/******/ (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] = {
/******/ exports: {},
/******/ id: moduleId,
/******/ loaded: false
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.loaded = 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;
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/*!******************!*\
!*** multi main ***!
\******************/
/***/ function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(/*! ./app/index.js */1);
/***/ },
/* 1 */
/*!**********************!*\
!*** ./app/index.js ***!
\**********************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _reactDom = __webpack_require__(/*! react-dom */ 33);
var _redux = __webpack_require__(/*! redux */ 179);
var _reactRedux = __webpack_require__(/*! react-redux */ 200);
var _reduxThunk = __webpack_require__(/*! redux-thunk */ 227);
var _reduxThunk2 = _interopRequireDefault(_reduxThunk);
var _Reducer = __webpack_require__(/*! Reducer */ 228);
var _Reducer2 = _interopRequireDefault(_Reducer);
var _DetailsStepContainer = __webpack_require__(/*! DetailsStepContainer */ 1064);
var _DetailsStepContainer2 = _interopRequireDefault(_DetailsStepContainer);
var _FileUploadContainer = __webpack_require__(/*! FileUploadContainer */ 1073);
var _FileUploadContainer2 = _interopRequireDefault(_FileUploadContainer);
var _PrimaryModalContainer = __webpack_require__(/*! PrimaryModalContainer */ 1077);
var _PrimaryModalContainer2 = _interopRequireDefault(_PrimaryModalContainer);
var _ProgressStepsContainer = __webpack_require__(/*! ProgressStepsContainer */ 1082);
var _ProgressStepsContainer2 = _interopRequireDefault(_ProgressStepsContainer);
var _StoStepContainer = __webpack_require__(/*! StoStepContainer */ 1085);
var _StoStepContainer2 = _interopRequireDefault(_StoStepContainer);
var _FinalStepContainer = __webpack_require__(/*! FinalStepContainer */ 1217);
var _FinalStepContainer2 = _interopRequireDefault(_FinalStepContainer);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || _redux.compose;
var store = (0, _redux.createStore)(_Reducer2.default, composeEnhancers((0, _redux.applyMiddleware)(_reduxThunk2.default)));
(0, _reactDom.render)(_react2.default.createElement(
_reactRedux.Provider,
{ store: store },
_react2.default.createElement(
_PrimaryModalContainer2.default,
null,
_react2.default.createElement(
_ProgressStepsContainer2.default,
null,
_react2.default.createElement(_DetailsStepContainer2.default, null),
_react2.default.createElement(_StoStepContainer2.default, null),
_react2.default.createElement(_FileUploadContainer2.default, null),
_react2.default.createElement(_FinalStepContainer2.default, null)
)
)
), document.getElementById('fastfile-modal'));
/***/ },
/* 2 */
/*!**************************!*\
!*** ./~/react/react.js ***!
\**************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
module.exports = __webpack_require__(/*! ./lib/React */ 3);
/***/ },
/* 3 */
/*!******************************!*\
!*** ./~/react/lib/React.js ***!
\******************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var _assign = __webpack_require__(/*! object-assign */ 5);
var ReactChildren = __webpack_require__(/*! ./ReactChildren */ 6);
var ReactComponent = __webpack_require__(/*! ./ReactComponent */ 19);
var ReactPureComponent = __webpack_require__(/*! ./ReactPureComponent */ 22);
var ReactClass = __webpack_require__(/*! ./ReactClass */ 23);
var ReactDOMFactories = __webpack_require__(/*! ./ReactDOMFactories */ 25);
var ReactElement = __webpack_require__(/*! ./ReactElement */ 10);
var ReactPropTypes = __webpack_require__(/*! ./ReactPropTypes */ 30);
var ReactVersion = __webpack_require__(/*! ./ReactVersion */ 31);
var onlyChild = __webpack_require__(/*! ./onlyChild */ 32);
var warning = __webpack_require__(/*! fbjs/lib/warning */ 12);
var createElement = ReactElement.createElement;
var createFactory = ReactElement.createFactory;
var cloneElement = ReactElement.cloneElement;
if (process.env.NODE_ENV !== 'production') {
var ReactElementValidator = __webpack_require__(/*! ./ReactElementValidator */ 26);
createElement = ReactElementValidator.createElement;
createFactory = ReactElementValidator.createFactory;
cloneElement = ReactElementValidator.cloneElement;
}
var __spread = _assign;
if (process.env.NODE_ENV !== 'production') {
var warned = false;
__spread = function () {
process.env.NODE_ENV !== 'production' ? warning(warned, 'React.__spread is deprecated and should not be used. Use ' + 'Object.assign directly or another helper function with similar ' + 'semantics. You may be seeing this warning due to your compiler. ' + 'See https://fb.me/react-spread-deprecation for more details.') : void 0;
warned = true;
return _assign.apply(null, arguments);
};
}
var React = {
// Modern
Children: {
map: ReactChildren.map,
forEach: ReactChildren.forEach,
count: ReactChildren.count,
toArray: ReactChildren.toArray,
only: onlyChild
},
Component: ReactComponent,
PureComponent: ReactPureComponent,
createElement: createElement,
cloneElement: cloneElement,
isValidElement: ReactElement.isValidElement,
// Classic
PropTypes: ReactPropTypes,
createClass: ReactClass.createClass,
createFactory: createFactory,
createMixin: function (mixin) {
// Currently a noop. Will be used to validate and trace mixins.
return mixin;
},
// This looks DOM specific but these are actually isomorphic helpers
// since they are just generating DOM strings.
DOM: ReactDOMFactories,
version: ReactVersion,
// Deprecated hook for JSX spread, don't use this for anything.
__spread: __spread
};
module.exports = React;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 4 */
/*!******************************!*\
!*** ./~/process/browser.js ***!
\******************************/
/***/ 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.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; };
/***/ },
/* 5 */
/*!**********************************!*\
!*** ./~/object-assign/index.js ***!
\**********************************/
/***/ function(module, exports) {
'use strict';
/* eslint-disable no-unused-vars */
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
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 (e) {
// 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 (Object.getOwnPropertySymbols) {
symbols = Object.getOwnPropertySymbols(from);
for (var i = 0; i < symbols.length; i++) {
if (propIsEnumerable.call(from, symbols[i])) {
to[symbols[i]] = from[symbols[i]];
}
}
}
}
return to;
};
/***/ },
/* 6 */
/*!**************************************!*\
!*** ./~/react/lib/ReactChildren.js ***!
\**************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var PooledClass = __webpack_require__(/*! ./PooledClass */ 7);
var ReactElement = __webpack_require__(/*! ./ReactElement */ 10);
var emptyFunction = __webpack_require__(/*! fbjs/lib/emptyFunction */ 13);
var traverseAllChildren = __webpack_require__(/*! ./traverseAllChildren */ 16);
var twoArgumentPooler = PooledClass.twoArgumentPooler;
var fourArgumentPooler = PooledClass.fourArgumentPooler;
var userProvidedKeyEscapeRegex = /\/+/g;
function escapeUserProvidedKey(text) {
return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/');
}
/**
* PooledClass representing the bookkeeping associated with performing a child
* traversal. Allows avoiding binding callbacks.
*
* @constructor ForEachBookKeeping
* @param {!function} forEachFunction Function to perform traversal with.
* @param {?*} forEachContext Context to perform context with.
*/
function ForEachBookKeeping(forEachFunction, forEachContext) {
this.func = forEachFunction;
this.context = forEachContext;
this.count = 0;
}
ForEachBookKeeping.prototype.destructor = function () {
this.func = null;
this.context = null;
this.count = 0;
};
PooledClass.addPoolingTo(ForEachBookKeeping, twoArgumentPooler);
function forEachSingleChild(bookKeeping, child, name) {
var func = bookKeeping.func,
context = bookKeeping.context;
func.call(context, child, bookKeeping.count++);
}
/**
* Iterates through children that are typically specified as `props.children`.
*
* See https://facebook.github.io/react/docs/top-level-api.html#react.children.foreach
*
* The provided forEachFunc(child, index) will be called for each
* leaf child.
*
* @param {?*} children Children tree container.
* @param {function(*, int)} forEachFunc
* @param {*} forEachContext Context for forEachContext.
*/
function forEachChildren(children, forEachFunc, forEachContext) {
if (children == null) {
return children;
}
var traverseContext = ForEachBookKeeping.getPooled(forEachFunc, forEachContext);
traverseAllChildren(children, forEachSingleChild, traverseContext);
ForEachBookKeeping.release(traverseContext);
}
/**
* PooledClass representing the bookkeeping associated with performing a child
* mapping. Allows avoiding binding callbacks.
*
* @constructor MapBookKeeping
* @param {!*} mapResult Object containing the ordered map of results.
* @param {!function} mapFunction Function to perform mapping with.
* @param {?*} mapContext Context to perform mapping with.
*/
function MapBookKeeping(mapResult, keyPrefix, mapFunction, mapContext) {
this.result = mapResult;
this.keyPrefix = keyPrefix;
this.func = mapFunction;
this.context = mapContext;
this.count = 0;
}
MapBookKeeping.prototype.destructor = function () {
this.result = null;
this.keyPrefix = null;
this.func = null;
this.context = null;
this.count = 0;
};
PooledClass.addPoolingTo(MapBookKeeping, fourArgumentPooler);
function mapSingleChildIntoContext(bookKeeping, child, childKey) {
var result = bookKeeping.result,
keyPrefix = bookKeeping.keyPrefix,
func = bookKeeping.func,
context = bookKeeping.context;
var mappedChild = func.call(context, child, bookKeeping.count++);
if (Array.isArray(mappedChild)) {
mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, emptyFunction.thatReturnsArgument);
} else if (mappedChild != null) {
if (ReactElement.isValidElement(mappedChild)) {
mappedChild = ReactElement.cloneAndReplaceKey(mappedChild,
// Keep both the (mapped) and old keys if they differ, just as
// traverseAllChildren used to do for objects as children
keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey);
}
result.push(mappedChild);
}
}
function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
var escapedPrefix = '';
if (prefix != null) {
escapedPrefix = escapeUserProvidedKey(prefix) + '/';
}
var traverseContext = MapBookKeeping.getPooled(array, escapedPrefix, func, context);
traverseAllChildren(children, mapSingleChildIntoContext, traverseContext);
MapBookKeeping.release(traverseContext);
}
/**
* Maps children that are typically specified as `props.children`.
*
* See https://facebook.github.io/react/docs/top-level-api.html#react.children.map
*
* The provided mapFunction(child, key, index) will be called for each
* leaf child.
*
* @param {?*} children Children tree container.
* @param {function(*, int)} func The map function.
* @param {*} context Context for mapFunction.
* @return {object} Object containing the ordered map of results.
*/
function mapChildren(children, func, context) {
if (children == null) {
return children;
}
var result = [];
mapIntoWithKeyPrefixInternal(children, result, null, func, context);
return result;
}
function forEachSingleChildDummy(traverseContext, child, name) {
return null;
}
/**
* Count the number of children that are typically specified as
* `props.children`.
*
* See https://facebook.github.io/react/docs/top-level-api.html#react.children.count
*
* @param {?*} children Children tree container.
* @return {number} The number of children.
*/
function countChildren(children, context) {
return traverseAllChildren(children, forEachSingleChildDummy, null);
}
/**
* Flatten a children object (typically specified as `props.children`) and
* return an array with appropriately re-keyed children.
*
* See https://facebook.github.io/react/docs/top-level-api.html#react.children.toarray
*/
function toArray(children) {
var result = [];
mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument);
return result;
}
var ReactChildren = {
forEach: forEachChildren,
map: mapChildren,
mapIntoWithKeyPrefixInternal: mapIntoWithKeyPrefixInternal,
count: countChildren,
toArray: toArray
};
module.exports = ReactChildren;
/***/ },
/* 7 */
/*!************************************!*\
!*** ./~/react/lib/PooledClass.js ***!
\************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
'use strict';
var _prodInvariant = __webpack_require__(/*! ./reactProdInvariant */ 8);
var invariant = __webpack_require__(/*! fbjs/lib/invariant */ 9);
/**
* Static poolers. Several custom versions for each potential number of
* arguments. A completely generic pooler is easy to implement, but would
* require accessing the `arguments` object. In each of these, `this` refers to
* the Class itself, not an instance. If any others are needed, simply add them
* here, or in their own files.
*/
var oneArgumentPooler = function (copyFieldsFrom) {
var Klass = this;
if (Klass.instancePool.length) {
var instance = Klass.instancePool.pop();
Klass.call(instance, copyFieldsFrom);
return instance;
} else {
return new Klass(copyFieldsFrom);
}
};
var twoArgumentPooler = function (a1, a2) {
var Klass = this;
if (Klass.instancePool.length) {
var instance = Klass.instancePool.pop();
Klass.call(instance, a1, a2);
return instance;
} else {
return new Klass(a1, a2);
}
};
var threeArgumentPooler = function (a1, a2, a3) {
var Klass = this;
if (Klass.instancePool.length) {
var instance = Klass.instancePool.pop();
Klass.call(instance, a1, a2, a3);
return instance;
} else {
return new Klass(a1, a2, a3);
}
};
var fourArgumentPooler = function (a1, a2, a3, a4) {
var Klass = this;
if (Klass.instancePool.length) {
var instance = Klass.instancePool.pop();
Klass.call(instance, a1, a2, a3, a4);
return instance;
} else {
return new Klass(a1, a2, a3, a4);
}
};
var standardReleaser = function (instance) {
var Klass = this;
!(instance instanceof Klass) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Trying to release an instance into a pool of a different type.') : _prodInvariant('25') : void 0;
instance.destructor();
if (Klass.instancePool.length < Klass.poolSize) {
Klass.instancePool.push(instance);
}
};
var DEFAULT_POOL_SIZE = 10;
var DEFAULT_POOLER = oneArgumentPooler;
/**
* Augments `CopyConstructor` to be a poolable class, augmenting only the class
* itself (statically) not adding any prototypical fields. Any CopyConstructor
* you give this may have a `poolSize` property, and will look for a
* prototypical `destructor` on instances.
*
* @param {Function} CopyConstructor Constructor that can be used to reset.
* @param {Function} pooler Customizable pooler.
*/
var addPoolingTo = function (CopyConstructor, pooler) {
// Casting as any so that flow ignores the actual implementation and trusts
// it to match the type we declared
var NewKlass = CopyConstructor;
NewKlass.instancePool = [];
NewKlass.getPooled = pooler || DEFAULT_POOLER;
if (!NewKlass.poolSize) {
NewKlass.poolSize = DEFAULT_POOL_SIZE;
}
NewKlass.release = standardReleaser;
return NewKlass;
};
var PooledClass = {
addPoolingTo: addPoolingTo,
oneArgumentPooler: oneArgumentPooler,
twoArgumentPooler: twoArgumentPooler,
threeArgumentPooler: threeArgumentPooler,
fourArgumentPooler: fourArgumentPooler
};
module.exports = PooledClass;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 8 */
/*!*******************************************!*\
!*** ./~/react/lib/reactProdInvariant.js ***!
\*******************************************/
/***/ function(module, exports) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
'use strict';
/**
* WARNING: DO NOT manually require this module.
* This is a replacement for `invariant(...)` used by the error code system
* and will _only_ be required by the corresponding babel pass.
* It always throws.
*/
function reactProdInvariant(code) {
var argCount = arguments.length - 1;
var message = 'Minified React error #' + code + '; visit ' + 'http://facebook.github.io/react/docs/error-decoder.html?invariant=' + code;
for (var argIdx = 0; argIdx < argCount; argIdx++) {
message += '&args[]=' + encodeURIComponent(arguments[argIdx + 1]);
}
message += ' for the full message or use the non-minified dev environment' + ' for full errors and additional helpful warnings.';
var error = new Error(message);
error.name = 'Invariant Violation';
error.framesToPop = 1; // we don't care about reactProdInvariant's own frame
throw error;
}
module.exports = reactProdInvariant;
/***/ },
/* 9 */
/*!*********************************!*\
!*** ./~/fbjs/lib/invariant.js ***!
\*********************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
/**
* Use invariant() to assert state which your program assumes to be true.
*
* Provide sprintf-style format (only %s is supported) and arguments
* to provide information about what broke and what you were
* expecting.
*
* The invariant message will be stripped in production, but the invariant
* will remain to ensure logic does not differ in production.
*/
var validateFormat = function validateFormat(format) {};
if (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__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 10 */
/*!*************************************!*\
!*** ./~/react/lib/ReactElement.js ***!
\*************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2014-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var _assign = __webpack_require__(/*! object-assign */ 5);
var ReactCurrentOwner = __webpack_require__(/*! ./ReactCurrentOwner */ 11);
var warning = __webpack_require__(/*! fbjs/lib/warning */ 12);
var canDefineProperty = __webpack_require__(/*! ./canDefineProperty */ 14);
var hasOwnProperty = Object.prototype.hasOwnProperty;
var REACT_ELEMENT_TYPE = __webpack_require__(/*! ./ReactElementSymbol */ 15);
var RESERVED_PROPS = {
key: true,
ref: true,
__self: true,
__source: true
};
var specialPropKeyWarningShown, specialPropRefWarningShown;
function hasValidRef(config) {
if (process.env.NODE_ENV !== 'production') {
if (hasOwnProperty.call(config, 'ref')) {
var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
if (getter && getter.isReactWarning) {
return false;
}
}
}
return config.ref !== undefined;
}
function hasValidKey(config) {
if (process.env.NODE_ENV !== 'production') {
if (hasOwnProperty.call(config, 'key')) {
var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
if (getter && getter.isReactWarning) {
return false;
}
}
}
return config.key !== undefined;
}
function defineKeyPropWarningGetter(props, displayName) {
var warnAboutAccessingKey = function () {
if (!specialPropKeyWarningShown) {
specialPropKeyWarningShown = true;
process.env.NODE_ENV !== 'production' ? warning(false, '%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName) : void 0;
}
};
warnAboutAccessingKey.isReactWarning = true;
Object.defineProperty(props, 'key', {
get: warnAboutAccessingKey,
configurable: true
});
}
function defineRefPropWarningGetter(props, displayName) {
var warnAboutAccessingRef = function () {
if (!specialPropRefWarningShown) {
specialPropRefWarningShown = true;
process.env.NODE_ENV !== 'production' ? warning(false, '%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName) : void 0;
}
};
warnAboutAccessingRef.isReactWarning = true;
Object.defineProperty(props, 'ref', {
get: warnAboutAccessingRef,
configurable: true
});
}
/**
* Factory method to create a new React element. This no longer adheres to
* the class pattern, so do not use new to call it. Also, no instanceof check
* will work. Instead test $$typeof field against Symbol.for('react.element') to check
* if something is a React Element.
*
* @param {*} type
* @param {*} key
* @param {string|object} ref
* @param {*} self A *temporary* helper to detect places where `this` is
* different from the `owner` when React.createElement is called, so that we
* can warn. We want to get rid of owner and replace string `ref`s with arrow
* functions, and as long as `this` and owner are the same, there will be no
* change in behavior.
* @param {*} source An annotation object (added by a transpiler or otherwise)
* indicating filename, line number, and/or other information.
* @param {*} owner
* @param {*} props
* @internal
*/
var ReactElement = function (type, key, ref, self, source, owner, props) {
var element = {
// This tag allow us to uniquely identify this as a React Element
$$typeof: REACT_ELEMENT_TYPE,
// Built-in properties that belong on the element
type: type,
key: key,
ref: ref,
props: props,
// Record the component responsible for creating this element.
_owner: owner
};
if (process.env.NODE_ENV !== 'production') {
// The validation flag is currently mutative. We put it on
// an external backing store so that we can freeze the whole object.
// This can be replaced with a WeakMap once they are implemented in
// commonly used development environments.
element._store = {};
// To make comparing ReactElements easier for testing purposes, we make
// the validation flag non-enumerable (where possible, which should
// include every environment we run tests in), so the test framework
// ignores it.
if (canDefineProperty) {
Object.defineProperty(element._store, 'validated', {
configurable: false,
enumerable: false,
writable: true,
value: false
});
// self and source are DEV only properties.
Object.defineProperty(element, '_self', {
configurable: false,
enumerable: false,
writable: false,
value: self
});
// Two elements created in two different places should be considered
// equal for testing purposes and therefore we hide it from enumeration.
Object.defineProperty(element, '_source', {
configurable: false,
enumerable: false,
writable: false,
value: source
});
} else {
element._store.validated = false;
element._self = self;
element._source = source;
}
if (Object.freeze) {
Object.freeze(element.props);
Object.freeze(element);
}
}
return element;
};
/**
* Create and return a new ReactElement of the given type.
* See https://facebook.github.io/react/docs/top-level-api.html#react.createelement
*/
ReactElement.createElement = function (type, config, children) {
var propName;
// Reserved names are extracted
var props = {};
var key = null;
var ref = null;
var self = null;
var source = null;
if (config != null) {
if (hasValidRef(config)) {
ref = config.ref;
}
if (hasValidKey(config)) {
key = '' + config.key;
}
self = config.__self === undefined ? null : config.__self;
source = config.__source === undefined ? null : config.__source;
// Remaining properties are added to a new props object
for (propName in config) {
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
props[propName] = config[propName];
}
}
}
// Children can be more than one argument, and those are transferred onto
// the newly allocated props object.
var childrenLength = arguments.length - 2;
if (childrenLength === 1) {
props.children = children;
} else if (childrenLength > 1) {
var childArray = Array(childrenLength);
for (var i = 0; i < childrenLength; i++) {
childArray[i] = arguments[i + 2];
}
if (process.env.NODE_ENV !== 'production') {
if (Object.freeze) {
Object.freeze(childArray);
}
}
props.children = childArray;
}
// Resolve default props
if (type && type.defaultProps) {
var defaultProps = type.defaultProps;
for (propName in defaultProps) {
if (props[propName] === undefined) {
props[propName] = defaultProps[propName];
}
}
}
if (process.env.NODE_ENV !== 'production') {
if (key || ref) {
if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {
var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
if (key) {
defineKeyPropWarningGetter(props, displayName);
}
if (ref) {
defineRefPropWarningGetter(props, displayName);
}
}
}
}
return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
};
/**
* Return a function that produces ReactElements of a given type.
* See https://facebook.github.io/react/docs/top-level-api.html#react.createfactory
*/
ReactElement.createFactory = function (type) {
var factory = ReactElement.createElement.bind(null, type);
// Expose the type on the factory and the prototype so that it can be
// easily accessed on elements. E.g. `<Foo />.type === Foo`.
// This should not be named `constructor` since this may not be the function
// that created the element, and it may not even be a constructor.
// Legacy hook TODO: Warn if this is accessed
factory.type = type;
return factory;
};
ReactElement.cloneAndReplaceKey = function (oldElement, newKey) {
var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
return newElement;
};
/**
* Clone and return a new ReactElement using element as the starting point.
* See https://facebook.github.io/react/docs/top-level-api.html#react.cloneelement
*/
ReactElement.cloneElement = function (element, config, children) {
var propName;
// Original props are copied
var props = _assign({}, element.props);
// Reserved names are extracted
var key = element.key;
var ref = element.ref;
// Self is preserved since the owner is preserved.
var self = element._self;
// Source is preserved since cloneElement is unlikely to be targeted by a
// transpiler, and the original source is probably a better indicator of the
// true owner.
var source = element._source;
// Owner will be preserved, unless ref is overridden
var owner = element._owner;
if (config != null) {
if (hasValidRef(config)) {
// Silently steal the ref from the parent.
ref = config.ref;
owner = ReactCurrentOwner.current;
}
if (hasValidKey(config)) {
key = '' + config.key;
}
// Remaining properties override existing props
var defaultProps;
if (element.type && element.type.defaultProps) {
defaultProps = element.type.defaultProps;
}
for (propName in config) {
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
if (config[propName] === undefined && defaultProps !== undefined) {
// Resolve default props
props[propName] = defaultProps[propName];
} else {
props[propName] = config[propName];
}
}
}
}
// Children can be more than one argument, and those are transferred onto
// the newly allocated props object.
var childrenLength = arguments.length - 2;
if (childrenLength === 1) {
props.children = children;
} else if (childrenLength > 1) {
var childArray = Array(childrenLength);
for (var i = 0; i < childrenLength; i++) {
childArray[i] = arguments[i + 2];
}
props.children = childArray;
}
return ReactElement(element.type, key, ref, self, source, owner, props);
};
/**
* Verifies the object is a ReactElement.
* See https://facebook.github.io/react/docs/top-level-api.html#react.isvalidelement
* @param {?object} object
* @return {boolean} True if `object` is a valid component.
* @final
*/
ReactElement.isValidElement = function (object) {
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
};
module.exports = ReactElement;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 11 */
/*!******************************************!*\
!*** ./~/react/lib/ReactCurrentOwner.js ***!
\******************************************/
/***/ function(module, exports) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
'use strict';
/**
* Keeps track of the current owner.
*
* The current owner is the component who should own any components that are
* currently being constructed.
*/
var ReactCurrentOwner = {
/**
* @internal
* @type {ReactComponent}
*/
current: null
};
module.exports = ReactCurrentOwner;
/***/ },
/* 12 */
/*!*******************************!*\
!*** ./~/fbjs/lib/warning.js ***!
\*******************************/
/***/ function(module, exports, __webpack_require__) {
/* 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.
*
*/
'use strict';
var emptyFunction = __webpack_require__(/*! ./emptyFunction */ 13);
/**
* 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') {
(function () {
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__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 13 */
/*!*************************************!*\
!*** ./~/fbjs/lib/emptyFunction.js ***!
\*************************************/
/***/ function(module, exports) {
"use strict";
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
function makeEmptyFunction(arg) {
return function () {
return arg;
};
}
/**
* This function accepts and discards inputs; it has no side effects. This is
* primarily useful idiomatically for overridable function endpoints which
* always need to be callable, since JS lacks a null-call idiom ala Cocoa.
*/
var emptyFunction = function emptyFunction() {};
emptyFunction.thatReturns = makeEmptyFunction;
emptyFunction.thatReturnsFalse = makeEmptyFunction(false);
emptyFunction.thatReturnsTrue = makeEmptyFunction(true);
emptyFunction.thatReturnsNull = makeEmptyFunction(null);
emptyFunction.thatReturnsThis = function () {
return this;
};
emptyFunction.thatReturnsArgument = function (arg) {
return arg;
};
module.exports = emptyFunction;
/***/ },
/* 14 */
/*!******************************************!*\
!*** ./~/react/lib/canDefineProperty.js ***!
\******************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
'use strict';
var canDefineProperty = false;
if (process.env.NODE_ENV !== 'production') {
try {
// $FlowFixMe https://github.com/facebook/flow/issues/285
Object.defineProperty({}, 'x', { get: function () {} });
canDefineProperty = true;
} catch (x) {
// IE will fail on defineProperty
}
}
module.exports = canDefineProperty;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 15 */
/*!*******************************************!*\
!*** ./~/react/lib/ReactElementSymbol.js ***!
\*******************************************/
/***/ function(module, exports) {
/**
* Copyright 2014-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
'use strict';
// The Symbol used to tag the ReactElement type. If there is no native Symbol
// nor polyfill, then a plain number is used for performance.
var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7;
module.exports = REACT_ELEMENT_TYPE;
/***/ },
/* 16 */
/*!********************************************!*\
!*** ./~/react/lib/traverseAllChildren.js ***!
\********************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var _prodInvariant = __webpack_require__(/*! ./reactProdInvariant */ 8);
var ReactCurrentOwner = __webpack_require__(/*! ./ReactCurrentOwner */ 11);
var REACT_ELEMENT_TYPE = __webpack_require__(/*! ./ReactElementSymbol */ 15);
var getIteratorFn = __webpack_require__(/*! ./getIteratorFn */ 17);
var invariant = __webpack_require__(/*! fbjs/lib/invariant */ 9);
var KeyEscapeUtils = __webpack_require__(/*! ./KeyEscapeUtils */ 18);
var warning = __webpack_require__(/*! fbjs/lib/warning */ 12);
var SEPARATOR = '.';
var SUBSEPARATOR = ':';
/**
* This is inlined from ReactElement since this file is shared between
* isomorphic and renderers. We could extract this to a
*
*/
/**
* TODO: Test that a single child and an array with one item have the same key
* pattern.
*/
var didWarnAboutMaps = false;
/**
* Generate a key string that identifies a component within a set.
*
* @param {*} component A component that could contain a manual key.
* @param {number} index Index that is used if a manual key is not provided.
* @return {string}
*/
function getComponentKey(component, index) {
// Do some typechecking here since we call this blindly. We want to ensure
// that we don't block potential future ES APIs.
if (component && typeof component === 'object' && component.key != null) {
// Explicit key
return KeyEscapeUtils.escape(component.key);
}
// Implicit key determined by the index in the set
return index.toString(36);
}
/**
* @param {?*} children Children tree container.
* @param {!string} nameSoFar Name of the key path so far.
* @param {!function} callback Callback to invoke with each child found.
* @param {?*} traverseContext Used to pass information throughout the traversal
* process.
* @return {!number} The number of children in this subtree.
*/
function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
var type = typeof children;
if (type === 'undefined' || type === 'boolean') {
// All of the above are perceived as null.
children = null;
}
if (children === null || type === 'string' || type === 'number' ||
// The following is inlined from ReactElement. This means we can optimize
// some checks. React Fiber also inlines this logic for similar purposes.
type === 'object' && children.$$typeof === REACT_ELEMENT_TYPE) {
callback(traverseContext, children,
// If it's the only child, treat the name as if it was wrapped in an array
// so that it's consistent if the number of children grows.
nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);
return 1;
}
var child;
var nextName;
var subtreeCount = 0; // Count of children found in the current subtree.
var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
if (Array.isArray(children)) {
for (var i = 0; i < children.length; i++) {
child = children[i];
nextName = nextNamePrefix + getComponentKey(child, i);
subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
}
} else {
var iteratorFn = getIteratorFn(children);
if (iteratorFn) {
var iterator = iteratorFn.call(children);
var step;
if (iteratorFn !== children.entries) {
var ii = 0;
while (!(step = iterator.next()).done) {
child = step.value;
nextName = nextNamePrefix + getComponentKey(child, ii++);
subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
}
} else {
if (process.env.NODE_ENV !== 'production') {
var mapsAsChildrenAddendum = '';
if (ReactCurrentOwner.current) {
var mapsAsChildrenOwnerName = ReactCurrentOwner.current.getName();
if (mapsAsChildrenOwnerName) {
mapsAsChildrenAddendum = ' Check the render method of `' + mapsAsChildrenOwnerName + '`.';
}
}
process.env.NODE_ENV !== 'production' ? warning(didWarnAboutMaps, 'Using Maps as children is not yet fully supported. It is an ' + 'experimental feature that might be removed. Convert it to a ' + 'sequence / iterable of keyed ReactElements instead.%s', mapsAsChildrenAddendum) : void 0;
didWarnAboutMaps = true;
}
// Iterator will provide entry [k,v] tuples rather than values.
while (!(step = iterator.next()).done) {
var entry = step.value;
if (entry) {
child = entry[1];
nextName = nextNamePrefix + KeyEscapeUtils.escape(entry[0]) + SUBSEPARATOR + getComponentKey(child, 0);
subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
}
}
}
} else if (type === 'object') {
var addendum = '';
if (process.env.NODE_ENV !== 'production') {
addendum = ' If you meant to render a collection of children, use an array ' + 'instead or wrap the object using createFragment(object) from the ' + 'React add-ons.';
if (children._isReactElement) {
addendum = ' It looks like you\'re using an element created by a different ' + 'version of React. Make sure to use only one copy of React.';
}
if (ReactCurrentOwner.current) {
var name = ReactCurrentOwner.current.getName();
if (name) {
addendum += ' Check the render method of `' + name + '`.';
}
}
}
var childrenString = String(children);
true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Objects are not valid as a React child (found: %s).%s', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : _prodInvariant('31', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : void 0;
}
}
return subtreeCount;
}
/**
* Traverses children that are typically specified as `props.children`, but
* might also be specified through attributes:
*
* - `traverseAllChildren(this.props.children, ...)`
* - `traverseAllChildren(this.props.leftPanelChildren, ...)`
*
* The `traverseContext` is an optional argument that is passed through the
* entire traversal. It can be used to store accumulations or anything else that
* the callback might find relevant.
*
* @param {?*} children Children tree object.
* @param {!function} callback To invoke upon traversing each child.
* @param {?*} traverseContext Context for traversal.
* @return {!number} The number of children in this subtree.
*/
function traverseAllChildren(children, callback, traverseContext) {
if (children == null) {
return 0;
}
return traverseAllChildrenImpl(children, '', callback, traverseContext);
}
module.exports = traverseAllChildren;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 17 */
/*!**************************************!*\
!*** ./~/react/lib/getIteratorFn.js ***!
\**************************************/
/***/ function(module, exports) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
'use strict';
/* global Symbol */
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
/**
* Returns the iterator method function contained on the iterable object.
*
* Be sure to invoke the function with the iterable as context:
*
* var iteratorFn = getIteratorFn(myIterable);
* if (iteratorFn) {
* var iterator = iteratorFn.call(myIterable);
* ...
* }
*
* @param {?object} maybeIterable
* @return {?function}
*/
function getIteratorFn(maybeIterable) {
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
if (typeof iteratorFn === 'function') {
return iteratorFn;
}
}
module.exports = getIteratorFn;
/***/ },
/* 18 */
/*!***************************************!*\
!*** ./~/react/lib/KeyEscapeUtils.js ***!
\***************************************/
/***/ function(module, exports) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
'use strict';
/**
* Escape and wrap key so it is safe to use as a reactid
*
* @param {string} key to be escaped.
* @return {string} the escaped key.
*/
function escape(key) {
var escapeRegex = /[=:]/g;
var escaperLookup = {
'=': '=0',
':': '=2'
};
var escapedString = ('' + key).replace(escapeRegex, function (match) {
return escaperLookup[match];
});
return '$' + escapedString;
}
/**
* Unescape and unwrap key for human-readable display
*
* @param {string} key to unescape.
* @return {string} the unescaped key.
*/
function unescape(key) {
var unescapeRegex = /(=0|=2)/g;
var unescaperLookup = {
'=0': '=',
'=2': ':'
};
var keySubstring = key[0] === '.' && key[1] === '$' ? key.substring(2) : key.substring(1);
return ('' + keySubstring).replace(unescapeRegex, function (match) {
return unescaperLookup[match];
});
}
var KeyEscapeUtils = {
escape: escape,
unescape: unescape
};
module.exports = KeyEscapeUtils;
/***/ },
/* 19 */
/*!***************************************!*\
!*** ./~/react/lib/ReactComponent.js ***!
\***************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var _prodInvariant = __webpack_require__(/*! ./reactProdInvariant */ 8);
var ReactNoopUpdateQueue = __webpack_require__(/*! ./ReactNoopUpdateQueue */ 20);
var canDefineProperty = __webpack_require__(/*! ./canDefineProperty */ 14);
var emptyObject = __webpack_require__(/*! fbjs/lib/emptyObject */ 21);
var invariant = __webpack_require__(/*! fbjs/lib/invariant */ 9);
var warning = __webpack_require__(/*! fbjs/lib/warning */ 12);
/**
* Base class helpers for the updating state of a component.
*/
function ReactComponent(props, context, updater) {
this.props = props;
this.context = context;
this.refs = emptyObject;
// We initialize the default updater but the real one gets injected by the
// renderer.
this.updater = updater || ReactNoopUpdateQueue;
}
ReactComponent.prototype.isReactComponent = {};
/**
* Sets a subset of the state. Always use this to mutate
* state. You should treat `this.state` as immutable.
*
* There is no guarantee that `this.state` will be immediately updated, so
* accessing `this.state` after calling this method may return the old value.
*
* There is no guarantee that calls to `setState` will run synchronously,
* as they may eventually be batched together. You can provide an optional
* callback that will be executed when the call to setState is actually
* completed.
*
* When a function is provided to setState, it will be called at some point in
* the future (not synchronously). It will be called with the up to date
* component arguments (state, props, context). These values can be different
* from this.* because your function may be called after receiveProps but before
* shouldComponentUpdate, and this new state, props, and context will not yet be
* assigned to this.
*
* @param {object|function} partialState Next partial state or function to
* produce next partial state to be merged with current state.
* @param {?function} callback Called after state is updated.
* @final
* @protected
*/
ReactComponent.prototype.setState = function (partialState, callback) {
!(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'setState(...): takes an object of state variables to update or a function which returns an object of state variables.') : _prodInvariant('85') : void 0;
this.updater.enqueueSetState(this, partialState);
if (callback) {
this.updater.enqueueCallback(this, callback, 'setState');
}
};
/**
* Forces an update. This should only be invoked when it is known with
* certainty that we are **not** in a DOM transaction.
*
* You may want to call this when you know that some deeper aspect of the
* component's state has changed but `setState` was not called.
*
* This will not invoke `shouldComponentUpdate`, but it will invoke
* `componentWillUpdate` and `componentDidUpdate`.
*
* @param {?function} callback Called after update is complete.
* @final
* @protected
*/
ReactComponent.prototype.forceUpdate = function (callback) {
this.updater.enqueueForceUpdate(this);
if (callback) {
this.updater.enqueueCallback(this, callback, 'forceUpdate');
}
};
/**
* Deprecated APIs. These APIs used to exist on classic React classes but since
* we would like to deprecate them, we're not going to move them over to this
* modern base class. Instead, we define a getter that warns if it's accessed.
*/
if (process.env.NODE_ENV !== 'production') {
var deprecatedAPIs = {
isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
};
var defineDeprecationWarning = function (methodName, info) {
if (canDefineProperty) {
Object.defineProperty(ReactComponent.prototype, methodName, {
get: function () {
process.env.NODE_ENV !== 'production' ? warning(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]) : void 0;
return undefined;
}
});
}
};
for (var fnName in deprecatedAPIs) {
if (deprecatedAPIs.hasOwnProperty(fnName)) {
defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
}
}
}
module.exports = ReactComponent;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 20 */
/*!*********************************************!*\
!*** ./~/react/lib/ReactNoopUpdateQueue.js ***!
\*********************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var warning = __webpack_require__(/*! fbjs/lib/warning */ 12);
function warnNoop(publicInstance, callerName) {
if (process.env.NODE_ENV !== 'production') {
var constructor = publicInstance.constructor;
process.env.NODE_ENV !== 'production' ? warning(false, '%s(...): Can only update a mounted or mounting component. ' + 'This usually means you called %s() on an unmounted component. ' + 'This is a no-op. Please check the code for the %s component.', callerName, callerName, constructor && (constructor.displayName || constructor.name) || 'ReactClass') : void 0;
}
}
/**
* This is the abstract API for an update queue.
*/
var ReactNoopUpdateQueue = {
/**
* Checks whether or not this composite component is mounted.
* @param {ReactClass} publicInstance The instance we want to test.
* @return {boolean} True if mounted, false otherwise.
* @protected
* @final
*/
isMounted: function (publicInstance) {
return false;
},
/**
* Enqueue a callback that will be executed after all the pending updates
* have processed.
*
* @param {ReactClass} publicInstance The instance to use as `this` context.
* @param {?function} callback Called after state is updated.
* @internal
*/
enqueueCallback: function (publicInstance, callback) {},
/**
* Forces an update. This should only be invoked when it is known with
* certainty that we are **not** in a DOM transaction.
*
* You may want to call this when you know that some deeper aspect of the
* component's state has changed but `setState` was not called.
*
* This will not invoke `shouldComponentUpdate`, but it will invoke
* `componentWillUpdate` and `componentDidUpdate`.
*
* @param {ReactClass} publicInstance The instance that should rerender.
* @internal
*/
enqueueForceUpdate: function (publicInstance) {
warnNoop(publicInstance, 'forceUpdate');
},
/**
* Replaces all of the state. Always use this or `setState` to mutate state.
* You should treat `this.state` as immutable.
*
* There is no guarantee that `this.state` will be immediately updated, so
* accessing `this.state` after calling this method may return the old value.
*
* @param {ReactClass} publicInstance The instance that should rerender.
* @param {object} completeState Next state.
* @internal
*/
enqueueReplaceState: function (publicInstance, completeState) {
warnNoop(publicInstance, 'replaceState');
},
/**
* Sets a subset of the state. This only exists because _pendingState is
* internal. This provides a merging strategy that is not available to deep
* properties which is confusing. TODO: Expose pendingState or don't use it
* during the merge.
*
* @param {ReactClass} publicInstance The instance that should rerender.
* @param {object} partialState Next partial state to be merged with state.
* @internal
*/
enqueueSetState: function (publicInstance, partialState) {
warnNoop(publicInstance, 'setState');
}
};
module.exports = ReactNoopUpdateQueue;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 21 */
/*!***********************************!*\
!*** ./~/fbjs/lib/emptyObject.js ***!
\***********************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var emptyObject = {};
if (process.env.NODE_ENV !== 'production') {
Object.freeze(emptyObject);
}
module.exports = emptyObject;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 22 */
/*!*******************************************!*\
!*** ./~/react/lib/ReactPureComponent.js ***!
\*******************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var _assign = __webpack_require__(/*! object-assign */ 5);
var ReactComponent = __webpack_require__(/*! ./ReactComponent */ 19);
var ReactNoopUpdateQueue = __webpack_require__(/*! ./ReactNoopUpdateQueue */ 20);
var emptyObject = __webpack_require__(/*! fbjs/lib/emptyObject */ 21);
/**
* Base class helpers for the updating state of a component.
*/
function ReactPureComponent(props, context, updater) {
// Duplicated from ReactComponent.
this.props = props;
this.context = context;
this.refs = emptyObject;
// We initialize the default updater but the real one gets injected by the
// renderer.
this.updater = updater || ReactNoopUpdateQueue;
}
function ComponentDummy() {}
ComponentDummy.prototype = ReactComponent.prototype;
ReactPureComponent.prototype = new ComponentDummy();
ReactPureComponent.prototype.constructor = ReactPureComponent;
// Avoid an extra prototype jump for these methods.
_assign(ReactPureComponent.prototype, ReactComponent.prototype);
ReactPureComponent.prototype.isPureReactComponent = true;
module.exports = ReactPureComponent;
/***/ },
/* 23 */
/*!***********************************!*\
!*** ./~/react/lib/ReactClass.js ***!
\***********************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var _prodInvariant = __webpack_require__(/*! ./reactProdInvariant */ 8),
_assign = __webpack_require__(/*! object-assign */ 5);
var ReactComponent = __webpack_require__(/*! ./ReactComponent */ 19);
var ReactElement = __webpack_require__(/*! ./ReactElement */ 10);
var ReactPropTypeLocationNames = __webpack_require__(/*! ./ReactPropTypeLocationNames */ 24);
var ReactNoopUpdateQueue = __webpack_require__(/*! ./ReactNoopUpdateQueue */ 20);
var emptyObject = __webpack_require__(/*! fbjs/lib/emptyObject */ 21);
var invariant = __webpack_require__(/*! fbjs/lib/invariant */ 9);
var warning = __webpack_require__(/*! fbjs/lib/warning */ 12);
var MIXINS_KEY = 'mixins';
// Helper function to allow the creation of anonymous functions which do not
// have .name set to the name of the variable being assigned to.
function identity(fn) {
return fn;
}
/**
* Policies that describe methods in `ReactClassInterface`.
*/
var injectedMixins = [];
/**
* Composite components are higher-level components that compose other composite
* or host components.
*
* To create a new type of `ReactClass`, pass a specification of
* your new class to `React.createClass`. The only requirement of your class
* specification is that you implement a `render` method.
*
* var MyComponent = React.createClass({
* render: function() {
* return <div>Hello World</div>;
* }
* });
*
* The class specification supports a specific protocol of methods that have
* special meaning (e.g. `render`). See `ReactClassInterface` for
* more the comprehensive protocol. Any other properties and methods in the
* class specification will be available on the prototype.
*
* @interface ReactClassInterface
* @internal
*/
var ReactClassInterface = {
/**
* An array of Mixin objects to include when defining your component.
*
* @type {array}
* @optional
*/
mixins: 'DEFINE_MANY',
/**
* An object containing properties and methods that should be defined on
* the component's constructor instead of its prototype (static methods).
*
* @type {object}
* @optional
*/
statics: 'DEFINE_MANY',
/**
* Definition of prop types for this component.
*
* @type {object}
* @optional
*/
propTypes: 'DEFINE_MANY',
/**
* Definition of context types for this component.
*
* @type {object}
* @optional
*/
contextTypes: 'DEFINE_MANY',
/**
* Definition of context types this component sets for its children.
*
* @type {object}
* @optional
*/
childContextTypes: 'DEFINE_MANY',
// ==== Definition methods ====
/**
* Invoked when the component is mounted. Values in the mapping will be set on
* `this.props` if that prop is not specified (i.e. using an `in` check).
*
* This method is invoked before `getInitialState` and therefore cannot rely
* on `this.state` or use `this.setState`.
*
* @return {object}
* @optional
*/
getDefaultProps: 'DEFINE_MANY_MERGED',
/**
* Invoked once before the component is mounted. The return value will be used
* as the initial value of `this.state`.
*
* getInitialState: function() {
* return {
* isOn: false,
* fooBaz: new BazFoo()
* }
* }
*
* @return {object}
* @optional
*/
getInitialState: 'DEFINE_MANY_MERGED',
/**
* @return {object}
* @optional
*/
getChildContext: 'DEFINE_MANY_MERGED',
/**
* Uses props from `this.props` and state from `this.state` to render the
* structure of the component.
*
* No guarantees are made about when or how often this method is invoked, so
* it must not have side effects.
*
* render: function() {
* var name = this.props.name;
* return <div>Hello, {name}!</div>;
* }
*
* @return {ReactComponent}
* @nosideeffects
* @required
*/
render: 'DEFINE_ONCE',
// ==== Delegate methods ====
/**
* Invoked when the component is initially created and about to be mounted.
* This may have side effects, but any external subscriptions or data created
* by this method must be cleaned up in `componentWillUnmount`.
*
* @optional
*/
componentWillMount: 'DEFINE_MANY',
/**
* Invoked when the component has been mounted and has a DOM representation.
* However, there is no guarantee that the DOM node is in the document.
*
* Use this as an opportunity to operate on the DOM when the component has
* been mounted (initialized and rendered) for the first time.
*
* @param {DOMElement} rootNode DOM element representing the component.
* @optional
*/
componentDidMount: 'DEFINE_MANY',
/**
* Invoked before the component receives new props.
*
* Use this as an opportunity to react to a prop transition by updating the
* state using `this.setState`. Current props are accessed via `this.props`.
*
* componentWillReceiveProps: function(nextProps, nextContext) {
* this.setState({
* likesIncreasing: nextProps.likeCount > this.props.likeCount
* });
* }
*
* NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop
* transition may cause a state change, but the opposite is not true. If you
* need it, you are probably looking for `componentWillUpdate`.
*
* @param {object} nextProps
* @optional
*/
componentWillReceiveProps: 'DEFINE_MANY',
/**
* Invoked while deciding if the component should be updated as a result of
* receiving new props, state and/or context.
*
* Use this as an opportunity to `return false` when you're certain that the
* transition to the new props/state/context will not require a component
* update.
*
* shouldComponentUpdate: function(nextProps, nextState, nextContext) {
* return !equal(nextProps, this.props) ||
* !equal(nextState, this.state) ||
* !equal(nextContext, this.context);
* }
*
* @param {object} nextProps
* @param {?object} nextState
* @param {?object} nextContext
* @return {boolean} True if the component should update.
* @optional
*/
shouldComponentUpdate: 'DEFINE_ONCE',
/**
* Invoked when the component is about to update due to a transition from
* `this.props`, `this.state` and `this.context` to `nextProps`, `nextState`
* and `nextContext`.
*
* Use this as an opportunity to perform preparation before an update occurs.
*
* NOTE: You **cannot** use `this.setState()` in this method.
*
* @param {object} nextProps
* @param {?object} nextState
* @param {?object} nextContext
* @param {ReactReconcileTransaction} transaction
* @optional
*/
componentWillUpdate: 'DEFINE_MANY',
/**
* Invoked when the component's DOM representation has been updated.
*
* Use this as an opportunity to operate on the DOM when the component has
* been updated.
*
* @param {object} prevProps
* @param {?object} prevState
* @param {?object} prevContext
* @param {DOMElement} rootNode DOM element representing the component.
* @optional
*/
componentDidUpdate: 'DEFINE_MANY',
/**
* Invoked when the component is about to be removed from its parent and have
* its DOM representation destroyed.
*
* Use this as an opportunity to deallocate any external resources.
*
* NOTE: There is no `componentDidUnmount` since your component will have been
* destroyed by that point.
*
* @optional
*/
componentWillUnmount: 'DEFINE_MANY',
// ==== Advanced methods ====
/**
* Updates the component's currently mounted DOM representation.
*
* By default, this implements React's rendering and reconciliation algorithm.
* Sophisticated clients may wish to override this.
*
* @param {ReactReconcileTransaction} transaction
* @internal
* @overridable
*/
updateComponent: 'OVERRIDE_BASE'
};
/**
* Mapping from class specification keys to special processing functions.
*
* Although these are declared like instance properties in the specification
* when defining classes using `React.createClass`, they are actually static
* and are accessible on the constructor instead of the prototype. Despite
* being static, they must be defined outside of the "statics" key under
* which all other static methods are defined.
*/
var RESERVED_SPEC_KEYS = {
displayName: function (Constructor, displayName) {
Constructor.displayName = displayName;
},
mixins: function (Constructor, mixins) {
if (mixins) {
for (var i = 0; i < mixins.length; i++) {
mixSpecIntoComponent(Constructor, mixins[i]);
}
}
},
childContextTypes: function (Constructor, childContextTypes) {
if (process.env.NODE_ENV !== 'production') {
validateTypeDef(Constructor, childContextTypes, 'childContext');
}
Constructor.childContextTypes = _assign({}, Constructor.childContextTypes, childContextTypes);
},
contextTypes: function (Constructor, contextTypes) {
if (process.env.NODE_ENV !== 'production') {
validateTypeDef(Constructor, contextTypes, 'context');
}
Constructor.contextTypes = _assign({}, Constructor.contextTypes, contextTypes);
},
/**
* Special case getDefaultProps which should move into statics but requires
* automatic merging.
*/
getDefaultProps: function (Constructor, getDefaultProps) {
if (Constructor.getDefaultProps) {
Constructor.getDefaultProps = createMergedResultFunction(Constructor.getDefaultProps, getDefaultProps);
} else {
Constructor.getDefaultProps = getDefaultProps;
}
},
propTypes: function (Constructor, propTypes) {
if (process.env.NODE_ENV !== 'production') {
validateTypeDef(Constructor, propTypes, 'prop');
}
Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes);
},
statics: function (Constructor, statics) {
mixStaticSpecIntoComponent(Constructor, statics);
},
autobind: function () {} };
function validateTypeDef(Constructor, typeDef, location) {
for (var propName in typeDef) {
if (typeDef.hasOwnProperty(propName)) {
// use a warning instead of an invariant so components
// don't show up in prod but only in __DEV__
process.env.NODE_ENV !== 'production' ? warning(typeof typeDef[propName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', Constructor.displayName || 'ReactClass', ReactPropTypeLocationNames[location], propName) : void 0;
}
}
}
function validateMethodOverride(isAlreadyDefined, name) {
var specPolicy = ReactClassInterface.hasOwnProperty(name) ? ReactClassInterface[name] : null;
// Disallow overriding of base class methods unless explicitly allowed.
if (ReactClassMixin.hasOwnProperty(name)) {
!(specPolicy === 'OVERRIDE_BASE') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.', name) : _prodInvariant('73', name) : void 0;
}
// Disallow defining methods more than once unless explicitly allowed.
if (isAlreadyDefined) {
!(specPolicy === 'DEFINE_MANY' || specPolicy === 'DEFINE_MANY_MERGED') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.', name) : _prodInvariant('74', name) : void 0;
}
}
/**
* Mixin helper which handles policy validation and reserved
* specification keys when building React classes.
*/
function mixSpecIntoComponent(Constructor, spec) {
if (!spec) {
if (process.env.NODE_ENV !== 'production') {
var typeofSpec = typeof spec;
var isMixinValid = typeofSpec === 'object' && spec !== null;
process.env.NODE_ENV !== 'production' ? warning(isMixinValid, '%s: You\'re attempting to include a mixin that is either null ' + 'or not an object. Check the mixins included by the component, ' + 'as well as any mixins they include themselves. ' + 'Expected object but got %s.', Constructor.displayName || 'ReactClass', spec === null ? null : typeofSpec) : void 0;
}
return;
}
!(typeof spec !== 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You\'re attempting to use a component class or function as a mixin. Instead, just use a regular object.') : _prodInvariant('75') : void 0;
!!ReactElement.isValidElement(spec) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You\'re attempting to use a component as a mixin. Instead, just use a regular object.') : _prodInvariant('76') : void 0;
var proto = Constructor.prototype;
var autoBindPairs = proto.__reactAutoBindPairs;
// By handling mixins before any other properties, we ensure the same
// chaining order is applied to methods with DEFINE_MANY policy, whether
// mixins are listed before or after these methods in the spec.
if (spec.hasOwnProperty(MIXINS_KEY)) {
RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins);
}
for (var name in spec) {
if (!spec.hasOwnProperty(name)) {
continue;
}
if (name === MIXINS_KEY) {
// We have already handled mixins in a special case above.
continue;
}
var property = spec[name];
var isAlreadyDefined = proto.hasOwnProperty(name);
validateMethodOverride(isAlreadyDefined, name);
if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) {
RESERVED_SPEC_KEYS[name](Constructor, property);
} else {
// Setup methods on prototype:
// The following member methods should not be automatically bound:
// 1. Expected ReactClass methods (in the "interface").
// 2. Overridden methods (that were mixed in).
var isReactClassMethod = ReactClassInterface.hasOwnProperty(name);
var isFunction = typeof property === 'function';
var shouldAutoBind = isFunction && !isReactClassMethod && !isAlreadyDefined && spec.autobind !== false;
if (shouldAutoBind) {
autoBindPairs.push(name, property);
proto[name] = property;
} else {
if (isAlreadyDefined) {
var specPolicy = ReactClassInterface[name];
// These cases should already be caught by validateMethodOverride.
!(isReactClassMethod && (specPolicy === 'DEFINE_MANY_MERGED' || specPolicy === 'DEFINE_MANY')) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.', specPolicy, name) : _prodInvariant('77', specPolicy, name) : void 0;
// For methods which are defined more than once, call the existing
// methods before calling the new property, merging if appropriate.
if (specPolicy === 'DEFINE_MANY_MERGED') {
proto[name] = createMergedResultFunction(proto[name], property);
} else if (specPolicy === 'DEFINE_MANY') {
proto[name] = createChainedFunction(proto[name], property);
}
} else {
proto[name] = property;
if (process.env.NODE_ENV !== 'production') {
// Add verbose displayName to the function, which helps when looking
// at profiling tools.
if (typeof property === 'function' && spec.displayName) {
proto[name].displayName = spec.displayName + '_' + name;
}
}
}
}
}
}
}
function mixStaticSpecIntoComponent(Constructor, statics) {
if (!statics) {
return;
}
for (var name in statics) {
var property = statics[name];
if (!statics.hasOwnProperty(name)) {
continue;
}
var isReserved = name in RESERVED_SPEC_KEYS;
!!isReserved ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.', name) : _prodInvariant('78', name) : void 0;
var isInherited = name in Constructor;
!!isInherited ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.', name) : _prodInvariant('79', name) : void 0;
Constructor[name] = property;
}
}
/**
* Merge two objects, but throw if both contain the same key.
*
* @param {object} one The first object, which is mutated.
* @param {object} two The second object
* @return {object} one after it has been mutated to contain everything in two.
*/
function mergeIntoWithNoDuplicateKeys(one, two) {
!(one && two && typeof one === 'object' && typeof two === 'object') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.') : _prodInvariant('80') : void 0;
for (var key in two) {
if (two.hasOwnProperty(key)) {
!(one[key] === undefined) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.', key) : _prodInvariant('81', key) : void 0;
one[key] = two[key];
}
}
return one;
}
/**
* Creates a function that invokes two functions and merges their return values.
*
* @param {function} one Function to invoke first.
* @param {function} two Function to invoke second.
* @return {function} Function that invokes the two argument functions.
* @private
*/
function createMergedResultFunction(one, two) {
return function mergedResult() {
var a = one.apply(this, arguments);
var b = two.apply(this, arguments);
if (a == null) {
return b;
} else if (b == null) {
return a;
}
var c = {};
mergeIntoWithNoDuplicateKeys(c, a);
mergeIntoWithNoDuplicateKeys(c, b);
return c;
};
}
/**
* Creates a function that invokes two functions and ignores their return vales.
*
* @param {function} one Function to invoke first.
* @param {function} two Function to invoke second.
* @return {function} Function that invokes the two argument functions.
* @private
*/
function createChainedFunction(one, two) {
return function chainedFunction() {
one.apply(this, arguments);
two.apply(this, arguments);
};
}
/**
* Binds a method to the component.
*
* @param {object} component Component whose method is going to be bound.
* @param {function} method Method to be bound.
* @return {function} The bound method.
*/
function bindAutoBindMethod(component, method) {
var boundMethod = method.bind(component);
if (process.env.NODE_ENV !== 'production') {
boundMethod.__reactBoundContext = component;
boundMethod.__reactBoundMethod = method;
boundMethod.__reactBoundArguments = null;
var componentName = component.constructor.displayName;
var _bind = boundMethod.bind;
boundMethod.bind = function (newThis) {
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
// User is trying to bind() an autobound method; we effectively will
// ignore the value of "this" that the user is trying to use, so
// let's warn.
if (newThis !== component && newThis !== null) {
process.env.NODE_ENV !== 'production' ? warning(false, 'bind(): React component methods may only be bound to the ' + 'component instance. See %s', componentName) : void 0;
} else if (!args.length) {
process.env.NODE_ENV !== 'production' ? warning(false, 'bind(): You are binding a component method to the component. ' + 'React does this for you automatically in a high-performance ' + 'way, so you can safely remove this call. See %s', componentName) : void 0;
return boundMethod;
}
var reboundMethod = _bind.apply(boundMethod, arguments);
reboundMethod.__reactBoundContext = component;
reboundMethod.__reactBoundMethod = method;
reboundMethod.__reactBoundArguments = args;
return reboundMethod;
};
}
return boundMethod;
}
/**
* Binds all auto-bound methods in a component.
*
* @param {object} component Component whose method is going to be bound.
*/
function bindAutoBindMethods(component) {
var pairs = component.__reactAutoBindPairs;
for (var i = 0; i < pairs.length; i += 2) {
var autoBindKey = pairs[i];
var method = pairs[i + 1];
component[autoBindKey] = bindAutoBindMethod(component, method);
}
}
/**
* Add more to the ReactClass base class. These are all legacy features and
* therefore not already part of the modern ReactComponent.
*/
var ReactClassMixin = {
/**
* TODO: This will be deprecated because state should always keep a consistent
* type signature and the only use case for this, is to avoid that.
*/
replaceState: function (newState, callback) {
this.updater.enqueueReplaceState(this, newState);
if (callback) {
this.updater.enqueueCallback(this, callback, 'replaceState');
}
},
/**
* Checks whether or not this composite component is mounted.
* @return {boolean} True if mounted, false otherwise.
* @protected
* @final
*/
isMounted: function () {
return this.updater.isMounted(this);
}
};
var ReactClassComponent = function () {};
_assign(ReactClassComponent.prototype, ReactComponent.prototype, ReactClassMixin);
/**
* Module for creating composite components.
*
* @class ReactClass
*/
var ReactClass = {
/**
* Creates a composite component class given a class specification.
* See https://facebook.github.io/react/docs/top-level-api.html#react.createclass
*
* @param {object} spec Class specification (which must define `render`).
* @return {function} Component constructor function.
* @public
*/
createClass: function (spec) {
// To keep our warnings more understandable, we'll use a little hack here to
// ensure that Constructor.name !== 'Constructor'. This makes sure we don't
// unnecessarily identify a class without displayName as 'Constructor'.
var Constructor = identity(function (props, context, updater) {
// This constructor gets overridden by mocks. The argument is used
// by mocks to assert on what gets mounted.
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(this instanceof Constructor, 'Something is calling a React component directly. Use a factory or ' + 'JSX instead. See: https://fb.me/react-legacyfactory') : void 0;
}
// Wire up auto-binding
if (this.__reactAutoBindPairs.length) {
bindAutoBindMethods(this);
}
this.props = props;
this.context = context;
this.refs = emptyObject;
this.updater = updater || ReactNoopUpdateQueue;
this.state = null;
// ReactClasses doesn't have constructors. Instead, they use the
// getInitialState and componentWillMount methods for initialization.
var initialState = this.getInitialState ? this.getInitialState() : null;
if (process.env.NODE_ENV !== 'production') {
// We allow auto-mocks to proceed as if they're returning null.
if (initialState === undefined && this.getInitialState._isMockFunction) {
// This is probably bad practice. Consider warning here and
// deprecating this convenience.
initialState = null;
}
}
!(typeof initialState === 'object' && !Array.isArray(initialState)) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.getInitialState(): must return an object or null', Constructor.displayName || 'ReactCompositeComponent') : _prodInvariant('82', Constructor.displayName || 'ReactCompositeComponent') : void 0;
this.state = initialState;
});
Constructor.prototype = new ReactClassComponent();
Constructor.prototype.constructor = Constructor;
Constructor.prototype.__reactAutoBindPairs = [];
injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor));
mixSpecIntoComponent(Constructor, spec);
// Initialize the defaultProps property after all mixins have been merged.
if (Constructor.getDefaultProps) {
Constructor.defaultProps = Constructor.getDefaultProps();
}
if (process.env.NODE_ENV !== 'production') {
// This is a tag to indicate that the use of these method names is ok,
// since it's used with createClass. If it's not, then it's likely a
// mistake so we'll warn you to use the static property, property
// initializer or constructor respectively.
if (Constructor.getDefaultProps) {
Constructor.getDefaultProps.isReactClassApproved = {};
}
if (Constructor.prototype.getInitialState) {
Constructor.prototype.getInitialState.isReactClassApproved = {};
}
}
!Constructor.prototype.render ? process.env.NODE_ENV !== 'production' ? invariant(false, 'createClass(...): Class specification must implement a `render` method.') : _prodInvariant('83') : void 0;
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(!Constructor.prototype.componentShouldUpdate, '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', spec.displayName || 'A component') : void 0;
process.env.NODE_ENV !== 'production' ? warning(!Constructor.prototype.componentWillRecieveProps, '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', spec.displayName || 'A component') : void 0;
}
// Reduce time spent doing lookups by setting these on the prototype.
for (var methodName in ReactClassInterface) {
if (!Constructor.prototype[methodName]) {
Constructor.prototype[methodName] = null;
}
}
return Constructor;
},
injection: {
injectMixin: function (mixin) {
injectedMixins.push(mixin);
}
}
};
module.exports = ReactClass;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 24 */
/*!***************************************************!*\
!*** ./~/react/lib/ReactPropTypeLocationNames.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
'use strict';
var ReactPropTypeLocationNames = {};
if (process.env.NODE_ENV !== 'production') {
ReactPropTypeLocationNames = {
prop: 'prop',
context: 'context',
childContext: 'child context'
};
}
module.exports = ReactPropTypeLocationNames;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 25 */
/*!******************************************!*\
!*** ./~/react/lib/ReactDOMFactories.js ***!
\******************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var ReactElement = __webpack_require__(/*! ./ReactElement */ 10);
/**
* Create a factory that creates HTML tag elements.
*
* @private
*/
var createDOMFactory = ReactElement.createFactory;
if (process.env.NODE_ENV !== 'production') {
var ReactElementValidator = __webpack_require__(/*! ./ReactElementValidator */ 26);
createDOMFactory = ReactElementValidator.createFactory;
}
/**
* Creates a mapping from supported HTML tags to `ReactDOMComponent` classes.
* This is also accessible via `React.DOM`.
*
* @public
*/
var ReactDOMFactories = {
a: createDOMFactory('a'),
abbr: createDOMFactory('abbr'),
address: createDOMFactory('address'),
area: createDOMFactory('area'),
article: createDOMFactory('article'),
aside: createDOMFactory('aside'),
audio: createDOMFactory('audio'),
b: createDOMFactory('b'),
base: createDOMFactory('base'),
bdi: createDOMFactory('bdi'),
bdo: createDOMFactory('bdo'),
big: createDOMFactory('big'),
blockquote: createDOMFactory('blockquote'),
body: createDOMFactory('body'),
br: createDOMFactory('br'),
button: createDOMFactory('button'),
canvas: createDOMFactory('canvas'),
caption: createDOMFactory('caption'),
cite: createDOMFactory('cite'),
code: createDOMFactory('code'),
col: createDOMFactory('col'),
colgroup: createDOMFactory('colgroup'),
data: createDOMFactory('data'),
datalist: createDOMFactory('datalist'),
dd: createDOMFactory('dd'),
del: createDOMFactory('del'),
details: createDOMFactory('details'),
dfn: createDOMFactory('dfn'),
dialog: createDOMFactory('dialog'),
div: createDOMFactory('div'),
dl: createDOMFactory('dl'),
dt: createDOMFactory('dt'),
em: createDOMFactory('em'),
embed: createDOMFactory('embed'),
fieldset: createDOMFactory('fieldset'),
figcaption: createDOMFactory('figcaption'),
figure: createDOMFactory('figure'),
footer: createDOMFactory('footer'),
form: createDOMFactory('form'),
h1: createDOMFactory('h1'),
h2: createDOMFactory('h2'),
h3: createDOMFactory('h3'),
h4: createDOMFactory('h4'),
h5: createDOMFactory('h5'),
h6: createDOMFactory('h6'),
head: createDOMFactory('head'),
header: createDOMFactory('header'),
hgroup: createDOMFactory('hgroup'),
hr: createDOMFactory('hr'),
html: createDOMFactory('html'),
i: createDOMFactory('i'),
iframe: createDOMFactory('iframe'),
img: createDOMFactory('img'),
input: createDOMFactory('input'),
ins: createDOMFactory('ins'),
kbd: createDOMFactory('kbd'),
keygen: createDOMFactory('keygen'),
label: createDOMFactory('label'),
legend: createDOMFactory('legend'),
li: createDOMFactory('li'),
link: createDOMFactory('link'),
main: createDOMFactory('main'),
map: createDOMFactory('map'),
mark: createDOMFactory('mark'),
menu: createDOMFactory('menu'),
menuitem: createDOMFactory('menuitem'),
meta: createDOMFactory('meta'),
meter: createDOMFactory('meter'),
nav: createDOMFactory('nav'),
noscript: createDOMFactory('noscript'),
object: createDOMFactory('object'),
ol: createDOMFactory('ol'),
optgroup: createDOMFactory('optgroup'),
option: createDOMFactory('option'),
output: createDOMFactory('output'),
p: createDOMFactory('p'),
param: createDOMFactory('param'),
picture: createDOMFactory('picture'),
pre: createDOMFactory('pre'),
progress: createDOMFactory('progress'),
q: createDOMFactory('q'),
rp: createDOMFactory('rp'),
rt: createDOMFactory('rt'),
ruby: createDOMFactory('ruby'),
s: createDOMFactory('s'),
samp: createDOMFactory('samp'),
script: createDOMFactory('script'),
section: createDOMFactory('section'),
select: createDOMFactory('select'),
small: createDOMFactory('small'),
source: createDOMFactory('source'),
span: createDOMFactory('span'),
strong: createDOMFactory('strong'),
style: createDOMFactory('style'),
sub: createDOMFactory('sub'),
summary: createDOMFactory('summary'),
sup: createDOMFactory('sup'),
table: createDOMFactory('table'),
tbody: createDOMFactory('tbody'),
td: createDOMFactory('td'),
textarea: createDOMFactory('textarea'),
tfoot: createDOMFactory('tfoot'),
th: createDOMFactory('th'),
thead: createDOMFactory('thead'),
time: createDOMFactory('time'),
title: createDOMFactory('title'),
tr: createDOMFactory('tr'),
track: createDOMFactory('track'),
u: createDOMFactory('u'),
ul: createDOMFactory('ul'),
'var': createDOMFactory('var'),
video: createDOMFactory('video'),
wbr: createDOMFactory('wbr'),
// SVG
circle: createDOMFactory('circle'),
clipPath: createDOMFactory('clipPath'),
defs: createDOMFactory('defs'),
ellipse: createDOMFactory('ellipse'),
g: createDOMFactory('g'),
image: createDOMFactory('image'),
line: createDOMFactory('line'),
linearGradient: createDOMFactory('linearGradient'),
mask: createDOMFactory('mask'),
path: createDOMFactory('path'),
pattern: createDOMFactory('pattern'),
polygon: createDOMFactory('polygon'),
polyline: createDOMFactory('polyline'),
radialGradient: createDOMFactory('radialGradient'),
rect: createDOMFactory('rect'),
stop: createDOMFactory('stop'),
svg: createDOMFactory('svg'),
text: createDOMFactory('text'),
tspan: createDOMFactory('tspan')
};
module.exports = ReactDOMFactories;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 26 */
/*!**********************************************!*\
!*** ./~/react/lib/ReactElementValidator.js ***!
\**********************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2014-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
/**
* ReactElementValidator provides a wrapper around a element factory
* which validates the props passed to the element. This is intended to be
* used only in DEV and could be replaced by a static type checker for languages
* that support it.
*/
'use strict';
var ReactCurrentOwner = __webpack_require__(/*! ./ReactCurrentOwner */ 11);
var ReactComponentTreeHook = __webpack_require__(/*! ./ReactComponentTreeHook */ 27);
var ReactElement = __webpack_require__(/*! ./ReactElement */ 10);
var checkReactTypeSpec = __webpack_require__(/*! ./checkReactTypeSpec */ 28);
var canDefineProperty = __webpack_require__(/*! ./canDefineProperty */ 14);
var getIteratorFn = __webpack_require__(/*! ./getIteratorFn */ 17);
var warning = __webpack_require__(/*! fbjs/lib/warning */ 12);
function getDeclarationErrorAddendum() {
if (ReactCurrentOwner.current) {
var name = ReactCurrentOwner.current.getName();
if (name) {
return ' Check the render method of `' + name + '`.';
}
}
return '';
}
/**
* Warn if there's no key explicitly set on dynamic arrays of children or
* object keys are not valid. This allows us to keep track of children between
* updates.
*/
var ownerHasKeyUseWarning = {};
function getCurrentComponentErrorInfo(parentType) {
var info = getDeclarationErrorAddendum();
if (!info) {
var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
if (parentName) {
info = ' Check the top-level render call using <' + parentName + '>.';
}
}
return info;
}
/**
* Warn if the element doesn't have an explicit key assigned to it.
* This element is in an array. The array could grow and shrink or be
* reordered. All children that haven't already been validated are required to
* have a "key" property assigned to it. Error statuses are cached so a warning
* will only be shown once.
*
* @internal
* @param {ReactElement} element Element that requires a key.
* @param {*} parentType element's parent's type.
*/
function validateExplicitKey(element, parentType) {
if (!element._store || element._store.validated || element.key != null) {
return;
}
element._store.validated = true;
var memoizer = ownerHasKeyUseWarning.uniqueKey || (ownerHasKeyUseWarning.uniqueKey = {});
var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
if (memoizer[currentComponentErrorInfo]) {
return;
}
memoizer[currentComponentErrorInfo] = true;
// Usually the current owner is the offender, but if it accepts children as a
// property, it may be the creator of the child that's responsible for
// assigning it a key.
var childOwner = '';
if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
// Give the component that originally created this child.
childOwner = ' It was passed a child from ' + element._owner.getName() + '.';
}
process.env.NODE_ENV !== 'production' ? warning(false, 'Each child in an array or iterator should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.%s', currentComponentErrorInfo, childOwner, ReactComponentTreeHook.getCurrentStackAddendum(element)) : void 0;
}
/**
* Ensure that every element either is passed in a static location, in an
* array with an explicit keys property defined, or in an object literal
* with valid key property.
*
* @internal
* @param {ReactNode} node Statically passed child of any type.
* @param {*} parentType node's parent's type.
*/
function validateChildKeys(node, parentType) {
if (typeof node !== 'object') {
return;
}
if (Array.isArray(node)) {
for (var i = 0; i < node.length; i++) {
var child = node[i];
if (ReactElement.isValidElement(child)) {
validateExplicitKey(child, parentType);
}
}
} else if (ReactElement.isValidElement(node)) {
// This element was passed in a valid location.
if (node._store) {
node._store.validated = true;
}
} else if (node) {
var iteratorFn = getIteratorFn(node);
// Entry iterators provide implicit keys.
if (iteratorFn) {
if (iteratorFn !== node.entries) {
var iterator = iteratorFn.call(node);
var step;
while (!(step = iterator.next()).done) {
if (ReactElement.isValidElement(step.value)) {
validateExplicitKey(step.value, parentType);
}
}
}
}
}
}
/**
* Given an element, validate that its props follow the propTypes definition,
* provided by the type.
*
* @param {ReactElement} element
*/
function validatePropTypes(element) {
var componentClass = element.type;
if (typeof componentClass !== 'function') {
return;
}
var name = componentClass.displayName || componentClass.name;
if (componentClass.propTypes) {
checkReactTypeSpec(componentClass.propTypes, element.props, 'prop', name, element, null);
}
if (typeof componentClass.getDefaultProps === 'function') {
process.env.NODE_ENV !== 'production' ? warning(componentClass.getDefaultProps.isReactClassApproved, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : void 0;
}
}
var ReactElementValidator = {
createElement: function (type, props, children) {
var validType = typeof type === 'string' || typeof type === 'function';
// We warn in this case but don't throw. We expect the element creation to
// succeed and there will likely be errors in render.
if (!validType) {
if (typeof type !== 'function' && typeof type !== 'string') {
var info = '';
if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
info += ' You likely forgot to export your component from the file ' + 'it\'s defined in.';
}
info += getDeclarationErrorAddendum();
process.env.NODE_ENV !== 'production' ? warning(false, 'React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', type == null ? type : typeof type, info) : void 0;
}
}
var element = ReactElement.createElement.apply(this, arguments);
// The result can be nullish if a mock or a custom function is used.
// TODO: Drop this when these are no longer allowed as the type argument.
if (element == null) {
return element;
}
// Skip key warning if the type isn't valid since our key validation logic
// doesn't expect a non-string/function type and can throw confusing errors.
// We don't want exception behavior to differ between dev and prod.
// (Rendering will throw with a helpful message and as soon as the type is
// fixed, the key warnings will appear.)
if (validType) {
for (var i = 2; i < arguments.length; i++) {
validateChildKeys(arguments[i], type);
}
}
validatePropTypes(element);
return element;
},
createFactory: function (type) {
var validatedFactory = ReactElementValidator.createElement.bind(null, type);
// Legacy hook TODO: Warn if this is accessed
validatedFactory.type = type;
if (process.env.NODE_ENV !== 'production') {
if (canDefineProperty) {
Object.defineProperty(validatedFactory, 'type', {
enumerable: false,
get: function () {
process.env.NODE_ENV !== 'production' ? warning(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.') : void 0;
Object.defineProperty(this, 'type', {
value: type
});
return type;
}
});
}
}
return validatedFactory;
},
cloneElement: function (element, props, children) {
var newElement = ReactElement.cloneElement.apply(this, arguments);
for (var i = 2; i < arguments.length; i++) {
validateChildKeys(arguments[i], newElement.type);
}
validatePropTypes(newElement);
return newElement;
}
};
module.exports = ReactElementValidator;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 27 */
/*!***********************************************!*\
!*** ./~/react/lib/ReactComponentTreeHook.js ***!
\***********************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2016-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
'use strict';
var _prodInvariant = __webpack_require__(/*! ./reactProdInvariant */ 8);
var ReactCurrentOwner = __webpack_require__(/*! ./ReactCurrentOwner */ 11);
var invariant = __webpack_require__(/*! fbjs/lib/invariant */ 9);
var warning = __webpack_require__(/*! fbjs/lib/warning */ 12);
function isNative(fn) {
// Based on isNative() from Lodash
var funcToString = Function.prototype.toString;
var hasOwnProperty = Object.prototype.hasOwnProperty;
var reIsNative = RegExp('^' + funcToString
// Take an example native function source for comparison
.call(hasOwnProperty)
// Strip regex characters so we can use it for regex
.replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')
// Remove hasOwnProperty from the template to make it generic
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
try {
var source = funcToString.call(fn);
return reIsNative.test(source);
} catch (err) {
return false;
}
}
var canUseCollections =
// Array.from
typeof Array.from === 'function' &&
// Map
typeof Map === 'function' && isNative(Map) &&
// Map.prototype.keys
Map.prototype != null && typeof Map.prototype.keys === 'function' && isNative(Map.prototype.keys) &&
// Set
typeof Set === 'function' && isNative(Set) &&
// Set.prototype.keys
Set.prototype != null && typeof Set.prototype.keys === 'function' && isNative(Set.prototype.keys);
var setItem;
var getItem;
var removeItem;
var getItemIDs;
var addRoot;
var removeRoot;
var getRootIDs;
if (canUseCollections) {
var itemMap = new Map();
var rootIDSet = new Set();
setItem = function (id, item) {
itemMap.set(id, item);
};
getItem = function (id) {
return itemMap.get(id);
};
removeItem = function (id) {
itemMap['delete'](id);
};
getItemIDs = function () {
return Array.from(itemMap.keys());
};
addRoot = function (id) {
rootIDSet.add(id);
};
removeRoot = function (id) {
rootIDSet['delete'](id);
};
getRootIDs = function () {
return Array.from(rootIDSet.keys());
};
} else {
var itemByKey = {};
var rootByKey = {};
// Use non-numeric keys to prevent V8 performance issues:
// https://github.com/facebook/react/pull/7232
var getKeyFromID = function (id) {
return '.' + id;
};
var getIDFromKey = function (key) {
return parseInt(key.substr(1), 10);
};
setItem = function (id, item) {
var key = getKeyFromID(id);
itemByKey[key] = item;
};
getItem = function (id) {
var key = getKeyFromID(id);
return itemByKey[key];
};
removeItem = function (id) {
var key = getKeyFromID(id);
delete itemByKey[key];
};
getItemIDs = function () {
return Object.keys(itemByKey).map(getIDFromKey);
};
addRoot = function (id) {
var key = getKeyFromID(id);
rootByKey[key] = true;
};
removeRoot = function (id) {
var key = getKeyFromID(id);
delete rootByKey[key];
};
getRootIDs = function () {
return Object.keys(rootByKey).map(getIDFromKey);
};
}
var unmountedIDs = [];
function purgeDeep(id) {
var item = getItem(id);
if (item) {
var childIDs = item.childIDs;
removeItem(id);
childIDs.forEach(purgeDeep);
}
}
function describeComponentFrame(name, source, ownerName) {
return '\n in ' + (name || 'Unknown') + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : '');
}
function getDisplayName(element) {
if (element == null) {
return '#empty';
} else if (typeof element === 'string' || typeof element === 'number') {
return '#text';
} else if (typeof element.type === 'string') {
return element.type;
} else {
return element.type.displayName || element.type.name || 'Unknown';
}
}
function describeID(id) {
var name = ReactComponentTreeHook.getDisplayName(id);
var element = ReactComponentTreeHook.getElement(id);
var ownerID = ReactComponentTreeHook.getOwnerID(id);
var ownerName;
if (ownerID) {
ownerName = ReactComponentTreeHook.getDisplayName(ownerID);
}
process.env.NODE_ENV !== 'production' ? warning(element, 'ReactComponentTreeHook: Missing React element for debugID %s when ' + 'building stack', id) : void 0;
return describeComponentFrame(name, element && element._source, ownerName);
}
var ReactComponentTreeHook = {
onSetChildren: function (id, nextChildIDs) {
var item = getItem(id);
!item ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Item must have been set') : _prodInvariant('144') : void 0;
item.childIDs = nextChildIDs;
for (var i = 0; i < nextChildIDs.length; i++) {
var nextChildID = nextChildIDs[i];
var nextChild = getItem(nextChildID);
!nextChild ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected hook events to fire for the child before its parent includes it in onSetChildren().') : _prodInvariant('140') : void 0;
!(nextChild.childIDs != null || typeof nextChild.element !== 'object' || nextChild.element == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected onSetChildren() to fire for a container child before its parent includes it in onSetChildren().') : _prodInvariant('141') : void 0;
!nextChild.isMounted ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected onMountComponent() to fire for the child before its parent includes it in onSetChildren().') : _prodInvariant('71') : void 0;
if (nextChild.parentID == null) {
nextChild.parentID = id;
// TODO: This shouldn't be necessary but mounting a new root during in
// componentWillMount currently causes not-yet-mounted components to
// be purged from our tree data so their parent id is missing.
}
!(nextChild.parentID === id) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected onBeforeMountComponent() parent and onSetChildren() to be consistent (%s has parents %s and %s).', nextChildID, nextChild.parentID, id) : _prodInvariant('142', nextChildID, nextChild.parentID, id) : void 0;
}
},
onBeforeMountComponent: function (id, element, parentID) {
var item = {
element: element,
parentID: parentID,
text: null,
childIDs: [],
isMounted: false,
updateCount: 0
};
setItem(id, item);
},
onBeforeUpdateComponent: function (id, element) {
var item = getItem(id);
if (!item || !item.isMounted) {
// We may end up here as a result of setState() in componentWillUnmount().
// In this case, ignore the element.
return;
}
item.element = element;
},
onMountComponent: function (id) {
var item = getItem(id);
!item ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Item must have been set') : _prodInvariant('144') : void 0;
item.isMounted = true;
var isRoot = item.parentID === 0;
if (isRoot) {
addRoot(id);
}
},
onUpdateComponent: function (id) {
var item = getItem(id);
if (!item || !item.isMounted) {
// We may end up here as a result of setState() in componentWillUnmount().
// In this case, ignore the element.
return;
}
item.updateCount++;
},
onUnmountComponent: function (id) {
var item = getItem(id);
if (item) {
// We need to check if it exists.
// `item` might not exist if it is inside an error boundary, and a sibling
// error boundary child threw while mounting. Then this instance never
// got a chance to mount, but it still gets an unmounting event during
// the error boundary cleanup.
item.isMounted = false;
var isRoot = item.parentID === 0;
if (isRoot) {
removeRoot(id);
}
}
unmountedIDs.push(id);
},
purgeUnmountedComponents: function () {
if (ReactComponentTreeHook._preventPurging) {
// Should only be used for testing.
return;
}
for (var i = 0; i < unmountedIDs.length; i++) {
var id = unmountedIDs[i];
purgeDeep(id);
}
unmountedIDs.length = 0;
},
isMounted: function (id) {
var item = getItem(id);
return item ? item.isMounted : false;
},
getCurrentStackAddendum: function (topElement) {
var info = '';
if (topElement) {
var name = getDisplayName(topElement);
var owner = topElement._owner;
info += describeComponentFrame(name, topElement._source, owner && owner.getName());
}
var currentOwner = ReactCurrentOwner.current;
var id = currentOwner && currentOwner._debugID;
info += ReactComponentTreeHook.getStackAddendumByID(id);
return info;
},
getStackAddendumByID: function (id) {
var info = '';
while (id) {
info += describeID(id);
id = ReactComponentTreeHook.getParentID(id);
}
return info;
},
getChildIDs: function (id) {
var item = getItem(id);
return item ? item.childIDs : [];
},
getDisplayName: function (id) {
var element = ReactComponentTreeHook.getElement(id);
if (!element) {
return null;
}
return getDisplayName(element);
},
getElement: function (id) {
var item = getItem(id);
return item ? item.element : null;
},
getOwnerID: function (id) {
var element = ReactComponentTreeHook.getElement(id);
if (!element || !element._owner) {
return null;
}
return element._owner._debugID;
},
getParentID: function (id) {
var item = getItem(id);
return item ? item.parentID : null;
},
getSource: function (id) {
var item = getItem(id);
var element = item ? item.element : null;
var source = element != null ? element._source : null;
return source;
},
getText: function (id) {
var element = ReactComponentTreeHook.getElement(id);
if (typeof element === 'string') {
return element;
} else if (typeof element === 'number') {
return '' + element;
} else {
return null;
}
},
getUpdateCount: function (id) {
var item = getItem(id);
return item ? item.updateCount : 0;
},
getRootIDs: getRootIDs,
getRegisteredIDs: getItemIDs
};
module.exports = ReactComponentTreeHook;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 28 */
/*!*******************************************!*\
!*** ./~/react/lib/checkReactTypeSpec.js ***!
\*******************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var _prodInvariant = __webpack_require__(/*! ./reactProdInvariant */ 8);
var ReactPropTypeLocationNames = __webpack_require__(/*! ./ReactPropTypeLocationNames */ 24);
var ReactPropTypesSecret = __webpack_require__(/*! ./ReactPropTypesSecret */ 29);
var invariant = __webpack_require__(/*! fbjs/lib/invariant */ 9);
var warning = __webpack_require__(/*! fbjs/lib/warning */ 12);
var ReactComponentTreeHook;
if (typeof process !== 'undefined' && process.env && process.env.NODE_ENV === 'test') {
// Temporary hack.
// Inline requires don't work well with Jest:
// https://github.com/facebook/react/issues/7240
// Remove the inline requires when we don't need them anymore:
// https://github.com/facebook/react/pull/7178
ReactComponentTreeHook = __webpack_require__(/*! ./ReactComponentTreeHook */ 27);
}
var loggedTypeFailures = {};
/**
* Assert that the values match with the type specs.
* Error messages are memorized and will only be shown once.
*
* @param {object} typeSpecs Map of name to a ReactPropType
* @param {object} values Runtime values that need to be type-checked
* @param {string} location e.g. "prop", "context", "child context"
* @param {string} componentName Name of the component for error messages.
* @param {?object} element The React element that is being type-checked
* @param {?number} debugID The React component instance that is being type-checked
* @private
*/
function checkReactTypeSpec(typeSpecs, values, location, componentName, element, debugID) {
for (var typeSpecName in typeSpecs) {
if (typeSpecs.hasOwnProperty(typeSpecName)) {
var error;
// Prop type validation may throw. In case they do, we don't want to
// fail the render phase where it didn't fail before. So we log it.
// After these have been cleaned up, we'll let them throw.
try {
// This is intentionally an invariant that gets caught. It's the same
// behavior as without this statement except with a better message.
!(typeof typeSpecs[typeSpecName] === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName) : _prodInvariant('84', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName) : void 0;
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
} catch (ex) {
error = ex;
}
process.env.NODE_ENV !== 'production' ? warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName, typeof error) : void 0;
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
// Only monitor this failure once because there tends to be a lot of the
// same error.
loggedTypeFailures[error.message] = true;
var componentStackInfo = '';
if (process.env.NODE_ENV !== 'production') {
if (!ReactComponentTreeHook) {
ReactComponentTreeHook = __webpack_require__(/*! ./ReactComponentTreeHook */ 27);
}
if (debugID !== null) {
componentStackInfo = ReactComponentTreeHook.getStackAddendumByID(debugID);
} else if (element !== null) {
componentStackInfo = ReactComponentTreeHook.getCurrentStackAddendum(element);
}
}
process.env.NODE_ENV !== 'production' ? warning(false, 'Failed %s type: %s%s', location, error.message, componentStackInfo) : void 0;
}
}
}
}
module.exports = checkReactTypeSpec;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 29 */
/*!*********************************************!*\
!*** ./~/react/lib/ReactPropTypesSecret.js ***!
\*********************************************/
/***/ function(module, exports) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
'use strict';
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
module.exports = ReactPropTypesSecret;
/***/ },
/* 30 */
/*!***************************************!*\
!*** ./~/react/lib/ReactPropTypes.js ***!
\***************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var ReactElement = __webpack_require__(/*! ./ReactElement */ 10);
var ReactPropTypeLocationNames = __webpack_require__(/*! ./ReactPropTypeLocationNames */ 24);
var ReactPropTypesSecret = __webpack_require__(/*! ./ReactPropTypesSecret */ 29);
var emptyFunction = __webpack_require__(/*! fbjs/lib/emptyFunction */ 13);
var getIteratorFn = __webpack_require__(/*! ./getIteratorFn */ 17);
var warning = __webpack_require__(/*! fbjs/lib/warning */ 12);
/**
* 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 = '<<anonymous>>';
var ReactPropTypes = {
array: createPrimitiveTypeChecker('array'),
bool: createPrimitiveTypeChecker('boolean'),
func: createPrimitiveTypeChecker('function'),
number: createPrimitiveTypeChecker('number'),
object: createPrimitiveTypeChecker('object'),
string: createPrimitiveTypeChecker('string'),
symbol: createPrimitiveTypeChecker('symbol'),
any: createAnyTypeChecker(),
arrayOf: createArrayOfTypeChecker,
element: createElementTypeChecker(),
instanceOf: createInstanceTypeChecker,
node: createNodeChecker(),
objectOf: createObjectOfTypeChecker,
oneOf: createEnumTypeChecker,
oneOfType: createUnionTypeChecker,
shape: createShapeTypeChecker
};
/**
* inlined Object.is polyfill to avoid requiring consumers ship their own
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
*/
/*eslint-disable no-self-compare*/
function is(x, y) {
// SameValue algorithm
if (x === y) {
// Steps 1-5, 7-10
// Steps 6.b-6.e: +0 != -0
return x !== 0 || 1 / x === 1 / y;
} else {
// Step 6.a: NaN == NaN
return x !== x && y !== y;
}
}
/*eslint-enable no-self-compare*/
/**
* We use an Error-like object for backward compatibility as people may call
* PropTypes directly and inspect their output. However we don't use real
* Errors anymore. We don't inspect their stack anyway, and creating them
* is prohibitively expensive if they are created too often, such as what
* happens in oneOfType() for any type before the one that matched.
*/
function PropTypeError(message) {
this.message = message;
this.stack = '';
}
// Make `instanceof Error` still work for returned errors.
PropTypeError.prototype = Error.prototype;
function createChainableTypeChecker(validate) {
if (process.env.NODE_ENV !== 'production') {
var manualPropTypeCallCache = {};
}
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
componentName = componentName || ANONYMOUS;
propFullName = propFullName || propName;
if (process.env.NODE_ENV !== 'production') {
if (secret !== ReactPropTypesSecret && typeof console !== 'undefined') {
var cacheKey = componentName + ':' + propName;
if (!manualPropTypeCallCache[cacheKey]) {
process.env.NODE_ENV !== 'production' ? warning(false, 'You are manually calling a React.PropTypes validation ' + 'function for the `%s` prop on `%s`. This is deprecated ' + 'and will not work in production with the next major version. ' + '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) : void 0;
manualPropTypeCallCache[cacheKey] = true;
}
}
}
if (props[propName] == null) {
var locationName = ReactPropTypeLocationNames[location];
if (isRequired) {
if (props[propName] === null) {
return new PropTypeError('The ' + locationName + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
}
return new PropTypeError('The ' + locationName + ' `' + 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) {
var locationName = ReactPropTypeLocationNames[location];
// `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 ' + locationName + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createAnyTypeChecker() {
return createChainableTypeChecker(emptyFunction.thatReturns(null));
}
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 locationName = ReactPropTypeLocationNames[location];
var propType = getPropType(propValue);
return new PropTypeError('Invalid ' + locationName + ' `' + 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 (!ReactElement.isValidElement(propValue)) {
var locationName = ReactPropTypeLocationNames[location];
var propType = getPropType(propValue);
return new PropTypeError('Invalid ' + locationName + ' `' + 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 locationName = ReactPropTypeLocationNames[location];
var expectedClassName = expectedClass.name || ANONYMOUS;
var actualClassName = getClassName(props[propName]);
return new PropTypeError('Invalid ' + locationName + ' `' + 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 locationName = ReactPropTypeLocationNames[location];
var valuesString = JSON.stringify(expectedValues);
return new PropTypeError('Invalid ' + locationName + ' `' + 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') {
var locationName = ReactPropTypeLocationNames[location];
return new PropTypeError('Invalid ' + locationName + ' `' + 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;
}
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;
}
}
var locationName = ReactPropTypeLocationNames[location];
return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
}
return createChainableTypeChecker(validate);
}
function createNodeChecker() {
function validate(props, propName, componentName, location, propFullName) {
if (!isNode(props[propName])) {
var locationName = ReactPropTypeLocationNames[location];
return new PropTypeError('Invalid ' + locationName + ' `' + 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') {
var locationName = ReactPropTypeLocationNames[location];
return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
}
for (var key in shapeTypes) {
var checker = shapeTypes[key];
if (!checker) {
continue;
}
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
if (error) {
return error;
}
}
return null;
}
return createChainableTypeChecker(validate);
}
function isNode(propValue) {
switch (typeof propValue) {
case 'number':
case 'string':
case 'undefined':
return true;
case 'boolean':
return !propValue;
case 'object':
if (Array.isArray(propValue)) {
return propValue.every(isNode);
}
if (propValue === null || ReactElement.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) {
var propType = getPropType(propValue);
if (propType === 'object') {
if (propValue instanceof Date) {
return 'date';
} else if (propValue instanceof RegExp) {
return 'regexp';
}
}
return propType;
}
// Returns class name of the object, if any.
function getClassName(propValue) {
if (!propValue.constructor || !propValue.constructor.name) {
return ANONYMOUS;
}
return propValue.constructor.name;
}
module.exports = ReactPropTypes;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 31 */
/*!*************************************!*\
!*** ./~/react/lib/ReactVersion.js ***!
\*************************************/
/***/ function(module, exports) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
module.exports = '15.4.2';
/***/ },
/* 32 */
/*!**********************************!*\
!*** ./~/react/lib/onlyChild.js ***!
\**********************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var _prodInvariant = __webpack_require__(/*! ./reactProdInvariant */ 8);
var ReactElement = __webpack_require__(/*! ./ReactElement */ 10);
var invariant = __webpack_require__(/*! fbjs/lib/invariant */ 9);
/**
* Returns the first child in a collection of children and verifies that there
* is only one child in the collection.
*
* See https://facebook.github.io/react/docs/top-level-api.html#react.children.only
*
* The current implementation of this function assumes that a single child gets
* passed without a wrapper, but the purpose of this helper function is to
* abstract away the particular structure of children.
*
* @param {?object} children Child collection structure.
* @return {ReactElement} The first and only `ReactElement` contained in the
* structure.
*/
function onlyChild(children) {
!ReactElement.isValidElement(children) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'React.Children.only expected to receive a single React element child.') : _prodInvariant('143') : void 0;
return children;
}
module.exports = onlyChild;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 33 */
/*!******************************!*\
!*** ./~/react-dom/index.js ***!
\******************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
module.exports = __webpack_require__(/*! ./lib/ReactDOM */ 34);
/***/ },
/* 34 */
/*!*************************************!*\
!*** ./~/react-dom/lib/ReactDOM.js ***!
\*************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
/* globals __REACT_DEVTOOLS_GLOBAL_HOOK__*/
'use strict';
var ReactDOMComponentTree = __webpack_require__(/*! ./ReactDOMComponentTree */ 35);
var ReactDefaultInjection = __webpack_require__(/*! ./ReactDefaultInjection */ 39);
var ReactMount = __webpack_require__(/*! ./ReactMount */ 167);
var ReactReconciler = __webpack_require__(/*! ./ReactReconciler */ 60);
var ReactUpdates = __webpack_require__(/*! ./ReactUpdates */ 57);
var ReactVersion = __webpack_require__(/*! ./ReactVersion */ 172);
var findDOMNode = __webpack_require__(/*! ./findDOMNode */ 173);
var getHostComponentFromComposite = __webpack_require__(/*! ./getHostComponentFromComposite */ 174);
var renderSubtreeIntoContainer = __webpack_require__(/*! ./renderSubtreeIntoContainer */ 175);
var warning = __webpack_require__(/*! fbjs/lib/warning */ 12);
ReactDefaultInjection.inject();
var ReactDOM = {
findDOMNode: findDOMNode,
render: ReactMount.render,
unmountComponentAtNode: ReactMount.unmountComponentAtNode,
version: ReactVersion,
/* eslint-disable camelcase */
unstable_batchedUpdates: ReactUpdates.batchedUpdates,
unstable_renderSubtreeIntoContainer: renderSubtreeIntoContainer
};
// Inject the runtime into a devtools global hook regardless of browser.
// Allows for debugging when the hook is injected on the page.
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject === 'function') {
__REACT_DEVTOOLS_GLOBAL_HOOK__.inject({
ComponentTree: {
getClosestInstanceFromNode: ReactDOMComponentTree.getClosestInstanceFromNode,
getNodeFromInstance: function (inst) {
// inst is an internal instance (but could be a composite)
if (inst._renderedComponent) {
inst = getHostComponentFromComposite(inst);
}
if (inst) {
return ReactDOMComponentTree.getNodeFromInstance(inst);
} else {
return null;
}
}
},
Mount: ReactMount,
Reconciler: ReactReconciler
});
}
if (process.env.NODE_ENV !== 'production') {
var ExecutionEnvironment = __webpack_require__(/*! fbjs/lib/ExecutionEnvironment */ 49);
if (ExecutionEnvironment.canUseDOM && window.top === window.self) {
// First check if devtools is not installed
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') {
// If we're in Chrome or Firefox, provide a download link if not installed.
if (navigator.userAgent.indexOf('Chrome') > -1 && navigator.userAgent.indexOf('Edge') === -1 || navigator.userAgent.indexOf('Firefox') > -1) {
// Firefox does not have the issue with devtools loaded over file://
var showFileUrlMessage = window.location.protocol.indexOf('http') === -1 && navigator.userAgent.indexOf('Firefox') === -1;
console.debug('Download the React DevTools ' + (showFileUrlMessage ? 'and use an HTTP server (instead of a file: URL) ' : '') + 'for a better development experience: ' + 'https://fb.me/react-devtools');
}
}
var testFunc = function testFn() {};
process.env.NODE_ENV !== 'production' ? warning((testFunc.name || testFunc.toString()).indexOf('testFn') !== -1, 'It looks like you\'re using a minified copy of the development build ' + 'of React. When deploying React apps to production, make sure to use ' + 'the production build which skips development warnings and is faster. ' + 'See https://fb.me/react-minification for more details.') : void 0;
// If we're in IE8, check to see if we are in compatibility mode and provide
// information on preventing compatibility mode
var ieCompatibilityMode = document.documentMode && document.documentMode < 8;
process.env.NODE_ENV !== 'production' ? warning(!ieCompatibilityMode, 'Internet Explorer is running in compatibility mode; please add the ' + 'following tag to your HTML to prevent this from happening: ' + '<meta http-equiv="X-UA-Compatible" content="IE=edge" />') : void 0;
var expectedFeatures = [
// shims
Array.isArray, Array.prototype.every, Array.prototype.forEach, Array.prototype.indexOf, Array.prototype.map, Date.now, Function.prototype.bind, Object.keys, String.prototype.trim];
for (var i = 0; i < expectedFeatures.length; i++) {
if (!expectedFeatures[i]) {
process.env.NODE_ENV !== 'production' ? warning(false, 'One or more ES5 shims expected by React are not available: ' + 'https://fb.me/react-warning-polyfills') : void 0;
break;
}
}
}
}
if (process.env.NODE_ENV !== 'production') {
var ReactInstrumentation = __webpack_require__(/*! ./ReactInstrumentation */ 63);
var ReactDOMUnknownPropertyHook = __webpack_require__(/*! ./ReactDOMUnknownPropertyHook */ 176);
var ReactDOMNullInputValuePropHook = __webpack_require__(/*! ./ReactDOMNullInputValuePropHook */ 177);
var ReactDOMInvalidARIAHook = __webpack_require__(/*! ./ReactDOMInvalidARIAHook */ 178);
ReactInstrumentation.debugTool.addHook(ReactDOMUnknownPropertyHook);
ReactInstrumentation.debugTool.addHook(ReactDOMNullInputValuePropHook);
ReactInstrumentation.debugTool.addHook(ReactDOMInvalidARIAHook);
}
module.exports = ReactDOM;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 35 */
/*!**************************************************!*\
!*** ./~/react-dom/lib/ReactDOMComponentTree.js ***!
\**************************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var _prodInvariant = __webpack_require__(/*! ./reactProdInvariant */ 36);
var DOMProperty = __webpack_require__(/*! ./DOMProperty */ 37);
var ReactDOMComponentFlags = __webpack_require__(/*! ./ReactDOMComponentFlags */ 38);
var invariant = __webpack_require__(/*! fbjs/lib/invariant */ 9);
var ATTR_NAME = DOMProperty.ID_ATTRIBUTE_NAME;
var Flags = ReactDOMComponentFlags;
var internalInstanceKey = '__reactInternalInstance$' + Math.random().toString(36).slice(2);
/**
* Check if a given node should be cached.
*/
function shouldPrecacheNode(node, nodeID) {
return node.nodeType === 1 && node.getAttribute(ATTR_NAME) === String(nodeID) || node.nodeType === 8 && node.nodeValue === ' react-text: ' + nodeID + ' ' || node.nodeType === 8 && node.nodeValue === ' react-empty: ' + nodeID + ' ';
}
/**
* Drill down (through composites and empty components) until we get a host or
* host text component.
*
* This is pretty polymorphic but unavoidable with the current structure we have
* for `_renderedChildren`.
*/
function getRenderedHostOrTextFromComponent(component) {
var rendered;
while (rendered = component._renderedComponent) {
component = rendered;
}
return component;
}
/**
* Populate `_hostNode` on the rendered host/text component with the given
* DOM node. The passed `inst` can be a composite.
*/
function precacheNode(inst, node) {
var hostInst = getRenderedHostOrTextFromComponent(inst);
hostInst._hostNode = node;
node[internalInstanceKey] = hostInst;
}
function uncacheNode(inst) {
var node = inst._hostNode;
if (node) {
delete node[internalInstanceKey];
inst._hostNode = null;
}
}
/**
* Populate `_hostNode` on each child of `inst`, assuming that the children
* match up with the DOM (element) children of `node`.
*
* We cache entire levels at once to avoid an n^2 problem where we access the
* children of a node sequentially and have to walk from the start to our target
* node every time.
*
* Since we update `_renderedChildren` and the actual DOM at (slightly)
* different times, we could race here and see a newer `_renderedChildren` than
* the DOM nodes we see. To avoid this, ReactMultiChild calls
* `prepareToManageChildren` before we change `_renderedChildren`, at which
* time the container's child nodes are always cached (until it unmounts).
*/
function precacheChildNodes(inst, node) {
if (inst._flags & Flags.hasCachedChildNodes) {
return;
}
var children = inst._renderedChildren;
var childNode = node.firstChild;
outer: for (var name in children) {
if (!children.hasOwnProperty(name)) {
continue;
}
var childInst = children[name];
var childID = getRenderedHostOrTextFromComponent(childInst)._domID;
if (childID === 0) {
// We're currently unmounting this child in ReactMultiChild; skip it.
continue;
}
// We assume the child nodes are in the same order as the child instances.
for (; childNode !== null; childNode = childNode.nextSibling) {
if (shouldPrecacheNode(childNode, childID)) {
precacheNode(childInst, childNode);
continue outer;
}
}
// We reached the end of the DOM children without finding an ID match.
true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;
}
inst._flags |= Flags.hasCachedChildNodes;
}
/**
* Given a DOM node, return the closest ReactDOMComponent or
* ReactDOMTextComponent instance ancestor.
*/
function getClosestInstanceFromNode(node) {
if (node[internalInstanceKey]) {
return node[internalInstanceKey];
}
// Walk up the tree until we find an ancestor whose instance we have cached.
var parents = [];
while (!node[internalInstanceKey]) {
parents.push(node);
if (node.parentNode) {
node = node.parentNode;
} else {
// Top of the tree. This node must not be part of a React tree (or is
// unmounted, potentially).
return null;
}
}
var closest;
var inst;
for (; node && (inst = node[internalInstanceKey]); node = parents.pop()) {
closest = inst;
if (parents.length) {
precacheChildNodes(inst, node);
}
}
return closest;
}
/**
* Given a DOM node, return the ReactDOMComponent or ReactDOMTextComponent
* instance, or null if the node was not rendered by this React.
*/
function getInstanceFromNode(node) {
var inst = getClosestInstanceFromNode(node);
if (inst != null && inst._hostNode === node) {
return inst;
} else {
return null;
}
}
/**
* Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding
* DOM node.
*/
function getNodeFromInstance(inst) {
// Without this first invariant, passing a non-DOM-component triggers the next
// invariant for a missing parent, which is super confusing.
!(inst._hostNode !== undefined) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getNodeFromInstance: Invalid argument.') : _prodInvariant('33') : void 0;
if (inst._hostNode) {
return inst._hostNode;
}
// Walk up the tree until we find an ancestor whose DOM node we have cached.
var parents = [];
while (!inst._hostNode) {
parents.push(inst);
!inst._hostParent ? process.env.NODE_ENV !== 'production' ? invariant(false, 'React DOM tree root should always have a node reference.') : _prodInvariant('34') : void 0;
inst = inst._hostParent;
}
// Now parents contains each ancestor that does *not* have a cached native
// node, and `inst` is the deepest ancestor that does.
for (; parents.length; inst = parents.pop()) {
precacheChildNodes(inst, inst._hostNode);
}
return inst._hostNode;
}
var ReactDOMComponentTree = {
getClosestInstanceFromNode: getClosestInstanceFromNode,
getInstanceFromNode: getInstanceFromNode,
getNodeFromInstance: getNodeFromInstance,
precacheChildNodes: precacheChildNodes,
precacheNode: precacheNode,
uncacheNode: uncacheNode
};
module.exports = ReactDOMComponentTree;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 36 */
/*!***********************************************!*\
!*** ./~/react-dom/lib/reactProdInvariant.js ***!
\***********************************************/
/***/ function(module, exports) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
'use strict';
/**
* WARNING: DO NOT manually require this module.
* This is a replacement for `invariant(...)` used by the error code system
* and will _only_ be required by the corresponding babel pass.
* It always throws.
*/
function reactProdInvariant(code) {
var argCount = arguments.length - 1;
var message = 'Minified React error #' + code + '; visit ' + 'http://facebook.github.io/react/docs/error-decoder.html?invariant=' + code;
for (var argIdx = 0; argIdx < argCount; argIdx++) {
message += '&args[]=' + encodeURIComponent(arguments[argIdx + 1]);
}
message += ' for the full message or use the non-minified dev environment' + ' for full errors and additional helpful warnings.';
var error = new Error(message);
error.name = 'Invariant Violation';
error.framesToPop = 1; // we don't care about reactProdInvariant's own frame
throw error;
}
module.exports = reactProdInvariant;
/***/ },
/* 37 */
/*!****************************************!*\
!*** ./~/react-dom/lib/DOMProperty.js ***!
\****************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var _prodInvariant = __webpack_require__(/*! ./reactProdInvariant */ 36);
var invariant = __webpack_require__(/*! fbjs/lib/invariant */ 9);
function checkMask(value, bitmask) {
return (value & bitmask) === bitmask;
}
var DOMPropertyInjection = {
/**
* Mapping from normalized, camelcased property names to a configuration that
* specifies how the associated DOM property should be accessed or rendered.
*/
MUST_USE_PROPERTY: 0x1,
HAS_BOOLEAN_VALUE: 0x4,
HAS_NUMERIC_VALUE: 0x8,
HAS_POSITIVE_NUMERIC_VALUE: 0x10 | 0x8,
HAS_OVERLOADED_BOOLEAN_VALUE: 0x20,
/**
* Inject some specialized knowledge about the DOM. This takes a config object
* with the following properties:
*
* isCustomAttribute: function that given an attribute name will return true
* if it can be inserted into the DOM verbatim. Useful for data-* or aria-*
* attributes where it's impossible to enumerate all of the possible
* attribute names,
*
* Properties: object mapping DOM property name to one of the
* DOMPropertyInjection constants or null. If your attribute isn't in here,
* it won't get written to the DOM.
*
* DOMAttributeNames: object mapping React attribute name to the DOM
* attribute name. Attribute names not specified use the **lowercase**
* normalized name.
*
* DOMAttributeNamespaces: object mapping React attribute name to the DOM
* attribute namespace URL. (Attribute names not specified use no namespace.)
*
* DOMPropertyNames: similar to DOMAttributeNames but for DOM properties.
* Property names not specified use the normalized name.
*
* DOMMutationMethods: Properties that require special mutation methods. If
* `value` is undefined, the mutation method should unset the property.
*
* @param {object} domPropertyConfig the config as described above.
*/
injectDOMPropertyConfig: function (domPropertyConfig) {
var Injection = DOMPropertyInjection;
var Properties = domPropertyConfig.Properties || {};
var DOMAttributeNamespaces = domPropertyConfig.DOMAttributeNamespaces || {};
var DOMAttributeNames = domPropertyConfig.DOMAttributeNames || {};
var DOMPropertyNames = domPropertyConfig.DOMPropertyNames || {};
var DOMMutationMethods = domPropertyConfig.DOMMutationMethods || {};
if (domPropertyConfig.isCustomAttribute) {
DOMProperty._isCustomAttributeFunctions.push(domPropertyConfig.isCustomAttribute);
}
for (var propName in Properties) {
!!DOMProperty.properties.hasOwnProperty(propName) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'injectDOMPropertyConfig(...): You\'re trying to inject DOM property \'%s\' which has already been injected. You may be accidentally injecting the same DOM property config twice, or you may be injecting two configs that have conflicting property names.', propName) : _prodInvariant('48', propName) : void 0;
var lowerCased = propName.toLowerCase();
var propConfig = Properties[propName];
var propertyInfo = {
attributeName: lowerCased,
attributeNamespace: null,
propertyName: propName,
mutationMethod: null,
mustUseProperty: checkMask(propConfig, Injection.MUST_USE_PROPERTY),
hasBooleanValue: checkMask(propConfig, Injection.HAS_BOOLEAN_VALUE),
hasNumericValue: checkMask(propConfig, Injection.HAS_NUMERIC_VALUE),
hasPositiveNumericValue: checkMask(propConfig, Injection.HAS_POSITIVE_NUMERIC_VALUE),
hasOverloadedBooleanValue: checkMask(propConfig, Injection.HAS_OVERLOADED_BOOLEAN_VALUE)
};
!(propertyInfo.hasBooleanValue + propertyInfo.hasNumericValue + propertyInfo.hasOverloadedBooleanValue <= 1) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'DOMProperty: Value can be one of boolean, overloaded boolean, or numeric value, but not a combination: %s', propName) : _prodInvariant('50', propName) : void 0;
if (process.env.NODE_ENV !== 'production') {
DOMProperty.getPossibleStandardName[lowerCased] = propName;
}
if (DOMAttributeNames.hasOwnProperty(propName)) {
var attributeName = DOMAttributeNames[propName];
propertyInfo.attributeName = attributeName;
if (process.env.NODE_ENV !== 'production') {
DOMProperty.getPossibleStandardName[attributeName] = propName;
}
}
if (DOMAttributeNamespaces.hasOwnProperty(propName)) {
propertyInfo.attributeNamespace = DOMAttributeNamespaces[propName];
}
if (DOMPropertyNames.hasOwnProperty(propName)) {
propertyInfo.propertyName = DOMPropertyNames[propName];
}
if (DOMMutationMethods.hasOwnProperty(propName)) {
propertyInfo.mutationMethod = DOMMutationMethods[propName];
}
DOMProperty.properties[propName] = propertyInfo;
}
}
};
/* eslint-disable max-len */
var ATTRIBUTE_NAME_START_CHAR = ':A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD';
/* eslint-enable max-len */
/**
* DOMProperty exports lookup objects that can be used like functions:
*
* > DOMProperty.isValid['id']
* true
* > DOMProperty.isValid['foobar']
* undefined
*
* Although this may be confusing, it performs better in general.
*
* @see http://jsperf.com/key-exists
* @see http://jsperf.com/key-missing
*/
var DOMProperty = {
ID_ATTRIBUTE_NAME: 'data-reactid',
ROOT_ATTRIBUTE_NAME: 'data-reactroot',
ATTRIBUTE_NAME_START_CHAR: ATTRIBUTE_NAME_START_CHAR,
ATTRIBUTE_NAME_CHAR: ATTRIBUTE_NAME_START_CHAR + '\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040',
/**
* Map from property "standard name" to an object with info about how to set
* the property in the DOM. Each object contains:
*
* attributeName:
* Used when rendering markup or with `*Attribute()`.
* attributeNamespace
* propertyName:
* Used on DOM node instances. (This includes properties that mutate due to
* external factors.)
* mutationMethod:
* If non-null, used instead of the property or `setAttribute()` after
* initial render.
* mustUseProperty:
* Whether the property must be accessed and mutated as an object property.
* hasBooleanValue:
* Whether the property should be removed when set to a falsey value.
* hasNumericValue:
* Whether the property must be numeric or parse as a numeric and should be
* removed when set to a falsey value.
* hasPositiveNumericValue:
* Whether the property must be positive numeric or parse as a positive
* numeric and should be removed when set to a falsey value.
* hasOverloadedBooleanValue:
* Whether the property can be used as a flag as well as with a value.
* Removed when strictly equal to false; present without a value when
* strictly equal to true; present with a value otherwise.
*/
properties: {},
/**
* Mapping from lowercase property names to the properly cased version, used
* to warn in the case of missing properties. Available only in __DEV__.
*
* autofocus is predefined, because adding it to the property whitelist
* causes unintended side effects.
*
* @type {Object}
*/
getPossibleStandardName: process.env.NODE_ENV !== 'production' ? { autofocus: 'autoFocus' } : null,
/**
* All of the isCustomAttribute() functions that have been injected.
*/
_isCustomAttributeFunctions: [],
/**
* Checks whether a property name is a custom attribute.
* @method
*/
isCustomAttribute: function (attributeName) {
for (var i = 0; i < DOMProperty._isCustomAttributeFunctions.length; i++) {
var isCustomAttributeFn = DOMProperty._isCustomAttributeFunctions[i];
if (isCustomAttributeFn(attributeName)) {
return true;
}
}
return false;
},
injection: DOMPropertyInjection
};
module.exports = DOMProperty;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 38 */
/*!***************************************************!*\
!*** ./~/react-dom/lib/ReactDOMComponentFlags.js ***!
\***************************************************/
/***/ function(module, exports) {
/**
* Copyright 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var ReactDOMComponentFlags = {
hasCachedChildNodes: 1 << 0
};
module.exports = ReactDOMComponentFlags;
/***/ },
/* 39 */
/*!**************************************************!*\
!*** ./~/react-dom/lib/ReactDefaultInjection.js ***!
\**************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var ARIADOMPropertyConfig = __webpack_require__(/*! ./ARIADOMPropertyConfig */ 40);
var BeforeInputEventPlugin = __webpack_require__(/*! ./BeforeInputEventPlugin */ 41);
var ChangeEventPlugin = __webpack_require__(/*! ./ChangeEventPlugin */ 56);
var DefaultEventPluginOrder = __webpack_require__(/*! ./DefaultEventPluginOrder */ 73);
var EnterLeaveEventPlugin = __webpack_require__(/*! ./EnterLeaveEventPlugin */ 74);
var HTMLDOMPropertyConfig = __webpack_require__(/*! ./HTMLDOMPropertyConfig */ 79);
var ReactComponentBrowserEnvironment = __webpack_require__(/*! ./ReactComponentBrowserEnvironment */ 80);
var ReactDOMComponent = __webpack_require__(/*! ./ReactDOMComponent */ 93);
var ReactDOMComponentTree = __webpack_require__(/*! ./ReactDOMComponentTree */ 35);
var ReactDOMEmptyComponent = __webpack_require__(/*! ./ReactDOMEmptyComponent */ 138);
var ReactDOMTreeTraversal = __webpack_require__(/*! ./ReactDOMTreeTraversal */ 139);
var ReactDOMTextComponent = __webpack_require__(/*! ./ReactDOMTextComponent */ 140);
var ReactDefaultBatchingStrategy = __webpack_require__(/*! ./ReactDefaultBatchingStrategy */ 141);
var ReactEventListener = __webpack_require__(/*! ./ReactEventListener */ 142);
var ReactInjection = __webpack_require__(/*! ./ReactInjection */ 145);
var ReactReconcileTransaction = __webpack_require__(/*! ./ReactReconcileTransaction */ 146);
var SVGDOMPropertyConfig = __webpack_require__(/*! ./SVGDOMPropertyConfig */ 154);
var SelectEventPlugin = __webpack_require__(/*! ./SelectEventPlugin */ 155);
var SimpleEventPlugin = __webpack_require__(/*! ./SimpleEventPlugin */ 156);
var alreadyInjected = false;
function inject() {
if (alreadyInjected) {
// TODO: This is currently true because these injections are shared between
// the client and the server package. They should be built independently
// and not share any injection state. Then this problem will be solved.
return;
}
alreadyInjected = true;
ReactInjection.EventEmitter.injectReactEventListener(ReactEventListener);
/**
* Inject modules for resolving DOM hierarchy and plugin ordering.
*/
ReactInjection.EventPluginHub.injectEventPluginOrder(DefaultEventPluginOrder);
ReactInjection.EventPluginUtils.injectComponentTree(ReactDOMComponentTree);
ReactInjection.EventPluginUtils.injectTreeTraversal(ReactDOMTreeTraversal);
/**
* Some important event plugins included by default (without having to require
* them).
*/
ReactInjection.EventPluginHub.injectEventPluginsByName({
SimpleEventPlugin: SimpleEventPlugin,
EnterLeaveEventPlugin: EnterLeaveEventPlugin,
ChangeEventPlugin: ChangeEventPlugin,
SelectEventPlugin: SelectEventPlugin,
BeforeInputEventPlugin: BeforeInputEventPlugin
});
ReactInjection.HostComponent.injectGenericComponentClass(ReactDOMComponent);
ReactInjection.HostComponent.injectTextComponentClass(ReactDOMTextComponent);
ReactInjection.DOMProperty.injectDOMPropertyConfig(ARIADOMPropertyConfig);
ReactInjection.DOMProperty.injectDOMPropertyConfig(HTMLDOMPropertyConfig);
ReactInjection.DOMProperty.injectDOMPropertyConfig(SVGDOMPropertyConfig);
ReactInjection.EmptyComponent.injectEmptyComponentFactory(function (instantiate) {
return new ReactDOMEmptyComponent(instantiate);
});
ReactInjection.Updates.injectReconcileTransaction(ReactReconcileTransaction);
ReactInjection.Updates.injectBatchingStrategy(ReactDefaultBatchingStrategy);
ReactInjection.Component.injectEnvironment(ReactComponentBrowserEnvironment);
}
module.exports = {
inject: inject
};
/***/ },
/* 40 */
/*!**************************************************!*\
!*** ./~/react-dom/lib/ARIADOMPropertyConfig.js ***!
\**************************************************/
/***/ function(module, exports) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var ARIADOMPropertyConfig = {
Properties: {
// Global States and Properties
'aria-current': 0, // state
'aria-details': 0,
'aria-disabled': 0, // state
'aria-hidden': 0, // state
'aria-invalid': 0, // state
'aria-keyshortcuts': 0,
'aria-label': 0,
'aria-roledescription': 0,
// Widget Attributes
'aria-autocomplete': 0,
'aria-checked': 0,
'aria-expanded': 0,
'aria-haspopup': 0,
'aria-level': 0,
'aria-modal': 0,
'aria-multiline': 0,
'aria-multiselectable': 0,
'aria-orientation': 0,
'aria-placeholder': 0,
'aria-pressed': 0,
'aria-readonly': 0,
'aria-required': 0,
'aria-selected': 0,
'aria-sort': 0,
'aria-valuemax': 0,
'aria-valuemin': 0,
'aria-valuenow': 0,
'aria-valuetext': 0,
// Live Region Attributes
'aria-atomic': 0,
'aria-busy': 0,
'aria-live': 0,
'aria-relevant': 0,
// Drag-and-Drop Attributes
'aria-dropeffect': 0,
'aria-grabbed': 0,
// Relationship Attributes
'aria-activedescendant': 0,
'aria-colcount': 0,
'aria-colindex': 0,
'aria-colspan': 0,
'aria-controls': 0,
'aria-describedby': 0,
'aria-errormessage': 0,
'aria-flowto': 0,
'aria-labelledby': 0,
'aria-owns': 0,
'aria-posinset': 0,
'aria-rowcount': 0,
'aria-rowindex': 0,
'aria-rowspan': 0,
'aria-setsize': 0
},
DOMAttributeNames: {},
DOMPropertyNames: {}
};
module.exports = ARIADOMPropertyConfig;
/***/ },
/* 41 */
/*!***************************************************!*\
!*** ./~/react-dom/lib/BeforeInputEventPlugin.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var EventPropagators = __webpack_require__(/*! ./EventPropagators */ 42);
var ExecutionEnvironment = __webpack_require__(/*! fbjs/lib/ExecutionEnvironment */ 49);
var FallbackCompositionState = __webpack_require__(/*! ./FallbackCompositionState */ 50);
var SyntheticCompositionEvent = __webpack_require__(/*! ./SyntheticCompositionEvent */ 53);
var SyntheticInputEvent = __webpack_require__(/*! ./SyntheticInputEvent */ 55);
var END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space
var START_KEYCODE = 229;
var canUseCompositionEvent = ExecutionEnvironment.canUseDOM && 'CompositionEvent' in window;
var documentMode = null;
if (ExecutionEnvironment.canUseDOM && 'documentMode' in document) {
documentMode = document.documentMode;
}
// Webkit offers a very useful `textInput` event that can be used to
// directly represent `beforeInput`. The IE `textinput` event is not as
// useful, so we don't use it.
var canUseTextInputEvent = ExecutionEnvironment.canUseDOM && 'TextEvent' in window && !documentMode && !isPresto();
// In IE9+, we have access to composition events, but the data supplied
// by the native compositionend event may be incorrect. Japanese ideographic
// spaces, for instance (\u3000) are not recorded correctly.
var useFallbackCompositionData = ExecutionEnvironment.canUseDOM && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11);
/**
* Opera <= 12 includes TextEvent in window, but does not fire
* text input events. Rely on keypress instead.
*/
function isPresto() {
var opera = window.opera;
return typeof opera === 'object' && typeof opera.version === 'function' && parseInt(opera.version(), 10) <= 12;
}
var SPACEBAR_CODE = 32;
var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE);
// Events and their corresponding property names.
var eventTypes = {
beforeInput: {
phasedRegistrationNames: {
bubbled: 'onBeforeInput',
captured: 'onBeforeInputCapture'
},
dependencies: ['topCompositionEnd', 'topKeyPress', 'topTextInput', 'topPaste']
},
compositionEnd: {
phasedRegistrationNames: {
bubbled: 'onCompositionEnd',
captured: 'onCompositionEndCapture'
},
dependencies: ['topBlur', 'topCompositionEnd', 'topKeyDown', 'topKeyPress', 'topKeyUp', 'topMouseDown']
},
compositionStart: {
phasedRegistrationNames: {
bubbled: 'onCompositionStart',
captured: 'onCompositionStartCapture'
},
dependencies: ['topBlur', 'topCompositionStart', 'topKeyDown', 'topKeyPress', 'topKeyUp', 'topMouseDown']
},
compositionUpdate: {
phasedRegistrationNames: {
bubbled: 'onCompositionUpdate',
captured: 'onCompositionUpdateCapture'
},
dependencies: ['topBlur', 'topCompositionUpdate', 'topKeyDown', 'topKeyPress', 'topKeyUp', 'topMouseDown']
}
};
// Track whether we've ever handled a keypress on the space key.
var hasSpaceKeypress = false;
/**
* Return whether a native keypress event is assumed to be a command.
* This is required because Firefox fires `keypress` events for key commands
* (cut, copy, select-all, etc.) even though no character is inserted.
*/
function isKeypressCommand(nativeEvent) {
return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&
// ctrlKey && altKey is equivalent to AltGr, and is not a command.
!(nativeEvent.ctrlKey && nativeEvent.altKey);
}
/**
* Translate native top level events into event types.
*
* @param {string} topLevelType
* @return {object}
*/
function getCompositionEventType(topLevelType) {
switch (topLevelType) {
case 'topCompositionStart':
return eventTypes.compositionStart;
case 'topCompositionEnd':
return eventTypes.compositionEnd;
case 'topCompositionUpdate':
return eventTypes.compositionUpdate;
}
}
/**
* Does our fallback best-guess model think this event signifies that
* composition has begun?
*
* @param {string} topLevelType
* @param {object} nativeEvent
* @return {boolean}
*/
function isFallbackCompositionStart(topLevelType, nativeEvent) {
return topLevelType === 'topKeyDown' && nativeEvent.keyCode === START_KEYCODE;
}
/**
* Does our fallback mode think that this event is the end of composition?
*
* @param {string} topLevelType
* @param {object} nativeEvent
* @return {boolean}
*/
function isFallbackCompositionEnd(topLevelType, nativeEvent) {
switch (topLevelType) {
case 'topKeyUp':
// Command keys insert or clear IME input.
return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;
case 'topKeyDown':
// Expect IME keyCode on each keydown. If we get any other
// code we must have exited earlier.
return nativeEvent.keyCode !== START_KEYCODE;
case 'topKeyPress':
case 'topMouseDown':
case 'topBlur':
// Events are not possible without cancelling IME.
return true;
default:
return false;
}
}
/**
* Google Input Tools provides composition data via a CustomEvent,
* with the `data` property populated in the `detail` object. If this
* is available on the event object, use it. If not, this is a plain
* composition event and we have nothing special to extract.
*
* @param {object} nativeEvent
* @return {?string}
*/
function getDataFromCustomEvent(nativeEvent) {
var detail = nativeEvent.detail;
if (typeof detail === 'object' && 'data' in detail) {
return detail.data;
}
return null;
}
// Track the current IME composition fallback object, if any.
var currentComposition = null;
/**
* @return {?object} A SyntheticCompositionEvent.
*/
function extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
var eventType;
var fallbackData;
if (canUseCompositionEvent) {
eventType = getCompositionEventType(topLevelType);
} else if (!currentComposition) {
if (isFallbackCompositionStart(topLevelType, nativeEvent)) {
eventType = eventTypes.compositionStart;
}
} else if (isFallbackCompositionEnd(topLevelType, nativeEvent)) {
eventType = eventTypes.compositionEnd;
}
if (!eventType) {
return null;
}
if (useFallbackCompositionData) {
// The current composition is stored statically and must not be
// overwritten while composition continues.
if (!currentComposition && eventType === eventTypes.compositionStart) {
currentComposition = FallbackCompositionState.getPooled(nativeEventTarget);
} else if (eventType === eventTypes.compositionEnd) {
if (currentComposition) {
fallbackData = currentComposition.getData();
}
}
}
var event = SyntheticCompositionEvent.getPooled(eventType, targetInst, nativeEvent, nativeEventTarget);
if (fallbackData) {
// Inject data generated from fallback path into the synthetic event.
// This matches the property of native CompositionEventInterface.
event.data = fallbackData;
} else {
var customData = getDataFromCustomEvent(nativeEvent);
if (customData !== null) {
event.data = customData;
}
}
EventPropagators.accumulateTwoPhaseDispatches(event);
return event;
}
/**
* @param {string} topLevelType Record from `EventConstants`.
* @param {object} nativeEvent Native browser event.
* @return {?string} The string corresponding to this `beforeInput` event.
*/
function getNativeBeforeInputChars(topLevelType, nativeEvent) {
switch (topLevelType) {
case 'topCompositionEnd':
return getDataFromCustomEvent(nativeEvent);
case 'topKeyPress':
/**
* If native `textInput` events are available, our goal is to make
* use of them. However, there is a special case: the spacebar key.
* In Webkit, preventing default on a spacebar `textInput` event
* cancels character insertion, but it *also* causes the browser
* to fall back to its default spacebar behavior of scrolling the
* page.
*
* Tracking at:
* https://code.google.com/p/chromium/issues/detail?id=355103
*
* To avoid this issue, use the keypress event as if no `textInput`
* event is available.
*/
var which = nativeEvent.which;
if (which !== SPACEBAR_CODE) {
return null;
}
hasSpaceKeypress = true;
return SPACEBAR_CHAR;
case 'topTextInput':
// Record the characters to be added to the DOM.
var chars = nativeEvent.data;
// If it's a spacebar character, assume that we have already handled
// it at the keypress level and bail immediately. Android Chrome
// doesn't give us keycodes, so we need to blacklist it.
if (chars === SPACEBAR_CHAR && hasSpaceKeypress) {
return null;
}
return chars;
default:
// For other native event types, do nothing.
return null;
}
}
/**
* For browsers that do not provide the `textInput` event, extract the
* appropriate string to use for SyntheticInputEvent.
*
* @param {string} topLevelType Record from `EventConstants`.
* @param {object} nativeEvent Native browser event.
* @return {?string} The fallback string for this `beforeInput` event.
*/
function getFallbackBeforeInputChars(topLevelType, nativeEvent) {
// If we are currently composing (IME) and using a fallback to do so,
// try to extract the composed characters from the fallback object.
// If composition event is available, we extract a string only at
// compositionevent, otherwise extract it at fallback events.
if (currentComposition) {
if (topLevelType === 'topCompositionEnd' || !canUseCompositionEvent && isFallbackCompositionEnd(topLevelType, nativeEvent)) {
var chars = currentComposition.getData();
FallbackCompositionState.release(currentComposition);
currentComposition = null;
return chars;
}
return null;
}
switch (topLevelType) {
case 'topPaste':
// If a paste event occurs after a keypress, throw out the input
// chars. Paste events should not lead to BeforeInput events.
return null;
case 'topKeyPress':
/**
* As of v27, Firefox may fire keypress events even when no character
* will be inserted. A few possibilities:
*
* - `which` is `0`. Arrow keys, Esc key, etc.
*
* - `which` is the pressed key code, but no char is available.
* Ex: 'AltGr + d` in Polish. There is no modified character for
* this key combination and no character is inserted into the
* document, but FF fires the keypress for char code `100` anyway.
* No `input` event will occur.
*
* - `which` is the pressed key code, but a command combination is
* being used. Ex: `Cmd+C`. No character is inserted, and no
* `input` event will occur.
*/
if (nativeEvent.which && !isKeypressCommand(nativeEvent)) {
return String.fromCharCode(nativeEvent.which);
}
return null;
case 'topCompositionEnd':
return useFallbackCompositionData ? null : nativeEvent.data;
default:
return null;
}
}
/**
* Extract a SyntheticInputEvent for `beforeInput`, based on either native
* `textInput` or fallback behavior.
*
* @return {?object} A SyntheticInputEvent.
*/
function extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
var chars;
if (canUseTextInputEvent) {
chars = getNativeBeforeInputChars(topLevelType, nativeEvent);
} else {
chars = getFallbackBeforeInputChars(topLevelType, nativeEvent);
}
// If no characters are being inserted, no BeforeInput event should
// be fired.
if (!chars) {
return null;
}
var event = SyntheticInputEvent.getPooled(eventTypes.beforeInput, targetInst, nativeEvent, nativeEventTarget);
event.data = chars;
EventPropagators.accumulateTwoPhaseDispatches(event);
return event;
}
/**
* Create an `onBeforeInput` event to match
* http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105/#events-inputevents.
*
* This event plugin is based on the native `textInput` event
* available in Chrome, Safari, Opera, and IE. This event fires after
* `onKeyPress` and `onCompositionEnd`, but before `onInput`.
*
* `beforeInput` is spec'd but not implemented in any browsers, and
* the `input` event does not provide any useful information about what has
* actually been added, contrary to the spec. Thus, `textInput` is the best
* available event to identify the characters that have actually been inserted
* into the target node.
*
* This plugin is also responsible for emitting `composition` events, thus
* allowing us to share composition fallback code for both `beforeInput` and
* `composition` event types.
*/
var BeforeInputEventPlugin = {
eventTypes: eventTypes,
extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
return [extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget), extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget)];
}
};
module.exports = BeforeInputEventPlugin;
/***/ },
/* 42 */
/*!*********************************************!*\
!*** ./~/react-dom/lib/EventPropagators.js ***!
\*********************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var EventPluginHub = __webpack_require__(/*! ./EventPluginHub */ 43);
var EventPluginUtils = __webpack_require__(/*! ./EventPluginUtils */ 45);
var accumulateInto = __webpack_require__(/*! ./accumulateInto */ 47);
var forEachAccumulated = __webpack_require__(/*! ./forEachAccumulated */ 48);
var warning = __webpack_require__(/*! fbjs/lib/warning */ 12);
var getListener = EventPluginHub.getListener;
/**
* Some event types have a notion of different registration names for different
* "phases" of propagation. This finds listeners by a given phase.
*/
function listenerAtPhase(inst, event, propagationPhase) {
var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];
return getListener(inst, registrationName);
}
/**
* Tags a `SyntheticEvent` with dispatched listeners. Creating this function
* here, allows us to not have to bind or create functions for each event.
* Mutating the event's members allows us to not have to create a wrapping
* "dispatch" object that pairs the event with the listener.
*/
function accumulateDirectionalDispatches(inst, phase, event) {
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(inst, 'Dispatching inst must not be null') : void 0;
}
var listener = listenerAtPhase(inst, event, phase);
if (listener) {
event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);
}
}
/**
* Collect dispatches (must be entirely collected before dispatching - see unit
* tests). Lazily allocate the array to conserve memory. We must loop through
* each event and perform the traversal for each one. We cannot perform a
* single traversal for the entire collection of events because each event may
* have a different target.
*/
function accumulateTwoPhaseDispatchesSingle(event) {
if (event && event.dispatchConfig.phasedRegistrationNames) {
EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);
}
}
/**
* Same as `accumulateTwoPhaseDispatchesSingle`, but skips over the targetID.
*/
function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {
if (event && event.dispatchConfig.phasedRegistrationNames) {
var targetInst = event._targetInst;
var parentInst = targetInst ? EventPluginUtils.getParentInstance(targetInst) : null;
EventPluginUtils.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);
}
}
/**
* Accumulates without regard to direction, does not look for phased
* registration names. Same as `accumulateDirectDispatchesSingle` but without
* requiring that the `dispatchMarker` be the same as the dispatched ID.
*/
function accumulateDispatches(inst, ignoredDirection, event) {
if (event && event.dispatchConfig.registrationName) {
var registrationName = event.dispatchConfig.registrationName;
var listener = getListener(inst, registrationName);
if (listener) {
event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);
}
}
}
/**
* Accumulates dispatches on an `SyntheticEvent`, but only for the
* `dispatchMarker`.
* @param {SyntheticEvent} event
*/
function accumulateDirectDispatchesSingle(event) {
if (event && event.dispatchConfig.registrationName) {
accumulateDispatches(event._targetInst, null, event);
}
}
function accumulateTwoPhaseDispatches(events) {
forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle);
}
function accumulateTwoPhaseDispatchesSkipTarget(events) {
forEachAccumulated(events, accumulateTwoPhaseDispatchesSingleSkipTarget);
}
function accumulateEnterLeaveDispatches(leave, enter, from, to) {
EventPluginUtils.traverseEnterLeave(from, to, accumulateDispatches, leave, enter);
}
function accumulateDirectDispatches(events) {
forEachAccumulated(events, accumulateDirectDispatchesSingle);
}
/**
* A small set of propagation patterns, each of which will accept a small amount
* of information, and generate a set of "dispatch ready event objects" - which
* are sets of events that have already been annotated with a set of dispatched
* listener functions/ids. The API is designed this way to discourage these
* propagation strategies from actually executing the dispatches, since we
* always want to collect the entire set of dispatches before executing event a
* single one.
*
* @constructor EventPropagators
*/
var EventPropagators = {
accumulateTwoPhaseDispatches: accumulateTwoPhaseDispatches,
accumulateTwoPhaseDispatchesSkipTarget: accumulateTwoPhaseDispatchesSkipTarget,
accumulateDirectDispatches: accumulateDirectDispatches,
accumulateEnterLeaveDispatches: accumulateEnterLeaveDispatches
};
module.exports = EventPropagators;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 43 */
/*!*******************************************!*\
!*** ./~/react-dom/lib/EventPluginHub.js ***!
\*******************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var _prodInvariant = __webpack_require__(/*! ./reactProdInvariant */ 36);
var EventPluginRegistry = __webpack_require__(/*! ./EventPluginRegistry */ 44);
var EventPluginUtils = __webpack_require__(/*! ./EventPluginUtils */ 45);
var ReactErrorUtils = __webpack_require__(/*! ./ReactErrorUtils */ 46);
var accumulateInto = __webpack_require__(/*! ./accumulateInto */ 47);
var forEachAccumulated = __webpack_require__(/*! ./forEachAccumulated */ 48);
var invariant = __webpack_require__(/*! fbjs/lib/invariant */ 9);
/**
* Internal store for event listeners
*/
var listenerBank = {};
/**
* Internal queue of events that have accumulated their dispatches and are
* waiting to have their dispatches executed.
*/
var eventQueue = null;
/**
* Dispatches an event and releases it back into the pool, unless persistent.
*
* @param {?object} event Synthetic event to be dispatched.
* @param {boolean} simulated If the event is simulated (changes exn behavior)
* @private
*/
var executeDispatchesAndRelease = function (event, simulated) {
if (event) {
EventPluginUtils.executeDispatchesInOrder(event, simulated);
if (!event.isPersistent()) {
event.constructor.release(event);
}
}
};
var executeDispatchesAndReleaseSimulated = function (e) {
return executeDispatchesAndRelease(e, true);
};
var executeDispatchesAndReleaseTopLevel = function (e) {
return executeDispatchesAndRelease(e, false);
};
var getDictionaryKey = function (inst) {
// Prevents V8 performance issue:
// https://github.com/facebook/react/pull/7232
return '.' + inst._rootNodeID;
};
function isInteractive(tag) {
return tag === 'button' || tag === 'input' || tag === 'select' || tag === 'textarea';
}
function shouldPreventMouseEvent(name, type, props) {
switch (name) {
case 'onClick':
case 'onClickCapture':
case 'onDoubleClick':
case 'onDoubleClickCapture':
case 'onMouseDown':
case 'onMouseDownCapture':
case 'onMouseMove':
case 'onMouseMoveCapture':
case 'onMouseUp':
case 'onMouseUpCapture':
return !!(props.disabled && isInteractive(type));
default:
return false;
}
}
/**
* This is a unified interface for event plugins to be installed and configured.
*
* Event plugins can implement the following properties:
*
* `extractEvents` {function(string, DOMEventTarget, string, object): *}
* Required. When a top-level event is fired, this method is expected to
* extract synthetic events that will in turn be queued and dispatched.
*
* `eventTypes` {object}
* Optional, plugins that fire events must publish a mapping of registration
* names that are used to register listeners. Values of this mapping must
* be objects that contain `registrationName` or `phasedRegistrationNames`.
*
* `executeDispatch` {function(object, function, string)}
* Optional, allows plugins to override how an event gets dispatched. By
* default, the listener is simply invoked.
*
* Each plugin that is injected into `EventsPluginHub` is immediately operable.
*
* @public
*/
var EventPluginHub = {
/**
* Methods for injecting dependencies.
*/
injection: {
/**
* @param {array} InjectedEventPluginOrder
* @public
*/
injectEventPluginOrder: EventPluginRegistry.injectEventPluginOrder,
/**
* @param {object} injectedNamesToPlugins Map from names to plugin modules.
*/
injectEventPluginsByName: EventPluginRegistry.injectEventPluginsByName
},
/**
* Stores `listener` at `listenerBank[registrationName][key]`. Is idempotent.
*
* @param {object} inst The instance, which is the source of events.
* @param {string} registrationName Name of listener (e.g. `onClick`).
* @param {function} listener The callback to store.
*/
putListener: function (inst, registrationName, listener) {
!(typeof listener === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected %s listener to be a function, instead got type %s', registrationName, typeof listener) : _prodInvariant('94', registrationName, typeof listener) : void 0;
var key = getDictionaryKey(inst);
var bankForRegistrationName = listenerBank[registrationName] || (listenerBank[registrationName] = {});
bankForRegistrationName[key] = listener;
var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];
if (PluginModule && PluginModule.didPutListener) {
PluginModule.didPutListener(inst, registrationName, listener);
}
},
/**
* @param {object} inst The instance, which is the source of events.
* @param {string} registrationName Name of listener (e.g. `onClick`).
* @return {?function} The stored callback.
*/
getListener: function (inst, registrationName) {
// TODO: shouldPreventMouseEvent is DOM-specific and definitely should not
// live here; needs to be moved to a better place soon
var bankForRegistrationName = listenerBank[registrationName];
if (shouldPreventMouseEvent(registrationName, inst._currentElement.type, inst._currentElement.props)) {
return null;
}
var key = getDictionaryKey(inst);
return bankForRegistrationName && bankForRegistrationName[key];
},
/**
* Deletes a listener from the registration bank.
*
* @param {object} inst The instance, which is the source of events.
* @param {string} registrationName Name of listener (e.g. `onClick`).
*/
deleteListener: function (inst, registrationName) {
var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];
if (PluginModule && PluginModule.willDeleteListener) {
PluginModule.willDeleteListener(inst, registrationName);
}
var bankForRegistrationName = listenerBank[registrationName];
// TODO: This should never be null -- when is it?
if (bankForRegistrationName) {
var key = getDictionaryKey(inst);
delete bankForRegistrationName[key];
}
},
/**
* Deletes all listeners for the DOM element with the supplied ID.
*
* @param {object} inst The instance, which is the source of events.
*/
deleteAllListeners: function (inst) {
var key = getDictionaryKey(inst);
for (var registrationName in listenerBank) {
if (!listenerBank.hasOwnProperty(registrationName)) {
continue;
}
if (!listenerBank[registrationName][key]) {
continue;
}
var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];
if (PluginModule && PluginModule.willDeleteListener) {
PluginModule.willDeleteListener(inst, registrationName);
}
delete listenerBank[registrationName][key];
}
},
/**
* Allows registered plugins an opportunity to extract events from top-level
* native browser events.
*
* @return {*} An accumulation of synthetic events.
* @internal
*/
extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
var events;
var plugins = EventPluginRegistry.plugins;
for (var i = 0; i < plugins.length; i++) {
// Not every plugin in the ordering may be loaded at runtime.
var possiblePlugin = plugins[i];
if (possiblePlugin) {
var extractedEvents = possiblePlugin.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget);
if (extractedEvents) {
events = accumulateInto(events, extractedEvents);
}
}
}
return events;
},
/**
* Enqueues a synthetic event that should be dispatched when
* `processEventQueue` is invoked.
*
* @param {*} events An accumulation of synthetic events.
* @internal
*/
enqueueEvents: function (events) {
if (events) {
eventQueue = accumulateInto(eventQueue, events);
}
},
/**
* Dispatches all synthetic events on the event queue.
*
* @internal
*/
processEventQueue: function (simulated) {
// Set `eventQueue` to null before processing it so that we can tell if more
// events get enqueued while processing.
var processingEventQueue = eventQueue;
eventQueue = null;
if (simulated) {
forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseSimulated);
} else {
forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel);
}
!!eventQueue ? process.env.NODE_ENV !== 'production' ? invariant(false, 'processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.') : _prodInvariant('95') : void 0;
// This would be a good time to rethrow if any of the event handlers threw.
ReactErrorUtils.rethrowCaughtError();
},
/**
* These are needed for tests only. Do not use!
*/
__purge: function () {
listenerBank = {};
},
__getListenerBank: function () {
return listenerBank;
}
};
module.exports = EventPluginHub;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 44 */
/*!************************************************!*\
!*** ./~/react-dom/lib/EventPluginRegistry.js ***!
\************************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
'use strict';
var _prodInvariant = __webpack_require__(/*! ./reactProdInvariant */ 36);
var invariant = __webpack_require__(/*! fbjs/lib/invariant */ 9);
/**
* Injectable ordering of event plugins.
*/
var eventPluginOrder = null;
/**
* Injectable mapping from names to event plugin modules.
*/
var namesToPlugins = {};
/**
* Recomputes the plugin list using the injected plugins and plugin ordering.
*
* @private
*/
function recomputePluginOrdering() {
if (!eventPluginOrder) {
// Wait until an `eventPluginOrder` is injected.
return;
}
for (var pluginName in namesToPlugins) {
var pluginModule = namesToPlugins[pluginName];
var pluginIndex = eventPluginOrder.indexOf(pluginName);
!(pluginIndex > -1) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : _prodInvariant('96', pluginName) : void 0;
if (EventPluginRegistry.plugins[pluginIndex]) {
continue;
}
!pluginModule.extractEvents ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : _prodInvariant('97', pluginName) : void 0;
EventPluginRegistry.plugins[pluginIndex] = pluginModule;
var publishedEvents = pluginModule.eventTypes;
for (var eventName in publishedEvents) {
!publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : _prodInvariant('98', eventName, pluginName) : void 0;
}
}
}
/**
* Publishes an event so that it can be dispatched by the supplied plugin.
*
* @param {object} dispatchConfig Dispatch configuration for the event.
* @param {object} PluginModule Plugin publishing the event.
* @return {boolean} True if the event was successfully published.
* @private
*/
function publishEventForPlugin(dispatchConfig, pluginModule, eventName) {
!!EventPluginRegistry.eventNameDispatchConfigs.hasOwnProperty(eventName) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same event name, `%s`.', eventName) : _prodInvariant('99', eventName) : void 0;
EventPluginRegistry.eventNameDispatchConfigs[eventName] = dispatchConfig;
var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;
if (phasedRegistrationNames) {
for (var phaseName in phasedRegistrationNames) {
if (phasedRegistrationNames.hasOwnProperty(phaseName)) {
var phasedRegistrationName = phasedRegistrationNames[phaseName];
publishRegistrationName(phasedRegistrationName, pluginModule, eventName);
}
}
return true;
} else if (dispatchConfig.registrationName) {
publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName);
return true;
}
return false;
}
/**
* Publishes a registration name that is used to identify dispatched events and
* can be used with `EventPluginHub.putListener` to register listeners.
*
* @param {string} registrationName Registration name to add.
* @param {object} PluginModule Plugin publishing the event.
* @private
*/
function publishRegistrationName(registrationName, pluginModule, eventName) {
!!EventPluginRegistry.registrationNameModules[registrationName] ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same registration name, `%s`.', registrationName) : _prodInvariant('100', registrationName) : void 0;
EventPluginRegistry.registrationNameModules[registrationName] = pluginModule;
EventPluginRegistry.registrationNameDependencies[registrationName] = pluginModule.eventTypes[eventName].dependencies;
if (process.env.NODE_ENV !== 'production') {
var lowerCasedName = registrationName.toLowerCase();
EventPluginRegistry.possibleRegistrationNames[lowerCasedName] = registrationName;
if (registrationName === 'onDoubleClick') {
EventPluginRegistry.possibleRegistrationNames.ondblclick = registrationName;
}
}
}
/**
* Registers plugins so that they can extract and dispatch events.
*
* @see {EventPluginHub}
*/
var EventPluginRegistry = {
/**
* Ordered list of injected plugins.
*/
plugins: [],
/**
* Mapping from event name to dispatch config
*/
eventNameDispatchConfigs: {},
/**
* Mapping from registration name to plugin module
*/
registrationNameModules: {},
/**
* Mapping from registration name to event name
*/
registrationNameDependencies: {},
/**
* Mapping from lowercase registration names to the properly cased version,
* used to warn in the case of missing event handlers. Available
* only in __DEV__.
* @type {Object}
*/
possibleRegistrationNames: process.env.NODE_ENV !== 'production' ? {} : null,
// Trust the developer to only use possibleRegistrationNames in __DEV__
/**
* Injects an ordering of plugins (by plugin name). This allows the ordering
* to be decoupled from injection of the actual plugins so that ordering is
* always deterministic regardless of packaging, on-the-fly injection, etc.
*
* @param {array} InjectedEventPluginOrder
* @internal
* @see {EventPluginHub.injection.injectEventPluginOrder}
*/
injectEventPluginOrder: function (injectedEventPluginOrder) {
!!eventPluginOrder ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React.') : _prodInvariant('101') : void 0;
// Clone the ordering so it cannot be dynamically mutated.
eventPluginOrder = Array.prototype.slice.call(injectedEventPluginOrder);
recomputePluginOrdering();
},
/**
* Injects plugins to be used by `EventPluginHub`. The plugin names must be
* in the ordering injected by `injectEventPluginOrder`.
*
* Plugins can be injected as part of page initialization or on-the-fly.
*
* @param {object} injectedNamesToPlugins Map from names to plugin modules.
* @internal
* @see {EventPluginHub.injection.injectEventPluginsByName}
*/
injectEventPluginsByName: function (injectedNamesToPlugins) {
var isOrderingDirty = false;
for (var pluginName in injectedNamesToPlugins) {
if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) {
continue;
}
var pluginModule = injectedNamesToPlugins[pluginName];
if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== pluginModule) {
!!namesToPlugins[pluginName] ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject two different event plugins using the same name, `%s`.', pluginName) : _prodInvariant('102', pluginName) : void 0;
namesToPlugins[pluginName] = pluginModule;
isOrderingDirty = true;
}
}
if (isOrderingDirty) {
recomputePluginOrdering();
}
},
/**
* Looks up the plugin for the supplied event.
*
* @param {object} event A synthetic event.
* @return {?object} The plugin that created the supplied event.
* @internal
*/
getPluginModuleForEvent: function (event) {
var dispatchConfig = event.dispatchConfig;
if (dispatchConfig.registrationName) {
return EventPluginRegistry.registrationNameModules[dispatchConfig.registrationName] || null;
}
if (dispatchConfig.phasedRegistrationNames !== undefined) {
// pulling phasedRegistrationNames out of dispatchConfig helps Flow see
// that it is not undefined.
var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;
for (var phase in phasedRegistrationNames) {
if (!phasedRegistrationNames.hasOwnProperty(phase)) {
continue;
}
var pluginModule = EventPluginRegistry.registrationNameModules[phasedRegistrationNames[phase]];
if (pluginModule) {
return pluginModule;
}
}
}
return null;
},
/**
* Exposed for unit testing.
* @private
*/
_resetEventPlugins: function () {
eventPluginOrder = null;
for (var pluginName in namesToPlugins) {
if (namesToPlugins.hasOwnProperty(pluginName)) {
delete namesToPlugins[pluginName];
}
}
EventPluginRegistry.plugins.length = 0;
var eventNameDispatchConfigs = EventPluginRegistry.eventNameDispatchConfigs;
for (var eventName in eventNameDispatchConfigs) {
if (eventNameDispatchConfigs.hasOwnProperty(eventName)) {
delete eventNameDispatchConfigs[eventName];
}
}
var registrationNameModules = EventPluginRegistry.registrationNameModules;
for (var registrationName in registrationNameModules) {
if (registrationNameModules.hasOwnProperty(registrationName)) {
delete registrationNameModules[registrationName];
}
}
if (process.env.NODE_ENV !== 'production') {
var possibleRegistrationNames = EventPluginRegistry.possibleRegistrationNames;
for (var lowerCasedName in possibleRegistrationNames) {
if (possibleRegistrationNames.hasOwnProperty(lowerCasedName)) {
delete possibleRegistrationNames[lowerCasedName];
}
}
}
}
};
module.exports = EventPluginRegistry;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 45 */
/*!*********************************************!*\
!*** ./~/react-dom/lib/EventPluginUtils.js ***!
\*********************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var _prodInvariant = __webpack_require__(/*! ./reactProdInvariant */ 36);
var ReactErrorUtils = __webpack_require__(/*! ./ReactErrorUtils */ 46);
var invariant = __webpack_require__(/*! fbjs/lib/invariant */ 9);
var warning = __webpack_require__(/*! fbjs/lib/warning */ 12);
/**
* Injected dependencies:
*/
/**
* - `ComponentTree`: [required] Module that can convert between React instances
* and actual node references.
*/
var ComponentTree;
var TreeTraversal;
var injection = {
injectComponentTree: function (Injected) {
ComponentTree = Injected;
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(Injected && Injected.getNodeFromInstance && Injected.getInstanceFromNode, 'EventPluginUtils.injection.injectComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.') : void 0;
}
},
injectTreeTraversal: function (Injected) {
TreeTraversal = Injected;
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(Injected && Injected.isAncestor && Injected.getLowestCommonAncestor, 'EventPluginUtils.injection.injectTreeTraversal(...): Injected ' + 'module is missing isAncestor or getLowestCommonAncestor.') : void 0;
}
}
};
function isEndish(topLevelType) {
return topLevelType === 'topMouseUp' || topLevelType === 'topTouchEnd' || topLevelType === 'topTouchCancel';
}
function isMoveish(topLevelType) {
return topLevelType === 'topMouseMove' || topLevelType === 'topTouchMove';
}
function isStartish(topLevelType) {
return topLevelType === 'topMouseDown' || topLevelType === 'topTouchStart';
}
var validateEventDispatches;
if (process.env.NODE_ENV !== 'production') {
validateEventDispatches = function (event) {
var dispatchListeners = event._dispatchListeners;
var dispatchInstances = event._dispatchInstances;
var listenersIsArr = Array.isArray(dispatchListeners);
var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0;
var instancesIsArr = Array.isArray(dispatchInstances);
var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0;
process.env.NODE_ENV !== 'production' ? warning(instancesIsArr === listenersIsArr && instancesLen === listenersLen, 'EventPluginUtils: Invalid `event`.') : void 0;
};
}
/**
* Dispatch the event to the listener.
* @param {SyntheticEvent} event SyntheticEvent to handle
* @param {boolean} simulated If the event is simulated (changes exn behavior)
* @param {function} listener Application-level callback
* @param {*} inst Internal component instance
*/
function executeDispatch(event, simulated, listener, inst) {
var type = event.type || 'unknown-event';
event.currentTarget = EventPluginUtils.getNodeFromInstance(inst);
if (simulated) {
ReactErrorUtils.invokeGuardedCallbackWithCatch(type, listener, event);
} else {
ReactErrorUtils.invokeGuardedCallback(type, listener, event);
}
event.currentTarget = null;
}
/**
* Standard/simple iteration through an event's collected dispatches.
*/
function executeDispatchesInOrder(event, simulated) {
var dispatchListeners = event._dispatchListeners;
var dispatchInstances = event._dispatchInstances;
if (process.env.NODE_ENV !== 'production') {
validateEventDispatches(event);
}
if (Array.isArray(dispatchListeners)) {
for (var i = 0; i < dispatchListeners.length; i++) {
if (event.isPropagationStopped()) {
break;
}
// Listeners and Instances are two parallel arrays that are always in sync.
executeDispatch(event, simulated, dispatchListeners[i], dispatchInstances[i]);
}
} else if (dispatchListeners) {
executeDispatch(event, simulated, dispatchListeners, dispatchInstances);
}
event._dispatchListeners = null;
event._dispatchInstances = null;
}
/**
* Standard/simple iteration through an event's collected dispatches, but stops
* at the first dispatch execution returning true, and returns that id.
*
* @return {?string} id of the first dispatch execution who's listener returns
* true, or null if no listener returned true.
*/
function executeDispatchesInOrderStopAtTrueImpl(event) {
var dispatchListeners = event._dispatchListeners;
var dispatchInstances = event._dispatchInstances;
if (process.env.NODE_ENV !== 'production') {
validateEventDispatches(event);
}
if (Array.isArray(dispatchListeners)) {
for (var i = 0; i < dispatchListeners.length; i++) {
if (event.isPropagationStopped()) {
break;
}
// Listeners and Instances are two parallel arrays that are always in sync.
if (dispatchListeners[i](event, dispatchInstances[i])) {
return dispatchInstances[i];
}
}
} else if (dispatchListeners) {
if (dispatchListeners(event, dispatchInstances)) {
return dispatchInstances;
}
}
return null;
}
/**
* @see executeDispatchesInOrderStopAtTrueImpl
*/
function executeDispatchesInOrderStopAtTrue(event) {
var ret = executeDispatchesInOrderStopAtTrueImpl(event);
event._dispatchInstances = null;
event._dispatchListeners = null;
return ret;
}
/**
* Execution of a "direct" dispatch - there must be at most one dispatch
* accumulated on the event or it is considered an error. It doesn't really make
* sense for an event with multiple dispatches (bubbled) to keep track of the
* return values at each dispatch execution, but it does tend to make sense when
* dealing with "direct" dispatches.
*
* @return {*} The return value of executing the single dispatch.
*/
function executeDirectDispatch(event) {
if (process.env.NODE_ENV !== 'production') {
validateEventDispatches(event);
}
var dispatchListener = event._dispatchListeners;
var dispatchInstance = event._dispatchInstances;
!!Array.isArray(dispatchListener) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'executeDirectDispatch(...): Invalid `event`.') : _prodInvariant('103') : void 0;
event.currentTarget = dispatchListener ? EventPluginUtils.getNodeFromInstance(dispatchInstance) : null;
var res = dispatchListener ? dispatchListener(event) : null;
event.currentTarget = null;
event._dispatchListeners = null;
event._dispatchInstances = null;
return res;
}
/**
* @param {SyntheticEvent} event
* @return {boolean} True iff number of dispatches accumulated is greater than 0.
*/
function hasDispatches(event) {
return !!event._dispatchListeners;
}
/**
* General utilities that are useful in creating custom Event Plugins.
*/
var EventPluginUtils = {
isEndish: isEndish,
isMoveish: isMoveish,
isStartish: isStartish,
executeDirectDispatch: executeDirectDispatch,
executeDispatchesInOrder: executeDispatchesInOrder,
executeDispatchesInOrderStopAtTrue: executeDispatchesInOrderStopAtTrue,
hasDispatches: hasDispatches,
getInstanceFromNode: function (node) {
return ComponentTree.getInstanceFromNode(node);
},
getNodeFromInstance: function (node) {
return ComponentTree.getNodeFromInstance(node);
},
isAncestor: function (a, b) {
return TreeTraversal.isAncestor(a, b);
},
getLowestCommonAncestor: function (a, b) {
return TreeTraversal.getLowestCommonAncestor(a, b);
},
getParentInstance: function (inst) {
return TreeTraversal.getParentInstance(inst);
},
traverseTwoPhase: function (target, fn, arg) {
return TreeTraversal.traverseTwoPhase(target, fn, arg);
},
traverseEnterLeave: function (from, to, fn, argFrom, argTo) {
return TreeTraversal.traverseEnterLeave(from, to, fn, argFrom, argTo);
},
injection: injection
};
module.exports = EventPluginUtils;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 46 */
/*!********************************************!*\
!*** ./~/react-dom/lib/ReactErrorUtils.js ***!
\********************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
'use strict';
var caughtError = null;
/**
* Call a function while guarding against errors that happens within it.
*
* @param {String} name of the guard to use for logging or debugging
* @param {Function} func The function to invoke
* @param {*} a First argument
* @param {*} b Second argument
*/
function invokeGuardedCallback(name, func, a) {
try {
func(a);
} catch (x) {
if (caughtError === null) {
caughtError = x;
}
}
}
var ReactErrorUtils = {
invokeGuardedCallback: invokeGuardedCallback,
/**
* Invoked by ReactTestUtils.Simulate so that any errors thrown by the event
* handler are sure to be rethrown by rethrowCaughtError.
*/
invokeGuardedCallbackWithCatch: invokeGuardedCallback,
/**
* During execution of guarded functions we will capture the first error which
* we will rethrow to be handled by the top level error handler.
*/
rethrowCaughtError: function () {
if (caughtError) {
var error = caughtError;
caughtError = null;
throw error;
}
}
};
if (process.env.NODE_ENV !== 'production') {
/**
* To help development we can get better devtools integration by simulating a
* real browser event.
*/
if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') {
var fakeNode = document.createElement('react');
ReactErrorUtils.invokeGuardedCallback = function (name, func, a) {
var boundFunc = func.bind(null, a);
var evtType = 'react-' + name;
fakeNode.addEventListener(evtType, boundFunc, false);
var evt = document.createEvent('Event');
// $FlowFixMe https://github.com/facebook/flow/issues/2336
evt.initEvent(evtType, false, false);
fakeNode.dispatchEvent(evt);
fakeNode.removeEventListener(evtType, boundFunc, false);
};
}
}
module.exports = ReactErrorUtils;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 47 */
/*!*******************************************!*\
!*** ./~/react-dom/lib/accumulateInto.js ***!
\*******************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2014-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
'use strict';
var _prodInvariant = __webpack_require__(/*! ./reactProdInvariant */ 36);
var invariant = __webpack_require__(/*! fbjs/lib/invariant */ 9);
/**
* Accumulates items that must not be null or undefined into the first one. This
* is used to conserve memory by avoiding array allocations, and thus sacrifices
* API cleanness. Since `current` can be null before being passed in and not
* null after this function, make sure to assign it back to `current`:
*
* `a = accumulateInto(a, b);`
*
* This API should be sparingly used. Try `accumulate` for something cleaner.
*
* @return {*|array<*>} An accumulation of items.
*/
function accumulateInto(current, next) {
!(next != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'accumulateInto(...): Accumulated items must not be null or undefined.') : _prodInvariant('30') : void 0;
if (current == null) {
return next;
}
// Both are not empty. Warning: Never call x.concat(y) when you are not
// certain that x is an Array (x could be a string with concat method).
if (Array.isArray(current)) {
if (Array.isArray(next)) {
current.push.apply(current, next);
return current;
}
current.push(next);
return current;
}
if (Array.isArray(next)) {
// A bit too dangerous to mutate `next`.
return [current].concat(next);
}
return [current, next];
}
module.exports = accumulateInto;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 48 */
/*!***********************************************!*\
!*** ./~/react-dom/lib/forEachAccumulated.js ***!
\***********************************************/
/***/ function(module, exports) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
'use strict';
/**
* @param {array} arr an "accumulation" of items which is either an Array or
* a single item. Useful when paired with the `accumulate` module. This is a
* simple utility that allows us to reason about a collection of items, but
* handling the case when there is exactly one item (and we do not need to
* allocate an array).
*/
function forEachAccumulated(arr, cb, scope) {
if (Array.isArray(arr)) {
arr.forEach(cb, scope);
} else if (arr) {
cb.call(scope, arr);
}
}
module.exports = forEachAccumulated;
/***/ },
/* 49 */
/*!********************************************!*\
!*** ./~/fbjs/lib/ExecutionEnvironment.js ***!
\********************************************/
/***/ function(module, exports) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
/**
* Simple, lightweight module assisting with the detection and context of
* Worker. Helps avoid circular dependencies and allows code to reason about
* whether or not they are in a Worker, even if they never include the main
* `ReactWorker` dependency.
*/
var ExecutionEnvironment = {
canUseDOM: canUseDOM,
canUseWorkers: typeof Worker !== 'undefined',
canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent),
canUseViewport: canUseDOM && !!window.screen,
isInWorker: !canUseDOM // For now, this is true - might change in the future.
};
module.exports = ExecutionEnvironment;
/***/ },
/* 50 */
/*!*****************************************************!*\
!*** ./~/react-dom/lib/FallbackCompositionState.js ***!
\*****************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var _assign = __webpack_require__(/*! object-assign */ 5);
var PooledClass = __webpack_require__(/*! ./PooledClass */ 51);
var getTextContentAccessor = __webpack_require__(/*! ./getTextContentAccessor */ 52);
/**
* This helper class stores information about text content of a target node,
* allowing comparison of content before and after a given event.
*
* Identify the node where selection currently begins, then observe
* both its text content and its current position in the DOM. Since the
* browser may natively replace the target node during composition, we can
* use its position to find its replacement.
*
* @param {DOMEventTarget} root
*/
function FallbackCompositionState(root) {
this._root = root;
this._startText = this.getText();
this._fallbackText = null;
}
_assign(FallbackCompositionState.prototype, {
destructor: function () {
this._root = null;
this._startText = null;
this._fallbackText = null;
},
/**
* Get current text of input.
*
* @return {string}
*/
getText: function () {
if ('value' in this._root) {
return this._root.value;
}
return this._root[getTextContentAccessor()];
},
/**
* Determine the differing substring between the initially stored
* text content and the current content.
*
* @return {string}
*/
getData: function () {
if (this._fallbackText) {
return this._fallbackText;
}
var start;
var startValue = this._startText;
var startLength = startValue.length;
var end;
var endValue = this.getText();
var endLength = endValue.length;
for (start = 0; start < startLength; start++) {
if (startValue[start] !== endValue[start]) {
break;
}
}
var minEnd = startLength - start;
for (end = 1; end <= minEnd; end++) {
if (startValue[startLength - end] !== endValue[endLength - end]) {
break;
}
}
var sliceTail = end > 1 ? 1 - end : undefined;
this._fallbackText = endValue.slice(start, sliceTail);
return this._fallbackText;
}
});
PooledClass.addPoolingTo(FallbackCompositionState);
module.exports = FallbackCompositionState;
/***/ },
/* 51 */
/*!****************************************!*\
!*** ./~/react-dom/lib/PooledClass.js ***!
\****************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
'use strict';
var _prodInvariant = __webpack_require__(/*! ./reactProdInvariant */ 36);
var invariant = __webpack_require__(/*! fbjs/lib/invariant */ 9);
/**
* Static poolers. Several custom versions for each potential number of
* arguments. A completely generic pooler is easy to implement, but would
* require accessing the `arguments` object. In each of these, `this` refers to
* the Class itself, not an instance. If any others are needed, simply add them
* here, or in their own files.
*/
var oneArgumentPooler = function (copyFieldsFrom) {
var Klass = this;
if (Klass.instancePool.length) {
var instance = Klass.instancePool.pop();
Klass.call(instance, copyFieldsFrom);
return instance;
} else {
return new Klass(copyFieldsFrom);
}
};
var twoArgumentPooler = function (a1, a2) {
var Klass = this;
if (Klass.instancePool.length) {
var instance = Klass.instancePool.pop();
Klass.call(instance, a1, a2);
return instance;
} else {
return new Klass(a1, a2);
}
};
var threeArgumentPooler = function (a1, a2, a3) {
var Klass = this;
if (Klass.instancePool.length) {
var instance = Klass.instancePool.pop();
Klass.call(instance, a1, a2, a3);
return instance;
} else {
return new Klass(a1, a2, a3);
}
};
var fourArgumentPooler = function (a1, a2, a3, a4) {
var Klass = this;
if (Klass.instancePool.length) {
var instance = Klass.instancePool.pop();
Klass.call(instance, a1, a2, a3, a4);
return instance;
} else {
return new Klass(a1, a2, a3, a4);
}
};
var standardReleaser = function (instance) {
var Klass = this;
!(instance instanceof Klass) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Trying to release an instance into a pool of a different type.') : _prodInvariant('25') : void 0;
instance.destructor();
if (Klass.instancePool.length < Klass.poolSize) {
Klass.instancePool.push(instance);
}
};
var DEFAULT_POOL_SIZE = 10;
var DEFAULT_POOLER = oneArgumentPooler;
/**
* Augments `CopyConstructor` to be a poolable class, augmenting only the class
* itself (statically) not adding any prototypical fields. Any CopyConstructor
* you give this may have a `poolSize` property, and will look for a
* prototypical `destructor` on instances.
*
* @param {Function} CopyConstructor Constructor that can be used to reset.
* @param {Function} pooler Customizable pooler.
*/
var addPoolingTo = function (CopyConstructor, pooler) {
// Casting as any so that flow ignores the actual implementation and trusts
// it to match the type we declared
var NewKlass = CopyConstructor;
NewKlass.instancePool = [];
NewKlass.getPooled = pooler || DEFAULT_POOLER;
if (!NewKlass.poolSize) {
NewKlass.poolSize = DEFAULT_POOL_SIZE;
}
NewKlass.release = standardReleaser;
return NewKlass;
};
var PooledClass = {
addPoolingTo: addPoolingTo,
oneArgumentPooler: oneArgumentPooler,
twoArgumentPooler: twoArgumentPooler,
threeArgumentPooler: threeArgumentPooler,
fourArgumentPooler: fourArgumentPooler
};
module.exports = PooledClass;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 52 */
/*!***************************************************!*\
!*** ./~/react-dom/lib/getTextContentAccessor.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var ExecutionEnvironment = __webpack_require__(/*! fbjs/lib/ExecutionEnvironment */ 49);
var contentKey = null;
/**
* Gets the key used to access text content on a DOM node.
*
* @return {?string} Key used to access text content.
* @internal
*/
function getTextContentAccessor() {
if (!contentKey && ExecutionEnvironment.canUseDOM) {
// Prefer textContent to innerText because many browsers support both but
// SVG <text> elements don't support innerText even when <div> does.
contentKey = 'textContent' in document.documentElement ? 'textContent' : 'innerText';
}
return contentKey;
}
module.exports = getTextContentAccessor;
/***/ },
/* 53 */
/*!******************************************************!*\
!*** ./~/react-dom/lib/SyntheticCompositionEvent.js ***!
\******************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var SyntheticEvent = __webpack_require__(/*! ./SyntheticEvent */ 54);
/**
* @interface Event
* @see http://www.w3.org/TR/DOM-Level-3-Events/#events-compositionevents
*/
var CompositionEventInterface = {
data: null
};
/**
* @param {object} dispatchConfig Configuration used to dispatch this event.
* @param {string} dispatchMarker Marker identifying the event target.
* @param {object} nativeEvent Native browser event.
* @extends {SyntheticUIEvent}
*/
function SyntheticCompositionEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
}
SyntheticEvent.augmentClass(SyntheticCompositionEvent, CompositionEventInterface);
module.exports = SyntheticCompositionEvent;
/***/ },
/* 54 */
/*!*******************************************!*\
!*** ./~/react-dom/lib/SyntheticEvent.js ***!
\*******************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var _assign = __webpack_require__(/*! object-assign */ 5);
var PooledClass = __webpack_require__(/*! ./PooledClass */ 51);
var emptyFunction = __webpack_require__(/*! fbjs/lib/emptyFunction */ 13);
var warning = __webpack_require__(/*! fbjs/lib/warning */ 12);
var didWarnForAddedNewProperty = false;
var isProxySupported = typeof Proxy === 'function';
var shouldBeReleasedProperties = ['dispatchConfig', '_targetInst', 'nativeEvent', 'isDefaultPrevented', 'isPropagationStopped', '_dispatchListeners', '_dispatchInstances'];
/**
* @interface Event
* @see http://www.w3.org/TR/DOM-Level-3-Events/
*/
var EventInterface = {
type: null,
target: null,
// currentTarget is set when dispatching; no use in copying it here
currentTarget: emptyFunction.thatReturnsNull,
eventPhase: null,
bubbles: null,
cancelable: null,
timeStamp: function (event) {
return event.timeStamp || Date.now();
},
defaultPrevented: null,
isTrusted: null
};
/**
* Synthetic events are dispatched by event plugins, typically in response to a
* top-level event delegation handler.
*
* These systems should generally use pooling to reduce the frequency of garbage
* collection. The system should check `isPersistent` to determine whether the
* event should be released into the pool after being dispatched. Users that
* need a persisted event should invoke `persist`.
*
* Synthetic events (and subclasses) implement the DOM Level 3 Events API by
* normalizing browser quirks. Subclasses do not necessarily have to implement a
* DOM interface; custom application-specific events can also subclass this.
*
* @param {object} dispatchConfig Configuration used to dispatch this event.
* @param {*} targetInst Marker identifying the event target.
* @param {object} nativeEvent Native browser event.
* @param {DOMEventTarget} nativeEventTarget Target node.
*/
function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) {
if (process.env.NODE_ENV !== 'production') {
// these have a getter/setter for warnings
delete this.nativeEvent;
delete this.preventDefault;
delete this.stopPropagation;
}
this.dispatchConfig = dispatchConfig;
this._targetInst = targetInst;
this.nativeEvent = nativeEvent;
var Interface = this.constructor.Interface;
for (var propName in Interface) {
if (!Interface.hasOwnProperty(propName)) {
continue;
}
if (process.env.NODE_ENV !== 'production') {
delete this[propName]; // this has a getter/setter for warnings
}
var normalize = Interface[propName];
if (normalize) {
this[propName] = normalize(nativeEvent);
} else {
if (propName === 'target') {
this.target = nativeEventTarget;
} else {
this[propName] = nativeEvent[propName];
}
}
}
var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;
if (defaultPrevented) {
this.isDefaultPrevented = emptyFunction.thatReturnsTrue;
} else {
this.isDefaultPrevented = emptyFunction.thatReturnsFalse;
}
this.isPropagationStopped = emptyFunction.thatReturnsFalse;
return this;
}
_assign(SyntheticEvent.prototype, {
preventDefault: function () {
this.defaultPrevented = true;
var event = this.nativeEvent;
if (!event) {
return;
}
if (event.preventDefault) {
event.preventDefault();
} else if (typeof event.returnValue !== 'unknown') {
// eslint-disable-line valid-typeof
event.returnValue = false;
}
this.isDefaultPrevented = emptyFunction.thatReturnsTrue;
},
stopPropagation: function () {
var event = this.nativeEvent;
if (!event) {
return;
}
if (event.stopPropagation) {
event.stopPropagation();
} else if (typeof event.cancelBubble !== 'unknown') {
// eslint-disable-line valid-typeof
// The ChangeEventPlugin registers a "propertychange" event for
// IE. This event does not support bubbling or cancelling, and
// any references to cancelBubble throw "Member not found". A
// typeof check of "unknown" circumvents this issue (and is also
// IE specific).
event.cancelBubble = true;
}
this.isPropagationStopped = emptyFunction.thatReturnsTrue;
},
/**
* We release all dispatched `SyntheticEvent`s after each event loop, adding
* them back into the pool. This allows a way to hold onto a reference that
* won't be added back into the pool.
*/
persist: function () {
this.isPersistent = emptyFunction.thatReturnsTrue;
},
/**
* Checks if this event should be released back into the pool.
*
* @return {boolean} True if this should not be released, false otherwise.
*/
isPersistent: emptyFunction.thatReturnsFalse,
/**
* `PooledClass` looks for `destructor` on each instance it releases.
*/
destructor: function () {
var Interface = this.constructor.Interface;
for (var propName in Interface) {
if (process.env.NODE_ENV !== 'production') {
Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName]));
} else {
this[propName] = null;
}
}
for (var i = 0; i < shouldBeReleasedProperties.length; i++) {
this[shouldBeReleasedProperties[i]] = null;
}
if (process.env.NODE_ENV !== 'production') {
Object.defineProperty(this, 'nativeEvent', getPooledWarningPropertyDefinition('nativeEvent', null));
Object.defineProperty(this, 'preventDefault', getPooledWarningPropertyDefinition('preventDefault', emptyFunction));
Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', emptyFunction));
}
}
});
SyntheticEvent.Interface = EventInterface;
if (process.env.NODE_ENV !== 'production') {
if (isProxySupported) {
/*eslint-disable no-func-assign */
SyntheticEvent = new Proxy(SyntheticEvent, {
construct: function (target, args) {
return this.apply(target, Object.create(target.prototype), args);
},
apply: function (constructor, that, args) {
return new Proxy(constructor.apply(that, args), {
set: function (target, prop, value) {
if (prop !== 'isPersistent' && !target.constructor.Interface.hasOwnProperty(prop) && shouldBeReleasedProperties.indexOf(prop) === -1) {
process.env.NODE_ENV !== 'production' ? warning(didWarnForAddedNewProperty || target.isPersistent(), 'This synthetic event is reused for performance reasons. If you\'re ' + 'seeing this, you\'re adding a new property in the synthetic event object. ' + 'The property is never released. See ' + 'https://fb.me/react-event-pooling for more information.') : void 0;
didWarnForAddedNewProperty = true;
}
target[prop] = value;
return true;
}
});
}
});
/*eslint-enable no-func-assign */
}
}
/**
* Helper to reduce boilerplate when creating subclasses.
*
* @param {function} Class
* @param {?object} Interface
*/
SyntheticEvent.augmentClass = function (Class, Interface) {
var Super = this;
var E = function () {};
E.prototype = Super.prototype;
var prototype = new E();
_assign(prototype, Class.prototype);
Class.prototype = prototype;
Class.prototype.constructor = Class;
Class.Interface = _assign({}, Super.Interface, Interface);
Class.augmentClass = Super.augmentClass;
PooledClass.addPoolingTo(Class, PooledClass.fourArgumentPooler);
};
PooledClass.addPoolingTo(SyntheticEvent, PooledClass.fourArgumentPooler);
module.exports = SyntheticEvent;
/**
* Helper to nullify syntheticEvent instance properties when destructing
*
* @param {object} SyntheticEvent
* @param {String} propName
* @return {object} defineProperty object
*/
function getPooledWarningPropertyDefinition(propName, getVal) {
var isFunction = typeof getVal === 'function';
return {
configurable: true,
set: set,
get: get
};
function set(val) {
var action = isFunction ? 'setting the method' : 'setting the property';
warn(action, 'This is effectively a no-op');
return val;
}
function get() {
var action = isFunction ? 'accessing the method' : 'accessing the property';
var result = isFunction ? 'This is a no-op function' : 'This is set to null';
warn(action, result);
return getVal;
}
function warn(action, result) {
var warningCondition = false;
process.env.NODE_ENV !== 'production' ? warning(warningCondition, 'This synthetic event is reused for performance reasons. If you\'re seeing this, ' + 'you\'re %s `%s` on a released/nullified synthetic event. %s. ' + 'If you must keep the original synthetic event around, use event.persist(). ' + 'See https://fb.me/react-event-pooling for more information.', action, propName, result) : void 0;
}
}
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 55 */
/*!************************************************!*\
!*** ./~/react-dom/lib/SyntheticInputEvent.js ***!
\************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var SyntheticEvent = __webpack_require__(/*! ./SyntheticEvent */ 54);
/**
* @interface Event
* @see http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105
* /#events-inputevents
*/
var InputEventInterface = {
data: null
};
/**
* @param {object} dispatchConfig Configuration used to dispatch this event.
* @param {string} dispatchMarker Marker identifying the event target.
* @param {object} nativeEvent Native browser event.
* @extends {SyntheticUIEvent}
*/
function SyntheticInputEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
}
SyntheticEvent.augmentClass(SyntheticInputEvent, InputEventInterface);
module.exports = SyntheticInputEvent;
/***/ },
/* 56 */
/*!**********************************************!*\
!*** ./~/react-dom/lib/ChangeEventPlugin.js ***!
\**********************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var EventPluginHub = __webpack_require__(/*! ./EventPluginHub */ 43);
var EventPropagators = __webpack_require__(/*! ./EventPropagators */ 42);
var ExecutionEnvironment = __webpack_require__(/*! fbjs/lib/ExecutionEnvironment */ 49);
var ReactDOMComponentTree = __webpack_require__(/*! ./ReactDOMComponentTree */ 35);
var ReactUpdates = __webpack_require__(/*! ./ReactUpdates */ 57);
var SyntheticEvent = __webpack_require__(/*! ./SyntheticEvent */ 54);
var getEventTarget = __webpack_require__(/*! ./getEventTarget */ 70);
var isEventSupported = __webpack_require__(/*! ./isEventSupported */ 71);
var isTextInputElement = __webpack_require__(/*! ./isTextInputElement */ 72);
var eventTypes = {
change: {
phasedRegistrationNames: {
bubbled: 'onChange',
captured: 'onChangeCapture'
},
dependencies: ['topBlur', 'topChange', 'topClick', 'topFocus', 'topInput', 'topKeyDown', 'topKeyUp', 'topSelectionChange']
}
};
/**
* For IE shims
*/
var activeElement = null;
var activeElementInst = null;
var activeElementValue = null;
var activeElementValueProp = null;
/**
* SECTION: handle `change` event
*/
function shouldUseChangeEvent(elem) {
var nodeName = elem.nodeName && elem.nodeName.toLowerCase();
return nodeName === 'select' || nodeName === 'input' && elem.type === 'file';
}
var doesChangeEventBubble = false;
if (ExecutionEnvironment.canUseDOM) {
// See `handleChange` comment below
doesChangeEventBubble = isEventSupported('change') && (!document.documentMode || document.documentMode > 8);
}
function manualDispatchChangeEvent(nativeEvent) {
var event = SyntheticEvent.getPooled(eventTypes.change, activeElementInst, nativeEvent, getEventTarget(nativeEvent));
EventPropagators.accumulateTwoPhaseDispatches(event);
// If change and propertychange bubbled, we'd just bind to it like all the
// other events and have it go through ReactBrowserEventEmitter. Since it
// doesn't, we manually listen for the events and so we have to enqueue and
// process the abstract event manually.
//
// Batching is necessary here in order to ensure that all event handlers run
// before the next rerender (including event handlers attached to ancestor
// elements instead of directly on the input). Without this, controlled
// components don't work properly in conjunction with event bubbling because
// the component is rerendered and the value reverted before all the event
// handlers can run. See https://github.com/facebook/react/issues/708.
ReactUpdates.batchedUpdates(runEventInBatch, event);
}
function runEventInBatch(event) {
EventPluginHub.enqueueEvents(event);
EventPluginHub.processEventQueue(false);
}
function startWatchingForChangeEventIE8(target, targetInst) {
activeElement = target;
activeElementInst = targetInst;
activeElement.attachEvent('onchange', manualDispatchChangeEvent);
}
function stopWatchingForChangeEventIE8() {
if (!activeElement) {
return;
}
activeElement.detachEvent('onchange', manualDispatchChangeEvent);
activeElement = null;
activeElementInst = null;
}
function getTargetInstForChangeEvent(topLevelType, targetInst) {
if (topLevelType === 'topChange') {
return targetInst;
}
}
function handleEventsForChangeEventIE8(topLevelType, target, targetInst) {
if (topLevelType === 'topFocus') {
// stopWatching() should be a noop here but we call it just in case we
// missed a blur event somehow.
stopWatchingForChangeEventIE8();
startWatchingForChangeEventIE8(target, targetInst);
} else if (topLevelType === 'topBlur') {
stopWatchingForChangeEventIE8();
}
}
/**
* SECTION: handle `input` event
*/
var isInputEventSupported = false;
if (ExecutionEnvironment.canUseDOM) {
// IE9 claims to support the input event but fails to trigger it when
// deleting text, so we ignore its input events.
// IE10+ fire input events to often, such when a placeholder
// changes or when an input with a placeholder is focused.
isInputEventSupported = isEventSupported('input') && (!document.documentMode || document.documentMode > 11);
}
/**
* (For IE <=11) Replacement getter/setter for the `value` property that gets
* set on the active element.
*/
var newValueProp = {
get: function () {
return activeElementValueProp.get.call(this);
},
set: function (val) {
// Cast to a string so we can do equality checks.
activeElementValue = '' + val;
activeElementValueProp.set.call(this, val);
}
};
/**
* (For IE <=11) Starts tracking propertychange events on the passed-in element
* and override the value property so that we can distinguish user events from
* value changes in JS.
*/
function startWatchingForValueChange(target, targetInst) {
activeElement = target;
activeElementInst = targetInst;
activeElementValue = target.value;
activeElementValueProp = Object.getOwnPropertyDescriptor(target.constructor.prototype, 'value');
// Not guarded in a canDefineProperty check: IE8 supports defineProperty only
// on DOM elements
Object.defineProperty(activeElement, 'value', newValueProp);
if (activeElement.attachEvent) {
activeElement.attachEvent('onpropertychange', handlePropertyChange);
} else {
activeElement.addEventListener('propertychange', handlePropertyChange, false);
}
}
/**
* (For IE <=11) Removes the event listeners from the currently-tracked element,
* if any exists.
*/
function stopWatchingForValueChange() {
if (!activeElement) {
return;
}
// delete restores the original property definition
delete activeElement.value;
if (activeElement.detachEvent) {
activeElement.detachEvent('onpropertychange', handlePropertyChange);
} else {
activeElement.removeEventListener('propertychange', handlePropertyChange, false);
}
activeElement = null;
activeElementInst = null;
activeElementValue = null;
activeElementValueProp = null;
}
/**
* (For IE <=11) Handles a propertychange event, sending a `change` event if
* the value of the active element has changed.
*/
function handlePropertyChange(nativeEvent) {
if (nativeEvent.propertyName !== 'value') {
return;
}
var value = nativeEvent.srcElement.value;
if (value === activeElementValue) {
return;
}
activeElementValue = value;
manualDispatchChangeEvent(nativeEvent);
}
/**
* If a `change` event should be fired, returns the target's ID.
*/
function getTargetInstForInputEvent(topLevelType, targetInst) {
if (topLevelType === 'topInput') {
// In modern browsers (i.e., not IE8 or IE9), the input event is exactly
// what we want so fall through here and trigger an abstract event
return targetInst;
}
}
function handleEventsForInputEventIE(topLevelType, target, targetInst) {
if (topLevelType === 'topFocus') {
// In IE8, we can capture almost all .value changes by adding a
// propertychange handler and looking for events with propertyName
// equal to 'value'
// In IE9-11, propertychange fires for most input events but is buggy and
// doesn't fire when text is deleted, but conveniently, selectionchange
// appears to fire in all of the remaining cases so we catch those and
// forward the event if the value has changed
// In either case, we don't want to call the event handler if the value
// is changed from JS so we redefine a setter for `.value` that updates
// our activeElementValue variable, allowing us to ignore those changes
//
// stopWatching() should be a noop here but we call it just in case we
// missed a blur event somehow.
stopWatchingForValueChange();
startWatchingForValueChange(target, targetInst);
} else if (topLevelType === 'topBlur') {
stopWatchingForValueChange();
}
}
// For IE8 and IE9.
function getTargetInstForInputEventIE(topLevelType, targetInst) {
if (topLevelType === 'topSelectionChange' || topLevelType === 'topKeyUp' || topLevelType === 'topKeyDown') {
// On the selectionchange event, the target is just document which isn't
// helpful for us so just check activeElement instead.
//
// 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire
// propertychange on the first input event after setting `value` from a
// script and fires only keydown, keypress, keyup. Catching keyup usually
// gets it and catching keydown lets us fire an event for the first
// keystroke if user does a key repeat (it'll be a little delayed: right
// before the second keystroke). Other input methods (e.g., paste) seem to
// fire selectionchange normally.
if (activeElement && activeElement.value !== activeElementValue) {
activeElementValue = activeElement.value;
return activeElementInst;
}
}
}
/**
* SECTION: handle `click` event
*/
function shouldUseClickEvent(elem) {
// Use the `click` event to detect changes to checkbox and radio inputs.
// This approach works across all browsers, whereas `change` does not fire
// until `blur` in IE8.
return elem.nodeName && elem.nodeName.toLowerCase() === 'input' && (elem.type === 'checkbox' || elem.type === 'radio');
}
function getTargetInstForClickEvent(topLevelType, targetInst) {
if (topLevelType === 'topClick') {
return targetInst;
}
}
/**
* This plugin creates an `onChange` event that normalizes change events
* across form elements. This event fires at a time when it's possible to
* change the element's value without seeing a flicker.
*
* Supported elements are:
* - input (see `isTextInputElement`)
* - textarea
* - select
*/
var ChangeEventPlugin = {
eventTypes: eventTypes,
extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
var targetNode = targetInst ? ReactDOMComponentTree.getNodeFromInstance(targetInst) : window;
var getTargetInstFunc, handleEventFunc;
if (shouldUseChangeEvent(targetNode)) {
if (doesChangeEventBubble) {
getTargetInstFunc = getTargetInstForChangeEvent;
} else {
handleEventFunc = handleEventsForChangeEventIE8;
}
} else if (isTextInputElement(targetNode)) {
if (isInputEventSupported) {
getTargetInstFunc = getTargetInstForInputEvent;
} else {
getTargetInstFunc = getTargetInstForInputEventIE;
handleEventFunc = handleEventsForInputEventIE;
}
} else if (shouldUseClickEvent(targetNode)) {
getTargetInstFunc = getTargetInstForClickEvent;
}
if (getTargetInstFunc) {
var inst = getTargetInstFunc(topLevelType, targetInst);
if (inst) {
var event = SyntheticEvent.getPooled(eventTypes.change, inst, nativeEvent, nativeEventTarget);
event.type = 'change';
EventPropagators.accumulateTwoPhaseDispatches(event);
return event;
}
}
if (handleEventFunc) {
handleEventFunc(topLevelType, targetNode, targetInst);
}
}
};
module.exports = ChangeEventPlugin;
/***/ },
/* 57 */
/*!*****************************************!*\
!*** ./~/react-dom/lib/ReactUpdates.js ***!
\*****************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var _prodInvariant = __webpack_require__(/*! ./reactProdInvariant */ 36),
_assign = __webpack_require__(/*! object-assign */ 5);
var CallbackQueue = __webpack_require__(/*! ./CallbackQueue */ 58);
var PooledClass = __webpack_require__(/*! ./PooledClass */ 51);
var ReactFeatureFlags = __webpack_require__(/*! ./ReactFeatureFlags */ 59);
var ReactReconciler = __webpack_require__(/*! ./ReactReconciler */ 60);
var Transaction = __webpack_require__(/*! ./Transaction */ 69);
var invariant = __webpack_require__(/*! fbjs/lib/invariant */ 9);
var dirtyComponents = [];
var updateBatchNumber = 0;
var asapCallbackQueue = CallbackQueue.getPooled();
var asapEnqueued = false;
var batchingStrategy = null;
function ensureInjected() {
!(ReactUpdates.ReactReconcileTransaction && batchingStrategy) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must inject a reconcile transaction class and batching strategy') : _prodInvariant('123') : void 0;
}
var NESTED_UPDATES = {
initialize: function () {
this.dirtyComponentsLength = dirtyComponents.length;
},
close: function () {
if (this.dirtyComponentsLength !== dirtyComponents.length) {
// Additional updates were enqueued by componentDidUpdate handlers or
// similar; before our own UPDATE_QUEUEING wrapper closes, we want to run
// these new updates so that if A's componentDidUpdate calls setState on
// B, B will update before the callback A's updater provided when calling
// setState.
dirtyComponents.splice(0, this.dirtyComponentsLength);
flushBatchedUpdates();
} else {
dirtyComponents.length = 0;
}
}
};
var UPDATE_QUEUEING = {
initialize: function () {
this.callbackQueue.reset();
},
close: function () {
this.callbackQueue.notifyAll();
}
};
var TRANSACTION_WRAPPERS = [NESTED_UPDATES, UPDATE_QUEUEING];
function ReactUpdatesFlushTransaction() {
this.reinitializeTransaction();
this.dirtyComponentsLength = null;
this.callbackQueue = CallbackQueue.getPooled();
this.reconcileTransaction = ReactUpdates.ReactReconcileTransaction.getPooled(
/* useCreateElement */true);
}
_assign(ReactUpdatesFlushTransaction.prototype, Transaction, {
getTransactionWrappers: function () {
return TRANSACTION_WRAPPERS;
},
destructor: function () {
this.dirtyComponentsLength = null;
CallbackQueue.release(this.callbackQueue);
this.callbackQueue = null;
ReactUpdates.ReactReconcileTransaction.release(this.reconcileTransaction);
this.reconcileTransaction = null;
},
perform: function (method, scope, a) {
// Essentially calls `this.reconcileTransaction.perform(method, scope, a)`
// with this transaction's wrappers around it.
return Transaction.perform.call(this, this.reconcileTransaction.perform, this.reconcileTransaction, method, scope, a);
}
});
PooledClass.addPoolingTo(ReactUpdatesFlushTransaction);
function batchedUpdates(callback, a, b, c, d, e) {
ensureInjected();
return batchingStrategy.batchedUpdates(callback, a, b, c, d, e);
}
/**
* Array comparator for ReactComponents by mount ordering.
*
* @param {ReactComponent} c1 first component you're comparing
* @param {ReactComponent} c2 second component you're comparing
* @return {number} Return value usable by Array.prototype.sort().
*/
function mountOrderComparator(c1, c2) {
return c1._mountOrder - c2._mountOrder;
}
function runBatchedUpdates(transaction) {
var len = transaction.dirtyComponentsLength;
!(len === dirtyComponents.length) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected flush transaction\'s stored dirty-components length (%s) to match dirty-components array length (%s).', len, dirtyComponents.length) : _prodInvariant('124', len, dirtyComponents.length) : void 0;
// Since reconciling a component higher in the owner hierarchy usually (not
// always -- see shouldComponentUpdate()) will reconcile children, reconcile
// them before their children by sorting the array.
dirtyComponents.sort(mountOrderComparator);
// Any updates enqueued while reconciling must be performed after this entire
// batch. Otherwise, if dirtyComponents is [A, B] where A has children B and
// C, B could update twice in a single batch if C's render enqueues an update
// to B (since B would have already updated, we should skip it, and the only
// way we can know to do so is by checking the batch counter).
updateBatchNumber++;
for (var i = 0; i < len; i++) {
// If a component is unmounted before pending changes apply, it will still
// be here, but we assume that it has cleared its _pendingCallbacks and
// that performUpdateIfNecessary is a noop.
var component = dirtyComponents[i];
// If performUpdateIfNecessary happens to enqueue any new updates, we
// shouldn't execute the callbacks until the next render happens, so
// stash the callbacks first
var callbacks = component._pendingCallbacks;
component._pendingCallbacks = null;
var markerName;
if (ReactFeatureFlags.logTopLevelRenders) {
var namedComponent = component;
// Duck type TopLevelWrapper. This is probably always true.
if (component._currentElement.type.isReactTopLevelWrapper) {
namedComponent = component._renderedComponent;
}
markerName = 'React update: ' + namedComponent.getName();
console.time(markerName);
}
ReactReconciler.performUpdateIfNecessary(component, transaction.reconcileTransaction, updateBatchNumber);
if (markerName) {
console.timeEnd(markerName);
}
if (callbacks) {
for (var j = 0; j < callbacks.length; j++) {
transaction.callbackQueue.enqueue(callbacks[j], component.getPublicInstance());
}
}
}
}
var flushBatchedUpdates = function () {
// ReactUpdatesFlushTransaction's wrappers will clear the dirtyComponents
// array and perform any updates enqueued by mount-ready handlers (i.e.,
// componentDidUpdate) but we need to check here too in order to catch
// updates enqueued by setState callbacks and asap calls.
while (dirtyComponents.length || asapEnqueued) {
if (dirtyComponents.length) {
var transaction = ReactUpdatesFlushTransaction.getPooled();
transaction.perform(runBatchedUpdates, null, transaction);
ReactUpdatesFlushTransaction.release(transaction);
}
if (asapEnqueued) {
asapEnqueued = false;
var queue = asapCallbackQueue;
asapCallbackQueue = CallbackQueue.getPooled();
queue.notifyAll();
CallbackQueue.release(queue);
}
}
};
/**
* Mark a component as needing a rerender, adding an optional callback to a
* list of functions which will be executed once the rerender occurs.
*/
function enqueueUpdate(component) {
ensureInjected();
// Various parts of our code (such as ReactCompositeComponent's
// _renderValidatedComponent) assume that calls to render aren't nested;
// verify that that's the case. (This is called by each top-level update
// function, like setState, forceUpdate, etc.; creation and
// destruction of top-level components is guarded in ReactMount.)
if (!batchingStrategy.isBatchingUpdates) {
batchingStrategy.batchedUpdates(enqueueUpdate, component);
return;
}
dirtyComponents.push(component);
if (component._updateBatchNumber == null) {
component._updateBatchNumber = updateBatchNumber + 1;
}
}
/**
* Enqueue a callback to be run at the end of the current batching cycle. Throws
* if no updates are currently being performed.
*/
function asap(callback, context) {
!batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\'t enqueue an asap callback in a context whereupdates are not being batched.') : _prodInvariant('125') : void 0;
asapCallbackQueue.enqueue(callback, context);
asapEnqueued = true;
}
var ReactUpdatesInjection = {
injectReconcileTransaction: function (ReconcileTransaction) {
!ReconcileTransaction ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a reconcile transaction class') : _prodInvariant('126') : void 0;
ReactUpdates.ReactReconcileTransaction = ReconcileTransaction;
},
injectBatchingStrategy: function (_batchingStrategy) {
!_batchingStrategy ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a batching strategy') : _prodInvariant('127') : void 0;
!(typeof _batchingStrategy.batchedUpdates === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a batchedUpdates() function') : _prodInvariant('128') : void 0;
!(typeof _batchingStrategy.isBatchingUpdates === 'boolean') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide an isBatchingUpdates boolean attribute') : _prodInvariant('129') : void 0;
batchingStrategy = _batchingStrategy;
}
};
var ReactUpdates = {
/**
* React references `ReactReconcileTransaction` using this property in order
* to allow dependency injection.
*
* @internal
*/
ReactReconcileTransaction: null,
batchedUpdates: batchedUpdates,
enqueueUpdate: enqueueUpdate,
flushBatchedUpdates: flushBatchedUpdates,
injection: ReactUpdatesInjection,
asap: asap
};
module.exports = ReactUpdates;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 58 */
/*!******************************************!*\
!*** ./~/react-dom/lib/CallbackQueue.js ***!
\******************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
'use strict';
var _prodInvariant = __webpack_require__(/*! ./reactProdInvariant */ 36);
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var PooledClass = __webpack_require__(/*! ./PooledClass */ 51);
var invariant = __webpack_require__(/*! fbjs/lib/invariant */ 9);
/**
* A specialized pseudo-event module to help keep track of components waiting to
* be notified when their DOM representations are available for use.
*
* This implements `PooledClass`, so you should never need to instantiate this.
* Instead, use `CallbackQueue.getPooled()`.
*
* @class ReactMountReady
* @implements PooledClass
* @internal
*/
var CallbackQueue = function () {
function CallbackQueue(arg) {
_classCallCheck(this, CallbackQueue);
this._callbacks = null;
this._contexts = null;
this._arg = arg;
}
/**
* Enqueues a callback to be invoked when `notifyAll` is invoked.
*
* @param {function} callback Invoked when `notifyAll` is invoked.
* @param {?object} context Context to call `callback` with.
* @internal
*/
CallbackQueue.prototype.enqueue = function enqueue(callback, context) {
this._callbacks = this._callbacks || [];
this._callbacks.push(callback);
this._contexts = this._contexts || [];
this._contexts.push(context);
};
/**
* Invokes all enqueued callbacks and clears the queue. This is invoked after
* the DOM representation of a component has been created or updated.
*
* @internal
*/
CallbackQueue.prototype.notifyAll = function notifyAll() {
var callbacks = this._callbacks;
var contexts = this._contexts;
var arg = this._arg;
if (callbacks && contexts) {
!(callbacks.length === contexts.length) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Mismatched list of contexts in callback queue') : _prodInvariant('24') : void 0;
this._callbacks = null;
this._contexts = null;
for (var i = 0; i < callbacks.length; i++) {
callbacks[i].call(contexts[i], arg);
}
callbacks.length = 0;
contexts.length = 0;
}
};
CallbackQueue.prototype.checkpoint = function checkpoint() {
return this._callbacks ? this._callbacks.length : 0;
};
CallbackQueue.prototype.rollback = function rollback(len) {
if (this._callbacks && this._contexts) {
this._callbacks.length = len;
this._contexts.length = len;
}
};
/**
* Resets the internal queue.
*
* @internal
*/
CallbackQueue.prototype.reset = function reset() {
this._callbacks = null;
this._contexts = null;
};
/**
* `PooledClass` looks for this.
*/
CallbackQueue.prototype.destructor = function destructor() {
this.reset();
};
return CallbackQueue;
}();
module.exports = PooledClass.addPoolingTo(CallbackQueue);
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 59 */
/*!**********************************************!*\
!*** ./~/react-dom/lib/ReactFeatureFlags.js ***!
\**********************************************/
/***/ function(module, exports) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
'use strict';
var ReactFeatureFlags = {
// When true, call console.time() before and .timeEnd() after each top-level
// render (both initial renders and updates). Useful when looking at prod-mode
// timeline profiles in Chrome, for example.
logTopLevelRenders: false
};
module.exports = ReactFeatureFlags;
/***/ },
/* 60 */
/*!********************************************!*\
!*** ./~/react-dom/lib/ReactReconciler.js ***!
\********************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var ReactRef = __webpack_require__(/*! ./ReactRef */ 61);
var ReactInstrumentation = __webpack_require__(/*! ./ReactInstrumentation */ 63);
var warning = __webpack_require__(/*! fbjs/lib/warning */ 12);
/**
* Helper to call ReactRef.attachRefs with this composite component, split out
* to avoid allocations in the transaction mount-ready queue.
*/
function attachRefs() {
ReactRef.attachRefs(this, this._currentElement);
}
var ReactReconciler = {
/**
* Initializes the component, renders markup, and registers event listeners.
*
* @param {ReactComponent} internalInstance
* @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
* @param {?object} the containing host component instance
* @param {?object} info about the host container
* @return {?string} Rendered markup to be inserted into the DOM.
* @final
* @internal
*/
mountComponent: function (internalInstance, transaction, hostParent, hostContainerInfo, context, parentDebugID // 0 in production and for roots
) {
if (process.env.NODE_ENV !== 'production') {
if (internalInstance._debugID !== 0) {
ReactInstrumentation.debugTool.onBeforeMountComponent(internalInstance._debugID, internalInstance._currentElement, parentDebugID);
}
}
var markup = internalInstance.mountComponent(transaction, hostParent, hostContainerInfo, context, parentDebugID);
if (internalInstance._currentElement && internalInstance._currentElement.ref != null) {
transaction.getReactMountReady().enqueue(attachRefs, internalInstance);
}
if (process.env.NODE_ENV !== 'production') {
if (internalInstance._debugID !== 0) {
ReactInstrumentation.debugTool.onMountComponent(internalInstance._debugID);
}
}
return markup;
},
/**
* Returns a value that can be passed to
* ReactComponentEnvironment.replaceNodeWithMarkup.
*/
getHostNode: function (internalInstance) {
return internalInstance.getHostNode();
},
/**
* Releases any resources allocated by `mountComponent`.
*
* @final
* @internal
*/
unmountComponent: function (internalInstance, safely) {
if (process.env.NODE_ENV !== 'production') {
if (internalInstance._debugID !== 0) {
ReactInstrumentation.debugTool.onBeforeUnmountComponent(internalInstance._debugID);
}
}
ReactRef.detachRefs(internalInstance, internalInstance._currentElement);
internalInstance.unmountComponent(safely);
if (process.env.NODE_ENV !== 'production') {
if (internalInstance._debugID !== 0) {
ReactInstrumentation.debugTool.onUnmountComponent(internalInstance._debugID);
}
}
},
/**
* Update a component using a new element.
*
* @param {ReactComponent} internalInstance
* @param {ReactElement} nextElement
* @param {ReactReconcileTransaction} transaction
* @param {object} context
* @internal
*/
receiveComponent: function (internalInstance, nextElement, transaction, context) {
var prevElement = internalInstance._currentElement;
if (nextElement === prevElement && context === internalInstance._context) {
// Since elements are immutable after the owner is rendered,
// we can do a cheap identity compare here to determine if this is a
// superfluous reconcile. It's possible for state to be mutable but such
// change should trigger an update of the owner which would recreate
// the element. We explicitly check for the existence of an owner since
// it's possible for an element created outside a composite to be
// deeply mutated and reused.
// TODO: Bailing out early is just a perf optimization right?
// TODO: Removing the return statement should affect correctness?
return;
}
if (process.env.NODE_ENV !== 'production') {
if (internalInstance._debugID !== 0) {
ReactInstrumentation.debugTool.onBeforeUpdateComponent(internalInstance._debugID, nextElement);
}
}
var refsChanged = ReactRef.shouldUpdateRefs(prevElement, nextElement);
if (refsChanged) {
ReactRef.detachRefs(internalInstance, prevElement);
}
internalInstance.receiveComponent(nextElement, transaction, context);
if (refsChanged && internalInstance._currentElement && internalInstance._currentElement.ref != null) {
transaction.getReactMountReady().enqueue(attachRefs, internalInstance);
}
if (process.env.NODE_ENV !== 'production') {
if (internalInstance._debugID !== 0) {
ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID);
}
}
},
/**
* Flush any dirty changes in a component.
*
* @param {ReactComponent} internalInstance
* @param {ReactReconcileTransaction} transaction
* @internal
*/
performUpdateIfNecessary: function (internalInstance, transaction, updateBatchNumber) {
if (internalInstance._updateBatchNumber !== updateBatchNumber) {
// The component's enqueued batch number should always be the current
// batch or the following one.
process.env.NODE_ENV !== 'production' ? warning(internalInstance._updateBatchNumber == null || internalInstance._updateBatchNumber === updateBatchNumber + 1, 'performUpdateIfNecessary: Unexpected batch number (current %s, ' + 'pending %s)', updateBatchNumber, internalInstance._updateBatchNumber) : void 0;
return;
}
if (process.env.NODE_ENV !== 'production') {
if (internalInstance._debugID !== 0) {
ReactInstrumentation.debugTool.onBeforeUpdateComponent(internalInstance._debugID, internalInstance._currentElement);
}
}
internalInstance.performUpdateIfNecessary(transaction);
if (process.env.NODE_ENV !== 'production') {
if (internalInstance._debugID !== 0) {
ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID);
}
}
}
};
module.exports = ReactReconciler;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 61 */
/*!*************************************!*\
!*** ./~/react-dom/lib/ReactRef.js ***!
\*************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
'use strict';
var ReactOwner = __webpack_require__(/*! ./ReactOwner */ 62);
var ReactRef = {};
function attachRef(ref, component, owner) {
if (typeof ref === 'function') {
ref(component.getPublicInstance());
} else {
// Legacy ref
ReactOwner.addComponentAsRefTo(component, ref, owner);
}
}
function detachRef(ref, component, owner) {
if (typeof ref === 'function') {
ref(null);
} else {
// Legacy ref
ReactOwner.removeComponentAsRefFrom(component, ref, owner);
}
}
ReactRef.attachRefs = function (instance, element) {
if (element === null || typeof element !== 'object') {
return;
}
var ref = element.ref;
if (ref != null) {
attachRef(ref, instance, element._owner);
}
};
ReactRef.shouldUpdateRefs = function (prevElement, nextElement) {
// If either the owner or a `ref` has changed, make sure the newest owner
// has stored a reference to `this`, and the previous owner (if different)
// has forgotten the reference to `this`. We use the element instead
// of the public this.props because the post processing cannot determine
// a ref. The ref conceptually lives on the element.
// TODO: Should this even be possible? The owner cannot change because
// it's forbidden by shouldUpdateReactComponent. The ref can change
// if you swap the keys of but not the refs. Reconsider where this check
// is made. It probably belongs where the key checking and
// instantiateReactComponent is done.
var prevRef = null;
var prevOwner = null;
if (prevElement !== null && typeof prevElement === 'object') {
prevRef = prevElement.ref;
prevOwner = prevElement._owner;
}
var nextRef = null;
var nextOwner = null;
if (nextElement !== null && typeof nextElement === 'object') {
nextRef = nextElement.ref;
nextOwner = nextElement._owner;
}
return prevRef !== nextRef ||
// If owner changes but we have an unchanged function ref, don't update refs
typeof nextRef === 'string' && nextOwner !== prevOwner;
};
ReactRef.detachRefs = function (instance, element) {
if (element === null || typeof element !== 'object') {
return;
}
var ref = element.ref;
if (ref != null) {
detachRef(ref, instance, element._owner);
}
};
module.exports = ReactRef;
/***/ },
/* 62 */
/*!***************************************!*\
!*** ./~/react-dom/lib/ReactOwner.js ***!
\***************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
'use strict';
var _prodInvariant = __webpack_require__(/*! ./reactProdInvariant */ 36);
var invariant = __webpack_require__(/*! fbjs/lib/invariant */ 9);
/**
* @param {?object} object
* @return {boolean} True if `object` is a valid owner.
* @final
*/
function isValidOwner(object) {
return !!(object && typeof object.attachRef === 'function' && typeof object.detachRef === 'function');
}
/**
* ReactOwners are capable of storing references to owned components.
*
* All components are capable of //being// referenced by owner components, but
* only ReactOwner components are capable of //referencing// owned components.
* The named reference is known as a "ref".
*
* Refs are available when mounted and updated during reconciliation.
*
* var MyComponent = React.createClass({
* render: function() {
* return (
* <div onClick={this.handleClick}>
* <CustomComponent ref="custom" />
* </div>
* );
* },
* handleClick: function() {
* this.refs.custom.handleClick();
* },
* componentDidMount: function() {
* this.refs.custom.initialize();
* }
* });
*
* Refs should rarely be used. When refs are used, they should only be done to
* control data that is not handled by React's data flow.
*
* @class ReactOwner
*/
var ReactOwner = {
/**
* Adds a component by ref to an owner component.
*
* @param {ReactComponent} component Component to reference.
* @param {string} ref Name by which to refer to the component.
* @param {ReactOwner} owner Component on which to record the ref.
* @final
* @internal
*/
addComponentAsRefTo: function (component, ref, owner) {
!isValidOwner(owner) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component\'s `render` method, or you have multiple copies of React loaded (details: https://fb.me/react-refs-must-have-owner).') : _prodInvariant('119') : void 0;
owner.attachRef(ref, component);
},
/**
* Removes a component by ref from an owner component.
*
* @param {ReactComponent} component Component to dereference.
* @param {string} ref Name of the ref to remove.
* @param {ReactOwner} owner Component on which the ref is recorded.
* @final
* @internal
*/
removeComponentAsRefFrom: function (component, ref, owner) {
!isValidOwner(owner) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'removeComponentAsRefFrom(...): Only a ReactOwner can have refs. You might be removing a ref to a component that was not created inside a component\'s `render` method, or you have multiple copies of React loaded (details: https://fb.me/react-refs-must-have-owner).') : _prodInvariant('120') : void 0;
var ownerPublicInstance = owner.getPublicInstance();
// Check that `component`'s owner is still alive and that `component` is still the current ref
// because we do not want to detach the ref if another component stole it.
if (ownerPublicInstance && ownerPublicInstance.refs[ref] === component.getPublicInstance()) {
owner.detachRef(ref);
}
}
};
module.exports = ReactOwner;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 63 */
/*!*************************************************!*\
!*** ./~/react-dom/lib/ReactInstrumentation.js ***!
\*************************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2016-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
'use strict';
// Trust the developer to only use ReactInstrumentation with a __DEV__ check
var debugTool = null;
if (process.env.NODE_ENV !== 'production') {
var ReactDebugTool = __webpack_require__(/*! ./ReactDebugTool */ 64);
debugTool = ReactDebugTool;
}
module.exports = { debugTool: debugTool };
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 64 */
/*!*******************************************!*\
!*** ./~/react-dom/lib/ReactDebugTool.js ***!
\*******************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2016-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
'use strict';
var ReactInvalidSetStateWarningHook = __webpack_require__(/*! ./ReactInvalidSetStateWarningHook */ 65);
var ReactHostOperationHistoryHook = __webpack_require__(/*! ./ReactHostOperationHistoryHook */ 66);
var ReactComponentTreeHook = __webpack_require__(/*! react/lib/ReactComponentTreeHook */ 27);
var ExecutionEnvironment = __webpack_require__(/*! fbjs/lib/ExecutionEnvironment */ 49);
var performanceNow = __webpack_require__(/*! fbjs/lib/performanceNow */ 67);
var warning = __webpack_require__(/*! fbjs/lib/warning */ 12);
var hooks = [];
var didHookThrowForEvent = {};
function callHook(event, fn, context, arg1, arg2, arg3, arg4, arg5) {
try {
fn.call(context, arg1, arg2, arg3, arg4, arg5);
} catch (e) {
process.env.NODE_ENV !== 'production' ? warning(didHookThrowForEvent[event], 'Exception thrown by hook while handling %s: %s', event, e + '\n' + e.stack) : void 0;
didHookThrowForEvent[event] = true;
}
}
function emitEvent(event, arg1, arg2, arg3, arg4, arg5) {
for (var i = 0; i < hooks.length; i++) {
var hook = hooks[i];
var fn = hook[event];
if (fn) {
callHook(event, fn, hook, arg1, arg2, arg3, arg4, arg5);
}
}
}
var isProfiling = false;
var flushHistory = [];
var lifeCycleTimerStack = [];
var currentFlushNesting = 0;
var currentFlushMeasurements = [];
var currentFlushStartTime = 0;
var currentTimerDebugID = null;
var currentTimerStartTime = 0;
var currentTimerNestedFlushDuration = 0;
var currentTimerType = null;
var lifeCycleTimerHasWarned = false;
function clearHistory() {
ReactComponentTreeHook.purgeUnmountedComponents();
ReactHostOperationHistoryHook.clearHistory();
}
function getTreeSnapshot(registeredIDs) {
return registeredIDs.reduce(function (tree, id) {
var ownerID = ReactComponentTreeHook.getOwnerID(id);
var parentID = ReactComponentTreeHook.getParentID(id);
tree[id] = {
displayName: ReactComponentTreeHook.getDisplayName(id),
text: ReactComponentTreeHook.getText(id),
updateCount: ReactComponentTreeHook.getUpdateCount(id),
childIDs: ReactComponentTreeHook.getChildIDs(id),
// Text nodes don't have owners but this is close enough.
ownerID: ownerID || parentID && ReactComponentTreeHook.getOwnerID(parentID) || 0,
parentID: parentID
};
return tree;
}, {});
}
function resetMeasurements() {
var previousStartTime = currentFlushStartTime;
var previousMeasurements = currentFlushMeasurements;
var previousOperations = ReactHostOperationHistoryHook.getHistory();
if (currentFlushNesting === 0) {
currentFlushStartTime = 0;
currentFlushMeasurements = [];
clearHistory();
return;
}
if (previousMeasurements.length || previousOperations.length) {
var registeredIDs = ReactComponentTreeHook.getRegisteredIDs();
flushHistory.push({
duration: performanceNow() - previousStartTime,
measurements: previousMeasurements || [],
operations: previousOperations || [],
treeSnapshot: getTreeSnapshot(registeredIDs)
});
}
clearHistory();
currentFlushStartTime = performanceNow();
currentFlushMeasurements = [];
}
function checkDebugID(debugID) {
var allowRoot = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
if (allowRoot && debugID === 0) {
return;
}
if (!debugID) {
process.env.NODE_ENV !== 'production' ? warning(false, 'ReactDebugTool: debugID may not be empty.') : void 0;
}
}
function beginLifeCycleTimer(debugID, timerType) {
if (currentFlushNesting === 0) {
return;
}
if (currentTimerType && !lifeCycleTimerHasWarned) {
process.env.NODE_ENV !== 'production' ? warning(false, 'There is an internal error in the React performance measurement code. ' + 'Did not expect %s timer to start while %s timer is still in ' + 'progress for %s instance.', timerType, currentTimerType || 'no', debugID === currentTimerDebugID ? 'the same' : 'another') : void 0;
lifeCycleTimerHasWarned = true;
}
currentTimerStartTime = performanceNow();
currentTimerNestedFlushDuration = 0;
currentTimerDebugID = debugID;
currentTimerType = timerType;
}
function endLifeCycleTimer(debugID, timerType) {
if (currentFlushNesting === 0) {
return;
}
if (currentTimerType !== timerType && !lifeCycleTimerHasWarned) {
process.env.NODE_ENV !== 'production' ? warning(false, 'There is an internal error in the React performance measurement code. ' + 'We did not expect %s timer to stop while %s timer is still in ' + 'progress for %s instance. Please report this as a bug in React.', timerType, currentTimerType || 'no', debugID === currentTimerDebugID ? 'the same' : 'another') : void 0;
lifeCycleTimerHasWarned = true;
}
if (isProfiling) {
currentFlushMeasurements.push({
timerType: timerType,
instanceID: debugID,
duration: performanceNow() - currentTimerStartTime - currentTimerNestedFlushDuration
});
}
currentTimerStartTime = 0;
currentTimerNestedFlushDuration = 0;
currentTimerDebugID = null;
currentTimerType = null;
}
function pauseCurrentLifeCycleTimer() {
var currentTimer = {
startTime: currentTimerStartTime,
nestedFlushStartTime: performanceNow(),
debugID: currentTimerDebugID,
timerType: currentTimerType
};
lifeCycleTimerStack.push(currentTimer);
currentTimerStartTime = 0;
currentTimerNestedFlushDuration = 0;
currentTimerDebugID = null;
currentTimerType = null;
}
function resumeCurrentLifeCycleTimer() {
var _lifeCycleTimerStack$ = lifeCycleTimerStack.pop(),
startTime = _lifeCycleTimerStack$.startTime,
nestedFlushStartTime = _lifeCycleTimerStack$.nestedFlushStartTime,
debugID = _lifeCycleTimerStack$.debugID,
timerType = _lifeCycleTimerStack$.timerType;
var nestedFlushDuration = performanceNow() - nestedFlushStartTime;
currentTimerStartTime = startTime;
currentTimerNestedFlushDuration += nestedFlushDuration;
currentTimerDebugID = debugID;
currentTimerType = timerType;
}
var lastMarkTimeStamp = 0;
var canUsePerformanceMeasure =
// $FlowFixMe https://github.com/facebook/flow/issues/2345
typeof performance !== 'undefined' && typeof performance.mark === 'function' && typeof performance.clearMarks === 'function' && typeof performance.measure === 'function' && typeof performance.clearMeasures === 'function';
function shouldMark(debugID) {
if (!isProfiling || !canUsePerformanceMeasure) {
return false;
}
var element = ReactComponentTreeHook.getElement(debugID);
if (element == null || typeof element !== 'object') {
return false;
}
var isHostElement = typeof element.type === 'string';
if (isHostElement) {
return false;
}
return true;
}
function markBegin(debugID, markType) {
if (!shouldMark(debugID)) {
return;
}
var markName = debugID + '::' + markType;
lastMarkTimeStamp = performanceNow();
performance.mark(markName);
}
function markEnd(debugID, markType) {
if (!shouldMark(debugID)) {
return;
}
var markName = debugID + '::' + markType;
var displayName = ReactComponentTreeHook.getDisplayName(debugID) || 'Unknown';
// Chrome has an issue of dropping markers recorded too fast:
// https://bugs.chromium.org/p/chromium/issues/detail?id=640652
// To work around this, we will not report very small measurements.
// I determined the magic number by tweaking it back and forth.
// 0.05ms was enough to prevent the issue, but I set it to 0.1ms to be safe.
// When the bug is fixed, we can `measure()` unconditionally if we want to.
var timeStamp = performanceNow();
if (timeStamp - lastMarkTimeStamp > 0.1) {
var measurementName = displayName + ' [' + markType + ']';
performance.measure(measurementName, markName);
}
performance.clearMarks(markName);
performance.clearMeasures(measurementName);
}
var ReactDebugTool = {
addHook: function (hook) {
hooks.push(hook);
},
removeHook: function (hook) {
for (var i = 0; i < hooks.length; i++) {
if (hooks[i] === hook) {
hooks.splice(i, 1);
i--;
}
}
},
isProfiling: function () {
return isProfiling;
},
beginProfiling: function () {
if (isProfiling) {
return;
}
isProfiling = true;
flushHistory.length = 0;
resetMeasurements();
ReactDebugTool.addHook(ReactHostOperationHistoryHook);
},
endProfiling: function () {
if (!isProfiling) {
return;
}
isProfiling = false;
resetMeasurements();
ReactDebugTool.removeHook(ReactHostOperationHistoryHook);
},
getFlushHistory: function () {
return flushHistory;
},
onBeginFlush: function () {
currentFlushNesting++;
resetMeasurements();
pauseCurrentLifeCycleTimer();
emitEvent('onBeginFlush');
},
onEndFlush: function () {
resetMeasurements();
currentFlushNesting--;
resumeCurrentLifeCycleTimer();
emitEvent('onEndFlush');
},
onBeginLifeCycleTimer: function (debugID, timerType) {
checkDebugID(debugID);
emitEvent('onBeginLifeCycleTimer', debugID, timerType);
markBegin(debugID, timerType);
beginLifeCycleTimer(debugID, timerType);
},
onEndLifeCycleTimer: function (debugID, timerType) {
checkDebugID(debugID);
endLifeCycleTimer(debugID, timerType);
markEnd(debugID, timerType);
emitEvent('onEndLifeCycleTimer', debugID, timerType);
},
onBeginProcessingChildContext: function () {
emitEvent('onBeginProcessingChildContext');
},
onEndProcessingChildContext: function () {
emitEvent('onEndProcessingChildContext');
},
onHostOperation: function (operation) {
checkDebugID(operation.instanceID);
emitEvent('onHostOperation', operation);
},
onSetState: function () {
emitEvent('onSetState');
},
onSetChildren: function (debugID, childDebugIDs) {
checkDebugID(debugID);
childDebugIDs.forEach(checkDebugID);
emitEvent('onSetChildren', debugID, childDebugIDs);
},
onBeforeMountComponent: function (debugID, element, parentDebugID) {
checkDebugID(debugID);
checkDebugID(parentDebugID, true);
emitEvent('onBeforeMountComponent', debugID, element, parentDebugID);
markBegin(debugID, 'mount');
},
onMountComponent: function (debugID) {
checkDebugID(debugID);
markEnd(debugID, 'mount');
emitEvent('onMountComponent', debugID);
},
onBeforeUpdateComponent: function (debugID, element) {
checkDebugID(debugID);
emitEvent('onBeforeUpdateComponent', debugID, element);
markBegin(debugID, 'update');
},
onUpdateComponent: function (debugID) {
checkDebugID(debugID);
markEnd(debugID, 'update');
emitEvent('onUpdateComponent', debugID);
},
onBeforeUnmountComponent: function (debugID) {
checkDebugID(debugID);
emitEvent('onBeforeUnmountComponent', debugID);
markBegin(debugID, 'unmount');
},
onUnmountComponent: function (debugID) {
checkDebugID(debugID);
markEnd(debugID, 'unmount');
emitEvent('onUnmountComponent', debugID);
},
onTestEvent: function () {
emitEvent('onTestEvent');
}
};
// TODO remove these when RN/www gets updated
ReactDebugTool.addDevtool = ReactDebugTool.addHook;
ReactDebugTool.removeDevtool = ReactDebugTool.removeHook;
ReactDebugTool.addHook(ReactInvalidSetStateWarningHook);
ReactDebugTool.addHook(ReactComponentTreeHook);
var url = ExecutionEnvironment.canUseDOM && window.location.href || '';
if (/[?&]react_perf\b/.test(url)) {
ReactDebugTool.beginProfiling();
}
module.exports = ReactDebugTool;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 65 */
/*!************************************************************!*\
!*** ./~/react-dom/lib/ReactInvalidSetStateWarningHook.js ***!
\************************************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2016-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
'use strict';
var warning = __webpack_require__(/*! fbjs/lib/warning */ 12);
if (process.env.NODE_ENV !== 'production') {
var processingChildContext = false;
var warnInvalidSetState = function () {
process.env.NODE_ENV !== 'production' ? warning(!processingChildContext, 'setState(...): Cannot call setState() inside getChildContext()') : void 0;
};
}
var ReactInvalidSetStateWarningHook = {
onBeginProcessingChildContext: function () {
processingChildContext = true;
},
onEndProcessingChildContext: function () {
processingChildContext = false;
},
onSetState: function () {
warnInvalidSetState();
}
};
module.exports = ReactInvalidSetStateWarningHook;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 66 */
/*!**********************************************************!*\
!*** ./~/react-dom/lib/ReactHostOperationHistoryHook.js ***!
\**********************************************************/
/***/ function(module, exports) {
/**
* Copyright 2016-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
'use strict';
var history = [];
var ReactHostOperationHistoryHook = {
onHostOperation: function (operation) {
history.push(operation);
},
clearHistory: function () {
if (ReactHostOperationHistoryHook._preventClearing) {
// Should only be used for tests.
return;
}
history = [];
},
getHistory: function () {
return history;
}
};
module.exports = ReactHostOperationHistoryHook;
/***/ },
/* 67 */
/*!**************************************!*\
!*** ./~/fbjs/lib/performanceNow.js ***!
\**************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @typechecks
*/
var performance = __webpack_require__(/*! ./performance */ 68);
var performanceNow;
/**
* Detect if we can use `window.performance.now()` and gracefully fallback to
* `Date.now()` if it doesn't exist. We need to support Firefox < 15 for now
* because of Facebook's testing infrastructure.
*/
if (performance.now) {
performanceNow = function performanceNow() {
return performance.now();
};
} else {
performanceNow = function performanceNow() {
return Date.now();
};
}
module.exports = performanceNow;
/***/ },
/* 68 */
/*!***********************************!*\
!*** ./~/fbjs/lib/performance.js ***!
\***********************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @typechecks
*/
'use strict';
var ExecutionEnvironment = __webpack_require__(/*! ./ExecutionEnvironment */ 49);
var performance;
if (ExecutionEnvironment.canUseDOM) {
performance = window.performance || window.msPerformance || window.webkitPerformance;
}
module.exports = performance || {};
/***/ },
/* 69 */
/*!****************************************!*\
!*** ./~/react-dom/lib/Transaction.js ***!
\****************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
'use strict';
var _prodInvariant = __webpack_require__(/*! ./reactProdInvariant */ 36);
var invariant = __webpack_require__(/*! fbjs/lib/invariant */ 9);
var OBSERVED_ERROR = {};
/**
* `Transaction` creates a black box that is able to wrap any method such that
* certain invariants are maintained before and after the method is invoked
* (Even if an exception is thrown while invoking the wrapped method). Whoever
* instantiates a transaction can provide enforcers of the invariants at
* creation time. The `Transaction` class itself will supply one additional
* automatic invariant for you - the invariant that any transaction instance
* should not be run while it is already being run. You would typically create a
* single instance of a `Transaction` for reuse multiple times, that potentially
* is used to wrap several different methods. Wrappers are extremely simple -
* they only require implementing two methods.
*
* <pre>
* wrappers (injected at creation time)
* + +
* | |
* +-----------------|--------|--------------+
* | v | |
* | +---------------+ | |
* | +--| wrapper1 |---|----+ |
* | | +---------------+ v | |
* | | +-------------+ | |
* | | +----| wrapper2 |--------+ |
* | | | +-------------+ | | |
* | | | | | |
* | v v v v | wrapper
* | +---+ +---+ +---------+ +---+ +---+ | invariants
* perform(anyMethod) | | | | | | | | | | | | maintained
* +----------------->|-|---|-|---|-->|anyMethod|---|---|-|---|-|-------->
* | | | | | | | | | | | |
* | | | | | | | | | | | |
* | | | | | | | | | | | |
* | +---+ +---+ +---------+ +---+ +---+ |
* | initialize close |
* +-----------------------------------------+
* </pre>
*
* Use cases:
* - Preserving the input selection ranges before/after reconciliation.
* Restoring selection even in the event of an unexpected error.
* - Deactivating events while rearranging the DOM, preventing blurs/focuses,
* while guaranteeing that afterwards, the event system is reactivated.
* - Flushing a queue of collected DOM mutations to the main UI thread after a
* reconciliation takes place in a worker thread.
* - Invoking any collected `componentDidUpdate` callbacks after rendering new
* content.
* - (Future use case): Wrapping particular flushes of the `ReactWorker` queue
* to preserve the `scrollTop` (an automatic scroll aware DOM).
* - (Future use case): Layout calculations before and after DOM updates.
*
* Transactional plugin API:
* - A module that has an `initialize` method that returns any precomputation.
* - and a `close` method that accepts the precomputation. `close` is invoked
* when the wrapped process is completed, or has failed.
*
* @param {Array<TransactionalWrapper>} transactionWrapper Wrapper modules
* that implement `initialize` and `close`.
* @return {Transaction} Single transaction for reuse in thread.
*
* @class Transaction
*/
var TransactionImpl = {
/**
* Sets up this instance so that it is prepared for collecting metrics. Does
* so such that this setup method may be used on an instance that is already
* initialized, in a way that does not consume additional memory upon reuse.
* That can be useful if you decide to make your subclass of this mixin a
* "PooledClass".
*/
reinitializeTransaction: function () {
this.transactionWrappers = this.getTransactionWrappers();
if (this.wrapperInitData) {
this.wrapperInitData.length = 0;
} else {
this.wrapperInitData = [];
}
this._isInTransaction = false;
},
_isInTransaction: false,
/**
* @abstract
* @return {Array<TransactionWrapper>} Array of transaction wrappers.
*/
getTransactionWrappers: null,
isInTransaction: function () {
return !!this._isInTransaction;
},
/**
* Executes the function within a safety window. Use this for the top level
* methods that result in large amounts of computation/mutations that would
* need to be safety checked. The optional arguments helps prevent the need
* to bind in many cases.
*
* @param {function} method Member of scope to call.
* @param {Object} scope Scope to invoke from.
* @param {Object?=} a Argument to pass to the method.
* @param {Object?=} b Argument to pass to the method.
* @param {Object?=} c Argument to pass to the method.
* @param {Object?=} d Argument to pass to the method.
* @param {Object?=} e Argument to pass to the method.
* @param {Object?=} f Argument to pass to the method.
*
* @return {*} Return value from `method`.
*/
perform: function (method, scope, a, b, c, d, e, f) {
!!this.isInTransaction() ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Transaction.perform(...): Cannot initialize a transaction when there is already an outstanding transaction.') : _prodInvariant('27') : void 0;
var errorThrown;
var ret;
try {
this._isInTransaction = true;
// Catching errors makes debugging more difficult, so we start with
// errorThrown set to true before setting it to false after calling
// close -- if it's still set to true in the finally block, it means
// one of these calls threw.
errorThrown = true;
this.initializeAll(0);
ret = method.call(scope, a, b, c, d, e, f);
errorThrown = false;
} finally {
try {
if (errorThrown) {
// If `method` throws, prefer to show that stack trace over any thrown
// by invoking `closeAll`.
try {
this.closeAll(0);
} catch (err) {}
} else {
// Since `method` didn't throw, we don't want to silence the exception
// here.
this.closeAll(0);
}
} finally {
this._isInTransaction = false;
}
}
return ret;
},
initializeAll: function (startIndex) {
var transactionWrappers = this.transactionWrappers;
for (var i = startIndex; i < transactionWrappers.length; i++) {
var wrapper = transactionWrappers[i];
try {
// Catching errors makes debugging more difficult, so we start with the
// OBSERVED_ERROR state before overwriting it with the real return value
// of initialize -- if it's still set to OBSERVED_ERROR in the finally
// block, it means wrapper.initialize threw.
this.wrapperInitData[i] = OBSERVED_ERROR;
this.wrapperInitData[i] = wrapper.initialize ? wrapper.initialize.call(this) : null;
} finally {
if (this.wrapperInitData[i] === OBSERVED_ERROR) {
// The initializer for wrapper i threw an error; initialize the
// remaining wrappers but silence any exceptions from them to ensure
// that the first error is the one to bubble up.
try {
this.initializeAll(i + 1);
} catch (err) {}
}
}
}
},
/**
* Invokes each of `this.transactionWrappers.close[i]` functions, passing into
* them the respective return values of `this.transactionWrappers.init[i]`
* (`close`rs that correspond to initializers that failed will not be
* invoked).
*/
closeAll: function (startIndex) {
!this.isInTransaction() ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Transaction.closeAll(): Cannot close transaction when none are open.') : _prodInvariant('28') : void 0;
var transactionWrappers = this.transactionWrappers;
for (var i = startIndex; i < transactionWrappers.length; i++) {
var wrapper = transactionWrappers[i];
var initData = this.wrapperInitData[i];
var errorThrown;
try {
// Catching errors makes debugging more difficult, so we start with
// errorThrown set to true before setting it to false after calling
// close -- if it's still set to true in the finally block, it means
// wrapper.close threw.
errorThrown = true;
if (initData !== OBSERVED_ERROR && wrapper.close) {
wrapper.close.call(this, initData);
}
errorThrown = false;
} finally {
if (errorThrown) {
// The closer for wrapper i threw an error; close the remaining
// wrappers but silence any exceptions from them to ensure that the
// first error is the one to bubble up.
try {
this.closeAll(i + 1);
} catch (e) {}
}
}
}
this.wrapperInitData.length = 0;
}
};
module.exports = TransactionImpl;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 70 */
/*!*******************************************!*\
!*** ./~/react-dom/lib/getEventTarget.js ***!
\*******************************************/
/***/ function(module, exports) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
/**
* Gets the target node from a native browser event by accounting for
* inconsistencies in browser DOM APIs.
*
* @param {object} nativeEvent Native browser event.
* @return {DOMEventTarget} Target node.
*/
function getEventTarget(nativeEvent) {
var target = nativeEvent.target || nativeEvent.srcElement || window;
// Normalize SVG <use> element events #4963
if (target.correspondingUseElement) {
target = target.correspondingUseElement;
}
// Safari may fire events on text nodes (Node.TEXT_NODE is 3).
// @see http://www.quirksmode.org/js/events_properties.html
return target.nodeType === 3 ? target.parentNode : target;
}
module.exports = getEventTarget;
/***/ },
/* 71 */
/*!*********************************************!*\
!*** ./~/react-dom/lib/isEventSupported.js ***!
\*********************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var ExecutionEnvironment = __webpack_require__(/*! fbjs/lib/ExecutionEnvironment */ 49);
var useHasFeature;
if (ExecutionEnvironment.canUseDOM) {
useHasFeature = document.implementation && document.implementation.hasFeature &&
// always returns true in newer browsers as per the standard.
// @see http://dom.spec.whatwg.org/#dom-domimplementation-hasfeature
document.implementation.hasFeature('', '') !== true;
}
/**
* Checks if an event is supported in the current execution environment.
*
* NOTE: This will not work correctly for non-generic events such as `change`,
* `reset`, `load`, `error`, and `select`.
*
* Borrows from Modernizr.
*
* @param {string} eventNameSuffix Event name, e.g. "click".
* @param {?boolean} capture Check if the capture phase is supported.
* @return {boolean} True if the event is supported.
* @internal
* @license Modernizr 3.0.0pre (Custom Build) | MIT
*/
function isEventSupported(eventNameSuffix, capture) {
if (!ExecutionEnvironment.canUseDOM || capture && !('addEventListener' in document)) {
return false;
}
var eventName = 'on' + eventNameSuffix;
var isSupported = eventName in document;
if (!isSupported) {
var element = document.createElement('div');
element.setAttribute(eventName, 'return;');
isSupported = typeof element[eventName] === 'function';
}
if (!isSupported && useHasFeature && eventNameSuffix === 'wheel') {
// This is the only way to test support for the `wheel` event in IE9+.
isSupported = document.implementation.hasFeature('Events.wheel', '3.0');
}
return isSupported;
}
module.exports = isEventSupported;
/***/ },
/* 72 */
/*!***********************************************!*\
!*** ./~/react-dom/lib/isTextInputElement.js ***!
\***********************************************/
/***/ function(module, exports) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
'use strict';
/**
* @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary
*/
var supportedInputTypes = {
'color': true,
'date': true,
'datetime': true,
'datetime-local': true,
'email': true,
'month': true,
'number': true,
'password': true,
'range': true,
'search': true,
'tel': true,
'text': true,
'time': true,
'url': true,
'week': true
};
function isTextInputElement(elem) {
var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
if (nodeName === 'input') {
return !!supportedInputTypes[elem.type];
}
if (nodeName === 'textarea') {
return true;
}
return false;
}
module.exports = isTextInputElement;
/***/ },
/* 73 */
/*!****************************************************!*\
!*** ./~/react-dom/lib/DefaultEventPluginOrder.js ***!
\****************************************************/
/***/ function(module, exports) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
/**
* Module that is injectable into `EventPluginHub`, that specifies a
* deterministic ordering of `EventPlugin`s. A convenient way to reason about
* plugins, without having to package every one of them. This is better than
* having plugins be ordered in the same order that they are injected because
* that ordering would be influenced by the packaging order.
* `ResponderEventPlugin` must occur before `SimpleEventPlugin` so that
* preventing default on events is convenient in `SimpleEventPlugin` handlers.
*/
var DefaultEventPluginOrder = ['ResponderEventPlugin', 'SimpleEventPlugin', 'TapEventPlugin', 'EnterLeaveEventPlugin', 'ChangeEventPlugin', 'SelectEventPlugin', 'BeforeInputEventPlugin'];
module.exports = DefaultEventPluginOrder;
/***/ },
/* 74 */
/*!**************************************************!*\
!*** ./~/react-dom/lib/EnterLeaveEventPlugin.js ***!
\**************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var EventPropagators = __webpack_require__(/*! ./EventPropagators */ 42);
var ReactDOMComponentTree = __webpack_require__(/*! ./ReactDOMComponentTree */ 35);
var SyntheticMouseEvent = __webpack_require__(/*! ./SyntheticMouseEvent */ 75);
var eventTypes = {
mouseEnter: {
registrationName: 'onMouseEnter',
dependencies: ['topMouseOut', 'topMouseOver']
},
mouseLeave: {
registrationName: 'onMouseLeave',
dependencies: ['topMouseOut', 'topMouseOver']
}
};
var EnterLeaveEventPlugin = {
eventTypes: eventTypes,
/**
* For almost every interaction we care about, there will be both a top-level
* `mouseover` and `mouseout` event that occurs. Only use `mouseout` so that
* we do not extract duplicate events. However, moving the mouse into the
* browser from outside will not fire a `mouseout` event. In this case, we use
* the `mouseover` top-level event.
*/
extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
if (topLevelType === 'topMouseOver' && (nativeEvent.relatedTarget || nativeEvent.fromElement)) {
return null;
}
if (topLevelType !== 'topMouseOut' && topLevelType !== 'topMouseOver') {
// Must not be a mouse in or mouse out - ignoring.
return null;
}
var win;
if (nativeEventTarget.window === nativeEventTarget) {
// `nativeEventTarget` is probably a window object.
win = nativeEventTarget;
} else {
// TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.
var doc = nativeEventTarget.ownerDocument;
if (doc) {
win = doc.defaultView || doc.parentWindow;
} else {
win = window;
}
}
var from;
var to;
if (topLevelType === 'topMouseOut') {
from = targetInst;
var related = nativeEvent.relatedTarget || nativeEvent.toElement;
to = related ? ReactDOMComponentTree.getClosestInstanceFromNode(related) : null;
} else {
// Moving to a node from outside the window.
from = null;
to = targetInst;
}
if (from === to) {
// Nothing pertains to our managed components.
return null;
}
var fromNode = from == null ? win : ReactDOMComponentTree.getNodeFromInstance(from);
var toNode = to == null ? win : ReactDOMComponentTree.getNodeFromInstance(to);
var leave = SyntheticMouseEvent.getPooled(eventTypes.mouseLeave, from, nativeEvent, nativeEventTarget);
leave.type = 'mouseleave';
leave.target = fromNode;
leave.relatedTarget = toNode;
var enter = SyntheticMouseEvent.getPooled(eventTypes.mouseEnter, to, nativeEvent, nativeEventTarget);
enter.type = 'mouseenter';
enter.target = toNode;
enter.relatedTarget = fromNode;
EventPropagators.accumulateEnterLeaveDispatches(leave, enter, from, to);
return [leave, enter];
}
};
module.exports = EnterLeaveEventPlugin;
/***/ },
/* 75 */
/*!************************************************!*\
!*** ./~/react-dom/lib/SyntheticMouseEvent.js ***!
\************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var SyntheticUIEvent = __webpack_require__(/*! ./SyntheticUIEvent */ 76);
var ViewportMetrics = __webpack_require__(/*! ./ViewportMetrics */ 77);
var getEventModifierState = __webpack_require__(/*! ./getEventModifierState */ 78);
/**
* @interface MouseEvent
* @see http://www.w3.org/TR/DOM-Level-3-Events/
*/
var MouseEventInterface = {
screenX: null,
screenY: null,
clientX: null,
clientY: null,
ctrlKey: null,
shiftKey: null,
altKey: null,
metaKey: null,
getModifierState: getEventModifierState,
button: function (event) {
// Webkit, Firefox, IE9+
// which: 1 2 3
// button: 0 1 2 (standard)
var button = event.button;
if ('which' in event) {
return button;
}
// IE<9
// which: undefined
// button: 0 0 0
// button: 1 4 2 (onmouseup)
return button === 2 ? 2 : button === 4 ? 1 : 0;
},
buttons: null,
relatedTarget: function (event) {
return event.relatedTarget || (event.fromElement === event.srcElement ? event.toElement : event.fromElement);
},
// "Proprietary" Interface.
pageX: function (event) {
return 'pageX' in event ? event.pageX : event.clientX + ViewportMetrics.currentScrollLeft;
},
pageY: function (event) {
return 'pageY' in event ? event.pageY : event.clientY + ViewportMetrics.currentScrollTop;
}
};
/**
* @param {object} dispatchConfig Configuration used to dispatch this event.
* @param {string} dispatchMarker Marker identifying the event target.
* @param {object} nativeEvent Native browser event.
* @extends {SyntheticUIEvent}
*/
function SyntheticMouseEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
}
SyntheticUIEvent.augmentClass(SyntheticMouseEvent, MouseEventInterface);
module.exports = SyntheticMouseEvent;
/***/ },
/* 76 */
/*!*********************************************!*\
!*** ./~/react-dom/lib/SyntheticUIEvent.js ***!
\*********************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var SyntheticEvent = __webpack_require__(/*! ./SyntheticEvent */ 54);
var getEventTarget = __webpack_require__(/*! ./getEventTarget */ 70);
/**
* @interface UIEvent
* @see http://www.w3.org/TR/DOM-Level-3-Events/
*/
var UIEventInterface = {
view: function (event) {
if (event.view) {
return event.view;
}
var target = getEventTarget(event);
if (target.window === target) {
// target is a window object
return target;
}
var doc = target.ownerDocument;
// TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.
if (doc) {
return doc.defaultView || doc.parentWindow;
} else {
return window;
}
},
detail: function (event) {
return event.detail || 0;
}
};
/**
* @param {object} dispatchConfig Configuration used to dispatch this event.
* @param {string} dispatchMarker Marker identifying the event target.
* @param {object} nativeEvent Native browser event.
* @extends {SyntheticEvent}
*/
function SyntheticUIEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
}
SyntheticEvent.augmentClass(SyntheticUIEvent, UIEventInterface);
module.exports = SyntheticUIEvent;
/***/ },
/* 77 */
/*!********************************************!*\
!*** ./~/react-dom/lib/ViewportMetrics.js ***!
\********************************************/
/***/ function(module, exports) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var ViewportMetrics = {
currentScrollLeft: 0,
currentScrollTop: 0,
refreshScrollValues: function (scrollPosition) {
ViewportMetrics.currentScrollLeft = scrollPosition.x;
ViewportMetrics.currentScrollTop = scrollPosition.y;
}
};
module.exports = ViewportMetrics;
/***/ },
/* 78 */
/*!**************************************************!*\
!*** ./~/react-dom/lib/getEventModifierState.js ***!
\**************************************************/
/***/ function(module, exports) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
/**
* Translation from modifier key to the associated property in the event.
* @see http://www.w3.org/TR/DOM-Level-3-Events/#keys-Modifiers
*/
var modifierKeyToProp = {
'Alt': 'altKey',
'Control': 'ctrlKey',
'Meta': 'metaKey',
'Shift': 'shiftKey'
};
// IE8 does not implement getModifierState so we simply map it to the only
// modifier keys exposed by the event itself, does not support Lock-keys.
// Currently, all major browsers except Chrome seems to support Lock-keys.
function modifierStateGetter(keyArg) {
var syntheticEvent = this;
var nativeEvent = syntheticEvent.nativeEvent;
if (nativeEvent.getModifierState) {
return nativeEvent.getModifierState(keyArg);
}
var keyProp = modifierKeyToProp[keyArg];
return keyProp ? !!nativeEvent[keyProp] : false;
}
function getEventModifierState(nativeEvent) {
return modifierStateGetter;
}
module.exports = getEventModifierState;
/***/ },
/* 79 */
/*!**************************************************!*\
!*** ./~/react-dom/lib/HTMLDOMPropertyConfig.js ***!
\**************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var DOMProperty = __webpack_require__(/*! ./DOMProperty */ 37);
var MUST_USE_PROPERTY = DOMProperty.injection.MUST_USE_PROPERTY;
var HAS_BOOLEAN_VALUE = DOMProperty.injection.HAS_BOOLEAN_VALUE;
var HAS_NUMERIC_VALUE = DOMProperty.injection.HAS_NUMERIC_VALUE;
var HAS_POSITIVE_NUMERIC_VALUE = DOMProperty.injection.HAS_POSITIVE_NUMERIC_VALUE;
var HAS_OVERLOADED_BOOLEAN_VALUE = DOMProperty.injection.HAS_OVERLOADED_BOOLEAN_VALUE;
var HTMLDOMPropertyConfig = {
isCustomAttribute: RegExp.prototype.test.bind(new RegExp('^(data|aria)-[' + DOMProperty.ATTRIBUTE_NAME_CHAR + ']*$')),
Properties: {
/**
* Standard Properties
*/
accept: 0,
acceptCharset: 0,
accessKey: 0,
action: 0,
allowFullScreen: HAS_BOOLEAN_VALUE,
allowTransparency: 0,
alt: 0,
// specifies target context for links with `preload` type
as: 0,
async: HAS_BOOLEAN_VALUE,
autoComplete: 0,
// autoFocus is polyfilled/normalized by AutoFocusUtils
// autoFocus: HAS_BOOLEAN_VALUE,
autoPlay: HAS_BOOLEAN_VALUE,
capture: HAS_BOOLEAN_VALUE,
cellPadding: 0,
cellSpacing: 0,
charSet: 0,
challenge: 0,
checked: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
cite: 0,
classID: 0,
className: 0,
cols: HAS_POSITIVE_NUMERIC_VALUE,
colSpan: 0,
content: 0,
contentEditable: 0,
contextMenu: 0,
controls: HAS_BOOLEAN_VALUE,
coords: 0,
crossOrigin: 0,
data: 0, // For `<object />` acts as `src`.
dateTime: 0,
'default': HAS_BOOLEAN_VALUE,
defer: HAS_BOOLEAN_VALUE,
dir: 0,
disabled: HAS_BOOLEAN_VALUE,
download: HAS_OVERLOADED_BOOLEAN_VALUE,
draggable: 0,
encType: 0,
form: 0,
formAction: 0,
formEncType: 0,
formMethod: 0,
formNoValidate: HAS_BOOLEAN_VALUE,
formTarget: 0,
frameBorder: 0,
headers: 0,
height: 0,
hidden: HAS_BOOLEAN_VALUE,
high: 0,
href: 0,
hrefLang: 0,
htmlFor: 0,
httpEquiv: 0,
icon: 0,
id: 0,
inputMode: 0,
integrity: 0,
is: 0,
keyParams: 0,
keyType: 0,
kind: 0,
label: 0,
lang: 0,
list: 0,
loop: HAS_BOOLEAN_VALUE,
low: 0,
manifest: 0,
marginHeight: 0,
marginWidth: 0,
max: 0,
maxLength: 0,
media: 0,
mediaGroup: 0,
method: 0,
min: 0,
minLength: 0,
// Caution; `option.selected` is not updated if `select.multiple` is
// disabled with `removeAttribute`.
multiple: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
muted: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
name: 0,
nonce: 0,
noValidate: HAS_BOOLEAN_VALUE,
open: HAS_BOOLEAN_VALUE,
optimum: 0,
pattern: 0,
placeholder: 0,
playsInline: HAS_BOOLEAN_VALUE,
poster: 0,
preload: 0,
profile: 0,
radioGroup: 0,
readOnly: HAS_BOOLEAN_VALUE,
referrerPolicy: 0,
rel: 0,
required: HAS_BOOLEAN_VALUE,
reversed: HAS_BOOLEAN_VALUE,
role: 0,
rows: HAS_POSITIVE_NUMERIC_VALUE,
rowSpan: HAS_NUMERIC_VALUE,
sandbox: 0,
scope: 0,
scoped: HAS_BOOLEAN_VALUE,
scrolling: 0,
seamless: HAS_BOOLEAN_VALUE,
selected: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
shape: 0,
size: HAS_POSITIVE_NUMERIC_VALUE,
sizes: 0,
span: HAS_POSITIVE_NUMERIC_VALUE,
spellCheck: 0,
src: 0,
srcDoc: 0,
srcLang: 0,
srcSet: 0,
start: HAS_NUMERIC_VALUE,
step: 0,
style: 0,
summary: 0,
tabIndex: 0,
target: 0,
title: 0,
// Setting .type throws on non-<input> tags
type: 0,
useMap: 0,
value: 0,
width: 0,
wmode: 0,
wrap: 0,
/**
* RDFa Properties
*/
about: 0,
datatype: 0,
inlist: 0,
prefix: 0,
// property is also supported for OpenGraph in meta tags.
property: 0,
resource: 0,
'typeof': 0,
vocab: 0,
/**
* Non-standard Properties
*/
// autoCapitalize and autoCorrect are supported in Mobile Safari for
// keyboard hints.
autoCapitalize: 0,
autoCorrect: 0,
// autoSave allows WebKit/Blink to persist values of input fields on page reloads
autoSave: 0,
// color is for Safari mask-icon link
color: 0,
// itemProp, itemScope, itemType are for
// Microdata support. See http://schema.org/docs/gs.html
itemProp: 0,
itemScope: HAS_BOOLEAN_VALUE,
itemType: 0,
// itemID and itemRef are for Microdata support as well but
// only specified in the WHATWG spec document. See
// https://html.spec.whatwg.org/multipage/microdata.html#microdata-dom-api
itemID: 0,
itemRef: 0,
// results show looking glass icon and recent searches on input
// search fields in WebKit/Blink
results: 0,
// IE-only attribute that specifies security restrictions on an iframe
// as an alternative to the sandbox attribute on IE<10
security: 0,
// IE-only attribute that controls focus behavior
unselectable: 0
},
DOMAttributeNames: {
acceptCharset: 'accept-charset',
className: 'class',
htmlFor: 'for',
httpEquiv: 'http-equiv'
},
DOMPropertyNames: {}
};
module.exports = HTMLDOMPropertyConfig;
/***/ },
/* 80 */
/*!*************************************************************!*\
!*** ./~/react-dom/lib/ReactComponentBrowserEnvironment.js ***!
\*************************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var DOMChildrenOperations = __webpack_require__(/*! ./DOMChildrenOperations */ 81);
var ReactDOMIDOperations = __webpack_require__(/*! ./ReactDOMIDOperations */ 92);
/**
* Abstracts away all functionality of the reconciler that requires knowledge of
* the browser context. TODO: These callers should be refactored to avoid the
* need for this injection.
*/
var ReactComponentBrowserEnvironment = {
processChildrenUpdates: ReactDOMIDOperations.dangerouslyProcessChildrenUpdates,
replaceNodeWithMarkup: DOMChildrenOperations.dangerouslyReplaceNodeWithMarkup
};
module.exports = ReactComponentBrowserEnvironment;
/***/ },
/* 81 */
/*!**************************************************!*\
!*** ./~/react-dom/lib/DOMChildrenOperations.js ***!
\**************************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var DOMLazyTree = __webpack_require__(/*! ./DOMLazyTree */ 82);
var Danger = __webpack_require__(/*! ./Danger */ 88);
var ReactDOMComponentTree = __webpack_require__(/*! ./ReactDOMComponentTree */ 35);
var ReactInstrumentation = __webpack_require__(/*! ./ReactInstrumentation */ 63);
var createMicrosoftUnsafeLocalFunction = __webpack_require__(/*! ./createMicrosoftUnsafeLocalFunction */ 85);
var setInnerHTML = __webpack_require__(/*! ./setInnerHTML */ 84);
var setTextContent = __webpack_require__(/*! ./setTextContent */ 86);
function getNodeAfter(parentNode, node) {
// Special case for text components, which return [open, close] comments
// from getHostNode.
if (Array.isArray(node)) {
node = node[1];
}
return node ? node.nextSibling : parentNode.firstChild;
}
/**
* Inserts `childNode` as a child of `parentNode` at the `index`.
*
* @param {DOMElement} parentNode Parent node in which to insert.
* @param {DOMElement} childNode Child node to insert.
* @param {number} index Index at which to insert the child.
* @internal
*/
var insertChildAt = createMicrosoftUnsafeLocalFunction(function (parentNode, childNode, referenceNode) {
// We rely exclusively on `insertBefore(node, null)` instead of also using
// `appendChild(node)`. (Using `undefined` is not allowed by all browsers so
// we are careful to use `null`.)
parentNode.insertBefore(childNode, referenceNode);
});
function insertLazyTreeChildAt(parentNode, childTree, referenceNode) {
DOMLazyTree.insertTreeBefore(parentNode, childTree, referenceNode);
}
function moveChild(parentNode, childNode, referenceNode) {
if (Array.isArray(childNode)) {
moveDelimitedText(parentNode, childNode[0], childNode[1], referenceNode);
} else {
insertChildAt(parentNode, childNode, referenceNode);
}
}
function removeChild(parentNode, childNode) {
if (Array.isArray(childNode)) {
var closingComment = childNode[1];
childNode = childNode[0];
removeDelimitedText(parentNode, childNode, closingComment);
parentNode.removeChild(closingComment);
}
parentNode.removeChild(childNode);
}
function moveDelimitedText(parentNode, openingComment, closingComment, referenceNode) {
var node = openingComment;
while (true) {
var nextNode = node.nextSibling;
insertChildAt(parentNode, node, referenceNode);
if (node === closingComment) {
break;
}
node = nextNode;
}
}
function removeDelimitedText(parentNode, startNode, closingComment) {
while (true) {
var node = startNode.nextSibling;
if (node === closingComment) {
// The closing comment is removed by ReactMultiChild.
break;
} else {
parentNode.removeChild(node);
}
}
}
function replaceDelimitedText(openingComment, closingComment, stringText) {
var parentNode = openingComment.parentNode;
var nodeAfterComment = openingComment.nextSibling;
if (nodeAfterComment === closingComment) {
// There are no text nodes between the opening and closing comments; insert
// a new one if stringText isn't empty.
if (stringText) {
insertChildAt(parentNode, document.createTextNode(stringText), nodeAfterComment);
}
} else {
if (stringText) {
// Set the text content of the first node after the opening comment, and
// remove all following nodes up until the closing comment.
setTextContent(nodeAfterComment, stringText);
removeDelimitedText(parentNode, nodeAfterComment, closingComment);
} else {
removeDelimitedText(parentNode, openingComment, closingComment);
}
}
if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onHostOperation({
instanceID: ReactDOMComponentTree.getInstanceFromNode(openingComment)._debugID,
type: 'replace text',
payload: stringText
});
}
}
var dangerouslyReplaceNodeWithMarkup = Danger.dangerouslyReplaceNodeWithMarkup;
if (process.env.NODE_ENV !== 'production') {
dangerouslyReplaceNodeWithMarkup = function (oldChild, markup, prevInstance) {
Danger.dangerouslyReplaceNodeWithMarkup(oldChild, markup);
if (prevInstance._debugID !== 0) {
ReactInstrumentation.debugTool.onHostOperation({
instanceID: prevInstance._debugID,
type: 'replace with',
payload: markup.toString()
});
} else {
var nextInstance = ReactDOMComponentTree.getInstanceFromNode(markup.node);
if (nextInstance._debugID !== 0) {
ReactInstrumentation.debugTool.onHostOperation({
instanceID: nextInstance._debugID,
type: 'mount',
payload: markup.toString()
});
}
}
};
}
/**
* Operations for updating with DOM children.
*/
var DOMChildrenOperations = {
dangerouslyReplaceNodeWithMarkup: dangerouslyReplaceNodeWithMarkup,
replaceDelimitedText: replaceDelimitedText,
/**
* Updates a component's children by processing a series of updates. The
* update configurations are each expected to have a `parentNode` property.
*
* @param {array<object>} updates List of update configurations.
* @internal
*/
processUpdates: function (parentNode, updates) {
if (process.env.NODE_ENV !== 'production') {
var parentNodeDebugID = ReactDOMComponentTree.getInstanceFromNode(parentNode)._debugID;
}
for (var k = 0; k < updates.length; k++) {
var update = updates[k];
switch (update.type) {
case 'INSERT_MARKUP':
insertLazyTreeChildAt(parentNode, update.content, getNodeAfter(parentNode, update.afterNode));
if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onHostOperation({
instanceID: parentNodeDebugID,
type: 'insert child',
payload: { toIndex: update.toIndex, content: update.content.toString() }
});
}
break;
case 'MOVE_EXISTING':
moveChild(parentNode, update.fromNode, getNodeAfter(parentNode, update.afterNode));
if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onHostOperation({
instanceID: parentNodeDebugID,
type: 'move child',
payload: { fromIndex: update.fromIndex, toIndex: update.toIndex }
});
}
break;
case 'SET_MARKUP':
setInnerHTML(parentNode, update.content);
if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onHostOperation({
instanceID: parentNodeDebugID,
type: 'replace children',
payload: update.content.toString()
});
}
break;
case 'TEXT_CONTENT':
setTextContent(parentNode, update.content);
if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onHostOperation({
instanceID: parentNodeDebugID,
type: 'replace text',
payload: update.content.toString()
});
}
break;
case 'REMOVE_NODE':
removeChild(parentNode, update.fromNode);
if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onHostOperation({
instanceID: parentNodeDebugID,
type: 'remove child',
payload: { fromIndex: update.fromIndex }
});
}
break;
}
}
}
};
module.exports = DOMChildrenOperations;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 82 */
/*!****************************************!*\
!*** ./~/react-dom/lib/DOMLazyTree.js ***!
\****************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var DOMNamespaces = __webpack_require__(/*! ./DOMNamespaces */ 83);
var setInnerHTML = __webpack_require__(/*! ./setInnerHTML */ 84);
var createMicrosoftUnsafeLocalFunction = __webpack_require__(/*! ./createMicrosoftUnsafeLocalFunction */ 85);
var setTextContent = __webpack_require__(/*! ./setTextContent */ 86);
var ELEMENT_NODE_TYPE = 1;
var DOCUMENT_FRAGMENT_NODE_TYPE = 11;
/**
* In IE (8-11) and Edge, appending nodes with no children is dramatically
* faster than appending a full subtree, so we essentially queue up the
* .appendChild calls here and apply them so each node is added to its parent
* before any children are added.
*
* In other browsers, doing so is slower or neutral compared to the other order
* (in Firefox, twice as slow) so we only do this inversion in IE.
*
* See https://github.com/spicyj/innerhtml-vs-createelement-vs-clonenode.
*/
var enableLazy = typeof document !== 'undefined' && typeof document.documentMode === 'number' || typeof navigator !== 'undefined' && typeof navigator.userAgent === 'string' && /\bEdge\/\d/.test(navigator.userAgent);
function insertTreeChildren(tree) {
if (!enableLazy) {
return;
}
var node = tree.node;
var children = tree.children;
if (children.length) {
for (var i = 0; i < children.length; i++) {
insertTreeBefore(node, children[i], null);
}
} else if (tree.html != null) {
setInnerHTML(node, tree.html);
} else if (tree.text != null) {
setTextContent(node, tree.text);
}
}
var insertTreeBefore = createMicrosoftUnsafeLocalFunction(function (parentNode, tree, referenceNode) {
// DocumentFragments aren't actually part of the DOM after insertion so
// appending children won't update the DOM. We need to ensure the fragment
// is properly populated first, breaking out of our lazy approach for just
// this level. Also, some <object> plugins (like Flash Player) will read
// <param> nodes immediately upon insertion into the DOM, so <object>
// must also be populated prior to insertion into the DOM.
if (tree.node.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE || tree.node.nodeType === ELEMENT_NODE_TYPE && tree.node.nodeName.toLowerCase() === 'object' && (tree.node.namespaceURI == null || tree.node.namespaceURI === DOMNamespaces.html)) {
insertTreeChildren(tree);
parentNode.insertBefore(tree.node, referenceNode);
} else {
parentNode.insertBefore(tree.node, referenceNode);
insertTreeChildren(tree);
}
});
function replaceChildWithTree(oldNode, newTree) {
oldNode.parentNode.replaceChild(newTree.node, oldNode);
insertTreeChildren(newTree);
}
function queueChild(parentTree, childTree) {
if (enableLazy) {
parentTree.children.push(childTree);
} else {
parentTree.node.appendChild(childTree.node);
}
}
function queueHTML(tree, html) {
if (enableLazy) {
tree.html = html;
} else {
setInnerHTML(tree.node, html);
}
}
function queueText(tree, text) {
if (enableLazy) {
tree.text = text;
} else {
setTextContent(tree.node, text);
}
}
function toString() {
return this.node.nodeName;
}
function DOMLazyTree(node) {
return {
node: node,
children: [],
html: null,
text: null,
toString: toString
};
}
DOMLazyTree.insertTreeBefore = insertTreeBefore;
DOMLazyTree.replaceChildWithTree = replaceChildWithTree;
DOMLazyTree.queueChild = queueChild;
DOMLazyTree.queueHTML = queueHTML;
DOMLazyTree.queueText = queueText;
module.exports = DOMLazyTree;
/***/ },
/* 83 */
/*!******************************************!*\
!*** ./~/react-dom/lib/DOMNamespaces.js ***!
\******************************************/
/***/ function(module, exports) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var DOMNamespaces = {
html: 'http://www.w3.org/1999/xhtml',
mathml: 'http://www.w3.org/1998/Math/MathML',
svg: 'http://www.w3.org/2000/svg'
};
module.exports = DOMNamespaces;
/***/ },
/* 84 */
/*!*****************************************!*\
!*** ./~/react-dom/lib/setInnerHTML.js ***!
\*****************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var ExecutionEnvironment = __webpack_require__(/*! fbjs/lib/ExecutionEnvironment */ 49);
var DOMNamespaces = __webpack_require__(/*! ./DOMNamespaces */ 83);
var WHITESPACE_TEST = /^[ \r\n\t\f]/;
var NONVISIBLE_TEST = /<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/;
var createMicrosoftUnsafeLocalFunction = __webpack_require__(/*! ./createMicrosoftUnsafeLocalFunction */ 85);
// SVG temp container for IE lacking innerHTML
var reusableSVGContainer;
/**
* Set the innerHTML property of a node, ensuring that whitespace is preserved
* even in IE8.
*
* @param {DOMElement} node
* @param {string} html
* @internal
*/
var setInnerHTML = createMicrosoftUnsafeLocalFunction(function (node, html) {
// IE does not have innerHTML for SVG nodes, so instead we inject the
// new markup in a temp node and then move the child nodes across into
// the target node
if (node.namespaceURI === DOMNamespaces.svg && !('innerHTML' in node)) {
reusableSVGContainer = reusableSVGContainer || document.createElement('div');
reusableSVGContainer.innerHTML = '<svg>' + html + '</svg>';
var svgNode = reusableSVGContainer.firstChild;
while (svgNode.firstChild) {
node.appendChild(svgNode.firstChild);
}
} else {
node.innerHTML = html;
}
});
if (ExecutionEnvironment.canUseDOM) {
// IE8: When updating a just created node with innerHTML only leading
// whitespace is removed. When updating an existing node with innerHTML
// whitespace in root TextNodes is also collapsed.
// @see quirksmode.org/bugreports/archives/2004/11/innerhtml_and_t.html
// Feature detection; only IE8 is known to behave improperly like this.
var testElement = document.createElement('div');
testElement.innerHTML = ' ';
if (testElement.innerHTML === '') {
setInnerHTML = function (node, html) {
// Magic theory: IE8 supposedly differentiates between added and updated
// nodes when processing innerHTML, innerHTML on updated nodes suffers
// from worse whitespace behavior. Re-adding a node like this triggers
// the initial and more favorable whitespace behavior.
// TODO: What to do on a detached node?
if (node.parentNode) {
node.parentNode.replaceChild(node, node);
}
// We also implement a workaround for non-visible tags disappearing into
// thin air on IE8, this only happens if there is no visible text
// in-front of the non-visible tags. Piggyback on the whitespace fix
// and simply check if any non-visible tags appear in the source.
if (WHITESPACE_TEST.test(html) || html[0] === '<' && NONVISIBLE_TEST.test(html)) {
// Recover leading whitespace by temporarily prepending any character.
// \uFEFF has the potential advantage of being zero-width/invisible.
// UglifyJS drops U+FEFF chars when parsing, so use String.fromCharCode
// in hopes that this is preserved even if "\uFEFF" is transformed to
// the actual Unicode character (by Babel, for example).
// https://github.com/mishoo/UglifyJS2/blob/v2.4.20/lib/parse.js#L216
node.innerHTML = String.fromCharCode(0xFEFF) + html;
// deleteData leaves an empty `TextNode` which offsets the index of all
// children. Definitely want to avoid this.
var textNode = node.firstChild;
if (textNode.data.length === 1) {
node.removeChild(textNode);
} else {
textNode.deleteData(0, 1);
}
} else {
node.innerHTML = html;
}
};
}
testElement = null;
}
module.exports = setInnerHTML;
/***/ },
/* 85 */
/*!***************************************************************!*\
!*** ./~/react-dom/lib/createMicrosoftUnsafeLocalFunction.js ***!
\***************************************************************/
/***/ function(module, exports) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
/* globals MSApp */
'use strict';
/**
* Create a function which has 'unsafe' privileges (required by windows8 apps)
*/
var createMicrosoftUnsafeLocalFunction = function (func) {
if (typeof MSApp !== 'undefined' && MSApp.execUnsafeLocalFunction) {
return function (arg0, arg1, arg2, arg3) {
MSApp.execUnsafeLocalFunction(function () {
return func(arg0, arg1, arg2, arg3);
});
};
} else {
return func;
}
};
module.exports = createMicrosoftUnsafeLocalFunction;
/***/ },
/* 86 */
/*!*******************************************!*\
!*** ./~/react-dom/lib/setTextContent.js ***!
\*******************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var ExecutionEnvironment = __webpack_require__(/*! fbjs/lib/ExecutionEnvironment */ 49);
var escapeTextContentForBrowser = __webpack_require__(/*! ./escapeTextContentForBrowser */ 87);
var setInnerHTML = __webpack_require__(/*! ./setInnerHTML */ 84);
/**
* Set the textContent property of a node, ensuring that whitespace is preserved
* even in IE8. innerText is a poor substitute for textContent and, among many
* issues, inserts <br> instead of the literal newline chars. innerHTML behaves
* as it should.
*
* @param {DOMElement} node
* @param {string} text
* @internal
*/
var setTextContent = function (node, text) {
if (text) {
var firstChild = node.firstChild;
if (firstChild && firstChild === node.lastChild && firstChild.nodeType === 3) {
firstChild.nodeValue = text;
return;
}
}
node.textContent = text;
};
if (ExecutionEnvironment.canUseDOM) {
if (!('textContent' in document.documentElement)) {
setTextContent = function (node, text) {
if (node.nodeType === 3) {
node.nodeValue = text;
return;
}
setInnerHTML(node, escapeTextContentForBrowser(text));
};
}
}
module.exports = setTextContent;
/***/ },
/* 87 */
/*!********************************************************!*\
!*** ./~/react-dom/lib/escapeTextContentForBrowser.js ***!
\********************************************************/
/***/ function(module, exports) {
/**
* Copyright 2016-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* Based on the escape-html library, which is used under the MIT License below:
*
* Copyright (c) 2012-2013 TJ Holowaychuk
* Copyright (c) 2015 Andreas Lubbe
* Copyright (c) 2015 Tiancheng "Timothy" Gu
*
* 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.
*
*/
'use strict';
// code copied and modified from escape-html
/**
* Module variables.
* @private
*/
var matchHtmlRegExp = /["'&<>]/;
/**
* Escape special characters in the given string of html.
*
* @param {string} string The string to escape for inserting into HTML
* @return {string}
* @public
*/
function escapeHtml(string) {
var str = '' + string;
var match = matchHtmlRegExp.exec(str);
if (!match) {
return str;
}
var escape;
var html = '';
var index = 0;
var lastIndex = 0;
for (index = match.index; index < str.length; index++) {
switch (str.charCodeAt(index)) {
case 34:
// "
escape = '"';
break;
case 38:
// &
escape = '&';
break;
case 39:
// '
escape = '''; // modified from escape-html; used to be '''
break;
case 60:
// <
escape = '<';
break;
case 62:
// >
escape = '>';
break;
default:
continue;
}
if (lastIndex !== index) {
html += str.substring(lastIndex, index);
}
lastIndex = index + 1;
html += escape;
}
return lastIndex !== index ? html + str.substring(lastIndex, index) : html;
}
// end code copied and modified from escape-html
/**
* Escapes text to prevent scripting attacks.
*
* @param {*} text Text value to escape.
* @return {string} An escaped string.
*/
function escapeTextContentForBrowser(text) {
if (typeof text === 'boolean' || typeof text === 'number') {
// this shortcircuit helps perf for types that we know will never have
// special characters, especially given that this function is used often
// for numeric dom ids.
return '' + text;
}
return escapeHtml(text);
}
module.exports = escapeTextContentForBrowser;
/***/ },
/* 88 */
/*!***********************************!*\
!*** ./~/react-dom/lib/Danger.js ***!
\***********************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var _prodInvariant = __webpack_require__(/*! ./reactProdInvariant */ 36);
var DOMLazyTree = __webpack_require__(/*! ./DOMLazyTree */ 82);
var ExecutionEnvironment = __webpack_require__(/*! fbjs/lib/ExecutionEnvironment */ 49);
var createNodesFromMarkup = __webpack_require__(/*! fbjs/lib/createNodesFromMarkup */ 89);
var emptyFunction = __webpack_require__(/*! fbjs/lib/emptyFunction */ 13);
var invariant = __webpack_require__(/*! fbjs/lib/invariant */ 9);
var Danger = {
/**
* Replaces a node with a string of markup at its current position within its
* parent. The markup must render into a single root node.
*
* @param {DOMElement} oldChild Child node to replace.
* @param {string} markup Markup to render in place of the child node.
* @internal
*/
dangerouslyReplaceNodeWithMarkup: function (oldChild, markup) {
!ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Cannot render markup in a worker thread. Make sure `window` and `document` are available globally before requiring React when unit testing or use ReactDOMServer.renderToString() for server rendering.') : _prodInvariant('56') : void 0;
!markup ? process.env.NODE_ENV !== 'production' ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Missing markup.') : _prodInvariant('57') : void 0;
!(oldChild.nodeName !== 'HTML') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Cannot replace markup of the <html> node. This is because browser quirks make this unreliable and/or slow. If you want to render to the root you must use server rendering. See ReactDOMServer.renderToString().') : _prodInvariant('58') : void 0;
if (typeof markup === 'string') {
var newChild = createNodesFromMarkup(markup, emptyFunction)[0];
oldChild.parentNode.replaceChild(newChild, oldChild);
} else {
DOMLazyTree.replaceChildWithTree(oldChild, markup);
}
}
};
module.exports = Danger;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 89 */
/*!*********************************************!*\
!*** ./~/fbjs/lib/createNodesFromMarkup.js ***!
\*********************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {'use strict';
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @typechecks
*/
/*eslint-disable fb-www/unsafe-html*/
var ExecutionEnvironment = __webpack_require__(/*! ./ExecutionEnvironment */ 49);
var createArrayFromMixed = __webpack_require__(/*! ./createArrayFromMixed */ 90);
var getMarkupWrap = __webpack_require__(/*! ./getMarkupWrap */ 91);
var invariant = __webpack_require__(/*! ./invariant */ 9);
/**
* Dummy container used to render all markup.
*/
var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null;
/**
* Pattern used by `getNodeName`.
*/
var nodeNamePattern = /^\s*<(\w+)/;
/**
* Extracts the `nodeName` of the first element in a string of markup.
*
* @param {string} markup String of markup.
* @return {?string} Node name of the supplied markup.
*/
function getNodeName(markup) {
var nodeNameMatch = markup.match(nodeNamePattern);
return nodeNameMatch && nodeNameMatch[1].toLowerCase();
}
/**
* Creates an array containing the nodes rendered from the supplied markup. The
* optionally supplied `handleScript` function will be invoked once for each
* <script> element that is rendered. If no `handleScript` function is supplied,
* an exception is thrown if any <script> elements are rendered.
*
* @param {string} markup A string of valid HTML markup.
* @param {?function} handleScript Invoked once for each rendered <script>.
* @return {array<DOMElement|DOMTextNode>} An array of rendered nodes.
*/
function createNodesFromMarkup(markup, handleScript) {
var node = dummyNode;
!!!dummyNode ? process.env.NODE_ENV !== 'production' ? invariant(false, 'createNodesFromMarkup dummy not initialized') : invariant(false) : void 0;
var nodeName = getNodeName(markup);
var wrap = nodeName && getMarkupWrap(nodeName);
if (wrap) {
node.innerHTML = wrap[1] + markup + wrap[2];
var wrapDepth = wrap[0];
while (wrapDepth--) {
node = node.lastChild;
}
} else {
node.innerHTML = markup;
}
var scripts = node.getElementsByTagName('script');
if (scripts.length) {
!handleScript ? process.env.NODE_ENV !== 'production' ? invariant(false, 'createNodesFromMarkup(...): Unexpected <script> element rendered.') : invariant(false) : void 0;
createArrayFromMixed(scripts).forEach(handleScript);
}
var nodes = Array.from(node.childNodes);
while (node.lastChild) {
node.removeChild(node.lastChild);
}
return nodes;
}
module.exports = createNodesFromMarkup;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 90 */
/*!********************************************!*\
!*** ./~/fbjs/lib/createArrayFromMixed.js ***!
\********************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {'use strict';
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @typechecks
*/
var invariant = __webpack_require__(/*! ./invariant */ 9);
/**
* Convert array-like objects to arrays.
*
* This API assumes the caller knows the contents of the data type. For less
* well defined inputs use createArrayFromMixed.
*
* @param {object|function|filelist} obj
* @return {array}
*/
function toArray(obj) {
var length = obj.length;
// Some browsers builtin objects can report typeof 'function' (e.g. NodeList
// in old versions of Safari).
!(!Array.isArray(obj) && (typeof obj === 'object' || typeof obj === 'function')) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Array-like object expected') : invariant(false) : void 0;
!(typeof length === 'number') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Object needs a length property') : invariant(false) : void 0;
!(length === 0 || length - 1 in obj) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Object should have keys for indices') : invariant(false) : void 0;
!(typeof obj.callee !== 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Object can\'t be `arguments`. Use rest params ' + '(function(...args) {}) or Array.from() instead.') : invariant(false) : void 0;
// Old IE doesn't give collections access to hasOwnProperty. Assume inputs
// without method will throw during the slice call and skip straight to the
// fallback.
if (obj.hasOwnProperty) {
try {
return Array.prototype.slice.call(obj);
} catch (e) {
// IE < 9 does not support Array#slice on collections objects
}
}
// Fall back to copying key by key. This assumes all keys have a value,
// so will not preserve sparsely populated inputs.
var ret = Array(length);
for (var ii = 0; ii < length; ii++) {
ret[ii] = obj[ii];
}
return ret;
}
/**
* Perform a heuristic test to determine if an object is "array-like".
*
* A monk asked Joshu, a Zen master, "Has a dog Buddha nature?"
* Joshu replied: "Mu."
*
* This function determines if its argument has "array nature": it returns
* true if the argument is an actual array, an `arguments' object, or an
* HTMLCollection (e.g. node.childNodes or node.getElementsByTagName()).
*
* It will return false for other array-like objects like Filelist.
*
* @param {*} obj
* @return {boolean}
*/
function hasArrayNature(obj) {
return (
// not null/false
!!obj && (
// arrays are objects, NodeLists are functions in Safari
typeof obj == 'object' || typeof obj == 'function') &&
// quacks like an array
'length' in obj &&
// not window
!('setInterval' in obj) &&
// no DOM node should be considered an array-like
// a 'select' element has 'length' and 'item' properties on IE8
typeof obj.nodeType != 'number' && (
// a real array
Array.isArray(obj) ||
// arguments
'callee' in obj ||
// HTMLCollection/NodeList
'item' in obj)
);
}
/**
* Ensure that the argument is an array by wrapping it in an array if it is not.
* Creates a copy of the argument if it is already an array.
*
* This is mostly useful idiomatically:
*
* var createArrayFromMixed = require('createArrayFromMixed');
*
* function takesOneOrMoreThings(things) {
* things = createArrayFromMixed(things);
* ...
* }
*
* This allows you to treat `things' as an array, but accept scalars in the API.
*
* If you need to convert an array-like object, like `arguments`, into an array
* use toArray instead.
*
* @param {*} obj
* @return {array}
*/
function createArrayFromMixed(obj) {
if (!hasArrayNature(obj)) {
return [obj];
} else if (Array.isArray(obj)) {
return obj.slice();
} else {
return toArray(obj);
}
}
module.exports = createArrayFromMixed;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 91 */
/*!*************************************!*\
!*** ./~/fbjs/lib/getMarkupWrap.js ***!
\*************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {'use strict';
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
/*eslint-disable fb-www/unsafe-html */
var ExecutionEnvironment = __webpack_require__(/*! ./ExecutionEnvironment */ 49);
var invariant = __webpack_require__(/*! ./invariant */ 9);
/**
* Dummy container used to detect which wraps are necessary.
*/
var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null;
/**
* Some browsers cannot use `innerHTML` to render certain elements standalone,
* so we wrap them, render the wrapped nodes, then extract the desired node.
*
* In IE8, certain elements cannot render alone, so wrap all elements ('*').
*/
var shouldWrap = {};
var selectWrap = [1, '<select multiple="true">', '</select>'];
var tableWrap = [1, '<table>', '</table>'];
var trWrap = [3, '<table><tbody><tr>', '</tr></tbody></table>'];
var svgWrap = [1, '<svg xmlns="http://www.w3.org/2000/svg">', '</svg>'];
var markupWrap = {
'*': [1, '?<div>', '</div>'],
'area': [1, '<map>', '</map>'],
'col': [2, '<table><tbody></tbody><colgroup>', '</colgroup></table>'],
'legend': [1, '<fieldset>', '</fieldset>'],
'param': [1, '<object>', '</object>'],
'tr': [2, '<table><tbody>', '</tbody></table>'],
'optgroup': selectWrap,
'option': selectWrap,
'caption': tableWrap,
'colgroup': tableWrap,
'tbody': tableWrap,
'tfoot': tableWrap,
'thead': tableWrap,
'td': trWrap,
'th': trWrap
};
// Initialize the SVG elements since we know they'll always need to be wrapped
// consistently. If they are created inside a <div> they will be initialized in
// the wrong namespace (and will not display).
var svgElements = ['circle', 'clipPath', 'defs', 'ellipse', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'text', 'tspan'];
svgElements.forEach(function (nodeName) {
markupWrap[nodeName] = svgWrap;
shouldWrap[nodeName] = true;
});
/**
* Gets the markup wrap configuration for the supplied `nodeName`.
*
* NOTE: This lazily detects which wraps are necessary for the current browser.
*
* @param {string} nodeName Lowercase `nodeName`.
* @return {?array} Markup wrap configuration, if applicable.
*/
function getMarkupWrap(nodeName) {
!!!dummyNode ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Markup wrapping node not initialized') : invariant(false) : void 0;
if (!markupWrap.hasOwnProperty(nodeName)) {
nodeName = '*';
}
if (!shouldWrap.hasOwnProperty(nodeName)) {
if (nodeName === '*') {
dummyNode.innerHTML = '<link />';
} else {
dummyNode.innerHTML = '<' + nodeName + '></' + nodeName + '>';
}
shouldWrap[nodeName] = !dummyNode.firstChild;
}
return shouldWrap[nodeName] ? markupWrap[nodeName] : null;
}
module.exports = getMarkupWrap;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 92 */
/*!*************************************************!*\
!*** ./~/react-dom/lib/ReactDOMIDOperations.js ***!
\*************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var DOMChildrenOperations = __webpack_require__(/*! ./DOMChildrenOperations */ 81);
var ReactDOMComponentTree = __webpack_require__(/*! ./ReactDOMComponentTree */ 35);
/**
* Operations used to process updates to DOM nodes.
*/
var ReactDOMIDOperations = {
/**
* Updates a component's children by processing a series of updates.
*
* @param {array<object>} updates List of update configurations.
* @internal
*/
dangerouslyProcessChildrenUpdates: function (parentInst, updates) {
var node = ReactDOMComponentTree.getNodeFromInstance(parentInst);
DOMChildrenOperations.processUpdates(node, updates);
}
};
module.exports = ReactDOMIDOperations;
/***/ },
/* 93 */
/*!**********************************************!*\
!*** ./~/react-dom/lib/ReactDOMComponent.js ***!
\**********************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
/* global hasOwnProperty:true */
'use strict';
var _prodInvariant = __webpack_require__(/*! ./reactProdInvariant */ 36),
_assign = __webpack_require__(/*! object-assign */ 5);
var AutoFocusUtils = __webpack_require__(/*! ./AutoFocusUtils */ 94);
var CSSPropertyOperations = __webpack_require__(/*! ./CSSPropertyOperations */ 96);
var DOMLazyTree = __webpack_require__(/*! ./DOMLazyTree */ 82);
var DOMNamespaces = __webpack_require__(/*! ./DOMNamespaces */ 83);
var DOMProperty = __webpack_require__(/*! ./DOMProperty */ 37);
var DOMPropertyOperations = __webpack_require__(/*! ./DOMPropertyOperations */ 104);
var EventPluginHub = __webpack_require__(/*! ./EventPluginHub */ 43);
var EventPluginRegistry = __webpack_require__(/*! ./EventPluginRegistry */ 44);
var ReactBrowserEventEmitter = __webpack_require__(/*! ./ReactBrowserEventEmitter */ 106);
var ReactDOMComponentFlags = __webpack_require__(/*! ./ReactDOMComponentFlags */ 38);
var ReactDOMComponentTree = __webpack_require__(/*! ./ReactDOMComponentTree */ 35);
var ReactDOMInput = __webpack_require__(/*! ./ReactDOMInput */ 109);
var ReactDOMOption = __webpack_require__(/*! ./ReactDOMOption */ 112);
var ReactDOMSelect = __webpack_require__(/*! ./ReactDOMSelect */ 113);
var ReactDOMTextarea = __webpack_require__(/*! ./ReactDOMTextarea */ 114);
var ReactInstrumentation = __webpack_require__(/*! ./ReactInstrumentation */ 63);
var ReactMultiChild = __webpack_require__(/*! ./ReactMultiChild */ 115);
var ReactServerRenderingTransaction = __webpack_require__(/*! ./ReactServerRenderingTransaction */ 134);
var emptyFunction = __webpack_require__(/*! fbjs/lib/emptyFunction */ 13);
var escapeTextContentForBrowser = __webpack_require__(/*! ./escapeTextContentForBrowser */ 87);
var invariant = __webpack_require__(/*! fbjs/lib/invariant */ 9);
var isEventSupported = __webpack_require__(/*! ./isEventSupported */ 71);
var shallowEqual = __webpack_require__(/*! fbjs/lib/shallowEqual */ 124);
var validateDOMNesting = __webpack_require__(/*! ./validateDOMNesting */ 137);
var warning = __webpack_require__(/*! fbjs/lib/warning */ 12);
var Flags = ReactDOMComponentFlags;
var deleteListener = EventPluginHub.deleteListener;
var getNode = ReactDOMComponentTree.getNodeFromInstance;
var listenTo = ReactBrowserEventEmitter.listenTo;
var registrationNameModules = EventPluginRegistry.registrationNameModules;
// For quickly matching children type, to test if can be treated as content.
var CONTENT_TYPES = { 'string': true, 'number': true };
var STYLE = 'style';
var HTML = '__html';
var RESERVED_PROPS = {
children: null,
dangerouslySetInnerHTML: null,
suppressContentEditableWarning: null
};
// Node type for document fragments (Node.DOCUMENT_FRAGMENT_NODE).
var DOC_FRAGMENT_TYPE = 11;
function getDeclarationErrorAddendum(internalInstance) {
if (internalInstance) {
var owner = internalInstance._currentElement._owner || null;
if (owner) {
var name = owner.getName();
if (name) {
return ' This DOM node was rendered by `' + name + '`.';
}
}
}
return '';
}
function friendlyStringify(obj) {
if (typeof obj === 'object') {
if (Array.isArray(obj)) {
return '[' + obj.map(friendlyStringify).join(', ') + ']';
} else {
var pairs = [];
for (var key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) {
var keyEscaped = /^[a-z$_][\w$_]*$/i.test(key) ? key : JSON.stringify(key);
pairs.push(keyEscaped + ': ' + friendlyStringify(obj[key]));
}
}
return '{' + pairs.join(', ') + '}';
}
} else if (typeof obj === 'string') {
return JSON.stringify(obj);
} else if (typeof obj === 'function') {
return '[function object]';
}
// Differs from JSON.stringify in that undefined because undefined and that
// inf and nan don't become null
return String(obj);
}
var styleMutationWarning = {};
function checkAndWarnForMutatedStyle(style1, style2, component) {
if (style1 == null || style2 == null) {
return;
}
if (shallowEqual(style1, style2)) {
return;
}
var componentName = component._tag;
var owner = component._currentElement._owner;
var ownerName;
if (owner) {
ownerName = owner.getName();
}
var hash = ownerName + '|' + componentName;
if (styleMutationWarning.hasOwnProperty(hash)) {
return;
}
styleMutationWarning[hash] = true;
process.env.NODE_ENV !== 'production' ? warning(false, '`%s` was passed a style object that has previously been mutated. ' + 'Mutating `style` is deprecated. Consider cloning it beforehand. Check ' + 'the `render` %s. Previous style: %s. Mutated style: %s.', componentName, owner ? 'of `' + ownerName + '`' : 'using <' + componentName + '>', friendlyStringify(style1), friendlyStringify(style2)) : void 0;
}
/**
* @param {object} component
* @param {?object} props
*/
function assertValidProps(component, props) {
if (!props) {
return;
}
// Note the use of `==` which checks for null or undefined.
if (voidElementTags[component._tag]) {
!(props.children == null && props.dangerouslySetInnerHTML == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.%s', component._tag, component._currentElement._owner ? ' Check the render method of ' + component._currentElement._owner.getName() + '.' : '') : _prodInvariant('137', component._tag, component._currentElement._owner ? ' Check the render method of ' + component._currentElement._owner.getName() + '.' : '') : void 0;
}
if (props.dangerouslySetInnerHTML != null) {
!(props.children == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Can only set one of `children` or `props.dangerouslySetInnerHTML`.') : _prodInvariant('60') : void 0;
!(typeof props.dangerouslySetInnerHTML === 'object' && HTML in props.dangerouslySetInnerHTML) ? process.env.NODE_ENV !== 'production' ? invariant(false, '`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://fb.me/react-invariant-dangerously-set-inner-html for more information.') : _prodInvariant('61') : void 0;
}
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(props.innerHTML == null, 'Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.') : void 0;
process.env.NODE_ENV !== 'production' ? warning(props.suppressContentEditableWarning || !props.contentEditable || props.children == null, 'A component is `contentEditable` and contains `children` managed by ' + 'React. It is now your responsibility to guarantee that none of ' + 'those nodes are unexpectedly modified or duplicated. This is ' + 'probably not intentional.') : void 0;
process.env.NODE_ENV !== 'production' ? warning(props.onFocusIn == null && props.onFocusOut == null, 'React uses onFocus and onBlur instead of onFocusIn and onFocusOut. ' + 'All React events are normalized to bubble, so onFocusIn and onFocusOut ' + 'are not needed/supported by React.') : void 0;
}
!(props.style == null || typeof props.style === 'object') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + \'em\'}} when using JSX.%s', getDeclarationErrorAddendum(component)) : _prodInvariant('62', getDeclarationErrorAddendum(component)) : void 0;
}
function enqueuePutListener(inst, registrationName, listener, transaction) {
if (transaction instanceof ReactServerRenderingTransaction) {
return;
}
if (process.env.NODE_ENV !== 'production') {
// IE8 has no API for event capturing and the `onScroll` event doesn't
// bubble.
process.env.NODE_ENV !== 'production' ? warning(registrationName !== 'onScroll' || isEventSupported('scroll', true), 'This browser doesn\'t support the `onScroll` event') : void 0;
}
var containerInfo = inst._hostContainerInfo;
var isDocumentFragment = containerInfo._node && containerInfo._node.nodeType === DOC_FRAGMENT_TYPE;
var doc = isDocumentFragment ? containerInfo._node : containerInfo._ownerDocument;
listenTo(registrationName, doc);
transaction.getReactMountReady().enqueue(putListener, {
inst: inst,
registrationName: registrationName,
listener: listener
});
}
function putListener() {
var listenerToPut = this;
EventPluginHub.putListener(listenerToPut.inst, listenerToPut.registrationName, listenerToPut.listener);
}
function inputPostMount() {
var inst = this;
ReactDOMInput.postMountWrapper(inst);
}
function textareaPostMount() {
var inst = this;
ReactDOMTextarea.postMountWrapper(inst);
}
function optionPostMount() {
var inst = this;
ReactDOMOption.postMountWrapper(inst);
}
var setAndValidateContentChildDev = emptyFunction;
if (process.env.NODE_ENV !== 'production') {
setAndValidateContentChildDev = function (content) {
var hasExistingContent = this._contentDebugID != null;
var debugID = this._debugID;
// This ID represents the inlined child that has no backing instance:
var contentDebugID = -debugID;
if (content == null) {
if (hasExistingContent) {
ReactInstrumentation.debugTool.onUnmountComponent(this._contentDebugID);
}
this._contentDebugID = null;
return;
}
validateDOMNesting(null, String(content), this, this._ancestorInfo);
this._contentDebugID = contentDebugID;
if (hasExistingContent) {
ReactInstrumentation.debugTool.onBeforeUpdateComponent(contentDebugID, content);
ReactInstrumentation.debugTool.onUpdateComponent(contentDebugID);
} else {
ReactInstrumentation.debugTool.onBeforeMountComponent(contentDebugID, content, debugID);
ReactInstrumentation.debugTool.onMountComponent(contentDebugID);
ReactInstrumentation.debugTool.onSetChildren(debugID, [contentDebugID]);
}
};
}
// There are so many media events, it makes sense to just
// maintain a list rather than create a `trapBubbledEvent` for each
var mediaEvents = {
topAbort: 'abort',
topCanPlay: 'canplay',
topCanPlayThrough: 'canplaythrough',
topDurationChange: 'durationchange',
topEmptied: 'emptied',
topEncrypted: 'encrypted',
topEnded: 'ended',
topError: 'error',
topLoadedData: 'loadeddata',
topLoadedMetadata: 'loadedmetadata',
topLoadStart: 'loadstart',
topPause: 'pause',
topPlay: 'play',
topPlaying: 'playing',
topProgress: 'progress',
topRateChange: 'ratechange',
topSeeked: 'seeked',
topSeeking: 'seeking',
topStalled: 'stalled',
topSuspend: 'suspend',
topTimeUpdate: 'timeupdate',
topVolumeChange: 'volumechange',
topWaiting: 'waiting'
};
function trapBubbledEventsLocal() {
var inst = this;
// If a component renders to null or if another component fatals and causes
// the state of the tree to be corrupted, `node` here can be null.
!inst._rootNodeID ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Must be mounted to trap events') : _prodInvariant('63') : void 0;
var node = getNode(inst);
!node ? process.env.NODE_ENV !== 'production' ? invariant(false, 'trapBubbledEvent(...): Requires node to be rendered.') : _prodInvariant('64') : void 0;
switch (inst._tag) {
case 'iframe':
case 'object':
inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent('topLoad', 'load', node)];
break;
case 'video':
case 'audio':
inst._wrapperState.listeners = [];
// Create listener for each media event
for (var event in mediaEvents) {
if (mediaEvents.hasOwnProperty(event)) {
inst._wrapperState.listeners.push(ReactBrowserEventEmitter.trapBubbledEvent(event, mediaEvents[event], node));
}
}
break;
case 'source':
inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent('topError', 'error', node)];
break;
case 'img':
inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent('topError', 'error', node), ReactBrowserEventEmitter.trapBubbledEvent('topLoad', 'load', node)];
break;
case 'form':
inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent('topReset', 'reset', node), ReactBrowserEventEmitter.trapBubbledEvent('topSubmit', 'submit', node)];
break;
case 'input':
case 'select':
case 'textarea':
inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent('topInvalid', 'invalid', node)];
break;
}
}
function postUpdateSelectWrapper() {
ReactDOMSelect.postUpdateWrapper(this);
}
// For HTML, certain tags should omit their close tag. We keep a whitelist for
// those special-case tags.
var omittedCloseTags = {
'area': true,
'base': true,
'br': true,
'col': true,
'embed': true,
'hr': true,
'img': true,
'input': true,
'keygen': true,
'link': true,
'meta': true,
'param': true,
'source': true,
'track': true,
'wbr': true
};
var newlineEatingTags = {
'listing': true,
'pre': true,
'textarea': true
};
// For HTML, certain tags cannot have children. This has the same purpose as
// `omittedCloseTags` except that `menuitem` should still have its closing tag.
var voidElementTags = _assign({
'menuitem': true
}, omittedCloseTags);
// We accept any tag to be rendered but since this gets injected into arbitrary
// HTML, we want to make sure that it's a safe tag.
// http://www.w3.org/TR/REC-xml/#NT-Name
var VALID_TAG_REGEX = /^[a-zA-Z][a-zA-Z:_\.\-\d]*$/; // Simplified subset
var validatedTagCache = {};
var hasOwnProperty = {}.hasOwnProperty;
function validateDangerousTag(tag) {
if (!hasOwnProperty.call(validatedTagCache, tag)) {
!VALID_TAG_REGEX.test(tag) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Invalid tag: %s', tag) : _prodInvariant('65', tag) : void 0;
validatedTagCache[tag] = true;
}
}
function isCustomComponent(tagName, props) {
return tagName.indexOf('-') >= 0 || props.is != null;
}
var globalIdCounter = 1;
/**
* Creates a new React class that is idempotent and capable of containing other
* React components. It accepts event listeners and DOM properties that are
* valid according to `DOMProperty`.
*
* - Event listeners: `onClick`, `onMouseDown`, etc.
* - DOM properties: `className`, `name`, `title`, etc.
*
* The `style` property functions differently from the DOM API. It accepts an
* object mapping of style properties to values.
*
* @constructor ReactDOMComponent
* @extends ReactMultiChild
*/
function ReactDOMComponent(element) {
var tag = element.type;
validateDangerousTag(tag);
this._currentElement = element;
this._tag = tag.toLowerCase();
this._namespaceURI = null;
this._renderedChildren = null;
this._previousStyle = null;
this._previousStyleCopy = null;
this._hostNode = null;
this._hostParent = null;
this._rootNodeID = 0;
this._domID = 0;
this._hostContainerInfo = null;
this._wrapperState = null;
this._topLevelWrapper = null;
this._flags = 0;
if (process.env.NODE_ENV !== 'production') {
this._ancestorInfo = null;
setAndValidateContentChildDev.call(this, null);
}
}
ReactDOMComponent.displayName = 'ReactDOMComponent';
ReactDOMComponent.Mixin = {
/**
* Generates root tag markup then recurses. This method has side effects and
* is not idempotent.
*
* @internal
* @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
* @param {?ReactDOMComponent} the parent component instance
* @param {?object} info about the host container
* @param {object} context
* @return {string} The computed markup.
*/
mountComponent: function (transaction, hostParent, hostContainerInfo, context) {
this._rootNodeID = globalIdCounter++;
this._domID = hostContainerInfo._idCounter++;
this._hostParent = hostParent;
this._hostContainerInfo = hostContainerInfo;
var props = this._currentElement.props;
switch (this._tag) {
case 'audio':
case 'form':
case 'iframe':
case 'img':
case 'link':
case 'object':
case 'source':
case 'video':
this._wrapperState = {
listeners: null
};
transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
break;
case 'input':
ReactDOMInput.mountWrapper(this, props, hostParent);
props = ReactDOMInput.getHostProps(this, props);
transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
break;
case 'option':
ReactDOMOption.mountWrapper(this, props, hostParent);
props = ReactDOMOption.getHostProps(this, props);
break;
case 'select':
ReactDOMSelect.mountWrapper(this, props, hostParent);
props = ReactDOMSelect.getHostProps(this, props);
transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
break;
case 'textarea':
ReactDOMTextarea.mountWrapper(this, props, hostParent);
props = ReactDOMTextarea.getHostProps(this, props);
transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
break;
}
assertValidProps(this, props);
// We create tags in the namespace of their parent container, except HTML
// tags get no namespace.
var namespaceURI;
var parentTag;
if (hostParent != null) {
namespaceURI = hostParent._namespaceURI;
parentTag = hostParent._tag;
} else if (hostContainerInfo._tag) {
namespaceURI = hostContainerInfo._namespaceURI;
parentTag = hostContainerInfo._tag;
}
if (namespaceURI == null || namespaceURI === DOMNamespaces.svg && parentTag === 'foreignobject') {
namespaceURI = DOMNamespaces.html;
}
if (namespaceURI === DOMNamespaces.html) {
if (this._tag === 'svg') {
namespaceURI = DOMNamespaces.svg;
} else if (this._tag === 'math') {
namespaceURI = DOMNamespaces.mathml;
}
}
this._namespaceURI = namespaceURI;
if (process.env.NODE_ENV !== 'production') {
var parentInfo;
if (hostParent != null) {
parentInfo = hostParent._ancestorInfo;
} else if (hostContainerInfo._tag) {
parentInfo = hostContainerInfo._ancestorInfo;
}
if (parentInfo) {
// parentInfo should always be present except for the top-level
// component when server rendering
validateDOMNesting(this._tag, null, this, parentInfo);
}
this._ancestorInfo = validateDOMNesting.updatedAncestorInfo(parentInfo, this._tag, this);
}
var mountImage;
if (transaction.useCreateElement) {
var ownerDocument = hostContainerInfo._ownerDocument;
var el;
if (namespaceURI === DOMNamespaces.html) {
if (this._tag === 'script') {
// Create the script via .innerHTML so its "parser-inserted" flag is
// set to true and it does not execute
var div = ownerDocument.createElement('div');
var type = this._currentElement.type;
div.innerHTML = '<' + type + '></' + type + '>';
el = div.removeChild(div.firstChild);
} else if (props.is) {
el = ownerDocument.createElement(this._currentElement.type, props.is);
} else {
// Separate else branch instead of using `props.is || undefined` above becuase of a Firefox bug.
// See discussion in https://github.com/facebook/react/pull/6896
// and discussion in https://bugzilla.mozilla.org/show_bug.cgi?id=1276240
el = ownerDocument.createElement(this._currentElement.type);
}
} else {
el = ownerDocument.createElementNS(namespaceURI, this._currentElement.type);
}
ReactDOMComponentTree.precacheNode(this, el);
this._flags |= Flags.hasCachedChildNodes;
if (!this._hostParent) {
DOMPropertyOperations.setAttributeForRoot(el);
}
this._updateDOMProperties(null, props, transaction);
var lazyTree = DOMLazyTree(el);
this._createInitialChildren(transaction, props, context, lazyTree);
mountImage = lazyTree;
} else {
var tagOpen = this._createOpenTagMarkupAndPutListeners(transaction, props);
var tagContent = this._createContentMarkup(transaction, props, context);
if (!tagContent && omittedCloseTags[this._tag]) {
mountImage = tagOpen + '/>';
} else {
mountImage = tagOpen + '>' + tagContent + '</' + this._currentElement.type + '>';
}
}
switch (this._tag) {
case 'input':
transaction.getReactMountReady().enqueue(inputPostMount, this);
if (props.autoFocus) {
transaction.getReactMountReady().enqueue(AutoFocusUtils.focusDOMComponent, this);
}
break;
case 'textarea':
transaction.getReactMountReady().enqueue(textareaPostMount, this);
if (props.autoFocus) {
transaction.getReactMountReady().enqueue(AutoFocusUtils.focusDOMComponent, this);
}
break;
case 'select':
if (props.autoFocus) {
transaction.getReactMountReady().enqueue(AutoFocusUtils.focusDOMComponent, this);
}
break;
case 'button':
if (props.autoFocus) {
transaction.getReactMountReady().enqueue(AutoFocusUtils.focusDOMComponent, this);
}
break;
case 'option':
transaction.getReactMountReady().enqueue(optionPostMount, this);
break;
}
return mountImage;
},
/**
* Creates markup for the open tag and all attributes.
*
* This method has side effects because events get registered.
*
* Iterating over object properties is faster than iterating over arrays.
* @see http://jsperf.com/obj-vs-arr-iteration
*
* @private
* @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
* @param {object} props
* @return {string} Markup of opening tag.
*/
_createOpenTagMarkupAndPutListeners: function (transaction, props) {
var ret = '<' + this._currentElement.type;
for (var propKey in props) {
if (!props.hasOwnProperty(propKey)) {
continue;
}
var propValue = props[propKey];
if (propValue == null) {
continue;
}
if (registrationNameModules.hasOwnProperty(propKey)) {
if (propValue) {
enqueuePutListener(this, propKey, propValue, transaction);
}
} else {
if (propKey === STYLE) {
if (propValue) {
if (process.env.NODE_ENV !== 'production') {
// See `_updateDOMProperties`. style block
this._previousStyle = propValue;
}
propValue = this._previousStyleCopy = _assign({}, props.style);
}
propValue = CSSPropertyOperations.createMarkupForStyles(propValue, this);
}
var markup = null;
if (this._tag != null && isCustomComponent(this._tag, props)) {
if (!RESERVED_PROPS.hasOwnProperty(propKey)) {
markup = DOMPropertyOperations.createMarkupForCustomAttribute(propKey, propValue);
}
} else {
markup = DOMPropertyOperations.createMarkupForProperty(propKey, propValue);
}
if (markup) {
ret += ' ' + markup;
}
}
}
// For static pages, no need to put React ID and checksum. Saves lots of
// bytes.
if (transaction.renderToStaticMarkup) {
return ret;
}
if (!this._hostParent) {
ret += ' ' + DOMPropertyOperations.createMarkupForRoot();
}
ret += ' ' + DOMPropertyOperations.createMarkupForID(this._domID);
return ret;
},
/**
* Creates markup for the content between the tags.
*
* @private
* @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
* @param {object} props
* @param {object} context
* @return {string} Content markup.
*/
_createContentMarkup: function (transaction, props, context) {
var ret = '';
// Intentional use of != to avoid catching zero/false.
var innerHTML = props.dangerouslySetInnerHTML;
if (innerHTML != null) {
if (innerHTML.__html != null) {
ret = innerHTML.__html;
}
} else {
var contentToUse = CONTENT_TYPES[typeof props.children] ? props.children : null;
var childrenToUse = contentToUse != null ? null : props.children;
if (contentToUse != null) {
// TODO: Validate that text is allowed as a child of this node
ret = escapeTextContentForBrowser(contentToUse);
if (process.env.NODE_ENV !== 'production') {
setAndValidateContentChildDev.call(this, contentToUse);
}
} else if (childrenToUse != null) {
var mountImages = this.mountChildren(childrenToUse, transaction, context);
ret = mountImages.join('');
}
}
if (newlineEatingTags[this._tag] && ret.charAt(0) === '\n') {
// text/html ignores the first character in these tags if it's a newline
// Prefer to break application/xml over text/html (for now) by adding
// a newline specifically to get eaten by the parser. (Alternately for
// textareas, replacing "^\n" with "\r\n" doesn't get eaten, and the first
// \r is normalized out by HTMLTextAreaElement#value.)
// See: <http://www.w3.org/TR/html-polyglot/#newlines-in-textarea-and-pre>
// See: <http://www.w3.org/TR/html5/syntax.html#element-restrictions>
// See: <http://www.w3.org/TR/html5/syntax.html#newlines>
// See: Parsing of "textarea" "listing" and "pre" elements
// from <http://www.w3.org/TR/html5/syntax.html#parsing-main-inbody>
return '\n' + ret;
} else {
return ret;
}
},
_createInitialChildren: function (transaction, props, context, lazyTree) {
// Intentional use of != to avoid catching zero/false.
var innerHTML = props.dangerouslySetInnerHTML;
if (innerHTML != null) {
if (innerHTML.__html != null) {
DOMLazyTree.queueHTML(lazyTree, innerHTML.__html);
}
} else {
var contentToUse = CONTENT_TYPES[typeof props.children] ? props.children : null;
var childrenToUse = contentToUse != null ? null : props.children;
// TODO: Validate that text is allowed as a child of this node
if (contentToUse != null) {
// Avoid setting textContent when the text is empty. In IE11 setting
// textContent on a text area will cause the placeholder to not
// show within the textarea until it has been focused and blurred again.
// https://github.com/facebook/react/issues/6731#issuecomment-254874553
if (contentToUse !== '') {
if (process.env.NODE_ENV !== 'production') {
setAndValidateContentChildDev.call(this, contentToUse);
}
DOMLazyTree.queueText(lazyTree, contentToUse);
}
} else if (childrenToUse != null) {
var mountImages = this.mountChildren(childrenToUse, transaction, context);
for (var i = 0; i < mountImages.length; i++) {
DOMLazyTree.queueChild(lazyTree, mountImages[i]);
}
}
}
},
/**
* Receives a next element and updates the component.
*
* @internal
* @param {ReactElement} nextElement
* @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
* @param {object} context
*/
receiveComponent: function (nextElement, transaction, context) {
var prevElement = this._currentElement;
this._currentElement = nextElement;
this.updateComponent(transaction, prevElement, nextElement, context);
},
/**
* Updates a DOM component after it has already been allocated and
* attached to the DOM. Reconciles the root DOM node, then recurses.
*
* @param {ReactReconcileTransaction} transaction
* @param {ReactElement} prevElement
* @param {ReactElement} nextElement
* @internal
* @overridable
*/
updateComponent: function (transaction, prevElement, nextElement, context) {
var lastProps = prevElement.props;
var nextProps = this._currentElement.props;
switch (this._tag) {
case 'input':
lastProps = ReactDOMInput.getHostProps(this, lastProps);
nextProps = ReactDOMInput.getHostProps(this, nextProps);
break;
case 'option':
lastProps = ReactDOMOption.getHostProps(this, lastProps);
nextProps = ReactDOMOption.getHostProps(this, nextProps);
break;
case 'select':
lastProps = ReactDOMSelect.getHostProps(this, lastProps);
nextProps = ReactDOMSelect.getHostProps(this, nextProps);
break;
case 'textarea':
lastProps = ReactDOMTextarea.getHostProps(this, lastProps);
nextProps = ReactDOMTextarea.getHostProps(this, nextProps);
break;
}
assertValidProps(this, nextProps);
this._updateDOMProperties(lastProps, nextProps, transaction);
this._updateDOMChildren(lastProps, nextProps, transaction, context);
switch (this._tag) {
case 'input':
// Update the wrapper around inputs *after* updating props. This has to
// happen after `_updateDOMProperties`. Otherwise HTML5 input validations
// raise warnings and prevent the new value from being assigned.
ReactDOMInput.updateWrapper(this);
break;
case 'textarea':
ReactDOMTextarea.updateWrapper(this);
break;
case 'select':
// <select> value update needs to occur after <option> children
// reconciliation
transaction.getReactMountReady().enqueue(postUpdateSelectWrapper, this);
break;
}
},
/**
* Reconciles the properties by detecting differences in property values and
* updating the DOM as necessary. This function is probably the single most
* critical path for performance optimization.
*
* TODO: Benchmark whether checking for changed values in memory actually
* improves performance (especially statically positioned elements).
* TODO: Benchmark the effects of putting this at the top since 99% of props
* do not change for a given reconciliation.
* TODO: Benchmark areas that can be improved with caching.
*
* @private
* @param {object} lastProps
* @param {object} nextProps
* @param {?DOMElement} node
*/
_updateDOMProperties: function (lastProps, nextProps, transaction) {
var propKey;
var styleName;
var styleUpdates;
for (propKey in lastProps) {
if (nextProps.hasOwnProperty(propKey) || !lastProps.hasOwnProperty(propKey) || lastProps[propKey] == null) {
continue;
}
if (propKey === STYLE) {
var lastStyle = this._previousStyleCopy;
for (styleName in lastStyle) {
if (lastStyle.hasOwnProperty(styleName)) {
styleUpdates = styleUpdates || {};
styleUpdates[styleName] = '';
}
}
this._previousStyleCopy = null;
} else if (registrationNameModules.hasOwnProperty(propKey)) {
if (lastProps[propKey]) {
// Only call deleteListener if there was a listener previously or
// else willDeleteListener gets called when there wasn't actually a
// listener (e.g., onClick={null})
deleteListener(this, propKey);
}
} else if (isCustomComponent(this._tag, lastProps)) {
if (!RESERVED_PROPS.hasOwnProperty(propKey)) {
DOMPropertyOperations.deleteValueForAttribute(getNode(this), propKey);
}
} else if (DOMProperty.properties[propKey] || DOMProperty.isCustomAttribute(propKey)) {
DOMPropertyOperations.deleteValueForProperty(getNode(this), propKey);
}
}
for (propKey in nextProps) {
var nextProp = nextProps[propKey];
var lastProp = propKey === STYLE ? this._previousStyleCopy : lastProps != null ? lastProps[propKey] : undefined;
if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp || nextProp == null && lastProp == null) {
continue;
}
if (propKey === STYLE) {
if (nextProp) {
if (process.env.NODE_ENV !== 'production') {
checkAndWarnForMutatedStyle(this._previousStyleCopy, this._previousStyle, this);
this._previousStyle = nextProp;
}
nextProp = this._previousStyleCopy = _assign({}, nextProp);
} else {
this._previousStyleCopy = null;
}
if (lastProp) {
// Unset styles on `lastProp` but not on `nextProp`.
for (styleName in lastProp) {
if (lastProp.hasOwnProperty(styleName) && (!nextProp || !nextProp.hasOwnProperty(styleName))) {
styleUpdates = styleUpdates || {};
styleUpdates[styleName] = '';
}
}
// Update styles that changed since `lastProp`.
for (styleName in nextProp) {
if (nextProp.hasOwnProperty(styleName) && lastProp[styleName] !== nextProp[styleName]) {
styleUpdates = styleUpdates || {};
styleUpdates[styleName] = nextProp[styleName];
}
}
} else {
// Relies on `updateStylesByID` not mutating `styleUpdates`.
styleUpdates = nextProp;
}
} else if (registrationNameModules.hasOwnProperty(propKey)) {
if (nextProp) {
enqueuePutListener(this, propKey, nextProp, transaction);
} else if (lastProp) {
deleteListener(this, propKey);
}
} else if (isCustomComponent(this._tag, nextProps)) {
if (!RESERVED_PROPS.hasOwnProperty(propKey)) {
DOMPropertyOperations.setValueForAttribute(getNode(this), propKey, nextProp);
}
} else if (DOMProperty.properties[propKey] || DOMProperty.isCustomAttribute(propKey)) {
var node = getNode(this);
// If we're updating to null or undefined, we should remove the property
// from the DOM node instead of inadvertently setting to a string. This
// brings us in line with the same behavior we have on initial render.
if (nextProp != null) {
DOMPropertyOperations.setValueForProperty(node, propKey, nextProp);
} else {
DOMPropertyOperations.deleteValueForProperty(node, propKey);
}
}
}
if (styleUpdates) {
CSSPropertyOperations.setValueForStyles(getNode(this), styleUpdates, this);
}
},
/**
* Reconciles the children with the various properties that affect the
* children content.
*
* @param {object} lastProps
* @param {object} nextProps
* @param {ReactReconcileTransaction} transaction
* @param {object} context
*/
_updateDOMChildren: function (lastProps, nextProps, transaction, context) {
var lastContent = CONTENT_TYPES[typeof lastProps.children] ? lastProps.children : null;
var nextContent = CONTENT_TYPES[typeof nextProps.children] ? nextProps.children : null;
var lastHtml = lastProps.dangerouslySetInnerHTML && lastProps.dangerouslySetInnerHTML.__html;
var nextHtml = nextProps.dangerouslySetInnerHTML && nextProps.dangerouslySetInnerHTML.__html;
// Note the use of `!=` which checks for null or undefined.
var lastChildren = lastContent != null ? null : lastProps.children;
var nextChildren = nextContent != null ? null : nextProps.children;
// If we're switching from children to content/html or vice versa, remove
// the old content
var lastHasContentOrHtml = lastContent != null || lastHtml != null;
var nextHasContentOrHtml = nextContent != null || nextHtml != null;
if (lastChildren != null && nextChildren == null) {
this.updateChildren(null, transaction, context);
} else if (lastHasContentOrHtml && !nextHasContentOrHtml) {
this.updateTextContent('');
if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onSetChildren(this._debugID, []);
}
}
if (nextContent != null) {
if (lastContent !== nextContent) {
this.updateTextContent('' + nextContent);
if (process.env.NODE_ENV !== 'production') {
setAndValidateContentChildDev.call(this, nextContent);
}
}
} else if (nextHtml != null) {
if (lastHtml !== nextHtml) {
this.updateMarkup('' + nextHtml);
}
if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onSetChildren(this._debugID, []);
}
} else if (nextChildren != null) {
if (process.env.NODE_ENV !== 'production') {
setAndValidateContentChildDev.call(this, null);
}
this.updateChildren(nextChildren, transaction, context);
}
},
getHostNode: function () {
return getNode(this);
},
/**
* Destroys all event registrations for this instance. Does not remove from
* the DOM. That must be done by the parent.
*
* @internal
*/
unmountComponent: function (safely) {
switch (this._tag) {
case 'audio':
case 'form':
case 'iframe':
case 'img':
case 'link':
case 'object':
case 'source':
case 'video':
var listeners = this._wrapperState.listeners;
if (listeners) {
for (var i = 0; i < listeners.length; i++) {
listeners[i].remove();
}
}
break;
case 'html':
case 'head':
case 'body':
/**
* Components like <html> <head> and <body> can't be removed or added
* easily in a cross-browser way, however it's valuable to be able to
* take advantage of React's reconciliation for styling and <title>
* management. So we just document it and throw in dangerous cases.
*/
true ? process.env.NODE_ENV !== 'production' ? invariant(false, '<%s> tried to unmount. Because of cross-browser quirks it is impossible to unmount some top-level components (eg <html>, <head>, and <body>) reliably and efficiently. To fix this, have a single top-level component that never unmounts render these elements.', this._tag) : _prodInvariant('66', this._tag) : void 0;
break;
}
this.unmountChildren(safely);
ReactDOMComponentTree.uncacheNode(this);
EventPluginHub.deleteAllListeners(this);
this._rootNodeID = 0;
this._domID = 0;
this._wrapperState = null;
if (process.env.NODE_ENV !== 'production') {
setAndValidateContentChildDev.call(this, null);
}
},
getPublicInstance: function () {
return getNode(this);
}
};
_assign(ReactDOMComponent.prototype, ReactDOMComponent.Mixin, ReactMultiChild.Mixin);
module.exports = ReactDOMComponent;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 94 */
/*!*******************************************!*\
!*** ./~/react-dom/lib/AutoFocusUtils.js ***!
\*******************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var ReactDOMComponentTree = __webpack_require__(/*! ./ReactDOMComponentTree */ 35);
var focusNode = __webpack_require__(/*! fbjs/lib/focusNode */ 95);
var AutoFocusUtils = {
focusDOMComponent: function () {
focusNode(ReactDOMComponentTree.getNodeFromInstance(this));
}
};
module.exports = AutoFocusUtils;
/***/ },
/* 95 */
/*!*********************************!*\
!*** ./~/fbjs/lib/focusNode.js ***!
\*********************************/
/***/ function(module, exports) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
/**
* @param {DOMElement} node input/textarea to focus
*/
function focusNode(node) {
// IE8 can throw "Can't move focus to the control because it is invisible,
// not enabled, or of a type that does not accept the focus." for all kinds of
// reasons that are too expensive and fragile to test.
try {
node.focus();
} catch (e) {}
}
module.exports = focusNode;
/***/ },
/* 96 */
/*!**************************************************!*\
!*** ./~/react-dom/lib/CSSPropertyOperations.js ***!
\**************************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var CSSProperty = __webpack_require__(/*! ./CSSProperty */ 97);
var ExecutionEnvironment = __webpack_require__(/*! fbjs/lib/ExecutionEnvironment */ 49);
var ReactInstrumentation = __webpack_require__(/*! ./ReactInstrumentation */ 63);
var camelizeStyleName = __webpack_require__(/*! fbjs/lib/camelizeStyleName */ 98);
var dangerousStyleValue = __webpack_require__(/*! ./dangerousStyleValue */ 100);
var hyphenateStyleName = __webpack_require__(/*! fbjs/lib/hyphenateStyleName */ 101);
var memoizeStringOnly = __webpack_require__(/*! fbjs/lib/memoizeStringOnly */ 103);
var warning = __webpack_require__(/*! fbjs/lib/warning */ 12);
var processStyleName = memoizeStringOnly(function (styleName) {
return hyphenateStyleName(styleName);
});
var hasShorthandPropertyBug = false;
var styleFloatAccessor = 'cssFloat';
if (ExecutionEnvironment.canUseDOM) {
var tempStyle = document.createElement('div').style;
try {
// IE8 throws "Invalid argument." if resetting shorthand style properties.
tempStyle.font = '';
} catch (e) {
hasShorthandPropertyBug = true;
}
// IE8 only supports accessing cssFloat (standard) as styleFloat
if (document.documentElement.style.cssFloat === undefined) {
styleFloatAccessor = 'styleFloat';
}
}
if (process.env.NODE_ENV !== 'production') {
// 'msTransform' is correct, but the other prefixes should be capitalized
var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;
// style values shouldn't contain a semicolon
var badStyleValueWithSemicolonPattern = /;\s*$/;
var warnedStyleNames = {};
var warnedStyleValues = {};
var warnedForNaNValue = false;
var warnHyphenatedStyleName = function (name, owner) {
if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
return;
}
warnedStyleNames[name] = true;
process.env.NODE_ENV !== 'production' ? warning(false, 'Unsupported style property %s. Did you mean %s?%s', name, camelizeStyleName(name), checkRenderMessage(owner)) : void 0;
};
var warnBadVendoredStyleName = function (name, owner) {
if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
return;
}
warnedStyleNames[name] = true;
process.env.NODE_ENV !== 'production' ? warning(false, 'Unsupported vendor-prefixed style property %s. Did you mean %s?%s', name, name.charAt(0).toUpperCase() + name.slice(1), checkRenderMessage(owner)) : void 0;
};
var warnStyleValueWithSemicolon = function (name, value, owner) {
if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {
return;
}
warnedStyleValues[value] = true;
process.env.NODE_ENV !== 'production' ? warning(false, 'Style property values shouldn\'t contain a semicolon.%s ' + 'Try "%s: %s" instead.', checkRenderMessage(owner), name, value.replace(badStyleValueWithSemicolonPattern, '')) : void 0;
};
var warnStyleValueIsNaN = function (name, value, owner) {
if (warnedForNaNValue) {
return;
}
warnedForNaNValue = true;
process.env.NODE_ENV !== 'production' ? warning(false, '`NaN` is an invalid value for the `%s` css style property.%s', name, checkRenderMessage(owner)) : void 0;
};
var checkRenderMessage = function (owner) {
if (owner) {
var name = owner.getName();
if (name) {
return ' Check the render method of `' + name + '`.';
}
}
return '';
};
/**
* @param {string} name
* @param {*} value
* @param {ReactDOMComponent} component
*/
var warnValidStyle = function (name, value, component) {
var owner;
if (component) {
owner = component._currentElement._owner;
}
if (name.indexOf('-') > -1) {
warnHyphenatedStyleName(name, owner);
} else if (badVendoredStyleNamePattern.test(name)) {
warnBadVendoredStyleName(name, owner);
} else if (badStyleValueWithSemicolonPattern.test(value)) {
warnStyleValueWithSemicolon(name, value, owner);
}
if (typeof value === 'number' && isNaN(value)) {
warnStyleValueIsNaN(name, value, owner);
}
};
}
/**
* Operations for dealing with CSS properties.
*/
var CSSPropertyOperations = {
/**
* Serializes a mapping of style properties for use as inline styles:
*
* > createMarkupForStyles({width: '200px', height: 0})
* "width:200px;height:0;"
*
* Undefined values are ignored so that declarative programming is easier.
* The result should be HTML-escaped before insertion into the DOM.
*
* @param {object} styles
* @param {ReactDOMComponent} component
* @return {?string}
*/
createMarkupForStyles: function (styles, component) {
var serialized = '';
for (var styleName in styles) {
if (!styles.hasOwnProperty(styleName)) {
continue;
}
var styleValue = styles[styleName];
if (process.env.NODE_ENV !== 'production') {
warnValidStyle(styleName, styleValue, component);
}
if (styleValue != null) {
serialized += processStyleName(styleName) + ':';
serialized += dangerousStyleValue(styleName, styleValue, component) + ';';
}
}
return serialized || null;
},
/**
* Sets the value for multiple styles on a node. If a value is specified as
* '' (empty string), the corresponding style property will be unset.
*
* @param {DOMElement} node
* @param {object} styles
* @param {ReactDOMComponent} component
*/
setValueForStyles: function (node, styles, component) {
if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onHostOperation({
instanceID: component._debugID,
type: 'update styles',
payload: styles
});
}
var style = node.style;
for (var styleName in styles) {
if (!styles.hasOwnProperty(styleName)) {
continue;
}
if (process.env.NODE_ENV !== 'production') {
warnValidStyle(styleName, styles[styleName], component);
}
var styleValue = dangerousStyleValue(styleName, styles[styleName], component);
if (styleName === 'float' || styleName === 'cssFloat') {
styleName = styleFloatAccessor;
}
if (styleValue) {
style[styleName] = styleValue;
} else {
var expansion = hasShorthandPropertyBug && CSSProperty.shorthandPropertyExpansions[styleName];
if (expansion) {
// Shorthand property that IE8 won't like unsetting, so unset each
// component to placate it
for (var individualStyleName in expansion) {
style[individualStyleName] = '';
}
} else {
style[styleName] = '';
}
}
}
}
};
module.exports = CSSPropertyOperations;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 97 */
/*!****************************************!*\
!*** ./~/react-dom/lib/CSSProperty.js ***!
\****************************************/
/***/ function(module, exports) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
/**
* CSS properties which accept numbers but are not in units of "px".
*/
var isUnitlessNumber = {
animationIterationCount: true,
borderImageOutset: true,
borderImageSlice: true,
borderImageWidth: true,
boxFlex: true,
boxFlexGroup: true,
boxOrdinalGroup: true,
columnCount: true,
flex: true,
flexGrow: true,
flexPositive: true,
flexShrink: true,
flexNegative: true,
flexOrder: true,
gridRow: true,
gridColumn: true,
fontWeight: true,
lineClamp: true,
lineHeight: true,
opacity: true,
order: true,
orphans: true,
tabSize: true,
widows: true,
zIndex: true,
zoom: true,
// SVG-related properties
fillOpacity: true,
floodOpacity: true,
stopOpacity: true,
strokeDasharray: true,
strokeDashoffset: true,
strokeMiterlimit: true,
strokeOpacity: true,
strokeWidth: true
};
/**
* @param {string} prefix vendor-specific prefix, eg: Webkit
* @param {string} key style name, eg: transitionDuration
* @return {string} style name prefixed with `prefix`, properly camelCased, eg:
* WebkitTransitionDuration
*/
function prefixKey(prefix, key) {
return prefix + key.charAt(0).toUpperCase() + key.substring(1);
}
/**
* Support style names that may come passed in prefixed by adding permutations
* of vendor prefixes.
*/
var prefixes = ['Webkit', 'ms', 'Moz', 'O'];
// Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an
// infinite loop, because it iterates over the newly added props too.
Object.keys(isUnitlessNumber).forEach(function (prop) {
prefixes.forEach(function (prefix) {
isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];
});
});
/**
* Most style properties can be unset by doing .style[prop] = '' but IE8
* doesn't like doing that with shorthand properties so for the properties that
* IE8 breaks on, which are listed here, we instead unset each of the
* individual properties. See http://bugs.jquery.com/ticket/12385.
* The 4-value 'clock' properties like margin, padding, border-width seem to
* behave without any problems. Curiously, list-style works too without any
* special prodding.
*/
var shorthandPropertyExpansions = {
background: {
backgroundAttachment: true,
backgroundColor: true,
backgroundImage: true,
backgroundPositionX: true,
backgroundPositionY: true,
backgroundRepeat: true
},
backgroundPosition: {
backgroundPositionX: true,
backgroundPositionY: true
},
border: {
borderWidth: true,
borderStyle: true,
borderColor: true
},
borderBottom: {
borderBottomWidth: true,
borderBottomStyle: true,
borderBottomColor: true
},
borderLeft: {
borderLeftWidth: true,
borderLeftStyle: true,
borderLeftColor: true
},
borderRight: {
borderRightWidth: true,
borderRightStyle: true,
borderRightColor: true
},
borderTop: {
borderTopWidth: true,
borderTopStyle: true,
borderTopColor: true
},
font: {
fontStyle: true,
fontVariant: true,
fontWeight: true,
fontSize: true,
lineHeight: true,
fontFamily: true
},
outline: {
outlineWidth: true,
outlineStyle: true,
outlineColor: true
}
};
var CSSProperty = {
isUnitlessNumber: isUnitlessNumber,
shorthandPropertyExpansions: shorthandPropertyExpansions
};
module.exports = CSSProperty;
/***/ },
/* 98 */
/*!*****************************************!*\
!*** ./~/fbjs/lib/camelizeStyleName.js ***!
\*****************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @typechecks
*/
'use strict';
var camelize = __webpack_require__(/*! ./camelize */ 99);
var msPattern = /^-ms-/;
/**
* Camelcases a hyphenated CSS property name, for example:
*
* > camelizeStyleName('background-color')
* < "backgroundColor"
* > camelizeStyleName('-moz-transition')
* < "MozTransition"
* > camelizeStyleName('-ms-transition')
* < "msTransition"
*
* As Andi Smith suggests
* (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix
* is converted to lowercase `ms`.
*
* @param {string} string
* @return {string}
*/
function camelizeStyleName(string) {
return camelize(string.replace(msPattern, 'ms-'));
}
module.exports = camelizeStyleName;
/***/ },
/* 99 */
/*!********************************!*\
!*** ./~/fbjs/lib/camelize.js ***!
\********************************/
/***/ function(module, exports) {
"use strict";
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @typechecks
*/
var _hyphenPattern = /-(.)/g;
/**
* Camelcases a hyphenated string, for example:
*
* > camelize('background-color')
* < "backgroundColor"
*
* @param {string} string
* @return {string}
*/
function camelize(string) {
return string.replace(_hyphenPattern, function (_, character) {
return character.toUpperCase();
});
}
module.exports = camelize;
/***/ },
/* 100 */
/*!************************************************!*\
!*** ./~/react-dom/lib/dangerousStyleValue.js ***!
\************************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var CSSProperty = __webpack_require__(/*! ./CSSProperty */ 97);
var warning = __webpack_require__(/*! fbjs/lib/warning */ 12);
var isUnitlessNumber = CSSProperty.isUnitlessNumber;
var styleWarnings = {};
/**
* Convert a value into the proper css writable value. The style name `name`
* should be logical (no hyphens), as specified
* in `CSSProperty.isUnitlessNumber`.
*
* @param {string} name CSS property name such as `topMargin`.
* @param {*} value CSS property value such as `10px`.
* @param {ReactDOMComponent} component
* @return {string} Normalized style value with dimensions applied.
*/
function dangerousStyleValue(name, value, component) {
// Note that we've removed escapeTextForBrowser() calls here since the
// whole string will be escaped when the attribute is injected into
// the markup. If you provide unsafe user data here they can inject
// arbitrary CSS which may be problematic (I couldn't repro this):
// https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet
// http://www.thespanner.co.uk/2007/11/26/ultimate-xss-css-injection/
// This is not an XSS hole but instead a potential CSS injection issue
// which has lead to a greater discussion about how we're going to
// trust URLs moving forward. See #2115901
var isEmpty = value == null || typeof value === 'boolean' || value === '';
if (isEmpty) {
return '';
}
var isNonNumeric = isNaN(value);
if (isNonNumeric || value === 0 || isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name]) {
return '' + value; // cast to string
}
if (typeof value === 'string') {
if (process.env.NODE_ENV !== 'production') {
// Allow '0' to pass through without warning. 0 is already special and
// doesn't require units, so we don't need to warn about it.
if (component && value !== '0') {
var owner = component._currentElement._owner;
var ownerName = owner ? owner.getName() : null;
if (ownerName && !styleWarnings[ownerName]) {
styleWarnings[ownerName] = {};
}
var warned = false;
if (ownerName) {
var warnings = styleWarnings[ownerName];
warned = warnings[name];
if (!warned) {
warnings[name] = true;
}
}
if (!warned) {
process.env.NODE_ENV !== 'production' ? warning(false, 'a `%s` tag (owner: `%s`) was passed a numeric string value ' + 'for CSS property `%s` (value: `%s`) which will be treated ' + 'as a unitless number in a future version of React.', component._currentElement.type, ownerName || 'unknown', name, value) : void 0;
}
}
}
value = value.trim();
}
return value + 'px';
}
module.exports = dangerousStyleValue;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 101 */
/*!******************************************!*\
!*** ./~/fbjs/lib/hyphenateStyleName.js ***!
\******************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @typechecks
*/
'use strict';
var hyphenate = __webpack_require__(/*! ./hyphenate */ 102);
var msPattern = /^ms-/;
/**
* Hyphenates a camelcased CSS property name, for example:
*
* > hyphenateStyleName('backgroundColor')
* < "background-color"
* > hyphenateStyleName('MozTransition')
* < "-moz-transition"
* > hyphenateStyleName('msTransition')
* < "-ms-transition"
*
* As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix
* is converted to `-ms-`.
*
* @param {string} string
* @return {string}
*/
function hyphenateStyleName(string) {
return hyphenate(string).replace(msPattern, '-ms-');
}
module.exports = hyphenateStyleName;
/***/ },
/* 102 */
/*!*********************************!*\
!*** ./~/fbjs/lib/hyphenate.js ***!
\*********************************/
/***/ function(module, exports) {
'use strict';
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @typechecks
*/
var _uppercasePattern = /([A-Z])/g;
/**
* Hyphenates a camelcased string, for example:
*
* > hyphenate('backgroundColor')
* < "background-color"
*
* For CSS style names, use `hyphenateStyleName` instead which works properly
* with all vendor prefixes, including `ms`.
*
* @param {string} string
* @return {string}
*/
function hyphenate(string) {
return string.replace(_uppercasePattern, '-$1').toLowerCase();
}
module.exports = hyphenate;
/***/ },
/* 103 */
/*!*****************************************!*\
!*** ./~/fbjs/lib/memoizeStringOnly.js ***!
\*****************************************/
/***/ function(module, exports) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
* @typechecks static-only
*/
'use strict';
/**
* Memoizes the return value of a function that accepts one string argument.
*/
function memoizeStringOnly(callback) {
var cache = {};
return function (string) {
if (!cache.hasOwnProperty(string)) {
cache[string] = callback.call(this, string);
}
return cache[string];
};
}
module.exports = memoizeStringOnly;
/***/ },
/* 104 */
/*!**************************************************!*\
!*** ./~/react-dom/lib/DOMPropertyOperations.js ***!
\**************************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var DOMProperty = __webpack_require__(/*! ./DOMProperty */ 37);
var ReactDOMComponentTree = __webpack_require__(/*! ./ReactDOMComponentTree */ 35);
var ReactInstrumentation = __webpack_require__(/*! ./ReactInstrumentation */ 63);
var quoteAttributeValueForBrowser = __webpack_require__(/*! ./quoteAttributeValueForBrowser */ 105);
var warning = __webpack_require__(/*! fbjs/lib/warning */ 12);
var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + DOMProperty.ATTRIBUTE_NAME_START_CHAR + '][' + DOMProperty.ATTRIBUTE_NAME_CHAR + ']*$');
var illegalAttributeNameCache = {};
var validatedAttributeNameCache = {};
function isAttributeNameSafe(attributeName) {
if (validatedAttributeNameCache.hasOwnProperty(attributeName)) {
return true;
}
if (illegalAttributeNameCache.hasOwnProperty(attributeName)) {
return false;
}
if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {
validatedAttributeNameCache[attributeName] = true;
return true;
}
illegalAttributeNameCache[attributeName] = true;
process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid attribute name: `%s`', attributeName) : void 0;
return false;
}
function shouldIgnoreValue(propertyInfo, value) {
return value == null || propertyInfo.hasBooleanValue && !value || propertyInfo.hasNumericValue && isNaN(value) || propertyInfo.hasPositiveNumericValue && value < 1 || propertyInfo.hasOverloadedBooleanValue && value === false;
}
/**
* Operations for dealing with DOM properties.
*/
var DOMPropertyOperations = {
/**
* Creates markup for the ID property.
*
* @param {string} id Unescaped ID.
* @return {string} Markup string.
*/
createMarkupForID: function (id) {
return DOMProperty.ID_ATTRIBUTE_NAME + '=' + quoteAttributeValueForBrowser(id);
},
setAttributeForID: function (node, id) {
node.setAttribute(DOMProperty.ID_ATTRIBUTE_NAME, id);
},
createMarkupForRoot: function () {
return DOMProperty.ROOT_ATTRIBUTE_NAME + '=""';
},
setAttributeForRoot: function (node) {
node.setAttribute(DOMProperty.ROOT_ATTRIBUTE_NAME, '');
},
/**
* Creates markup for a property.
*
* @param {string} name
* @param {*} value
* @return {?string} Markup string, or null if the property was invalid.
*/
createMarkupForProperty: function (name, value) {
var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
if (propertyInfo) {
if (shouldIgnoreValue(propertyInfo, value)) {
return '';
}
var attributeName = propertyInfo.attributeName;
if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) {
return attributeName + '=""';
}
return attributeName + '=' + quoteAttributeValueForBrowser(value);
} else if (DOMProperty.isCustomAttribute(name)) {
if (value == null) {
return '';
}
return name + '=' + quoteAttributeValueForBrowser(value);
}
return null;
},
/**
* Creates markup for a custom property.
*
* @param {string} name
* @param {*} value
* @return {string} Markup string, or empty string if the property was invalid.
*/
createMarkupForCustomAttribute: function (name, value) {
if (!isAttributeNameSafe(name) || value == null) {
return '';
}
return name + '=' + quoteAttributeValueForBrowser(value);
},
/**
* Sets the value for a property on a node.
*
* @param {DOMElement} node
* @param {string} name
* @param {*} value
*/
setValueForProperty: function (node, name, value) {
var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
if (propertyInfo) {
var mutationMethod = propertyInfo.mutationMethod;
if (mutationMethod) {
mutationMethod(node, value);
} else if (shouldIgnoreValue(propertyInfo, value)) {
this.deleteValueForProperty(node, name);
return;
} else if (propertyInfo.mustUseProperty) {
// Contrary to `setAttribute`, object properties are properly
// `toString`ed by IE8/9.
node[propertyInfo.propertyName] = value;
} else {
var attributeName = propertyInfo.attributeName;
var namespace = propertyInfo.attributeNamespace;
// `setAttribute` with objects becomes only `[object]` in IE8/9,
// ('' + value) makes it output the correct toString()-value.
if (namespace) {
node.setAttributeNS(namespace, attributeName, '' + value);
} else if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) {
node.setAttribute(attributeName, '');
} else {
node.setAttribute(attributeName, '' + value);
}
}
} else if (DOMProperty.isCustomAttribute(name)) {
DOMPropertyOperations.setValueForAttribute(node, name, value);
return;
}
if (process.env.NODE_ENV !== 'production') {
var payload = {};
payload[name] = value;
ReactInstrumentation.debugTool.onHostOperation({
instanceID: ReactDOMComponentTree.getInstanceFromNode(node)._debugID,
type: 'update attribute',
payload: payload
});
}
},
setValueForAttribute: function (node, name, value) {
if (!isAttributeNameSafe(name)) {
return;
}
if (value == null) {
node.removeAttribute(name);
} else {
node.setAttribute(name, '' + value);
}
if (process.env.NODE_ENV !== 'production') {
var payload = {};
payload[name] = value;
ReactInstrumentation.debugTool.onHostOperation({
instanceID: ReactDOMComponentTree.getInstanceFromNode(node)._debugID,
type: 'update attribute',
payload: payload
});
}
},
/**
* Deletes an attributes from a node.
*
* @param {DOMElement} node
* @param {string} name
*/
deleteValueForAttribute: function (node, name) {
node.removeAttribute(name);
if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onHostOperation({
instanceID: ReactDOMComponentTree.getInstanceFromNode(node)._debugID,
type: 'remove attribute',
payload: name
});
}
},
/**
* Deletes the value for a property on a node.
*
* @param {DOMElement} node
* @param {string} name
*/
deleteValueForProperty: function (node, name) {
var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
if (propertyInfo) {
var mutationMethod = propertyInfo.mutationMethod;
if (mutationMethod) {
mutationMethod(node, undefined);
} else if (propertyInfo.mustUseProperty) {
var propName = propertyInfo.propertyName;
if (propertyInfo.hasBooleanValue) {
node[propName] = false;
} else {
node[propName] = '';
}
} else {
node.removeAttribute(propertyInfo.attributeName);
}
} else if (DOMProperty.isCustomAttribute(name)) {
node.removeAttribute(name);
}
if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onHostOperation({
instanceID: ReactDOMComponentTree.getInstanceFromNode(node)._debugID,
type: 'remove attribute',
payload: name
});
}
}
};
module.exports = DOMPropertyOperations;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 105 */
/*!**********************************************************!*\
!*** ./~/react-dom/lib/quoteAttributeValueForBrowser.js ***!
\**********************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var escapeTextContentForBrowser = __webpack_require__(/*! ./escapeTextContentForBrowser */ 87);
/**
* Escapes attribute value to prevent scripting attacks.
*
* @param {*} value Value to escape.
* @return {string} An escaped string.
*/
function quoteAttributeValueForBrowser(value) {
return '"' + escapeTextContentForBrowser(value) + '"';
}
module.exports = quoteAttributeValueForBrowser;
/***/ },
/* 106 */
/*!*****************************************************!*\
!*** ./~/react-dom/lib/ReactBrowserEventEmitter.js ***!
\*****************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var _assign = __webpack_require__(/*! object-assign */ 5);
var EventPluginRegistry = __webpack_require__(/*! ./EventPluginRegistry */ 44);
var ReactEventEmitterMixin = __webpack_require__(/*! ./ReactEventEmitterMixin */ 107);
var ViewportMetrics = __webpack_require__(/*! ./ViewportMetrics */ 77);
var getVendorPrefixedEventName = __webpack_require__(/*! ./getVendorPrefixedEventName */ 108);
var isEventSupported = __webpack_require__(/*! ./isEventSupported */ 71);
/**
* Summary of `ReactBrowserEventEmitter` event handling:
*
* - Top-level delegation is used to trap most native browser events. This
* may only occur in the main thread and is the responsibility of
* ReactEventListener, which is injected and can therefore support pluggable
* event sources. This is the only work that occurs in the main thread.
*
* - We normalize and de-duplicate events to account for browser quirks. This
* may be done in the worker thread.
*
* - Forward these native events (with the associated top-level type used to
* trap it) to `EventPluginHub`, which in turn will ask plugins if they want
* to extract any synthetic events.
*
* - The `EventPluginHub` will then process each event by annotating them with
* "dispatches", a sequence of listeners and IDs that care about that event.
*
* - The `EventPluginHub` then dispatches the events.
*
* Overview of React and the event system:
*
* +------------+ .
* | DOM | .
* +------------+ .
* | .
* v .
* +------------+ .
* | ReactEvent | .
* | Listener | .
* +------------+ . +-----------+
* | . +--------+|SimpleEvent|
* | . | |Plugin |
* +-----|------+ . v +-----------+
* | | | . +--------------+ +------------+
* | +-----------.--->|EventPluginHub| | Event |
* | | . | | +-----------+ | Propagators|
* | ReactEvent | . | | |TapEvent | |------------|
* | Emitter | . | |<---+|Plugin | |other plugin|
* | | . | | +-----------+ | utilities |
* | +-----------.--->| | +------------+
* | | | . +--------------+
* +-----|------+ . ^ +-----------+
* | . | |Enter/Leave|
* + . +-------+|Plugin |
* +-------------+ . +-----------+
* | application | .
* |-------------| .
* | | .
* | | .
* +-------------+ .
* .
* React Core . General Purpose Event Plugin System
*/
var hasEventPageXY;
var alreadyListeningTo = {};
var isMonitoringScrollValue = false;
var reactTopListenersCounter = 0;
// For events like 'submit' which don't consistently bubble (which we trap at a
// lower node than `document`), binding at `document` would cause duplicate
// events so we don't include them here
var topEventMapping = {
topAbort: 'abort',
topAnimationEnd: getVendorPrefixedEventName('animationend') || 'animationend',
topAnimationIteration: getVendorPrefixedEventName('animationiteration') || 'animationiteration',
topAnimationStart: getVendorPrefixedEventName('animationstart') || 'animationstart',
topBlur: 'blur',
topCanPlay: 'canplay',
topCanPlayThrough: 'canplaythrough',
topChange: 'change',
topClick: 'click',
topCompositionEnd: 'compositionend',
topCompositionStart: 'compositionstart',
topCompositionUpdate: 'compositionupdate',
topContextMenu: 'contextmenu',
topCopy: 'copy',
topCut: 'cut',
topDoubleClick: 'dblclick',
topDrag: 'drag',
topDragEnd: 'dragend',
topDragEnter: 'dragenter',
topDragExit: 'dragexit',
topDragLeave: 'dragleave',
topDragOver: 'dragover',
topDragStart: 'dragstart',
topDrop: 'drop',
topDurationChange: 'durationchange',
topEmptied: 'emptied',
topEncrypted: 'encrypted',
topEnded: 'ended',
topError: 'error',
topFocus: 'focus',
topInput: 'input',
topKeyDown: 'keydown',
topKeyPress: 'keypress',
topKeyUp: 'keyup',
topLoadedData: 'loadeddata',
topLoadedMetadata: 'loadedmetadata',
topLoadStart: 'loadstart',
topMouseDown: 'mousedown',
topMouseMove: 'mousemove',
topMouseOut: 'mouseout',
topMouseOver: 'mouseover',
topMouseUp: 'mouseup',
topPaste: 'paste',
topPause: 'pause',
topPlay: 'play',
topPlaying: 'playing',
topProgress: 'progress',
topRateChange: 'ratechange',
topScroll: 'scroll',
topSeeked: 'seeked',
topSeeking: 'seeking',
topSelectionChange: 'selectionchange',
topStalled: 'stalled',
topSuspend: 'suspend',
topTextInput: 'textInput',
topTimeUpdate: 'timeupdate',
topTouchCancel: 'touchcancel',
topTouchEnd: 'touchend',
topTouchMove: 'touchmove',
topTouchStart: 'touchstart',
topTransitionEnd: getVendorPrefixedEventName('transitionend') || 'transitionend',
topVolumeChange: 'volumechange',
topWaiting: 'waiting',
topWheel: 'wheel'
};
/**
* To ensure no conflicts with other potential React instances on the page
*/
var topListenersIDKey = '_reactListenersID' + String(Math.random()).slice(2);
function getListeningForDocument(mountAt) {
// In IE8, `mountAt` is a host object and doesn't have `hasOwnProperty`
// directly.
if (!Object.prototype.hasOwnProperty.call(mountAt, topListenersIDKey)) {
mountAt[topListenersIDKey] = reactTopListenersCounter++;
alreadyListeningTo[mountAt[topListenersIDKey]] = {};
}
return alreadyListeningTo[mountAt[topListenersIDKey]];
}
/**
* `ReactBrowserEventEmitter` is used to attach top-level event listeners. For
* example:
*
* EventPluginHub.putListener('myID', 'onClick', myFunction);
*
* This would allocate a "registration" of `('onClick', myFunction)` on 'myID'.
*
* @internal
*/
var ReactBrowserEventEmitter = _assign({}, ReactEventEmitterMixin, {
/**
* Injectable event backend
*/
ReactEventListener: null,
injection: {
/**
* @param {object} ReactEventListener
*/
injectReactEventListener: function (ReactEventListener) {
ReactEventListener.setHandleTopLevel(ReactBrowserEventEmitter.handleTopLevel);
ReactBrowserEventEmitter.ReactEventListener = ReactEventListener;
}
},
/**
* Sets whether or not any created callbacks should be enabled.
*
* @param {boolean} enabled True if callbacks should be enabled.
*/
setEnabled: function (enabled) {
if (ReactBrowserEventEmitter.ReactEventListener) {
ReactBrowserEventEmitter.ReactEventListener.setEnabled(enabled);
}
},
/**
* @return {boolean} True if callbacks are enabled.
*/
isEnabled: function () {
return !!(ReactBrowserEventEmitter.ReactEventListener && ReactBrowserEventEmitter.ReactEventListener.isEnabled());
},
/**
* We listen for bubbled touch events on the document object.
*
* Firefox v8.01 (and possibly others) exhibited strange behavior when
* mounting `onmousemove` events at some node that was not the document
* element. The symptoms were that if your mouse is not moving over something
* contained within that mount point (for example on the background) the
* top-level listeners for `onmousemove` won't be called. However, if you
* register the `mousemove` on the document object, then it will of course
* catch all `mousemove`s. This along with iOS quirks, justifies restricting
* top-level listeners to the document object only, at least for these
* movement types of events and possibly all events.
*
* @see http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html
*
* Also, `keyup`/`keypress`/`keydown` do not bubble to the window on IE, but
* they bubble to document.
*
* @param {string} registrationName Name of listener (e.g. `onClick`).
* @param {object} contentDocumentHandle Document which owns the container
*/
listenTo: function (registrationName, contentDocumentHandle) {
var mountAt = contentDocumentHandle;
var isListening = getListeningForDocument(mountAt);
var dependencies = EventPluginRegistry.registrationNameDependencies[registrationName];
for (var i = 0; i < dependencies.length; i++) {
var dependency = dependencies[i];
if (!(isListening.hasOwnProperty(dependency) && isListening[dependency])) {
if (dependency === 'topWheel') {
if (isEventSupported('wheel')) {
ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topWheel', 'wheel', mountAt);
} else if (isEventSupported('mousewheel')) {
ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topWheel', 'mousewheel', mountAt);
} else {
// Firefox needs to capture a different mouse scroll event.
// @see http://www.quirksmode.org/dom/events/tests/scroll.html
ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topWheel', 'DOMMouseScroll', mountAt);
}
} else if (dependency === 'topScroll') {
if (isEventSupported('scroll', true)) {
ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent('topScroll', 'scroll', mountAt);
} else {
ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topScroll', 'scroll', ReactBrowserEventEmitter.ReactEventListener.WINDOW_HANDLE);
}
} else if (dependency === 'topFocus' || dependency === 'topBlur') {
if (isEventSupported('focus', true)) {
ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent('topFocus', 'focus', mountAt);
ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent('topBlur', 'blur', mountAt);
} else if (isEventSupported('focusin')) {
// IE has `focusin` and `focusout` events which bubble.
// @see http://www.quirksmode.org/blog/archives/2008/04/delegating_the.html
ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topFocus', 'focusin', mountAt);
ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topBlur', 'focusout', mountAt);
}
// to make sure blur and focus event listeners are only attached once
isListening.topBlur = true;
isListening.topFocus = true;
} else if (topEventMapping.hasOwnProperty(dependency)) {
ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(dependency, topEventMapping[dependency], mountAt);
}
isListening[dependency] = true;
}
}
},
trapBubbledEvent: function (topLevelType, handlerBaseName, handle) {
return ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelType, handlerBaseName, handle);
},
trapCapturedEvent: function (topLevelType, handlerBaseName, handle) {
return ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelType, handlerBaseName, handle);
},
/**
* Protect against document.createEvent() returning null
* Some popup blocker extensions appear to do this:
* https://github.com/facebook/react/issues/6887
*/
supportsEventPageXY: function () {
if (!document.createEvent) {
return false;
}
var ev = document.createEvent('MouseEvent');
return ev != null && 'pageX' in ev;
},
/**
* Listens to window scroll and resize events. We cache scroll values so that
* application code can access them without triggering reflows.
*
* ViewportMetrics is only used by SyntheticMouse/TouchEvent and only when
* pageX/pageY isn't supported (legacy browsers).
*
* NOTE: Scroll events do not bubble.
*
* @see http://www.quirksmode.org/dom/events/scroll.html
*/
ensureScrollValueMonitoring: function () {
if (hasEventPageXY === undefined) {
hasEventPageXY = ReactBrowserEventEmitter.supportsEventPageXY();
}
if (!hasEventPageXY && !isMonitoringScrollValue) {
var refresh = ViewportMetrics.refreshScrollValues;
ReactBrowserEventEmitter.ReactEventListener.monitorScrollValue(refresh);
isMonitoringScrollValue = true;
}
}
});
module.exports = ReactBrowserEventEmitter;
/***/ },
/* 107 */
/*!***************************************************!*\
!*** ./~/react-dom/lib/ReactEventEmitterMixin.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var EventPluginHub = __webpack_require__(/*! ./EventPluginHub */ 43);
function runEventQueueInBatch(events) {
EventPluginHub.enqueueEvents(events);
EventPluginHub.processEventQueue(false);
}
var ReactEventEmitterMixin = {
/**
* Streams a fired top-level event to `EventPluginHub` where plugins have the
* opportunity to create `ReactEvent`s to be dispatched.
*/
handleTopLevel: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
var events = EventPluginHub.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget);
runEventQueueInBatch(events);
}
};
module.exports = ReactEventEmitterMixin;
/***/ },
/* 108 */
/*!*******************************************************!*\
!*** ./~/react-dom/lib/getVendorPrefixedEventName.js ***!
\*******************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var ExecutionEnvironment = __webpack_require__(/*! fbjs/lib/ExecutionEnvironment */ 49);
/**
* Generate a mapping of standard vendor prefixes using the defined style property and event name.
*
* @param {string} styleProp
* @param {string} eventName
* @returns {object}
*/
function makePrefixMap(styleProp, eventName) {
var prefixes = {};
prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();
prefixes['Webkit' + styleProp] = 'webkit' + eventName;
prefixes['Moz' + styleProp] = 'moz' + eventName;
prefixes['ms' + styleProp] = 'MS' + eventName;
prefixes['O' + styleProp] = 'o' + eventName.toLowerCase();
return prefixes;
}
/**
* A list of event names to a configurable list of vendor prefixes.
*/
var vendorPrefixes = {
animationend: makePrefixMap('Animation', 'AnimationEnd'),
animationiteration: makePrefixMap('Animation', 'AnimationIteration'),
animationstart: makePrefixMap('Animation', 'AnimationStart'),
transitionend: makePrefixMap('Transition', 'TransitionEnd')
};
/**
* Event names that have already been detected and prefixed (if applicable).
*/
var prefixedEventNames = {};
/**
* Element to check for prefixes on.
*/
var style = {};
/**
* Bootstrap if a DOM exists.
*/
if (ExecutionEnvironment.canUseDOM) {
style = document.createElement('div').style;
// On some platforms, in particular some releases of Android 4.x,
// the un-prefixed "animation" and "transition" properties are defined on the
// style object but the events that fire will still be prefixed, so we need
// to check if the un-prefixed events are usable, and if not remove them from the map.
if (!('AnimationEvent' in window)) {
delete vendorPrefixes.animationend.animation;
delete vendorPrefixes.animationiteration.animation;
delete vendorPrefixes.animationstart.animation;
}
// Same as above
if (!('TransitionEvent' in window)) {
delete vendorPrefixes.transitionend.transition;
}
}
/**
* Attempts to determine the correct vendor prefixed event name.
*
* @param {string} eventName
* @returns {string}
*/
function getVendorPrefixedEventName(eventName) {
if (prefixedEventNames[eventName]) {
return prefixedEventNames[eventName];
} else if (!vendorPrefixes[eventName]) {
return eventName;
}
var prefixMap = vendorPrefixes[eventName];
for (var styleProp in prefixMap) {
if (prefixMap.hasOwnProperty(styleProp) && styleProp in style) {
return prefixedEventNames[eventName] = prefixMap[styleProp];
}
}
return '';
}
module.exports = getVendorPrefixedEventName;
/***/ },
/* 109 */
/*!******************************************!*\
!*** ./~/react-dom/lib/ReactDOMInput.js ***!
\******************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var _prodInvariant = __webpack_require__(/*! ./reactProdInvariant */ 36),
_assign = __webpack_require__(/*! object-assign */ 5);
var DOMPropertyOperations = __webpack_require__(/*! ./DOMPropertyOperations */ 104);
var LinkedValueUtils = __webpack_require__(/*! ./LinkedValueUtils */ 110);
var ReactDOMComponentTree = __webpack_require__(/*! ./ReactDOMComponentTree */ 35);
var ReactUpdates = __webpack_require__(/*! ./ReactUpdates */ 57);
var invariant = __webpack_require__(/*! fbjs/lib/invariant */ 9);
var warning = __webpack_require__(/*! fbjs/lib/warning */ 12);
var didWarnValueLink = false;
var didWarnCheckedLink = false;
var didWarnValueDefaultValue = false;
var didWarnCheckedDefaultChecked = false;
var didWarnControlledToUncontrolled = false;
var didWarnUncontrolledToControlled = false;
function forceUpdateIfMounted() {
if (this._rootNodeID) {
// DOM component is still mounted; update
ReactDOMInput.updateWrapper(this);
}
}
function isControlled(props) {
var usesChecked = props.type === 'checkbox' || props.type === 'radio';
return usesChecked ? props.checked != null : props.value != null;
}
/**
* Implements an <input> host component that allows setting these optional
* props: `checked`, `value`, `defaultChecked`, and `defaultValue`.
*
* If `checked` or `value` are not supplied (or null/undefined), user actions
* that affect the checked state or value will trigger updates to the element.
*
* If they are supplied (and not null/undefined), the rendered element will not
* trigger updates to the element. Instead, the props must change in order for
* the rendered element to be updated.
*
* The rendered element will be initialized as unchecked (or `defaultChecked`)
* with an empty value (or `defaultValue`).
*
* @see http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html
*/
var ReactDOMInput = {
getHostProps: function (inst, props) {
var value = LinkedValueUtils.getValue(props);
var checked = LinkedValueUtils.getChecked(props);
var hostProps = _assign({
// Make sure we set .type before any other properties (setting .value
// before .type means .value is lost in IE11 and below)
type: undefined,
// Make sure we set .step before .value (setting .value before .step
// means .value is rounded on mount, based upon step precision)
step: undefined,
// Make sure we set .min & .max before .value (to ensure proper order
// in corner cases such as min or max deriving from value, e.g. Issue #7170)
min: undefined,
max: undefined
}, props, {
defaultChecked: undefined,
defaultValue: undefined,
value: value != null ? value : inst._wrapperState.initialValue,
checked: checked != null ? checked : inst._wrapperState.initialChecked,
onChange: inst._wrapperState.onChange
});
return hostProps;
},
mountWrapper: function (inst, props) {
if (process.env.NODE_ENV !== 'production') {
LinkedValueUtils.checkPropTypes('input', props, inst._currentElement._owner);
var owner = inst._currentElement._owner;
if (props.valueLink !== undefined && !didWarnValueLink) {
process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `input` is deprecated; set `value` and `onChange` instead.') : void 0;
didWarnValueLink = true;
}
if (props.checkedLink !== undefined && !didWarnCheckedLink) {
process.env.NODE_ENV !== 'production' ? warning(false, '`checkedLink` prop on `input` is deprecated; set `value` and `onChange` instead.') : void 0;
didWarnCheckedLink = true;
}
if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) {
process.env.NODE_ENV !== 'production' ? warning(false, '%s contains an input of type %s with both checked and defaultChecked props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the checked prop, or the defaultChecked prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', owner && owner.getName() || 'A component', props.type) : void 0;
didWarnCheckedDefaultChecked = true;
}
if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) {
process.env.NODE_ENV !== 'production' ? warning(false, '%s contains an input of type %s with both value and defaultValue props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', owner && owner.getName() || 'A component', props.type) : void 0;
didWarnValueDefaultValue = true;
}
}
var defaultValue = props.defaultValue;
inst._wrapperState = {
initialChecked: props.checked != null ? props.checked : props.defaultChecked,
initialValue: props.value != null ? props.value : defaultValue,
listeners: null,
onChange: _handleChange.bind(inst)
};
if (process.env.NODE_ENV !== 'production') {
inst._wrapperState.controlled = isControlled(props);
}
},
updateWrapper: function (inst) {
var props = inst._currentElement.props;
if (process.env.NODE_ENV !== 'production') {
var controlled = isControlled(props);
var owner = inst._currentElement._owner;
if (!inst._wrapperState.controlled && controlled && !didWarnUncontrolledToControlled) {
process.env.NODE_ENV !== 'production' ? warning(false, '%s is changing an uncontrolled input of type %s to be controlled. ' + 'Input elements should not switch from uncontrolled to controlled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', owner && owner.getName() || 'A component', props.type) : void 0;
didWarnUncontrolledToControlled = true;
}
if (inst._wrapperState.controlled && !controlled && !didWarnControlledToUncontrolled) {
process.env.NODE_ENV !== 'production' ? warning(false, '%s is changing a controlled input of type %s to be uncontrolled. ' + 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', owner && owner.getName() || 'A component', props.type) : void 0;
didWarnControlledToUncontrolled = true;
}
}
// TODO: Shouldn't this be getChecked(props)?
var checked = props.checked;
if (checked != null) {
DOMPropertyOperations.setValueForProperty(ReactDOMComponentTree.getNodeFromInstance(inst), 'checked', checked || false);
}
var node = ReactDOMComponentTree.getNodeFromInstance(inst);
var value = LinkedValueUtils.getValue(props);
if (value != null) {
// Cast `value` to a string to ensure the value is set correctly. While
// browsers typically do this as necessary, jsdom doesn't.
var newValue = '' + value;
// To avoid side effects (such as losing text selection), only set value if changed
if (newValue !== node.value) {
node.value = newValue;
}
} else {
if (props.value == null && props.defaultValue != null) {
// In Chrome, assigning defaultValue to certain input types triggers input validation.
// For number inputs, the display value loses trailing decimal points. For email inputs,
// Chrome raises "The specified value <x> is not a valid email address".
//
// Here we check to see if the defaultValue has actually changed, avoiding these problems
// when the user is inputting text
//
// https://github.com/facebook/react/issues/7253
if (node.defaultValue !== '' + props.defaultValue) {
node.defaultValue = '' + props.defaultValue;
}
}
if (props.checked == null && props.defaultChecked != null) {
node.defaultChecked = !!props.defaultChecked;
}
}
},
postMountWrapper: function (inst) {
var props = inst._currentElement.props;
// This is in postMount because we need access to the DOM node, which is not
// available until after the component has mounted.
var node = ReactDOMComponentTree.getNodeFromInstance(inst);
// Detach value from defaultValue. We won't do anything if we're working on
// submit or reset inputs as those values & defaultValues are linked. They
// are not resetable nodes so this operation doesn't matter and actually
// removes browser-default values (eg "Submit Query") when no value is
// provided.
switch (props.type) {
case 'submit':
case 'reset':
break;
case 'color':
case 'date':
case 'datetime':
case 'datetime-local':
case 'month':
case 'time':
case 'week':
// This fixes the no-show issue on iOS Safari and Android Chrome:
// https://github.com/facebook/react/issues/7233
node.value = '';
node.value = node.defaultValue;
break;
default:
node.value = node.value;
break;
}
// Normally, we'd just do `node.checked = node.checked` upon initial mount, less this bug
// this is needed to work around a chrome bug where setting defaultChecked
// will sometimes influence the value of checked (even after detachment).
// Reference: https://bugs.chromium.org/p/chromium/issues/detail?id=608416
// We need to temporarily unset name to avoid disrupting radio button groups.
var name = node.name;
if (name !== '') {
node.name = '';
}
node.defaultChecked = !node.defaultChecked;
node.defaultChecked = !node.defaultChecked;
if (name !== '') {
node.name = name;
}
}
};
function _handleChange(event) {
var props = this._currentElement.props;
var returnValue = LinkedValueUtils.executeOnChange(props, event);
// Here we use asap to wait until all updates have propagated, which
// is important when using controlled components within layers:
// https://github.com/facebook/react/issues/1698
ReactUpdates.asap(forceUpdateIfMounted, this);
var name = props.name;
if (props.type === 'radio' && name != null) {
var rootNode = ReactDOMComponentTree.getNodeFromInstance(this);
var queryRoot = rootNode;
while (queryRoot.parentNode) {
queryRoot = queryRoot.parentNode;
}
// If `rootNode.form` was non-null, then we could try `form.elements`,
// but that sometimes behaves strangely in IE8. We could also try using
// `form.getElementsByName`, but that will only return direct children
// and won't include inputs that use the HTML5 `form=` attribute. Since
// the input might not even be in a form, let's just use the global
// `querySelectorAll` to ensure we don't miss anything.
var group = queryRoot.querySelectorAll('input[name=' + JSON.stringify('' + name) + '][type="radio"]');
for (var i = 0; i < group.length; i++) {
var otherNode = group[i];
if (otherNode === rootNode || otherNode.form !== rootNode.form) {
continue;
}
// This will throw if radio buttons rendered by different copies of React
// and the same name are rendered into the same form (same as #1939).
// That's probably okay; we don't support it just as we don't support
// mixing React radio buttons with non-React ones.
var otherInstance = ReactDOMComponentTree.getInstanceFromNode(otherNode);
!otherInstance ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.') : _prodInvariant('90') : void 0;
// If this is a controlled radio button group, forcing the input that
// was previously checked to update will cause it to be come re-checked
// as appropriate.
ReactUpdates.asap(forceUpdateIfMounted, otherInstance);
}
}
return returnValue;
}
module.exports = ReactDOMInput;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 110 */
/*!*********************************************!*\
!*** ./~/react-dom/lib/LinkedValueUtils.js ***!
\*********************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var _prodInvariant = __webpack_require__(/*! ./reactProdInvariant */ 36);
var React = __webpack_require__(/*! react/lib/React */ 3);
var ReactPropTypesSecret = __webpack_require__(/*! ./ReactPropTypesSecret */ 111);
var invariant = __webpack_require__(/*! fbjs/lib/invariant */ 9);
var warning = __webpack_require__(/*! fbjs/lib/warning */ 12);
var hasReadOnlyValue = {
'button': true,
'checkbox': true,
'image': true,
'hidden': true,
'radio': true,
'reset': true,
'submit': true
};
function _assertSingleLink(inputProps) {
!(inputProps.checkedLink == null || inputProps.valueLink == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot provide a checkedLink and a valueLink. If you want to use checkedLink, you probably don\'t want to use valueLink and vice versa.') : _prodInvariant('87') : void 0;
}
function _assertValueLink(inputProps) {
_assertSingleLink(inputProps);
!(inputProps.value == null && inputProps.onChange == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot provide a valueLink and a value or onChange event. If you want to use value or onChange, you probably don\'t want to use valueLink.') : _prodInvariant('88') : void 0;
}
function _assertCheckedLink(inputProps) {
_assertSingleLink(inputProps);
!(inputProps.checked == null && inputProps.onChange == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot provide a checkedLink and a checked property or onChange event. If you want to use checked or onChange, you probably don\'t want to use checkedLink') : _prodInvariant('89') : void 0;
}
var propTypes = {
value: function (props, propName, componentName) {
if (!props[propName] || hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled) {
return null;
}
return new Error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
},
checked: function (props, propName, componentName) {
if (!props[propName] || props.onChange || props.readOnly || props.disabled) {
return null;
}
return new Error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
},
onChange: React.PropTypes.func
};
var loggedTypeFailures = {};
function getDeclarationErrorAddendum(owner) {
if (owner) {
var name = owner.getName();
if (name) {
return ' Check the render method of `' + name + '`.';
}
}
return '';
}
/**
* Provide a linked `value` attribute for controlled forms. You should not use
* this outside of the ReactDOM controlled form components.
*/
var LinkedValueUtils = {
checkPropTypes: function (tagName, props, owner) {
for (var propName in propTypes) {
if (propTypes.hasOwnProperty(propName)) {
var error = propTypes[propName](props, propName, tagName, 'prop', null, ReactPropTypesSecret);
}
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 addendum = getDeclarationErrorAddendum(owner);
process.env.NODE_ENV !== 'production' ? warning(false, 'Failed form propType: %s%s', error.message, addendum) : void 0;
}
}
},
/**
* @param {object} inputProps Props for form component
* @return {*} current value of the input either from value prop or link.
*/
getValue: function (inputProps) {
if (inputProps.valueLink) {
_assertValueLink(inputProps);
return inputProps.valueLink.value;
}
return inputProps.value;
},
/**
* @param {object} inputProps Props for form component
* @return {*} current checked status of the input either from checked prop
* or link.
*/
getChecked: function (inputProps) {
if (inputProps.checkedLink) {
_assertCheckedLink(inputProps);
return inputProps.checkedLink.value;
}
return inputProps.checked;
},
/**
* @param {object} inputProps Props for form component
* @param {SyntheticEvent} event change event to handle
*/
executeOnChange: function (inputProps, event) {
if (inputProps.valueLink) {
_assertValueLink(inputProps);
return inputProps.valueLink.requestChange(event.target.value);
} else if (inputProps.checkedLink) {
_assertCheckedLink(inputProps);
return inputProps.checkedLink.requestChange(event.target.checked);
} else if (inputProps.onChange) {
return inputProps.onChange.call(undefined, event);
}
}
};
module.exports = LinkedValueUtils;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 111 */
/*!*************************************************!*\
!*** ./~/react-dom/lib/ReactPropTypesSecret.js ***!
\*************************************************/
/***/ function(module, exports) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
'use strict';
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
module.exports = ReactPropTypesSecret;
/***/ },
/* 112 */
/*!*******************************************!*\
!*** ./~/react-dom/lib/ReactDOMOption.js ***!
\*******************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var _assign = __webpack_require__(/*! object-assign */ 5);
var React = __webpack_require__(/*! react/lib/React */ 3);
var ReactDOMComponentTree = __webpack_require__(/*! ./ReactDOMComponentTree */ 35);
var ReactDOMSelect = __webpack_require__(/*! ./ReactDOMSelect */ 113);
var warning = __webpack_require__(/*! fbjs/lib/warning */ 12);
var didWarnInvalidOptionChildren = false;
function flattenChildren(children) {
var content = '';
// Flatten children and warn if they aren't strings or numbers;
// invalid types are ignored.
React.Children.forEach(children, function (child) {
if (child == null) {
return;
}
if (typeof child === 'string' || typeof child === 'number') {
content += child;
} else if (!didWarnInvalidOptionChildren) {
didWarnInvalidOptionChildren = true;
process.env.NODE_ENV !== 'production' ? warning(false, 'Only strings and numbers are supported as <option> children.') : void 0;
}
});
return content;
}
/**
* Implements an <option> host component that warns when `selected` is set.
*/
var ReactDOMOption = {
mountWrapper: function (inst, props, hostParent) {
// TODO (yungsters): Remove support for `selected` in <option>.
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(props.selected == null, 'Use the `defaultValue` or `value` props on <select> instead of ' + 'setting `selected` on <option>.') : void 0;
}
// Look up whether this option is 'selected'
var selectValue = null;
if (hostParent != null) {
var selectParent = hostParent;
if (selectParent._tag === 'optgroup') {
selectParent = selectParent._hostParent;
}
if (selectParent != null && selectParent._tag === 'select') {
selectValue = ReactDOMSelect.getSelectValueContext(selectParent);
}
}
// If the value is null (e.g., no specified value or after initial mount)
// or missing (e.g., for <datalist>), we don't change props.selected
var selected = null;
if (selectValue != null) {
var value;
if (props.value != null) {
value = props.value + '';
} else {
value = flattenChildren(props.children);
}
selected = false;
if (Array.isArray(selectValue)) {
// multiple
for (var i = 0; i < selectValue.length; i++) {
if ('' + selectValue[i] === value) {
selected = true;
break;
}
}
} else {
selected = '' + selectValue === value;
}
}
inst._wrapperState = { selected: selected };
},
postMountWrapper: function (inst) {
// value="" should make a value attribute (#6219)
var props = inst._currentElement.props;
if (props.value != null) {
var node = ReactDOMComponentTree.getNodeFromInstance(inst);
node.setAttribute('value', props.value);
}
},
getHostProps: function (inst, props) {
var hostProps = _assign({ selected: undefined, children: undefined }, props);
// Read state only from initial mount because <select> updates value
// manually; we need the initial state only for server rendering
if (inst._wrapperState.selected != null) {
hostProps.selected = inst._wrapperState.selected;
}
var content = flattenChildren(props.children);
if (content) {
hostProps.children = content;
}
return hostProps;
}
};
module.exports = ReactDOMOption;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 113 */
/*!*******************************************!*\
!*** ./~/react-dom/lib/ReactDOMSelect.js ***!
\*******************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var _assign = __webpack_require__(/*! object-assign */ 5);
var LinkedValueUtils = __webpack_require__(/*! ./LinkedValueUtils */ 110);
var ReactDOMComponentTree = __webpack_require__(/*! ./ReactDOMComponentTree */ 35);
var ReactUpdates = __webpack_require__(/*! ./ReactUpdates */ 57);
var warning = __webpack_require__(/*! fbjs/lib/warning */ 12);
var didWarnValueLink = false;
var didWarnValueDefaultValue = false;
function updateOptionsIfPendingUpdateAndMounted() {
if (this._rootNodeID && this._wrapperState.pendingUpdate) {
this._wrapperState.pendingUpdate = false;
var props = this._currentElement.props;
var value = LinkedValueUtils.getValue(props);
if (value != null) {
updateOptions(this, Boolean(props.multiple), value);
}
}
}
function getDeclarationErrorAddendum(owner) {
if (owner) {
var name = owner.getName();
if (name) {
return ' Check the render method of `' + name + '`.';
}
}
return '';
}
var valuePropNames = ['value', 'defaultValue'];
/**
* Validation function for `value` and `defaultValue`.
* @private
*/
function checkSelectPropTypes(inst, props) {
var owner = inst._currentElement._owner;
LinkedValueUtils.checkPropTypes('select', props, owner);
if (props.valueLink !== undefined && !didWarnValueLink) {
process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0;
didWarnValueLink = true;
}
for (var i = 0; i < valuePropNames.length; i++) {
var propName = valuePropNames[i];
if (props[propName] == null) {
continue;
}
var isArray = Array.isArray(props[propName]);
if (props.multiple && !isArray) {
process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;
} else if (!props.multiple && isArray) {
process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;
}
}
}
/**
* @param {ReactDOMComponent} inst
* @param {boolean} multiple
* @param {*} propValue A stringable (with `multiple`, a list of stringables).
* @private
*/
function updateOptions(inst, multiple, propValue) {
var selectedValue, i;
var options = ReactDOMComponentTree.getNodeFromInstance(inst).options;
if (multiple) {
selectedValue = {};
for (i = 0; i < propValue.length; i++) {
selectedValue['' + propValue[i]] = true;
}
for (i = 0; i < options.length; i++) {
var selected = selectedValue.hasOwnProperty(options[i].value);
if (options[i].selected !== selected) {
options[i].selected = selected;
}
}
} else {
// Do not set `select.value` as exact behavior isn't consistent across all
// browsers for all cases.
selectedValue = '' + propValue;
for (i = 0; i < options.length; i++) {
if (options[i].value === selectedValue) {
options[i].selected = true;
return;
}
}
if (options.length) {
options[0].selected = true;
}
}
}
/**
* Implements a <select> host component that allows optionally setting the
* props `value` and `defaultValue`. If `multiple` is false, the prop must be a
* stringable. If `multiple` is true, the prop must be an array of stringables.
*
* If `value` is not supplied (or null/undefined), user actions that change the
* selected option will trigger updates to the rendered options.
*
* If it is supplied (and not null/undefined), the rendered options will not
* update in response to user actions. Instead, the `value` prop must change in
* order for the rendered options to update.
*
* If `defaultValue` is provided, any options with the supplied values will be
* selected.
*/
var ReactDOMSelect = {
getHostProps: function (inst, props) {
return _assign({}, props, {
onChange: inst._wrapperState.onChange,
value: undefined
});
},
mountWrapper: function (inst, props) {
if (process.env.NODE_ENV !== 'production') {
checkSelectPropTypes(inst, props);
}
var value = LinkedValueUtils.getValue(props);
inst._wrapperState = {
pendingUpdate: false,
initialValue: value != null ? value : props.defaultValue,
listeners: null,
onChange: _handleChange.bind(inst),
wasMultiple: Boolean(props.multiple)
};
if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) {
process.env.NODE_ENV !== 'production' ? warning(false, 'Select elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled select ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components') : void 0;
didWarnValueDefaultValue = true;
}
},
getSelectValueContext: function (inst) {
// ReactDOMOption looks at this initial value so the initial generated
// markup has correct `selected` attributes
return inst._wrapperState.initialValue;
},
postUpdateWrapper: function (inst) {
var props = inst._currentElement.props;
// After the initial mount, we control selected-ness manually so don't pass
// this value down
inst._wrapperState.initialValue = undefined;
var wasMultiple = inst._wrapperState.wasMultiple;
inst._wrapperState.wasMultiple = Boolean(props.multiple);
var value = LinkedValueUtils.getValue(props);
if (value != null) {
inst._wrapperState.pendingUpdate = false;
updateOptions(inst, Boolean(props.multiple), value);
} else if (wasMultiple !== Boolean(props.multiple)) {
// For simplicity, reapply `defaultValue` if `multiple` is toggled.
if (props.defaultValue != null) {
updateOptions(inst, Boolean(props.multiple), props.defaultValue);
} else {
// Revert the select back to its default unselected state.
updateOptions(inst, Boolean(props.multiple), props.multiple ? [] : '');
}
}
}
};
function _handleChange(event) {
var props = this._currentElement.props;
var returnValue = LinkedValueUtils.executeOnChange(props, event);
if (this._rootNodeID) {
this._wrapperState.pendingUpdate = true;
}
ReactUpdates.asap(updateOptionsIfPendingUpdateAndMounted, this);
return returnValue;
}
module.exports = ReactDOMSelect;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 114 */
/*!*********************************************!*\
!*** ./~/react-dom/lib/ReactDOMTextarea.js ***!
\*********************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var _prodInvariant = __webpack_require__(/*! ./reactProdInvariant */ 36),
_assign = __webpack_require__(/*! object-assign */ 5);
var LinkedValueUtils = __webpack_require__(/*! ./LinkedValueUtils */ 110);
var ReactDOMComponentTree = __webpack_require__(/*! ./ReactDOMComponentTree */ 35);
var ReactUpdates = __webpack_require__(/*! ./ReactUpdates */ 57);
var invariant = __webpack_require__(/*! fbjs/lib/invariant */ 9);
var warning = __webpack_require__(/*! fbjs/lib/warning */ 12);
var didWarnValueLink = false;
var didWarnValDefaultVal = false;
function forceUpdateIfMounted() {
if (this._rootNodeID) {
// DOM component is still mounted; update
ReactDOMTextarea.updateWrapper(this);
}
}
/**
* Implements a <textarea> host component that allows setting `value`, and
* `defaultValue`. This differs from the traditional DOM API because value is
* usually set as PCDATA children.
*
* If `value` is not supplied (or null/undefined), user actions that affect the
* value will trigger updates to the element.
*
* If `value` is supplied (and not null/undefined), the rendered element will
* not trigger updates to the element. Instead, the `value` prop must change in
* order for the rendered element to be updated.
*
* The rendered element will be initialized with an empty value, the prop
* `defaultValue` if specified, or the children content (deprecated).
*/
var ReactDOMTextarea = {
getHostProps: function (inst, props) {
!(props.dangerouslySetInnerHTML == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, '`dangerouslySetInnerHTML` does not make sense on <textarea>.') : _prodInvariant('91') : void 0;
// Always set children to the same thing. In IE9, the selection range will
// get reset if `textContent` is mutated. We could add a check in setTextContent
// to only set the value if/when the value differs from the node value (which would
// completely solve this IE9 bug), but Sebastian+Ben seemed to like this solution.
// The value can be a boolean or object so that's why it's forced to be a string.
var hostProps = _assign({}, props, {
value: undefined,
defaultValue: undefined,
children: '' + inst._wrapperState.initialValue,
onChange: inst._wrapperState.onChange
});
return hostProps;
},
mountWrapper: function (inst, props) {
if (process.env.NODE_ENV !== 'production') {
LinkedValueUtils.checkPropTypes('textarea', props, inst._currentElement._owner);
if (props.valueLink !== undefined && !didWarnValueLink) {
process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `textarea` is deprecated; set `value` and `onChange` instead.') : void 0;
didWarnValueLink = true;
}
if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValDefaultVal) {
process.env.NODE_ENV !== 'production' ? warning(false, 'Textarea elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled textarea ' + 'and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components') : void 0;
didWarnValDefaultVal = true;
}
}
var value = LinkedValueUtils.getValue(props);
var initialValue = value;
// Only bother fetching default value if we're going to use it
if (value == null) {
var defaultValue = props.defaultValue;
// TODO (yungsters): Remove support for children content in <textarea>.
var children = props.children;
if (children != null) {
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(false, 'Use the `defaultValue` or `value` props instead of setting ' + 'children on <textarea>.') : void 0;
}
!(defaultValue == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'If you supply `defaultValue` on a <textarea>, do not pass children.') : _prodInvariant('92') : void 0;
if (Array.isArray(children)) {
!(children.length <= 1) ? process.env.NODE_ENV !== 'production' ? invariant(false, '<textarea> can only have at most one child.') : _prodInvariant('93') : void 0;
children = children[0];
}
defaultValue = '' + children;
}
if (defaultValue == null) {
defaultValue = '';
}
initialValue = defaultValue;
}
inst._wrapperState = {
initialValue: '' + initialValue,
listeners: null,
onChange: _handleChange.bind(inst)
};
},
updateWrapper: function (inst) {
var props = inst._currentElement.props;
var node = ReactDOMComponentTree.getNodeFromInstance(inst);
var value = LinkedValueUtils.getValue(props);
if (value != null) {
// Cast `value` to a string to ensure the value is set correctly. While
// browsers typically do this as necessary, jsdom doesn't.
var newValue = '' + value;
// To avoid side effects (such as losing text selection), only set value if changed
if (newValue !== node.value) {
node.value = newValue;
}
if (props.defaultValue == null) {
node.defaultValue = newValue;
}
}
if (props.defaultValue != null) {
node.defaultValue = props.defaultValue;
}
},
postMountWrapper: function (inst) {
// This is in postMount because we need access to the DOM node, which is not
// available until after the component has mounted.
var node = ReactDOMComponentTree.getNodeFromInstance(inst);
var textContent = node.textContent;
// Only set node.value if textContent is equal to the expected
// initial value. In IE10/IE11 there is a bug where the placeholder attribute
// will populate textContent as well.
// https://developer.microsoft.com/microsoft-edge/platform/issues/101525/
if (textContent === inst._wrapperState.initialValue) {
node.value = textContent;
}
}
};
function _handleChange(event) {
var props = this._currentElement.props;
var returnValue = LinkedValueUtils.executeOnChange(props, event);
ReactUpdates.asap(forceUpdateIfMounted, this);
return returnValue;
}
module.exports = ReactDOMTextarea;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 115 */
/*!********************************************!*\
!*** ./~/react-dom/lib/ReactMultiChild.js ***!
\********************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var _prodInvariant = __webpack_require__(/*! ./reactProdInvariant */ 36);
var ReactComponentEnvironment = __webpack_require__(/*! ./ReactComponentEnvironment */ 116);
var ReactInstanceMap = __webpack_require__(/*! ./ReactInstanceMap */ 117);
var ReactInstrumentation = __webpack_require__(/*! ./ReactInstrumentation */ 63);
var ReactCurrentOwner = __webpack_require__(/*! react/lib/ReactCurrentOwner */ 11);
var ReactReconciler = __webpack_require__(/*! ./ReactReconciler */ 60);
var ReactChildReconciler = __webpack_require__(/*! ./ReactChildReconciler */ 118);
var emptyFunction = __webpack_require__(/*! fbjs/lib/emptyFunction */ 13);
var flattenChildren = __webpack_require__(/*! ./flattenChildren */ 133);
var invariant = __webpack_require__(/*! fbjs/lib/invariant */ 9);
/**
* Make an update for markup to be rendered and inserted at a supplied index.
*
* @param {string} markup Markup that renders into an element.
* @param {number} toIndex Destination index.
* @private
*/
function makeInsertMarkup(markup, afterNode, toIndex) {
// NOTE: Null values reduce hidden classes.
return {
type: 'INSERT_MARKUP',
content: markup,
fromIndex: null,
fromNode: null,
toIndex: toIndex,
afterNode: afterNode
};
}
/**
* Make an update for moving an existing element to another index.
*
* @param {number} fromIndex Source index of the existing element.
* @param {number} toIndex Destination index of the element.
* @private
*/
function makeMove(child, afterNode, toIndex) {
// NOTE: Null values reduce hidden classes.
return {
type: 'MOVE_EXISTING',
content: null,
fromIndex: child._mountIndex,
fromNode: ReactReconciler.getHostNode(child),
toIndex: toIndex,
afterNode: afterNode
};
}
/**
* Make an update for removing an element at an index.
*
* @param {number} fromIndex Index of the element to remove.
* @private
*/
function makeRemove(child, node) {
// NOTE: Null values reduce hidden classes.
return {
type: 'REMOVE_NODE',
content: null,
fromIndex: child._mountIndex,
fromNode: node,
toIndex: null,
afterNode: null
};
}
/**
* Make an update for setting the markup of a node.
*
* @param {string} markup Markup that renders into an element.
* @private
*/
function makeSetMarkup(markup) {
// NOTE: Null values reduce hidden classes.
return {
type: 'SET_MARKUP',
content: markup,
fromIndex: null,
fromNode: null,
toIndex: null,
afterNode: null
};
}
/**
* Make an update for setting the text content.
*
* @param {string} textContent Text content to set.
* @private
*/
function makeTextContent(textContent) {
// NOTE: Null values reduce hidden classes.
return {
type: 'TEXT_CONTENT',
content: textContent,
fromIndex: null,
fromNode: null,
toIndex: null,
afterNode: null
};
}
/**
* Push an update, if any, onto the queue. Creates a new queue if none is
* passed and always returns the queue. Mutative.
*/
function enqueue(queue, update) {
if (update) {
queue = queue || [];
queue.push(update);
}
return queue;
}
/**
* Processes any enqueued updates.
*
* @private
*/
function processQueue(inst, updateQueue) {
ReactComponentEnvironment.processChildrenUpdates(inst, updateQueue);
}
var setChildrenForInstrumentation = emptyFunction;
if (process.env.NODE_ENV !== 'production') {
var getDebugID = function (inst) {
if (!inst._debugID) {
// Check for ART-like instances. TODO: This is silly/gross.
var internal;
if (internal = ReactInstanceMap.get(inst)) {
inst = internal;
}
}
return inst._debugID;
};
setChildrenForInstrumentation = function (children) {
var debugID = getDebugID(this);
// TODO: React Native empty components are also multichild.
// This means they still get into this method but don't have _debugID.
if (debugID !== 0) {
ReactInstrumentation.debugTool.onSetChildren(debugID, children ? Object.keys(children).map(function (key) {
return children[key]._debugID;
}) : []);
}
};
}
/**
* ReactMultiChild are capable of reconciling multiple children.
*
* @class ReactMultiChild
* @internal
*/
var ReactMultiChild = {
/**
* Provides common functionality for components that must reconcile multiple
* children. This is used by `ReactDOMComponent` to mount, update, and
* unmount child components.
*
* @lends {ReactMultiChild.prototype}
*/
Mixin: {
_reconcilerInstantiateChildren: function (nestedChildren, transaction, context) {
if (process.env.NODE_ENV !== 'production') {
var selfDebugID = getDebugID(this);
if (this._currentElement) {
try {
ReactCurrentOwner.current = this._currentElement._owner;
return ReactChildReconciler.instantiateChildren(nestedChildren, transaction, context, selfDebugID);
} finally {
ReactCurrentOwner.current = null;
}
}
}
return ReactChildReconciler.instantiateChildren(nestedChildren, transaction, context);
},
_reconcilerUpdateChildren: function (prevChildren, nextNestedChildrenElements, mountImages, removedNodes, transaction, context) {
var nextChildren;
var selfDebugID = 0;
if (process.env.NODE_ENV !== 'production') {
selfDebugID = getDebugID(this);
if (this._currentElement) {
try {
ReactCurrentOwner.current = this._currentElement._owner;
nextChildren = flattenChildren(nextNestedChildrenElements, selfDebugID);
} finally {
ReactCurrentOwner.current = null;
}
ReactChildReconciler.updateChildren(prevChildren, nextChildren, mountImages, removedNodes, transaction, this, this._hostContainerInfo, context, selfDebugID);
return nextChildren;
}
}
nextChildren = flattenChildren(nextNestedChildrenElements, selfDebugID);
ReactChildReconciler.updateChildren(prevChildren, nextChildren, mountImages, removedNodes, transaction, this, this._hostContainerInfo, context, selfDebugID);
return nextChildren;
},
/**
* Generates a "mount image" for each of the supplied children. In the case
* of `ReactDOMComponent`, a mount image is a string of markup.
*
* @param {?object} nestedChildren Nested child maps.
* @return {array} An array of mounted representations.
* @internal
*/
mountChildren: function (nestedChildren, transaction, context) {
var children = this._reconcilerInstantiateChildren(nestedChildren, transaction, context);
this._renderedChildren = children;
var mountImages = [];
var index = 0;
for (var name in children) {
if (children.hasOwnProperty(name)) {
var child = children[name];
var selfDebugID = 0;
if (process.env.NODE_ENV !== 'production') {
selfDebugID = getDebugID(this);
}
var mountImage = ReactReconciler.mountComponent(child, transaction, this, this._hostContainerInfo, context, selfDebugID);
child._mountIndex = index++;
mountImages.push(mountImage);
}
}
if (process.env.NODE_ENV !== 'production') {
setChildrenForInstrumentation.call(this, children);
}
return mountImages;
},
/**
* Replaces any rendered children with a text content string.
*
* @param {string} nextContent String of content.
* @internal
*/
updateTextContent: function (nextContent) {
var prevChildren = this._renderedChildren;
// Remove any rendered children.
ReactChildReconciler.unmountChildren(prevChildren, false);
for (var name in prevChildren) {
if (prevChildren.hasOwnProperty(name)) {
true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'updateTextContent called on non-empty component.') : _prodInvariant('118') : void 0;
}
}
// Set new text content.
var updates = [makeTextContent(nextContent)];
processQueue(this, updates);
},
/**
* Replaces any rendered children with a markup string.
*
* @param {string} nextMarkup String of markup.
* @internal
*/
updateMarkup: function (nextMarkup) {
var prevChildren = this._renderedChildren;
// Remove any rendered children.
ReactChildReconciler.unmountChildren(prevChildren, false);
for (var name in prevChildren) {
if (prevChildren.hasOwnProperty(name)) {
true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'updateTextContent called on non-empty component.') : _prodInvariant('118') : void 0;
}
}
var updates = [makeSetMarkup(nextMarkup)];
processQueue(this, updates);
},
/**
* Updates the rendered children with new children.
*
* @param {?object} nextNestedChildrenElements Nested child element maps.
* @param {ReactReconcileTransaction} transaction
* @internal
*/
updateChildren: function (nextNestedChildrenElements, transaction, context) {
// Hook used by React ART
this._updateChildren(nextNestedChildrenElements, transaction, context);
},
/**
* @param {?object} nextNestedChildrenElements Nested child element maps.
* @param {ReactReconcileTransaction} transaction
* @final
* @protected
*/
_updateChildren: function (nextNestedChildrenElements, transaction, context) {
var prevChildren = this._renderedChildren;
var removedNodes = {};
var mountImages = [];
var nextChildren = this._reconcilerUpdateChildren(prevChildren, nextNestedChildrenElements, mountImages, removedNodes, transaction, context);
if (!nextChildren && !prevChildren) {
return;
}
var updates = null;
var name;
// `nextIndex` will increment for each child in `nextChildren`, but
// `lastIndex` will be the last index visited in `prevChildren`.
var nextIndex = 0;
var lastIndex = 0;
// `nextMountIndex` will increment for each newly mounted child.
var nextMountIndex = 0;
var lastPlacedNode = null;
for (name in nextChildren) {
if (!nextChildren.hasOwnProperty(name)) {
continue;
}
var prevChild = prevChildren && prevChildren[name];
var nextChild = nextChildren[name];
if (prevChild === nextChild) {
updates = enqueue(updates, this.moveChild(prevChild, lastPlacedNode, nextIndex, lastIndex));
lastIndex = Math.max(prevChild._mountIndex, lastIndex);
prevChild._mountIndex = nextIndex;
} else {
if (prevChild) {
// Update `lastIndex` before `_mountIndex` gets unset by unmounting.
lastIndex = Math.max(prevChild._mountIndex, lastIndex);
// The `removedNodes` loop below will actually remove the child.
}
// The child must be instantiated before it's mounted.
updates = enqueue(updates, this._mountChildAtIndex(nextChild, mountImages[nextMountIndex], lastPlacedNode, nextIndex, transaction, context));
nextMountIndex++;
}
nextIndex++;
lastPlacedNode = ReactReconciler.getHostNode(nextChild);
}
// Remove children that are no longer present.
for (name in removedNodes) {
if (removedNodes.hasOwnProperty(name)) {
updates = enqueue(updates, this._unmountChild(prevChildren[name], removedNodes[name]));
}
}
if (updates) {
processQueue(this, updates);
}
this._renderedChildren = nextChildren;
if (process.env.NODE_ENV !== 'production') {
setChildrenForInstrumentation.call(this, nextChildren);
}
},
/**
* Unmounts all rendered children. This should be used to clean up children
* when this component is unmounted. It does not actually perform any
* backend operations.
*
* @internal
*/
unmountChildren: function (safely) {
var renderedChildren = this._renderedChildren;
ReactChildReconciler.unmountChildren(renderedChildren, safely);
this._renderedChildren = null;
},
/**
* Moves a child component to the supplied index.
*
* @param {ReactComponent} child Component to move.
* @param {number} toIndex Destination index of the element.
* @param {number} lastIndex Last index visited of the siblings of `child`.
* @protected
*/
moveChild: function (child, afterNode, toIndex, lastIndex) {
// If the index of `child` is less than `lastIndex`, then it needs to
// be moved. Otherwise, we do not need to move it because a child will be
// inserted or moved before `child`.
if (child._mountIndex < lastIndex) {
return makeMove(child, afterNode, toIndex);
}
},
/**
* Creates a child component.
*
* @param {ReactComponent} child Component to create.
* @param {string} mountImage Markup to insert.
* @protected
*/
createChild: function (child, afterNode, mountImage) {
return makeInsertMarkup(mountImage, afterNode, child._mountIndex);
},
/**
* Removes a child component.
*
* @param {ReactComponent} child Child to remove.
* @protected
*/
removeChild: function (child, node) {
return makeRemove(child, node);
},
/**
* Mounts a child with the supplied name.
*
* NOTE: This is part of `updateChildren` and is here for readability.
*
* @param {ReactComponent} child Component to mount.
* @param {string} name Name of the child.
* @param {number} index Index at which to insert the child.
* @param {ReactReconcileTransaction} transaction
* @private
*/
_mountChildAtIndex: function (child, mountImage, afterNode, index, transaction, context) {
child._mountIndex = index;
return this.createChild(child, afterNode, mountImage);
},
/**
* Unmounts a rendered child.
*
* NOTE: This is part of `updateChildren` and is here for readability.
*
* @param {ReactComponent} child Component to unmount.
* @private
*/
_unmountChild: function (child, node) {
var update = this.removeChild(child, node);
child._mountIndex = null;
return update;
}
}
};
module.exports = ReactMultiChild;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 116 */
/*!******************************************************!*\
!*** ./~/react-dom/lib/ReactComponentEnvironment.js ***!
\******************************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2014-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
'use strict';
var _prodInvariant = __webpack_require__(/*! ./reactProdInvariant */ 36);
var invariant = __webpack_require__(/*! fbjs/lib/invariant */ 9);
var injected = false;
var ReactComponentEnvironment = {
/**
* Optionally injectable hook for swapping out mount images in the middle of
* the tree.
*/
replaceNodeWithMarkup: null,
/**
* Optionally injectable hook for processing a queue of child updates. Will
* later move into MultiChildComponents.
*/
processChildrenUpdates: null,
injection: {
injectEnvironment: function (environment) {
!!injected ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactCompositeComponent: injectEnvironment() can only be called once.') : _prodInvariant('104') : void 0;
ReactComponentEnvironment.replaceNodeWithMarkup = environment.replaceNodeWithMarkup;
ReactComponentEnvironment.processChildrenUpdates = environment.processChildrenUpdates;
injected = true;
}
}
};
module.exports = ReactComponentEnvironment;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 117 */
/*!*********************************************!*\
!*** ./~/react-dom/lib/ReactInstanceMap.js ***!
\*********************************************/
/***/ function(module, exports) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
/**
* `ReactInstanceMap` maintains a mapping from a public facing stateful
* instance (key) and the internal representation (value). This allows public
* methods to accept the user facing instance as an argument and map them back
* to internal methods.
*/
// TODO: Replace this with ES6: var ReactInstanceMap = new Map();
var ReactInstanceMap = {
/**
* This API should be called `delete` but we'd have to make sure to always
* transform these to strings for IE support. When this transform is fully
* supported we can rename it.
*/
remove: function (key) {
key._reactInternalInstance = undefined;
},
get: function (key) {
return key._reactInternalInstance;
},
has: function (key) {
return key._reactInternalInstance !== undefined;
},
set: function (key, value) {
key._reactInternalInstance = value;
}
};
module.exports = ReactInstanceMap;
/***/ },
/* 118 */
/*!*************************************************!*\
!*** ./~/react-dom/lib/ReactChildReconciler.js ***!
\*************************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2014-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var ReactReconciler = __webpack_require__(/*! ./ReactReconciler */ 60);
var instantiateReactComponent = __webpack_require__(/*! ./instantiateReactComponent */ 119);
var KeyEscapeUtils = __webpack_require__(/*! ./KeyEscapeUtils */ 129);
var shouldUpdateReactComponent = __webpack_require__(/*! ./shouldUpdateReactComponent */ 125);
var traverseAllChildren = __webpack_require__(/*! ./traverseAllChildren */ 130);
var warning = __webpack_require__(/*! fbjs/lib/warning */ 12);
var ReactComponentTreeHook;
if (typeof process !== 'undefined' && process.env && process.env.NODE_ENV === 'test') {
// Temporary hack.
// Inline requires don't work well with Jest:
// https://github.com/facebook/react/issues/7240
// Remove the inline requires when we don't need them anymore:
// https://github.com/facebook/react/pull/7178
ReactComponentTreeHook = __webpack_require__(/*! react/lib/ReactComponentTreeHook */ 27);
}
function instantiateChild(childInstances, child, name, selfDebugID) {
// We found a component instance.
var keyUnique = childInstances[name] === undefined;
if (process.env.NODE_ENV !== 'production') {
if (!ReactComponentTreeHook) {
ReactComponentTreeHook = __webpack_require__(/*! react/lib/ReactComponentTreeHook */ 27);
}
if (!keyUnique) {
process.env.NODE_ENV !== 'production' ? warning(false, 'flattenChildren(...): Encountered two children with the same key, ' + '`%s`. Child keys must be unique; when two children share a key, only ' + 'the first child will be used.%s', KeyEscapeUtils.unescape(name), ReactComponentTreeHook.getStackAddendumByID(selfDebugID)) : void 0;
}
}
if (child != null && keyUnique) {
childInstances[name] = instantiateReactComponent(child, true);
}
}
/**
* ReactChildReconciler provides helpers for initializing or updating a set of
* children. Its output is suitable for passing it onto ReactMultiChild which
* does diffed reordering and insertion.
*/
var ReactChildReconciler = {
/**
* Generates a "mount image" for each of the supplied children. In the case
* of `ReactDOMComponent`, a mount image is a string of markup.
*
* @param {?object} nestedChildNodes Nested child maps.
* @return {?object} A set of child instances.
* @internal
*/
instantiateChildren: function (nestedChildNodes, transaction, context, selfDebugID // 0 in production and for roots
) {
if (nestedChildNodes == null) {
return null;
}
var childInstances = {};
if (process.env.NODE_ENV !== 'production') {
traverseAllChildren(nestedChildNodes, function (childInsts, child, name) {
return instantiateChild(childInsts, child, name, selfDebugID);
}, childInstances);
} else {
traverseAllChildren(nestedChildNodes, instantiateChild, childInstances);
}
return childInstances;
},
/**
* Updates the rendered children and returns a new set of children.
*
* @param {?object} prevChildren Previously initialized set of children.
* @param {?object} nextChildren Flat child element maps.
* @param {ReactReconcileTransaction} transaction
* @param {object} context
* @return {?object} A new set of child instances.
* @internal
*/
updateChildren: function (prevChildren, nextChildren, mountImages, removedNodes, transaction, hostParent, hostContainerInfo, context, selfDebugID // 0 in production and for roots
) {
// We currently don't have a way to track moves here but if we use iterators
// instead of for..in we can zip the iterators and check if an item has
// moved.
// TODO: If nothing has changed, return the prevChildren object so that we
// can quickly bailout if nothing has changed.
if (!nextChildren && !prevChildren) {
return;
}
var name;
var prevChild;
for (name in nextChildren) {
if (!nextChildren.hasOwnProperty(name)) {
continue;
}
prevChild = prevChildren && prevChildren[name];
var prevElement = prevChild && prevChild._currentElement;
var nextElement = nextChildren[name];
if (prevChild != null && shouldUpdateReactComponent(prevElement, nextElement)) {
ReactReconciler.receiveComponent(prevChild, nextElement, transaction, context);
nextChildren[name] = prevChild;
} else {
if (prevChild) {
removedNodes[name] = ReactReconciler.getHostNode(prevChild);
ReactReconciler.unmountComponent(prevChild, false);
}
// The child must be instantiated before it's mounted.
var nextChildInstance = instantiateReactComponent(nextElement, true);
nextChildren[name] = nextChildInstance;
// Creating mount image now ensures refs are resolved in right order
// (see https://github.com/facebook/react/pull/7101 for explanation).
var nextChildMountImage = ReactReconciler.mountComponent(nextChildInstance, transaction, hostParent, hostContainerInfo, context, selfDebugID);
mountImages.push(nextChildMountImage);
}
}
// Unmount children that are no longer present.
for (name in prevChildren) {
if (prevChildren.hasOwnProperty(name) && !(nextChildren && nextChildren.hasOwnProperty(name))) {
prevChild = prevChildren[name];
removedNodes[name] = ReactReconciler.getHostNode(prevChild);
ReactReconciler.unmountComponent(prevChild, false);
}
}
},
/**
* Unmounts all rendered children. This should be used to clean up children
* when this component is unmounted.
*
* @param {?object} renderedChildren Previously initialized set of children.
* @internal
*/
unmountChildren: function (renderedChildren, safely) {
for (var name in renderedChildren) {
if (renderedChildren.hasOwnProperty(name)) {
var renderedChild = renderedChildren[name];
ReactReconciler.unmountComponent(renderedChild, safely);
}
}
}
};
module.exports = ReactChildReconciler;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 119 */
/*!******************************************************!*\
!*** ./~/react-dom/lib/instantiateReactComponent.js ***!
\******************************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var _prodInvariant = __webpack_require__(/*! ./reactProdInvariant */ 36),
_assign = __webpack_require__(/*! object-assign */ 5);
var ReactCompositeComponent = __webpack_require__(/*! ./ReactCompositeComponent */ 120);
var ReactEmptyComponent = __webpack_require__(/*! ./ReactEmptyComponent */ 126);
var ReactHostComponent = __webpack_require__(/*! ./ReactHostComponent */ 127);
var getNextDebugID = __webpack_require__(/*! ./getNextDebugID */ 128);
var invariant = __webpack_require__(/*! fbjs/lib/invariant */ 9);
var warning = __webpack_require__(/*! fbjs/lib/warning */ 12);
// To avoid a cyclic dependency, we create the final class in this module
var ReactCompositeComponentWrapper = function (element) {
this.construct(element);
};
_assign(ReactCompositeComponentWrapper.prototype, ReactCompositeComponent, {
_instantiateReactComponent: instantiateReactComponent
});
function getDeclarationErrorAddendum(owner) {
if (owner) {
var name = owner.getName();
if (name) {
return ' Check the render method of `' + name + '`.';
}
}
return '';
}
/**
* Check if the type reference is a known internal type. I.e. not a user
* provided composite type.
*
* @param {function} type
* @return {boolean} Returns true if this is a valid internal type.
*/
function isInternalComponentType(type) {
return typeof type === 'function' && typeof type.prototype !== 'undefined' && typeof type.prototype.mountComponent === 'function' && typeof type.prototype.receiveComponent === 'function';
}
/**
* Given a ReactNode, create an instance that will actually be mounted.
*
* @param {ReactNode} node
* @param {boolean} shouldHaveDebugID
* @return {object} A new instance of the element's constructor.
* @protected
*/
function instantiateReactComponent(node, shouldHaveDebugID) {
var instance;
if (node === null || node === false) {
instance = ReactEmptyComponent.create(instantiateReactComponent);
} else if (typeof node === 'object') {
var element = node;
var type = element.type;
if (typeof type !== 'function' && typeof type !== 'string') {
var info = '';
if (process.env.NODE_ENV !== 'production') {
if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
info += ' You likely forgot to export your component from the file ' + 'it\'s defined in.';
}
}
info += getDeclarationErrorAddendum(element._owner);
true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s', type == null ? type : typeof type, info) : _prodInvariant('130', type == null ? type : typeof type, info) : void 0;
}
// Special case string values
if (typeof element.type === 'string') {
instance = ReactHostComponent.createInternalComponent(element);
} else if (isInternalComponentType(element.type)) {
// This is temporarily available for custom components that are not string
// representations. I.e. ART. Once those are updated to use the string
// representation, we can drop this code path.
instance = new element.type(element);
// We renamed this. Allow the old name for compat. :(
if (!instance.getHostNode) {
instance.getHostNode = instance.getNativeNode;
}
} else {
instance = new ReactCompositeComponentWrapper(element);
}
} else if (typeof node === 'string' || typeof node === 'number') {
instance = ReactHostComponent.createInstanceForText(node);
} else {
true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Encountered invalid React node of type %s', typeof node) : _prodInvariant('131', typeof node) : void 0;
}
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(typeof instance.mountComponent === 'function' && typeof instance.receiveComponent === 'function' && typeof instance.getHostNode === 'function' && typeof instance.unmountComponent === 'function', 'Only React Components can be mounted.') : void 0;
}
// These two fields are used by the DOM and ART diffing algorithms
// respectively. Instead of using expandos on components, we should be
// storing the state needed by the diffing algorithms elsewhere.
instance._mountIndex = 0;
instance._mountImage = null;
if (process.env.NODE_ENV !== 'production') {
instance._debugID = shouldHaveDebugID ? getNextDebugID() : 0;
}
// Internal instances should fully constructed at this point, so they should
// not get any new fields added to them at this point.
if (process.env.NODE_ENV !== 'production') {
if (Object.preventExtensions) {
Object.preventExtensions(instance);
}
}
return instance;
}
module.exports = instantiateReactComponent;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 120 */
/*!****************************************************!*\
!*** ./~/react-dom/lib/ReactCompositeComponent.js ***!
\****************************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var _prodInvariant = __webpack_require__(/*! ./reactProdInvariant */ 36),
_assign = __webpack_require__(/*! object-assign */ 5);
var React = __webpack_require__(/*! react/lib/React */ 3);
var ReactComponentEnvironment = __webpack_require__(/*! ./ReactComponentEnvironment */ 116);
var ReactCurrentOwner = __webpack_require__(/*! react/lib/ReactCurrentOwner */ 11);
var ReactErrorUtils = __webpack_require__(/*! ./ReactErrorUtils */ 46);
var ReactInstanceMap = __webpack_require__(/*! ./ReactInstanceMap */ 117);
var ReactInstrumentation = __webpack_require__(/*! ./ReactInstrumentation */ 63);
var ReactNodeTypes = __webpack_require__(/*! ./ReactNodeTypes */ 121);
var ReactReconciler = __webpack_require__(/*! ./ReactReconciler */ 60);
if (process.env.NODE_ENV !== 'production') {
var checkReactTypeSpec = __webpack_require__(/*! ./checkReactTypeSpec */ 122);
}
var emptyObject = __webpack_require__(/*! fbjs/lib/emptyObject */ 21);
var invariant = __webpack_require__(/*! fbjs/lib/invariant */ 9);
var shallowEqual = __webpack_require__(/*! fbjs/lib/shallowEqual */ 124);
var shouldUpdateReactComponent = __webpack_require__(/*! ./shouldUpdateReactComponent */ 125);
var warning = __webpack_require__(/*! fbjs/lib/warning */ 12);
var CompositeTypes = {
ImpureClass: 0,
PureClass: 1,
StatelessFunctional: 2
};
function StatelessComponent(Component) {}
StatelessComponent.prototype.render = function () {
var Component = ReactInstanceMap.get(this)._currentElement.type;
var element = Component(this.props, this.context, this.updater);
warnIfInvalidElement(Component, element);
return element;
};
function warnIfInvalidElement(Component, element) {
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(element === null || element === false || React.isValidElement(element), '%s(...): A valid React element (or null) must be returned. You may have ' + 'returned undefined, an array or some other invalid object.', Component.displayName || Component.name || 'Component') : void 0;
process.env.NODE_ENV !== 'production' ? warning(!Component.childContextTypes, '%s(...): childContextTypes cannot be defined on a functional component.', Component.displayName || Component.name || 'Component') : void 0;
}
}
function shouldConstruct(Component) {
return !!(Component.prototype && Component.prototype.isReactComponent);
}
function isPureComponent(Component) {
return !!(Component.prototype && Component.prototype.isPureReactComponent);
}
// Separated into a function to contain deoptimizations caused by try/finally.
function measureLifeCyclePerf(fn, debugID, timerType) {
if (debugID === 0) {
// Top-level wrappers (see ReactMount) and empty components (see
// ReactDOMEmptyComponent) are invisible to hooks and devtools.
// Both are implementation details that should go away in the future.
return fn();
}
ReactInstrumentation.debugTool.onBeginLifeCycleTimer(debugID, timerType);
try {
return fn();
} finally {
ReactInstrumentation.debugTool.onEndLifeCycleTimer(debugID, timerType);
}
}
/**
* ------------------ The Life-Cycle of a Composite Component ------------------
*
* - constructor: Initialization of state. The instance is now retained.
* - componentWillMount
* - render
* - [children's constructors]
* - [children's componentWillMount and render]
* - [children's componentDidMount]
* - componentDidMount
*
* Update Phases:
* - componentWillReceiveProps (only called if parent updated)
* - shouldComponentUpdate
* - componentWillUpdate
* - render
* - [children's constructors or receive props phases]
* - componentDidUpdate
*
* - componentWillUnmount
* - [children's componentWillUnmount]
* - [children destroyed]
* - (destroyed): The instance is now blank, released by React and ready for GC.
*
* -----------------------------------------------------------------------------
*/
/**
* An incrementing ID assigned to each component when it is mounted. This is
* used to enforce the order in which `ReactUpdates` updates dirty components.
*
* @private
*/
var nextMountID = 1;
/**
* @lends {ReactCompositeComponent.prototype}
*/
var ReactCompositeComponent = {
/**
* Base constructor for all composite component.
*
* @param {ReactElement} element
* @final
* @internal
*/
construct: function (element) {
this._currentElement = element;
this._rootNodeID = 0;
this._compositeType = null;
this._instance = null;
this._hostParent = null;
this._hostContainerInfo = null;
// See ReactUpdateQueue
this._updateBatchNumber = null;
this._pendingElement = null;
this._pendingStateQueue = null;
this._pendingReplaceState = false;
this._pendingForceUpdate = false;
this._renderedNodeType = null;
this._renderedComponent = null;
this._context = null;
this._mountOrder = 0;
this._topLevelWrapper = null;
// See ReactUpdates and ReactUpdateQueue.
this._pendingCallbacks = null;
// ComponentWillUnmount shall only be called once
this._calledComponentWillUnmount = false;
if (process.env.NODE_ENV !== 'production') {
this._warnedAboutRefsInRender = false;
}
},
/**
* Initializes the component, renders markup, and registers event listeners.
*
* @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
* @param {?object} hostParent
* @param {?object} hostContainerInfo
* @param {?object} context
* @return {?string} Rendered markup to be inserted into the DOM.
* @final
* @internal
*/
mountComponent: function (transaction, hostParent, hostContainerInfo, context) {
var _this = this;
this._context = context;
this._mountOrder = nextMountID++;
this._hostParent = hostParent;
this._hostContainerInfo = hostContainerInfo;
var publicProps = this._currentElement.props;
var publicContext = this._processContext(context);
var Component = this._currentElement.type;
var updateQueue = transaction.getUpdateQueue();
// Initialize the public class
var doConstruct = shouldConstruct(Component);
var inst = this._constructComponent(doConstruct, publicProps, publicContext, updateQueue);
var renderedElement;
// Support functional components
if (!doConstruct && (inst == null || inst.render == null)) {
renderedElement = inst;
warnIfInvalidElement(Component, renderedElement);
!(inst === null || inst === false || React.isValidElement(inst)) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s(...): A valid React element (or null) must be returned. You may have returned undefined, an array or some other invalid object.', Component.displayName || Component.name || 'Component') : _prodInvariant('105', Component.displayName || Component.name || 'Component') : void 0;
inst = new StatelessComponent(Component);
this._compositeType = CompositeTypes.StatelessFunctional;
} else {
if (isPureComponent(Component)) {
this._compositeType = CompositeTypes.PureClass;
} else {
this._compositeType = CompositeTypes.ImpureClass;
}
}
if (process.env.NODE_ENV !== 'production') {
// This will throw later in _renderValidatedComponent, but add an early
// warning now to help debugging
if (inst.render == null) {
process.env.NODE_ENV !== 'production' ? warning(false, '%s(...): No `render` method found on the returned component ' + 'instance: you may have forgotten to define `render`.', Component.displayName || Component.name || 'Component') : void 0;
}
var propsMutated = inst.props !== publicProps;
var componentName = Component.displayName || Component.name || 'Component';
process.env.NODE_ENV !== 'production' ? warning(inst.props === undefined || !propsMutated, '%s(...): When calling super() in `%s`, make sure to pass ' + 'up the same props that your component\'s constructor was passed.', componentName, componentName) : void 0;
}
// These should be set up in the constructor, but as a convenience for
// simpler class abstractions, we set them up after the fact.
inst.props = publicProps;
inst.context = publicContext;
inst.refs = emptyObject;
inst.updater = updateQueue;
this._instance = inst;
// Store a reference from the instance back to the internal representation
ReactInstanceMap.set(inst, this);
if (process.env.NODE_ENV !== 'production') {
// Since plain JS classes are defined without any special initialization
// logic, we can not catch common errors early. Therefore, we have to
// catch them here, at initialization time, instead.
process.env.NODE_ENV !== 'production' ? warning(!inst.getInitialState || inst.getInitialState.isReactClassApproved || inst.state, 'getInitialState was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Did you mean to define a state property instead?', this.getName() || 'a component') : void 0;
process.env.NODE_ENV !== 'production' ? warning(!inst.getDefaultProps || inst.getDefaultProps.isReactClassApproved, 'getDefaultProps was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Use a static property to define defaultProps instead.', this.getName() || 'a component') : void 0;
process.env.NODE_ENV !== 'production' ? warning(!inst.propTypes, 'propTypes was defined as an instance property on %s. Use a static ' + 'property to define propTypes instead.', this.getName() || 'a component') : void 0;
process.env.NODE_ENV !== 'production' ? warning(!inst.contextTypes, 'contextTypes was defined as an instance property on %s. Use a ' + 'static property to define contextTypes instead.', this.getName() || 'a component') : void 0;
process.env.NODE_ENV !== 'production' ? warning(typeof inst.componentShouldUpdate !== 'function', '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', this.getName() || 'A component') : void 0;
process.env.NODE_ENV !== 'production' ? warning(typeof inst.componentDidUnmount !== 'function', '%s has a method called ' + 'componentDidUnmount(). But there is no such lifecycle method. ' + 'Did you mean componentWillUnmount()?', this.getName() || 'A component') : void 0;
process.env.NODE_ENV !== 'production' ? warning(typeof inst.componentWillRecieveProps !== 'function', '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', this.getName() || 'A component') : void 0;
}
var initialState = inst.state;
if (initialState === undefined) {
inst.state = initialState = null;
}
!(typeof initialState === 'object' && !Array.isArray(initialState)) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.state: must be set to an object or null', this.getName() || 'ReactCompositeComponent') : _prodInvariant('106', this.getName() || 'ReactCompositeComponent') : void 0;
this._pendingStateQueue = null;
this._pendingReplaceState = false;
this._pendingForceUpdate = false;
var markup;
if (inst.unstable_handleError) {
markup = this.performInitialMountWithErrorHandling(renderedElement, hostParent, hostContainerInfo, transaction, context);
} else {
markup = this.performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context);
}
if (inst.componentDidMount) {
if (process.env.NODE_ENV !== 'production') {
transaction.getReactMountReady().enqueue(function () {
measureLifeCyclePerf(function () {
return inst.componentDidMount();
}, _this._debugID, 'componentDidMount');
});
} else {
transaction.getReactMountReady().enqueue(inst.componentDidMount, inst);
}
}
return markup;
},
_constructComponent: function (doConstruct, publicProps, publicContext, updateQueue) {
if (process.env.NODE_ENV !== 'production') {
ReactCurrentOwner.current = this;
try {
return this._constructComponentWithoutOwner(doConstruct, publicProps, publicContext, updateQueue);
} finally {
ReactCurrentOwner.current = null;
}
} else {
return this._constructComponentWithoutOwner(doConstruct, publicProps, publicContext, updateQueue);
}
},
_constructComponentWithoutOwner: function (doConstruct, publicProps, publicContext, updateQueue) {
var Component = this._currentElement.type;
if (doConstruct) {
if (process.env.NODE_ENV !== 'production') {
return measureLifeCyclePerf(function () {
return new Component(publicProps, publicContext, updateQueue);
}, this._debugID, 'ctor');
} else {
return new Component(publicProps, publicContext, updateQueue);
}
}
// This can still be an instance in case of factory components
// but we'll count this as time spent rendering as the more common case.
if (process.env.NODE_ENV !== 'production') {
return measureLifeCyclePerf(function () {
return Component(publicProps, publicContext, updateQueue);
}, this._debugID, 'render');
} else {
return Component(publicProps, publicContext, updateQueue);
}
},
performInitialMountWithErrorHandling: function (renderedElement, hostParent, hostContainerInfo, transaction, context) {
var markup;
var checkpoint = transaction.checkpoint();
try {
markup = this.performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context);
} catch (e) {
// Roll back to checkpoint, handle error (which may add items to the transaction), and take a new checkpoint
transaction.rollback(checkpoint);
this._instance.unstable_handleError(e);
if (this._pendingStateQueue) {
this._instance.state = this._processPendingState(this._instance.props, this._instance.context);
}
checkpoint = transaction.checkpoint();
this._renderedComponent.unmountComponent(true);
transaction.rollback(checkpoint);
// Try again - we've informed the component about the error, so they can render an error message this time.
// If this throws again, the error will bubble up (and can be caught by a higher error boundary).
markup = this.performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context);
}
return markup;
},
performInitialMount: function (renderedElement, hostParent, hostContainerInfo, transaction, context) {
var inst = this._instance;
var debugID = 0;
if (process.env.NODE_ENV !== 'production') {
debugID = this._debugID;
}
if (inst.componentWillMount) {
if (process.env.NODE_ENV !== 'production') {
measureLifeCyclePerf(function () {
return inst.componentWillMount();
}, debugID, 'componentWillMount');
} else {
inst.componentWillMount();
}
// When mounting, calls to `setState` by `componentWillMount` will set
// `this._pendingStateQueue` without triggering a re-render.
if (this._pendingStateQueue) {
inst.state = this._processPendingState(inst.props, inst.context);
}
}
// If not a stateless component, we now render
if (renderedElement === undefined) {
renderedElement = this._renderValidatedComponent();
}
var nodeType = ReactNodeTypes.getType(renderedElement);
this._renderedNodeType = nodeType;
var child = this._instantiateReactComponent(renderedElement, nodeType !== ReactNodeTypes.EMPTY /* shouldHaveDebugID */
);
this._renderedComponent = child;
var markup = ReactReconciler.mountComponent(child, transaction, hostParent, hostContainerInfo, this._processChildContext(context), debugID);
if (process.env.NODE_ENV !== 'production') {
if (debugID !== 0) {
var childDebugIDs = child._debugID !== 0 ? [child._debugID] : [];
ReactInstrumentation.debugTool.onSetChildren(debugID, childDebugIDs);
}
}
return markup;
},
getHostNode: function () {
return ReactReconciler.getHostNode(this._renderedComponent);
},
/**
* Releases any resources allocated by `mountComponent`.
*
* @final
* @internal
*/
unmountComponent: function (safely) {
if (!this._renderedComponent) {
return;
}
var inst = this._instance;
if (inst.componentWillUnmount && !inst._calledComponentWillUnmount) {
inst._calledComponentWillUnmount = true;
if (safely) {
var name = this.getName() + '.componentWillUnmount()';
ReactErrorUtils.invokeGuardedCallback(name, inst.componentWillUnmount.bind(inst));
} else {
if (process.env.NODE_ENV !== 'production') {
measureLifeCyclePerf(function () {
return inst.componentWillUnmount();
}, this._debugID, 'componentWillUnmount');
} else {
inst.componentWillUnmount();
}
}
}
if (this._renderedComponent) {
ReactReconciler.unmountComponent(this._renderedComponent, safely);
this._renderedNodeType = null;
this._renderedComponent = null;
this._instance = null;
}
// Reset pending fields
// Even if this component is scheduled for another update in ReactUpdates,
// it would still be ignored because these fields are reset.
this._pendingStateQueue = null;
this._pendingReplaceState = false;
this._pendingForceUpdate = false;
this._pendingCallbacks = null;
this._pendingElement = null;
// These fields do not really need to be reset since this object is no
// longer accessible.
this._context = null;
this._rootNodeID = 0;
this._topLevelWrapper = null;
// Delete the reference from the instance to this internal representation
// which allow the internals to be properly cleaned up even if the user
// leaks a reference to the public instance.
ReactInstanceMap.remove(inst);
// Some existing components rely on inst.props even after they've been
// destroyed (in event handlers).
// TODO: inst.props = null;
// TODO: inst.state = null;
// TODO: inst.context = null;
},
/**
* Filters the context object to only contain keys specified in
* `contextTypes`
*
* @param {object} context
* @return {?object}
* @private
*/
_maskContext: function (context) {
var Component = this._currentElement.type;
var contextTypes = Component.contextTypes;
if (!contextTypes) {
return emptyObject;
}
var maskedContext = {};
for (var contextName in contextTypes) {
maskedContext[contextName] = context[contextName];
}
return maskedContext;
},
/**
* Filters the context object to only contain keys specified in
* `contextTypes`, and asserts that they are valid.
*
* @param {object} context
* @return {?object}
* @private
*/
_processContext: function (context) {
var maskedContext = this._maskContext(context);
if (process.env.NODE_ENV !== 'production') {
var Component = this._currentElement.type;
if (Component.contextTypes) {
this._checkContextTypes(Component.contextTypes, maskedContext, 'context');
}
}
return maskedContext;
},
/**
* @param {object} currentContext
* @return {object}
* @private
*/
_processChildContext: function (currentContext) {
var Component = this._currentElement.type;
var inst = this._instance;
var childContext;
if (inst.getChildContext) {
if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onBeginProcessingChildContext();
try {
childContext = inst.getChildContext();
} finally {
ReactInstrumentation.debugTool.onEndProcessingChildContext();
}
} else {
childContext = inst.getChildContext();
}
}
if (childContext) {
!(typeof Component.childContextTypes === 'object') ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().', this.getName() || 'ReactCompositeComponent') : _prodInvariant('107', this.getName() || 'ReactCompositeComponent') : void 0;
if (process.env.NODE_ENV !== 'production') {
this._checkContextTypes(Component.childContextTypes, childContext, 'childContext');
}
for (var name in childContext) {
!(name in Component.childContextTypes) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.getChildContext(): key "%s" is not defined in childContextTypes.', this.getName() || 'ReactCompositeComponent', name) : _prodInvariant('108', this.getName() || 'ReactCompositeComponent', name) : void 0;
}
return _assign({}, currentContext, childContext);
}
return currentContext;
},
/**
* Assert that the context types are valid
*
* @param {object} typeSpecs Map of context field to a ReactPropType
* @param {object} values Runtime values that need to be type-checked
* @param {string} location e.g. "prop", "context", "child context"
* @private
*/
_checkContextTypes: function (typeSpecs, values, location) {
if (process.env.NODE_ENV !== 'production') {
checkReactTypeSpec(typeSpecs, values, location, this.getName(), null, this._debugID);
}
},
receiveComponent: function (nextElement, transaction, nextContext) {
var prevElement = this._currentElement;
var prevContext = this._context;
this._pendingElement = null;
this.updateComponent(transaction, prevElement, nextElement, prevContext, nextContext);
},
/**
* If any of `_pendingElement`, `_pendingStateQueue`, or `_pendingForceUpdate`
* is set, update the component.
*
* @param {ReactReconcileTransaction} transaction
* @internal
*/
performUpdateIfNecessary: function (transaction) {
if (this._pendingElement != null) {
ReactReconciler.receiveComponent(this, this._pendingElement, transaction, this._context);
} else if (this._pendingStateQueue !== null || this._pendingForceUpdate) {
this.updateComponent(transaction, this._currentElement, this._currentElement, this._context, this._context);
} else {
this._updateBatchNumber = null;
}
},
/**
* Perform an update to a mounted component. The componentWillReceiveProps and
* shouldComponentUpdate methods are called, then (assuming the update isn't
* skipped) the remaining update lifecycle methods are called and the DOM
* representation is updated.
*
* By default, this implements React's rendering and reconciliation algorithm.
* Sophisticated clients may wish to override this.
*
* @param {ReactReconcileTransaction} transaction
* @param {ReactElement} prevParentElement
* @param {ReactElement} nextParentElement
* @internal
* @overridable
*/
updateComponent: function (transaction, prevParentElement, nextParentElement, prevUnmaskedContext, nextUnmaskedContext) {
var inst = this._instance;
!(inst != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Attempted to update component `%s` that has already been unmounted (or failed to mount).', this.getName() || 'ReactCompositeComponent') : _prodInvariant('136', this.getName() || 'ReactCompositeComponent') : void 0;
var willReceive = false;
var nextContext;
// Determine if the context has changed or not
if (this._context === nextUnmaskedContext) {
nextContext = inst.context;
} else {
nextContext = this._processContext(nextUnmaskedContext);
willReceive = true;
}
var prevProps = prevParentElement.props;
var nextProps = nextParentElement.props;
// Not a simple state update but a props update
if (prevParentElement !== nextParentElement) {
willReceive = true;
}
// An update here will schedule an update but immediately set
// _pendingStateQueue which will ensure that any state updates gets
// immediately reconciled instead of waiting for the next batch.
if (willReceive && inst.componentWillReceiveProps) {
if (process.env.NODE_ENV !== 'production') {
measureLifeCyclePerf(function () {
return inst.componentWillReceiveProps(nextProps, nextContext);
}, this._debugID, 'componentWillReceiveProps');
} else {
inst.componentWillReceiveProps(nextProps, nextContext);
}
}
var nextState = this._processPendingState(nextProps, nextContext);
var shouldUpdate = true;
if (!this._pendingForceUpdate) {
if (inst.shouldComponentUpdate) {
if (process.env.NODE_ENV !== 'production') {
shouldUpdate = measureLifeCyclePerf(function () {
return inst.shouldComponentUpdate(nextProps, nextState, nextContext);
}, this._debugID, 'shouldComponentUpdate');
} else {
shouldUpdate = inst.shouldComponentUpdate(nextProps, nextState, nextContext);
}
} else {
if (this._compositeType === CompositeTypes.PureClass) {
shouldUpdate = !shallowEqual(prevProps, nextProps) || !shallowEqual(inst.state, nextState);
}
}
}
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(shouldUpdate !== undefined, '%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', this.getName() || 'ReactCompositeComponent') : void 0;
}
this._updateBatchNumber = null;
if (shouldUpdate) {
this._pendingForceUpdate = false;
// Will set `this.props`, `this.state` and `this.context`.
this._performComponentUpdate(nextParentElement, nextProps, nextState, nextContext, transaction, nextUnmaskedContext);
} else {
// If it's determined that a component should not update, we still want
// to set props and state but we shortcut the rest of the update.
this._currentElement = nextParentElement;
this._context = nextUnmaskedContext;
inst.props = nextProps;
inst.state = nextState;
inst.context = nextContext;
}
},
_processPendingState: function (props, context) {
var inst = this._instance;
var queue = this._pendingStateQueue;
var replace = this._pendingReplaceState;
this._pendingReplaceState = false;
this._pendingStateQueue = null;
if (!queue) {
return inst.state;
}
if (replace && queue.length === 1) {
return queue[0];
}
var nextState = _assign({}, replace ? queue[0] : inst.state);
for (var i = replace ? 1 : 0; i < queue.length; i++) {
var partial = queue[i];
_assign(nextState, typeof partial === 'function' ? partial.call(inst, nextState, props, context) : partial);
}
return nextState;
},
/**
* Merges new props and state, notifies delegate methods of update and
* performs update.
*
* @param {ReactElement} nextElement Next element
* @param {object} nextProps Next public object to set as properties.
* @param {?object} nextState Next object to set as state.
* @param {?object} nextContext Next public object to set as context.
* @param {ReactReconcileTransaction} transaction
* @param {?object} unmaskedContext
* @private
*/
_performComponentUpdate: function (nextElement, nextProps, nextState, nextContext, transaction, unmaskedContext) {
var _this2 = this;
var inst = this._instance;
var hasComponentDidUpdate = Boolean(inst.componentDidUpdate);
var prevProps;
var prevState;
var prevContext;
if (hasComponentDidUpdate) {
prevProps = inst.props;
prevState = inst.state;
prevContext = inst.context;
}
if (inst.componentWillUpdate) {
if (process.env.NODE_ENV !== 'production') {
measureLifeCyclePerf(function () {
return inst.componentWillUpdate(nextProps, nextState, nextContext);
}, this._debugID, 'componentWillUpdate');
} else {
inst.componentWillUpdate(nextProps, nextState, nextContext);
}
}
this._currentElement = nextElement;
this._context = unmaskedContext;
inst.props = nextProps;
inst.state = nextState;
inst.context = nextContext;
this._updateRenderedComponent(transaction, unmaskedContext);
if (hasComponentDidUpdate) {
if (process.env.NODE_ENV !== 'production') {
transaction.getReactMountReady().enqueue(function () {
measureLifeCyclePerf(inst.componentDidUpdate.bind(inst, prevProps, prevState, prevContext), _this2._debugID, 'componentDidUpdate');
});
} else {
transaction.getReactMountReady().enqueue(inst.componentDidUpdate.bind(inst, prevProps, prevState, prevContext), inst);
}
}
},
/**
* Call the component's `render` method and update the DOM accordingly.
*
* @param {ReactReconcileTransaction} transaction
* @internal
*/
_updateRenderedComponent: function (transaction, context) {
var prevComponentInstance = this._renderedComponent;
var prevRenderedElement = prevComponentInstance._currentElement;
var nextRenderedElement = this._renderValidatedComponent();
var debugID = 0;
if (process.env.NODE_ENV !== 'production') {
debugID = this._debugID;
}
if (shouldUpdateReactComponent(prevRenderedElement, nextRenderedElement)) {
ReactReconciler.receiveComponent(prevComponentInstance, nextRenderedElement, transaction, this._processChildContext(context));
} else {
var oldHostNode = ReactReconciler.getHostNode(prevComponentInstance);
ReactReconciler.unmountComponent(prevComponentInstance, false);
var nodeType = ReactNodeTypes.getType(nextRenderedElement);
this._renderedNodeType = nodeType;
var child = this._instantiateReactComponent(nextRenderedElement, nodeType !== ReactNodeTypes.EMPTY /* shouldHaveDebugID */
);
this._renderedComponent = child;
var nextMarkup = ReactReconciler.mountComponent(child, transaction, this._hostParent, this._hostContainerInfo, this._processChildContext(context), debugID);
if (process.env.NODE_ENV !== 'production') {
if (debugID !== 0) {
var childDebugIDs = child._debugID !== 0 ? [child._debugID] : [];
ReactInstrumentation.debugTool.onSetChildren(debugID, childDebugIDs);
}
}
this._replaceNodeWithMarkup(oldHostNode, nextMarkup, prevComponentInstance);
}
},
/**
* Overridden in shallow rendering.
*
* @protected
*/
_replaceNodeWithMarkup: function (oldHostNode, nextMarkup, prevInstance) {
ReactComponentEnvironment.replaceNodeWithMarkup(oldHostNode, nextMarkup, prevInstance);
},
/**
* @protected
*/
_renderValidatedComponentWithoutOwnerOrContext: function () {
var inst = this._instance;
var renderedElement;
if (process.env.NODE_ENV !== 'production') {
renderedElement = measureLifeCyclePerf(function () {
return inst.render();
}, this._debugID, 'render');
} else {
renderedElement = inst.render();
}
if (process.env.NODE_ENV !== 'production') {
// We allow auto-mocks to proceed as if they're returning null.
if (renderedElement === undefined && inst.render._isMockFunction) {
// This is probably bad practice. Consider warning here and
// deprecating this convenience.
renderedElement = null;
}
}
return renderedElement;
},
/**
* @private
*/
_renderValidatedComponent: function () {
var renderedElement;
if (process.env.NODE_ENV !== 'production' || this._compositeType !== CompositeTypes.StatelessFunctional) {
ReactCurrentOwner.current = this;
try {
renderedElement = this._renderValidatedComponentWithoutOwnerOrContext();
} finally {
ReactCurrentOwner.current = null;
}
} else {
renderedElement = this._renderValidatedComponentWithoutOwnerOrContext();
}
!(
// TODO: An `isValidNode` function would probably be more appropriate
renderedElement === null || renderedElement === false || React.isValidElement(renderedElement)) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.render(): A valid React element (or null) must be returned. You may have returned undefined, an array or some other invalid object.', this.getName() || 'ReactCompositeComponent') : _prodInvariant('109', this.getName() || 'ReactCompositeComponent') : void 0;
return renderedElement;
},
/**
* Lazily allocates the refs object and stores `component` as `ref`.
*
* @param {string} ref Reference name.
* @param {component} component Component to store as `ref`.
* @final
* @private
*/
attachRef: function (ref, component) {
var inst = this.getPublicInstance();
!(inst != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Stateless function components cannot have refs.') : _prodInvariant('110') : void 0;
var publicComponentInstance = component.getPublicInstance();
if (process.env.NODE_ENV !== 'production') {
var componentName = component && component.getName ? component.getName() : 'a component';
process.env.NODE_ENV !== 'production' ? warning(publicComponentInstance != null || component._compositeType !== CompositeTypes.StatelessFunctional, 'Stateless function components cannot be given refs ' + '(See ref "%s" in %s created by %s). ' + 'Attempts to access this ref will fail.', ref, componentName, this.getName()) : void 0;
}
var refs = inst.refs === emptyObject ? inst.refs = {} : inst.refs;
refs[ref] = publicComponentInstance;
},
/**
* Detaches a reference name.
*
* @param {string} ref Name to dereference.
* @final
* @private
*/
detachRef: function (ref) {
var refs = this.getPublicInstance().refs;
delete refs[ref];
},
/**
* Get a text description of the component that can be used to identify it
* in error messages.
* @return {string} The name or null.
* @internal
*/
getName: function () {
var type = this._currentElement.type;
var constructor = this._instance && this._instance.constructor;
return type.displayName || constructor && constructor.displayName || type.name || constructor && constructor.name || null;
},
/**
* Get the publicly accessible representation of this component - i.e. what
* is exposed by refs and returned by render. Can be null for stateless
* components.
*
* @return {ReactComponent} the public component instance.
* @internal
*/
getPublicInstance: function () {
var inst = this._instance;
if (this._compositeType === CompositeTypes.StatelessFunctional) {
return null;
}
return inst;
},
// Stub
_instantiateReactComponent: null
};
module.exports = ReactCompositeComponent;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 121 */
/*!*******************************************!*\
!*** ./~/react-dom/lib/ReactNodeTypes.js ***!
\*******************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
'use strict';
var _prodInvariant = __webpack_require__(/*! ./reactProdInvariant */ 36);
var React = __webpack_require__(/*! react/lib/React */ 3);
var invariant = __webpack_require__(/*! fbjs/lib/invariant */ 9);
var ReactNodeTypes = {
HOST: 0,
COMPOSITE: 1,
EMPTY: 2,
getType: function (node) {
if (node === null || node === false) {
return ReactNodeTypes.EMPTY;
} else if (React.isValidElement(node)) {
if (typeof node.type === 'function') {
return ReactNodeTypes.COMPOSITE;
} else {
return ReactNodeTypes.HOST;
}
}
true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unexpected node: %s', node) : _prodInvariant('26', node) : void 0;
}
};
module.exports = ReactNodeTypes;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 122 */
/*!***********************************************!*\
!*** ./~/react-dom/lib/checkReactTypeSpec.js ***!
\***********************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var _prodInvariant = __webpack_require__(/*! ./reactProdInvariant */ 36);
var ReactPropTypeLocationNames = __webpack_require__(/*! ./ReactPropTypeLocationNames */ 123);
var ReactPropTypesSecret = __webpack_require__(/*! ./ReactPropTypesSecret */ 111);
var invariant = __webpack_require__(/*! fbjs/lib/invariant */ 9);
var warning = __webpack_require__(/*! fbjs/lib/warning */ 12);
var ReactComponentTreeHook;
if (typeof process !== 'undefined' && process.env && process.env.NODE_ENV === 'test') {
// Temporary hack.
// Inline requires don't work well with Jest:
// https://github.com/facebook/react/issues/7240
// Remove the inline requires when we don't need them anymore:
// https://github.com/facebook/react/pull/7178
ReactComponentTreeHook = __webpack_require__(/*! react/lib/ReactComponentTreeHook */ 27);
}
var loggedTypeFailures = {};
/**
* Assert that the values match with the type specs.
* Error messages are memorized and will only be shown once.
*
* @param {object} typeSpecs Map of name to a ReactPropType
* @param {object} values Runtime values that need to be type-checked
* @param {string} location e.g. "prop", "context", "child context"
* @param {string} componentName Name of the component for error messages.
* @param {?object} element The React element that is being type-checked
* @param {?number} debugID The React component instance that is being type-checked
* @private
*/
function checkReactTypeSpec(typeSpecs, values, location, componentName, element, debugID) {
for (var typeSpecName in typeSpecs) {
if (typeSpecs.hasOwnProperty(typeSpecName)) {
var error;
// Prop type validation may throw. In case they do, we don't want to
// fail the render phase where it didn't fail before. So we log it.
// After these have been cleaned up, we'll let them throw.
try {
// This is intentionally an invariant that gets caught. It's the same
// behavior as without this statement except with a better message.
!(typeof typeSpecs[typeSpecName] === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName) : _prodInvariant('84', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName) : void 0;
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
} catch (ex) {
error = ex;
}
process.env.NODE_ENV !== 'production' ? warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName, typeof error) : void 0;
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
// Only monitor this failure once because there tends to be a lot of the
// same error.
loggedTypeFailures[error.message] = true;
var componentStackInfo = '';
if (process.env.NODE_ENV !== 'production') {
if (!ReactComponentTreeHook) {
ReactComponentTreeHook = __webpack_require__(/*! react/lib/ReactComponentTreeHook */ 27);
}
if (debugID !== null) {
componentStackInfo = ReactComponentTreeHook.getStackAddendumByID(debugID);
} else if (element !== null) {
componentStackInfo = ReactComponentTreeHook.getCurrentStackAddendum(element);
}
}
process.env.NODE_ENV !== 'production' ? warning(false, 'Failed %s type: %s%s', location, error.message, componentStackInfo) : void 0;
}
}
}
}
module.exports = checkReactTypeSpec;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 123 */
/*!*******************************************************!*\
!*** ./~/react-dom/lib/ReactPropTypeLocationNames.js ***!
\*******************************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
'use strict';
var ReactPropTypeLocationNames = {};
if (process.env.NODE_ENV !== 'production') {
ReactPropTypeLocationNames = {
prop: 'prop',
context: 'context',
childContext: 'child context'
};
}
module.exports = ReactPropTypeLocationNames;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 124 */
/*!************************************!*\
!*** ./~/fbjs/lib/shallowEqual.js ***!
\************************************/
/***/ function(module, exports) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @typechecks
*
*/
/*eslint-disable no-self-compare */
'use strict';
var hasOwnProperty = Object.prototype.hasOwnProperty;
/**
* 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
*/
function is(x, y) {
// SameValue algorithm
if (x === y) {
// Steps 1-5, 7-10
// Steps 6.b-6.e: +0 != -0
// Added the nonzero y check to make Flow happy, but it is redundant
return x !== 0 || y !== 0 || 1 / x === 1 / y;
} else {
// Step 6.a: NaN == NaN
return x !== x && y !== y;
}
}
/**
* Performs equality by iterating through keys on an object and returning false
* when any key has values which are not strictly equal between the arguments.
* Returns true when the values of all keys are strictly equal.
*/
function shallowEqual(objA, objB) {
if (is(objA, objB)) {
return true;
}
if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
return false;
}
var keysA = Object.keys(objA);
var keysB = Object.keys(objB);
if (keysA.length !== keysB.length) {
return false;
}
// Test for A's keys different from B.
for (var i = 0; i < keysA.length; i++) {
if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {
return false;
}
}
return true;
}
module.exports = shallowEqual;
/***/ },
/* 125 */
/*!*******************************************************!*\
!*** ./~/react-dom/lib/shouldUpdateReactComponent.js ***!
\*******************************************************/
/***/ function(module, exports) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
/**
* Given a `prevElement` and `nextElement`, determines if the existing
* instance should be updated as opposed to being destroyed or replaced by a new
* instance. Both arguments are elements. This ensures that this logic can
* operate on stateless trees without any backing instance.
*
* @param {?object} prevElement
* @param {?object} nextElement
* @return {boolean} True if the existing instance should be updated.
* @protected
*/
function shouldUpdateReactComponent(prevElement, nextElement) {
var prevEmpty = prevElement === null || prevElement === false;
var nextEmpty = nextElement === null || nextElement === false;
if (prevEmpty || nextEmpty) {
return prevEmpty === nextEmpty;
}
var prevType = typeof prevElement;
var nextType = typeof nextElement;
if (prevType === 'string' || prevType === 'number') {
return nextType === 'string' || nextType === 'number';
} else {
return nextType === 'object' && prevElement.type === nextElement.type && prevElement.key === nextElement.key;
}
}
module.exports = shouldUpdateReactComponent;
/***/ },
/* 126 */
/*!************************************************!*\
!*** ./~/react-dom/lib/ReactEmptyComponent.js ***!
\************************************************/
/***/ function(module, exports) {
/**
* Copyright 2014-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var emptyComponentFactory;
var ReactEmptyComponentInjection = {
injectEmptyComponentFactory: function (factory) {
emptyComponentFactory = factory;
}
};
var ReactEmptyComponent = {
create: function (instantiate) {
return emptyComponentFactory(instantiate);
}
};
ReactEmptyComponent.injection = ReactEmptyComponentInjection;
module.exports = ReactEmptyComponent;
/***/ },
/* 127 */
/*!***********************************************!*\
!*** ./~/react-dom/lib/ReactHostComponent.js ***!
\***********************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2014-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var _prodInvariant = __webpack_require__(/*! ./reactProdInvariant */ 36);
var invariant = __webpack_require__(/*! fbjs/lib/invariant */ 9);
var genericComponentClass = null;
var textComponentClass = null;
var ReactHostComponentInjection = {
// This accepts a class that receives the tag string. This is a catch all
// that can render any kind of tag.
injectGenericComponentClass: function (componentClass) {
genericComponentClass = componentClass;
},
// This accepts a text component class that takes the text string to be
// rendered as props.
injectTextComponentClass: function (componentClass) {
textComponentClass = componentClass;
}
};
/**
* Get a host internal component class for a specific tag.
*
* @param {ReactElement} element The element to create.
* @return {function} The internal class constructor function.
*/
function createInternalComponent(element) {
!genericComponentClass ? process.env.NODE_ENV !== 'production' ? invariant(false, 'There is no registered component for the tag %s', element.type) : _prodInvariant('111', element.type) : void 0;
return new genericComponentClass(element);
}
/**
* @param {ReactText} text
* @return {ReactComponent}
*/
function createInstanceForText(text) {
return new textComponentClass(text);
}
/**
* @param {ReactComponent} component
* @return {boolean}
*/
function isTextComponent(component) {
return component instanceof textComponentClass;
}
var ReactHostComponent = {
createInternalComponent: createInternalComponent,
createInstanceForText: createInstanceForText,
isTextComponent: isTextComponent,
injection: ReactHostComponentInjection
};
module.exports = ReactHostComponent;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 128 */
/*!*******************************************!*\
!*** ./~/react-dom/lib/getNextDebugID.js ***!
\*******************************************/
/***/ function(module, exports) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
'use strict';
var nextDebugID = 1;
function getNextDebugID() {
return nextDebugID++;
}
module.exports = getNextDebugID;
/***/ },
/* 129 */
/*!*******************************************!*\
!*** ./~/react-dom/lib/KeyEscapeUtils.js ***!
\*******************************************/
/***/ function(module, exports) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
'use strict';
/**
* Escape and wrap key so it is safe to use as a reactid
*
* @param {string} key to be escaped.
* @return {string} the escaped key.
*/
function escape(key) {
var escapeRegex = /[=:]/g;
var escaperLookup = {
'=': '=0',
':': '=2'
};
var escapedString = ('' + key).replace(escapeRegex, function (match) {
return escaperLookup[match];
});
return '$' + escapedString;
}
/**
* Unescape and unwrap key for human-readable display
*
* @param {string} key to unescape.
* @return {string} the unescaped key.
*/
function unescape(key) {
var unescapeRegex = /(=0|=2)/g;
var unescaperLookup = {
'=0': '=',
'=2': ':'
};
var keySubstring = key[0] === '.' && key[1] === '$' ? key.substring(2) : key.substring(1);
return ('' + keySubstring).replace(unescapeRegex, function (match) {
return unescaperLookup[match];
});
}
var KeyEscapeUtils = {
escape: escape,
unescape: unescape
};
module.exports = KeyEscapeUtils;
/***/ },
/* 130 */
/*!************************************************!*\
!*** ./~/react-dom/lib/traverseAllChildren.js ***!
\************************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var _prodInvariant = __webpack_require__(/*! ./reactProdInvariant */ 36);
var ReactCurrentOwner = __webpack_require__(/*! react/lib/ReactCurrentOwner */ 11);
var REACT_ELEMENT_TYPE = __webpack_require__(/*! ./ReactElementSymbol */ 131);
var getIteratorFn = __webpack_require__(/*! ./getIteratorFn */ 132);
var invariant = __webpack_require__(/*! fbjs/lib/invariant */ 9);
var KeyEscapeUtils = __webpack_require__(/*! ./KeyEscapeUtils */ 129);
var warning = __webpack_require__(/*! fbjs/lib/warning */ 12);
var SEPARATOR = '.';
var SUBSEPARATOR = ':';
/**
* This is inlined from ReactElement since this file is shared between
* isomorphic and renderers. We could extract this to a
*
*/
/**
* TODO: Test that a single child and an array with one item have the same key
* pattern.
*/
var didWarnAboutMaps = false;
/**
* Generate a key string that identifies a component within a set.
*
* @param {*} component A component that could contain a manual key.
* @param {number} index Index that is used if a manual key is not provided.
* @return {string}
*/
function getComponentKey(component, index) {
// Do some typechecking here since we call this blindly. We want to ensure
// that we don't block potential future ES APIs.
if (component && typeof component === 'object' && component.key != null) {
// Explicit key
return KeyEscapeUtils.escape(component.key);
}
// Implicit key determined by the index in the set
return index.toString(36);
}
/**
* @param {?*} children Children tree container.
* @param {!string} nameSoFar Name of the key path so far.
* @param {!function} callback Callback to invoke with each child found.
* @param {?*} traverseContext Used to pass information throughout the traversal
* process.
* @return {!number} The number of children in this subtree.
*/
function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
var type = typeof children;
if (type === 'undefined' || type === 'boolean') {
// All of the above are perceived as null.
children = null;
}
if (children === null || type === 'string' || type === 'number' ||
// The following is inlined from ReactElement. This means we can optimize
// some checks. React Fiber also inlines this logic for similar purposes.
type === 'object' && children.$$typeof === REACT_ELEMENT_TYPE) {
callback(traverseContext, children,
// If it's the only child, treat the name as if it was wrapped in an array
// so that it's consistent if the number of children grows.
nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);
return 1;
}
var child;
var nextName;
var subtreeCount = 0; // Count of children found in the current subtree.
var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
if (Array.isArray(children)) {
for (var i = 0; i < children.length; i++) {
child = children[i];
nextName = nextNamePrefix + getComponentKey(child, i);
subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
}
} else {
var iteratorFn = getIteratorFn(children);
if (iteratorFn) {
var iterator = iteratorFn.call(children);
var step;
if (iteratorFn !== children.entries) {
var ii = 0;
while (!(step = iterator.next()).done) {
child = step.value;
nextName = nextNamePrefix + getComponentKey(child, ii++);
subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
}
} else {
if (process.env.NODE_ENV !== 'production') {
var mapsAsChildrenAddendum = '';
if (ReactCurrentOwner.current) {
var mapsAsChildrenOwnerName = ReactCurrentOwner.current.getName();
if (mapsAsChildrenOwnerName) {
mapsAsChildrenAddendum = ' Check the render method of `' + mapsAsChildrenOwnerName + '`.';
}
}
process.env.NODE_ENV !== 'production' ? warning(didWarnAboutMaps, 'Using Maps as children is not yet fully supported. It is an ' + 'experimental feature that might be removed. Convert it to a ' + 'sequence / iterable of keyed ReactElements instead.%s', mapsAsChildrenAddendum) : void 0;
didWarnAboutMaps = true;
}
// Iterator will provide entry [k,v] tuples rather than values.
while (!(step = iterator.next()).done) {
var entry = step.value;
if (entry) {
child = entry[1];
nextName = nextNamePrefix + KeyEscapeUtils.escape(entry[0]) + SUBSEPARATOR + getComponentKey(child, 0);
subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
}
}
}
} else if (type === 'object') {
var addendum = '';
if (process.env.NODE_ENV !== 'production') {
addendum = ' If you meant to render a collection of children, use an array ' + 'instead or wrap the object using createFragment(object) from the ' + 'React add-ons.';
if (children._isReactElement) {
addendum = ' It looks like you\'re using an element created by a different ' + 'version of React. Make sure to use only one copy of React.';
}
if (ReactCurrentOwner.current) {
var name = ReactCurrentOwner.current.getName();
if (name) {
addendum += ' Check the render method of `' + name + '`.';
}
}
}
var childrenString = String(children);
true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Objects are not valid as a React child (found: %s).%s', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : _prodInvariant('31', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : void 0;
}
}
return subtreeCount;
}
/**
* Traverses children that are typically specified as `props.children`, but
* might also be specified through attributes:
*
* - `traverseAllChildren(this.props.children, ...)`
* - `traverseAllChildren(this.props.leftPanelChildren, ...)`
*
* The `traverseContext` is an optional argument that is passed through the
* entire traversal. It can be used to store accumulations or anything else that
* the callback might find relevant.
*
* @param {?*} children Children tree object.
* @param {!function} callback To invoke upon traversing each child.
* @param {?*} traverseContext Context for traversal.
* @return {!number} The number of children in this subtree.
*/
function traverseAllChildren(children, callback, traverseContext) {
if (children == null) {
return 0;
}
return traverseAllChildrenImpl(children, '', callback, traverseContext);
}
module.exports = traverseAllChildren;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 131 */
/*!***********************************************!*\
!*** ./~/react-dom/lib/ReactElementSymbol.js ***!
\***********************************************/
/***/ function(module, exports) {
/**
* Copyright 2014-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
'use strict';
// The Symbol used to tag the ReactElement type. If there is no native Symbol
// nor polyfill, then a plain number is used for performance.
var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7;
module.exports = REACT_ELEMENT_TYPE;
/***/ },
/* 132 */
/*!******************************************!*\
!*** ./~/react-dom/lib/getIteratorFn.js ***!
\******************************************/
/***/ function(module, exports) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
'use strict';
/* global Symbol */
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
/**
* Returns the iterator method function contained on the iterable object.
*
* Be sure to invoke the function with the iterable as context:
*
* var iteratorFn = getIteratorFn(myIterable);
* if (iteratorFn) {
* var iterator = iteratorFn.call(myIterable);
* ...
* }
*
* @param {?object} maybeIterable
* @return {?function}
*/
function getIteratorFn(maybeIterable) {
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
if (typeof iteratorFn === 'function') {
return iteratorFn;
}
}
module.exports = getIteratorFn;
/***/ },
/* 133 */
/*!********************************************!*\
!*** ./~/react-dom/lib/flattenChildren.js ***!
\********************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
'use strict';
var KeyEscapeUtils = __webpack_require__(/*! ./KeyEscapeUtils */ 129);
var traverseAllChildren = __webpack_require__(/*! ./traverseAllChildren */ 130);
var warning = __webpack_require__(/*! fbjs/lib/warning */ 12);
var ReactComponentTreeHook;
if (typeof process !== 'undefined' && process.env && process.env.NODE_ENV === 'test') {
// Temporary hack.
// Inline requires don't work well with Jest:
// https://github.com/facebook/react/issues/7240
// Remove the inline requires when we don't need them anymore:
// https://github.com/facebook/react/pull/7178
ReactComponentTreeHook = __webpack_require__(/*! react/lib/ReactComponentTreeHook */ 27);
}
/**
* @param {function} traverseContext Context passed through traversal.
* @param {?ReactComponent} child React child component.
* @param {!string} name String name of key path to child.
* @param {number=} selfDebugID Optional debugID of the current internal instance.
*/
function flattenSingleChildIntoContext(traverseContext, child, name, selfDebugID) {
// We found a component instance.
if (traverseContext && typeof traverseContext === 'object') {
var result = traverseContext;
var keyUnique = result[name] === undefined;
if (process.env.NODE_ENV !== 'production') {
if (!ReactComponentTreeHook) {
ReactComponentTreeHook = __webpack_require__(/*! react/lib/ReactComponentTreeHook */ 27);
}
if (!keyUnique) {
process.env.NODE_ENV !== 'production' ? warning(false, 'flattenChildren(...): Encountered two children with the same key, ' + '`%s`. Child keys must be unique; when two children share a key, only ' + 'the first child will be used.%s', KeyEscapeUtils.unescape(name), ReactComponentTreeHook.getStackAddendumByID(selfDebugID)) : void 0;
}
}
if (keyUnique && child != null) {
result[name] = child;
}
}
}
/**
* Flattens children that are typically specified as `props.children`. Any null
* children will not be included in the resulting object.
* @return {!object} flattened children keyed by name.
*/
function flattenChildren(children, selfDebugID) {
if (children == null) {
return children;
}
var result = {};
if (process.env.NODE_ENV !== 'production') {
traverseAllChildren(children, function (traverseContext, child, name) {
return flattenSingleChildIntoContext(traverseContext, child, name, selfDebugID);
}, result);
} else {
traverseAllChildren(children, flattenSingleChildIntoContext, result);
}
return result;
}
module.exports = flattenChildren;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 134 */
/*!************************************************************!*\
!*** ./~/react-dom/lib/ReactServerRenderingTransaction.js ***!
\************************************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2014-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var _assign = __webpack_require__(/*! object-assign */ 5);
var PooledClass = __webpack_require__(/*! ./PooledClass */ 51);
var Transaction = __webpack_require__(/*! ./Transaction */ 69);
var ReactInstrumentation = __webpack_require__(/*! ./ReactInstrumentation */ 63);
var ReactServerUpdateQueue = __webpack_require__(/*! ./ReactServerUpdateQueue */ 135);
/**
* Executed within the scope of the `Transaction` instance. Consider these as
* being member methods, but with an implied ordering while being isolated from
* each other.
*/
var TRANSACTION_WRAPPERS = [];
if (process.env.NODE_ENV !== 'production') {
TRANSACTION_WRAPPERS.push({
initialize: ReactInstrumentation.debugTool.onBeginFlush,
close: ReactInstrumentation.debugTool.onEndFlush
});
}
var noopCallbackQueue = {
enqueue: function () {}
};
/**
* @class ReactServerRenderingTransaction
* @param {boolean} renderToStaticMarkup
*/
function ReactServerRenderingTransaction(renderToStaticMarkup) {
this.reinitializeTransaction();
this.renderToStaticMarkup = renderToStaticMarkup;
this.useCreateElement = false;
this.updateQueue = new ReactServerUpdateQueue(this);
}
var Mixin = {
/**
* @see Transaction
* @abstract
* @final
* @return {array} Empty list of operation wrap procedures.
*/
getTransactionWrappers: function () {
return TRANSACTION_WRAPPERS;
},
/**
* @return {object} The queue to collect `onDOMReady` callbacks with.
*/
getReactMountReady: function () {
return noopCallbackQueue;
},
/**
* @return {object} The queue to collect React async events.
*/
getUpdateQueue: function () {
return this.updateQueue;
},
/**
* `PooledClass` looks for this, and will invoke this before allowing this
* instance to be reused.
*/
destructor: function () {},
checkpoint: function () {},
rollback: function () {}
};
_assign(ReactServerRenderingTransaction.prototype, Transaction, Mixin);
PooledClass.addPoolingTo(ReactServerRenderingTransaction);
module.exports = ReactServerRenderingTransaction;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 135 */
/*!***************************************************!*\
!*** ./~/react-dom/lib/ReactServerUpdateQueue.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
'use strict';
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var ReactUpdateQueue = __webpack_require__(/*! ./ReactUpdateQueue */ 136);
var warning = __webpack_require__(/*! fbjs/lib/warning */ 12);
function warnNoop(publicInstance, callerName) {
if (process.env.NODE_ENV !== 'production') {
var constructor = publicInstance.constructor;
process.env.NODE_ENV !== 'production' ? warning(false, '%s(...): Can only update a mounting component. ' + 'This usually means you called %s() outside componentWillMount() on the server. ' + 'This is a no-op. Please check the code for the %s component.', callerName, callerName, constructor && (constructor.displayName || constructor.name) || 'ReactClass') : void 0;
}
}
/**
* This is the update queue used for server rendering.
* It delegates to ReactUpdateQueue while server rendering is in progress and
* switches to ReactNoopUpdateQueue after the transaction has completed.
* @class ReactServerUpdateQueue
* @param {Transaction} transaction
*/
var ReactServerUpdateQueue = function () {
function ReactServerUpdateQueue(transaction) {
_classCallCheck(this, ReactServerUpdateQueue);
this.transaction = transaction;
}
/**
* Checks whether or not this composite component is mounted.
* @param {ReactClass} publicInstance The instance we want to test.
* @return {boolean} True if mounted, false otherwise.
* @protected
* @final
*/
ReactServerUpdateQueue.prototype.isMounted = function isMounted(publicInstance) {
return false;
};
/**
* Enqueue a callback that will be executed after all the pending updates
* have processed.
*
* @param {ReactClass} publicInstance The instance to use as `this` context.
* @param {?function} callback Called after state is updated.
* @internal
*/
ReactServerUpdateQueue.prototype.enqueueCallback = function enqueueCallback(publicInstance, callback, callerName) {
if (this.transaction.isInTransaction()) {
ReactUpdateQueue.enqueueCallback(publicInstance, callback, callerName);
}
};
/**
* Forces an update. This should only be invoked when it is known with
* certainty that we are **not** in a DOM transaction.
*
* You may want to call this when you know that some deeper aspect of the
* component's state has changed but `setState` was not called.
*
* This will not invoke `shouldComponentUpdate`, but it will invoke
* `componentWillUpdate` and `componentDidUpdate`.
*
* @param {ReactClass} publicInstance The instance that should rerender.
* @internal
*/
ReactServerUpdateQueue.prototype.enqueueForceUpdate = function enqueueForceUpdate(publicInstance) {
if (this.transaction.isInTransaction()) {
ReactUpdateQueue.enqueueForceUpdate(publicInstance);
} else {
warnNoop(publicInstance, 'forceUpdate');
}
};
/**
* Replaces all of the state. Always use this or `setState` to mutate state.
* You should treat `this.state` as immutable.
*
* There is no guarantee that `this.state` will be immediately updated, so
* accessing `this.state` after calling this method may return the old value.
*
* @param {ReactClass} publicInstance The instance that should rerender.
* @param {object|function} completeState Next state.
* @internal
*/
ReactServerUpdateQueue.prototype.enqueueReplaceState = function enqueueReplaceState(publicInstance, completeState) {
if (this.transaction.isInTransaction()) {
ReactUpdateQueue.enqueueReplaceState(publicInstance, completeState);
} else {
warnNoop(publicInstance, 'replaceState');
}
};
/**
* Sets a subset of the state. This only exists because _pendingState is
* internal. This provides a merging strategy that is not available to deep
* properties which is confusing. TODO: Expose pendingState or don't use it
* during the merge.
*
* @param {ReactClass} publicInstance The instance that should rerender.
* @param {object|function} partialState Next partial state to be merged with state.
* @internal
*/
ReactServerUpdateQueue.prototype.enqueueSetState = function enqueueSetState(publicInstance, partialState) {
if (this.transaction.isInTransaction()) {
ReactUpdateQueue.enqueueSetState(publicInstance, partialState);
} else {
warnNoop(publicInstance, 'setState');
}
};
return ReactServerUpdateQueue;
}();
module.exports = ReactServerUpdateQueue;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 136 */
/*!*********************************************!*\
!*** ./~/react-dom/lib/ReactUpdateQueue.js ***!
\*********************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var _prodInvariant = __webpack_require__(/*! ./reactProdInvariant */ 36);
var ReactCurrentOwner = __webpack_require__(/*! react/lib/ReactCurrentOwner */ 11);
var ReactInstanceMap = __webpack_require__(/*! ./ReactInstanceMap */ 117);
var ReactInstrumentation = __webpack_require__(/*! ./ReactInstrumentation */ 63);
var ReactUpdates = __webpack_require__(/*! ./ReactUpdates */ 57);
var invariant = __webpack_require__(/*! fbjs/lib/invariant */ 9);
var warning = __webpack_require__(/*! fbjs/lib/warning */ 12);
function enqueueUpdate(internalInstance) {
ReactUpdates.enqueueUpdate(internalInstance);
}
function formatUnexpectedArgument(arg) {
var type = typeof arg;
if (type !== 'object') {
return type;
}
var displayName = arg.constructor && arg.constructor.name || type;
var keys = Object.keys(arg);
if (keys.length > 0 && keys.length < 20) {
return displayName + ' (keys: ' + keys.join(', ') + ')';
}
return displayName;
}
function getInternalInstanceReadyForUpdate(publicInstance, callerName) {
var internalInstance = ReactInstanceMap.get(publicInstance);
if (!internalInstance) {
if (process.env.NODE_ENV !== 'production') {
var ctor = publicInstance.constructor;
// Only warn when we have a callerName. Otherwise we should be silent.
// We're probably calling from enqueueCallback. We don't want to warn
// there because we already warned for the corresponding lifecycle method.
process.env.NODE_ENV !== 'production' ? warning(!callerName, '%s(...): Can only update a mounted or mounting component. ' + 'This usually means you called %s() on an unmounted component. ' + 'This is a no-op. Please check the code for the %s component.', callerName, callerName, ctor && (ctor.displayName || ctor.name) || 'ReactClass') : void 0;
}
return null;
}
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(ReactCurrentOwner.current == null, '%s(...): Cannot update during an existing state transition (such as ' + 'within `render` or another component\'s constructor). Render methods ' + 'should be a pure function of props and state; constructor ' + 'side-effects are an anti-pattern, but can be moved to ' + '`componentWillMount`.', callerName) : void 0;
}
return internalInstance;
}
/**
* ReactUpdateQueue allows for state updates to be scheduled into a later
* reconciliation step.
*/
var ReactUpdateQueue = {
/**
* Checks whether or not this composite component is mounted.
* @param {ReactClass} publicInstance The instance we want to test.
* @return {boolean} True if mounted, false otherwise.
* @protected
* @final
*/
isMounted: function (publicInstance) {
if (process.env.NODE_ENV !== 'production') {
var owner = ReactCurrentOwner.current;
if (owner !== null) {
process.env.NODE_ENV !== 'production' ? warning(owner._warnedAboutRefsInRender, '%s is accessing isMounted inside its render() function. ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', owner.getName() || 'A component') : void 0;
owner._warnedAboutRefsInRender = true;
}
}
var internalInstance = ReactInstanceMap.get(publicInstance);
if (internalInstance) {
// During componentWillMount and render this will still be null but after
// that will always render to something. At least for now. So we can use
// this hack.
return !!internalInstance._renderedComponent;
} else {
return false;
}
},
/**
* Enqueue a callback that will be executed after all the pending updates
* have processed.
*
* @param {ReactClass} publicInstance The instance to use as `this` context.
* @param {?function} callback Called after state is updated.
* @param {string} callerName Name of the calling function in the public API.
* @internal
*/
enqueueCallback: function (publicInstance, callback, callerName) {
ReactUpdateQueue.validateCallback(callback, callerName);
var internalInstance = getInternalInstanceReadyForUpdate(publicInstance);
// Previously we would throw an error if we didn't have an internal
// instance. Since we want to make it a no-op instead, we mirror the same
// behavior we have in other enqueue* methods.
// We also need to ignore callbacks in componentWillMount. See
// enqueueUpdates.
if (!internalInstance) {
return null;
}
if (internalInstance._pendingCallbacks) {
internalInstance._pendingCallbacks.push(callback);
} else {
internalInstance._pendingCallbacks = [callback];
}
// TODO: The callback here is ignored when setState is called from
// componentWillMount. Either fix it or disallow doing so completely in
// favor of getInitialState. Alternatively, we can disallow
// componentWillMount during server-side rendering.
enqueueUpdate(internalInstance);
},
enqueueCallbackInternal: function (internalInstance, callback) {
if (internalInstance._pendingCallbacks) {
internalInstance._pendingCallbacks.push(callback);
} else {
internalInstance._pendingCallbacks = [callback];
}
enqueueUpdate(internalInstance);
},
/**
* Forces an update. This should only be invoked when it is known with
* certainty that we are **not** in a DOM transaction.
*
* You may want to call this when you know that some deeper aspect of the
* component's state has changed but `setState` was not called.
*
* This will not invoke `shouldComponentUpdate`, but it will invoke
* `componentWillUpdate` and `componentDidUpdate`.
*
* @param {ReactClass} publicInstance The instance that should rerender.
* @internal
*/
enqueueForceUpdate: function (publicInstance) {
var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'forceUpdate');
if (!internalInstance) {
return;
}
internalInstance._pendingForceUpdate = true;
enqueueUpdate(internalInstance);
},
/**
* Replaces all of the state. Always use this or `setState` to mutate state.
* You should treat `this.state` as immutable.
*
* There is no guarantee that `this.state` will be immediately updated, so
* accessing `this.state` after calling this method may return the old value.
*
* @param {ReactClass} publicInstance The instance that should rerender.
* @param {object} completeState Next state.
* @internal
*/
enqueueReplaceState: function (publicInstance, completeState) {
var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'replaceState');
if (!internalInstance) {
return;
}
internalInstance._pendingStateQueue = [completeState];
internalInstance._pendingReplaceState = true;
enqueueUpdate(internalInstance);
},
/**
* Sets a subset of the state. This only exists because _pendingState is
* internal. This provides a merging strategy that is not available to deep
* properties which is confusing. TODO: Expose pendingState or don't use it
* during the merge.
*
* @param {ReactClass} publicInstance The instance that should rerender.
* @param {object} partialState Next partial state to be merged with state.
* @internal
*/
enqueueSetState: function (publicInstance, partialState) {
if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onSetState();
process.env.NODE_ENV !== 'production' ? warning(partialState != null, 'setState(...): You passed an undefined or null state object; ' + 'instead, use forceUpdate().') : void 0;
}
var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'setState');
if (!internalInstance) {
return;
}
var queue = internalInstance._pendingStateQueue || (internalInstance._pendingStateQueue = []);
queue.push(partialState);
enqueueUpdate(internalInstance);
},
enqueueElementInternal: function (internalInstance, nextElement, nextContext) {
internalInstance._pendingElement = nextElement;
// TODO: introduce _pendingContext instead of setting it directly.
internalInstance._context = nextContext;
enqueueUpdate(internalInstance);
},
validateCallback: function (callback, callerName) {
!(!callback || typeof callback === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.', callerName, formatUnexpectedArgument(callback)) : _prodInvariant('122', callerName, formatUnexpectedArgument(callback)) : void 0;
}
};
module.exports = ReactUpdateQueue;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 137 */
/*!***********************************************!*\
!*** ./~/react-dom/lib/validateDOMNesting.js ***!
\***********************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var _assign = __webpack_require__(/*! object-assign */ 5);
var emptyFunction = __webpack_require__(/*! fbjs/lib/emptyFunction */ 13);
var warning = __webpack_require__(/*! fbjs/lib/warning */ 12);
var validateDOMNesting = emptyFunction;
if (process.env.NODE_ENV !== 'production') {
// This validation code was written based on the HTML5 parsing spec:
// https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope
//
// Note: this does not catch all invalid nesting, nor does it try to (as it's
// not clear what practical benefit doing so provides); instead, we warn only
// for cases where the parser will give a parse tree differing from what React
// intended. For example, <b><div></div></b> is invalid but we don't warn
// because it still parses correctly; we do warn for other cases like nested
// <p> tags where the beginning of the second element implicitly closes the
// first, causing a confusing mess.
// https://html.spec.whatwg.org/multipage/syntax.html#special
var specialTags = ['address', 'applet', 'area', 'article', 'aside', 'base', 'basefont', 'bgsound', 'blockquote', 'body', 'br', 'button', 'caption', 'center', 'col', 'colgroup', 'dd', 'details', 'dir', 'div', 'dl', 'dt', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'iframe', 'img', 'input', 'isindex', 'li', 'link', 'listing', 'main', 'marquee', 'menu', 'menuitem', 'meta', 'nav', 'noembed', 'noframes', 'noscript', 'object', 'ol', 'p', 'param', 'plaintext', 'pre', 'script', 'section', 'select', 'source', 'style', 'summary', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'title', 'tr', 'track', 'ul', 'wbr', 'xmp'];
// https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope
var inScopeTags = ['applet', 'caption', 'html', 'table', 'td', 'th', 'marquee', 'object', 'template',
// https://html.spec.whatwg.org/multipage/syntax.html#html-integration-point
// TODO: Distinguish by namespace here -- for <title>, including it here
// errs on the side of fewer warnings
'foreignObject', 'desc', 'title'];
// https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-button-scope
var buttonScopeTags = inScopeTags.concat(['button']);
// https://html.spec.whatwg.org/multipage/syntax.html#generate-implied-end-tags
var impliedEndTags = ['dd', 'dt', 'li', 'option', 'optgroup', 'p', 'rp', 'rt'];
var emptyAncestorInfo = {
current: null,
formTag: null,
aTagInScope: null,
buttonTagInScope: null,
nobrTagInScope: null,
pTagInButtonScope: null,
listItemTagAutoclosing: null,
dlItemTagAutoclosing: null
};
var updatedAncestorInfo = function (oldInfo, tag, instance) {
var ancestorInfo = _assign({}, oldInfo || emptyAncestorInfo);
var info = { tag: tag, instance: instance };
if (inScopeTags.indexOf(tag) !== -1) {
ancestorInfo.aTagInScope = null;
ancestorInfo.buttonTagInScope = null;
ancestorInfo.nobrTagInScope = null;
}
if (buttonScopeTags.indexOf(tag) !== -1) {
ancestorInfo.pTagInButtonScope = null;
}
// See rules for 'li', 'dd', 'dt' start tags in
// https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody
if (specialTags.indexOf(tag) !== -1 && tag !== 'address' && tag !== 'div' && tag !== 'p') {
ancestorInfo.listItemTagAutoclosing = null;
ancestorInfo.dlItemTagAutoclosing = null;
}
ancestorInfo.current = info;
if (tag === 'form') {
ancestorInfo.formTag = info;
}
if (tag === 'a') {
ancestorInfo.aTagInScope = info;
}
if (tag === 'button') {
ancestorInfo.buttonTagInScope = info;
}
if (tag === 'nobr') {
ancestorInfo.nobrTagInScope = info;
}
if (tag === 'p') {
ancestorInfo.pTagInButtonScope = info;
}
if (tag === 'li') {
ancestorInfo.listItemTagAutoclosing = info;
}
if (tag === 'dd' || tag === 'dt') {
ancestorInfo.dlItemTagAutoclosing = info;
}
return ancestorInfo;
};
/**
* Returns whether
*/
var isTagValidWithParent = function (tag, parentTag) {
// First, let's check if we're in an unusual parsing mode...
switch (parentTag) {
// https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inselect
case 'select':
return tag === 'option' || tag === 'optgroup' || tag === '#text';
case 'optgroup':
return tag === 'option' || tag === '#text';
// Strictly speaking, seeing an <option> doesn't mean we're in a <select>
// but
case 'option':
return tag === '#text';
// https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intd
// https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incaption
// No special behavior since these rules fall back to "in body" mode for
// all except special table nodes which cause bad parsing behavior anyway.
// https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intr
case 'tr':
return tag === 'th' || tag === 'td' || tag === 'style' || tag === 'script' || tag === 'template';
// https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intbody
case 'tbody':
case 'thead':
case 'tfoot':
return tag === 'tr' || tag === 'style' || tag === 'script' || tag === 'template';
// https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incolgroup
case 'colgroup':
return tag === 'col' || tag === 'template';
// https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intable
case 'table':
return tag === 'caption' || tag === 'colgroup' || tag === 'tbody' || tag === 'tfoot' || tag === 'thead' || tag === 'style' || tag === 'script' || tag === 'template';
// https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inhead
case 'head':
return tag === 'base' || tag === 'basefont' || tag === 'bgsound' || tag === 'link' || tag === 'meta' || tag === 'title' || tag === 'noscript' || tag === 'noframes' || tag === 'style' || tag === 'script' || tag === 'template';
// https://html.spec.whatwg.org/multipage/semantics.html#the-html-element
case 'html':
return tag === 'head' || tag === 'body';
case '#document':
return tag === 'html';
}
// Probably in the "in body" parsing mode, so we outlaw only tag combos
// where the parsing rules cause implicit opens or closes to be added.
// https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody
switch (tag) {
case 'h1':
case 'h2':
case 'h3':
case 'h4':
case 'h5':
case 'h6':
return parentTag !== 'h1' && parentTag !== 'h2' && parentTag !== 'h3' && parentTag !== 'h4' && parentTag !== 'h5' && parentTag !== 'h6';
case 'rp':
case 'rt':
return impliedEndTags.indexOf(parentTag) === -1;
case 'body':
case 'caption':
case 'col':
case 'colgroup':
case 'frame':
case 'head':
case 'html':
case 'tbody':
case 'td':
case 'tfoot':
case 'th':
case 'thead':
case 'tr':
// These tags are only valid with a few parents that have special child
// parsing rules -- if we're down here, then none of those matched and
// so we allow it only if we don't know what the parent is, as all other
// cases are invalid.
return parentTag == null;
}
return true;
};
/**
* Returns whether
*/
var findInvalidAncestorForTag = function (tag, ancestorInfo) {
switch (tag) {
case 'address':
case 'article':
case 'aside':
case 'blockquote':
case 'center':
case 'details':
case 'dialog':
case 'dir':
case 'div':
case 'dl':
case 'fieldset':
case 'figcaption':
case 'figure':
case 'footer':
case 'header':
case 'hgroup':
case 'main':
case 'menu':
case 'nav':
case 'ol':
case 'p':
case 'section':
case 'summary':
case 'ul':
case 'pre':
case 'listing':
case 'table':
case 'hr':
case 'xmp':
case 'h1':
case 'h2':
case 'h3':
case 'h4':
case 'h5':
case 'h6':
return ancestorInfo.pTagInButtonScope;
case 'form':
return ancestorInfo.formTag || ancestorInfo.pTagInButtonScope;
case 'li':
return ancestorInfo.listItemTagAutoclosing;
case 'dd':
case 'dt':
return ancestorInfo.dlItemTagAutoclosing;
case 'button':
return ancestorInfo.buttonTagInScope;
case 'a':
// Spec says something about storing a list of markers, but it sounds
// equivalent to this check.
return ancestorInfo.aTagInScope;
case 'nobr':
return ancestorInfo.nobrTagInScope;
}
return null;
};
/**
* Given a ReactCompositeComponent instance, return a list of its recursive
* owners, starting at the root and ending with the instance itself.
*/
var findOwnerStack = function (instance) {
if (!instance) {
return [];
}
var stack = [];
do {
stack.push(instance);
} while (instance = instance._currentElement._owner);
stack.reverse();
return stack;
};
var didWarn = {};
validateDOMNesting = function (childTag, childText, childInstance, ancestorInfo) {
ancestorInfo = ancestorInfo || emptyAncestorInfo;
var parentInfo = ancestorInfo.current;
var parentTag = parentInfo && parentInfo.tag;
if (childText != null) {
process.env.NODE_ENV !== 'production' ? warning(childTag == null, 'validateDOMNesting: when childText is passed, childTag should be null') : void 0;
childTag = '#text';
}
var invalidParent = isTagValidWithParent(childTag, parentTag) ? null : parentInfo;
var invalidAncestor = invalidParent ? null : findInvalidAncestorForTag(childTag, ancestorInfo);
var problematic = invalidParent || invalidAncestor;
if (problematic) {
var ancestorTag = problematic.tag;
var ancestorInstance = problematic.instance;
var childOwner = childInstance && childInstance._currentElement._owner;
var ancestorOwner = ancestorInstance && ancestorInstance._currentElement._owner;
var childOwners = findOwnerStack(childOwner);
var ancestorOwners = findOwnerStack(ancestorOwner);
var minStackLen = Math.min(childOwners.length, ancestorOwners.length);
var i;
var deepestCommon = -1;
for (i = 0; i < minStackLen; i++) {
if (childOwners[i] === ancestorOwners[i]) {
deepestCommon = i;
} else {
break;
}
}
var UNKNOWN = '(unknown)';
var childOwnerNames = childOwners.slice(deepestCommon + 1).map(function (inst) {
return inst.getName() || UNKNOWN;
});
var ancestorOwnerNames = ancestorOwners.slice(deepestCommon + 1).map(function (inst) {
return inst.getName() || UNKNOWN;
});
var ownerInfo = [].concat(
// If the parent and child instances have a common owner ancestor, start
// with that -- otherwise we just start with the parent's owners.
deepestCommon !== -1 ? childOwners[deepestCommon].getName() || UNKNOWN : [], ancestorOwnerNames, ancestorTag,
// If we're warning about an invalid (non-parent) ancestry, add '...'
invalidAncestor ? ['...'] : [], childOwnerNames, childTag).join(' > ');
var warnKey = !!invalidParent + '|' + childTag + '|' + ancestorTag + '|' + ownerInfo;
if (didWarn[warnKey]) {
return;
}
didWarn[warnKey] = true;
var tagDisplayName = childTag;
var whitespaceInfo = '';
if (childTag === '#text') {
if (/\S/.test(childText)) {
tagDisplayName = 'Text nodes';
} else {
tagDisplayName = 'Whitespace text nodes';
whitespaceInfo = ' Make sure you don\'t have any extra whitespace between tags on ' + 'each line of your source code.';
}
} else {
tagDisplayName = '<' + childTag + '>';
}
if (invalidParent) {
var info = '';
if (ancestorTag === 'table' && childTag === 'tr') {
info += ' Add a <tbody> to your code to match the DOM tree generated by ' + 'the browser.';
}
process.env.NODE_ENV !== 'production' ? warning(false, 'validateDOMNesting(...): %s cannot appear as a child of <%s>.%s ' + 'See %s.%s', tagDisplayName, ancestorTag, whitespaceInfo, ownerInfo, info) : void 0;
} else {
process.env.NODE_ENV !== 'production' ? warning(false, 'validateDOMNesting(...): %s cannot appear as a descendant of ' + '<%s>. See %s.', tagDisplayName, ancestorTag, ownerInfo) : void 0;
}
}
};
validateDOMNesting.updatedAncestorInfo = updatedAncestorInfo;
// For testing
validateDOMNesting.isTagValidInContext = function (tag, ancestorInfo) {
ancestorInfo = ancestorInfo || emptyAncestorInfo;
var parentInfo = ancestorInfo.current;
var parentTag = parentInfo && parentInfo.tag;
return isTagValidWithParent(tag, parentTag) && !findInvalidAncestorForTag(tag, ancestorInfo);
};
}
module.exports = validateDOMNesting;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 138 */
/*!***************************************************!*\
!*** ./~/react-dom/lib/ReactDOMEmptyComponent.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2014-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var _assign = __webpack_require__(/*! object-assign */ 5);
var DOMLazyTree = __webpack_require__(/*! ./DOMLazyTree */ 82);
var ReactDOMComponentTree = __webpack_require__(/*! ./ReactDOMComponentTree */ 35);
var ReactDOMEmptyComponent = function (instantiate) {
// ReactCompositeComponent uses this:
this._currentElement = null;
// ReactDOMComponentTree uses these:
this._hostNode = null;
this._hostParent = null;
this._hostContainerInfo = null;
this._domID = 0;
};
_assign(ReactDOMEmptyComponent.prototype, {
mountComponent: function (transaction, hostParent, hostContainerInfo, context) {
var domID = hostContainerInfo._idCounter++;
this._domID = domID;
this._hostParent = hostParent;
this._hostContainerInfo = hostContainerInfo;
var nodeValue = ' react-empty: ' + this._domID + ' ';
if (transaction.useCreateElement) {
var ownerDocument = hostContainerInfo._ownerDocument;
var node = ownerDocument.createComment(nodeValue);
ReactDOMComponentTree.precacheNode(this, node);
return DOMLazyTree(node);
} else {
if (transaction.renderToStaticMarkup) {
// Normally we'd insert a comment node, but since this is a situation
// where React won't take over (static pages), we can simply return
// nothing.
return '';
}
return '<!--' + nodeValue + '-->';
}
},
receiveComponent: function () {},
getHostNode: function () {
return ReactDOMComponentTree.getNodeFromInstance(this);
},
unmountComponent: function () {
ReactDOMComponentTree.uncacheNode(this);
}
});
module.exports = ReactDOMEmptyComponent;
/***/ },
/* 139 */
/*!**************************************************!*\
!*** ./~/react-dom/lib/ReactDOMTreeTraversal.js ***!
\**************************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var _prodInvariant = __webpack_require__(/*! ./reactProdInvariant */ 36);
var invariant = __webpack_require__(/*! fbjs/lib/invariant */ 9);
/**
* Return the lowest common ancestor of A and B, or null if they are in
* different trees.
*/
function getLowestCommonAncestor(instA, instB) {
!('_hostNode' in instA) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getNodeFromInstance: Invalid argument.') : _prodInvariant('33') : void 0;
!('_hostNode' in instB) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getNodeFromInstance: Invalid argument.') : _prodInvariant('33') : void 0;
var depthA = 0;
for (var tempA = instA; tempA; tempA = tempA._hostParent) {
depthA++;
}
var depthB = 0;
for (var tempB = instB; tempB; tempB = tempB._hostParent) {
depthB++;
}
// If A is deeper, crawl up.
while (depthA - depthB > 0) {
instA = instA._hostParent;
depthA--;
}
// If B is deeper, crawl up.
while (depthB - depthA > 0) {
instB = instB._hostParent;
depthB--;
}
// Walk in lockstep until we find a match.
var depth = depthA;
while (depth--) {
if (instA === instB) {
return instA;
}
instA = instA._hostParent;
instB = instB._hostParent;
}
return null;
}
/**
* Return if A is an ancestor of B.
*/
function isAncestor(instA, instB) {
!('_hostNode' in instA) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'isAncestor: Invalid argument.') : _prodInvariant('35') : void 0;
!('_hostNode' in instB) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'isAncestor: Invalid argument.') : _prodInvariant('35') : void 0;
while (instB) {
if (instB === instA) {
return true;
}
instB = instB._hostParent;
}
return false;
}
/**
* Return the parent instance of the passed-in instance.
*/
function getParentInstance(inst) {
!('_hostNode' in inst) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getParentInstance: Invalid argument.') : _prodInvariant('36') : void 0;
return inst._hostParent;
}
/**
* Simulates the traversal of a two-phase, capture/bubble event dispatch.
*/
function traverseTwoPhase(inst, fn, arg) {
var path = [];
while (inst) {
path.push(inst);
inst = inst._hostParent;
}
var i;
for (i = path.length; i-- > 0;) {
fn(path[i], 'captured', arg);
}
for (i = 0; i < path.length; i++) {
fn(path[i], 'bubbled', arg);
}
}
/**
* Traverses the ID hierarchy and invokes the supplied `cb` on any IDs that
* should would receive a `mouseEnter` or `mouseLeave` event.
*
* Does not invoke the callback on the nearest common ancestor because nothing
* "entered" or "left" that element.
*/
function traverseEnterLeave(from, to, fn, argFrom, argTo) {
var common = from && to ? getLowestCommonAncestor(from, to) : null;
var pathFrom = [];
while (from && from !== common) {
pathFrom.push(from);
from = from._hostParent;
}
var pathTo = [];
while (to && to !== common) {
pathTo.push(to);
to = to._hostParent;
}
var i;
for (i = 0; i < pathFrom.length; i++) {
fn(pathFrom[i], 'bubbled', argFrom);
}
for (i = pathTo.length; i-- > 0;) {
fn(pathTo[i], 'captured', argTo);
}
}
module.exports = {
isAncestor: isAncestor,
getLowestCommonAncestor: getLowestCommonAncestor,
getParentInstance: getParentInstance,
traverseTwoPhase: traverseTwoPhase,
traverseEnterLeave: traverseEnterLeave
};
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 140 */
/*!**************************************************!*\
!*** ./~/react-dom/lib/ReactDOMTextComponent.js ***!
\**************************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var _prodInvariant = __webpack_require__(/*! ./reactProdInvariant */ 36),
_assign = __webpack_require__(/*! object-assign */ 5);
var DOMChildrenOperations = __webpack_require__(/*! ./DOMChildrenOperations */ 81);
var DOMLazyTree = __webpack_require__(/*! ./DOMLazyTree */ 82);
var ReactDOMComponentTree = __webpack_require__(/*! ./ReactDOMComponentTree */ 35);
var escapeTextContentForBrowser = __webpack_require__(/*! ./escapeTextContentForBrowser */ 87);
var invariant = __webpack_require__(/*! fbjs/lib/invariant */ 9);
var validateDOMNesting = __webpack_require__(/*! ./validateDOMNesting */ 137);
/**
* Text nodes violate a couple assumptions that React makes about components:
*
* - When mounting text into the DOM, adjacent text nodes are merged.
* - Text nodes cannot be assigned a React root ID.
*
* This component is used to wrap strings between comment nodes so that they
* can undergo the same reconciliation that is applied to elements.
*
* TODO: Investigate representing React components in the DOM with text nodes.
*
* @class ReactDOMTextComponent
* @extends ReactComponent
* @internal
*/
var ReactDOMTextComponent = function (text) {
// TODO: This is really a ReactText (ReactNode), not a ReactElement
this._currentElement = text;
this._stringText = '' + text;
// ReactDOMComponentTree uses these:
this._hostNode = null;
this._hostParent = null;
// Properties
this._domID = 0;
this._mountIndex = 0;
this._closingComment = null;
this._commentNodes = null;
};
_assign(ReactDOMTextComponent.prototype, {
/**
* Creates the markup for this text node. This node is not intended to have
* any features besides containing text content.
*
* @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
* @return {string} Markup for this text node.
* @internal
*/
mountComponent: function (transaction, hostParent, hostContainerInfo, context) {
if (process.env.NODE_ENV !== 'production') {
var parentInfo;
if (hostParent != null) {
parentInfo = hostParent._ancestorInfo;
} else if (hostContainerInfo != null) {
parentInfo = hostContainerInfo._ancestorInfo;
}
if (parentInfo) {
// parentInfo should always be present except for the top-level
// component when server rendering
validateDOMNesting(null, this._stringText, this, parentInfo);
}
}
var domID = hostContainerInfo._idCounter++;
var openingValue = ' react-text: ' + domID + ' ';
var closingValue = ' /react-text ';
this._domID = domID;
this._hostParent = hostParent;
if (transaction.useCreateElement) {
var ownerDocument = hostContainerInfo._ownerDocument;
var openingComment = ownerDocument.createComment(openingValue);
var closingComment = ownerDocument.createComment(closingValue);
var lazyTree = DOMLazyTree(ownerDocument.createDocumentFragment());
DOMLazyTree.queueChild(lazyTree, DOMLazyTree(openingComment));
if (this._stringText) {
DOMLazyTree.queueChild(lazyTree, DOMLazyTree(ownerDocument.createTextNode(this._stringText)));
}
DOMLazyTree.queueChild(lazyTree, DOMLazyTree(closingComment));
ReactDOMComponentTree.precacheNode(this, openingComment);
this._closingComment = closingComment;
return lazyTree;
} else {
var escapedText = escapeTextContentForBrowser(this._stringText);
if (transaction.renderToStaticMarkup) {
// Normally we'd wrap this between comment nodes for the reasons stated
// above, but since this is a situation where React won't take over
// (static pages), we can simply return the text as it is.
return escapedText;
}
return '<!--' + openingValue + '-->' + escapedText + '<!--' + closingValue + '-->';
}
},
/**
* Updates this component by updating the text content.
*
* @param {ReactText} nextText The next text content
* @param {ReactReconcileTransaction} transaction
* @internal
*/
receiveComponent: function (nextText, transaction) {
if (nextText !== this._currentElement) {
this._currentElement = nextText;
var nextStringText = '' + nextText;
if (nextStringText !== this._stringText) {
// TODO: Save this as pending props and use performUpdateIfNecessary
// and/or updateComponent to do the actual update for consistency with
// other component types?
this._stringText = nextStringText;
var commentNodes = this.getHostNode();
DOMChildrenOperations.replaceDelimitedText(commentNodes[0], commentNodes[1], nextStringText);
}
}
},
getHostNode: function () {
var hostNode = this._commentNodes;
if (hostNode) {
return hostNode;
}
if (!this._closingComment) {
var openingComment = ReactDOMComponentTree.getNodeFromInstance(this);
var node = openingComment.nextSibling;
while (true) {
!(node != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Missing closing comment for text component %s', this._domID) : _prodInvariant('67', this._domID) : void 0;
if (node.nodeType === 8 && node.nodeValue === ' /react-text ') {
this._closingComment = node;
break;
}
node = node.nextSibling;
}
}
hostNode = [this._hostNode, this._closingComment];
this._commentNodes = hostNode;
return hostNode;
},
unmountComponent: function () {
this._closingComment = null;
this._commentNodes = null;
ReactDOMComponentTree.uncacheNode(this);
}
});
module.exports = ReactDOMTextComponent;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 141 */
/*!*********************************************************!*\
!*** ./~/react-dom/lib/ReactDefaultBatchingStrategy.js ***!
\*********************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var _assign = __webpack_require__(/*! object-assign */ 5);
var ReactUpdates = __webpack_require__(/*! ./ReactUpdates */ 57);
var Transaction = __webpack_require__(/*! ./Transaction */ 69);
var emptyFunction = __webpack_require__(/*! fbjs/lib/emptyFunction */ 13);
var RESET_BATCHED_UPDATES = {
initialize: emptyFunction,
close: function () {
ReactDefaultBatchingStrategy.isBatchingUpdates = false;
}
};
var FLUSH_BATCHED_UPDATES = {
initialize: emptyFunction,
close: ReactUpdates.flushBatchedUpdates.bind(ReactUpdates)
};
var TRANSACTION_WRAPPERS = [FLUSH_BATCHED_UPDATES, RESET_BATCHED_UPDATES];
function ReactDefaultBatchingStrategyTransaction() {
this.reinitializeTransaction();
}
_assign(ReactDefaultBatchingStrategyTransaction.prototype, Transaction, {
getTransactionWrappers: function () {
return TRANSACTION_WRAPPERS;
}
});
var transaction = new ReactDefaultBatchingStrategyTransaction();
var ReactDefaultBatchingStrategy = {
isBatchingUpdates: false,
/**
* Call the provided function in a context within which calls to `setState`
* and friends are batched such that components aren't updated unnecessarily.
*/
batchedUpdates: function (callback, a, b, c, d, e) {
var alreadyBatchingUpdates = ReactDefaultBatchingStrategy.isBatchingUpdates;
ReactDefaultBatchingStrategy.isBatchingUpdates = true;
// The code is written this way to avoid extra allocations
if (alreadyBatchingUpdates) {
return callback(a, b, c, d, e);
} else {
return transaction.perform(callback, null, a, b, c, d, e);
}
}
};
module.exports = ReactDefaultBatchingStrategy;
/***/ },
/* 142 */
/*!***********************************************!*\
!*** ./~/react-dom/lib/ReactEventListener.js ***!
\***********************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var _assign = __webpack_require__(/*! object-assign */ 5);
var EventListener = __webpack_require__(/*! fbjs/lib/EventListener */ 143);
var ExecutionEnvironment = __webpack_require__(/*! fbjs/lib/ExecutionEnvironment */ 49);
var PooledClass = __webpack_require__(/*! ./PooledClass */ 51);
var ReactDOMComponentTree = __webpack_require__(/*! ./ReactDOMComponentTree */ 35);
var ReactUpdates = __webpack_require__(/*! ./ReactUpdates */ 57);
var getEventTarget = __webpack_require__(/*! ./getEventTarget */ 70);
var getUnboundedScrollPosition = __webpack_require__(/*! fbjs/lib/getUnboundedScrollPosition */ 144);
/**
* Find the deepest React component completely containing the root of the
* passed-in instance (for use when entire React trees are nested within each
* other). If React trees are not nested, returns null.
*/
function findParent(inst) {
// TODO: It may be a good idea to cache this to prevent unnecessary DOM
// traversal, but caching is difficult to do correctly without using a
// mutation observer to listen for all DOM changes.
while (inst._hostParent) {
inst = inst._hostParent;
}
var rootNode = ReactDOMComponentTree.getNodeFromInstance(inst);
var container = rootNode.parentNode;
return ReactDOMComponentTree.getClosestInstanceFromNode(container);
}
// Used to store ancestor hierarchy in top level callback
function TopLevelCallbackBookKeeping(topLevelType, nativeEvent) {
this.topLevelType = topLevelType;
this.nativeEvent = nativeEvent;
this.ancestors = [];
}
_assign(TopLevelCallbackBookKeeping.prototype, {
destructor: function () {
this.topLevelType = null;
this.nativeEvent = null;
this.ancestors.length = 0;
}
});
PooledClass.addPoolingTo(TopLevelCallbackBookKeeping, PooledClass.twoArgumentPooler);
function handleTopLevelImpl(bookKeeping) {
var nativeEventTarget = getEventTarget(bookKeeping.nativeEvent);
var targetInst = ReactDOMComponentTree.getClosestInstanceFromNode(nativeEventTarget);
// Loop through the hierarchy, in case there's any nested components.
// It's important that we build the array of ancestors before calling any
// event handlers, because event handlers can modify the DOM, leading to
// inconsistencies with ReactMount's node cache. See #1105.
var ancestor = targetInst;
do {
bookKeeping.ancestors.push(ancestor);
ancestor = ancestor && findParent(ancestor);
} while (ancestor);
for (var i = 0; i < bookKeeping.ancestors.length; i++) {
targetInst = bookKeeping.ancestors[i];
ReactEventListener._handleTopLevel(bookKeeping.topLevelType, targetInst, bookKeeping.nativeEvent, getEventTarget(bookKeeping.nativeEvent));
}
}
function scrollValueMonitor(cb) {
var scrollPosition = getUnboundedScrollPosition(window);
cb(scrollPosition);
}
var ReactEventListener = {
_enabled: true,
_handleTopLevel: null,
WINDOW_HANDLE: ExecutionEnvironment.canUseDOM ? window : null,
setHandleTopLevel: function (handleTopLevel) {
ReactEventListener._handleTopLevel = handleTopLevel;
},
setEnabled: function (enabled) {
ReactEventListener._enabled = !!enabled;
},
isEnabled: function () {
return ReactEventListener._enabled;
},
/**
* Traps top-level events by using event bubbling.
*
* @param {string} topLevelType Record from `EventConstants`.
* @param {string} handlerBaseName Event name (e.g. "click").
* @param {object} element Element on which to attach listener.
* @return {?object} An object with a remove function which will forcefully
* remove the listener.
* @internal
*/
trapBubbledEvent: function (topLevelType, handlerBaseName, element) {
if (!element) {
return null;
}
return EventListener.listen(element, handlerBaseName, ReactEventListener.dispatchEvent.bind(null, topLevelType));
},
/**
* Traps a top-level event by using event capturing.
*
* @param {string} topLevelType Record from `EventConstants`.
* @param {string} handlerBaseName Event name (e.g. "click").
* @param {object} element Element on which to attach listener.
* @return {?object} An object with a remove function which will forcefully
* remove the listener.
* @internal
*/
trapCapturedEvent: function (topLevelType, handlerBaseName, element) {
if (!element) {
return null;
}
return EventListener.capture(element, handlerBaseName, ReactEventListener.dispatchEvent.bind(null, topLevelType));
},
monitorScrollValue: function (refresh) {
var callback = scrollValueMonitor.bind(null, refresh);
EventListener.listen(window, 'scroll', callback);
},
dispatchEvent: function (topLevelType, nativeEvent) {
if (!ReactEventListener._enabled) {
return;
}
var bookKeeping = TopLevelCallbackBookKeeping.getPooled(topLevelType, nativeEvent);
try {
// Event queue being processed in the same cycle allows
// `preventDefault`.
ReactUpdates.batchedUpdates(handleTopLevelImpl, bookKeeping);
} finally {
TopLevelCallbackBookKeeping.release(bookKeeping);
}
}
};
module.exports = ReactEventListener;
/***/ },
/* 143 */
/*!*************************************!*\
!*** ./~/fbjs/lib/EventListener.js ***!
\*************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {'use strict';
/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @typechecks
*/
var emptyFunction = __webpack_require__(/*! ./emptyFunction */ 13);
/**
* Upstream version of event listener. Does not take into account specific
* nature of platform.
*/
var EventListener = {
/**
* Listen to DOM events during the bubble phase.
*
* @param {DOMEventTarget} target DOM element to register listener on.
* @param {string} eventType Event type, e.g. 'click' or 'mouseover'.
* @param {function} callback Callback function.
* @return {object} Object with a `remove` method.
*/
listen: function listen(target, eventType, callback) {
if (target.addEventListener) {
target.addEventListener(eventType, callback, false);
return {
remove: function remove() {
target.removeEventListener(eventType, callback, false);
}
};
} else if (target.attachEvent) {
target.attachEvent('on' + eventType, callback);
return {
remove: function remove() {
target.detachEvent('on' + eventType, callback);
}
};
}
},
/**
* Listen to DOM events during the capture phase.
*
* @param {DOMEventTarget} target DOM element to register listener on.
* @param {string} eventType Event type, e.g. 'click' or 'mouseover'.
* @param {function} callback Callback function.
* @return {object} Object with a `remove` method.
*/
capture: function capture(target, eventType, callback) {
if (target.addEventListener) {
target.addEventListener(eventType, callback, true);
return {
remove: function remove() {
target.removeEventListener(eventType, callback, true);
}
};
} else {
if (process.env.NODE_ENV !== 'production') {
console.error('Attempted to listen to events during the capture phase on a ' + 'browser that does not support the capture phase. Your application ' + 'will not receive some events.');
}
return {
remove: emptyFunction
};
}
},
registerDefault: function registerDefault() {}
};
module.exports = EventListener;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 144 */
/*!**************************************************!*\
!*** ./~/fbjs/lib/getUnboundedScrollPosition.js ***!
\**************************************************/
/***/ function(module, exports) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @typechecks
*/
'use strict';
/**
* Gets the scroll position of the supplied element or window.
*
* The return values are unbounded, unlike `getScrollPosition`. This means they
* may be negative or exceed the element boundaries (which is possible using
* inertial scrolling).
*
* @param {DOMWindow|DOMElement} scrollable
* @return {object} Map with `x` and `y` keys.
*/
function getUnboundedScrollPosition(scrollable) {
if (scrollable === window) {
return {
x: window.pageXOffset || document.documentElement.scrollLeft,
y: window.pageYOffset || document.documentElement.scrollTop
};
}
return {
x: scrollable.scrollLeft,
y: scrollable.scrollTop
};
}
module.exports = getUnboundedScrollPosition;
/***/ },
/* 145 */
/*!*******************************************!*\
!*** ./~/react-dom/lib/ReactInjection.js ***!
\*******************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var DOMProperty = __webpack_require__(/*! ./DOMProperty */ 37);
var EventPluginHub = __webpack_require__(/*! ./EventPluginHub */ 43);
var EventPluginUtils = __webpack_require__(/*! ./EventPluginUtils */ 45);
var ReactComponentEnvironment = __webpack_require__(/*! ./ReactComponentEnvironment */ 116);
var ReactEmptyComponent = __webpack_require__(/*! ./ReactEmptyComponent */ 126);
var ReactBrowserEventEmitter = __webpack_require__(/*! ./ReactBrowserEventEmitter */ 106);
var ReactHostComponent = __webpack_require__(/*! ./ReactHostComponent */ 127);
var ReactUpdates = __webpack_require__(/*! ./ReactUpdates */ 57);
var ReactInjection = {
Component: ReactComponentEnvironment.injection,
DOMProperty: DOMProperty.injection,
EmptyComponent: ReactEmptyComponent.injection,
EventPluginHub: EventPluginHub.injection,
EventPluginUtils: EventPluginUtils.injection,
EventEmitter: ReactBrowserEventEmitter.injection,
HostComponent: ReactHostComponent.injection,
Updates: ReactUpdates.injection
};
module.exports = ReactInjection;
/***/ },
/* 146 */
/*!******************************************************!*\
!*** ./~/react-dom/lib/ReactReconcileTransaction.js ***!
\******************************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var _assign = __webpack_require__(/*! object-assign */ 5);
var CallbackQueue = __webpack_require__(/*! ./CallbackQueue */ 58);
var PooledClass = __webpack_require__(/*! ./PooledClass */ 51);
var ReactBrowserEventEmitter = __webpack_require__(/*! ./ReactBrowserEventEmitter */ 106);
var ReactInputSelection = __webpack_require__(/*! ./ReactInputSelection */ 147);
var ReactInstrumentation = __webpack_require__(/*! ./ReactInstrumentation */ 63);
var Transaction = __webpack_require__(/*! ./Transaction */ 69);
var ReactUpdateQueue = __webpack_require__(/*! ./ReactUpdateQueue */ 136);
/**
* Ensures that, when possible, the selection range (currently selected text
* input) is not disturbed by performing the transaction.
*/
var SELECTION_RESTORATION = {
/**
* @return {Selection} Selection information.
*/
initialize: ReactInputSelection.getSelectionInformation,
/**
* @param {Selection} sel Selection information returned from `initialize`.
*/
close: ReactInputSelection.restoreSelection
};
/**
* Suppresses events (blur/focus) that could be inadvertently dispatched due to
* high level DOM manipulations (like temporarily removing a text input from the
* DOM).
*/
var EVENT_SUPPRESSION = {
/**
* @return {boolean} The enabled status of `ReactBrowserEventEmitter` before
* the reconciliation.
*/
initialize: function () {
var currentlyEnabled = ReactBrowserEventEmitter.isEnabled();
ReactBrowserEventEmitter.setEnabled(false);
return currentlyEnabled;
},
/**
* @param {boolean} previouslyEnabled Enabled status of
* `ReactBrowserEventEmitter` before the reconciliation occurred. `close`
* restores the previous value.
*/
close: function (previouslyEnabled) {
ReactBrowserEventEmitter.setEnabled(previouslyEnabled);
}
};
/**
* Provides a queue for collecting `componentDidMount` and
* `componentDidUpdate` callbacks during the transaction.
*/
var ON_DOM_READY_QUEUEING = {
/**
* Initializes the internal `onDOMReady` queue.
*/
initialize: function () {
this.reactMountReady.reset();
},
/**
* After DOM is flushed, invoke all registered `onDOMReady` callbacks.
*/
close: function () {
this.reactMountReady.notifyAll();
}
};
/**
* Executed within the scope of the `Transaction` instance. Consider these as
* being member methods, but with an implied ordering while being isolated from
* each other.
*/
var TRANSACTION_WRAPPERS = [SELECTION_RESTORATION, EVENT_SUPPRESSION, ON_DOM_READY_QUEUEING];
if (process.env.NODE_ENV !== 'production') {
TRANSACTION_WRAPPERS.push({
initialize: ReactInstrumentation.debugTool.onBeginFlush,
close: ReactInstrumentation.debugTool.onEndFlush
});
}
/**
* Currently:
* - The order that these are listed in the transaction is critical:
* - Suppresses events.
* - Restores selection range.
*
* Future:
* - Restore document/overflow scroll positions that were unintentionally
* modified via DOM insertions above the top viewport boundary.
* - Implement/integrate with customized constraint based layout system and keep
* track of which dimensions must be remeasured.
*
* @class ReactReconcileTransaction
*/
function ReactReconcileTransaction(useCreateElement) {
this.reinitializeTransaction();
// Only server-side rendering really needs this option (see
// `ReactServerRendering`), but server-side uses
// `ReactServerRenderingTransaction` instead. This option is here so that it's
// accessible and defaults to false when `ReactDOMComponent` and
// `ReactDOMTextComponent` checks it in `mountComponent`.`
this.renderToStaticMarkup = false;
this.reactMountReady = CallbackQueue.getPooled(null);
this.useCreateElement = useCreateElement;
}
var Mixin = {
/**
* @see Transaction
* @abstract
* @final
* @return {array<object>} List of operation wrap procedures.
* TODO: convert to array<TransactionWrapper>
*/
getTransactionWrappers: function () {
return TRANSACTION_WRAPPERS;
},
/**
* @return {object} The queue to collect `onDOMReady` callbacks with.
*/
getReactMountReady: function () {
return this.reactMountReady;
},
/**
* @return {object} The queue to collect React async events.
*/
getUpdateQueue: function () {
return ReactUpdateQueue;
},
/**
* Save current transaction state -- if the return value from this method is
* passed to `rollback`, the transaction will be reset to that state.
*/
checkpoint: function () {
// reactMountReady is the our only stateful wrapper
return this.reactMountReady.checkpoint();
},
rollback: function (checkpoint) {
this.reactMountReady.rollback(checkpoint);
},
/**
* `PooledClass` looks for this, and will invoke this before allowing this
* instance to be reused.
*/
destructor: function () {
CallbackQueue.release(this.reactMountReady);
this.reactMountReady = null;
}
};
_assign(ReactReconcileTransaction.prototype, Transaction, Mixin);
PooledClass.addPoolingTo(ReactReconcileTransaction);
module.exports = ReactReconcileTransaction;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 147 */
/*!************************************************!*\
!*** ./~/react-dom/lib/ReactInputSelection.js ***!
\************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var ReactDOMSelection = __webpack_require__(/*! ./ReactDOMSelection */ 148);
var containsNode = __webpack_require__(/*! fbjs/lib/containsNode */ 150);
var focusNode = __webpack_require__(/*! fbjs/lib/focusNode */ 95);
var getActiveElement = __webpack_require__(/*! fbjs/lib/getActiveElement */ 153);
function isInDocument(node) {
return containsNode(document.documentElement, node);
}
/**
* @ReactInputSelection: React input selection module. Based on Selection.js,
* but modified to be suitable for react and has a couple of bug fixes (doesn't
* assume buttons have range selections allowed).
* Input selection module for React.
*/
var ReactInputSelection = {
hasSelectionCapabilities: function (elem) {
var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
return nodeName && (nodeName === 'input' && elem.type === 'text' || nodeName === 'textarea' || elem.contentEditable === 'true');
},
getSelectionInformation: function () {
var focusedElem = getActiveElement();
return {
focusedElem: focusedElem,
selectionRange: ReactInputSelection.hasSelectionCapabilities(focusedElem) ? ReactInputSelection.getSelection(focusedElem) : null
};
},
/**
* @restoreSelection: If any selection information was potentially lost,
* restore it. This is useful when performing operations that could remove dom
* nodes and place them back in, resulting in focus being lost.
*/
restoreSelection: function (priorSelectionInformation) {
var curFocusedElem = getActiveElement();
var priorFocusedElem = priorSelectionInformation.focusedElem;
var priorSelectionRange = priorSelectionInformation.selectionRange;
if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) {
if (ReactInputSelection.hasSelectionCapabilities(priorFocusedElem)) {
ReactInputSelection.setSelection(priorFocusedElem, priorSelectionRange);
}
focusNode(priorFocusedElem);
}
},
/**
* @getSelection: Gets the selection bounds of a focused textarea, input or
* contentEditable node.
* -@input: Look up selection bounds of this input
* -@return {start: selectionStart, end: selectionEnd}
*/
getSelection: function (input) {
var selection;
if ('selectionStart' in input) {
// Modern browser with input or textarea.
selection = {
start: input.selectionStart,
end: input.selectionEnd
};
} else if (document.selection && input.nodeName && input.nodeName.toLowerCase() === 'input') {
// IE8 input.
var range = document.selection.createRange();
// There can only be one selection per document in IE, so it must
// be in our element.
if (range.parentElement() === input) {
selection = {
start: -range.moveStart('character', -input.value.length),
end: -range.moveEnd('character', -input.value.length)
};
}
} else {
// Content editable or old IE textarea.
selection = ReactDOMSelection.getOffsets(input);
}
return selection || { start: 0, end: 0 };
},
/**
* @setSelection: Sets the selection bounds of a textarea or input and focuses
* the input.
* -@input Set selection bounds of this input or textarea
* -@offsets Object of same form that is returned from get*
*/
setSelection: function (input, offsets) {
var start = offsets.start;
var end = offsets.end;
if (end === undefined) {
end = start;
}
if ('selectionStart' in input) {
input.selectionStart = start;
input.selectionEnd = Math.min(end, input.value.length);
} else if (document.selection && input.nodeName && input.nodeName.toLowerCase() === 'input') {
var range = input.createTextRange();
range.collapse(true);
range.moveStart('character', start);
range.moveEnd('character', end - start);
range.select();
} else {
ReactDOMSelection.setOffsets(input, offsets);
}
}
};
module.exports = ReactInputSelection;
/***/ },
/* 148 */
/*!**********************************************!*\
!*** ./~/react-dom/lib/ReactDOMSelection.js ***!
\**********************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var ExecutionEnvironment = __webpack_require__(/*! fbjs/lib/ExecutionEnvironment */ 49);
var getNodeForCharacterOffset = __webpack_require__(/*! ./getNodeForCharacterOffset */ 149);
var getTextContentAccessor = __webpack_require__(/*! ./getTextContentAccessor */ 52);
/**
* While `isCollapsed` is available on the Selection object and `collapsed`
* is available on the Range object, IE11 sometimes gets them wrong.
* If the anchor/focus nodes and offsets are the same, the range is collapsed.
*/
function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {
return anchorNode === focusNode && anchorOffset === focusOffset;
}
/**
* Get the appropriate anchor and focus node/offset pairs for IE.
*
* The catch here is that IE's selection API doesn't provide information
* about whether the selection is forward or backward, so we have to
* behave as though it's always forward.
*
* IE text differs from modern selection in that it behaves as though
* block elements end with a new line. This means character offsets will
* differ between the two APIs.
*
* @param {DOMElement} node
* @return {object}
*/
function getIEOffsets(node) {
var selection = document.selection;
var selectedRange = selection.createRange();
var selectedLength = selectedRange.text.length;
// Duplicate selection so we can move range without breaking user selection.
var fromStart = selectedRange.duplicate();
fromStart.moveToElementText(node);
fromStart.setEndPoint('EndToStart', selectedRange);
var startOffset = fromStart.text.length;
var endOffset = startOffset + selectedLength;
return {
start: startOffset,
end: endOffset
};
}
/**
* @param {DOMElement} node
* @return {?object}
*/
function getModernOffsets(node) {
var selection = window.getSelection && window.getSelection();
if (!selection || selection.rangeCount === 0) {
return null;
}
var anchorNode = selection.anchorNode;
var anchorOffset = selection.anchorOffset;
var focusNode = selection.focusNode;
var focusOffset = selection.focusOffset;
var currentRange = selection.getRangeAt(0);
// In Firefox, range.startContainer and range.endContainer can be "anonymous
// divs", e.g. the up/down buttons on an <input type="number">. Anonymous
// divs do not seem to expose properties, triggering a "Permission denied
// error" if any of its properties are accessed. The only seemingly possible
// way to avoid erroring is to access a property that typically works for
// non-anonymous divs and catch any error that may otherwise arise. See
// https://bugzilla.mozilla.org/show_bug.cgi?id=208427
try {
/* eslint-disable no-unused-expressions */
currentRange.startContainer.nodeType;
currentRange.endContainer.nodeType;
/* eslint-enable no-unused-expressions */
} catch (e) {
return null;
}
// If the node and offset values are the same, the selection is collapsed.
// `Selection.isCollapsed` is available natively, but IE sometimes gets
// this value wrong.
var isSelectionCollapsed = isCollapsed(selection.anchorNode, selection.anchorOffset, selection.focusNode, selection.focusOffset);
var rangeLength = isSelectionCollapsed ? 0 : currentRange.toString().length;
var tempRange = currentRange.cloneRange();
tempRange.selectNodeContents(node);
tempRange.setEnd(currentRange.startContainer, currentRange.startOffset);
var isTempRangeCollapsed = isCollapsed(tempRange.startContainer, tempRange.startOffset, tempRange.endContainer, tempRange.endOffset);
var start = isTempRangeCollapsed ? 0 : tempRange.toString().length;
var end = start + rangeLength;
// Detect whether the selection is backward.
var detectionRange = document.createRange();
detectionRange.setStart(anchorNode, anchorOffset);
detectionRange.setEnd(focusNode, focusOffset);
var isBackward = detectionRange.collapsed;
return {
start: isBackward ? end : start,
end: isBackward ? start : end
};
}
/**
* @param {DOMElement|DOMTextNode} node
* @param {object} offsets
*/
function setIEOffsets(node, offsets) {
var range = document.selection.createRange().duplicate();
var start, end;
if (offsets.end === undefined) {
start = offsets.start;
end = start;
} else if (offsets.start > offsets.end) {
start = offsets.end;
end = offsets.start;
} else {
start = offsets.start;
end = offsets.end;
}
range.moveToElementText(node);
range.moveStart('character', start);
range.setEndPoint('EndToStart', range);
range.moveEnd('character', end - start);
range.select();
}
/**
* In modern non-IE browsers, we can support both forward and backward
* selections.
*
* Note: IE10+ supports the Selection object, but it does not support
* the `extend` method, which means that even in modern IE, it's not possible
* to programmatically create a backward selection. Thus, for all IE
* versions, we use the old IE API to create our selections.
*
* @param {DOMElement|DOMTextNode} node
* @param {object} offsets
*/
function setModernOffsets(node, offsets) {
if (!window.getSelection) {
return;
}
var selection = window.getSelection();
var length = node[getTextContentAccessor()].length;
var start = Math.min(offsets.start, length);
var end = offsets.end === undefined ? start : Math.min(offsets.end, length);
// IE 11 uses modern selection, but doesn't support the extend method.
// Flip backward selections, so we can set with a single range.
if (!selection.extend && start > end) {
var temp = end;
end = start;
start = temp;
}
var startMarker = getNodeForCharacterOffset(node, start);
var endMarker = getNodeForCharacterOffset(node, end);
if (startMarker && endMarker) {
var range = document.createRange();
range.setStart(startMarker.node, startMarker.offset);
selection.removeAllRanges();
if (start > end) {
selection.addRange(range);
selection.extend(endMarker.node, endMarker.offset);
} else {
range.setEnd(endMarker.node, endMarker.offset);
selection.addRange(range);
}
}
}
var useIEOffsets = ExecutionEnvironment.canUseDOM && 'selection' in document && !('getSelection' in window);
var ReactDOMSelection = {
/**
* @param {DOMElement} node
*/
getOffsets: useIEOffsets ? getIEOffsets : getModernOffsets,
/**
* @param {DOMElement|DOMTextNode} node
* @param {object} offsets
*/
setOffsets: useIEOffsets ? setIEOffsets : setModernOffsets
};
module.exports = ReactDOMSelection;
/***/ },
/* 149 */
/*!******************************************************!*\
!*** ./~/react-dom/lib/getNodeForCharacterOffset.js ***!
\******************************************************/
/***/ function(module, exports) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
/**
* Given any node return the first leaf node without children.
*
* @param {DOMElement|DOMTextNode} node
* @return {DOMElement|DOMTextNode}
*/
function getLeafNode(node) {
while (node && node.firstChild) {
node = node.firstChild;
}
return node;
}
/**
* Get the next sibling within a container. This will walk up the
* DOM if a node's siblings have been exhausted.
*
* @param {DOMElement|DOMTextNode} node
* @return {?DOMElement|DOMTextNode}
*/
function getSiblingNode(node) {
while (node) {
if (node.nextSibling) {
return node.nextSibling;
}
node = node.parentNode;
}
}
/**
* Get object describing the nodes which contain characters at offset.
*
* @param {DOMElement|DOMTextNode} root
* @param {number} offset
* @return {?object}
*/
function getNodeForCharacterOffset(root, offset) {
var node = getLeafNode(root);
var nodeStart = 0;
var nodeEnd = 0;
while (node) {
if (node.nodeType === 3) {
nodeEnd = nodeStart + node.textContent.length;
if (nodeStart <= offset && nodeEnd >= offset) {
return {
node: node,
offset: offset - nodeStart
};
}
nodeStart = nodeEnd;
}
node = getLeafNode(getSiblingNode(node));
}
}
module.exports = getNodeForCharacterOffset;
/***/ },
/* 150 */
/*!************************************!*\
!*** ./~/fbjs/lib/containsNode.js ***!
\************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
var isTextNode = __webpack_require__(/*! ./isTextNode */ 151);
/*eslint-disable no-bitwise */
/**
* Checks if a given DOM node contains or is another DOM node.
*/
function containsNode(outerNode, innerNode) {
if (!outerNode || !innerNode) {
return false;
} else if (outerNode === innerNode) {
return true;
} else if (isTextNode(outerNode)) {
return false;
} else if (isTextNode(innerNode)) {
return containsNode(outerNode, innerNode.parentNode);
} else if ('contains' in outerNode) {
return outerNode.contains(innerNode);
} else if (outerNode.compareDocumentPosition) {
return !!(outerNode.compareDocumentPosition(innerNode) & 16);
} else {
return false;
}
}
module.exports = containsNode;
/***/ },
/* 151 */
/*!**********************************!*\
!*** ./~/fbjs/lib/isTextNode.js ***!
\**********************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @typechecks
*/
var isNode = __webpack_require__(/*! ./isNode */ 152);
/**
* @param {*} object The object to check.
* @return {boolean} Whether or not the object is a DOM text node.
*/
function isTextNode(object) {
return isNode(object) && object.nodeType == 3;
}
module.exports = isTextNode;
/***/ },
/* 152 */
/*!******************************!*\
!*** ./~/fbjs/lib/isNode.js ***!
\******************************/
/***/ function(module, exports) {
'use strict';
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @typechecks
*/
/**
* @param {*} object The object to check.
* @return {boolean} Whether or not the object is a DOM node.
*/
function isNode(object) {
return !!(object && (typeof Node === 'function' ? object instanceof Node : typeof object === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string'));
}
module.exports = isNode;
/***/ },
/* 153 */
/*!****************************************!*\
!*** ./~/fbjs/lib/getActiveElement.js ***!
\****************************************/
/***/ function(module, exports) {
'use strict';
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @typechecks
*/
/* eslint-disable fb-www/typeof-undefined */
/**
* Same as document.activeElement but wraps in a try-catch block. In IE it is
* not safe to call document.activeElement if there is nothing focused.
*
* The activeElement will be null only if the document or document body is not
* yet defined.
*/
function getActiveElement() /*?DOMElement*/{
if (typeof document === 'undefined') {
return null;
}
try {
return document.activeElement || document.body;
} catch (e) {
return document.body;
}
}
module.exports = getActiveElement;
/***/ },
/* 154 */
/*!*************************************************!*\
!*** ./~/react-dom/lib/SVGDOMPropertyConfig.js ***!
\*************************************************/
/***/ function(module, exports) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var NS = {
xlink: 'http://www.w3.org/1999/xlink',
xml: 'http://www.w3.org/XML/1998/namespace'
};
// We use attributes for everything SVG so let's avoid some duplication and run
// code instead.
// The following are all specified in the HTML config already so we exclude here.
// - class (as className)
// - color
// - height
// - id
// - lang
// - max
// - media
// - method
// - min
// - name
// - style
// - target
// - type
// - width
var ATTRS = {
accentHeight: 'accent-height',
accumulate: 0,
additive: 0,
alignmentBaseline: 'alignment-baseline',
allowReorder: 'allowReorder',
alphabetic: 0,
amplitude: 0,
arabicForm: 'arabic-form',
ascent: 0,
attributeName: 'attributeName',
attributeType: 'attributeType',
autoReverse: 'autoReverse',
azimuth: 0,
baseFrequency: 'baseFrequency',
baseProfile: 'baseProfile',
baselineShift: 'baseline-shift',
bbox: 0,
begin: 0,
bias: 0,
by: 0,
calcMode: 'calcMode',
capHeight: 'cap-height',
clip: 0,
clipPath: 'clip-path',
clipRule: 'clip-rule',
clipPathUnits: 'clipPathUnits',
colorInterpolation: 'color-interpolation',
colorInterpolationFilters: 'color-interpolation-filters',
colorProfile: 'color-profile',
colorRendering: 'color-rendering',
contentScriptType: 'contentScriptType',
contentStyleType: 'contentStyleType',
cursor: 0,
cx: 0,
cy: 0,
d: 0,
decelerate: 0,
descent: 0,
diffuseConstant: 'diffuseConstant',
direction: 0,
display: 0,
divisor: 0,
dominantBaseline: 'dominant-baseline',
dur: 0,
dx: 0,
dy: 0,
edgeMode: 'edgeMode',
elevation: 0,
enableBackground: 'enable-background',
end: 0,
exponent: 0,
externalResourcesRequired: 'externalResourcesRequired',
fill: 0,
fillOpacity: 'fill-opacity',
fillRule: 'fill-rule',
filter: 0,
filterRes: 'filterRes',
filterUnits: 'filterUnits',
floodColor: 'flood-color',
floodOpacity: 'flood-opacity',
focusable: 0,
fontFamily: 'font-family',
fontSize: 'font-size',
fontSizeAdjust: 'font-size-adjust',
fontStretch: 'font-stretch',
fontStyle: 'font-style',
fontVariant: 'font-variant',
fontWeight: 'font-weight',
format: 0,
from: 0,
fx: 0,
fy: 0,
g1: 0,
g2: 0,
glyphName: 'glyph-name',
glyphOrientationHorizontal: 'glyph-orientation-horizontal',
glyphOrientationVertical: 'glyph-orientation-vertical',
glyphRef: 'glyphRef',
gradientTransform: 'gradientTransform',
gradientUnits: 'gradientUnits',
hanging: 0,
horizAdvX: 'horiz-adv-x',
horizOriginX: 'horiz-origin-x',
ideographic: 0,
imageRendering: 'image-rendering',
'in': 0,
in2: 0,
intercept: 0,
k: 0,
k1: 0,
k2: 0,
k3: 0,
k4: 0,
kernelMatrix: 'kernelMatrix',
kernelUnitLength: 'kernelUnitLength',
kerning: 0,
keyPoints: 'keyPoints',
keySplines: 'keySplines',
keyTimes: 'keyTimes',
lengthAdjust: 'lengthAdjust',
letterSpacing: 'letter-spacing',
lightingColor: 'lighting-color',
limitingConeAngle: 'limitingConeAngle',
local: 0,
markerEnd: 'marker-end',
markerMid: 'marker-mid',
markerStart: 'marker-start',
markerHeight: 'markerHeight',
markerUnits: 'markerUnits',
markerWidth: 'markerWidth',
mask: 0,
maskContentUnits: 'maskContentUnits',
maskUnits: 'maskUnits',
mathematical: 0,
mode: 0,
numOctaves: 'numOctaves',
offset: 0,
opacity: 0,
operator: 0,
order: 0,
orient: 0,
orientation: 0,
origin: 0,
overflow: 0,
overlinePosition: 'overline-position',
overlineThickness: 'overline-thickness',
paintOrder: 'paint-order',
panose1: 'panose-1',
pathLength: 'pathLength',
patternContentUnits: 'patternContentUnits',
patternTransform: 'patternTransform',
patternUnits: 'patternUnits',
pointerEvents: 'pointer-events',
points: 0,
pointsAtX: 'pointsAtX',
pointsAtY: 'pointsAtY',
pointsAtZ: 'pointsAtZ',
preserveAlpha: 'preserveAlpha',
preserveAspectRatio: 'preserveAspectRatio',
primitiveUnits: 'primitiveUnits',
r: 0,
radius: 0,
refX: 'refX',
refY: 'refY',
renderingIntent: 'rendering-intent',
repeatCount: 'repeatCount',
repeatDur: 'repeatDur',
requiredExtensions: 'requiredExtensions',
requiredFeatures: 'requiredFeatures',
restart: 0,
result: 0,
rotate: 0,
rx: 0,
ry: 0,
scale: 0,
seed: 0,
shapeRendering: 'shape-rendering',
slope: 0,
spacing: 0,
specularConstant: 'specularConstant',
specularExponent: 'specularExponent',
speed: 0,
spreadMethod: 'spreadMethod',
startOffset: 'startOffset',
stdDeviation: 'stdDeviation',
stemh: 0,
stemv: 0,
stitchTiles: 'stitchTiles',
stopColor: 'stop-color',
stopOpacity: 'stop-opacity',
strikethroughPosition: 'strikethrough-position',
strikethroughThickness: 'strikethrough-thickness',
string: 0,
stroke: 0,
strokeDasharray: 'stroke-dasharray',
strokeDashoffset: 'stroke-dashoffset',
strokeLinecap: 'stroke-linecap',
strokeLinejoin: 'stroke-linejoin',
strokeMiterlimit: 'stroke-miterlimit',
strokeOpacity: 'stroke-opacity',
strokeWidth: 'stroke-width',
surfaceScale: 'surfaceScale',
systemLanguage: 'systemLanguage',
tableValues: 'tableValues',
targetX: 'targetX',
targetY: 'targetY',
textAnchor: 'text-anchor',
textDecoration: 'text-decoration',
textRendering: 'text-rendering',
textLength: 'textLength',
to: 0,
transform: 0,
u1: 0,
u2: 0,
underlinePosition: 'underline-position',
underlineThickness: 'underline-thickness',
unicode: 0,
unicodeBidi: 'unicode-bidi',
unicodeRange: 'unicode-range',
unitsPerEm: 'units-per-em',
vAlphabetic: 'v-alphabetic',
vHanging: 'v-hanging',
vIdeographic: 'v-ideographic',
vMathematical: 'v-mathematical',
values: 0,
vectorEffect: 'vector-effect',
version: 0,
vertAdvY: 'vert-adv-y',
vertOriginX: 'vert-origin-x',
vertOriginY: 'vert-origin-y',
viewBox: 'viewBox',
viewTarget: 'viewTarget',
visibility: 0,
widths: 0,
wordSpacing: 'word-spacing',
writingMode: 'writing-mode',
x: 0,
xHeight: 'x-height',
x1: 0,
x2: 0,
xChannelSelector: 'xChannelSelector',
xlinkActuate: 'xlink:actuate',
xlinkArcrole: 'xlink:arcrole',
xlinkHref: 'xlink:href',
xlinkRole: 'xlink:role',
xlinkShow: 'xlink:show',
xlinkTitle: 'xlink:title',
xlinkType: 'xlink:type',
xmlBase: 'xml:base',
xmlns: 0,
xmlnsXlink: 'xmlns:xlink',
xmlLang: 'xml:lang',
xmlSpace: 'xml:space',
y: 0,
y1: 0,
y2: 0,
yChannelSelector: 'yChannelSelector',
z: 0,
zoomAndPan: 'zoomAndPan'
};
var SVGDOMPropertyConfig = {
Properties: {},
DOMAttributeNamespaces: {
xlinkActuate: NS.xlink,
xlinkArcrole: NS.xlink,
xlinkHref: NS.xlink,
xlinkRole: NS.xlink,
xlinkShow: NS.xlink,
xlinkTitle: NS.xlink,
xlinkType: NS.xlink,
xmlBase: NS.xml,
xmlLang: NS.xml,
xmlSpace: NS.xml
},
DOMAttributeNames: {}
};
Object.keys(ATTRS).forEach(function (key) {
SVGDOMPropertyConfig.Properties[key] = 0;
if (ATTRS[key]) {
SVGDOMPropertyConfig.DOMAttributeNames[key] = ATTRS[key];
}
});
module.exports = SVGDOMPropertyConfig;
/***/ },
/* 155 */
/*!**********************************************!*\
!*** ./~/react-dom/lib/SelectEventPlugin.js ***!
\**********************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var EventPropagators = __webpack_require__(/*! ./EventPropagators */ 42);
var ExecutionEnvironment = __webpack_require__(/*! fbjs/lib/ExecutionEnvironment */ 49);
var ReactDOMComponentTree = __webpack_require__(/*! ./ReactDOMComponentTree */ 35);
var ReactInputSelection = __webpack_require__(/*! ./ReactInputSelection */ 147);
var SyntheticEvent = __webpack_require__(/*! ./SyntheticEvent */ 54);
var getActiveElement = __webpack_require__(/*! fbjs/lib/getActiveElement */ 153);
var isTextInputElement = __webpack_require__(/*! ./isTextInputElement */ 72);
var shallowEqual = __webpack_require__(/*! fbjs/lib/shallowEqual */ 124);
var skipSelectionChangeEvent = ExecutionEnvironment.canUseDOM && 'documentMode' in document && document.documentMode <= 11;
var eventTypes = {
select: {
phasedRegistrationNames: {
bubbled: 'onSelect',
captured: 'onSelectCapture'
},
dependencies: ['topBlur', 'topContextMenu', 'topFocus', 'topKeyDown', 'topKeyUp', 'topMouseDown', 'topMouseUp', 'topSelectionChange']
}
};
var activeElement = null;
var activeElementInst = null;
var lastSelection = null;
var mouseDown = false;
// Track whether a listener exists for this plugin. If none exist, we do
// not extract events. See #3639.
var hasListener = false;
/**
* Get an object which is a unique representation of the current selection.
*
* The return value will not be consistent across nodes or browsers, but
* two identical selections on the same node will return identical objects.
*
* @param {DOMElement} node
* @return {object}
*/
function getSelection(node) {
if ('selectionStart' in node && ReactInputSelection.hasSelectionCapabilities(node)) {
return {
start: node.selectionStart,
end: node.selectionEnd
};
} else if (window.getSelection) {
var selection = window.getSelection();
return {
anchorNode: selection.anchorNode,
anchorOffset: selection.anchorOffset,
focusNode: selection.focusNode,
focusOffset: selection.focusOffset
};
} else if (document.selection) {
var range = document.selection.createRange();
return {
parentElement: range.parentElement(),
text: range.text,
top: range.boundingTop,
left: range.boundingLeft
};
}
}
/**
* Poll selection to see whether it's changed.
*
* @param {object} nativeEvent
* @return {?SyntheticEvent}
*/
function constructSelectEvent(nativeEvent, nativeEventTarget) {
// Ensure we have the right element, and that the user is not dragging a
// selection (this matches native `select` event behavior). In HTML5, select
// fires only on input and textarea thus if there's no focused element we
// won't dispatch.
if (mouseDown || activeElement == null || activeElement !== getActiveElement()) {
return null;
}
// Only fire when selection has actually changed.
var currentSelection = getSelection(activeElement);
if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) {
lastSelection = currentSelection;
var syntheticEvent = SyntheticEvent.getPooled(eventTypes.select, activeElementInst, nativeEvent, nativeEventTarget);
syntheticEvent.type = 'select';
syntheticEvent.target = activeElement;
EventPropagators.accumulateTwoPhaseDispatches(syntheticEvent);
return syntheticEvent;
}
return null;
}
/**
* This plugin creates an `onSelect` event that normalizes select events
* across form elements.
*
* Supported elements are:
* - input (see `isTextInputElement`)
* - textarea
* - contentEditable
*
* This differs from native browser implementations in the following ways:
* - Fires on contentEditable fields as well as inputs.
* - Fires for collapsed selection.
* - Fires after user input.
*/
var SelectEventPlugin = {
eventTypes: eventTypes,
extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
if (!hasListener) {
return null;
}
var targetNode = targetInst ? ReactDOMComponentTree.getNodeFromInstance(targetInst) : window;
switch (topLevelType) {
// Track the input node that has focus.
case 'topFocus':
if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {
activeElement = targetNode;
activeElementInst = targetInst;
lastSelection = null;
}
break;
case 'topBlur':
activeElement = null;
activeElementInst = null;
lastSelection = null;
break;
// Don't fire the event while the user is dragging. This matches the
// semantics of the native select event.
case 'topMouseDown':
mouseDown = true;
break;
case 'topContextMenu':
case 'topMouseUp':
mouseDown = false;
return constructSelectEvent(nativeEvent, nativeEventTarget);
// Chrome and IE fire non-standard event when selection is changed (and
// sometimes when it hasn't). IE's event fires out of order with respect
// to key and input events on deletion, so we discard it.
//
// Firefox doesn't support selectionchange, so check selection status
// after each key entry. The selection changes after keydown and before
// keyup, but we check on keydown as well in the case of holding down a
// key, when multiple keydown events are fired but only one keyup is.
// This is also our approach for IE handling, for the reason above.
case 'topSelectionChange':
if (skipSelectionChangeEvent) {
break;
}
// falls through
case 'topKeyDown':
case 'topKeyUp':
return constructSelectEvent(nativeEvent, nativeEventTarget);
}
return null;
},
didPutListener: function (inst, registrationName, listener) {
if (registrationName === 'onSelect') {
hasListener = true;
}
}
};
module.exports = SelectEventPlugin;
/***/ },
/* 156 */
/*!**********************************************!*\
!*** ./~/react-dom/lib/SimpleEventPlugin.js ***!
\**********************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
'use strict';
var _prodInvariant = __webpack_require__(/*! ./reactProdInvariant */ 36);
var EventListener = __webpack_require__(/*! fbjs/lib/EventListener */ 143);
var EventPropagators = __webpack_require__(/*! ./EventPropagators */ 42);
var ReactDOMComponentTree = __webpack_require__(/*! ./ReactDOMComponentTree */ 35);
var SyntheticAnimationEvent = __webpack_require__(/*! ./SyntheticAnimationEvent */ 157);
var SyntheticClipboardEvent = __webpack_require__(/*! ./SyntheticClipboardEvent */ 158);
var SyntheticEvent = __webpack_require__(/*! ./SyntheticEvent */ 54);
var SyntheticFocusEvent = __webpack_require__(/*! ./SyntheticFocusEvent */ 159);
var SyntheticKeyboardEvent = __webpack_require__(/*! ./SyntheticKeyboardEvent */ 160);
var SyntheticMouseEvent = __webpack_require__(/*! ./SyntheticMouseEvent */ 75);
var SyntheticDragEvent = __webpack_require__(/*! ./SyntheticDragEvent */ 163);
var SyntheticTouchEvent = __webpack_require__(/*! ./SyntheticTouchEvent */ 164);
var SyntheticTransitionEvent = __webpack_require__(/*! ./SyntheticTransitionEvent */ 165);
var SyntheticUIEvent = __webpack_require__(/*! ./SyntheticUIEvent */ 76);
var SyntheticWheelEvent = __webpack_require__(/*! ./SyntheticWheelEvent */ 166);
var emptyFunction = __webpack_require__(/*! fbjs/lib/emptyFunction */ 13);
var getEventCharCode = __webpack_require__(/*! ./getEventCharCode */ 161);
var invariant = __webpack_require__(/*! fbjs/lib/invariant */ 9);
/**
* Turns
* ['abort', ...]
* into
* eventTypes = {
* 'abort': {
* phasedRegistrationNames: {
* bubbled: 'onAbort',
* captured: 'onAbortCapture',
* },
* dependencies: ['topAbort'],
* },
* ...
* };
* topLevelEventsToDispatchConfig = {
* 'topAbort': { sameConfig }
* };
*/
var eventTypes = {};
var topLevelEventsToDispatchConfig = {};
['abort', 'animationEnd', 'animationIteration', 'animationStart', 'blur', 'canPlay', 'canPlayThrough', 'click', 'contextMenu', 'copy', 'cut', 'doubleClick', 'drag', 'dragEnd', 'dragEnter', 'dragExit', 'dragLeave', 'dragOver', 'dragStart', 'drop', 'durationChange', 'emptied', 'encrypted', 'ended', 'error', 'focus', 'input', 'invalid', 'keyDown', 'keyPress', 'keyUp', 'load', 'loadedData', 'loadedMetadata', 'loadStart', 'mouseDown', 'mouseMove', 'mouseOut', 'mouseOver', 'mouseUp', 'paste', 'pause', 'play', 'playing', 'progress', 'rateChange', 'reset', 'scroll', 'seeked', 'seeking', 'stalled', 'submit', 'suspend', 'timeUpdate', 'touchCancel', 'touchEnd', 'touchMove', 'touchStart', 'transitionEnd', 'volumeChange', 'waiting', 'wheel'].forEach(function (event) {
var capitalizedEvent = event[0].toUpperCase() + event.slice(1);
var onEvent = 'on' + capitalizedEvent;
var topEvent = 'top' + capitalizedEvent;
var type = {
phasedRegistrationNames: {
bubbled: onEvent,
captured: onEvent + 'Capture'
},
dependencies: [topEvent]
};
eventTypes[event] = type;
topLevelEventsToDispatchConfig[topEvent] = type;
});
var onClickListeners = {};
function getDictionaryKey(inst) {
// Prevents V8 performance issue:
// https://github.com/facebook/react/pull/7232
return '.' + inst._rootNodeID;
}
function isInteractive(tag) {
return tag === 'button' || tag === 'input' || tag === 'select' || tag === 'textarea';
}
var SimpleEventPlugin = {
eventTypes: eventTypes,
extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
var dispatchConfig = topLevelEventsToDispatchConfig[topLevelType];
if (!dispatchConfig) {
return null;
}
var EventConstructor;
switch (topLevelType) {
case 'topAbort':
case 'topCanPlay':
case 'topCanPlayThrough':
case 'topDurationChange':
case 'topEmptied':
case 'topEncrypted':
case 'topEnded':
case 'topError':
case 'topInput':
case 'topInvalid':
case 'topLoad':
case 'topLoadedData':
case 'topLoadedMetadata':
case 'topLoadStart':
case 'topPause':
case 'topPlay':
case 'topPlaying':
case 'topProgress':
case 'topRateChange':
case 'topReset':
case 'topSeeked':
case 'topSeeking':
case 'topStalled':
case 'topSubmit':
case 'topSuspend':
case 'topTimeUpdate':
case 'topVolumeChange':
case 'topWaiting':
// HTML Events
// @see http://www.w3.org/TR/html5/index.html#events-0
EventConstructor = SyntheticEvent;
break;
case 'topKeyPress':
// Firefox creates a keypress event for function keys too. This removes
// the unwanted keypress events. Enter is however both printable and
// non-printable. One would expect Tab to be as well (but it isn't).
if (getEventCharCode(nativeEvent) === 0) {
return null;
}
/* falls through */
case 'topKeyDown':
case 'topKeyUp':
EventConstructor = SyntheticKeyboardEvent;
break;
case 'topBlur':
case 'topFocus':
EventConstructor = SyntheticFocusEvent;
break;
case 'topClick':
// Firefox creates a click event on right mouse clicks. This removes the
// unwanted click events.
if (nativeEvent.button === 2) {
return null;
}
/* falls through */
case 'topDoubleClick':
case 'topMouseDown':
case 'topMouseMove':
case 'topMouseUp':
// TODO: Disabled elements should not respond to mouse events
/* falls through */
case 'topMouseOut':
case 'topMouseOver':
case 'topContextMenu':
EventConstructor = SyntheticMouseEvent;
break;
case 'topDrag':
case 'topDragEnd':
case 'topDragEnter':
case 'topDragExit':
case 'topDragLeave':
case 'topDragOver':
case 'topDragStart':
case 'topDrop':
EventConstructor = SyntheticDragEvent;
break;
case 'topTouchCancel':
case 'topTouchEnd':
case 'topTouchMove':
case 'topTouchStart':
EventConstructor = SyntheticTouchEvent;
break;
case 'topAnimationEnd':
case 'topAnimationIteration':
case 'topAnimationStart':
EventConstructor = SyntheticAnimationEvent;
break;
case 'topTransitionEnd':
EventConstructor = SyntheticTransitionEvent;
break;
case 'topScroll':
EventConstructor = SyntheticUIEvent;
break;
case 'topWheel':
EventConstructor = SyntheticWheelEvent;
break;
case 'topCopy':
case 'topCut':
case 'topPaste':
EventConstructor = SyntheticClipboardEvent;
break;
}
!EventConstructor ? process.env.NODE_ENV !== 'production' ? invariant(false, 'SimpleEventPlugin: Unhandled event type, `%s`.', topLevelType) : _prodInvariant('86', topLevelType) : void 0;
var event = EventConstructor.getPooled(dispatchConfig, targetInst, nativeEvent, nativeEventTarget);
EventPropagators.accumulateTwoPhaseDispatches(event);
return event;
},
didPutListener: function (inst, registrationName, listener) {
// Mobile Safari does not fire properly bubble click events on
// non-interactive elements, which means delegated click listeners do not
// fire. The workaround for this bug involves attaching an empty click
// listener on the target node.
// http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html
if (registrationName === 'onClick' && !isInteractive(inst._tag)) {
var key = getDictionaryKey(inst);
var node = ReactDOMComponentTree.getNodeFromInstance(inst);
if (!onClickListeners[key]) {
onClickListeners[key] = EventListener.listen(node, 'click', emptyFunction);
}
}
},
willDeleteListener: function (inst, registrationName) {
if (registrationName === 'onClick' && !isInteractive(inst._tag)) {
var key = getDictionaryKey(inst);
onClickListeners[key].remove();
delete onClickListeners[key];
}
}
};
module.exports = SimpleEventPlugin;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 157 */
/*!****************************************************!*\
!*** ./~/react-dom/lib/SyntheticAnimationEvent.js ***!
\****************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var SyntheticEvent = __webpack_require__(/*! ./SyntheticEvent */ 54);
/**
* @interface Event
* @see http://www.w3.org/TR/css3-animations/#AnimationEvent-interface
* @see https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent
*/
var AnimationEventInterface = {
animationName: null,
elapsedTime: null,
pseudoElement: null
};
/**
* @param {object} dispatchConfig Configuration used to dispatch this event.
* @param {string} dispatchMarker Marker identifying the event target.
* @param {object} nativeEvent Native browser event.
* @extends {SyntheticEvent}
*/
function SyntheticAnimationEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
}
SyntheticEvent.augmentClass(SyntheticAnimationEvent, AnimationEventInterface);
module.exports = SyntheticAnimationEvent;
/***/ },
/* 158 */
/*!****************************************************!*\
!*** ./~/react-dom/lib/SyntheticClipboardEvent.js ***!
\****************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var SyntheticEvent = __webpack_require__(/*! ./SyntheticEvent */ 54);
/**
* @interface Event
* @see http://www.w3.org/TR/clipboard-apis/
*/
var ClipboardEventInterface = {
clipboardData: function (event) {
return 'clipboardData' in event ? event.clipboardData : window.clipboardData;
}
};
/**
* @param {object} dispatchConfig Configuration used to dispatch this event.
* @param {string} dispatchMarker Marker identifying the event target.
* @param {object} nativeEvent Native browser event.
* @extends {SyntheticUIEvent}
*/
function SyntheticClipboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
}
SyntheticEvent.augmentClass(SyntheticClipboardEvent, ClipboardEventInterface);
module.exports = SyntheticClipboardEvent;
/***/ },
/* 159 */
/*!************************************************!*\
!*** ./~/react-dom/lib/SyntheticFocusEvent.js ***!
\************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var SyntheticUIEvent = __webpack_require__(/*! ./SyntheticUIEvent */ 76);
/**
* @interface FocusEvent
* @see http://www.w3.org/TR/DOM-Level-3-Events/
*/
var FocusEventInterface = {
relatedTarget: null
};
/**
* @param {object} dispatchConfig Configuration used to dispatch this event.
* @param {string} dispatchMarker Marker identifying the event target.
* @param {object} nativeEvent Native browser event.
* @extends {SyntheticUIEvent}
*/
function SyntheticFocusEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
}
SyntheticUIEvent.augmentClass(SyntheticFocusEvent, FocusEventInterface);
module.exports = SyntheticFocusEvent;
/***/ },
/* 160 */
/*!***************************************************!*\
!*** ./~/react-dom/lib/SyntheticKeyboardEvent.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var SyntheticUIEvent = __webpack_require__(/*! ./SyntheticUIEvent */ 76);
var getEventCharCode = __webpack_require__(/*! ./getEventCharCode */ 161);
var getEventKey = __webpack_require__(/*! ./getEventKey */ 162);
var getEventModifierState = __webpack_require__(/*! ./getEventModifierState */ 78);
/**
* @interface KeyboardEvent
* @see http://www.w3.org/TR/DOM-Level-3-Events/
*/
var KeyboardEventInterface = {
key: getEventKey,
location: null,
ctrlKey: null,
shiftKey: null,
altKey: null,
metaKey: null,
repeat: null,
locale: null,
getModifierState: getEventModifierState,
// Legacy Interface
charCode: function (event) {
// `charCode` is the result of a KeyPress event and represents the value of
// the actual printable character.
// KeyPress is deprecated, but its replacement is not yet final and not
// implemented in any major browser. Only KeyPress has charCode.
if (event.type === 'keypress') {
return getEventCharCode(event);
}
return 0;
},
keyCode: function (event) {
// `keyCode` is the result of a KeyDown/Up event and represents the value of
// physical keyboard key.
// The actual meaning of the value depends on the users' keyboard layout
// which cannot be detected. Assuming that it is a US keyboard layout
// provides a surprisingly accurate mapping for US and European users.
// Due to this, it is left to the user to implement at this time.
if (event.type === 'keydown' || event.type === 'keyup') {
return event.keyCode;
}
return 0;
},
which: function (event) {
// `which` is an alias for either `keyCode` or `charCode` depending on the
// type of the event.
if (event.type === 'keypress') {
return getEventCharCode(event);
}
if (event.type === 'keydown' || event.type === 'keyup') {
return event.keyCode;
}
return 0;
}
};
/**
* @param {object} dispatchConfig Configuration used to dispatch this event.
* @param {string} dispatchMarker Marker identifying the event target.
* @param {object} nativeEvent Native browser event.
* @extends {SyntheticUIEvent}
*/
function SyntheticKeyboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
}
SyntheticUIEvent.augmentClass(SyntheticKeyboardEvent, KeyboardEventInterface);
module.exports = SyntheticKeyboardEvent;
/***/ },
/* 161 */
/*!*********************************************!*\
!*** ./~/react-dom/lib/getEventCharCode.js ***!
\*********************************************/
/***/ function(module, exports) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
/**
* `charCode` represents the actual "character code" and is safe to use with
* `String.fromCharCode`. As such, only keys that correspond to printable
* characters produce a valid `charCode`, the only exception to this is Enter.
* The Tab-key is considered non-printable and does not have a `charCode`,
* presumably because it does not produce a tab-character in browsers.
*
* @param {object} nativeEvent Native browser event.
* @return {number} Normalized `charCode` property.
*/
function getEventCharCode(nativeEvent) {
var charCode;
var keyCode = nativeEvent.keyCode;
if ('charCode' in nativeEvent) {
charCode = nativeEvent.charCode;
// FF does not set `charCode` for the Enter-key, check against `keyCode`.
if (charCode === 0 && keyCode === 13) {
charCode = 13;
}
} else {
// IE8 does not implement `charCode`, but `keyCode` has the correct value.
charCode = keyCode;
}
// Some non-printable keys are reported in `charCode`/`keyCode`, discard them.
// Must not discard the (non-)printable Enter-key.
if (charCode >= 32 || charCode === 13) {
return charCode;
}
return 0;
}
module.exports = getEventCharCode;
/***/ },
/* 162 */
/*!****************************************!*\
!*** ./~/react-dom/lib/getEventKey.js ***!
\****************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var getEventCharCode = __webpack_require__(/*! ./getEventCharCode */ 161);
/**
* Normalization of deprecated HTML5 `key` values
* @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
*/
var normalizeKey = {
'Esc': 'Escape',
'Spacebar': ' ',
'Left': 'ArrowLeft',
'Up': 'ArrowUp',
'Right': 'ArrowRight',
'Down': 'ArrowDown',
'Del': 'Delete',
'Win': 'OS',
'Menu': 'ContextMenu',
'Apps': 'ContextMenu',
'Scroll': 'ScrollLock',
'MozPrintableKey': 'Unidentified'
};
/**
* Translation from legacy `keyCode` to HTML5 `key`
* Only special keys supported, all others depend on keyboard layout or browser
* @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
*/
var translateToKey = {
8: 'Backspace',
9: 'Tab',
12: 'Clear',
13: 'Enter',
16: 'Shift',
17: 'Control',
18: 'Alt',
19: 'Pause',
20: 'CapsLock',
27: 'Escape',
32: ' ',
33: 'PageUp',
34: 'PageDown',
35: 'End',
36: 'Home',
37: 'ArrowLeft',
38: 'ArrowUp',
39: 'ArrowRight',
40: 'ArrowDown',
45: 'Insert',
46: 'Delete',
112: 'F1', 113: 'F2', 114: 'F3', 115: 'F4', 116: 'F5', 117: 'F6',
118: 'F7', 119: 'F8', 120: 'F9', 121: 'F10', 122: 'F11', 123: 'F12',
144: 'NumLock',
145: 'ScrollLock',
224: 'Meta'
};
/**
* @param {object} nativeEvent Native browser event.
* @return {string} Normalized `key` property.
*/
function getEventKey(nativeEvent) {
if (nativeEvent.key) {
// Normalize inconsistent values reported by browsers due to
// implementations of a working draft specification.
// FireFox implements `key` but returns `MozPrintableKey` for all
// printable characters (normalized to `Unidentified`), ignore it.
var key = normalizeKey[nativeEvent.key] || nativeEvent.key;
if (key !== 'Unidentified') {
return key;
}
}
// Browser does not implement `key`, polyfill as much of it as we can.
if (nativeEvent.type === 'keypress') {
var charCode = getEventCharCode(nativeEvent);
// The enter-key is technically both printable and non-printable and can
// thus be captured by `keypress`, no other non-printable key should.
return charCode === 13 ? 'Enter' : String.fromCharCode(charCode);
}
if (nativeEvent.type === 'keydown' || nativeEvent.type === 'keyup') {
// While user keyboard layout determines the actual meaning of each
// `keyCode` value, almost all function keys have a universal value.
return translateToKey[nativeEvent.keyCode] || 'Unidentified';
}
return '';
}
module.exports = getEventKey;
/***/ },
/* 163 */
/*!***********************************************!*\
!*** ./~/react-dom/lib/SyntheticDragEvent.js ***!
\***********************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var SyntheticMouseEvent = __webpack_require__(/*! ./SyntheticMouseEvent */ 75);
/**
* @interface DragEvent
* @see http://www.w3.org/TR/DOM-Level-3-Events/
*/
var DragEventInterface = {
dataTransfer: null
};
/**
* @param {object} dispatchConfig Configuration used to dispatch this event.
* @param {string} dispatchMarker Marker identifying the event target.
* @param {object} nativeEvent Native browser event.
* @extends {SyntheticUIEvent}
*/
function SyntheticDragEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
return SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
}
SyntheticMouseEvent.augmentClass(SyntheticDragEvent, DragEventInterface);
module.exports = SyntheticDragEvent;
/***/ },
/* 164 */
/*!************************************************!*\
!*** ./~/react-dom/lib/SyntheticTouchEvent.js ***!
\************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var SyntheticUIEvent = __webpack_require__(/*! ./SyntheticUIEvent */ 76);
var getEventModifierState = __webpack_require__(/*! ./getEventModifierState */ 78);
/**
* @interface TouchEvent
* @see http://www.w3.org/TR/touch-events/
*/
var TouchEventInterface = {
touches: null,
targetTouches: null,
changedTouches: null,
altKey: null,
metaKey: null,
ctrlKey: null,
shiftKey: null,
getModifierState: getEventModifierState
};
/**
* @param {object} dispatchConfig Configuration used to dispatch this event.
* @param {string} dispatchMarker Marker identifying the event target.
* @param {object} nativeEvent Native browser event.
* @extends {SyntheticUIEvent}
*/
function SyntheticTouchEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
}
SyntheticUIEvent.augmentClass(SyntheticTouchEvent, TouchEventInterface);
module.exports = SyntheticTouchEvent;
/***/ },
/* 165 */
/*!*****************************************************!*\
!*** ./~/react-dom/lib/SyntheticTransitionEvent.js ***!
\*****************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var SyntheticEvent = __webpack_require__(/*! ./SyntheticEvent */ 54);
/**
* @interface Event
* @see http://www.w3.org/TR/2009/WD-css3-transitions-20090320/#transition-events-
* @see https://developer.mozilla.org/en-US/docs/Web/API/TransitionEvent
*/
var TransitionEventInterface = {
propertyName: null,
elapsedTime: null,
pseudoElement: null
};
/**
* @param {object} dispatchConfig Configuration used to dispatch this event.
* @param {string} dispatchMarker Marker identifying the event target.
* @param {object} nativeEvent Native browser event.
* @extends {SyntheticEvent}
*/
function SyntheticTransitionEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
}
SyntheticEvent.augmentClass(SyntheticTransitionEvent, TransitionEventInterface);
module.exports = SyntheticTransitionEvent;
/***/ },
/* 166 */
/*!************************************************!*\
!*** ./~/react-dom/lib/SyntheticWheelEvent.js ***!
\************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var SyntheticMouseEvent = __webpack_require__(/*! ./SyntheticMouseEvent */ 75);
/**
* @interface WheelEvent
* @see http://www.w3.org/TR/DOM-Level-3-Events/
*/
var WheelEventInterface = {
deltaX: function (event) {
return 'deltaX' in event ? event.deltaX :
// Fallback to `wheelDeltaX` for Webkit and normalize (right is positive).
'wheelDeltaX' in event ? -event.wheelDeltaX : 0;
},
deltaY: function (event) {
return 'deltaY' in event ? event.deltaY :
// Fallback to `wheelDeltaY` for Webkit and normalize (down is positive).
'wheelDeltaY' in event ? -event.wheelDeltaY :
// Fallback to `wheelDelta` for IE<9 and normalize (down is positive).
'wheelDelta' in event ? -event.wheelDelta : 0;
},
deltaZ: null,
// Browsers without "deltaMode" is reporting in raw wheel delta where one
// notch on the scroll is always +/- 120, roughly equivalent to pixels.
// A good approximation of DOM_DELTA_LINE (1) is 5% of viewport size or
// ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size.
deltaMode: null
};
/**
* @param {object} dispatchConfig Configuration used to dispatch this event.
* @param {string} dispatchMarker Marker identifying the event target.
* @param {object} nativeEvent Native browser event.
* @extends {SyntheticMouseEvent}
*/
function SyntheticWheelEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
return SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
}
SyntheticMouseEvent.augmentClass(SyntheticWheelEvent, WheelEventInterface);
module.exports = SyntheticWheelEvent;
/***/ },
/* 167 */
/*!***************************************!*\
!*** ./~/react-dom/lib/ReactMount.js ***!
\***************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var _prodInvariant = __webpack_require__(/*! ./reactProdInvariant */ 36);
var DOMLazyTree = __webpack_require__(/*! ./DOMLazyTree */ 82);
var DOMProperty = __webpack_require__(/*! ./DOMProperty */ 37);
var React = __webpack_require__(/*! react/lib/React */ 3);
var ReactBrowserEventEmitter = __webpack_require__(/*! ./ReactBrowserEventEmitter */ 106);
var ReactCurrentOwner = __webpack_require__(/*! react/lib/ReactCurrentOwner */ 11);
var ReactDOMComponentTree = __webpack_require__(/*! ./ReactDOMComponentTree */ 35);
var ReactDOMContainerInfo = __webpack_require__(/*! ./ReactDOMContainerInfo */ 168);
var ReactDOMFeatureFlags = __webpack_require__(/*! ./ReactDOMFeatureFlags */ 169);
var ReactFeatureFlags = __webpack_require__(/*! ./ReactFeatureFlags */ 59);
var ReactInstanceMap = __webpack_require__(/*! ./ReactInstanceMap */ 117);
var ReactInstrumentation = __webpack_require__(/*! ./ReactInstrumentation */ 63);
var ReactMarkupChecksum = __webpack_require__(/*! ./ReactMarkupChecksum */ 170);
var ReactReconciler = __webpack_require__(/*! ./ReactReconciler */ 60);
var ReactUpdateQueue = __webpack_require__(/*! ./ReactUpdateQueue */ 136);
var ReactUpdates = __webpack_require__(/*! ./ReactUpdates */ 57);
var emptyObject = __webpack_require__(/*! fbjs/lib/emptyObject */ 21);
var instantiateReactComponent = __webpack_require__(/*! ./instantiateReactComponent */ 119);
var invariant = __webpack_require__(/*! fbjs/lib/invariant */ 9);
var setInnerHTML = __webpack_require__(/*! ./setInnerHTML */ 84);
var shouldUpdateReactComponent = __webpack_require__(/*! ./shouldUpdateReactComponent */ 125);
var warning = __webpack_require__(/*! fbjs/lib/warning */ 12);
var ATTR_NAME = DOMProperty.ID_ATTRIBUTE_NAME;
var ROOT_ATTR_NAME = DOMProperty.ROOT_ATTRIBUTE_NAME;
var ELEMENT_NODE_TYPE = 1;
var DOC_NODE_TYPE = 9;
var DOCUMENT_FRAGMENT_NODE_TYPE = 11;
var instancesByReactRootID = {};
/**
* Finds the index of the first character
* that's not common between the two given strings.
*
* @return {number} the index of the character where the strings diverge
*/
function firstDifferenceIndex(string1, string2) {
var minLen = Math.min(string1.length, string2.length);
for (var i = 0; i < minLen; i++) {
if (string1.charAt(i) !== string2.charAt(i)) {
return i;
}
}
return string1.length === string2.length ? -1 : minLen;
}
/**
* @param {DOMElement|DOMDocument} container DOM element that may contain
* a React component
* @return {?*} DOM element that may have the reactRoot ID, or null.
*/
function getReactRootElementInContainer(container) {
if (!container) {
return null;
}
if (container.nodeType === DOC_NODE_TYPE) {
return container.documentElement;
} else {
return container.firstChild;
}
}
function internalGetID(node) {
// If node is something like a window, document, or text node, none of
// which support attributes or a .getAttribute method, gracefully return
// the empty string, as if the attribute were missing.
return node.getAttribute && node.getAttribute(ATTR_NAME) || '';
}
/**
* Mounts this component and inserts it into the DOM.
*
* @param {ReactComponent} componentInstance The instance to mount.
* @param {DOMElement} container DOM element to mount into.
* @param {ReactReconcileTransaction} transaction
* @param {boolean} shouldReuseMarkup If true, do not insert markup
*/
function mountComponentIntoNode(wrapperInstance, container, transaction, shouldReuseMarkup, context) {
var markerName;
if (ReactFeatureFlags.logTopLevelRenders) {
var wrappedElement = wrapperInstance._currentElement.props.child;
var type = wrappedElement.type;
markerName = 'React mount: ' + (typeof type === 'string' ? type : type.displayName || type.name);
console.time(markerName);
}
var markup = ReactReconciler.mountComponent(wrapperInstance, transaction, null, ReactDOMContainerInfo(wrapperInstance, container), context, 0 /* parentDebugID */
);
if (markerName) {
console.timeEnd(markerName);
}
wrapperInstance._renderedComponent._topLevelWrapper = wrapperInstance;
ReactMount._mountImageIntoNode(markup, container, wrapperInstance, shouldReuseMarkup, transaction);
}
/**
* Batched mount.
*
* @param {ReactComponent} componentInstance The instance to mount.
* @param {DOMElement} container DOM element to mount into.
* @param {boolean} shouldReuseMarkup If true, do not insert markup
*/
function batchedMountComponentIntoNode(componentInstance, container, shouldReuseMarkup, context) {
var transaction = ReactUpdates.ReactReconcileTransaction.getPooled(
/* useCreateElement */
!shouldReuseMarkup && ReactDOMFeatureFlags.useCreateElement);
transaction.perform(mountComponentIntoNode, null, componentInstance, container, transaction, shouldReuseMarkup, context);
ReactUpdates.ReactReconcileTransaction.release(transaction);
}
/**
* Unmounts a component and removes it from the DOM.
*
* @param {ReactComponent} instance React component instance.
* @param {DOMElement} container DOM element to unmount from.
* @final
* @internal
* @see {ReactMount.unmountComponentAtNode}
*/
function unmountComponentFromNode(instance, container, safely) {
if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onBeginFlush();
}
ReactReconciler.unmountComponent(instance, safely);
if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onEndFlush();
}
if (container.nodeType === DOC_NODE_TYPE) {
container = container.documentElement;
}
// http://jsperf.com/emptying-a-node
while (container.lastChild) {
container.removeChild(container.lastChild);
}
}
/**
* True if the supplied DOM node has a direct React-rendered child that is
* not a React root element. Useful for warning in `render`,
* `unmountComponentAtNode`, etc.
*
* @param {?DOMElement} node The candidate DOM node.
* @return {boolean} True if the DOM element contains a direct child that was
* rendered by React but is not a root element.
* @internal
*/
function hasNonRootReactChild(container) {
var rootEl = getReactRootElementInContainer(container);
if (rootEl) {
var inst = ReactDOMComponentTree.getInstanceFromNode(rootEl);
return !!(inst && inst._hostParent);
}
}
/**
* True if the supplied DOM node is a React DOM element and
* it has been rendered by another copy of React.
*
* @param {?DOMElement} node The candidate DOM node.
* @return {boolean} True if the DOM has been rendered by another copy of React
* @internal
*/
function nodeIsRenderedByOtherInstance(container) {
var rootEl = getReactRootElementInContainer(container);
return !!(rootEl && isReactNode(rootEl) && !ReactDOMComponentTree.getInstanceFromNode(rootEl));
}
/**
* True if the supplied DOM node is a valid node element.
*
* @param {?DOMElement} node The candidate DOM node.
* @return {boolean} True if the DOM is a valid DOM node.
* @internal
*/
function isValidContainer(node) {
return !!(node && (node.nodeType === ELEMENT_NODE_TYPE || node.nodeType === DOC_NODE_TYPE || node.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE));
}
/**
* True if the supplied DOM node is a valid React node element.
*
* @param {?DOMElement} node The candidate DOM node.
* @return {boolean} True if the DOM is a valid React DOM node.
* @internal
*/
function isReactNode(node) {
return isValidContainer(node) && (node.hasAttribute(ROOT_ATTR_NAME) || node.hasAttribute(ATTR_NAME));
}
function getHostRootInstanceInContainer(container) {
var rootEl = getReactRootElementInContainer(container);
var prevHostInstance = rootEl && ReactDOMComponentTree.getInstanceFromNode(rootEl);
return prevHostInstance && !prevHostInstance._hostParent ? prevHostInstance : null;
}
function getTopLevelWrapperInContainer(container) {
var root = getHostRootInstanceInContainer(container);
return root ? root._hostContainerInfo._topLevelWrapper : null;
}
/**
* Temporary (?) hack so that we can store all top-level pending updates on
* composites instead of having to worry about different types of components
* here.
*/
var topLevelRootCounter = 1;
var TopLevelWrapper = function () {
this.rootID = topLevelRootCounter++;
};
TopLevelWrapper.prototype.isReactComponent = {};
if (process.env.NODE_ENV !== 'production') {
TopLevelWrapper.displayName = 'TopLevelWrapper';
}
TopLevelWrapper.prototype.render = function () {
return this.props.child;
};
TopLevelWrapper.isReactTopLevelWrapper = true;
/**
* Mounting is the process of initializing a React component by creating its
* representative DOM elements and inserting them into a supplied `container`.
* Any prior content inside `container` is destroyed in the process.
*
* ReactMount.render(
* component,
* document.getElementById('container')
* );
*
* <div id="container"> <-- Supplied `container`.
* <div data-reactid=".3"> <-- Rendered reactRoot of React
* // ... component.
* </div>
* </div>
*
* Inside of `container`, the first element rendered is the "reactRoot".
*/
var ReactMount = {
TopLevelWrapper: TopLevelWrapper,
/**
* Used by devtools. The keys are not important.
*/
_instancesByReactRootID: instancesByReactRootID,
/**
* This is a hook provided to support rendering React components while
* ensuring that the apparent scroll position of its `container` does not
* change.
*
* @param {DOMElement} container The `container` being rendered into.
* @param {function} renderCallback This must be called once to do the render.
*/
scrollMonitor: function (container, renderCallback) {
renderCallback();
},
/**
* Take a component that's already mounted into the DOM and replace its props
* @param {ReactComponent} prevComponent component instance already in the DOM
* @param {ReactElement} nextElement component instance to render
* @param {DOMElement} container container to render into
* @param {?function} callback function triggered on completion
*/
_updateRootComponent: function (prevComponent, nextElement, nextContext, container, callback) {
ReactMount.scrollMonitor(container, function () {
ReactUpdateQueue.enqueueElementInternal(prevComponent, nextElement, nextContext);
if (callback) {
ReactUpdateQueue.enqueueCallbackInternal(prevComponent, callback);
}
});
return prevComponent;
},
/**
* Render a new component into the DOM. Hooked by hooks!
*
* @param {ReactElement} nextElement element to render
* @param {DOMElement} container container to render into
* @param {boolean} shouldReuseMarkup if we should skip the markup insertion
* @return {ReactComponent} nextComponent
*/
_renderNewRootComponent: function (nextElement, container, shouldReuseMarkup, context) {
// Various parts of our code (such as ReactCompositeComponent's
// _renderValidatedComponent) assume that calls to render aren't nested;
// verify that that's the case.
process.env.NODE_ENV !== 'production' ? warning(ReactCurrentOwner.current == null, '_renderNewRootComponent(): Render methods should be a pure function ' + 'of props and state; triggering nested component updates from ' + 'render is not allowed. If necessary, trigger nested updates in ' + 'componentDidUpdate. Check the render method of %s.', ReactCurrentOwner.current && ReactCurrentOwner.current.getName() || 'ReactCompositeComponent') : void 0;
!isValidContainer(container) ? process.env.NODE_ENV !== 'production' ? invariant(false, '_registerComponent(...): Target container is not a DOM element.') : _prodInvariant('37') : void 0;
ReactBrowserEventEmitter.ensureScrollValueMonitoring();
var componentInstance = instantiateReactComponent(nextElement, false);
// The initial render is synchronous but any updates that happen during
// rendering, in componentWillMount or componentDidMount, will be batched
// according to the current batching strategy.
ReactUpdates.batchedUpdates(batchedMountComponentIntoNode, componentInstance, container, shouldReuseMarkup, context);
var wrapperID = componentInstance._instance.rootID;
instancesByReactRootID[wrapperID] = componentInstance;
return componentInstance;
},
/**
* Renders a React component into the DOM in the supplied `container`.
*
* If the React component was previously rendered into `container`, this will
* perform an update on it and only mutate the DOM as necessary to reflect the
* latest React component.
*
* @param {ReactComponent} parentComponent The conceptual parent of this render tree.
* @param {ReactElement} nextElement Component element to render.
* @param {DOMElement} container DOM element to render into.
* @param {?function} callback function triggered on completion
* @return {ReactComponent} Component instance rendered in `container`.
*/
renderSubtreeIntoContainer: function (parentComponent, nextElement, container, callback) {
!(parentComponent != null && ReactInstanceMap.has(parentComponent)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'parentComponent must be a valid React Component') : _prodInvariant('38') : void 0;
return ReactMount._renderSubtreeIntoContainer(parentComponent, nextElement, container, callback);
},
_renderSubtreeIntoContainer: function (parentComponent, nextElement, container, callback) {
ReactUpdateQueue.validateCallback(callback, 'ReactDOM.render');
!React.isValidElement(nextElement) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactDOM.render(): Invalid component element.%s', typeof nextElement === 'string' ? ' Instead of passing a string like \'div\', pass ' + 'React.createElement(\'div\') or <div />.' : typeof nextElement === 'function' ? ' Instead of passing a class like Foo, pass ' + 'React.createElement(Foo) or <Foo />.' :
// Check if it quacks like an element
nextElement != null && nextElement.props !== undefined ? ' This may be caused by unintentionally loading two independent ' + 'copies of React.' : '') : _prodInvariant('39', typeof nextElement === 'string' ? ' Instead of passing a string like \'div\', pass ' + 'React.createElement(\'div\') or <div />.' : typeof nextElement === 'function' ? ' Instead of passing a class like Foo, pass ' + 'React.createElement(Foo) or <Foo />.' : nextElement != null && nextElement.props !== undefined ? ' This may be caused by unintentionally loading two independent ' + 'copies of React.' : '') : void 0;
process.env.NODE_ENV !== 'production' ? warning(!container || !container.tagName || container.tagName.toUpperCase() !== 'BODY', 'render(): Rendering components directly into document.body is ' + 'discouraged, since its children are often manipulated by third-party ' + 'scripts and browser extensions. This may lead to subtle ' + 'reconciliation issues. Try rendering into a container element created ' + 'for your app.') : void 0;
var nextWrappedElement = React.createElement(TopLevelWrapper, { child: nextElement });
var nextContext;
if (parentComponent) {
var parentInst = ReactInstanceMap.get(parentComponent);
nextContext = parentInst._processChildContext(parentInst._context);
} else {
nextContext = emptyObject;
}
var prevComponent = getTopLevelWrapperInContainer(container);
if (prevComponent) {
var prevWrappedElement = prevComponent._currentElement;
var prevElement = prevWrappedElement.props.child;
if (shouldUpdateReactComponent(prevElement, nextElement)) {
var publicInst = prevComponent._renderedComponent.getPublicInstance();
var updatedCallback = callback && function () {
callback.call(publicInst);
};
ReactMount._updateRootComponent(prevComponent, nextWrappedElement, nextContext, container, updatedCallback);
return publicInst;
} else {
ReactMount.unmountComponentAtNode(container);
}
}
var reactRootElement = getReactRootElementInContainer(container);
var containerHasReactMarkup = reactRootElement && !!internalGetID(reactRootElement);
var containerHasNonRootReactChild = hasNonRootReactChild(container);
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(!containerHasNonRootReactChild, 'render(...): Replacing React-rendered children with a new root ' + 'component. If you intended to update the children of this node, ' + 'you should instead have the existing children update their state ' + 'and render the new components instead of calling ReactDOM.render.') : void 0;
if (!containerHasReactMarkup || reactRootElement.nextSibling) {
var rootElementSibling = reactRootElement;
while (rootElementSibling) {
if (internalGetID(rootElementSibling)) {
process.env.NODE_ENV !== 'production' ? warning(false, 'render(): Target node has markup rendered by React, but there ' + 'are unrelated nodes as well. This is most commonly caused by ' + 'white-space inserted around server-rendered markup.') : void 0;
break;
}
rootElementSibling = rootElementSibling.nextSibling;
}
}
}
var shouldReuseMarkup = containerHasReactMarkup && !prevComponent && !containerHasNonRootReactChild;
var component = ReactMount._renderNewRootComponent(nextWrappedElement, container, shouldReuseMarkup, nextContext)._renderedComponent.getPublicInstance();
if (callback) {
callback.call(component);
}
return component;
},
/**
* Renders a React component into the DOM in the supplied `container`.
* See https://facebook.github.io/react/docs/top-level-api.html#reactdom.render
*
* If the React component was previously rendered into `container`, this will
* perform an update on it and only mutate the DOM as necessary to reflect the
* latest React component.
*
* @param {ReactElement} nextElement Component element to render.
* @param {DOMElement} container DOM element to render into.
* @param {?function} callback function triggered on completion
* @return {ReactComponent} Component instance rendered in `container`.
*/
render: function (nextElement, container, callback) {
return ReactMount._renderSubtreeIntoContainer(null, nextElement, container, callback);
},
/**
* Unmounts and destroys the React component rendered in the `container`.
* See https://facebook.github.io/react/docs/top-level-api.html#reactdom.unmountcomponentatnode
*
* @param {DOMElement} container DOM element containing a React component.
* @return {boolean} True if a component was found in and unmounted from
* `container`
*/
unmountComponentAtNode: function (container) {
// Various parts of our code (such as ReactCompositeComponent's
// _renderValidatedComponent) assume that calls to render aren't nested;
// verify that that's the case. (Strictly speaking, unmounting won't cause a
// render but we still don't expect to be in a render call here.)
process.env.NODE_ENV !== 'production' ? warning(ReactCurrentOwner.current == null, 'unmountComponentAtNode(): Render methods should be a pure function ' + 'of props and state; triggering nested component updates from render ' + 'is not allowed. If necessary, trigger nested updates in ' + 'componentDidUpdate. Check the render method of %s.', ReactCurrentOwner.current && ReactCurrentOwner.current.getName() || 'ReactCompositeComponent') : void 0;
!isValidContainer(container) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'unmountComponentAtNode(...): Target container is not a DOM element.') : _prodInvariant('40') : void 0;
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(!nodeIsRenderedByOtherInstance(container), 'unmountComponentAtNode(): The node you\'re attempting to unmount ' + 'was rendered by another copy of React.') : void 0;
}
var prevComponent = getTopLevelWrapperInContainer(container);
if (!prevComponent) {
// Check if the node being unmounted was rendered by React, but isn't a
// root node.
var containerHasNonRootReactChild = hasNonRootReactChild(container);
// Check if the container itself is a React root node.
var isContainerReactRoot = container.nodeType === 1 && container.hasAttribute(ROOT_ATTR_NAME);
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(!containerHasNonRootReactChild, 'unmountComponentAtNode(): The node you\'re attempting to unmount ' + 'was rendered by React and is not a top-level container. %s', isContainerReactRoot ? 'You may have accidentally passed in a React root node instead ' + 'of its container.' : 'Instead, have the parent component update its state and ' + 'rerender in order to remove this component.') : void 0;
}
return false;
}
delete instancesByReactRootID[prevComponent._instance.rootID];
ReactUpdates.batchedUpdates(unmountComponentFromNode, prevComponent, container, false);
return true;
},
_mountImageIntoNode: function (markup, container, instance, shouldReuseMarkup, transaction) {
!isValidContainer(container) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'mountComponentIntoNode(...): Target container is not valid.') : _prodInvariant('41') : void 0;
if (shouldReuseMarkup) {
var rootElement = getReactRootElementInContainer(container);
if (ReactMarkupChecksum.canReuseMarkup(markup, rootElement)) {
ReactDOMComponentTree.precacheNode(instance, rootElement);
return;
} else {
var checksum = rootElement.getAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME);
rootElement.removeAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME);
var rootMarkup = rootElement.outerHTML;
rootElement.setAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME, checksum);
var normalizedMarkup = markup;
if (process.env.NODE_ENV !== 'production') {
// because rootMarkup is retrieved from the DOM, various normalizations
// will have occurred which will not be present in `markup`. Here,
// insert markup into a <div> or <iframe> depending on the container
// type to perform the same normalizations before comparing.
var normalizer;
if (container.nodeType === ELEMENT_NODE_TYPE) {
normalizer = document.createElement('div');
normalizer.innerHTML = markup;
normalizedMarkup = normalizer.innerHTML;
} else {
normalizer = document.createElement('iframe');
document.body.appendChild(normalizer);
normalizer.contentDocument.write(markup);
normalizedMarkup = normalizer.contentDocument.documentElement.outerHTML;
document.body.removeChild(normalizer);
}
}
var diffIndex = firstDifferenceIndex(normalizedMarkup, rootMarkup);
var difference = ' (client) ' + normalizedMarkup.substring(diffIndex - 20, diffIndex + 20) + '\n (server) ' + rootMarkup.substring(diffIndex - 20, diffIndex + 20);
!(container.nodeType !== DOC_NODE_TYPE) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'You\'re trying to render a component to the document using server rendering but the checksum was invalid. This usually means you rendered a different component type or props on the client from the one on the server, or your render() methods are impure. React cannot handle this case due to cross-browser quirks by rendering at the document root. You should look for environment dependent code in your components and ensure the props are the same client and server side:\n%s', difference) : _prodInvariant('42', difference) : void 0;
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(false, 'React attempted to reuse markup in a container but the ' + 'checksum was invalid. This generally means that you are ' + 'using server rendering and the markup generated on the ' + 'server was not what the client was expecting. React injected ' + 'new markup to compensate which works but you have lost many ' + 'of the benefits of server rendering. Instead, figure out ' + 'why the markup being generated is different on the client ' + 'or server:\n%s', difference) : void 0;
}
}
}
!(container.nodeType !== DOC_NODE_TYPE) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'You\'re trying to render a component to the document but you didn\'t use server rendering. We can\'t do this without using server rendering due to cross-browser quirks. See ReactDOMServer.renderToString() for server rendering.') : _prodInvariant('43') : void 0;
if (transaction.useCreateElement) {
while (container.lastChild) {
container.removeChild(container.lastChild);
}
DOMLazyTree.insertTreeBefore(container, markup, null);
} else {
setInnerHTML(container, markup);
ReactDOMComponentTree.precacheNode(instance, container.firstChild);
}
if (process.env.NODE_ENV !== 'production') {
var hostNode = ReactDOMComponentTree.getInstanceFromNode(container.firstChild);
if (hostNode._debugID !== 0) {
ReactInstrumentation.debugTool.onHostOperation({
instanceID: hostNode._debugID,
type: 'mount',
payload: markup.toString()
});
}
}
}
};
module.exports = ReactMount;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 168 */
/*!**************************************************!*\
!*** ./~/react-dom/lib/ReactDOMContainerInfo.js ***!
\**************************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var validateDOMNesting = __webpack_require__(/*! ./validateDOMNesting */ 137);
var DOC_NODE_TYPE = 9;
function ReactDOMContainerInfo(topLevelWrapper, node) {
var info = {
_topLevelWrapper: topLevelWrapper,
_idCounter: 1,
_ownerDocument: node ? node.nodeType === DOC_NODE_TYPE ? node : node.ownerDocument : null,
_node: node,
_tag: node ? node.nodeName.toLowerCase() : null,
_namespaceURI: node ? node.namespaceURI : null
};
if (process.env.NODE_ENV !== 'production') {
info._ancestorInfo = node ? validateDOMNesting.updatedAncestorInfo(null, info._tag, null) : null;
}
return info;
}
module.exports = ReactDOMContainerInfo;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 169 */
/*!*************************************************!*\
!*** ./~/react-dom/lib/ReactDOMFeatureFlags.js ***!
\*************************************************/
/***/ function(module, exports) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var ReactDOMFeatureFlags = {
useCreateElement: true,
useFiber: false
};
module.exports = ReactDOMFeatureFlags;
/***/ },
/* 170 */
/*!************************************************!*\
!*** ./~/react-dom/lib/ReactMarkupChecksum.js ***!
\************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var adler32 = __webpack_require__(/*! ./adler32 */ 171);
var TAG_END = /\/?>/;
var COMMENT_START = /^<\!\-\-/;
var ReactMarkupChecksum = {
CHECKSUM_ATTR_NAME: 'data-react-checksum',
/**
* @param {string} markup Markup string
* @return {string} Markup string with checksum attribute attached
*/
addChecksumToMarkup: function (markup) {
var checksum = adler32(markup);
// Add checksum (handle both parent tags, comments and self-closing tags)
if (COMMENT_START.test(markup)) {
return markup;
} else {
return markup.replace(TAG_END, ' ' + ReactMarkupChecksum.CHECKSUM_ATTR_NAME + '="' + checksum + '"$&');
}
},
/**
* @param {string} markup to use
* @param {DOMElement} element root React element
* @returns {boolean} whether or not the markup is the same
*/
canReuseMarkup: function (markup, element) {
var existingChecksum = element.getAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME);
existingChecksum = existingChecksum && parseInt(existingChecksum, 10);
var markupChecksum = adler32(markup);
return markupChecksum === existingChecksum;
}
};
module.exports = ReactMarkupChecksum;
/***/ },
/* 171 */
/*!************************************!*\
!*** ./~/react-dom/lib/adler32.js ***!
\************************************/
/***/ function(module, exports) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
'use strict';
var MOD = 65521;
// adler32 is not cryptographically strong, and is only used to sanity check that
// markup generated on the server matches the markup generated on the client.
// This implementation (a modified version of the SheetJS version) has been optimized
// for our use case, at the expense of conforming to the adler32 specification
// for non-ascii inputs.
function adler32(data) {
var a = 1;
var b = 0;
var i = 0;
var l = data.length;
var m = l & ~0x3;
while (i < m) {
var n = Math.min(i + 4096, m);
for (; i < n; i += 4) {
b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));
}
a %= MOD;
b %= MOD;
}
for (; i < l; i++) {
b += a += data.charCodeAt(i);
}
a %= MOD;
b %= MOD;
return a | b << 16;
}
module.exports = adler32;
/***/ },
/* 172 */
/*!*****************************************!*\
!*** ./~/react-dom/lib/ReactVersion.js ***!
\*****************************************/
/***/ function(module, exports) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
module.exports = '15.4.2';
/***/ },
/* 173 */
/*!****************************************!*\
!*** ./~/react-dom/lib/findDOMNode.js ***!
\****************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var _prodInvariant = __webpack_require__(/*! ./reactProdInvariant */ 36);
var ReactCurrentOwner = __webpack_require__(/*! react/lib/ReactCurrentOwner */ 11);
var ReactDOMComponentTree = __webpack_require__(/*! ./ReactDOMComponentTree */ 35);
var ReactInstanceMap = __webpack_require__(/*! ./ReactInstanceMap */ 117);
var getHostComponentFromComposite = __webpack_require__(/*! ./getHostComponentFromComposite */ 174);
var invariant = __webpack_require__(/*! fbjs/lib/invariant */ 9);
var warning = __webpack_require__(/*! fbjs/lib/warning */ 12);
/**
* Returns the DOM node rendered by this element.
*
* See https://facebook.github.io/react/docs/top-level-api.html#reactdom.finddomnode
*
* @param {ReactComponent|DOMElement} componentOrElement
* @return {?DOMElement} The root node of this element.
*/
function findDOMNode(componentOrElement) {
if (process.env.NODE_ENV !== 'production') {
var owner = ReactCurrentOwner.current;
if (owner !== null) {
process.env.NODE_ENV !== 'production' ? warning(owner._warnedAboutRefsInRender, '%s is accessing findDOMNode inside its render(). ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', owner.getName() || 'A component') : void 0;
owner._warnedAboutRefsInRender = true;
}
}
if (componentOrElement == null) {
return null;
}
if (componentOrElement.nodeType === 1) {
return componentOrElement;
}
var inst = ReactInstanceMap.get(componentOrElement);
if (inst) {
inst = getHostComponentFromComposite(inst);
return inst ? ReactDOMComponentTree.getNodeFromInstance(inst) : null;
}
if (typeof componentOrElement.render === 'function') {
true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'findDOMNode was called on an unmounted component.') : _prodInvariant('44') : void 0;
} else {
true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Element appears to be neither ReactComponent nor DOMNode (keys: %s)', Object.keys(componentOrElement)) : _prodInvariant('45', Object.keys(componentOrElement)) : void 0;
}
}
module.exports = findDOMNode;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 174 */
/*!**********************************************************!*\
!*** ./~/react-dom/lib/getHostComponentFromComposite.js ***!
\**********************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var ReactNodeTypes = __webpack_require__(/*! ./ReactNodeTypes */ 121);
function getHostComponentFromComposite(inst) {
var type;
while ((type = inst._renderedNodeType) === ReactNodeTypes.COMPOSITE) {
inst = inst._renderedComponent;
}
if (type === ReactNodeTypes.HOST) {
return inst._renderedComponent;
} else if (type === ReactNodeTypes.EMPTY) {
return null;
}
}
module.exports = getHostComponentFromComposite;
/***/ },
/* 175 */
/*!*******************************************************!*\
!*** ./~/react-dom/lib/renderSubtreeIntoContainer.js ***!
\*******************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var ReactMount = __webpack_require__(/*! ./ReactMount */ 167);
module.exports = ReactMount.renderSubtreeIntoContainer;
/***/ },
/* 176 */
/*!********************************************************!*\
!*** ./~/react-dom/lib/ReactDOMUnknownPropertyHook.js ***!
\********************************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var DOMProperty = __webpack_require__(/*! ./DOMProperty */ 37);
var EventPluginRegistry = __webpack_require__(/*! ./EventPluginRegistry */ 44);
var ReactComponentTreeHook = __webpack_require__(/*! react/lib/ReactComponentTreeHook */ 27);
var warning = __webpack_require__(/*! fbjs/lib/warning */ 12);
if (process.env.NODE_ENV !== 'production') {
var reactProps = {
children: true,
dangerouslySetInnerHTML: true,
key: true,
ref: true,
autoFocus: true,
defaultValue: true,
valueLink: true,
defaultChecked: true,
checkedLink: true,
innerHTML: true,
suppressContentEditableWarning: true,
onFocusIn: true,
onFocusOut: true
};
var warnedProperties = {};
var validateProperty = function (tagName, name, debugID) {
if (DOMProperty.properties.hasOwnProperty(name) || DOMProperty.isCustomAttribute(name)) {
return true;
}
if (reactProps.hasOwnProperty(name) && reactProps[name] || warnedProperties.hasOwnProperty(name) && warnedProperties[name]) {
return true;
}
if (EventPluginRegistry.registrationNameModules.hasOwnProperty(name)) {
return true;
}
warnedProperties[name] = true;
var lowerCasedName = name.toLowerCase();
// data-* attributes should be lowercase; suggest the lowercase version
var standardName = DOMProperty.isCustomAttribute(lowerCasedName) ? lowerCasedName : DOMProperty.getPossibleStandardName.hasOwnProperty(lowerCasedName) ? DOMProperty.getPossibleStandardName[lowerCasedName] : null;
var registrationName = EventPluginRegistry.possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? EventPluginRegistry.possibleRegistrationNames[lowerCasedName] : null;
if (standardName != null) {
process.env.NODE_ENV !== 'production' ? warning(false, 'Unknown DOM property %s. Did you mean %s?%s', name, standardName, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
return true;
} else if (registrationName != null) {
process.env.NODE_ENV !== 'production' ? warning(false, 'Unknown event handler property %s. Did you mean `%s`?%s', name, registrationName, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
return true;
} else {
// We were unable to guess which prop the user intended.
// It is likely that the user was just blindly spreading/forwarding props
// Components should be careful to only render valid props/attributes.
// Warning will be invoked in warnUnknownProperties to allow grouping.
return false;
}
};
}
var warnUnknownProperties = function (debugID, element) {
var unknownProps = [];
for (var key in element.props) {
var isValid = validateProperty(element.type, key, debugID);
if (!isValid) {
unknownProps.push(key);
}
}
var unknownPropString = unknownProps.map(function (prop) {
return '`' + prop + '`';
}).join(', ');
if (unknownProps.length === 1) {
process.env.NODE_ENV !== 'production' ? warning(false, 'Unknown prop %s on <%s> tag. Remove this prop from the element. ' + 'For details, see https://fb.me/react-unknown-prop%s', unknownPropString, element.type, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
} else if (unknownProps.length > 1) {
process.env.NODE_ENV !== 'production' ? warning(false, 'Unknown props %s on <%s> tag. Remove these props from the element. ' + 'For details, see https://fb.me/react-unknown-prop%s', unknownPropString, element.type, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
}
};
function handleElement(debugID, element) {
if (element == null || typeof element.type !== 'string') {
return;
}
if (element.type.indexOf('-') >= 0 || element.props.is) {
return;
}
warnUnknownProperties(debugID, element);
}
var ReactDOMUnknownPropertyHook = {
onBeforeMountComponent: function (debugID, element) {
handleElement(debugID, element);
},
onBeforeUpdateComponent: function (debugID, element) {
handleElement(debugID, element);
}
};
module.exports = ReactDOMUnknownPropertyHook;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 177 */
/*!***********************************************************!*\
!*** ./~/react-dom/lib/ReactDOMNullInputValuePropHook.js ***!
\***********************************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var ReactComponentTreeHook = __webpack_require__(/*! react/lib/ReactComponentTreeHook */ 27);
var warning = __webpack_require__(/*! fbjs/lib/warning */ 12);
var didWarnValueNull = false;
function handleElement(debugID, element) {
if (element == null) {
return;
}
if (element.type !== 'input' && element.type !== 'textarea' && element.type !== 'select') {
return;
}
if (element.props != null && element.props.value === null && !didWarnValueNull) {
process.env.NODE_ENV !== 'production' ? warning(false, '`value` prop on `%s` should not be null. ' + 'Consider using the empty string to clear the component or `undefined` ' + 'for uncontrolled components.%s', element.type, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
didWarnValueNull = true;
}
}
var ReactDOMNullInputValuePropHook = {
onBeforeMountComponent: function (debugID, element) {
handleElement(debugID, element);
},
onBeforeUpdateComponent: function (debugID, element) {
handleElement(debugID, element);
}
};
module.exports = ReactDOMNullInputValuePropHook;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 178 */
/*!****************************************************!*\
!*** ./~/react-dom/lib/ReactDOMInvalidARIAHook.js ***!
\****************************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var DOMProperty = __webpack_require__(/*! ./DOMProperty */ 37);
var ReactComponentTreeHook = __webpack_require__(/*! react/lib/ReactComponentTreeHook */ 27);
var warning = __webpack_require__(/*! fbjs/lib/warning */ 12);
var warnedProperties = {};
var rARIA = new RegExp('^(aria)-[' + DOMProperty.ATTRIBUTE_NAME_CHAR + ']*$');
function validateProperty(tagName, name, debugID) {
if (warnedProperties.hasOwnProperty(name) && warnedProperties[name]) {
return true;
}
if (rARIA.test(name)) {
var lowerCasedName = name.toLowerCase();
var standardName = DOMProperty.getPossibleStandardName.hasOwnProperty(lowerCasedName) ? DOMProperty.getPossibleStandardName[lowerCasedName] : null;
// If this is an aria-* attribute, but is not listed in the known DOM
// DOM properties, then it is an invalid aria-* attribute.
if (standardName == null) {
warnedProperties[name] = true;
return false;
}
// aria-* attributes should be lowercase; suggest the lowercase version.
if (name !== standardName) {
process.env.NODE_ENV !== 'production' ? warning(false, 'Unknown ARIA attribute %s. Did you mean %s?%s', name, standardName, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
warnedProperties[name] = true;
return true;
}
}
return true;
}
function warnInvalidARIAProps(debugID, element) {
var invalidProps = [];
for (var key in element.props) {
var isValid = validateProperty(element.type, key, debugID);
if (!isValid) {
invalidProps.push(key);
}
}
var unknownPropString = invalidProps.map(function (prop) {
return '`' + prop + '`';
}).join(', ');
if (invalidProps.length === 1) {
process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid aria prop %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop%s', unknownPropString, element.type, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
} else if (invalidProps.length > 1) {
process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid aria props %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop%s', unknownPropString, element.type, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
}
}
function handleElement(debugID, element) {
if (element == null || typeof element.type !== 'string') {
return;
}
if (element.type.indexOf('-') >= 0 || element.props.is) {
return;
}
warnInvalidARIAProps(debugID, element);
}
var ReactDOMInvalidARIAHook = {
onBeforeMountComponent: function (debugID, element) {
if (process.env.NODE_ENV !== 'production') {
handleElement(debugID, element);
}
},
onBeforeUpdateComponent: function (debugID, element) {
if (process.env.NODE_ENV !== 'production') {
handleElement(debugID, element);
}
}
};
module.exports = ReactDOMInvalidARIAHook;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 179 */
/*!******************************!*\
!*** ./~/redux/lib/index.js ***!
\******************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {'use strict';
exports.__esModule = true;
exports.compose = exports.applyMiddleware = exports.bindActionCreators = exports.combineReducers = exports.createStore = undefined;
var _createStore = __webpack_require__(/*! ./createStore */ 180);
var _createStore2 = _interopRequireDefault(_createStore);
var _combineReducers = __webpack_require__(/*! ./combineReducers */ 195);
var _combineReducers2 = _interopRequireDefault(_combineReducers);
var _bindActionCreators = __webpack_require__(/*! ./bindActionCreators */ 197);
var _bindActionCreators2 = _interopRequireDefault(_bindActionCreators);
var _applyMiddleware = __webpack_require__(/*! ./applyMiddleware */ 198);
var _applyMiddleware2 = _interopRequireDefault(_applyMiddleware);
var _compose = __webpack_require__(/*! ./compose */ 199);
var _compose2 = _interopRequireDefault(_compose);
var _warning = __webpack_require__(/*! ./utils/warning */ 196);
var _warning2 = _interopRequireDefault(_warning);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
/*
* This is a dummy function to check if the function name has been altered by minification.
* If the function has been minified and NODE_ENV !== 'production', warn the user.
*/
function isCrushed() {}
if (process.env.NODE_ENV !== 'production' && typeof isCrushed.name === 'string' && isCrushed.name !== 'isCrushed') {
(0, _warning2['default'])('You are currently using minified code outside of NODE_ENV === \'production\'. ' + 'This means that you are running a slower development build of Redux. ' + 'You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify ' + 'or DefinePlugin for webpack (http://stackoverflow.com/questions/30030031) ' + 'to ensure you have the correct code for your production build.');
}
exports.createStore = _createStore2['default'];
exports.combineReducers = _combineReducers2['default'];
exports.bindActionCreators = _bindActionCreators2['default'];
exports.applyMiddleware = _applyMiddleware2['default'];
exports.compose = _compose2['default'];
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 180 */
/*!************************************!*\
!*** ./~/redux/lib/createStore.js ***!
\************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
exports.ActionTypes = undefined;
exports['default'] = createStore;
var _isPlainObject = __webpack_require__(/*! lodash/isPlainObject */ 181);
var _isPlainObject2 = _interopRequireDefault(_isPlainObject);
var _symbolObservable = __webpack_require__(/*! symbol-observable */ 191);
var _symbolObservable2 = _interopRequireDefault(_symbolObservable);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
/**
* These are private action types reserved by Redux.
* For any unknown actions, you must return the current state.
* If the current state is undefined, you must return the initial state.
* Do not reference these action types directly in your code.
*/
var ActionTypes = exports.ActionTypes = {
INIT: '@@redux/INIT'
};
/**
* Creates a Redux store that holds the state tree.
* The only way to change the data in the store is to call `dispatch()` on it.
*
* There should only be a single store in your app. To specify how different
* parts of the state tree respond to actions, you may combine several reducers
* into a single reducer function by using `combineReducers`.
*
* @param {Function} reducer A function that returns the next state tree, given
* the current state tree and the action to handle.
*
* @param {any} [preloadedState] The initial state. You may optionally specify it
* to hydrate the state from the server in universal apps, or to restore a
* previously serialized user session.
* If you use `combineReducers` to produce the root reducer function, this must be
* an object with the same shape as `combineReducers` keys.
*
* @param {Function} enhancer The store enhancer. You may optionally specify it
* to enhance the store with third-party capabilities such as middleware,
* time travel, persistence, etc. The only store enhancer that ships with Redux
* is `applyMiddleware()`.
*
* @returns {Store} A Redux store that lets you read the state, dispatch actions
* and subscribe to changes.
*/
function createStore(reducer, preloadedState, enhancer) {
var _ref2;
if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {
enhancer = preloadedState;
preloadedState = undefined;
}
if (typeof enhancer !== 'undefined') {
if (typeof enhancer !== 'function') {
throw new Error('Expected the enhancer to be a function.');
}
return enhancer(createStore)(reducer, preloadedState);
}
if (typeof reducer !== 'function') {
throw new Error('Expected the reducer to be a function.');
}
var currentReducer = reducer;
var currentState = preloadedState;
var currentListeners = [];
var nextListeners = currentListeners;
var isDispatching = false;
function ensureCanMutateNextListeners() {
if (nextListeners === currentListeners) {
nextListeners = currentListeners.slice();
}
}
/**
* Reads the state tree managed by the store.
*
* @returns {any} The current state tree of your application.
*/
function getState() {
return currentState;
}
/**
* Adds a change listener. It will be called any time an action is dispatched,
* and some part of the state tree may potentially have changed. You may then
* call `getState()` to read the current state tree inside the callback.
*
* You may call `dispatch()` from a change listener, with the following
* caveats:
*
* 1. The subscriptions are snapshotted just before every `dispatch()` call.
* If you subscribe or unsubscribe while the listeners are being invoked, this
* will not have any effect on the `dispatch()` that is currently in progress.
* However, the next `dispatch()` call, whether nested or not, will use a more
* recent snapshot of the subscription list.
*
* 2. The listener should not expect to see all state changes, as the state
* might have been updated multiple times during a nested `dispatch()` before
* the listener is called. It is, however, guaranteed that all subscribers
* registered before the `dispatch()` started will be called with the latest
* state by the time it exits.
*
* @param {Function} listener A callback to be invoked on every dispatch.
* @returns {Function} A function to remove this change listener.
*/
function subscribe(listener) {
if (typeof listener !== 'function') {
throw new Error('Expected listener to be a function.');
}
var isSubscribed = true;
ensureCanMutateNextListeners();
nextListeners.push(listener);
return function unsubscribe() {
if (!isSubscribed) {
return;
}
isSubscribed = false;
ensureCanMutateNextListeners();
var index = nextListeners.indexOf(listener);
nextListeners.splice(index, 1);
};
}
/**
* Dispatches an action. It is the only way to trigger a state change.
*
* The `reducer` function, used to create the store, will be called with the
* current state tree and the given `action`. Its return value will
* be considered the **next** state of the tree, and the change listeners
* will be notified.
*
* The base implementation only supports plain object actions. If you want to
* dispatch a Promise, an Observable, a thunk, or something else, you need to
* wrap your store creating function into the corresponding middleware. For
* example, see the documentation for the `redux-thunk` package. Even the
* middleware will eventually dispatch plain object actions using this method.
*
* @param {Object} action A plain object representing “what changed”. It is
* a good idea to keep actions serializable so you can record and replay user
* sessions, or use the time travelling `redux-devtools`. An action must have
* a `type` property which may not be `undefined`. It is a good idea to use
* string constants for action types.
*
* @returns {Object} For convenience, the same action object you dispatched.
*
* Note that, if you use a custom middleware, it may wrap `dispatch()` to
* return something else (for example, a Promise you can await).
*/
function dispatch(action) {
if (!(0, _isPlainObject2['default'])(action)) {
throw new Error('Actions must be plain objects. ' + 'Use custom middleware for async actions.');
}
if (typeof action.type === 'undefined') {
throw new Error('Actions may not have an undefined "type" property. ' + 'Have you misspelled a constant?');
}
if (isDispatching) {
throw new Error('Reducers may not dispatch actions.');
}
try {
isDispatching = true;
currentState = currentReducer(currentState, action);
} finally {
isDispatching = false;
}
var listeners = currentListeners = nextListeners;
for (var i = 0; i < listeners.length; i++) {
listeners[i]();
}
return action;
}
/**
* Replaces the reducer currently used by the store to calculate the state.
*
* You might need this if your app implements code splitting and you want to
* load some of the reducers dynamically. You might also need this if you
* implement a hot reloading mechanism for Redux.
*
* @param {Function} nextReducer The reducer for the store to use instead.
* @returns {void}
*/
function replaceReducer(nextReducer) {
if (typeof nextReducer !== 'function') {
throw new Error('Expected the nextReducer to be a function.');
}
currentReducer = nextReducer;
dispatch({ type: ActionTypes.INIT });
}
/**
* Interoperability point for observable/reactive libraries.
* @returns {observable} A minimal observable of state changes.
* For more information, see the observable proposal:
* https://github.com/zenparsing/es-observable
*/
function observable() {
var _ref;
var outerSubscribe = subscribe;
return _ref = {
/**
* The minimal observable subscription method.
* @param {Object} observer Any object that can be used as an observer.
* The observer object should have a `next` method.
* @returns {subscription} An object with an `unsubscribe` method that can
* be used to unsubscribe the observable from the store, and prevent further
* emission of values from the observable.
*/
subscribe: function subscribe(observer) {
if (typeof observer !== 'object') {
throw new TypeError('Expected the observer to be an object.');
}
function observeState() {
if (observer.next) {
observer.next(getState());
}
}
observeState();
var unsubscribe = outerSubscribe(observeState);
return { unsubscribe: unsubscribe };
}
}, _ref[_symbolObservable2['default']] = function () {
return this;
}, _ref;
}
// When a store is created, an "INIT" action is dispatched so that every
// reducer returns their initial state. This effectively populates
// the initial state tree.
dispatch({ type: ActionTypes.INIT });
return _ref2 = {
dispatch: dispatch,
subscribe: subscribe,
getState: getState,
replaceReducer: replaceReducer
}, _ref2[_symbolObservable2['default']] = observable, _ref2;
}
/***/ },
/* 181 */
/*!*******************************************!*\
!*** ./~/redux/~/lodash/isPlainObject.js ***!
\*******************************************/
/***/ function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ 182),
getPrototype = __webpack_require__(/*! ./_getPrototype */ 188),
isObjectLike = __webpack_require__(/*! ./isObjectLike */ 190);
/** `Object#toString` result references. */
var objectTag = '[object Object]';
/** Used for built-in method references. */
var funcProto = Function.prototype,
objectProto = Object.prototype;
/** Used to resolve the decompiled source of functions. */
var funcToString = funcProto.toString;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/** Used to infer the `Object` constructor. */
var objectCtorString = funcToString.call(Object);
/**
* Checks if `value` is a plain object, that is, an object created by the
* `Object` constructor or one with a `[[Prototype]]` of `null`.
*
* @static
* @memberOf _
* @since 0.8.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
* @example
*
* function Foo() {
* this.a = 1;
* }
*
* _.isPlainObject(new Foo);
* // => false
*
* _.isPlainObject([1, 2, 3]);
* // => false
*
* _.isPlainObject({ 'x': 0, 'y': 0 });
* // => true
*
* _.isPlainObject(Object.create(null));
* // => true
*/
function isPlainObject(value) {
if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
return false;
}
var proto = getPrototype(value);
if (proto === null) {
return true;
}
var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
return typeof Ctor == 'function' && Ctor instanceof Ctor &&
funcToString.call(Ctor) == objectCtorString;
}
module.exports = isPlainObject;
/***/ },
/* 182 */
/*!*****************************************!*\
!*** ./~/redux/~/lodash/_baseGetTag.js ***!
\*****************************************/
/***/ function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__(/*! ./_Symbol */ 183),
getRawTag = __webpack_require__(/*! ./_getRawTag */ 186),
objectToString = __webpack_require__(/*! ./_objectToString */ 187);
/** `Object#toString` result references. */
var nullTag = '[object Null]',
undefinedTag = '[object Undefined]';
/** Built-in value references. */
var 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);
}
module.exports = baseGetTag;
/***/ },
/* 183 */
/*!*************************************!*\
!*** ./~/redux/~/lodash/_Symbol.js ***!
\*************************************/
/***/ function(module, exports, __webpack_require__) {
var root = __webpack_require__(/*! ./_root */ 184);
/** Built-in value references. */
var Symbol = root.Symbol;
module.exports = Symbol;
/***/ },
/* 184 */
/*!***********************************!*\
!*** ./~/redux/~/lodash/_root.js ***!
\***********************************/
/***/ function(module, exports, __webpack_require__) {
var freeGlobal = __webpack_require__(/*! ./_freeGlobal */ 185);
/** 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')();
module.exports = root;
/***/ },
/* 185 */
/*!*****************************************!*\
!*** ./~/redux/~/lodash/_freeGlobal.js ***!
\*****************************************/
/***/ function(module, exports) {
/* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
module.exports = freeGlobal;
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
/***/ },
/* 186 */
/*!****************************************!*\
!*** ./~/redux/~/lodash/_getRawTag.js ***!
\****************************************/
/***/ function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__(/*! ./_Symbol */ 183);
/** 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 symToStringTag = Symbol ? Symbol.toStringTag : undefined;
/**
* 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;
}
module.exports = getRawTag;
/***/ },
/* 187 */
/*!*********************************************!*\
!*** ./~/redux/~/lodash/_objectToString.js ***!
\*********************************************/
/***/ function(module, exports) {
/** 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 nativeObjectToString = objectProto.toString;
/**
* 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);
}
module.exports = objectToString;
/***/ },
/* 188 */
/*!*******************************************!*\
!*** ./~/redux/~/lodash/_getPrototype.js ***!
\*******************************************/
/***/ function(module, exports, __webpack_require__) {
var overArg = __webpack_require__(/*! ./_overArg */ 189);
/** Built-in value references. */
var getPrototype = overArg(Object.getPrototypeOf, Object);
module.exports = getPrototype;
/***/ },
/* 189 */
/*!**************************************!*\
!*** ./~/redux/~/lodash/_overArg.js ***!
\**************************************/
/***/ function(module, exports) {
/**
* Creates a unary function that invokes `func` with its argument transformed.
*
* @private
* @param {Function} func The function to wrap.
* @param {Function} transform The argument transform.
* @returns {Function} Returns the new function.
*/
function overArg(func, transform) {
return function(arg) {
return func(transform(arg));
};
}
module.exports = overArg;
/***/ },
/* 190 */
/*!******************************************!*\
!*** ./~/redux/~/lodash/isObjectLike.js ***!
\******************************************/
/***/ function(module, exports) {
/**
* 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 != null && typeof value == 'object';
}
module.exports = isObjectLike;
/***/ },
/* 191 */
/*!**************************************!*\
!*** ./~/symbol-observable/index.js ***!
\**************************************/
/***/ function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(/*! ./lib/index */ 192);
/***/ },
/* 192 */
/*!******************************************!*\
!*** ./~/symbol-observable/lib/index.js ***!
\******************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global, module) {'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _ponyfill = __webpack_require__(/*! ./ponyfill */ 194);
var _ponyfill2 = _interopRequireDefault(_ponyfill);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var root; /* global window */
if (typeof self !== 'undefined') {
root = self;
} else if (typeof window !== 'undefined') {
root = window;
} else if (typeof global !== 'undefined') {
root = global;
} else if (true) {
root = module;
} else {
root = Function('return this')();
}
var result = (0, _ponyfill2['default'])(root);
exports['default'] = result;
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()), __webpack_require__(/*! ./../../webpack/buildin/module.js */ 193)(module)))
/***/ },
/* 193 */
/*!***********************************!*\
!*** (webpack)/buildin/module.js ***!
\***********************************/
/***/ function(module, exports) {
module.exports = function(module) {
if(!module.webpackPolyfill) {
module.deprecate = function() {};
module.paths = [];
// module.parent = undefined by default
module.children = [];
module.webpackPolyfill = 1;
}
return module;
}
/***/ },
/* 194 */
/*!*********************************************!*\
!*** ./~/symbol-observable/lib/ponyfill.js ***!
\*********************************************/
/***/ function(module, exports) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = symbolObservablePonyfill;
function symbolObservablePonyfill(root) {
var result;
var _Symbol = root.Symbol;
if (typeof _Symbol === 'function') {
if (_Symbol.observable) {
result = _Symbol.observable;
} else {
result = _Symbol('observable');
_Symbol.observable = result;
}
} else {
result = '@@observable';
}
return result;
};
/***/ },
/* 195 */
/*!****************************************!*\
!*** ./~/redux/lib/combineReducers.js ***!
\****************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {'use strict';
exports.__esModule = true;
exports['default'] = combineReducers;
var _createStore = __webpack_require__(/*! ./createStore */ 180);
var _isPlainObject = __webpack_require__(/*! lodash/isPlainObject */ 181);
var _isPlainObject2 = _interopRequireDefault(_isPlainObject);
var _warning = __webpack_require__(/*! ./utils/warning */ 196);
var _warning2 = _interopRequireDefault(_warning);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function getUndefinedStateErrorMessage(key, action) {
var actionType = action && action.type;
var actionName = actionType && '"' + actionType.toString() + '"' || 'an action';
return 'Given action ' + actionName + ', reducer "' + key + '" returned undefined. ' + 'To ignore an action, you must explicitly return the previous state.';
}
function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {
var reducerKeys = Object.keys(reducers);
var argumentName = action && action.type === _createStore.ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';
if (reducerKeys.length === 0) {
return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';
}
if (!(0, _isPlainObject2['default'])(inputState)) {
return 'The ' + argumentName + ' has unexpected type of "' + {}.toString.call(inputState).match(/\s([a-z|A-Z]+)/)[1] + '". Expected argument to be an object with the following ' + ('keys: "' + reducerKeys.join('", "') + '"');
}
var unexpectedKeys = Object.keys(inputState).filter(function (key) {
return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];
});
unexpectedKeys.forEach(function (key) {
unexpectedKeyCache[key] = true;
});
if (unexpectedKeys.length > 0) {
return 'Unexpected ' + (unexpectedKeys.length > 1 ? 'keys' : 'key') + ' ' + ('"' + unexpectedKeys.join('", "') + '" found in ' + argumentName + '. ') + 'Expected to find one of the known reducer keys instead: ' + ('"' + reducerKeys.join('", "') + '". Unexpected keys will be ignored.');
}
}
function assertReducerSanity(reducers) {
Object.keys(reducers).forEach(function (key) {
var reducer = reducers[key];
var initialState = reducer(undefined, { type: _createStore.ActionTypes.INIT });
if (typeof initialState === 'undefined') {
throw new Error('Reducer "' + key + '" returned undefined during initialization. ' + 'If the state passed to the reducer is undefined, you must ' + 'explicitly return the initial state. The initial state may ' + 'not be undefined.');
}
var type = '@@redux/PROBE_UNKNOWN_ACTION_' + Math.random().toString(36).substring(7).split('').join('.');
if (typeof reducer(undefined, { type: type }) === 'undefined') {
throw new Error('Reducer "' + key + '" returned undefined when probed with a random type. ' + ('Don\'t try to handle ' + _createStore.ActionTypes.INIT + ' or other actions in "redux/*" ') + 'namespace. They are considered private. Instead, you must return the ' + 'current state for any unknown actions, unless it is undefined, ' + 'in which case you must return the initial state, regardless of the ' + 'action type. The initial state may not be undefined.');
}
});
}
/**
* Turns an object whose values are different reducer functions, into a single
* reducer function. It will call every child reducer, and gather their results
* into a single state object, whose keys correspond to the keys of the passed
* reducer functions.
*
* @param {Object} reducers An object whose values correspond to different
* reducer functions that need to be combined into one. One handy way to obtain
* it is to use ES6 `import * as reducers` syntax. The reducers may never return
* undefined for any action. Instead, they should return their initial state
* if the state passed to them was undefined, and the current state for any
* unrecognized action.
*
* @returns {Function} A reducer function that invokes every reducer inside the
* passed object, and builds a state object with the same shape.
*/
function combineReducers(reducers) {
var reducerKeys = Object.keys(reducers);
var finalReducers = {};
for (var i = 0; i < reducerKeys.length; i++) {
var key = reducerKeys[i];
if (process.env.NODE_ENV !== 'production') {
if (typeof reducers[key] === 'undefined') {
(0, _warning2['default'])('No reducer provided for key "' + key + '"');
}
}
if (typeof reducers[key] === 'function') {
finalReducers[key] = reducers[key];
}
}
var finalReducerKeys = Object.keys(finalReducers);
if (process.env.NODE_ENV !== 'production') {
var unexpectedKeyCache = {};
}
var sanityError;
try {
assertReducerSanity(finalReducers);
} catch (e) {
sanityError = e;
}
return function combination() {
var state = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
var action = arguments[1];
if (sanityError) {
throw sanityError;
}
if (process.env.NODE_ENV !== 'production') {
var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);
if (warningMessage) {
(0, _warning2['default'])(warningMessage);
}
}
var hasChanged = false;
var nextState = {};
for (var i = 0; i < finalReducerKeys.length; i++) {
var key = finalReducerKeys[i];
var reducer = finalReducers[key];
var previousStateForKey = state[key];
var nextStateForKey = reducer(previousStateForKey, action);
if (typeof nextStateForKey === 'undefined') {
var errorMessage = getUndefinedStateErrorMessage(key, action);
throw new Error(errorMessage);
}
nextState[key] = nextStateForKey;
hasChanged = hasChanged || nextStateForKey !== previousStateForKey;
}
return hasChanged ? nextState : state;
};
}
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 196 */
/*!**************************************!*\
!*** ./~/redux/lib/utils/warning.js ***!
\**************************************/
/***/ function(module, exports) {
'use strict';
exports.__esModule = true;
exports['default'] = warning;
/**
* Prints a warning in the console if it exists.
*
* @param {String} message The warning message.
* @returns {void}
*/
function warning(message) {
/* eslint-disable no-console */
if (typeof console !== 'undefined' && typeof console.error === 'function') {
console.error(message);
}
/* eslint-enable no-console */
try {
// This error was thrown as a convenience so that if you enable
// "break on all exceptions" in your console,
// it would pause the execution at this line.
throw new Error(message);
/* eslint-disable no-empty */
} catch (e) {}
/* eslint-enable no-empty */
}
/***/ },
/* 197 */
/*!*******************************************!*\
!*** ./~/redux/lib/bindActionCreators.js ***!
\*******************************************/
/***/ function(module, exports) {
'use strict';
exports.__esModule = true;
exports['default'] = bindActionCreators;
function bindActionCreator(actionCreator, dispatch) {
return function () {
return dispatch(actionCreator.apply(undefined, arguments));
};
}
/**
* Turns an object whose values are action creators, into an object with the
* same keys, but with every function wrapped into a `dispatch` call so they
* may be invoked directly. This is just a convenience method, as you can call
* `store.dispatch(MyActionCreators.doSomething())` yourself just fine.
*
* For convenience, you can also pass a single function as the first argument,
* and get a function in return.
*
* @param {Function|Object} actionCreators An object whose values are action
* creator functions. One handy way to obtain it is to use ES6 `import * as`
* syntax. You may also pass a single function.
*
* @param {Function} dispatch The `dispatch` function available on your Redux
* store.
*
* @returns {Function|Object} The object mimicking the original object, but with
* every action creator wrapped into the `dispatch` call. If you passed a
* function as `actionCreators`, the return value will also be a single
* function.
*/
function bindActionCreators(actionCreators, dispatch) {
if (typeof actionCreators === 'function') {
return bindActionCreator(actionCreators, dispatch);
}
if (typeof actionCreators !== 'object' || actionCreators === null) {
throw new Error('bindActionCreators expected an object or a function, instead received ' + (actionCreators === null ? 'null' : typeof actionCreators) + '. ' + 'Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');
}
var keys = Object.keys(actionCreators);
var boundActionCreators = {};
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
var actionCreator = actionCreators[key];
if (typeof actionCreator === 'function') {
boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);
}
}
return boundActionCreators;
}
/***/ },
/* 198 */
/*!****************************************!*\
!*** ./~/redux/lib/applyMiddleware.js ***!
\****************************************/
/***/ 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; };
exports['default'] = applyMiddleware;
var _compose = __webpack_require__(/*! ./compose */ 199);
var _compose2 = _interopRequireDefault(_compose);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
/**
* Creates a store enhancer that applies middleware to the dispatch method
* of the Redux store. This is handy for a variety of tasks, such as expressing
* asynchronous actions in a concise manner, or logging every action payload.
*
* See `redux-thunk` package as an example of the Redux middleware.
*
* Because middleware is potentially asynchronous, this should be the first
* store enhancer in the composition chain.
*
* Note that each middleware will be given the `dispatch` and `getState` functions
* as named arguments.
*
* @param {...Function} middlewares The middleware chain to be applied.
* @returns {Function} A store enhancer applying the middleware.
*/
function applyMiddleware() {
for (var _len = arguments.length, middlewares = Array(_len), _key = 0; _key < _len; _key++) {
middlewares[_key] = arguments[_key];
}
return function (createStore) {
return function (reducer, preloadedState, enhancer) {
var store = createStore(reducer, preloadedState, enhancer);
var _dispatch = store.dispatch;
var chain = [];
var middlewareAPI = {
getState: store.getState,
dispatch: function dispatch(action) {
return _dispatch(action);
}
};
chain = middlewares.map(function (middleware) {
return middleware(middlewareAPI);
});
_dispatch = _compose2['default'].apply(undefined, chain)(store.dispatch);
return _extends({}, store, {
dispatch: _dispatch
});
};
};
}
/***/ },
/* 199 */
/*!********************************!*\
!*** ./~/redux/lib/compose.js ***!
\********************************/
/***/ function(module, exports) {
"use strict";
exports.__esModule = true;
exports["default"] = compose;
/**
* Composes single-argument functions from right to left. The rightmost
* function can take multiple arguments as it provides the signature for
* the resulting composite function.
*
* @param {...Function} funcs The functions to compose.
* @returns {Function} A function obtained by composing the argument functions
* from right to left. For example, compose(f, g, h) is identical to doing
* (...args) => f(g(h(...args))).
*/
function compose() {
for (var _len = arguments.length, funcs = Array(_len), _key = 0; _key < _len; _key++) {
funcs[_key] = arguments[_key];
}
if (funcs.length === 0) {
return function (arg) {
return arg;
};
}
if (funcs.length === 1) {
return funcs[0];
}
var last = funcs[funcs.length - 1];
var rest = funcs.slice(0, -1);
return function () {
return rest.reduceRight(function (composed, f) {
return f(composed);
}, last.apply(undefined, arguments));
};
}
/***/ },
/* 200 */
/*!************************************!*\
!*** ./~/react-redux/lib/index.js ***!
\************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
exports.connect = exports.connectAdvanced = exports.Provider = undefined;
var _Provider = __webpack_require__(/*! ./components/Provider */ 201);
var _Provider2 = _interopRequireDefault(_Provider);
var _connectAdvanced = __webpack_require__(/*! ./components/connectAdvanced */ 205);
var _connectAdvanced2 = _interopRequireDefault(_connectAdvanced);
var _connect = __webpack_require__(/*! ./connect/connect */ 208);
var _connect2 = _interopRequireDefault(_connect);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.Provider = _Provider2.default;
exports.connectAdvanced = _connectAdvanced2.default;
exports.connect = _connect2.default;
/***/ },
/* 201 */
/*!**************************************************!*\
!*** ./~/react-redux/lib/components/Provider.js ***!
\**************************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {'use strict';
exports.__esModule = true;
exports.default = undefined;
var _react = __webpack_require__(/*! react */ 2);
var _Subscription = __webpack_require__(/*! ../utils/Subscription */ 202);
var _Subscription2 = _interopRequireDefault(_Subscription);
var _storeShape = __webpack_require__(/*! ../utils/storeShape */ 203);
var _storeShape2 = _interopRequireDefault(_storeShape);
var _warning = __webpack_require__(/*! ../utils/warning */ 204);
var _warning2 = _interopRequireDefault(_warning);
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 didWarnAboutReceivingStore = false;
function warnAboutReceivingStore() {
if (didWarnAboutReceivingStore) {
return;
}
didWarnAboutReceivingStore = true;
(0, _warning2.default)('<Provider> does not support changing `store` on the fly. ' + 'It is most likely that you see this error because you updated to ' + 'Redux 2.x and React Redux 2.x which no longer hot reload reducers ' + 'automatically. See https://github.com/reactjs/react-redux/releases/' + 'tag/v2.0.0 for the migration instructions.');
}
var Provider = function (_Component) {
_inherits(Provider, _Component);
Provider.prototype.getChildContext = function getChildContext() {
return { store: this.store, storeSubscription: null };
};
function Provider(props, context) {
_classCallCheck(this, Provider);
var _this = _possibleConstructorReturn(this, _Component.call(this, props, context));
_this.store = props.store;
return _this;
}
Provider.prototype.render = function render() {
return _react.Children.only(this.props.children);
};
return Provider;
}(_react.Component);
exports.default = Provider;
if (process.env.NODE_ENV !== 'production') {
Provider.prototype.componentWillReceiveProps = function (nextProps) {
var store = this.store;
var nextStore = nextProps.store;
if (store !== nextStore) {
warnAboutReceivingStore();
}
};
}
Provider.propTypes = {
store: _storeShape2.default.isRequired,
children: _react.PropTypes.element.isRequired
};
Provider.childContextTypes = {
store: _storeShape2.default.isRequired,
storeSubscription: _react.PropTypes.instanceOf(_Subscription2.default)
};
Provider.displayName = 'Provider';
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../../process/browser.js */ 4)))
/***/ },
/* 202 */
/*!*************************************************!*\
!*** ./~/react-redux/lib/utils/Subscription.js ***!
\*************************************************/
/***/ function(module, exports) {
"use strict";
exports.__esModule = true;
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
// encapsulates the subscription logic for connecting a component to the redux store, as
// well as nesting subscriptions of descendant components, so that we can ensure the
// ancestor components re-render before descendants
var CLEARED = null;
var nullListeners = {
notify: function notify() {}
};
function createListenerCollection() {
// the current/next pattern is copied from redux's createStore code.
// TODO: refactor+expose that code to be reusable here?
var current = [];
var next = [];
return {
clear: function clear() {
next = CLEARED;
current = CLEARED;
},
notify: function notify() {
var listeners = current = next;
for (var i = 0; i < listeners.length; i++) {
listeners[i]();
}
},
subscribe: function subscribe(listener) {
var isSubscribed = true;
if (next === current) next = current.slice();
next.push(listener);
return function unsubscribe() {
if (!isSubscribed || current === CLEARED) return;
isSubscribed = false;
if (next === current) next = current.slice();
next.splice(next.indexOf(listener), 1);
};
}
};
}
var Subscription = function () {
function Subscription(store, parentSub) {
_classCallCheck(this, Subscription);
this.store = store;
this.parentSub = parentSub;
this.unsubscribe = null;
this.listeners = nullListeners;
}
Subscription.prototype.addNestedSub = function addNestedSub(listener) {
this.trySubscribe();
return this.listeners.subscribe(listener);
};
Subscription.prototype.notifyNestedSubs = function notifyNestedSubs() {
this.listeners.notify();
};
Subscription.prototype.isSubscribed = function isSubscribed() {
return Boolean(this.unsubscribe);
};
Subscription.prototype.trySubscribe = function trySubscribe() {
if (!this.unsubscribe) {
// this.onStateChange is set by connectAdvanced.initSubscription()
this.unsubscribe = this.parentSub ? this.parentSub.addNestedSub(this.onStateChange) : this.store.subscribe(this.onStateChange);
this.listeners = createListenerCollection();
}
};
Subscription.prototype.tryUnsubscribe = function tryUnsubscribe() {
if (this.unsubscribe) {
this.unsubscribe();
this.unsubscribe = null;
this.listeners.clear();
this.listeners = nullListeners;
}
};
return Subscription;
}();
exports.default = Subscription;
/***/ },
/* 203 */
/*!***********************************************!*\
!*** ./~/react-redux/lib/utils/storeShape.js ***!
\***********************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _react = __webpack_require__(/*! react */ 2);
exports.default = _react.PropTypes.shape({
subscribe: _react.PropTypes.func.isRequired,
dispatch: _react.PropTypes.func.isRequired,
getState: _react.PropTypes.func.isRequired
});
/***/ },
/* 204 */
/*!********************************************!*\
!*** ./~/react-redux/lib/utils/warning.js ***!
\********************************************/
/***/ function(module, exports) {
'use strict';
exports.__esModule = true;
exports.default = warning;
/**
* Prints a warning in the console if it exists.
*
* @param {String} message The warning message.
* @returns {void}
*/
function warning(message) {
/* eslint-disable no-console */
if (typeof console !== 'undefined' && typeof console.error === 'function') {
console.error(message);
}
/* eslint-enable no-console */
try {
// This error was thrown as a convenience so that if you enable
// "break on all exceptions" in your console,
// it would pause the execution at this line.
throw new Error(message);
/* eslint-disable no-empty */
} catch (e) {}
/* eslint-enable no-empty */
}
/***/ },
/* 205 */
/*!*********************************************************!*\
!*** ./~/react-redux/lib/components/connectAdvanced.js ***!
\*********************************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {'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; };
exports.default = connectAdvanced;
var _hoistNonReactStatics = __webpack_require__(/*! hoist-non-react-statics */ 206);
var _hoistNonReactStatics2 = _interopRequireDefault(_hoistNonReactStatics);
var _invariant = __webpack_require__(/*! invariant */ 207);
var _invariant2 = _interopRequireDefault(_invariant);
var _react = __webpack_require__(/*! react */ 2);
var _Subscription = __webpack_require__(/*! ../utils/Subscription */ 202);
var _Subscription2 = _interopRequireDefault(_Subscription);
var _storeShape = __webpack_require__(/*! ../utils/storeShape */ 203);
var _storeShape2 = _interopRequireDefault(_storeShape);
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; }
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 hotReloadingVersion = 0;
function connectAdvanced(
/*
selectorFactory is a func that is responsible for returning the selector function used to
compute new props from state, props, and dispatch. For example:
export default connectAdvanced((dispatch, options) => (state, props) => ({
thing: state.things[props.thingId],
saveThing: fields => dispatch(actionCreators.saveThing(props.thingId, fields)),
}))(YourComponent)
Access to dispatch is provided to the factory so selectorFactories can bind actionCreators
outside of their selector as an optimization. Options passed to connectAdvanced are passed to
the selectorFactory, along with displayName and WrappedComponent, as the second argument.
Note that selectorFactory is responsible for all caching/memoization of inbound and outbound
props. Do not use connectAdvanced directly without memoizing results between calls to your
selector, otherwise the Connect component will re-render on every state or props change.
*/
selectorFactory) {
var _contextTypes, _childContextTypes;
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
_ref$getDisplayName = _ref.getDisplayName,
getDisplayName = _ref$getDisplayName === undefined ? function (name) {
return 'ConnectAdvanced(' + name + ')';
} : _ref$getDisplayName,
_ref$methodName = _ref.methodName,
methodName = _ref$methodName === undefined ? 'connectAdvanced' : _ref$methodName,
_ref$renderCountProp = _ref.renderCountProp,
renderCountProp = _ref$renderCountProp === undefined ? undefined : _ref$renderCountProp,
_ref$shouldHandleStat = _ref.shouldHandleStateChanges,
shouldHandleStateChanges = _ref$shouldHandleStat === undefined ? true : _ref$shouldHandleStat,
_ref$storeKey = _ref.storeKey,
storeKey = _ref$storeKey === undefined ? 'store' : _ref$storeKey,
_ref$withRef = _ref.withRef,
withRef = _ref$withRef === undefined ? false : _ref$withRef,
connectOptions = _objectWithoutProperties(_ref, ['getDisplayName', 'methodName', 'renderCountProp', 'shouldHandleStateChanges', 'storeKey', 'withRef']);
var subscriptionKey = storeKey + 'Subscription';
var version = hotReloadingVersion++;
var contextTypes = (_contextTypes = {}, _contextTypes[storeKey] = _storeShape2.default, _contextTypes[subscriptionKey] = _react.PropTypes.instanceOf(_Subscription2.default), _contextTypes);
var childContextTypes = (_childContextTypes = {}, _childContextTypes[subscriptionKey] = _react.PropTypes.instanceOf(_Subscription2.default), _childContextTypes);
return function wrapWithConnect(WrappedComponent) {
(0, _invariant2.default)(typeof WrappedComponent == 'function', 'You must pass a component to the function returned by ' + ('connect. Instead received ' + WrappedComponent));
var wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || 'Component';
var displayName = getDisplayName(wrappedComponentName);
var selectorFactoryOptions = _extends({}, connectOptions, {
getDisplayName: getDisplayName,
methodName: methodName,
renderCountProp: renderCountProp,
shouldHandleStateChanges: shouldHandleStateChanges,
storeKey: storeKey,
withRef: withRef,
displayName: displayName,
wrappedComponentName: wrappedComponentName,
WrappedComponent: WrappedComponent
});
var Connect = function (_Component) {
_inherits(Connect, _Component);
function Connect(props, context) {
_classCallCheck(this, Connect);
var _this = _possibleConstructorReturn(this, _Component.call(this, props, context));
_this.version = version;
_this.state = {};
_this.renderCount = 0;
_this.store = _this.props[storeKey] || _this.context[storeKey];
_this.parentSub = props[subscriptionKey] || context[subscriptionKey];
_this.setWrappedInstance = _this.setWrappedInstance.bind(_this);
(0, _invariant2.default)(_this.store, 'Could not find "' + storeKey + '" in either the context or ' + ('props of "' + displayName + '". ') + 'Either wrap the root component in a <Provider>, ' + ('or explicitly pass "' + storeKey + '" as a prop to "' + displayName + '".'));
// make sure `getState` is properly bound in order to avoid breaking
// custom store implementations that rely on the store's context
_this.getState = _this.store.getState.bind(_this.store);
_this.initSelector();
_this.initSubscription();
return _this;
}
Connect.prototype.getChildContext = function getChildContext() {
var _ref2;
return _ref2 = {}, _ref2[subscriptionKey] = this.subscription || this.parentSub, _ref2;
};
Connect.prototype.componentDidMount = function componentDidMount() {
if (!shouldHandleStateChanges) return;
// componentWillMount fires during server side rendering, but componentDidMount and
// componentWillUnmount do not. Because of this, trySubscribe happens during ...didMount.
// Otherwise, unsubscription would never take place during SSR, causing a memory leak.
// To handle the case where a child component may have triggered a state change by
// dispatching an action in its componentWillMount, we have to re-run the select and maybe
// re-render.
this.subscription.trySubscribe();
this.selector.run(this.props);
if (this.selector.shouldComponentUpdate) this.forceUpdate();
};
Connect.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
this.selector.run(nextProps);
};
Connect.prototype.shouldComponentUpdate = function shouldComponentUpdate() {
return this.selector.shouldComponentUpdate;
};
Connect.prototype.componentWillUnmount = function componentWillUnmount() {
if (this.subscription) this.subscription.tryUnsubscribe();
// these are just to guard against extra memory leakage if a parent element doesn't
// dereference this instance properly, such as an async callback that never finishes
this.subscription = null;
this.store = null;
this.parentSub = null;
this.selector.run = function () {};
};
Connect.prototype.getWrappedInstance = function getWrappedInstance() {
(0, _invariant2.default)(withRef, 'To access the wrapped instance, you need to specify ' + ('{ withRef: true } in the options argument of the ' + methodName + '() call.'));
return this.wrappedInstance;
};
Connect.prototype.setWrappedInstance = function setWrappedInstance(ref) {
this.wrappedInstance = ref;
};
Connect.prototype.initSelector = function initSelector() {
var dispatch = this.store.dispatch;
var getState = this.getState;
var sourceSelector = selectorFactory(dispatch, selectorFactoryOptions);
// wrap the selector in an object that tracks its results between runs
var selector = this.selector = {
shouldComponentUpdate: true,
props: sourceSelector(getState(), this.props),
run: function runComponentSelector(props) {
try {
var nextProps = sourceSelector(getState(), props);
if (selector.error || nextProps !== selector.props) {
selector.shouldComponentUpdate = true;
selector.props = nextProps;
selector.error = null;
}
} catch (error) {
selector.shouldComponentUpdate = true;
selector.error = error;
}
}
};
};
Connect.prototype.initSubscription = function initSubscription() {
var _this2 = this;
if (shouldHandleStateChanges) {
(function () {
var subscription = _this2.subscription = new _Subscription2.default(_this2.store, _this2.parentSub);
var dummyState = {};
subscription.onStateChange = function onStateChange() {
this.selector.run(this.props);
if (!this.selector.shouldComponentUpdate) {
subscription.notifyNestedSubs();
} else {
this.componentDidUpdate = function componentDidUpdate() {
this.componentDidUpdate = undefined;
subscription.notifyNestedSubs();
};
this.setState(dummyState);
}
}.bind(_this2);
})();
}
};
Connect.prototype.isSubscribed = function isSubscribed() {
return Boolean(this.subscription) && this.subscription.isSubscribed();
};
Connect.prototype.addExtraProps = function addExtraProps(props) {
if (!withRef && !renderCountProp) return props;
// make a shallow copy so that fields added don't leak to the original selector.
// this is especially important for 'ref' since that's a reference back to the component
// instance. a singleton memoized selector would then be holding a reference to the
// instance, preventing the instance from being garbage collected, and that would be bad
var withExtras = _extends({}, props);
if (withRef) withExtras.ref = this.setWrappedInstance;
if (renderCountProp) withExtras[renderCountProp] = this.renderCount++;
return withExtras;
};
Connect.prototype.render = function render() {
var selector = this.selector;
selector.shouldComponentUpdate = false;
if (selector.error) {
throw selector.error;
} else {
return (0, _react.createElement)(WrappedComponent, this.addExtraProps(selector.props));
}
};
return Connect;
}(_react.Component);
Connect.WrappedComponent = WrappedComponent;
Connect.displayName = displayName;
Connect.childContextTypes = childContextTypes;
Connect.contextTypes = contextTypes;
Connect.propTypes = contextTypes;
if (process.env.NODE_ENV !== 'production') {
Connect.prototype.componentWillUpdate = function componentWillUpdate() {
// We are hot reloading!
if (this.version !== version) {
this.version = version;
this.initSelector();
if (this.subscription) this.subscription.tryUnsubscribe();
this.initSubscription();
if (shouldHandleStateChanges) this.subscription.trySubscribe();
}
};
}
return (0, _hoistNonReactStatics2.default)(Connect, WrappedComponent);
};
}
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../../process/browser.js */ 4)))
/***/ },
/* 206 */
/*!********************************************!*\
!*** ./~/hoist-non-react-statics/index.js ***!
\********************************************/
/***/ function(module, exports) {
/**
* Copyright 2015, Yahoo! Inc.
* Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
*/
'use strict';
var REACT_STATICS = {
childContextTypes: true,
contextTypes: true,
defaultProps: true,
displayName: true,
getDefaultProps: true,
mixins: true,
propTypes: true,
type: true
};
var KNOWN_STATICS = {
name: true,
length: true,
prototype: true,
caller: true,
arguments: true,
arity: true
};
var isGetOwnPropertySymbolsAvailable = typeof Object.getOwnPropertySymbols === 'function';
module.exports = function hoistNonReactStatics(targetComponent, sourceComponent, customStatics) {
if (typeof sourceComponent !== 'string') { // don't hoist over string (html) components
var keys = Object.getOwnPropertyNames(sourceComponent);
/* istanbul ignore else */
if (isGetOwnPropertySymbolsAvailable) {
keys = keys.concat(Object.getOwnPropertySymbols(sourceComponent));
}
for (var i = 0; i < keys.length; ++i) {
if (!REACT_STATICS[keys[i]] && !KNOWN_STATICS[keys[i]] && (!customStatics || !customStatics[keys[i]])) {
try {
targetComponent[keys[i]] = sourceComponent[keys[i]];
} catch (error) {
}
}
}
}
return targetComponent;
};
/***/ },
/* 207 */
/*!********************************!*\
!*** ./~/invariant/browser.js ***!
\********************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
'use strict';
/**
* 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__(/*! ./../process/browser.js */ 4)))
/***/ },
/* 208 */
/*!**********************************************!*\
!*** ./~/react-redux/lib/connect/connect.js ***!
\**********************************************/
/***/ 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; };
exports.createConnect = createConnect;
var _connectAdvanced = __webpack_require__(/*! ../components/connectAdvanced */ 205);
var _connectAdvanced2 = _interopRequireDefault(_connectAdvanced);
var _shallowEqual = __webpack_require__(/*! ../utils/shallowEqual */ 209);
var _shallowEqual2 = _interopRequireDefault(_shallowEqual);
var _mapDispatchToProps = __webpack_require__(/*! ./mapDispatchToProps */ 210);
var _mapDispatchToProps2 = _interopRequireDefault(_mapDispatchToProps);
var _mapStateToProps = __webpack_require__(/*! ./mapStateToProps */ 223);
var _mapStateToProps2 = _interopRequireDefault(_mapStateToProps);
var _mergeProps = __webpack_require__(/*! ./mergeProps */ 224);
var _mergeProps2 = _interopRequireDefault(_mergeProps);
var _selectorFactory = __webpack_require__(/*! ./selectorFactory */ 225);
var _selectorFactory2 = _interopRequireDefault(_selectorFactory);
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; }
/*
connect is a facade over connectAdvanced. It turns its args into a compatible
selectorFactory, which has the signature:
(dispatch, options) => (nextState, nextOwnProps) => nextFinalProps
connect passes its args to connectAdvanced as options, which will in turn pass them to
selectorFactory each time a Connect component instance is instantiated or hot reloaded.
selectorFactory returns a final props selector from its mapStateToProps,
mapStateToPropsFactories, mapDispatchToProps, mapDispatchToPropsFactories, mergeProps,
mergePropsFactories, and pure args.
The resulting final props selector is called by the Connect component instance whenever
it receives new props or store state.
*/
function match(arg, factories, name) {
for (var i = factories.length - 1; i >= 0; i--) {
var result = factories[i](arg);
if (result) return result;
}
return function (dispatch, options) {
throw new Error('Invalid value of type ' + typeof arg + ' for ' + name + ' argument when connecting component ' + options.wrappedComponentName + '.');
};
}
function strictEqual(a, b) {
return a === b;
}
// createConnect with default args builds the 'official' connect behavior. Calling it with
// different options opens up some testing and extensibility scenarios
function createConnect() {
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
_ref$connectHOC = _ref.connectHOC,
connectHOC = _ref$connectHOC === undefined ? _connectAdvanced2.default : _ref$connectHOC,
_ref$mapStateToPropsF = _ref.mapStateToPropsFactories,
mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? _mapStateToProps2.default : _ref$mapStateToPropsF,
_ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,
mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? _mapDispatchToProps2.default : _ref$mapDispatchToPro,
_ref$mergePropsFactor = _ref.mergePropsFactories,
mergePropsFactories = _ref$mergePropsFactor === undefined ? _mergeProps2.default : _ref$mergePropsFactor,
_ref$selectorFactory = _ref.selectorFactory,
selectorFactory = _ref$selectorFactory === undefined ? _selectorFactory2.default : _ref$selectorFactory;
return function connect(mapStateToProps, mapDispatchToProps, mergeProps) {
var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},
_ref2$pure = _ref2.pure,
pure = _ref2$pure === undefined ? true : _ref2$pure,
_ref2$areStatesEqual = _ref2.areStatesEqual,
areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual,
_ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual,
areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? _shallowEqual2.default : _ref2$areOwnPropsEqua,
_ref2$areStatePropsEq = _ref2.areStatePropsEqual,
areStatePropsEqual = _ref2$areStatePropsEq === undefined ? _shallowEqual2.default : _ref2$areStatePropsEq,
_ref2$areMergedPropsE = _ref2.areMergedPropsEqual,
areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? _shallowEqual2.default : _ref2$areMergedPropsE,
extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']);
var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');
var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');
var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');
return connectHOC(selectorFactory, _extends({
// used in error messages
methodName: 'connect',
// used to compute Connect's displayName from the wrapped component's displayName.
getDisplayName: function getDisplayName(name) {
return 'Connect(' + name + ')';
},
// if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes
shouldHandleStateChanges: Boolean(mapStateToProps),
// passed through to selectorFactory
initMapStateToProps: initMapStateToProps,
initMapDispatchToProps: initMapDispatchToProps,
initMergeProps: initMergeProps,
pure: pure,
areStatesEqual: areStatesEqual,
areOwnPropsEqual: areOwnPropsEqual,
areStatePropsEqual: areStatePropsEqual,
areMergedPropsEqual: areMergedPropsEqual
}, extraOptions));
};
}
exports.default = createConnect();
/***/ },
/* 209 */
/*!*************************************************!*\
!*** ./~/react-redux/lib/utils/shallowEqual.js ***!
\*************************************************/
/***/ function(module, exports) {
"use strict";
exports.__esModule = true;
exports.default = shallowEqual;
var hasOwn = Object.prototype.hasOwnProperty;
function shallowEqual(a, b) {
if (a === b) return true;
var countA = 0;
var countB = 0;
for (var key in a) {
if (hasOwn.call(a, key) && a[key] !== b[key]) return false;
countA++;
}
for (var _key in b) {
if (hasOwn.call(b, _key)) countB++;
}
return countA === countB;
}
/***/ },
/* 210 */
/*!*********************************************************!*\
!*** ./~/react-redux/lib/connect/mapDispatchToProps.js ***!
\*********************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
exports.whenMapDispatchToPropsIsFunction = whenMapDispatchToPropsIsFunction;
exports.whenMapDispatchToPropsIsMissing = whenMapDispatchToPropsIsMissing;
exports.whenMapDispatchToPropsIsObject = whenMapDispatchToPropsIsObject;
var _redux = __webpack_require__(/*! redux */ 179);
var _wrapMapToProps = __webpack_require__(/*! ./wrapMapToProps */ 211);
function whenMapDispatchToPropsIsFunction(mapDispatchToProps) {
return typeof mapDispatchToProps === 'function' ? (0, _wrapMapToProps.wrapMapToPropsFunc)(mapDispatchToProps, 'mapDispatchToProps') : undefined;
}
function whenMapDispatchToPropsIsMissing(mapDispatchToProps) {
return !mapDispatchToProps ? (0, _wrapMapToProps.wrapMapToPropsConstant)(function (dispatch) {
return { dispatch: dispatch };
}) : undefined;
}
function whenMapDispatchToPropsIsObject(mapDispatchToProps) {
return mapDispatchToProps && typeof mapDispatchToProps === 'object' ? (0, _wrapMapToProps.wrapMapToPropsConstant)(function (dispatch) {
return (0, _redux.bindActionCreators)(mapDispatchToProps, dispatch);
}) : undefined;
}
exports.default = [whenMapDispatchToPropsIsFunction, whenMapDispatchToPropsIsMissing, whenMapDispatchToPropsIsObject];
/***/ },
/* 211 */
/*!*****************************************************!*\
!*** ./~/react-redux/lib/connect/wrapMapToProps.js ***!
\*****************************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {'use strict';
exports.__esModule = true;
exports.wrapMapToPropsConstant = wrapMapToPropsConstant;
exports.getDependsOnOwnProps = getDependsOnOwnProps;
exports.wrapMapToPropsFunc = wrapMapToPropsFunc;
var _verifyPlainObject = __webpack_require__(/*! ../utils/verifyPlainObject */ 212);
var _verifyPlainObject2 = _interopRequireDefault(_verifyPlainObject);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function wrapMapToPropsConstant(getConstant) {
return function initConstantSelector(dispatch, options) {
var constant = getConstant(dispatch, options);
function constantSelector() {
return constant;
}
constantSelector.dependsOnOwnProps = false;
return constantSelector;
};
}
// dependsOnOwnProps is used by createMapToPropsProxy to determine whether to pass props as args
// to the mapToProps function being wrapped. It is also used by makePurePropsSelector to determine
// whether mapToProps needs to be invoked when props have changed.
//
// A length of one signals that mapToProps does not depend on props from the parent component.
// A length of zero is assumed to mean mapToProps is getting args via arguments or ...args and
// therefore not reporting its length accurately..
function getDependsOnOwnProps(mapToProps) {
return mapToProps.dependsOnOwnProps !== null && mapToProps.dependsOnOwnProps !== undefined ? Boolean(mapToProps.dependsOnOwnProps) : mapToProps.length !== 1;
}
// Used by whenMapStateToPropsIsFunction and whenMapDispatchToPropsIsFunction,
// this function wraps mapToProps in a proxy function which does several things:
//
// * Detects whether the mapToProps function being called depends on props, which
// is used by selectorFactory to decide if it should reinvoke on props changes.
//
// * On first call, handles mapToProps if returns another function, and treats that
// new function as the true mapToProps for subsequent calls.
//
// * On first call, verifies the first result is a plain object, in order to warn
// the developer that their mapToProps function is not returning a valid result.
//
function wrapMapToPropsFunc(mapToProps, methodName) {
return function initProxySelector(dispatch, _ref) {
var displayName = _ref.displayName;
var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {
return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);
};
proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);
proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {
proxy.mapToProps = mapToProps;
var props = proxy(stateOrDispatch, ownProps);
if (typeof props === 'function') {
proxy.mapToProps = props;
proxy.dependsOnOwnProps = getDependsOnOwnProps(props);
props = proxy(stateOrDispatch, ownProps);
}
if (process.env.NODE_ENV !== 'production') (0, _verifyPlainObject2.default)(props, displayName, methodName);
return props;
};
return proxy;
};
}
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../../process/browser.js */ 4)))
/***/ },
/* 212 */
/*!******************************************************!*\
!*** ./~/react-redux/lib/utils/verifyPlainObject.js ***!
\******************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
exports.default = verifyPlainObject;
var _isPlainObject = __webpack_require__(/*! lodash/isPlainObject */ 213);
var _isPlainObject2 = _interopRequireDefault(_isPlainObject);
var _warning = __webpack_require__(/*! ./warning */ 204);
var _warning2 = _interopRequireDefault(_warning);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function verifyPlainObject(value, displayName, methodName) {
if (!(0, _isPlainObject2.default)(value)) {
(0, _warning2.default)(methodName + '() in ' + displayName + ' must return a plain object. Instead received ' + value + '.');
}
}
/***/ },
/* 213 */
/*!*************************************************!*\
!*** ./~/react-redux/~/lodash/isPlainObject.js ***!
\*************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ 214),
getPrototype = __webpack_require__(/*! ./_getPrototype */ 220),
isObjectLike = __webpack_require__(/*! ./isObjectLike */ 222);
/** `Object#toString` result references. */
var objectTag = '[object Object]';
/** Used for built-in method references. */
var funcProto = Function.prototype,
objectProto = Object.prototype;
/** Used to resolve the decompiled source of functions. */
var funcToString = funcProto.toString;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/** Used to infer the `Object` constructor. */
var objectCtorString = funcToString.call(Object);
/**
* Checks if `value` is a plain object, that is, an object created by the
* `Object` constructor or one with a `[[Prototype]]` of `null`.
*
* @static
* @memberOf _
* @since 0.8.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
* @example
*
* function Foo() {
* this.a = 1;
* }
*
* _.isPlainObject(new Foo);
* // => false
*
* _.isPlainObject([1, 2, 3]);
* // => false
*
* _.isPlainObject({ 'x': 0, 'y': 0 });
* // => true
*
* _.isPlainObject(Object.create(null));
* // => true
*/
function isPlainObject(value) {
if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
return false;
}
var proto = getPrototype(value);
if (proto === null) {
return true;
}
var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
return typeof Ctor == 'function' && Ctor instanceof Ctor &&
funcToString.call(Ctor) == objectCtorString;
}
module.exports = isPlainObject;
/***/ },
/* 214 */
/*!***********************************************!*\
!*** ./~/react-redux/~/lodash/_baseGetTag.js ***!
\***********************************************/
/***/ function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__(/*! ./_Symbol */ 215),
getRawTag = __webpack_require__(/*! ./_getRawTag */ 218),
objectToString = __webpack_require__(/*! ./_objectToString */ 219);
/** `Object#toString` result references. */
var nullTag = '[object Null]',
undefinedTag = '[object Undefined]';
/** Built-in value references. */
var 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);
}
module.exports = baseGetTag;
/***/ },
/* 215 */
/*!*******************************************!*\
!*** ./~/react-redux/~/lodash/_Symbol.js ***!
\*******************************************/
/***/ function(module, exports, __webpack_require__) {
var root = __webpack_require__(/*! ./_root */ 216);
/** Built-in value references. */
var Symbol = root.Symbol;
module.exports = Symbol;
/***/ },
/* 216 */
/*!*****************************************!*\
!*** ./~/react-redux/~/lodash/_root.js ***!
\*****************************************/
/***/ function(module, exports, __webpack_require__) {
var freeGlobal = __webpack_require__(/*! ./_freeGlobal */ 217);
/** 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')();
module.exports = root;
/***/ },
/* 217 */
/*!***********************************************!*\
!*** ./~/react-redux/~/lodash/_freeGlobal.js ***!
\***********************************************/
/***/ function(module, exports) {
/* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
module.exports = freeGlobal;
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
/***/ },
/* 218 */
/*!**********************************************!*\
!*** ./~/react-redux/~/lodash/_getRawTag.js ***!
\**********************************************/
/***/ function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__(/*! ./_Symbol */ 215);
/** 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 symToStringTag = Symbol ? Symbol.toStringTag : undefined;
/**
* 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;
}
module.exports = getRawTag;
/***/ },
/* 219 */
/*!***************************************************!*\
!*** ./~/react-redux/~/lodash/_objectToString.js ***!
\***************************************************/
/***/ function(module, exports) {
/** 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 nativeObjectToString = objectProto.toString;
/**
* 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);
}
module.exports = objectToString;
/***/ },
/* 220 */
/*!*************************************************!*\
!*** ./~/react-redux/~/lodash/_getPrototype.js ***!
\*************************************************/
/***/ function(module, exports, __webpack_require__) {
var overArg = __webpack_require__(/*! ./_overArg */ 221);
/** Built-in value references. */
var getPrototype = overArg(Object.getPrototypeOf, Object);
module.exports = getPrototype;
/***/ },
/* 221 */
/*!********************************************!*\
!*** ./~/react-redux/~/lodash/_overArg.js ***!
\********************************************/
/***/ function(module, exports) {
/**
* Creates a unary function that invokes `func` with its argument transformed.
*
* @private
* @param {Function} func The function to wrap.
* @param {Function} transform The argument transform.
* @returns {Function} Returns the new function.
*/
function overArg(func, transform) {
return function(arg) {
return func(transform(arg));
};
}
module.exports = overArg;
/***/ },
/* 222 */
/*!************************************************!*\
!*** ./~/react-redux/~/lodash/isObjectLike.js ***!
\************************************************/
/***/ function(module, exports) {
/**
* 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 != null && typeof value == 'object';
}
module.exports = isObjectLike;
/***/ },
/* 223 */
/*!******************************************************!*\
!*** ./~/react-redux/lib/connect/mapStateToProps.js ***!
\******************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
exports.whenMapStateToPropsIsFunction = whenMapStateToPropsIsFunction;
exports.whenMapStateToPropsIsMissing = whenMapStateToPropsIsMissing;
var _wrapMapToProps = __webpack_require__(/*! ./wrapMapToProps */ 211);
function whenMapStateToPropsIsFunction(mapStateToProps) {
return typeof mapStateToProps === 'function' ? (0, _wrapMapToProps.wrapMapToPropsFunc)(mapStateToProps, 'mapStateToProps') : undefined;
}
function whenMapStateToPropsIsMissing(mapStateToProps) {
return !mapStateToProps ? (0, _wrapMapToProps.wrapMapToPropsConstant)(function () {
return {};
}) : undefined;
}
exports.default = [whenMapStateToPropsIsFunction, whenMapStateToPropsIsMissing];
/***/ },
/* 224 */
/*!*************************************************!*\
!*** ./~/react-redux/lib/connect/mergeProps.js ***!
\*************************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {'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; };
exports.defaultMergeProps = defaultMergeProps;
exports.wrapMergePropsFunc = wrapMergePropsFunc;
exports.whenMergePropsIsFunction = whenMergePropsIsFunction;
exports.whenMergePropsIsOmitted = whenMergePropsIsOmitted;
var _verifyPlainObject = __webpack_require__(/*! ../utils/verifyPlainObject */ 212);
var _verifyPlainObject2 = _interopRequireDefault(_verifyPlainObject);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function defaultMergeProps(stateProps, dispatchProps, ownProps) {
return _extends({}, ownProps, stateProps, dispatchProps);
}
function wrapMergePropsFunc(mergeProps) {
return function initMergePropsProxy(dispatch, _ref) {
var displayName = _ref.displayName,
pure = _ref.pure,
areMergedPropsEqual = _ref.areMergedPropsEqual;
var hasRunOnce = false;
var mergedProps = void 0;
return function mergePropsProxy(stateProps, dispatchProps, ownProps) {
var nextMergedProps = mergeProps(stateProps, dispatchProps, ownProps);
if (hasRunOnce) {
if (!pure || !areMergedPropsEqual(nextMergedProps, mergedProps)) mergedProps = nextMergedProps;
} else {
hasRunOnce = true;
mergedProps = nextMergedProps;
if (process.env.NODE_ENV !== 'production') (0, _verifyPlainObject2.default)(mergedProps, displayName, 'mergeProps');
}
return mergedProps;
};
};
}
function whenMergePropsIsFunction(mergeProps) {
return typeof mergeProps === 'function' ? wrapMergePropsFunc(mergeProps) : undefined;
}
function whenMergePropsIsOmitted(mergeProps) {
return !mergeProps ? function () {
return defaultMergeProps;
} : undefined;
}
exports.default = [whenMergePropsIsFunction, whenMergePropsIsOmitted];
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../../process/browser.js */ 4)))
/***/ },
/* 225 */
/*!******************************************************!*\
!*** ./~/react-redux/lib/connect/selectorFactory.js ***!
\******************************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {'use strict';
exports.__esModule = true;
exports.impureFinalPropsSelectorFactory = impureFinalPropsSelectorFactory;
exports.pureFinalPropsSelectorFactory = pureFinalPropsSelectorFactory;
exports.default = finalPropsSelectorFactory;
var _verifySubselectors = __webpack_require__(/*! ./verifySubselectors */ 226);
var _verifySubselectors2 = _interopRequireDefault(_verifySubselectors);
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 impureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch) {
return function impureFinalPropsSelector(state, ownProps) {
return mergeProps(mapStateToProps(state, ownProps), mapDispatchToProps(dispatch, ownProps), ownProps);
};
}
function pureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, _ref) {
var areStatesEqual = _ref.areStatesEqual,
areOwnPropsEqual = _ref.areOwnPropsEqual,
areStatePropsEqual = _ref.areStatePropsEqual;
var hasRunAtLeastOnce = false;
var state = void 0;
var ownProps = void 0;
var stateProps = void 0;
var dispatchProps = void 0;
var mergedProps = void 0;
function handleFirstCall(firstState, firstOwnProps) {
state = firstState;
ownProps = firstOwnProps;
stateProps = mapStateToProps(state, ownProps);
dispatchProps = mapDispatchToProps(dispatch, ownProps);
mergedProps = mergeProps(stateProps, dispatchProps, ownProps);
hasRunAtLeastOnce = true;
return mergedProps;
}
function handleNewPropsAndNewState() {
stateProps = mapStateToProps(state, ownProps);
if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps);
mergedProps = mergeProps(stateProps, dispatchProps, ownProps);
return mergedProps;
}
function handleNewProps() {
if (mapStateToProps.dependsOnOwnProps) stateProps = mapStateToProps(state, ownProps);
if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps);
mergedProps = mergeProps(stateProps, dispatchProps, ownProps);
return mergedProps;
}
function handleNewState() {
var nextStateProps = mapStateToProps(state, ownProps);
var statePropsChanged = !areStatePropsEqual(nextStateProps, stateProps);
stateProps = nextStateProps;
if (statePropsChanged) mergedProps = mergeProps(stateProps, dispatchProps, ownProps);
return mergedProps;
}
function handleSubsequentCalls(nextState, nextOwnProps) {
var propsChanged = !areOwnPropsEqual(nextOwnProps, ownProps);
var stateChanged = !areStatesEqual(nextState, state);
state = nextState;
ownProps = nextOwnProps;
if (propsChanged && stateChanged) return handleNewPropsAndNewState();
if (propsChanged) return handleNewProps();
if (stateChanged) return handleNewState();
return mergedProps;
}
return function pureFinalPropsSelector(nextState, nextOwnProps) {
return hasRunAtLeastOnce ? handleSubsequentCalls(nextState, nextOwnProps) : handleFirstCall(nextState, nextOwnProps);
};
}
// TODO: Add more comments
// If pure is true, the selector returned by selectorFactory will memoize its results,
// allowing connectAdvanced's shouldComponentUpdate to return false if final
// props have not changed. If false, the selector will always return a new
// object and shouldComponentUpdate will always return true.
function finalPropsSelectorFactory(dispatch, _ref2) {
var initMapStateToProps = _ref2.initMapStateToProps,
initMapDispatchToProps = _ref2.initMapDispatchToProps,
initMergeProps = _ref2.initMergeProps,
options = _objectWithoutProperties(_ref2, ['initMapStateToProps', 'initMapDispatchToProps', 'initMergeProps']);
var mapStateToProps = initMapStateToProps(dispatch, options);
var mapDispatchToProps = initMapDispatchToProps(dispatch, options);
var mergeProps = initMergeProps(dispatch, options);
if (process.env.NODE_ENV !== 'production') {
(0, _verifySubselectors2.default)(mapStateToProps, mapDispatchToProps, mergeProps, options.displayName);
}
var selectorFactory = options.pure ? pureFinalPropsSelectorFactory : impureFinalPropsSelectorFactory;
return selectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, options);
}
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../../process/browser.js */ 4)))
/***/ },
/* 226 */
/*!*********************************************************!*\
!*** ./~/react-redux/lib/connect/verifySubselectors.js ***!
\*********************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
exports.default = verifySubselectors;
var _warning = __webpack_require__(/*! ../utils/warning */ 204);
var _warning2 = _interopRequireDefault(_warning);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function verify(selector, methodName, displayName) {
if (!selector) {
throw new Error('Unexpected value for ' + methodName + ' in ' + displayName + '.');
} else if (methodName === 'mapStateToProps' || methodName === 'mapDispatchToProps') {
if (!selector.hasOwnProperty('dependsOnOwnProps')) {
(0, _warning2.default)('The selector for ' + methodName + ' of ' + displayName + ' did not specify a value for dependsOnOwnProps.');
}
}
}
function verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps, displayName) {
verify(mapStateToProps, 'mapStateToProps', displayName);
verify(mapDispatchToProps, 'mapDispatchToProps', displayName);
verify(mergeProps, 'mergeProps', displayName);
}
/***/ },
/* 227 */
/*!************************************!*\
!*** ./~/redux-thunk/lib/index.js ***!
\************************************/
/***/ function(module, exports) {
'use strict';
exports.__esModule = true;
function createThunkMiddleware(extraArgument) {
return function (_ref) {
var dispatch = _ref.dispatch,
getState = _ref.getState;
return function (next) {
return function (action) {
if (typeof action === 'function') {
return action(dispatch, getState, extraArgument);
}
return next(action);
};
};
};
}
var thunk = createThunkMiddleware();
thunk.withExtraArgument = createThunkMiddleware;
exports['default'] = thunk;
/***/ },
/* 228 */
/*!*********************************!*\
!*** ./app/reducers/Reducer.js ***!
\*********************************/
/***/ 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 _redux = __webpack_require__(/*! redux */ 179);
var _Actions = __webpack_require__(/*! Actions */ 229);
var _submodalContexts = __webpack_require__(/*! submodalContexts */ 531);
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
// initial states
var detailsStepFieldsInitialState = {
'title': { fieldValue: '', isValidated: false },
'category': { fieldValue: '', isValidated: false },
'component': { fieldValue: '', isValidated: false },
'references': { fieldValue: [], isValidated: false }
};
var modalInitialState = {
open: false,
subModalContext: _submodalContexts.fastFileHelp
};
var editorTemplates = {
sto: 'Steps to observe\n1. .\n\n**Result:**\n**Expected:**\n\nPlease explain how this issue impact\'s our customers:\n* .\n',
str: 'Steps to reproduce\n1. .\n\n**Result:**\n**Expected:**\n'
};
// Reducers
var primaryModalStatus = function primaryModalStatus() {
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : modalInitialState;
var action = arguments[1];
switch (action.type) {
case _Actions.TOGGLE_PRIMARY_MODAL:
return _extends({}, state, { open: !state.open });
case _Actions.TOGGLE_SUB_MODAL:
return _extends({}, state, {
subModalContext: _extends({}, action.subModalContext, {
openStatus: !action.subModalContext.openStatus
})
});
default:
return state;
}
};
var uploadFilter = function uploadFilter() {
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { files: [] };
var action = arguments[1];
var files = [];
switch (action.type) {
case _Actions.ADD_FILE:
return _extends({}, state, {
files: [].concat(_toConsumableArray(state.files), _toConsumableArray(action.file))
});
case _Actions.MODIFY_FILE:
// TODO: implement this modify file
return state;
case _Actions.REMOVE_FILE:
files = [].concat(_toConsumableArray(state.files));
files.splice(action.index, 1);
return _extends({}, state, {
files: files
});
default:
return state;
}
};
var stepFilter = function stepFilter() {
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { activeStep: 0 };
var action = arguments[1];
var index = action.index;
if (index < 0) {
index = 0;
}
switch (action.type) {
case _Actions.SET_ACTIVE_STEP:
return _extends({}, state, { activeStep: action.index });
default:
return state;
}
};
var validationFilter = function validationFilter() {
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : detailsStepFieldsInitialState;
var action = arguments[1];
var newState = {};
var fieldData = void 0;
var fieldValue = void 0;
switch (action.type) {
case _Actions.VALIDATE_INPUT:
fieldValue = action.data.text || action.data.value;
newState[action.name] = { value: fieldValue, isValidated: fieldValue.length > 1 };
return _extends({}, state, newState);
case _Actions.VALIDATE_STEPS:
fieldData = action.data;
fieldValue = action.data.value;
fieldData.isValidated = true;
newState[action.name] = fieldData;
return _extends({}, state, newState);
case _Actions.ADD_REFERENCE:
fieldValue = [].concat(_toConsumableArray(state.references.fieldValue));
fieldValue.push(action.data);
return _extends({}, state, {
references: {
fieldValue: fieldValue,
isValidated: fieldValue.length > 0
}
});
case _Actions.REMOVE_REFERENCE:
fieldValue = [].concat(_toConsumableArray(state.references.fieldValue));
fieldValue.splice(action.index, 1);
return _extends({}, state, {
references: {
fieldValue: fieldValue,
isValidated: fieldValue.length > 0
}
});
default:
return state;
}
};
var editorTemplate = function editorTemplate() {
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { template: editorTemplates.sto };
var action = arguments[1];
switch (action.type) {
case _Actions.TOGGLE_TEMPLATE:
return _extends({}, state, {
template: state.template === editorTemplates.sto ? editorTemplates.str : editorTemplates.sto
});
default:
return state;
}
};
var finalStep = function finalStep() {
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { busy: false };
var action = arguments[1];
switch (action.type) {
case _Actions.TOGGLE_FINAL_STEP_STATUS:
return _extends({}, state, { busy: !state.busy });
default:
return state;
}
};
// COMBINED FINAL REDUCER
var Reducer = (0, _redux.combineReducers)({
editorTemplate: editorTemplate,
finalStep: finalStep,
primaryModalStatus: primaryModalStatus,
stepFilter: stepFilter,
validationFilter: validationFilter,
uploadFilter: uploadFilter
});
exports.default = Reducer;
/***/ },
/* 229 */
/*!********************************!*\
!*** ./app/actions/Actions.js ***!
\********************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.fileJiraTicket = exports.serializeForm = exports.toggleFinalStepBusy = exports.removeReference = exports.addReference = exports.validateSteps = exports.validateInput = exports.togglePrimaryModal = exports.toggleSubModal = exports.toggleTemplate = exports.setActiveStep = exports.removeFile = exports.modifyFile = exports.addFile = exports.SERIALIZE_FORM = exports.TOGGLE_FINAL_STEP_STATUS = exports.TOGGLE_TEMPLATE = exports.TOGGLE_SUB_MODAL = exports.REMOVE_REFERENCE = exports.ADD_REFERENCE = exports.VALIDATE_STEPS = exports.VALIDATE_INPUT = exports.TOGGLE_PRIMARY_MODAL = exports.SET_ACTIVE_STEP = exports.REMOVE_FILE = exports.MODIFY_FILE = exports.ADD_FILE = 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; };
__webpack_require__(/*! babel-polyfill */ 230);
var _isomorphicFetch = __webpack_require__(/*! isomorphic-fetch */ 526);
var _isomorphicFetch2 = _interopRequireDefault(_isomorphicFetch);
var _helpers = __webpack_require__(/*! helpers */ 528);
var _action_helpers = __webpack_require__(/*! action_helpers */ 529);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// action types
var ADD_FILE = exports.ADD_FILE = 'ADD_FILE';
var MODIFY_FILE = exports.MODIFY_FILE = 'MODIFY_FILE';
var REMOVE_FILE = exports.REMOVE_FILE = 'REMOVE_FILE';
var SET_ACTIVE_STEP = exports.SET_ACTIVE_STEP = 'SET_ACTIVE_STEP';
var TOGGLE_PRIMARY_MODAL = exports.TOGGLE_PRIMARY_MODAL = 'TOGGLE_PRIMARY_MODAL';
var VALIDATE_INPUT = exports.VALIDATE_INPUT = 'VALIDATE_INPUT';
var VALIDATE_STEPS = exports.VALIDATE_STEPS = 'VALIDATE_STEPS';
var ADD_REFERENCE = exports.ADD_REFERENCE = 'ADD_REFERENCE';
var REMOVE_REFERENCE = exports.REMOVE_REFERENCE = 'REMOVE_REFERENCE';
var TOGGLE_SUB_MODAL = exports.TOGGLE_SUB_MODAL = 'TOGGLE_HELP_MODAL';
var TOGGLE_TEMPLATE = exports.TOGGLE_TEMPLATE = 'TOGGLE_TEMPLATE';
var TOGGLE_FINAL_STEP_STATUS = exports.TOGGLE_FINAL_STEP_STATUS = 'TOGGLE_FINAL_STEP_STATUS';
var SERIALIZE_FORM = exports.SERIALIZE_FORM = 'SERIALIZE_FORM';
// action creators
var addFile = exports.addFile = function addFile(file) {
return { type: ADD_FILE, file: file };
};
var modifyFile = exports.modifyFile = function modifyFile(index, changeObject) {
return _extends({}, changeObject, { type: MODIFY_FILE, index: index });
};
var removeFile = exports.removeFile = function removeFile(index) {
return { type: REMOVE_FILE, index: index };
};
var setActiveStep = exports.setActiveStep = function setActiveStep(index) {
return { type: SET_ACTIVE_STEP, index: index };
};
var toggleTemplate = exports.toggleTemplate = function toggleTemplate() {
return { type: TOGGLE_TEMPLATE };
};
var toggleSubModal = exports.toggleSubModal = function toggleSubModal(context) {
return { type: TOGGLE_SUB_MODAL, subModalContext: context };
};
var togglePrimaryModal = exports.togglePrimaryModal = function togglePrimaryModal() {
return { type: TOGGLE_PRIMARY_MODAL };
};
var validateInput = exports.validateInput = function validateInput(data) {
return { type: VALIDATE_INPUT, name: data.name, data: data };
};
var validateSteps = exports.validateSteps = function validateSteps(data) {
return { type: VALIDATE_STEPS, name: 'steps', data: data };
};
var addReference = exports.addReference = function addReference(data) {
return { type: ADD_REFERENCE, data: data };
};
var removeReference = exports.removeReference = function removeReference(index) {
return { type: REMOVE_REFERENCE, index: index };
};
var toggleFinalStepBusy = exports.toggleFinalStepBusy = function toggleFinalStepBusy() {
return { type: TOGGLE_FINAL_STEP_STATUS };
};
var serializeForm = exports.serializeForm = function serializeForm() {
return { type: SERIALIZE_FORM };
};
var fileJiraTicket = exports.fileJiraTicket = function fileJiraTicket(form) {
var url = (0, _helpers.isProduction)() ? 'https://jira.evbhome.com/rest/api/2/issue/' : 'https://httpbin.org/post';
var data = (0, _action_helpers.mapToJiraFields)(form);
return function (dispatch) {
dispatch(toggleFinalStepBusy());
return (0, _isomorphicFetch2.default)(url, {
method: 'POST',
credentials: 'same-origin',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(data)
}).then(function (response) {
// dispatch(toggleFinalStepBusy());
var reader = response.body.getReader();
var decoder = new TextDecoder();
reader.read().then(function (d) {
if (d.done) {
return;
}
console.log(decoder.decode(d.value, { stream: true }));
});
}).catch(function (response) {
return console.log('there was an error:', response);
});
};
};
/***/ },
/* 230 */
/*!***************************************!*\
!*** ./~/babel-polyfill/lib/index.js ***!
\***************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {"use strict";
__webpack_require__(/*! core-js/shim */ 231);
__webpack_require__(/*! regenerator-runtime/runtime */ 522);
__webpack_require__(/*! core-js/fn/regexp/escape */ 523);
if (global._babelPolyfill) {
throw new Error("only one instance of babel-polyfill is allowed");
}
global._babelPolyfill = true;
var DEFINE_PROPERTY = "defineProperty";
function define(O, key, value) {
O[key] || Object[DEFINE_PROPERTY](O, key, {
writable: true,
configurable: true,
value: value
});
}
define(String.prototype, "padLeft", "".padStart);
define(String.prototype, "padRight", "".padEnd);
"pop,reverse,shift,keys,values,entries,indexOf,every,some,forEach,map,filter,find,findIndex,includes,join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill".split(",").forEach(function (key) {
[][key] && define(Array, key, Function.call.bind([][key]));
});
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
/***/ },
/* 231 */
/*!***************************!*\
!*** ./~/core-js/shim.js ***!
\***************************/
/***/ function(module, exports, __webpack_require__) {
__webpack_require__(/*! ./modules/es6.symbol */ 232);
__webpack_require__(/*! ./modules/es6.object.create */ 281);
__webpack_require__(/*! ./modules/es6.object.define-property */ 282);
__webpack_require__(/*! ./modules/es6.object.define-properties */ 283);
__webpack_require__(/*! ./modules/es6.object.get-own-property-descriptor */ 284);
__webpack_require__(/*! ./modules/es6.object.get-prototype-of */ 286);
__webpack_require__(/*! ./modules/es6.object.keys */ 289);
__webpack_require__(/*! ./modules/es6.object.get-own-property-names */ 290);
__webpack_require__(/*! ./modules/es6.object.freeze */ 291);
__webpack_require__(/*! ./modules/es6.object.seal */ 292);
__webpack_require__(/*! ./modules/es6.object.prevent-extensions */ 293);
__webpack_require__(/*! ./modules/es6.object.is-frozen */ 294);
__webpack_require__(/*! ./modules/es6.object.is-sealed */ 295);
__webpack_require__(/*! ./modules/es6.object.is-extensible */ 296);
__webpack_require__(/*! ./modules/es6.object.assign */ 297);
__webpack_require__(/*! ./modules/es6.object.is */ 299);
__webpack_require__(/*! ./modules/es6.object.set-prototype-of */ 301);
__webpack_require__(/*! ./modules/es6.object.to-string */ 303);
__webpack_require__(/*! ./modules/es6.function.bind */ 305);
__webpack_require__(/*! ./modules/es6.function.name */ 308);
__webpack_require__(/*! ./modules/es6.function.has-instance */ 309);
__webpack_require__(/*! ./modules/es6.parse-int */ 310);
__webpack_require__(/*! ./modules/es6.parse-float */ 314);
__webpack_require__(/*! ./modules/es6.number.constructor */ 316);
__webpack_require__(/*! ./modules/es6.number.to-fixed */ 318);
__webpack_require__(/*! ./modules/es6.number.to-precision */ 321);
__webpack_require__(/*! ./modules/es6.number.epsilon */ 322);
__webpack_require__(/*! ./modules/es6.number.is-finite */ 323);
__webpack_require__(/*! ./modules/es6.number.is-integer */ 324);
__webpack_require__(/*! ./modules/es6.number.is-nan */ 326);
__webpack_require__(/*! ./modules/es6.number.is-safe-integer */ 327);
__webpack_require__(/*! ./modules/es6.number.max-safe-integer */ 328);
__webpack_require__(/*! ./modules/es6.number.min-safe-integer */ 329);
__webpack_require__(/*! ./modules/es6.number.parse-float */ 330);
__webpack_require__(/*! ./modules/es6.number.parse-int */ 331);
__webpack_require__(/*! ./modules/es6.math.acosh */ 332);
__webpack_require__(/*! ./modules/es6.math.asinh */ 334);
__webpack_require__(/*! ./modules/es6.math.atanh */ 335);
__webpack_require__(/*! ./modules/es6.math.cbrt */ 336);
__webpack_require__(/*! ./modules/es6.math.clz32 */ 338);
__webpack_require__(/*! ./modules/es6.math.cosh */ 339);
__webpack_require__(/*! ./modules/es6.math.expm1 */ 340);
__webpack_require__(/*! ./modules/es6.math.fround */ 342);
__webpack_require__(/*! ./modules/es6.math.hypot */ 343);
__webpack_require__(/*! ./modules/es6.math.imul */ 344);
__webpack_require__(/*! ./modules/es6.math.log10 */ 345);
__webpack_require__(/*! ./modules/es6.math.log1p */ 346);
__webpack_require__(/*! ./modules/es6.math.log2 */ 347);
__webpack_require__(/*! ./modules/es6.math.sign */ 348);
__webpack_require__(/*! ./modules/es6.math.sinh */ 349);
__webpack_require__(/*! ./modules/es6.math.tanh */ 350);
__webpack_require__(/*! ./modules/es6.math.trunc */ 351);
__webpack_require__(/*! ./modules/es6.string.from-code-point */ 352);
__webpack_require__(/*! ./modules/es6.string.raw */ 353);
__webpack_require__(/*! ./modules/es6.string.trim */ 354);
__webpack_require__(/*! ./modules/es6.string.iterator */ 355);
__webpack_require__(/*! ./modules/es6.string.code-point-at */ 360);
__webpack_require__(/*! ./modules/es6.string.ends-with */ 361);
__webpack_require__(/*! ./modules/es6.string.includes */ 365);
__webpack_require__(/*! ./modules/es6.string.repeat */ 366);
__webpack_require__(/*! ./modules/es6.string.starts-with */ 367);
__webpack_require__(/*! ./modules/es6.string.anchor */ 368);
__webpack_require__(/*! ./modules/es6.string.big */ 370);
__webpack_require__(/*! ./modules/es6.string.blink */ 371);
__webpack_require__(/*! ./modules/es6.string.bold */ 372);
__webpack_require__(/*! ./modules/es6.string.fixed */ 373);
__webpack_require__(/*! ./modules/es6.string.fontcolor */ 374);
__webpack_require__(/*! ./modules/es6.string.fontsize */ 375);
__webpack_require__(/*! ./modules/es6.string.italics */ 376);
__webpack_require__(/*! ./modules/es6.string.link */ 377);
__webpack_require__(/*! ./modules/es6.string.small */ 378);
__webpack_require__(/*! ./modules/es6.string.strike */ 379);
__webpack_require__(/*! ./modules/es6.string.sub */ 380);
__webpack_require__(/*! ./modules/es6.string.sup */ 381);
__webpack_require__(/*! ./modules/es6.date.now */ 382);
__webpack_require__(/*! ./modules/es6.date.to-json */ 383);
__webpack_require__(/*! ./modules/es6.date.to-iso-string */ 384);
__webpack_require__(/*! ./modules/es6.date.to-string */ 385);
__webpack_require__(/*! ./modules/es6.date.to-primitive */ 386);
__webpack_require__(/*! ./modules/es6.array.is-array */ 388);
__webpack_require__(/*! ./modules/es6.array.from */ 389);
__webpack_require__(/*! ./modules/es6.array.of */ 395);
__webpack_require__(/*! ./modules/es6.array.join */ 396);
__webpack_require__(/*! ./modules/es6.array.slice */ 398);
__webpack_require__(/*! ./modules/es6.array.sort */ 399);
__webpack_require__(/*! ./modules/es6.array.for-each */ 400);
__webpack_require__(/*! ./modules/es6.array.map */ 404);
__webpack_require__(/*! ./modules/es6.array.filter */ 405);
__webpack_require__(/*! ./modules/es6.array.some */ 406);
__webpack_require__(/*! ./modules/es6.array.every */ 407);
__webpack_require__(/*! ./modules/es6.array.reduce */ 408);
__webpack_require__(/*! ./modules/es6.array.reduce-right */ 410);
__webpack_require__(/*! ./modules/es6.array.index-of */ 411);
__webpack_require__(/*! ./modules/es6.array.last-index-of */ 412);
__webpack_require__(/*! ./modules/es6.array.copy-within */ 413);
__webpack_require__(/*! ./modules/es6.array.fill */ 416);
__webpack_require__(/*! ./modules/es6.array.find */ 418);
__webpack_require__(/*! ./modules/es6.array.find-index */ 419);
__webpack_require__(/*! ./modules/es6.array.species */ 420);
__webpack_require__(/*! ./modules/es6.array.iterator */ 422);
__webpack_require__(/*! ./modules/es6.regexp.constructor */ 424);
__webpack_require__(/*! ./modules/es6.regexp.to-string */ 426);
__webpack_require__(/*! ./modules/es6.regexp.flags */ 427);
__webpack_require__(/*! ./modules/es6.regexp.match */ 428);
__webpack_require__(/*! ./modules/es6.regexp.replace */ 430);
__webpack_require__(/*! ./modules/es6.regexp.search */ 431);
__webpack_require__(/*! ./modules/es6.regexp.split */ 432);
__webpack_require__(/*! ./modules/es6.promise */ 433);
__webpack_require__(/*! ./modules/es6.map */ 440);
__webpack_require__(/*! ./modules/es6.set */ 443);
__webpack_require__(/*! ./modules/es6.weak-map */ 444);
__webpack_require__(/*! ./modules/es6.weak-set */ 446);
__webpack_require__(/*! ./modules/es6.typed.array-buffer */ 447);
__webpack_require__(/*! ./modules/es6.typed.data-view */ 450);
__webpack_require__(/*! ./modules/es6.typed.int8-array */ 451);
__webpack_require__(/*! ./modules/es6.typed.uint8-array */ 453);
__webpack_require__(/*! ./modules/es6.typed.uint8-clamped-array */ 454);
__webpack_require__(/*! ./modules/es6.typed.int16-array */ 455);
__webpack_require__(/*! ./modules/es6.typed.uint16-array */ 456);
__webpack_require__(/*! ./modules/es6.typed.int32-array */ 457);
__webpack_require__(/*! ./modules/es6.typed.uint32-array */ 458);
__webpack_require__(/*! ./modules/es6.typed.float32-array */ 459);
__webpack_require__(/*! ./modules/es6.typed.float64-array */ 460);
__webpack_require__(/*! ./modules/es6.reflect.apply */ 461);
__webpack_require__(/*! ./modules/es6.reflect.construct */ 462);
__webpack_require__(/*! ./modules/es6.reflect.define-property */ 463);
__webpack_require__(/*! ./modules/es6.reflect.delete-property */ 464);
__webpack_require__(/*! ./modules/es6.reflect.enumerate */ 465);
__webpack_require__(/*! ./modules/es6.reflect.get */ 466);
__webpack_require__(/*! ./modules/es6.reflect.get-own-property-descriptor */ 467);
__webpack_require__(/*! ./modules/es6.reflect.get-prototype-of */ 468);
__webpack_require__(/*! ./modules/es6.reflect.has */ 469);
__webpack_require__(/*! ./modules/es6.reflect.is-extensible */ 470);
__webpack_require__(/*! ./modules/es6.reflect.own-keys */ 471);
__webpack_require__(/*! ./modules/es6.reflect.prevent-extensions */ 473);
__webpack_require__(/*! ./modules/es6.reflect.set */ 474);
__webpack_require__(/*! ./modules/es6.reflect.set-prototype-of */ 475);
__webpack_require__(/*! ./modules/es7.array.includes */ 476);
__webpack_require__(/*! ./modules/es7.string.at */ 477);
__webpack_require__(/*! ./modules/es7.string.pad-start */ 478);
__webpack_require__(/*! ./modules/es7.string.pad-end */ 480);
__webpack_require__(/*! ./modules/es7.string.trim-left */ 481);
__webpack_require__(/*! ./modules/es7.string.trim-right */ 482);
__webpack_require__(/*! ./modules/es7.string.match-all */ 483);
__webpack_require__(/*! ./modules/es7.symbol.async-iterator */ 484);
__webpack_require__(/*! ./modules/es7.symbol.observable */ 485);
__webpack_require__(/*! ./modules/es7.object.get-own-property-descriptors */ 486);
__webpack_require__(/*! ./modules/es7.object.values */ 487);
__webpack_require__(/*! ./modules/es7.object.entries */ 489);
__webpack_require__(/*! ./modules/es7.object.define-getter */ 490);
__webpack_require__(/*! ./modules/es7.object.define-setter */ 492);
__webpack_require__(/*! ./modules/es7.object.lookup-getter */ 493);
__webpack_require__(/*! ./modules/es7.object.lookup-setter */ 494);
__webpack_require__(/*! ./modules/es7.map.to-json */ 495);
__webpack_require__(/*! ./modules/es7.set.to-json */ 498);
__webpack_require__(/*! ./modules/es7.system.global */ 499);
__webpack_require__(/*! ./modules/es7.error.is-error */ 500);
__webpack_require__(/*! ./modules/es7.math.iaddh */ 501);
__webpack_require__(/*! ./modules/es7.math.isubh */ 502);
__webpack_require__(/*! ./modules/es7.math.imulh */ 503);
__webpack_require__(/*! ./modules/es7.math.umulh */ 504);
__webpack_require__(/*! ./modules/es7.reflect.define-metadata */ 505);
__webpack_require__(/*! ./modules/es7.reflect.delete-metadata */ 507);
__webpack_require__(/*! ./modules/es7.reflect.get-metadata */ 508);
__webpack_require__(/*! ./modules/es7.reflect.get-metadata-keys */ 509);
__webpack_require__(/*! ./modules/es7.reflect.get-own-metadata */ 510);
__webpack_require__(/*! ./modules/es7.reflect.get-own-metadata-keys */ 511);
__webpack_require__(/*! ./modules/es7.reflect.has-metadata */ 512);
__webpack_require__(/*! ./modules/es7.reflect.has-own-metadata */ 513);
__webpack_require__(/*! ./modules/es7.reflect.metadata */ 514);
__webpack_require__(/*! ./modules/es7.asap */ 515);
__webpack_require__(/*! ./modules/es7.observable */ 516);
__webpack_require__(/*! ./modules/web.timers */ 517);
__webpack_require__(/*! ./modules/web.immediate */ 520);
__webpack_require__(/*! ./modules/web.dom.iterable */ 521);
module.exports = __webpack_require__(/*! ./modules/_core */ 238);
/***/ },
/* 232 */
/*!*****************************************!*\
!*** ./~/core-js/modules/es6.symbol.js ***!
\*****************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
// ECMAScript 6 symbols shim
var global = __webpack_require__(/*! ./_global */ 233)
, has = __webpack_require__(/*! ./_has */ 234)
, DESCRIPTORS = __webpack_require__(/*! ./_descriptors */ 235)
, $export = __webpack_require__(/*! ./_export */ 237)
, redefine = __webpack_require__(/*! ./_redefine */ 247)
, META = __webpack_require__(/*! ./_meta */ 251).KEY
, $fails = __webpack_require__(/*! ./_fails */ 236)
, shared = __webpack_require__(/*! ./_shared */ 252)
, setToStringTag = __webpack_require__(/*! ./_set-to-string-tag */ 253)
, uid = __webpack_require__(/*! ./_uid */ 248)
, wks = __webpack_require__(/*! ./_wks */ 254)
, wksExt = __webpack_require__(/*! ./_wks-ext */ 255)
, wksDefine = __webpack_require__(/*! ./_wks-define */ 256)
, keyOf = __webpack_require__(/*! ./_keyof */ 258)
, enumKeys = __webpack_require__(/*! ./_enum-keys */ 271)
, isArray = __webpack_require__(/*! ./_is-array */ 274)
, anObject = __webpack_require__(/*! ./_an-object */ 241)
, toIObject = __webpack_require__(/*! ./_to-iobject */ 261)
, toPrimitive = __webpack_require__(/*! ./_to-primitive */ 245)
, createDesc = __webpack_require__(/*! ./_property-desc */ 246)
, _create = __webpack_require__(/*! ./_object-create */ 275)
, gOPNExt = __webpack_require__(/*! ./_object-gopn-ext */ 278)
, $GOPD = __webpack_require__(/*! ./_object-gopd */ 280)
, $DP = __webpack_require__(/*! ./_object-dp */ 240)
, $keys = __webpack_require__(/*! ./_object-keys */ 259)
, gOPD = $GOPD.f
, dP = $DP.f
, gOPN = gOPNExt.f
, $Symbol = global.Symbol
, $JSON = global.JSON
, _stringify = $JSON && $JSON.stringify
, PROTOTYPE = 'prototype'
, HIDDEN = wks('_hidden')
, TO_PRIMITIVE = wks('toPrimitive')
, isEnum = {}.propertyIsEnumerable
, SymbolRegistry = shared('symbol-registry')
, AllSymbols = shared('symbols')
, OPSymbols = shared('op-symbols')
, ObjectProto = Object[PROTOTYPE]
, USE_NATIVE = typeof $Symbol == 'function'
, QObject = global.QObject;
// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
var setSymbolDesc = DESCRIPTORS && $fails(function(){
return _create(dP({}, 'a', {
get: function(){ return dP(this, 'a', {value: 7}).a; }
})).a != 7;
}) ? function(it, key, D){
var protoDesc = gOPD(ObjectProto, key);
if(protoDesc)delete ObjectProto[key];
dP(it, key, D);
if(protoDesc && it !== ObjectProto)dP(ObjectProto, key, protoDesc);
} : dP;
var wrap = function(tag){
var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);
sym._k = tag;
return sym;
};
var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function(it){
return typeof it == 'symbol';
} : function(it){
return it instanceof $Symbol;
};
var $defineProperty = function defineProperty(it, key, D){
if(it === ObjectProto)$defineProperty(OPSymbols, key, D);
anObject(it);
key = toPrimitive(key, true);
anObject(D);
if(has(AllSymbols, key)){
if(!D.enumerable){
if(!has(it, HIDDEN))dP(it, HIDDEN, createDesc(1, {}));
it[HIDDEN][key] = true;
} else {
if(has(it, HIDDEN) && it[HIDDEN][key])it[HIDDEN][key] = false;
D = _create(D, {enumerable: createDesc(0, false)});
} return setSymbolDesc(it, key, D);
} return dP(it, key, D);
};
var $defineProperties = function defineProperties(it, P){
anObject(it);
var keys = enumKeys(P = toIObject(P))
, i = 0
, l = keys.length
, key;
while(l > i)$defineProperty(it, key = keys[i++], P[key]);
return it;
};
var $create = function create(it, P){
return P === undefined ? _create(it) : $defineProperties(_create(it), P);
};
var $propertyIsEnumerable = function propertyIsEnumerable(key){
var E = isEnum.call(this, key = toPrimitive(key, true));
if(this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))return false;
return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;
};
var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key){
it = toIObject(it);
key = toPrimitive(key, true);
if(it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))return;
var D = gOPD(it, key);
if(D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key]))D.enumerable = true;
return D;
};
var $getOwnPropertyNames = function getOwnPropertyNames(it){
var names = gOPN(toIObject(it))
, result = []
, i = 0
, key;
while(names.length > i){
if(!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META)result.push(key);
} return result;
};
var $getOwnPropertySymbols = function getOwnPropertySymbols(it){
var IS_OP = it === ObjectProto
, names = gOPN(IS_OP ? OPSymbols : toIObject(it))
, result = []
, i = 0
, key;
while(names.length > i){
if(has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true))result.push(AllSymbols[key]);
} return result;
};
// 19.4.1.1 Symbol([description])
if(!USE_NATIVE){
$Symbol = function Symbol(){
if(this instanceof $Symbol)throw TypeError('Symbol is not a constructor!');
var tag = uid(arguments.length > 0 ? arguments[0] : undefined);
var $set = function(value){
if(this === ObjectProto)$set.call(OPSymbols, value);
if(has(this, HIDDEN) && has(this[HIDDEN], tag))this[HIDDEN][tag] = false;
setSymbolDesc(this, tag, createDesc(1, value));
};
if(DESCRIPTORS && setter)setSymbolDesc(ObjectProto, tag, {configurable: true, set: $set});
return wrap(tag);
};
redefine($Symbol[PROTOTYPE], 'toString', function toString(){
return this._k;
});
$GOPD.f = $getOwnPropertyDescriptor;
$DP.f = $defineProperty;
__webpack_require__(/*! ./_object-gopn */ 279).f = gOPNExt.f = $getOwnPropertyNames;
__webpack_require__(/*! ./_object-pie */ 273).f = $propertyIsEnumerable;
__webpack_require__(/*! ./_object-gops */ 272).f = $getOwnPropertySymbols;
if(DESCRIPTORS && !__webpack_require__(/*! ./_library */ 257)){
redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);
}
wksExt.f = function(name){
return wrap(wks(name));
}
}
$export($export.G + $export.W + $export.F * !USE_NATIVE, {Symbol: $Symbol});
for(var symbols = (
// 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14
'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'
).split(','), i = 0; symbols.length > i; )wks(symbols[i++]);
for(var symbols = $keys(wks.store), i = 0; symbols.length > i; )wksDefine(symbols[i++]);
$export($export.S + $export.F * !USE_NATIVE, 'Symbol', {
// 19.4.2.1 Symbol.for(key)
'for': function(key){
return has(SymbolRegistry, key += '')
? SymbolRegistry[key]
: SymbolRegistry[key] = $Symbol(key);
},
// 19.4.2.5 Symbol.keyFor(sym)
keyFor: function keyFor(key){
if(isSymbol(key))return keyOf(SymbolRegistry, key);
throw TypeError(key + ' is not a symbol!');
},
useSetter: function(){ setter = true; },
useSimple: function(){ setter = false; }
});
$export($export.S + $export.F * !USE_NATIVE, 'Object', {
// 19.1.2.2 Object.create(O [, Properties])
create: $create,
// 19.1.2.4 Object.defineProperty(O, P, Attributes)
defineProperty: $defineProperty,
// 19.1.2.3 Object.defineProperties(O, Properties)
defineProperties: $defineProperties,
// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
getOwnPropertyDescriptor: $getOwnPropertyDescriptor,
// 19.1.2.7 Object.getOwnPropertyNames(O)
getOwnPropertyNames: $getOwnPropertyNames,
// 19.1.2.8 Object.getOwnPropertySymbols(O)
getOwnPropertySymbols: $getOwnPropertySymbols
});
// 24.3.2 JSON.stringify(value [, replacer [, space]])
$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function(){
var S = $Symbol();
// MS Edge converts symbol values to JSON as {}
// WebKit converts symbol values to JSON as null
// V8 throws on boxed symbols
return _stringify([S]) != '[null]' || _stringify({a: S}) != '{}' || _stringify(Object(S)) != '{}';
})), 'JSON', {
stringify: function stringify(it){
if(it === undefined || isSymbol(it))return; // IE8 returns string on undefined
var args = [it]
, i = 1
, replacer, $replacer;
while(arguments.length > i)args.push(arguments[i++]);
replacer = args[1];
if(typeof replacer == 'function')$replacer = replacer;
if($replacer || !isArray(replacer))replacer = function(key, value){
if($replacer)value = $replacer.call(this, key, value);
if(!isSymbol(value))return value;
};
args[1] = replacer;
return _stringify.apply($JSON, args);
}
});
// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)
$Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(/*! ./_hide */ 239)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);
// 19.4.3.5 Symbol.prototype[@@toStringTag]
setToStringTag($Symbol, 'Symbol');
// 20.2.1.9 Math[@@toStringTag]
setToStringTag(Math, 'Math', true);
// 24.3.3 JSON[@@toStringTag]
setToStringTag(global.JSON, 'JSON', true);
/***/ },
/* 233 */
/*!**************************************!*\
!*** ./~/core-js/modules/_global.js ***!
\**************************************/
/***/ function(module, exports) {
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
var global = module.exports = typeof window != 'undefined' && window.Math == Math
? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')();
if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef
/***/ },
/* 234 */
/*!***********************************!*\
!*** ./~/core-js/modules/_has.js ***!
\***********************************/
/***/ function(module, exports) {
var hasOwnProperty = {}.hasOwnProperty;
module.exports = function(it, key){
return hasOwnProperty.call(it, key);
};
/***/ },
/* 235 */
/*!*******************************************!*\
!*** ./~/core-js/modules/_descriptors.js ***!
\*******************************************/
/***/ function(module, exports, __webpack_require__) {
// Thank's IE8 for his funny defineProperty
module.exports = !__webpack_require__(/*! ./_fails */ 236)(function(){
return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7;
});
/***/ },
/* 236 */
/*!*************************************!*\
!*** ./~/core-js/modules/_fails.js ***!
\*************************************/
/***/ function(module, exports) {
module.exports = function(exec){
try {
return !!exec();
} catch(e){
return true;
}
};
/***/ },
/* 237 */
/*!**************************************!*\
!*** ./~/core-js/modules/_export.js ***!
\**************************************/
/***/ function(module, exports, __webpack_require__) {
var global = __webpack_require__(/*! ./_global */ 233)
, core = __webpack_require__(/*! ./_core */ 238)
, hide = __webpack_require__(/*! ./_hide */ 239)
, redefine = __webpack_require__(/*! ./_redefine */ 247)
, ctx = __webpack_require__(/*! ./_ctx */ 249)
, PROTOTYPE = 'prototype';
var $export = function(type, name, source){
var IS_FORCED = type & $export.F
, IS_GLOBAL = type & $export.G
, IS_STATIC = type & $export.S
, IS_PROTO = type & $export.P
, IS_BIND = type & $export.B
, target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE]
, exports = IS_GLOBAL ? core : core[name] || (core[name] = {})
, expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {})
, key, own, out, exp;
if(IS_GLOBAL)source = name;
for(key in source){
// contains in native
own = !IS_FORCED && target && target[key] !== undefined;
// export native or passed
out = (own ? target : source)[key];
// bind timers to global for call from export context
exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
// extend global
if(target)redefine(target, key, out, type & $export.U);
// export
if(exports[key] != out)hide(exports, key, exp);
if(IS_PROTO && expProto[key] != out)expProto[key] = out;
}
};
global.core = core;
// type bitmap
$export.F = 1; // forced
$export.G = 2; // global
$export.S = 4; // static
$export.P = 8; // proto
$export.B = 16; // bind
$export.W = 32; // wrap
$export.U = 64; // safe
$export.R = 128; // real proto method for `library`
module.exports = $export;
/***/ },
/* 238 */
/*!************************************!*\
!*** ./~/core-js/modules/_core.js ***!
\************************************/
/***/ function(module, exports) {
var core = module.exports = {version: '2.4.0'};
if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef
/***/ },
/* 239 */
/*!************************************!*\
!*** ./~/core-js/modules/_hide.js ***!
\************************************/
/***/ function(module, exports, __webpack_require__) {
var dP = __webpack_require__(/*! ./_object-dp */ 240)
, createDesc = __webpack_require__(/*! ./_property-desc */ 246);
module.exports = __webpack_require__(/*! ./_descriptors */ 235) ? function(object, key, value){
return dP.f(object, key, createDesc(1, value));
} : function(object, key, value){
object[key] = value;
return object;
};
/***/ },
/* 240 */
/*!*****************************************!*\
!*** ./~/core-js/modules/_object-dp.js ***!
\*****************************************/
/***/ function(module, exports, __webpack_require__) {
var anObject = __webpack_require__(/*! ./_an-object */ 241)
, IE8_DOM_DEFINE = __webpack_require__(/*! ./_ie8-dom-define */ 243)
, toPrimitive = __webpack_require__(/*! ./_to-primitive */ 245)
, dP = Object.defineProperty;
exports.f = __webpack_require__(/*! ./_descriptors */ 235) ? Object.defineProperty : function defineProperty(O, P, Attributes){
anObject(O);
P = toPrimitive(P, true);
anObject(Attributes);
if(IE8_DOM_DEFINE)try {
return dP(O, P, Attributes);
} catch(e){ /* empty */ }
if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!');
if('value' in Attributes)O[P] = Attributes.value;
return O;
};
/***/ },
/* 241 */
/*!*****************************************!*\
!*** ./~/core-js/modules/_an-object.js ***!
\*****************************************/
/***/ function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(/*! ./_is-object */ 242);
module.exports = function(it){
if(!isObject(it))throw TypeError(it + ' is not an object!');
return it;
};
/***/ },
/* 242 */
/*!*****************************************!*\
!*** ./~/core-js/modules/_is-object.js ***!
\*****************************************/
/***/ function(module, exports) {
module.exports = function(it){
return typeof it === 'object' ? it !== null : typeof it === 'function';
};
/***/ },
/* 243 */
/*!**********************************************!*\
!*** ./~/core-js/modules/_ie8-dom-define.js ***!
\**********************************************/
/***/ function(module, exports, __webpack_require__) {
module.exports = !__webpack_require__(/*! ./_descriptors */ 235) && !__webpack_require__(/*! ./_fails */ 236)(function(){
return Object.defineProperty(__webpack_require__(/*! ./_dom-create */ 244)('div'), 'a', {get: function(){ return 7; }}).a != 7;
});
/***/ },
/* 244 */
/*!******************************************!*\
!*** ./~/core-js/modules/_dom-create.js ***!
\******************************************/
/***/ function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(/*! ./_is-object */ 242)
, document = __webpack_require__(/*! ./_global */ 233).document
// in old IE typeof document.createElement is 'object'
, is = isObject(document) && isObject(document.createElement);
module.exports = function(it){
return is ? document.createElement(it) : {};
};
/***/ },
/* 245 */
/*!********************************************!*\
!*** ./~/core-js/modules/_to-primitive.js ***!
\********************************************/
/***/ function(module, exports, __webpack_require__) {
// 7.1.1 ToPrimitive(input [, PreferredType])
var isObject = __webpack_require__(/*! ./_is-object */ 242);
// instead of the ES6 spec version, we didn't implement @@toPrimitive case
// and the second argument - flag - preferred type is a string
module.exports = function(it, S){
if(!isObject(it))return it;
var fn, val;
if(S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;
if(typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it)))return val;
if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;
throw TypeError("Can't convert object to primitive value");
};
/***/ },
/* 246 */
/*!*********************************************!*\
!*** ./~/core-js/modules/_property-desc.js ***!
\*********************************************/
/***/ function(module, exports) {
module.exports = function(bitmap, value){
return {
enumerable : !(bitmap & 1),
configurable: !(bitmap & 2),
writable : !(bitmap & 4),
value : value
};
};
/***/ },
/* 247 */
/*!****************************************!*\
!*** ./~/core-js/modules/_redefine.js ***!
\****************************************/
/***/ function(module, exports, __webpack_require__) {
var global = __webpack_require__(/*! ./_global */ 233)
, hide = __webpack_require__(/*! ./_hide */ 239)
, has = __webpack_require__(/*! ./_has */ 234)
, SRC = __webpack_require__(/*! ./_uid */ 248)('src')
, TO_STRING = 'toString'
, $toString = Function[TO_STRING]
, TPL = ('' + $toString).split(TO_STRING);
__webpack_require__(/*! ./_core */ 238).inspectSource = function(it){
return $toString.call(it);
};
(module.exports = function(O, key, val, safe){
var isFunction = typeof val == 'function';
if(isFunction)has(val, 'name') || hide(val, 'name', key);
if(O[key] === val)return;
if(isFunction)has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));
if(O === global){
O[key] = val;
} else {
if(!safe){
delete O[key];
hide(O, key, val);
} else {
if(O[key])O[key] = val;
else hide(O, key, val);
}
}
// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
})(Function.prototype, TO_STRING, function toString(){
return typeof this == 'function' && this[SRC] || $toString.call(this);
});
/***/ },
/* 248 */
/*!***********************************!*\
!*** ./~/core-js/modules/_uid.js ***!
\***********************************/
/***/ function(module, exports) {
var id = 0
, px = Math.random();
module.exports = function(key){
return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
};
/***/ },
/* 249 */
/*!***********************************!*\
!*** ./~/core-js/modules/_ctx.js ***!
\***********************************/
/***/ function(module, exports, __webpack_require__) {
// optional / simple context binding
var aFunction = __webpack_require__(/*! ./_a-function */ 250);
module.exports = function(fn, that, length){
aFunction(fn);
if(that === undefined)return fn;
switch(length){
case 1: return function(a){
return fn.call(that, a);
};
case 2: return function(a, b){
return fn.call(that, a, b);
};
case 3: return function(a, b, c){
return fn.call(that, a, b, c);
};
}
return function(/* ...args */){
return fn.apply(that, arguments);
};
};
/***/ },
/* 250 */
/*!******************************************!*\
!*** ./~/core-js/modules/_a-function.js ***!
\******************************************/
/***/ function(module, exports) {
module.exports = function(it){
if(typeof it != 'function')throw TypeError(it + ' is not a function!');
return it;
};
/***/ },
/* 251 */
/*!************************************!*\
!*** ./~/core-js/modules/_meta.js ***!
\************************************/
/***/ function(module, exports, __webpack_require__) {
var META = __webpack_require__(/*! ./_uid */ 248)('meta')
, isObject = __webpack_require__(/*! ./_is-object */ 242)
, has = __webpack_require__(/*! ./_has */ 234)
, setDesc = __webpack_require__(/*! ./_object-dp */ 240).f
, id = 0;
var isExtensible = Object.isExtensible || function(){
return true;
};
var FREEZE = !__webpack_require__(/*! ./_fails */ 236)(function(){
return isExtensible(Object.preventExtensions({}));
});
var setMeta = function(it){
setDesc(it, META, {value: {
i: 'O' + ++id, // object ID
w: {} // weak collections IDs
}});
};
var fastKey = function(it, create){
// return primitive with prefix
if(!isObject(it))return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
if(!has(it, META)){
// can't set metadata to uncaught frozen object
if(!isExtensible(it))return 'F';
// not necessary to add metadata
if(!create)return 'E';
// add missing metadata
setMeta(it);
// return object ID
} return it[META].i;
};
var getWeak = function(it, create){
if(!has(it, META)){
// can't set metadata to uncaught frozen object
if(!isExtensible(it))return true;
// not necessary to add metadata
if(!create)return false;
// add missing metadata
setMeta(it);
// return hash weak collections IDs
} return it[META].w;
};
// add metadata on freeze-family methods calling
var onFreeze = function(it){
if(FREEZE && meta.NEED && isExtensible(it) && !has(it, META))setMeta(it);
return it;
};
var meta = module.exports = {
KEY: META,
NEED: false,
fastKey: fastKey,
getWeak: getWeak,
onFreeze: onFreeze
};
/***/ },
/* 252 */
/*!**************************************!*\
!*** ./~/core-js/modules/_shared.js ***!
\**************************************/
/***/ function(module, exports, __webpack_require__) {
var global = __webpack_require__(/*! ./_global */ 233)
, SHARED = '__core-js_shared__'
, store = global[SHARED] || (global[SHARED] = {});
module.exports = function(key){
return store[key] || (store[key] = {});
};
/***/ },
/* 253 */
/*!*************************************************!*\
!*** ./~/core-js/modules/_set-to-string-tag.js ***!
\*************************************************/
/***/ function(module, exports, __webpack_require__) {
var def = __webpack_require__(/*! ./_object-dp */ 240).f
, has = __webpack_require__(/*! ./_has */ 234)
, TAG = __webpack_require__(/*! ./_wks */ 254)('toStringTag');
module.exports = function(it, tag, stat){
if(it && !has(it = stat ? it : it.prototype, TAG))def(it, TAG, {configurable: true, value: tag});
};
/***/ },
/* 254 */
/*!***********************************!*\
!*** ./~/core-js/modules/_wks.js ***!
\***********************************/
/***/ function(module, exports, __webpack_require__) {
var store = __webpack_require__(/*! ./_shared */ 252)('wks')
, uid = __webpack_require__(/*! ./_uid */ 248)
, Symbol = __webpack_require__(/*! ./_global */ 233).Symbol
, USE_SYMBOL = typeof Symbol == 'function';
var $exports = module.exports = function(name){
return store[name] || (store[name] =
USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
};
$exports.store = store;
/***/ },
/* 255 */
/*!***************************************!*\
!*** ./~/core-js/modules/_wks-ext.js ***!
\***************************************/
/***/ function(module, exports, __webpack_require__) {
exports.f = __webpack_require__(/*! ./_wks */ 254);
/***/ },
/* 256 */
/*!******************************************!*\
!*** ./~/core-js/modules/_wks-define.js ***!
\******************************************/
/***/ function(module, exports, __webpack_require__) {
var global = __webpack_require__(/*! ./_global */ 233)
, core = __webpack_require__(/*! ./_core */ 238)
, LIBRARY = __webpack_require__(/*! ./_library */ 257)
, wksExt = __webpack_require__(/*! ./_wks-ext */ 255)
, defineProperty = __webpack_require__(/*! ./_object-dp */ 240).f;
module.exports = function(name){
var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});
if(name.charAt(0) != '_' && !(name in $Symbol))defineProperty($Symbol, name, {value: wksExt.f(name)});
};
/***/ },
/* 257 */
/*!***************************************!*\
!*** ./~/core-js/modules/_library.js ***!
\***************************************/
/***/ function(module, exports) {
module.exports = false;
/***/ },
/* 258 */
/*!*************************************!*\
!*** ./~/core-js/modules/_keyof.js ***!
\*************************************/
/***/ function(module, exports, __webpack_require__) {
var getKeys = __webpack_require__(/*! ./_object-keys */ 259)
, toIObject = __webpack_require__(/*! ./_to-iobject */ 261);
module.exports = function(object, el){
var O = toIObject(object)
, keys = getKeys(O)
, length = keys.length
, index = 0
, key;
while(length > index)if(O[key = keys[index++]] === el)return key;
};
/***/ },
/* 259 */
/*!*******************************************!*\
!*** ./~/core-js/modules/_object-keys.js ***!
\*******************************************/
/***/ function(module, exports, __webpack_require__) {
// 19.1.2.14 / 15.2.3.14 Object.keys(O)
var $keys = __webpack_require__(/*! ./_object-keys-internal */ 260)
, enumBugKeys = __webpack_require__(/*! ./_enum-bug-keys */ 270);
module.exports = Object.keys || function keys(O){
return $keys(O, enumBugKeys);
};
/***/ },
/* 260 */
/*!****************************************************!*\
!*** ./~/core-js/modules/_object-keys-internal.js ***!
\****************************************************/
/***/ function(module, exports, __webpack_require__) {
var has = __webpack_require__(/*! ./_has */ 234)
, toIObject = __webpack_require__(/*! ./_to-iobject */ 261)
, arrayIndexOf = __webpack_require__(/*! ./_array-includes */ 265)(false)
, IE_PROTO = __webpack_require__(/*! ./_shared-key */ 269)('IE_PROTO');
module.exports = function(object, names){
var O = toIObject(object)
, i = 0
, result = []
, key;
for(key in O)if(key != IE_PROTO)has(O, key) && result.push(key);
// Don't enum bug & hidden keys
while(names.length > i)if(has(O, key = names[i++])){
~arrayIndexOf(result, key) || result.push(key);
}
return result;
};
/***/ },
/* 261 */
/*!******************************************!*\
!*** ./~/core-js/modules/_to-iobject.js ***!
\******************************************/
/***/ function(module, exports, __webpack_require__) {
// to indexed object, toObject with fallback for non-array-like ES3 strings
var IObject = __webpack_require__(/*! ./_iobject */ 262)
, defined = __webpack_require__(/*! ./_defined */ 264);
module.exports = function(it){
return IObject(defined(it));
};
/***/ },
/* 262 */
/*!***************************************!*\
!*** ./~/core-js/modules/_iobject.js ***!
\***************************************/
/***/ function(module, exports, __webpack_require__) {
// fallback for non-array-like ES3 and non-enumerable old V8 strings
var cof = __webpack_require__(/*! ./_cof */ 263);
module.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){
return cof(it) == 'String' ? it.split('') : Object(it);
};
/***/ },
/* 263 */
/*!***********************************!*\
!*** ./~/core-js/modules/_cof.js ***!
\***********************************/
/***/ function(module, exports) {
var toString = {}.toString;
module.exports = function(it){
return toString.call(it).slice(8, -1);
};
/***/ },
/* 264 */
/*!***************************************!*\
!*** ./~/core-js/modules/_defined.js ***!
\***************************************/
/***/ function(module, exports) {
// 7.2.1 RequireObjectCoercible(argument)
module.exports = function(it){
if(it == undefined)throw TypeError("Can't call method on " + it);
return it;
};
/***/ },
/* 265 */
/*!**********************************************!*\
!*** ./~/core-js/modules/_array-includes.js ***!
\**********************************************/
/***/ function(module, exports, __webpack_require__) {
// false -> Array#indexOf
// true -> Array#includes
var toIObject = __webpack_require__(/*! ./_to-iobject */ 261)
, toLength = __webpack_require__(/*! ./_to-length */ 266)
, toIndex = __webpack_require__(/*! ./_to-index */ 268);
module.exports = function(IS_INCLUDES){
return function($this, el, fromIndex){
var O = toIObject($this)
, length = toLength(O.length)
, index = toIndex(fromIndex, length)
, value;
// Array#includes uses SameValueZero equality algorithm
if(IS_INCLUDES && el != el)while(length > index){
value = O[index++];
if(value != value)return true;
// Array#toIndex ignores holes, Array#includes - not
} else for(;length > index; index++)if(IS_INCLUDES || index in O){
if(O[index] === el)return IS_INCLUDES || index || 0;
} return !IS_INCLUDES && -1;
};
};
/***/ },
/* 266 */
/*!*****************************************!*\
!*** ./~/core-js/modules/_to-length.js ***!
\*****************************************/
/***/ function(module, exports, __webpack_require__) {
// 7.1.15 ToLength
var toInteger = __webpack_require__(/*! ./_to-integer */ 267)
, min = Math.min;
module.exports = function(it){
return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
};
/***/ },
/* 267 */
/*!******************************************!*\
!*** ./~/core-js/modules/_to-integer.js ***!
\******************************************/
/***/ function(module, exports) {
// 7.1.4 ToInteger
var ceil = Math.ceil
, floor = Math.floor;
module.exports = function(it){
return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
};
/***/ },
/* 268 */
/*!****************************************!*\
!*** ./~/core-js/modules/_to-index.js ***!
\****************************************/
/***/ function(module, exports, __webpack_require__) {
var toInteger = __webpack_require__(/*! ./_to-integer */ 267)
, max = Math.max
, min = Math.min;
module.exports = function(index, length){
index = toInteger(index);
return index < 0 ? max(index + length, 0) : min(index, length);
};
/***/ },
/* 269 */
/*!******************************************!*\
!*** ./~/core-js/modules/_shared-key.js ***!
\******************************************/
/***/ function(module, exports, __webpack_require__) {
var shared = __webpack_require__(/*! ./_shared */ 252)('keys')
, uid = __webpack_require__(/*! ./_uid */ 248);
module.exports = function(key){
return shared[key] || (shared[key] = uid(key));
};
/***/ },
/* 270 */
/*!*********************************************!*\
!*** ./~/core-js/modules/_enum-bug-keys.js ***!
\*********************************************/
/***/ function(module, exports) {
// IE 8- don't enum bug keys
module.exports = (
'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
).split(',');
/***/ },
/* 271 */
/*!*****************************************!*\
!*** ./~/core-js/modules/_enum-keys.js ***!
\*****************************************/
/***/ function(module, exports, __webpack_require__) {
// all enumerable object keys, includes symbols
var getKeys = __webpack_require__(/*! ./_object-keys */ 259)
, gOPS = __webpack_require__(/*! ./_object-gops */ 272)
, pIE = __webpack_require__(/*! ./_object-pie */ 273);
module.exports = function(it){
var result = getKeys(it)
, getSymbols = gOPS.f;
if(getSymbols){
var symbols = getSymbols(it)
, isEnum = pIE.f
, i = 0
, key;
while(symbols.length > i)if(isEnum.call(it, key = symbols[i++]))result.push(key);
} return result;
};
/***/ },
/* 272 */
/*!*******************************************!*\
!*** ./~/core-js/modules/_object-gops.js ***!
\*******************************************/
/***/ function(module, exports) {
exports.f = Object.getOwnPropertySymbols;
/***/ },
/* 273 */
/*!******************************************!*\
!*** ./~/core-js/modules/_object-pie.js ***!
\******************************************/
/***/ function(module, exports) {
exports.f = {}.propertyIsEnumerable;
/***/ },
/* 274 */
/*!****************************************!*\
!*** ./~/core-js/modules/_is-array.js ***!
\****************************************/
/***/ function(module, exports, __webpack_require__) {
// 7.2.2 IsArray(argument)
var cof = __webpack_require__(/*! ./_cof */ 263);
module.exports = Array.isArray || function isArray(arg){
return cof(arg) == 'Array';
};
/***/ },
/* 275 */
/*!*********************************************!*\
!*** ./~/core-js/modules/_object-create.js ***!
\*********************************************/
/***/ function(module, exports, __webpack_require__) {
// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
var anObject = __webpack_require__(/*! ./_an-object */ 241)
, dPs = __webpack_require__(/*! ./_object-dps */ 276)
, enumBugKeys = __webpack_require__(/*! ./_enum-bug-keys */ 270)
, IE_PROTO = __webpack_require__(/*! ./_shared-key */ 269)('IE_PROTO')
, Empty = function(){ /* empty */ }
, PROTOTYPE = 'prototype';
// Create object with fake `null` prototype: use iframe Object with cleared prototype
var createDict = function(){
// Thrash, waste and sodomy: IE GC bug
var iframe = __webpack_require__(/*! ./_dom-create */ 244)('iframe')
, i = enumBugKeys.length
, lt = '<'
, gt = '>'
, iframeDocument;
iframe.style.display = 'none';
__webpack_require__(/*! ./_html */ 277).appendChild(iframe);
iframe.src = 'javascript:'; // eslint-disable-line no-script-url
// createDict = iframe.contentWindow.Object;
// html.removeChild(iframe);
iframeDocument = iframe.contentWindow.document;
iframeDocument.open();
iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
iframeDocument.close();
createDict = iframeDocument.F;
while(i--)delete createDict[PROTOTYPE][enumBugKeys[i]];
return createDict();
};
module.exports = Object.create || function create(O, Properties){
var result;
if(O !== null){
Empty[PROTOTYPE] = anObject(O);
result = new Empty;
Empty[PROTOTYPE] = null;
// add "__proto__" for Object.getPrototypeOf polyfill
result[IE_PROTO] = O;
} else result = createDict();
return Properties === undefined ? result : dPs(result, Properties);
};
/***/ },
/* 276 */
/*!******************************************!*\
!*** ./~/core-js/modules/_object-dps.js ***!
\******************************************/
/***/ function(module, exports, __webpack_require__) {
var dP = __webpack_require__(/*! ./_object-dp */ 240)
, anObject = __webpack_require__(/*! ./_an-object */ 241)
, getKeys = __webpack_require__(/*! ./_object-keys */ 259);
module.exports = __webpack_require__(/*! ./_descriptors */ 235) ? Object.defineProperties : function defineProperties(O, Properties){
anObject(O);
var keys = getKeys(Properties)
, length = keys.length
, i = 0
, P;
while(length > i)dP.f(O, P = keys[i++], Properties[P]);
return O;
};
/***/ },
/* 277 */
/*!************************************!*\
!*** ./~/core-js/modules/_html.js ***!
\************************************/
/***/ function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(/*! ./_global */ 233).document && document.documentElement;
/***/ },
/* 278 */
/*!***********************************************!*\
!*** ./~/core-js/modules/_object-gopn-ext.js ***!
\***********************************************/
/***/ function(module, exports, __webpack_require__) {
// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
var toIObject = __webpack_require__(/*! ./_to-iobject */ 261)
, gOPN = __webpack_require__(/*! ./_object-gopn */ 279).f
, toString = {}.toString;
var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
? Object.getOwnPropertyNames(window) : [];
var getWindowNames = function(it){
try {
return gOPN(it);
} catch(e){
return windowNames.slice();
}
};
module.exports.f = function getOwnPropertyNames(it){
return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));
};
/***/ },
/* 279 */
/*!*******************************************!*\
!*** ./~/core-js/modules/_object-gopn.js ***!
\*******************************************/
/***/ function(module, exports, __webpack_require__) {
// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)
var $keys = __webpack_require__(/*! ./_object-keys-internal */ 260)
, hiddenKeys = __webpack_require__(/*! ./_enum-bug-keys */ 270).concat('length', 'prototype');
exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O){
return $keys(O, hiddenKeys);
};
/***/ },
/* 280 */
/*!*******************************************!*\
!*** ./~/core-js/modules/_object-gopd.js ***!
\*******************************************/
/***/ function(module, exports, __webpack_require__) {
var pIE = __webpack_require__(/*! ./_object-pie */ 273)
, createDesc = __webpack_require__(/*! ./_property-desc */ 246)
, toIObject = __webpack_require__(/*! ./_to-iobject */ 261)
, toPrimitive = __webpack_require__(/*! ./_to-primitive */ 245)
, has = __webpack_require__(/*! ./_has */ 234)
, IE8_DOM_DEFINE = __webpack_require__(/*! ./_ie8-dom-define */ 243)
, gOPD = Object.getOwnPropertyDescriptor;
exports.f = __webpack_require__(/*! ./_descriptors */ 235) ? gOPD : function getOwnPropertyDescriptor(O, P){
O = toIObject(O);
P = toPrimitive(P, true);
if(IE8_DOM_DEFINE)try {
return gOPD(O, P);
} catch(e){ /* empty */ }
if(has(O, P))return createDesc(!pIE.f.call(O, P), O[P]);
};
/***/ },
/* 281 */
/*!************************************************!*\
!*** ./~/core-js/modules/es6.object.create.js ***!
\************************************************/
/***/ function(module, exports, __webpack_require__) {
var $export = __webpack_require__(/*! ./_export */ 237)
// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
$export($export.S, 'Object', {create: __webpack_require__(/*! ./_object-create */ 275)});
/***/ },
/* 282 */
/*!*********************************************************!*\
!*** ./~/core-js/modules/es6.object.define-property.js ***!
\*********************************************************/
/***/ function(module, exports, __webpack_require__) {
var $export = __webpack_require__(/*! ./_export */ 237);
// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)
$export($export.S + $export.F * !__webpack_require__(/*! ./_descriptors */ 235), 'Object', {defineProperty: __webpack_require__(/*! ./_object-dp */ 240).f});
/***/ },
/* 283 */
/*!***********************************************************!*\
!*** ./~/core-js/modules/es6.object.define-properties.js ***!
\***********************************************************/
/***/ function(module, exports, __webpack_require__) {
var $export = __webpack_require__(/*! ./_export */ 237);
// 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties)
$export($export.S + $export.F * !__webpack_require__(/*! ./_descriptors */ 235), 'Object', {defineProperties: __webpack_require__(/*! ./_object-dps */ 276)});
/***/ },
/* 284 */
/*!*********************************************************************!*\
!*** ./~/core-js/modules/es6.object.get-own-property-descriptor.js ***!
\*********************************************************************/
/***/ function(module, exports, __webpack_require__) {
// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
var toIObject = __webpack_require__(/*! ./_to-iobject */ 261)
, $getOwnPropertyDescriptor = __webpack_require__(/*! ./_object-gopd */ 280).f;
__webpack_require__(/*! ./_object-sap */ 285)('getOwnPropertyDescriptor', function(){
return function getOwnPropertyDescriptor(it, key){
return $getOwnPropertyDescriptor(toIObject(it), key);
};
});
/***/ },
/* 285 */
/*!******************************************!*\
!*** ./~/core-js/modules/_object-sap.js ***!
\******************************************/
/***/ function(module, exports, __webpack_require__) {
// most Object methods by ES6 should accept primitives
var $export = __webpack_require__(/*! ./_export */ 237)
, core = __webpack_require__(/*! ./_core */ 238)
, fails = __webpack_require__(/*! ./_fails */ 236);
module.exports = function(KEY, exec){
var fn = (core.Object || {})[KEY] || Object[KEY]
, exp = {};
exp[KEY] = exec(fn);
$export($export.S + $export.F * fails(function(){ fn(1); }), 'Object', exp);
};
/***/ },
/* 286 */
/*!**********************************************************!*\
!*** ./~/core-js/modules/es6.object.get-prototype-of.js ***!
\**********************************************************/
/***/ function(module, exports, __webpack_require__) {
// 19.1.2.9 Object.getPrototypeOf(O)
var toObject = __webpack_require__(/*! ./_to-object */ 287)
, $getPrototypeOf = __webpack_require__(/*! ./_object-gpo */ 288);
__webpack_require__(/*! ./_object-sap */ 285)('getPrototypeOf', function(){
return function getPrototypeOf(it){
return $getPrototypeOf(toObject(it));
};
});
/***/ },
/* 287 */
/*!*****************************************!*\
!*** ./~/core-js/modules/_to-object.js ***!
\*****************************************/
/***/ function(module, exports, __webpack_require__) {
// 7.1.13 ToObject(argument)
var defined = __webpack_require__(/*! ./_defined */ 264);
module.exports = function(it){
return Object(defined(it));
};
/***/ },
/* 288 */
/*!******************************************!*\
!*** ./~/core-js/modules/_object-gpo.js ***!
\******************************************/
/***/ function(module, exports, __webpack_require__) {
// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
var has = __webpack_require__(/*! ./_has */ 234)
, toObject = __webpack_require__(/*! ./_to-object */ 287)
, IE_PROTO = __webpack_require__(/*! ./_shared-key */ 269)('IE_PROTO')
, ObjectProto = Object.prototype;
module.exports = Object.getPrototypeOf || function(O){
O = toObject(O);
if(has(O, IE_PROTO))return O[IE_PROTO];
if(typeof O.constructor == 'function' && O instanceof O.constructor){
return O.constructor.prototype;
} return O instanceof Object ? ObjectProto : null;
};
/***/ },
/* 289 */
/*!**********************************************!*\
!*** ./~/core-js/modules/es6.object.keys.js ***!
\**********************************************/
/***/ function(module, exports, __webpack_require__) {
// 19.1.2.14 Object.keys(O)
var toObject = __webpack_require__(/*! ./_to-object */ 287)
, $keys = __webpack_require__(/*! ./_object-keys */ 259);
__webpack_require__(/*! ./_object-sap */ 285)('keys', function(){
return function keys(it){
return $keys(toObject(it));
};
});
/***/ },
/* 290 */
/*!****************************************************************!*\
!*** ./~/core-js/modules/es6.object.get-own-property-names.js ***!
\****************************************************************/
/***/ function(module, exports, __webpack_require__) {
// 19.1.2.7 Object.getOwnPropertyNames(O)
__webpack_require__(/*! ./_object-sap */ 285)('getOwnPropertyNames', function(){
return __webpack_require__(/*! ./_object-gopn-ext */ 278).f;
});
/***/ },
/* 291 */
/*!************************************************!*\
!*** ./~/core-js/modules/es6.object.freeze.js ***!
\************************************************/
/***/ function(module, exports, __webpack_require__) {
// 19.1.2.5 Object.freeze(O)
var isObject = __webpack_require__(/*! ./_is-object */ 242)
, meta = __webpack_require__(/*! ./_meta */ 251).onFreeze;
__webpack_require__(/*! ./_object-sap */ 285)('freeze', function($freeze){
return function freeze(it){
return $freeze && isObject(it) ? $freeze(meta(it)) : it;
};
});
/***/ },
/* 292 */
/*!**********************************************!*\
!*** ./~/core-js/modules/es6.object.seal.js ***!
\**********************************************/
/***/ function(module, exports, __webpack_require__) {
// 19.1.2.17 Object.seal(O)
var isObject = __webpack_require__(/*! ./_is-object */ 242)
, meta = __webpack_require__(/*! ./_meta */ 251).onFreeze;
__webpack_require__(/*! ./_object-sap */ 285)('seal', function($seal){
return function seal(it){
return $seal && isObject(it) ? $seal(meta(it)) : it;
};
});
/***/ },
/* 293 */
/*!************************************************************!*\
!*** ./~/core-js/modules/es6.object.prevent-extensions.js ***!
\************************************************************/
/***/ function(module, exports, __webpack_require__) {
// 19.1.2.15 Object.preventExtensions(O)
var isObject = __webpack_require__(/*! ./_is-object */ 242)
, meta = __webpack_require__(/*! ./_meta */ 251).onFreeze;
__webpack_require__(/*! ./_object-sap */ 285)('preventExtensions', function($preventExtensions){
return function preventExtensions(it){
return $preventExtensions && isObject(it) ? $preventExtensions(meta(it)) : it;
};
});
/***/ },
/* 294 */
/*!***************************************************!*\
!*** ./~/core-js/modules/es6.object.is-frozen.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
// 19.1.2.12 Object.isFrozen(O)
var isObject = __webpack_require__(/*! ./_is-object */ 242);
__webpack_require__(/*! ./_object-sap */ 285)('isFrozen', function($isFrozen){
return function isFrozen(it){
return isObject(it) ? $isFrozen ? $isFrozen(it) : false : true;
};
});
/***/ },
/* 295 */
/*!***************************************************!*\
!*** ./~/core-js/modules/es6.object.is-sealed.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
// 19.1.2.13 Object.isSealed(O)
var isObject = __webpack_require__(/*! ./_is-object */ 242);
__webpack_require__(/*! ./_object-sap */ 285)('isSealed', function($isSealed){
return function isSealed(it){
return isObject(it) ? $isSealed ? $isSealed(it) : false : true;
};
});
/***/ },
/* 296 */
/*!*******************************************************!*\
!*** ./~/core-js/modules/es6.object.is-extensible.js ***!
\*******************************************************/
/***/ function(module, exports, __webpack_require__) {
// 19.1.2.11 Object.isExtensible(O)
var isObject = __webpack_require__(/*! ./_is-object */ 242);
__webpack_require__(/*! ./_object-sap */ 285)('isExtensible', function($isExtensible){
return function isExtensible(it){
return isObject(it) ? $isExtensible ? $isExtensible(it) : true : false;
};
});
/***/ },
/* 297 */
/*!************************************************!*\
!*** ./~/core-js/modules/es6.object.assign.js ***!
\************************************************/
/***/ function(module, exports, __webpack_require__) {
// 19.1.3.1 Object.assign(target, source)
var $export = __webpack_require__(/*! ./_export */ 237);
$export($export.S + $export.F, 'Object', {assign: __webpack_require__(/*! ./_object-assign */ 298)});
/***/ },
/* 298 */
/*!*********************************************!*\
!*** ./~/core-js/modules/_object-assign.js ***!
\*********************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
// 19.1.2.1 Object.assign(target, source, ...)
var getKeys = __webpack_require__(/*! ./_object-keys */ 259)
, gOPS = __webpack_require__(/*! ./_object-gops */ 272)
, pIE = __webpack_require__(/*! ./_object-pie */ 273)
, toObject = __webpack_require__(/*! ./_to-object */ 287)
, IObject = __webpack_require__(/*! ./_iobject */ 262)
, $assign = Object.assign;
// should work with symbols and should have deterministic property order (V8 bug)
module.exports = !$assign || __webpack_require__(/*! ./_fails */ 236)(function(){
var A = {}
, B = {}
, S = Symbol()
, K = 'abcdefghijklmnopqrst';
A[S] = 7;
K.split('').forEach(function(k){ B[k] = k; });
return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
}) ? function assign(target, source){ // eslint-disable-line no-unused-vars
var T = toObject(target)
, aLen = arguments.length
, index = 1
, getSymbols = gOPS.f
, isEnum = pIE.f;
while(aLen > index){
var S = IObject(arguments[index++])
, keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S)
, length = keys.length
, j = 0
, key;
while(length > j)if(isEnum.call(S, key = keys[j++]))T[key] = S[key];
} return T;
} : $assign;
/***/ },
/* 299 */
/*!********************************************!*\
!*** ./~/core-js/modules/es6.object.is.js ***!
\********************************************/
/***/ function(module, exports, __webpack_require__) {
// 19.1.3.10 Object.is(value1, value2)
var $export = __webpack_require__(/*! ./_export */ 237);
$export($export.S, 'Object', {is: __webpack_require__(/*! ./_same-value */ 300)});
/***/ },
/* 300 */
/*!******************************************!*\
!*** ./~/core-js/modules/_same-value.js ***!
\******************************************/
/***/ function(module, exports) {
// 7.2.9 SameValue(x, y)
module.exports = Object.is || function is(x, y){
return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
};
/***/ },
/* 301 */
/*!**********************************************************!*\
!*** ./~/core-js/modules/es6.object.set-prototype-of.js ***!
\**********************************************************/
/***/ function(module, exports, __webpack_require__) {
// 19.1.3.19 Object.setPrototypeOf(O, proto)
var $export = __webpack_require__(/*! ./_export */ 237);
$export($export.S, 'Object', {setPrototypeOf: __webpack_require__(/*! ./_set-proto */ 302).set});
/***/ },
/* 302 */
/*!*****************************************!*\
!*** ./~/core-js/modules/_set-proto.js ***!
\*****************************************/
/***/ function(module, exports, __webpack_require__) {
// Works with __proto__ only. Old v8 can't work with null proto objects.
/* eslint-disable no-proto */
var isObject = __webpack_require__(/*! ./_is-object */ 242)
, anObject = __webpack_require__(/*! ./_an-object */ 241);
var check = function(O, proto){
anObject(O);
if(!isObject(proto) && proto !== null)throw TypeError(proto + ": can't set as prototype!");
};
module.exports = {
set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line
function(test, buggy, set){
try {
set = __webpack_require__(/*! ./_ctx */ 249)(Function.call, __webpack_require__(/*! ./_object-gopd */ 280).f(Object.prototype, '__proto__').set, 2);
set(test, []);
buggy = !(test instanceof Array);
} catch(e){ buggy = true; }
return function setPrototypeOf(O, proto){
check(O, proto);
if(buggy)O.__proto__ = proto;
else set(O, proto);
return O;
};
}({}, false) : undefined),
check: check
};
/***/ },
/* 303 */
/*!***************************************************!*\
!*** ./~/core-js/modules/es6.object.to-string.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
// 19.1.3.6 Object.prototype.toString()
var classof = __webpack_require__(/*! ./_classof */ 304)
, test = {};
test[__webpack_require__(/*! ./_wks */ 254)('toStringTag')] = 'z';
if(test + '' != '[object z]'){
__webpack_require__(/*! ./_redefine */ 247)(Object.prototype, 'toString', function toString(){
return '[object ' + classof(this) + ']';
}, true);
}
/***/ },
/* 304 */
/*!***************************************!*\
!*** ./~/core-js/modules/_classof.js ***!
\***************************************/
/***/ function(module, exports, __webpack_require__) {
// getting tag from 19.1.3.6 Object.prototype.toString()
var cof = __webpack_require__(/*! ./_cof */ 263)
, TAG = __webpack_require__(/*! ./_wks */ 254)('toStringTag')
// ES3 wrong here
, ARG = cof(function(){ return arguments; }()) == 'Arguments';
// fallback for IE11 Script Access Denied error
var tryGet = function(it, key){
try {
return it[key];
} catch(e){ /* empty */ }
};
module.exports = function(it){
var O, T, B;
return it === undefined ? 'Undefined' : it === null ? 'Null'
// @@toStringTag case
: typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T
// builtinTag case
: ARG ? cof(O)
// ES3 arguments fallback
: (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
};
/***/ },
/* 305 */
/*!************************************************!*\
!*** ./~/core-js/modules/es6.function.bind.js ***!
\************************************************/
/***/ function(module, exports, __webpack_require__) {
// 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...)
var $export = __webpack_require__(/*! ./_export */ 237);
$export($export.P, 'Function', {bind: __webpack_require__(/*! ./_bind */ 306)});
/***/ },
/* 306 */
/*!************************************!*\
!*** ./~/core-js/modules/_bind.js ***!
\************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
var aFunction = __webpack_require__(/*! ./_a-function */ 250)
, isObject = __webpack_require__(/*! ./_is-object */ 242)
, invoke = __webpack_require__(/*! ./_invoke */ 307)
, arraySlice = [].slice
, factories = {};
var construct = function(F, len, args){
if(!(len in factories)){
for(var n = [], i = 0; i < len; i++)n[i] = 'a[' + i + ']';
factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')');
} return factories[len](F, args);
};
module.exports = Function.bind || function bind(that /*, args... */){
var fn = aFunction(this)
, partArgs = arraySlice.call(arguments, 1);
var bound = function(/* args... */){
var args = partArgs.concat(arraySlice.call(arguments));
return this instanceof bound ? construct(fn, args.length, args) : invoke(fn, args, that);
};
if(isObject(fn.prototype))bound.prototype = fn.prototype;
return bound;
};
/***/ },
/* 307 */
/*!**************************************!*\
!*** ./~/core-js/modules/_invoke.js ***!
\**************************************/
/***/ function(module, exports) {
// fast apply, http://jsperf.lnkit.com/fast-apply/5
module.exports = function(fn, args, that){
var un = that === undefined;
switch(args.length){
case 0: return un ? fn()
: fn.call(that);
case 1: return un ? fn(args[0])
: fn.call(that, args[0]);
case 2: return un ? fn(args[0], args[1])
: fn.call(that, args[0], args[1]);
case 3: return un ? fn(args[0], args[1], args[2])
: fn.call(that, args[0], args[1], args[2]);
case 4: return un ? fn(args[0], args[1], args[2], args[3])
: fn.call(that, args[0], args[1], args[2], args[3]);
} return fn.apply(that, args);
};
/***/ },
/* 308 */
/*!************************************************!*\
!*** ./~/core-js/modules/es6.function.name.js ***!
\************************************************/
/***/ function(module, exports, __webpack_require__) {
var dP = __webpack_require__(/*! ./_object-dp */ 240).f
, createDesc = __webpack_require__(/*! ./_property-desc */ 246)
, has = __webpack_require__(/*! ./_has */ 234)
, FProto = Function.prototype
, nameRE = /^\s*function ([^ (]*)/
, NAME = 'name';
var isExtensible = Object.isExtensible || function(){
return true;
};
// 19.2.4.2 name
NAME in FProto || __webpack_require__(/*! ./_descriptors */ 235) && dP(FProto, NAME, {
configurable: true,
get: function(){
try {
var that = this
, name = ('' + that).match(nameRE)[1];
has(that, NAME) || !isExtensible(that) || dP(that, NAME, createDesc(5, name));
return name;
} catch(e){
return '';
}
}
});
/***/ },
/* 309 */
/*!********************************************************!*\
!*** ./~/core-js/modules/es6.function.has-instance.js ***!
\********************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
var isObject = __webpack_require__(/*! ./_is-object */ 242)
, getPrototypeOf = __webpack_require__(/*! ./_object-gpo */ 288)
, HAS_INSTANCE = __webpack_require__(/*! ./_wks */ 254)('hasInstance')
, FunctionProto = Function.prototype;
// 19.2.3.6 Function.prototype[@@hasInstance](V)
if(!(HAS_INSTANCE in FunctionProto))__webpack_require__(/*! ./_object-dp */ 240).f(FunctionProto, HAS_INSTANCE, {value: function(O){
if(typeof this != 'function' || !isObject(O))return false;
if(!isObject(this.prototype))return O instanceof this;
// for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this:
while(O = getPrototypeOf(O))if(this.prototype === O)return true;
return false;
}});
/***/ },
/* 310 */
/*!********************************************!*\
!*** ./~/core-js/modules/es6.parse-int.js ***!
\********************************************/
/***/ function(module, exports, __webpack_require__) {
var $export = __webpack_require__(/*! ./_export */ 237)
, $parseInt = __webpack_require__(/*! ./_parse-int */ 311);
// 18.2.5 parseInt(string, radix)
$export($export.G + $export.F * (parseInt != $parseInt), {parseInt: $parseInt});
/***/ },
/* 311 */
/*!*****************************************!*\
!*** ./~/core-js/modules/_parse-int.js ***!
\*****************************************/
/***/ function(module, exports, __webpack_require__) {
var $parseInt = __webpack_require__(/*! ./_global */ 233).parseInt
, $trim = __webpack_require__(/*! ./_string-trim */ 312).trim
, ws = __webpack_require__(/*! ./_string-ws */ 313)
, hex = /^[\-+]?0[xX]/;
module.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? function parseInt(str, radix){
var string = $trim(String(str), 3);
return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10));
} : $parseInt;
/***/ },
/* 312 */
/*!*******************************************!*\
!*** ./~/core-js/modules/_string-trim.js ***!
\*******************************************/
/***/ function(module, exports, __webpack_require__) {
var $export = __webpack_require__(/*! ./_export */ 237)
, defined = __webpack_require__(/*! ./_defined */ 264)
, fails = __webpack_require__(/*! ./_fails */ 236)
, spaces = __webpack_require__(/*! ./_string-ws */ 313)
, space = '[' + spaces + ']'
, non = '\u200b\u0085'
, ltrim = RegExp('^' + space + space + '*')
, rtrim = RegExp(space + space + '*$');
var exporter = function(KEY, exec, ALIAS){
var exp = {};
var FORCE = fails(function(){
return !!spaces[KEY]() || non[KEY]() != non;
});
var fn = exp[KEY] = FORCE ? exec(trim) : spaces[KEY];
if(ALIAS)exp[ALIAS] = fn;
$export($export.P + $export.F * FORCE, 'String', exp);
};
// 1 -> String#trimLeft
// 2 -> String#trimRight
// 3 -> String#trim
var trim = exporter.trim = function(string, TYPE){
string = String(defined(string));
if(TYPE & 1)string = string.replace(ltrim, '');
if(TYPE & 2)string = string.replace(rtrim, '');
return string;
};
module.exports = exporter;
/***/ },
/* 313 */
/*!*****************************************!*\
!*** ./~/core-js/modules/_string-ws.js ***!
\*****************************************/
/***/ function(module, exports) {
module.exports = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' +
'\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
/***/ },
/* 314 */
/*!**********************************************!*\
!*** ./~/core-js/modules/es6.parse-float.js ***!
\**********************************************/
/***/ function(module, exports, __webpack_require__) {
var $export = __webpack_require__(/*! ./_export */ 237)
, $parseFloat = __webpack_require__(/*! ./_parse-float */ 315);
// 18.2.4 parseFloat(string)
$export($export.G + $export.F * (parseFloat != $parseFloat), {parseFloat: $parseFloat});
/***/ },
/* 315 */
/*!*******************************************!*\
!*** ./~/core-js/modules/_parse-float.js ***!
\*******************************************/
/***/ function(module, exports, __webpack_require__) {
var $parseFloat = __webpack_require__(/*! ./_global */ 233).parseFloat
, $trim = __webpack_require__(/*! ./_string-trim */ 312).trim;
module.exports = 1 / $parseFloat(__webpack_require__(/*! ./_string-ws */ 313) + '-0') !== -Infinity ? function parseFloat(str){
var string = $trim(String(str), 3)
, result = $parseFloat(string);
return result === 0 && string.charAt(0) == '-' ? -0 : result;
} : $parseFloat;
/***/ },
/* 316 */
/*!*****************************************************!*\
!*** ./~/core-js/modules/es6.number.constructor.js ***!
\*****************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
var global = __webpack_require__(/*! ./_global */ 233)
, has = __webpack_require__(/*! ./_has */ 234)
, cof = __webpack_require__(/*! ./_cof */ 263)
, inheritIfRequired = __webpack_require__(/*! ./_inherit-if-required */ 317)
, toPrimitive = __webpack_require__(/*! ./_to-primitive */ 245)
, fails = __webpack_require__(/*! ./_fails */ 236)
, gOPN = __webpack_require__(/*! ./_object-gopn */ 279).f
, gOPD = __webpack_require__(/*! ./_object-gopd */ 280).f
, dP = __webpack_require__(/*! ./_object-dp */ 240).f
, $trim = __webpack_require__(/*! ./_string-trim */ 312).trim
, NUMBER = 'Number'
, $Number = global[NUMBER]
, Base = $Number
, proto = $Number.prototype
// Opera ~12 has broken Object#toString
, BROKEN_COF = cof(__webpack_require__(/*! ./_object-create */ 275)(proto)) == NUMBER
, TRIM = 'trim' in String.prototype;
// 7.1.3 ToNumber(argument)
var toNumber = function(argument){
var it = toPrimitive(argument, false);
if(typeof it == 'string' && it.length > 2){
it = TRIM ? it.trim() : $trim(it, 3);
var first = it.charCodeAt(0)
, third, radix, maxCode;
if(first === 43 || first === 45){
third = it.charCodeAt(2);
if(third === 88 || third === 120)return NaN; // Number('+0x1') should be NaN, old V8 fix
} else if(first === 48){
switch(it.charCodeAt(1)){
case 66 : case 98 : radix = 2; maxCode = 49; break; // fast equal /^0b[01]+$/i
case 79 : case 111 : radix = 8; maxCode = 55; break; // fast equal /^0o[0-7]+$/i
default : return +it;
}
for(var digits = it.slice(2), i = 0, l = digits.length, code; i < l; i++){
code = digits.charCodeAt(i);
// parseInt parses a string to a first unavailable symbol
// but ToNumber should return NaN if a string contains unavailable symbols
if(code < 48 || code > maxCode)return NaN;
} return parseInt(digits, radix);
}
} return +it;
};
if(!$Number(' 0o1') || !$Number('0b1') || $Number('+0x1')){
$Number = function Number(value){
var it = arguments.length < 1 ? 0 : value
, that = this;
return that instanceof $Number
// check on 1..constructor(foo) case
&& (BROKEN_COF ? fails(function(){ proto.valueOf.call(that); }) : cof(that) != NUMBER)
? inheritIfRequired(new Base(toNumber(it)), that, $Number) : toNumber(it);
};
for(var keys = __webpack_require__(/*! ./_descriptors */ 235) ? gOPN(Base) : (
// ES3:
'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' +
// ES6 (in case, if modules with ES6 Number statics required before):
'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' +
'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger'
).split(','), j = 0, key; keys.length > j; j++){
if(has(Base, key = keys[j]) && !has($Number, key)){
dP($Number, key, gOPD(Base, key));
}
}
$Number.prototype = proto;
proto.constructor = $Number;
__webpack_require__(/*! ./_redefine */ 247)(global, NUMBER, $Number);
}
/***/ },
/* 317 */
/*!***************************************************!*\
!*** ./~/core-js/modules/_inherit-if-required.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(/*! ./_is-object */ 242)
, setPrototypeOf = __webpack_require__(/*! ./_set-proto */ 302).set;
module.exports = function(that, target, C){
var P, S = target.constructor;
if(S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf){
setPrototypeOf(that, P);
} return that;
};
/***/ },
/* 318 */
/*!**************************************************!*\
!*** ./~/core-js/modules/es6.number.to-fixed.js ***!
\**************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(/*! ./_export */ 237)
, toInteger = __webpack_require__(/*! ./_to-integer */ 267)
, aNumberValue = __webpack_require__(/*! ./_a-number-value */ 319)
, repeat = __webpack_require__(/*! ./_string-repeat */ 320)
, $toFixed = 1..toFixed
, floor = Math.floor
, data = [0, 0, 0, 0, 0, 0]
, ERROR = 'Number.toFixed: incorrect invocation!'
, ZERO = '0';
var multiply = function(n, c){
var i = -1
, c2 = c;
while(++i < 6){
c2 += n * data[i];
data[i] = c2 % 1e7;
c2 = floor(c2 / 1e7);
}
};
var divide = function(n){
var i = 6
, c = 0;
while(--i >= 0){
c += data[i];
data[i] = floor(c / n);
c = (c % n) * 1e7;
}
};
var numToString = function(){
var i = 6
, s = '';
while(--i >= 0){
if(s !== '' || i === 0 || data[i] !== 0){
var t = String(data[i]);
s = s === '' ? t : s + repeat.call(ZERO, 7 - t.length) + t;
}
} return s;
};
var pow = function(x, n, acc){
return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc);
};
var log = function(x){
var n = 0
, x2 = x;
while(x2 >= 4096){
n += 12;
x2 /= 4096;
}
while(x2 >= 2){
n += 1;
x2 /= 2;
} return n;
};
$export($export.P + $export.F * (!!$toFixed && (
0.00008.toFixed(3) !== '0.000' ||
0.9.toFixed(0) !== '1' ||
1.255.toFixed(2) !== '1.25' ||
1000000000000000128..toFixed(0) !== '1000000000000000128'
) || !__webpack_require__(/*! ./_fails */ 236)(function(){
// V8 ~ Android 4.3-
$toFixed.call({});
})), 'Number', {
toFixed: function toFixed(fractionDigits){
var x = aNumberValue(this, ERROR)
, f = toInteger(fractionDigits)
, s = ''
, m = ZERO
, e, z, j, k;
if(f < 0 || f > 20)throw RangeError(ERROR);
if(x != x)return 'NaN';
if(x <= -1e21 || x >= 1e21)return String(x);
if(x < 0){
s = '-';
x = -x;
}
if(x > 1e-21){
e = log(x * pow(2, 69, 1)) - 69;
z = e < 0 ? x * pow(2, -e, 1) : x / pow(2, e, 1);
z *= 0x10000000000000;
e = 52 - e;
if(e > 0){
multiply(0, z);
j = f;
while(j >= 7){
multiply(1e7, 0);
j -= 7;
}
multiply(pow(10, j, 1), 0);
j = e - 1;
while(j >= 23){
divide(1 << 23);
j -= 23;
}
divide(1 << j);
multiply(1, 1);
divide(2);
m = numToString();
} else {
multiply(0, z);
multiply(1 << -e, 0);
m = numToString() + repeat.call(ZERO, f);
}
}
if(f > 0){
k = m.length;
m = s + (k <= f ? '0.' + repeat.call(ZERO, f - k) + m : m.slice(0, k - f) + '.' + m.slice(k - f));
} else {
m = s + m;
} return m;
}
});
/***/ },
/* 319 */
/*!**********************************************!*\
!*** ./~/core-js/modules/_a-number-value.js ***!
\**********************************************/
/***/ function(module, exports, __webpack_require__) {
var cof = __webpack_require__(/*! ./_cof */ 263);
module.exports = function(it, msg){
if(typeof it != 'number' && cof(it) != 'Number')throw TypeError(msg);
return +it;
};
/***/ },
/* 320 */
/*!*********************************************!*\
!*** ./~/core-js/modules/_string-repeat.js ***!
\*********************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
var toInteger = __webpack_require__(/*! ./_to-integer */ 267)
, defined = __webpack_require__(/*! ./_defined */ 264);
module.exports = function repeat(count){
var str = String(defined(this))
, res = ''
, n = toInteger(count);
if(n < 0 || n == Infinity)throw RangeError("Count can't be negative");
for(;n > 0; (n >>>= 1) && (str += str))if(n & 1)res += str;
return res;
};
/***/ },
/* 321 */
/*!******************************************************!*\
!*** ./~/core-js/modules/es6.number.to-precision.js ***!
\******************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(/*! ./_export */ 237)
, $fails = __webpack_require__(/*! ./_fails */ 236)
, aNumberValue = __webpack_require__(/*! ./_a-number-value */ 319)
, $toPrecision = 1..toPrecision;
$export($export.P + $export.F * ($fails(function(){
// IE7-
return $toPrecision.call(1, undefined) !== '1';
}) || !$fails(function(){
// V8 ~ Android 4.3-
$toPrecision.call({});
})), 'Number', {
toPrecision: function toPrecision(precision){
var that = aNumberValue(this, 'Number#toPrecision: incorrect invocation!');
return precision === undefined ? $toPrecision.call(that) : $toPrecision.call(that, precision);
}
});
/***/ },
/* 322 */
/*!*************************************************!*\
!*** ./~/core-js/modules/es6.number.epsilon.js ***!
\*************************************************/
/***/ function(module, exports, __webpack_require__) {
// 20.1.2.1 Number.EPSILON
var $export = __webpack_require__(/*! ./_export */ 237);
$export($export.S, 'Number', {EPSILON: Math.pow(2, -52)});
/***/ },
/* 323 */
/*!***************************************************!*\
!*** ./~/core-js/modules/es6.number.is-finite.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
// 20.1.2.2 Number.isFinite(number)
var $export = __webpack_require__(/*! ./_export */ 237)
, _isFinite = __webpack_require__(/*! ./_global */ 233).isFinite;
$export($export.S, 'Number', {
isFinite: function isFinite(it){
return typeof it == 'number' && _isFinite(it);
}
});
/***/ },
/* 324 */
/*!****************************************************!*\
!*** ./~/core-js/modules/es6.number.is-integer.js ***!
\****************************************************/
/***/ function(module, exports, __webpack_require__) {
// 20.1.2.3 Number.isInteger(number)
var $export = __webpack_require__(/*! ./_export */ 237);
$export($export.S, 'Number', {isInteger: __webpack_require__(/*! ./_is-integer */ 325)});
/***/ },
/* 325 */
/*!******************************************!*\
!*** ./~/core-js/modules/_is-integer.js ***!
\******************************************/
/***/ function(module, exports, __webpack_require__) {
// 20.1.2.3 Number.isInteger(number)
var isObject = __webpack_require__(/*! ./_is-object */ 242)
, floor = Math.floor;
module.exports = function isInteger(it){
return !isObject(it) && isFinite(it) && floor(it) === it;
};
/***/ },
/* 326 */
/*!************************************************!*\
!*** ./~/core-js/modules/es6.number.is-nan.js ***!
\************************************************/
/***/ function(module, exports, __webpack_require__) {
// 20.1.2.4 Number.isNaN(number)
var $export = __webpack_require__(/*! ./_export */ 237);
$export($export.S, 'Number', {
isNaN: function isNaN(number){
return number != number;
}
});
/***/ },
/* 327 */
/*!*********************************************************!*\
!*** ./~/core-js/modules/es6.number.is-safe-integer.js ***!
\*********************************************************/
/***/ function(module, exports, __webpack_require__) {
// 20.1.2.5 Number.isSafeInteger(number)
var $export = __webpack_require__(/*! ./_export */ 237)
, isInteger = __webpack_require__(/*! ./_is-integer */ 325)
, abs = Math.abs;
$export($export.S, 'Number', {
isSafeInteger: function isSafeInteger(number){
return isInteger(number) && abs(number) <= 0x1fffffffffffff;
}
});
/***/ },
/* 328 */
/*!**********************************************************!*\
!*** ./~/core-js/modules/es6.number.max-safe-integer.js ***!
\**********************************************************/
/***/ function(module, exports, __webpack_require__) {
// 20.1.2.6 Number.MAX_SAFE_INTEGER
var $export = __webpack_require__(/*! ./_export */ 237);
$export($export.S, 'Number', {MAX_SAFE_INTEGER: 0x1fffffffffffff});
/***/ },
/* 329 */
/*!**********************************************************!*\
!*** ./~/core-js/modules/es6.number.min-safe-integer.js ***!
\**********************************************************/
/***/ function(module, exports, __webpack_require__) {
// 20.1.2.10 Number.MIN_SAFE_INTEGER
var $export = __webpack_require__(/*! ./_export */ 237);
$export($export.S, 'Number', {MIN_SAFE_INTEGER: -0x1fffffffffffff});
/***/ },
/* 330 */
/*!*****************************************************!*\
!*** ./~/core-js/modules/es6.number.parse-float.js ***!
\*****************************************************/
/***/ function(module, exports, __webpack_require__) {
var $export = __webpack_require__(/*! ./_export */ 237)
, $parseFloat = __webpack_require__(/*! ./_parse-float */ 315);
// 20.1.2.12 Number.parseFloat(string)
$export($export.S + $export.F * (Number.parseFloat != $parseFloat), 'Number', {parseFloat: $parseFloat});
/***/ },
/* 331 */
/*!***************************************************!*\
!*** ./~/core-js/modules/es6.number.parse-int.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
var $export = __webpack_require__(/*! ./_export */ 237)
, $parseInt = __webpack_require__(/*! ./_parse-int */ 311);
// 20.1.2.13 Number.parseInt(string, radix)
$export($export.S + $export.F * (Number.parseInt != $parseInt), 'Number', {parseInt: $parseInt});
/***/ },
/* 332 */
/*!*********************************************!*\
!*** ./~/core-js/modules/es6.math.acosh.js ***!
\*********************************************/
/***/ function(module, exports, __webpack_require__) {
// 20.2.2.3 Math.acosh(x)
var $export = __webpack_require__(/*! ./_export */ 237)
, log1p = __webpack_require__(/*! ./_math-log1p */ 333)
, sqrt = Math.sqrt
, $acosh = Math.acosh;
$export($export.S + $export.F * !($acosh
// V8 bug: https://code.google.com/p/v8/issues/detail?id=3509
&& Math.floor($acosh(Number.MAX_VALUE)) == 710
// Tor Browser bug: Math.acosh(Infinity) -> NaN
&& $acosh(Infinity) == Infinity
), 'Math', {
acosh: function acosh(x){
return (x = +x) < 1 ? NaN : x > 94906265.62425156
? Math.log(x) + Math.LN2
: log1p(x - 1 + sqrt(x - 1) * sqrt(x + 1));
}
});
/***/ },
/* 333 */
/*!******************************************!*\
!*** ./~/core-js/modules/_math-log1p.js ***!
\******************************************/
/***/ function(module, exports) {
// 20.2.2.20 Math.log1p(x)
module.exports = Math.log1p || function log1p(x){
return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : Math.log(1 + x);
};
/***/ },
/* 334 */
/*!*********************************************!*\
!*** ./~/core-js/modules/es6.math.asinh.js ***!
\*********************************************/
/***/ function(module, exports, __webpack_require__) {
// 20.2.2.5 Math.asinh(x)
var $export = __webpack_require__(/*! ./_export */ 237)
, $asinh = Math.asinh;
function asinh(x){
return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : Math.log(x + Math.sqrt(x * x + 1));
}
// Tor Browser bug: Math.asinh(0) -> -0
$export($export.S + $export.F * !($asinh && 1 / $asinh(0) > 0), 'Math', {asinh: asinh});
/***/ },
/* 335 */
/*!*********************************************!*\
!*** ./~/core-js/modules/es6.math.atanh.js ***!
\*********************************************/
/***/ function(module, exports, __webpack_require__) {
// 20.2.2.7 Math.atanh(x)
var $export = __webpack_require__(/*! ./_export */ 237)
, $atanh = Math.atanh;
// Tor Browser bug: Math.atanh(-0) -> 0
$export($export.S + $export.F * !($atanh && 1 / $atanh(-0) < 0), 'Math', {
atanh: function atanh(x){
return (x = +x) == 0 ? x : Math.log((1 + x) / (1 - x)) / 2;
}
});
/***/ },
/* 336 */
/*!********************************************!*\
!*** ./~/core-js/modules/es6.math.cbrt.js ***!
\********************************************/
/***/ function(module, exports, __webpack_require__) {
// 20.2.2.9 Math.cbrt(x)
var $export = __webpack_require__(/*! ./_export */ 237)
, sign = __webpack_require__(/*! ./_math-sign */ 337);
$export($export.S, 'Math', {
cbrt: function cbrt(x){
return sign(x = +x) * Math.pow(Math.abs(x), 1 / 3);
}
});
/***/ },
/* 337 */
/*!*****************************************!*\
!*** ./~/core-js/modules/_math-sign.js ***!
\*****************************************/
/***/ function(module, exports) {
// 20.2.2.28 Math.sign(x)
module.exports = Math.sign || function sign(x){
return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1;
};
/***/ },
/* 338 */
/*!*********************************************!*\
!*** ./~/core-js/modules/es6.math.clz32.js ***!
\*********************************************/
/***/ function(module, exports, __webpack_require__) {
// 20.2.2.11 Math.clz32(x)
var $export = __webpack_require__(/*! ./_export */ 237);
$export($export.S, 'Math', {
clz32: function clz32(x){
return (x >>>= 0) ? 31 - Math.floor(Math.log(x + 0.5) * Math.LOG2E) : 32;
}
});
/***/ },
/* 339 */
/*!********************************************!*\
!*** ./~/core-js/modules/es6.math.cosh.js ***!
\********************************************/
/***/ function(module, exports, __webpack_require__) {
// 20.2.2.12 Math.cosh(x)
var $export = __webpack_require__(/*! ./_export */ 237)
, exp = Math.exp;
$export($export.S, 'Math', {
cosh: function cosh(x){
return (exp(x = +x) + exp(-x)) / 2;
}
});
/***/ },
/* 340 */
/*!*********************************************!*\
!*** ./~/core-js/modules/es6.math.expm1.js ***!
\*********************************************/
/***/ function(module, exports, __webpack_require__) {
// 20.2.2.14 Math.expm1(x)
var $export = __webpack_require__(/*! ./_export */ 237)
, $expm1 = __webpack_require__(/*! ./_math-expm1 */ 341);
$export($export.S + $export.F * ($expm1 != Math.expm1), 'Math', {expm1: $expm1});
/***/ },
/* 341 */
/*!******************************************!*\
!*** ./~/core-js/modules/_math-expm1.js ***!
\******************************************/
/***/ function(module, exports) {
// 20.2.2.14 Math.expm1(x)
var $expm1 = Math.expm1;
module.exports = (!$expm1
// Old FF bug
|| $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168
// Tor Browser bug
|| $expm1(-2e-17) != -2e-17
) ? function expm1(x){
return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1;
} : $expm1;
/***/ },
/* 342 */
/*!**********************************************!*\
!*** ./~/core-js/modules/es6.math.fround.js ***!
\**********************************************/
/***/ function(module, exports, __webpack_require__) {
// 20.2.2.16 Math.fround(x)
var $export = __webpack_require__(/*! ./_export */ 237)
, sign = __webpack_require__(/*! ./_math-sign */ 337)
, pow = Math.pow
, EPSILON = pow(2, -52)
, EPSILON32 = pow(2, -23)
, MAX32 = pow(2, 127) * (2 - EPSILON32)
, MIN32 = pow(2, -126);
var roundTiesToEven = function(n){
return n + 1 / EPSILON - 1 / EPSILON;
};
$export($export.S, 'Math', {
fround: function fround(x){
var $abs = Math.abs(x)
, $sign = sign(x)
, a, result;
if($abs < MIN32)return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32;
a = (1 + EPSILON32 / EPSILON) * $abs;
result = a - (a - $abs);
if(result > MAX32 || result != result)return $sign * Infinity;
return $sign * result;
}
});
/***/ },
/* 343 */
/*!*********************************************!*\
!*** ./~/core-js/modules/es6.math.hypot.js ***!
\*********************************************/
/***/ function(module, exports, __webpack_require__) {
// 20.2.2.17 Math.hypot([value1[, value2[, … ]]])
var $export = __webpack_require__(/*! ./_export */ 237)
, abs = Math.abs;
$export($export.S, 'Math', {
hypot: function hypot(value1, value2){ // eslint-disable-line no-unused-vars
var sum = 0
, i = 0
, aLen = arguments.length
, larg = 0
, arg, div;
while(i < aLen){
arg = abs(arguments[i++]);
if(larg < arg){
div = larg / arg;
sum = sum * div * div + 1;
larg = arg;
} else if(arg > 0){
div = arg / larg;
sum += div * div;
} else sum += arg;
}
return larg === Infinity ? Infinity : larg * Math.sqrt(sum);
}
});
/***/ },
/* 344 */
/*!********************************************!*\
!*** ./~/core-js/modules/es6.math.imul.js ***!
\********************************************/
/***/ function(module, exports, __webpack_require__) {
// 20.2.2.18 Math.imul(x, y)
var $export = __webpack_require__(/*! ./_export */ 237)
, $imul = Math.imul;
// some WebKit versions fails with big numbers, some has wrong arity
$export($export.S + $export.F * __webpack_require__(/*! ./_fails */ 236)(function(){
return $imul(0xffffffff, 5) != -5 || $imul.length != 2;
}), 'Math', {
imul: function imul(x, y){
var UINT16 = 0xffff
, xn = +x
, yn = +y
, xl = UINT16 & xn
, yl = UINT16 & yn;
return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0);
}
});
/***/ },
/* 345 */
/*!*********************************************!*\
!*** ./~/core-js/modules/es6.math.log10.js ***!
\*********************************************/
/***/ function(module, exports, __webpack_require__) {
// 20.2.2.21 Math.log10(x)
var $export = __webpack_require__(/*! ./_export */ 237);
$export($export.S, 'Math', {
log10: function log10(x){
return Math.log(x) / Math.LN10;
}
});
/***/ },
/* 346 */
/*!*********************************************!*\
!*** ./~/core-js/modules/es6.math.log1p.js ***!
\*********************************************/
/***/ function(module, exports, __webpack_require__) {
// 20.2.2.20 Math.log1p(x)
var $export = __webpack_require__(/*! ./_export */ 237);
$export($export.S, 'Math', {log1p: __webpack_require__(/*! ./_math-log1p */ 333)});
/***/ },
/* 347 */
/*!********************************************!*\
!*** ./~/core-js/modules/es6.math.log2.js ***!
\********************************************/
/***/ function(module, exports, __webpack_require__) {
// 20.2.2.22 Math.log2(x)
var $export = __webpack_require__(/*! ./_export */ 237);
$export($export.S, 'Math', {
log2: function log2(x){
return Math.log(x) / Math.LN2;
}
});
/***/ },
/* 348 */
/*!********************************************!*\
!*** ./~/core-js/modules/es6.math.sign.js ***!
\********************************************/
/***/ function(module, exports, __webpack_require__) {
// 20.2.2.28 Math.sign(x)
var $export = __webpack_require__(/*! ./_export */ 237);
$export($export.S, 'Math', {sign: __webpack_require__(/*! ./_math-sign */ 337)});
/***/ },
/* 349 */
/*!********************************************!*\
!*** ./~/core-js/modules/es6.math.sinh.js ***!
\********************************************/
/***/ function(module, exports, __webpack_require__) {
// 20.2.2.30 Math.sinh(x)
var $export = __webpack_require__(/*! ./_export */ 237)
, expm1 = __webpack_require__(/*! ./_math-expm1 */ 341)
, exp = Math.exp;
// V8 near Chromium 38 has a problem with very small numbers
$export($export.S + $export.F * __webpack_require__(/*! ./_fails */ 236)(function(){
return !Math.sinh(-2e-17) != -2e-17;
}), 'Math', {
sinh: function sinh(x){
return Math.abs(x = +x) < 1
? (expm1(x) - expm1(-x)) / 2
: (exp(x - 1) - exp(-x - 1)) * (Math.E / 2);
}
});
/***/ },
/* 350 */
/*!********************************************!*\
!*** ./~/core-js/modules/es6.math.tanh.js ***!
\********************************************/
/***/ function(module, exports, __webpack_require__) {
// 20.2.2.33 Math.tanh(x)
var $export = __webpack_require__(/*! ./_export */ 237)
, expm1 = __webpack_require__(/*! ./_math-expm1 */ 341)
, exp = Math.exp;
$export($export.S, 'Math', {
tanh: function tanh(x){
var a = expm1(x = +x)
, b = expm1(-x);
return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x));
}
});
/***/ },
/* 351 */
/*!*********************************************!*\
!*** ./~/core-js/modules/es6.math.trunc.js ***!
\*********************************************/
/***/ function(module, exports, __webpack_require__) {
// 20.2.2.34 Math.trunc(x)
var $export = __webpack_require__(/*! ./_export */ 237);
$export($export.S, 'Math', {
trunc: function trunc(it){
return (it > 0 ? Math.floor : Math.ceil)(it);
}
});
/***/ },
/* 352 */
/*!*********************************************************!*\
!*** ./~/core-js/modules/es6.string.from-code-point.js ***!
\*********************************************************/
/***/ function(module, exports, __webpack_require__) {
var $export = __webpack_require__(/*! ./_export */ 237)
, toIndex = __webpack_require__(/*! ./_to-index */ 268)
, fromCharCode = String.fromCharCode
, $fromCodePoint = String.fromCodePoint;
// length should be 1, old FF problem
$export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', {
// 21.1.2.2 String.fromCodePoint(...codePoints)
fromCodePoint: function fromCodePoint(x){ // eslint-disable-line no-unused-vars
var res = []
, aLen = arguments.length
, i = 0
, code;
while(aLen > i){
code = +arguments[i++];
if(toIndex(code, 0x10ffff) !== code)throw RangeError(code + ' is not a valid code point');
res.push(code < 0x10000
? fromCharCode(code)
: fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00)
);
} return res.join('');
}
});
/***/ },
/* 353 */
/*!*********************************************!*\
!*** ./~/core-js/modules/es6.string.raw.js ***!
\*********************************************/
/***/ function(module, exports, __webpack_require__) {
var $export = __webpack_require__(/*! ./_export */ 237)
, toIObject = __webpack_require__(/*! ./_to-iobject */ 261)
, toLength = __webpack_require__(/*! ./_to-length */ 266);
$export($export.S, 'String', {
// 21.1.2.4 String.raw(callSite, ...substitutions)
raw: function raw(callSite){
var tpl = toIObject(callSite.raw)
, len = toLength(tpl.length)
, aLen = arguments.length
, res = []
, i = 0;
while(len > i){
res.push(String(tpl[i++]));
if(i < aLen)res.push(String(arguments[i]));
} return res.join('');
}
});
/***/ },
/* 354 */
/*!**********************************************!*\
!*** ./~/core-js/modules/es6.string.trim.js ***!
\**********************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
// 21.1.3.25 String.prototype.trim()
__webpack_require__(/*! ./_string-trim */ 312)('trim', function($trim){
return function trim(){
return $trim(this, 3);
};
});
/***/ },
/* 355 */
/*!**************************************************!*\
!*** ./~/core-js/modules/es6.string.iterator.js ***!
\**************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
var $at = __webpack_require__(/*! ./_string-at */ 356)(true);
// 21.1.3.27 String.prototype[@@iterator]()
__webpack_require__(/*! ./_iter-define */ 357)(String, 'String', function(iterated){
this._t = String(iterated); // target
this._i = 0; // next index
// 21.1.5.2.1 %StringIteratorPrototype%.next()
}, function(){
var O = this._t
, index = this._i
, point;
if(index >= O.length)return {value: undefined, done: true};
point = $at(O, index);
this._i += point.length;
return {value: point, done: false};
});
/***/ },
/* 356 */
/*!*****************************************!*\
!*** ./~/core-js/modules/_string-at.js ***!
\*****************************************/
/***/ function(module, exports, __webpack_require__) {
var toInteger = __webpack_require__(/*! ./_to-integer */ 267)
, defined = __webpack_require__(/*! ./_defined */ 264);
// true -> String#at
// false -> String#codePointAt
module.exports = function(TO_STRING){
return function(that, pos){
var s = String(defined(that))
, i = toInteger(pos)
, l = s.length
, a, b;
if(i < 0 || i >= l)return TO_STRING ? '' : undefined;
a = s.charCodeAt(i);
return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
? TO_STRING ? s.charAt(i) : a
: TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
};
};
/***/ },
/* 357 */
/*!*******************************************!*\
!*** ./~/core-js/modules/_iter-define.js ***!
\*******************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
var LIBRARY = __webpack_require__(/*! ./_library */ 257)
, $export = __webpack_require__(/*! ./_export */ 237)
, redefine = __webpack_require__(/*! ./_redefine */ 247)
, hide = __webpack_require__(/*! ./_hide */ 239)
, has = __webpack_require__(/*! ./_has */ 234)
, Iterators = __webpack_require__(/*! ./_iterators */ 358)
, $iterCreate = __webpack_require__(/*! ./_iter-create */ 359)
, setToStringTag = __webpack_require__(/*! ./_set-to-string-tag */ 253)
, getPrototypeOf = __webpack_require__(/*! ./_object-gpo */ 288)
, ITERATOR = __webpack_require__(/*! ./_wks */ 254)('iterator')
, BUGGY = !([].keys && 'next' in [].keys()) // Safari has buggy iterators w/o `next`
, FF_ITERATOR = '@@iterator'
, KEYS = 'keys'
, VALUES = 'values';
var returnThis = function(){ return this; };
module.exports = function(Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED){
$iterCreate(Constructor, NAME, next);
var getMethod = function(kind){
if(!BUGGY && kind in proto)return proto[kind];
switch(kind){
case KEYS: return function keys(){ return new Constructor(this, kind); };
case VALUES: return function values(){ return new Constructor(this, kind); };
} return function entries(){ return new Constructor(this, kind); };
};
var TAG = NAME + ' Iterator'
, DEF_VALUES = DEFAULT == VALUES
, VALUES_BUG = false
, proto = Base.prototype
, $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT]
, $default = $native || getMethod(DEFAULT)
, $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined
, $anyNative = NAME == 'Array' ? proto.entries || $native : $native
, methods, key, IteratorPrototype;
// Fix native
if($anyNative){
IteratorPrototype = getPrototypeOf($anyNative.call(new Base));
if(IteratorPrototype !== Object.prototype){
// Set @@toStringTag to native iterators
setToStringTag(IteratorPrototype, TAG, true);
// fix for some old engines
if(!LIBRARY && !has(IteratorPrototype, ITERATOR))hide(IteratorPrototype, ITERATOR, returnThis);
}
}
// fix Array#{values, @@iterator}.name in V8 / FF
if(DEF_VALUES && $native && $native.name !== VALUES){
VALUES_BUG = true;
$default = function values(){ return $native.call(this); };
}
// Define iterator
if((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])){
hide(proto, ITERATOR, $default);
}
// Plug for library
Iterators[NAME] = $default;
Iterators[TAG] = returnThis;
if(DEFAULT){
methods = {
values: DEF_VALUES ? $default : getMethod(VALUES),
keys: IS_SET ? $default : getMethod(KEYS),
entries: $entries
};
if(FORCED)for(key in methods){
if(!(key in proto))redefine(proto, key, methods[key]);
} else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);
}
return methods;
};
/***/ },
/* 358 */
/*!*****************************************!*\
!*** ./~/core-js/modules/_iterators.js ***!
\*****************************************/
/***/ function(module, exports) {
module.exports = {};
/***/ },
/* 359 */
/*!*******************************************!*\
!*** ./~/core-js/modules/_iter-create.js ***!
\*******************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
var create = __webpack_require__(/*! ./_object-create */ 275)
, descriptor = __webpack_require__(/*! ./_property-desc */ 246)
, setToStringTag = __webpack_require__(/*! ./_set-to-string-tag */ 253)
, IteratorPrototype = {};
// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
__webpack_require__(/*! ./_hide */ 239)(IteratorPrototype, __webpack_require__(/*! ./_wks */ 254)('iterator'), function(){ return this; });
module.exports = function(Constructor, NAME, next){
Constructor.prototype = create(IteratorPrototype, {next: descriptor(1, next)});
setToStringTag(Constructor, NAME + ' Iterator');
};
/***/ },
/* 360 */
/*!*******************************************************!*\
!*** ./~/core-js/modules/es6.string.code-point-at.js ***!
\*******************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(/*! ./_export */ 237)
, $at = __webpack_require__(/*! ./_string-at */ 356)(false);
$export($export.P, 'String', {
// 21.1.3.3 String.prototype.codePointAt(pos)
codePointAt: function codePointAt(pos){
return $at(this, pos);
}
});
/***/ },
/* 361 */
/*!***************************************************!*\
!*** ./~/core-js/modules/es6.string.ends-with.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
// 21.1.3.6 String.prototype.endsWith(searchString [, endPosition])
'use strict';
var $export = __webpack_require__(/*! ./_export */ 237)
, toLength = __webpack_require__(/*! ./_to-length */ 266)
, context = __webpack_require__(/*! ./_string-context */ 362)
, ENDS_WITH = 'endsWith'
, $endsWith = ''[ENDS_WITH];
$export($export.P + $export.F * __webpack_require__(/*! ./_fails-is-regexp */ 364)(ENDS_WITH), 'String', {
endsWith: function endsWith(searchString /*, endPosition = @length */){
var that = context(this, searchString, ENDS_WITH)
, endPosition = arguments.length > 1 ? arguments[1] : undefined
, len = toLength(that.length)
, end = endPosition === undefined ? len : Math.min(toLength(endPosition), len)
, search = String(searchString);
return $endsWith
? $endsWith.call(that, search, end)
: that.slice(end - search.length, end) === search;
}
});
/***/ },
/* 362 */
/*!**********************************************!*\
!*** ./~/core-js/modules/_string-context.js ***!
\**********************************************/
/***/ function(module, exports, __webpack_require__) {
// helper for String#{startsWith, endsWith, includes}
var isRegExp = __webpack_require__(/*! ./_is-regexp */ 363)
, defined = __webpack_require__(/*! ./_defined */ 264);
module.exports = function(that, searchString, NAME){
if(isRegExp(searchString))throw TypeError('String#' + NAME + " doesn't accept regex!");
return String(defined(that));
};
/***/ },
/* 363 */
/*!*****************************************!*\
!*** ./~/core-js/modules/_is-regexp.js ***!
\*****************************************/
/***/ function(module, exports, __webpack_require__) {
// 7.2.8 IsRegExp(argument)
var isObject = __webpack_require__(/*! ./_is-object */ 242)
, cof = __webpack_require__(/*! ./_cof */ 263)
, MATCH = __webpack_require__(/*! ./_wks */ 254)('match');
module.exports = function(it){
var isRegExp;
return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp');
};
/***/ },
/* 364 */
/*!***********************************************!*\
!*** ./~/core-js/modules/_fails-is-regexp.js ***!
\***********************************************/
/***/ function(module, exports, __webpack_require__) {
var MATCH = __webpack_require__(/*! ./_wks */ 254)('match');
module.exports = function(KEY){
var re = /./;
try {
'/./'[KEY](re);
} catch(e){
try {
re[MATCH] = false;
return !'/./'[KEY](re);
} catch(f){ /* empty */ }
} return true;
};
/***/ },
/* 365 */
/*!**************************************************!*\
!*** ./~/core-js/modules/es6.string.includes.js ***!
\**************************************************/
/***/ function(module, exports, __webpack_require__) {
// 21.1.3.7 String.prototype.includes(searchString, position = 0)
'use strict';
var $export = __webpack_require__(/*! ./_export */ 237)
, context = __webpack_require__(/*! ./_string-context */ 362)
, INCLUDES = 'includes';
$export($export.P + $export.F * __webpack_require__(/*! ./_fails-is-regexp */ 364)(INCLUDES), 'String', {
includes: function includes(searchString /*, position = 0 */){
return !!~context(this, searchString, INCLUDES)
.indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined);
}
});
/***/ },
/* 366 */
/*!************************************************!*\
!*** ./~/core-js/modules/es6.string.repeat.js ***!
\************************************************/
/***/ function(module, exports, __webpack_require__) {
var $export = __webpack_require__(/*! ./_export */ 237);
$export($export.P, 'String', {
// 21.1.3.13 String.prototype.repeat(count)
repeat: __webpack_require__(/*! ./_string-repeat */ 320)
});
/***/ },
/* 367 */
/*!*****************************************************!*\
!*** ./~/core-js/modules/es6.string.starts-with.js ***!
\*****************************************************/
/***/ function(module, exports, __webpack_require__) {
// 21.1.3.18 String.prototype.startsWith(searchString [, position ])
'use strict';
var $export = __webpack_require__(/*! ./_export */ 237)
, toLength = __webpack_require__(/*! ./_to-length */ 266)
, context = __webpack_require__(/*! ./_string-context */ 362)
, STARTS_WITH = 'startsWith'
, $startsWith = ''[STARTS_WITH];
$export($export.P + $export.F * __webpack_require__(/*! ./_fails-is-regexp */ 364)(STARTS_WITH), 'String', {
startsWith: function startsWith(searchString /*, position = 0 */){
var that = context(this, searchString, STARTS_WITH)
, index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length))
, search = String(searchString);
return $startsWith
? $startsWith.call(that, search, index)
: that.slice(index, index + search.length) === search;
}
});
/***/ },
/* 368 */
/*!************************************************!*\
!*** ./~/core-js/modules/es6.string.anchor.js ***!
\************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
// B.2.3.2 String.prototype.anchor(name)
__webpack_require__(/*! ./_string-html */ 369)('anchor', function(createHTML){
return function anchor(name){
return createHTML(this, 'a', 'name', name);
}
});
/***/ },
/* 369 */
/*!*******************************************!*\
!*** ./~/core-js/modules/_string-html.js ***!
\*******************************************/
/***/ function(module, exports, __webpack_require__) {
var $export = __webpack_require__(/*! ./_export */ 237)
, fails = __webpack_require__(/*! ./_fails */ 236)
, defined = __webpack_require__(/*! ./_defined */ 264)
, quot = /"/g;
// B.2.3.2.1 CreateHTML(string, tag, attribute, value)
var createHTML = function(string, tag, attribute, value) {
var S = String(defined(string))
, p1 = '<' + tag;
if(attribute !== '')p1 += ' ' + attribute + '="' + String(value).replace(quot, '"') + '"';
return p1 + '>' + S + '</' + tag + '>';
};
module.exports = function(NAME, exec){
var O = {};
O[NAME] = exec(createHTML);
$export($export.P + $export.F * fails(function(){
var test = ''[NAME]('"');
return test !== test.toLowerCase() || test.split('"').length > 3;
}), 'String', O);
};
/***/ },
/* 370 */
/*!*********************************************!*\
!*** ./~/core-js/modules/es6.string.big.js ***!
\*********************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
// B.2.3.3 String.prototype.big()
__webpack_require__(/*! ./_string-html */ 369)('big', function(createHTML){
return function big(){
return createHTML(this, 'big', '', '');
}
});
/***/ },
/* 371 */
/*!***********************************************!*\
!*** ./~/core-js/modules/es6.string.blink.js ***!
\***********************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
// B.2.3.4 String.prototype.blink()
__webpack_require__(/*! ./_string-html */ 369)('blink', function(createHTML){
return function blink(){
return createHTML(this, 'blink', '', '');
}
});
/***/ },
/* 372 */
/*!**********************************************!*\
!*** ./~/core-js/modules/es6.string.bold.js ***!
\**********************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
// B.2.3.5 String.prototype.bold()
__webpack_require__(/*! ./_string-html */ 369)('bold', function(createHTML){
return function bold(){
return createHTML(this, 'b', '', '');
}
});
/***/ },
/* 373 */
/*!***********************************************!*\
!*** ./~/core-js/modules/es6.string.fixed.js ***!
\***********************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
// B.2.3.6 String.prototype.fixed()
__webpack_require__(/*! ./_string-html */ 369)('fixed', function(createHTML){
return function fixed(){
return createHTML(this, 'tt', '', '');
}
});
/***/ },
/* 374 */
/*!***************************************************!*\
!*** ./~/core-js/modules/es6.string.fontcolor.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
// B.2.3.7 String.prototype.fontcolor(color)
__webpack_require__(/*! ./_string-html */ 369)('fontcolor', function(createHTML){
return function fontcolor(color){
return createHTML(this, 'font', 'color', color);
}
});
/***/ },
/* 375 */
/*!**************************************************!*\
!*** ./~/core-js/modules/es6.string.fontsize.js ***!
\**************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
// B.2.3.8 String.prototype.fontsize(size)
__webpack_require__(/*! ./_string-html */ 369)('fontsize', function(createHTML){
return function fontsize(size){
return createHTML(this, 'font', 'size', size);
}
});
/***/ },
/* 376 */
/*!*************************************************!*\
!*** ./~/core-js/modules/es6.string.italics.js ***!
\*************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
// B.2.3.9 String.prototype.italics()
__webpack_require__(/*! ./_string-html */ 369)('italics', function(createHTML){
return function italics(){
return createHTML(this, 'i', '', '');
}
});
/***/ },
/* 377 */
/*!**********************************************!*\
!*** ./~/core-js/modules/es6.string.link.js ***!
\**********************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
// B.2.3.10 String.prototype.link(url)
__webpack_require__(/*! ./_string-html */ 369)('link', function(createHTML){
return function link(url){
return createHTML(this, 'a', 'href', url);
}
});
/***/ },
/* 378 */
/*!***********************************************!*\
!*** ./~/core-js/modules/es6.string.small.js ***!
\***********************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
// B.2.3.11 String.prototype.small()
__webpack_require__(/*! ./_string-html */ 369)('small', function(createHTML){
return function small(){
return createHTML(this, 'small', '', '');
}
});
/***/ },
/* 379 */
/*!************************************************!*\
!*** ./~/core-js/modules/es6.string.strike.js ***!
\************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
// B.2.3.12 String.prototype.strike()
__webpack_require__(/*! ./_string-html */ 369)('strike', function(createHTML){
return function strike(){
return createHTML(this, 'strike', '', '');
}
});
/***/ },
/* 380 */
/*!*********************************************!*\
!*** ./~/core-js/modules/es6.string.sub.js ***!
\*********************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
// B.2.3.13 String.prototype.sub()
__webpack_require__(/*! ./_string-html */ 369)('sub', function(createHTML){
return function sub(){
return createHTML(this, 'sub', '', '');
}
});
/***/ },
/* 381 */
/*!*********************************************!*\
!*** ./~/core-js/modules/es6.string.sup.js ***!
\*********************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
// B.2.3.14 String.prototype.sup()
__webpack_require__(/*! ./_string-html */ 369)('sup', function(createHTML){
return function sup(){
return createHTML(this, 'sup', '', '');
}
});
/***/ },
/* 382 */
/*!*******************************************!*\
!*** ./~/core-js/modules/es6.date.now.js ***!
\*******************************************/
/***/ function(module, exports, __webpack_require__) {
// 20.3.3.1 / 15.9.4.4 Date.now()
var $export = __webpack_require__(/*! ./_export */ 237);
$export($export.S, 'Date', {now: function(){ return new Date().getTime(); }});
/***/ },
/* 383 */
/*!***********************************************!*\
!*** ./~/core-js/modules/es6.date.to-json.js ***!
\***********************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(/*! ./_export */ 237)
, toObject = __webpack_require__(/*! ./_to-object */ 287)
, toPrimitive = __webpack_require__(/*! ./_to-primitive */ 245);
$export($export.P + $export.F * __webpack_require__(/*! ./_fails */ 236)(function(){
return new Date(NaN).toJSON() !== null || Date.prototype.toJSON.call({toISOString: function(){ return 1; }}) !== 1;
}), 'Date', {
toJSON: function toJSON(key){
var O = toObject(this)
, pv = toPrimitive(O);
return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString();
}
});
/***/ },
/* 384 */
/*!*****************************************************!*\
!*** ./~/core-js/modules/es6.date.to-iso-string.js ***!
\*****************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString()
var $export = __webpack_require__(/*! ./_export */ 237)
, fails = __webpack_require__(/*! ./_fails */ 236)
, getTime = Date.prototype.getTime;
var lz = function(num){
return num > 9 ? num : '0' + num;
};
// PhantomJS / old WebKit has a broken implementations
$export($export.P + $export.F * (fails(function(){
return new Date(-5e13 - 1).toISOString() != '0385-07-25T07:06:39.999Z';
}) || !fails(function(){
new Date(NaN).toISOString();
})), 'Date', {
toISOString: function toISOString(){
if(!isFinite(getTime.call(this)))throw RangeError('Invalid time value');
var d = this
, y = d.getUTCFullYear()
, m = d.getUTCMilliseconds()
, s = y < 0 ? '-' : y > 9999 ? '+' : '';
return s + ('00000' + Math.abs(y)).slice(s ? -6 : -4) +
'-' + lz(d.getUTCMonth() + 1) + '-' + lz(d.getUTCDate()) +
'T' + lz(d.getUTCHours()) + ':' + lz(d.getUTCMinutes()) +
':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z';
}
});
/***/ },
/* 385 */
/*!*************************************************!*\
!*** ./~/core-js/modules/es6.date.to-string.js ***!
\*************************************************/
/***/ function(module, exports, __webpack_require__) {
var DateProto = Date.prototype
, INVALID_DATE = 'Invalid Date'
, TO_STRING = 'toString'
, $toString = DateProto[TO_STRING]
, getTime = DateProto.getTime;
if(new Date(NaN) + '' != INVALID_DATE){
__webpack_require__(/*! ./_redefine */ 247)(DateProto, TO_STRING, function toString(){
var value = getTime.call(this);
return value === value ? $toString.call(this) : INVALID_DATE;
});
}
/***/ },
/* 386 */
/*!****************************************************!*\
!*** ./~/core-js/modules/es6.date.to-primitive.js ***!
\****************************************************/
/***/ function(module, exports, __webpack_require__) {
var TO_PRIMITIVE = __webpack_require__(/*! ./_wks */ 254)('toPrimitive')
, proto = Date.prototype;
if(!(TO_PRIMITIVE in proto))__webpack_require__(/*! ./_hide */ 239)(proto, TO_PRIMITIVE, __webpack_require__(/*! ./_date-to-primitive */ 387));
/***/ },
/* 387 */
/*!*************************************************!*\
!*** ./~/core-js/modules/_date-to-primitive.js ***!
\*************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
var anObject = __webpack_require__(/*! ./_an-object */ 241)
, toPrimitive = __webpack_require__(/*! ./_to-primitive */ 245)
, NUMBER = 'number';
module.exports = function(hint){
if(hint !== 'string' && hint !== NUMBER && hint !== 'default')throw TypeError('Incorrect hint');
return toPrimitive(anObject(this), hint != NUMBER);
};
/***/ },
/* 388 */
/*!*************************************************!*\
!*** ./~/core-js/modules/es6.array.is-array.js ***!
\*************************************************/
/***/ function(module, exports, __webpack_require__) {
// 22.1.2.2 / 15.4.3.2 Array.isArray(arg)
var $export = __webpack_require__(/*! ./_export */ 237);
$export($export.S, 'Array', {isArray: __webpack_require__(/*! ./_is-array */ 274)});
/***/ },
/* 389 */
/*!*********************************************!*\
!*** ./~/core-js/modules/es6.array.from.js ***!
\*********************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
var ctx = __webpack_require__(/*! ./_ctx */ 249)
, $export = __webpack_require__(/*! ./_export */ 237)
, toObject = __webpack_require__(/*! ./_to-object */ 287)
, call = __webpack_require__(/*! ./_iter-call */ 390)
, isArrayIter = __webpack_require__(/*! ./_is-array-iter */ 391)
, toLength = __webpack_require__(/*! ./_to-length */ 266)
, createProperty = __webpack_require__(/*! ./_create-property */ 392)
, getIterFn = __webpack_require__(/*! ./core.get-iterator-method */ 393);
$export($export.S + $export.F * !__webpack_require__(/*! ./_iter-detect */ 394)(function(iter){ Array.from(iter); }), 'Array', {
// 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)
from: function from(arrayLike/*, mapfn = undefined, thisArg = undefined*/){
var O = toObject(arrayLike)
, C = typeof this == 'function' ? this : Array
, aLen = arguments.length
, mapfn = aLen > 1 ? arguments[1] : undefined
, mapping = mapfn !== undefined
, index = 0
, iterFn = getIterFn(O)
, length, result, step, iterator;
if(mapping)mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2);
// if object isn't iterable or it's array with default iterator - use simple case
if(iterFn != undefined && !(C == Array && isArrayIter(iterFn))){
for(iterator = iterFn.call(O), result = new C; !(step = iterator.next()).done; index++){
createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value);
}
} else {
length = toLength(O.length);
for(result = new C(length); length > index; index++){
createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);
}
}
result.length = index;
return result;
}
});
/***/ },
/* 390 */
/*!*****************************************!*\
!*** ./~/core-js/modules/_iter-call.js ***!
\*****************************************/
/***/ function(module, exports, __webpack_require__) {
// call something on iterator step with safe closing on error
var anObject = __webpack_require__(/*! ./_an-object */ 241);
module.exports = function(iterator, fn, value, entries){
try {
return entries ? fn(anObject(value)[0], value[1]) : fn(value);
// 7.4.6 IteratorClose(iterator, completion)
} catch(e){
var ret = iterator['return'];
if(ret !== undefined)anObject(ret.call(iterator));
throw e;
}
};
/***/ },
/* 391 */
/*!*********************************************!*\
!*** ./~/core-js/modules/_is-array-iter.js ***!
\*********************************************/
/***/ function(module, exports, __webpack_require__) {
// check on default Array iterator
var Iterators = __webpack_require__(/*! ./_iterators */ 358)
, ITERATOR = __webpack_require__(/*! ./_wks */ 254)('iterator')
, ArrayProto = Array.prototype;
module.exports = function(it){
return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);
};
/***/ },
/* 392 */
/*!***********************************************!*\
!*** ./~/core-js/modules/_create-property.js ***!
\***********************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
var $defineProperty = __webpack_require__(/*! ./_object-dp */ 240)
, createDesc = __webpack_require__(/*! ./_property-desc */ 246);
module.exports = function(object, index, value){
if(index in object)$defineProperty.f(object, index, createDesc(0, value));
else object[index] = value;
};
/***/ },
/* 393 */
/*!*******************************************************!*\
!*** ./~/core-js/modules/core.get-iterator-method.js ***!
\*******************************************************/
/***/ function(module, exports, __webpack_require__) {
var classof = __webpack_require__(/*! ./_classof */ 304)
, ITERATOR = __webpack_require__(/*! ./_wks */ 254)('iterator')
, Iterators = __webpack_require__(/*! ./_iterators */ 358);
module.exports = __webpack_require__(/*! ./_core */ 238).getIteratorMethod = function(it){
if(it != undefined)return it[ITERATOR]
|| it['@@iterator']
|| Iterators[classof(it)];
};
/***/ },
/* 394 */
/*!*******************************************!*\
!*** ./~/core-js/modules/_iter-detect.js ***!
\*******************************************/
/***/ function(module, exports, __webpack_require__) {
var ITERATOR = __webpack_require__(/*! ./_wks */ 254)('iterator')
, SAFE_CLOSING = false;
try {
var riter = [7][ITERATOR]();
riter['return'] = function(){ SAFE_CLOSING = true; };
Array.from(riter, function(){ throw 2; });
} catch(e){ /* empty */ }
module.exports = function(exec, skipClosing){
if(!skipClosing && !SAFE_CLOSING)return false;
var safe = false;
try {
var arr = [7]
, iter = arr[ITERATOR]();
iter.next = function(){ return {done: safe = true}; };
arr[ITERATOR] = function(){ return iter; };
exec(arr);
} catch(e){ /* empty */ }
return safe;
};
/***/ },
/* 395 */
/*!*******************************************!*\
!*** ./~/core-js/modules/es6.array.of.js ***!
\*******************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(/*! ./_export */ 237)
, createProperty = __webpack_require__(/*! ./_create-property */ 392);
// WebKit Array.of isn't generic
$export($export.S + $export.F * __webpack_require__(/*! ./_fails */ 236)(function(){
function F(){}
return !(Array.of.call(F) instanceof F);
}), 'Array', {
// 22.1.2.3 Array.of( ...items)
of: function of(/* ...args */){
var index = 0
, aLen = arguments.length
, result = new (typeof this == 'function' ? this : Array)(aLen);
while(aLen > index)createProperty(result, index, arguments[index++]);
result.length = aLen;
return result;
}
});
/***/ },
/* 396 */
/*!*********************************************!*\
!*** ./~/core-js/modules/es6.array.join.js ***!
\*********************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
// 22.1.3.13 Array.prototype.join(separator)
var $export = __webpack_require__(/*! ./_export */ 237)
, toIObject = __webpack_require__(/*! ./_to-iobject */ 261)
, arrayJoin = [].join;
// fallback for not array-like strings
$export($export.P + $export.F * (__webpack_require__(/*! ./_iobject */ 262) != Object || !__webpack_require__(/*! ./_strict-method */ 397)(arrayJoin)), 'Array', {
join: function join(separator){
return arrayJoin.call(toIObject(this), separator === undefined ? ',' : separator);
}
});
/***/ },
/* 397 */
/*!*********************************************!*\
!*** ./~/core-js/modules/_strict-method.js ***!
\*********************************************/
/***/ function(module, exports, __webpack_require__) {
var fails = __webpack_require__(/*! ./_fails */ 236);
module.exports = function(method, arg){
return !!method && fails(function(){
arg ? method.call(null, function(){}, 1) : method.call(null);
});
};
/***/ },
/* 398 */
/*!**********************************************!*\
!*** ./~/core-js/modules/es6.array.slice.js ***!
\**********************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(/*! ./_export */ 237)
, html = __webpack_require__(/*! ./_html */ 277)
, cof = __webpack_require__(/*! ./_cof */ 263)
, toIndex = __webpack_require__(/*! ./_to-index */ 268)
, toLength = __webpack_require__(/*! ./_to-length */ 266)
, arraySlice = [].slice;
// fallback for not array-like ES3 strings and DOM objects
$export($export.P + $export.F * __webpack_require__(/*! ./_fails */ 236)(function(){
if(html)arraySlice.call(html);
}), 'Array', {
slice: function slice(begin, end){
var len = toLength(this.length)
, klass = cof(this);
end = end === undefined ? len : end;
if(klass == 'Array')return arraySlice.call(this, begin, end);
var start = toIndex(begin, len)
, upTo = toIndex(end, len)
, size = toLength(upTo - start)
, cloned = Array(size)
, i = 0;
for(; i < size; i++)cloned[i] = klass == 'String'
? this.charAt(start + i)
: this[start + i];
return cloned;
}
});
/***/ },
/* 399 */
/*!*********************************************!*\
!*** ./~/core-js/modules/es6.array.sort.js ***!
\*********************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(/*! ./_export */ 237)
, aFunction = __webpack_require__(/*! ./_a-function */ 250)
, toObject = __webpack_require__(/*! ./_to-object */ 287)
, fails = __webpack_require__(/*! ./_fails */ 236)
, $sort = [].sort
, test = [1, 2, 3];
$export($export.P + $export.F * (fails(function(){
// IE8-
test.sort(undefined);
}) || !fails(function(){
// V8 bug
test.sort(null);
// Old WebKit
}) || !__webpack_require__(/*! ./_strict-method */ 397)($sort)), 'Array', {
// 22.1.3.25 Array.prototype.sort(comparefn)
sort: function sort(comparefn){
return comparefn === undefined
? $sort.call(toObject(this))
: $sort.call(toObject(this), aFunction(comparefn));
}
});
/***/ },
/* 400 */
/*!*************************************************!*\
!*** ./~/core-js/modules/es6.array.for-each.js ***!
\*************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(/*! ./_export */ 237)
, $forEach = __webpack_require__(/*! ./_array-methods */ 401)(0)
, STRICT = __webpack_require__(/*! ./_strict-method */ 397)([].forEach, true);
$export($export.P + $export.F * !STRICT, 'Array', {
// 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg])
forEach: function forEach(callbackfn /* , thisArg */){
return $forEach(this, callbackfn, arguments[1]);
}
});
/***/ },
/* 401 */
/*!*********************************************!*\
!*** ./~/core-js/modules/_array-methods.js ***!
\*********************************************/
/***/ function(module, exports, __webpack_require__) {
// 0 -> Array#forEach
// 1 -> Array#map
// 2 -> Array#filter
// 3 -> Array#some
// 4 -> Array#every
// 5 -> Array#find
// 6 -> Array#findIndex
var ctx = __webpack_require__(/*! ./_ctx */ 249)
, IObject = __webpack_require__(/*! ./_iobject */ 262)
, toObject = __webpack_require__(/*! ./_to-object */ 287)
, toLength = __webpack_require__(/*! ./_to-length */ 266)
, asc = __webpack_require__(/*! ./_array-species-create */ 402);
module.exports = function(TYPE, $create){
var IS_MAP = TYPE == 1
, IS_FILTER = TYPE == 2
, IS_SOME = TYPE == 3
, IS_EVERY = TYPE == 4
, IS_FIND_INDEX = TYPE == 6
, NO_HOLES = TYPE == 5 || IS_FIND_INDEX
, create = $create || asc;
return function($this, callbackfn, that){
var O = toObject($this)
, self = IObject(O)
, f = ctx(callbackfn, that, 3)
, length = toLength(self.length)
, index = 0
, result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined
, val, res;
for(;length > index; index++)if(NO_HOLES || index in self){
val = self[index];
res = f(val, index, O);
if(TYPE){
if(IS_MAP)result[index] = res; // map
else if(res)switch(TYPE){
case 3: return true; // some
case 5: return val; // find
case 6: return index; // findIndex
case 2: result.push(val); // filter
} else if(IS_EVERY)return false; // every
}
}
return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;
};
};
/***/ },
/* 402 */
/*!****************************************************!*\
!*** ./~/core-js/modules/_array-species-create.js ***!
\****************************************************/
/***/ function(module, exports, __webpack_require__) {
// 9.4.2.3 ArraySpeciesCreate(originalArray, length)
var speciesConstructor = __webpack_require__(/*! ./_array-species-constructor */ 403);
module.exports = function(original, length){
return new (speciesConstructor(original))(length);
};
/***/ },
/* 403 */
/*!*********************************************************!*\
!*** ./~/core-js/modules/_array-species-constructor.js ***!
\*********************************************************/
/***/ function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(/*! ./_is-object */ 242)
, isArray = __webpack_require__(/*! ./_is-array */ 274)
, SPECIES = __webpack_require__(/*! ./_wks */ 254)('species');
module.exports = function(original){
var C;
if(isArray(original)){
C = original.constructor;
// cross-realm fallback
if(typeof C == 'function' && (C === Array || isArray(C.prototype)))C = undefined;
if(isObject(C)){
C = C[SPECIES];
if(C === null)C = undefined;
}
} return C === undefined ? Array : C;
};
/***/ },
/* 404 */
/*!********************************************!*\
!*** ./~/core-js/modules/es6.array.map.js ***!
\********************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(/*! ./_export */ 237)
, $map = __webpack_require__(/*! ./_array-methods */ 401)(1);
$export($export.P + $export.F * !__webpack_require__(/*! ./_strict-method */ 397)([].map, true), 'Array', {
// 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg])
map: function map(callbackfn /* , thisArg */){
return $map(this, callbackfn, arguments[1]);
}
});
/***/ },
/* 405 */
/*!***********************************************!*\
!*** ./~/core-js/modules/es6.array.filter.js ***!
\***********************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(/*! ./_export */ 237)
, $filter = __webpack_require__(/*! ./_array-methods */ 401)(2);
$export($export.P + $export.F * !__webpack_require__(/*! ./_strict-method */ 397)([].filter, true), 'Array', {
// 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg])
filter: function filter(callbackfn /* , thisArg */){
return $filter(this, callbackfn, arguments[1]);
}
});
/***/ },
/* 406 */
/*!*********************************************!*\
!*** ./~/core-js/modules/es6.array.some.js ***!
\*********************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(/*! ./_export */ 237)
, $some = __webpack_require__(/*! ./_array-methods */ 401)(3);
$export($export.P + $export.F * !__webpack_require__(/*! ./_strict-method */ 397)([].some, true), 'Array', {
// 22.1.3.23 / 15.4.4.17 Array.prototype.some(callbackfn [, thisArg])
some: function some(callbackfn /* , thisArg */){
return $some(this, callbackfn, arguments[1]);
}
});
/***/ },
/* 407 */
/*!**********************************************!*\
!*** ./~/core-js/modules/es6.array.every.js ***!
\**********************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(/*! ./_export */ 237)
, $every = __webpack_require__(/*! ./_array-methods */ 401)(4);
$export($export.P + $export.F * !__webpack_require__(/*! ./_strict-method */ 397)([].every, true), 'Array', {
// 22.1.3.5 / 15.4.4.16 Array.prototype.every(callbackfn [, thisArg])
every: function every(callbackfn /* , thisArg */){
return $every(this, callbackfn, arguments[1]);
}
});
/***/ },
/* 408 */
/*!***********************************************!*\
!*** ./~/core-js/modules/es6.array.reduce.js ***!
\***********************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(/*! ./_export */ 237)
, $reduce = __webpack_require__(/*! ./_array-reduce */ 409);
$export($export.P + $export.F * !__webpack_require__(/*! ./_strict-method */ 397)([].reduce, true), 'Array', {
// 22.1.3.18 / 15.4.4.21 Array.prototype.reduce(callbackfn [, initialValue])
reduce: function reduce(callbackfn /* , initialValue */){
return $reduce(this, callbackfn, arguments.length, arguments[1], false);
}
});
/***/ },
/* 409 */
/*!********************************************!*\
!*** ./~/core-js/modules/_array-reduce.js ***!
\********************************************/
/***/ function(module, exports, __webpack_require__) {
var aFunction = __webpack_require__(/*! ./_a-function */ 250)
, toObject = __webpack_require__(/*! ./_to-object */ 287)
, IObject = __webpack_require__(/*! ./_iobject */ 262)
, toLength = __webpack_require__(/*! ./_to-length */ 266);
module.exports = function(that, callbackfn, aLen, memo, isRight){
aFunction(callbackfn);
var O = toObject(that)
, self = IObject(O)
, length = toLength(O.length)
, index = isRight ? length - 1 : 0
, i = isRight ? -1 : 1;
if(aLen < 2)for(;;){
if(index in self){
memo = self[index];
index += i;
break;
}
index += i;
if(isRight ? index < 0 : length <= index){
throw TypeError('Reduce of empty array with no initial value');
}
}
for(;isRight ? index >= 0 : length > index; index += i)if(index in self){
memo = callbackfn(memo, self[index], index, O);
}
return memo;
};
/***/ },
/* 410 */
/*!*****************************************************!*\
!*** ./~/core-js/modules/es6.array.reduce-right.js ***!
\*****************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(/*! ./_export */ 237)
, $reduce = __webpack_require__(/*! ./_array-reduce */ 409);
$export($export.P + $export.F * !__webpack_require__(/*! ./_strict-method */ 397)([].reduceRight, true), 'Array', {
// 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue])
reduceRight: function reduceRight(callbackfn /* , initialValue */){
return $reduce(this, callbackfn, arguments.length, arguments[1], true);
}
});
/***/ },
/* 411 */
/*!*************************************************!*\
!*** ./~/core-js/modules/es6.array.index-of.js ***!
\*************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(/*! ./_export */ 237)
, $indexOf = __webpack_require__(/*! ./_array-includes */ 265)(false)
, $native = [].indexOf
, NEGATIVE_ZERO = !!$native && 1 / [1].indexOf(1, -0) < 0;
$export($export.P + $export.F * (NEGATIVE_ZERO || !__webpack_require__(/*! ./_strict-method */ 397)($native)), 'Array', {
// 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex])
indexOf: function indexOf(searchElement /*, fromIndex = 0 */){
return NEGATIVE_ZERO
// convert -0 to +0
? $native.apply(this, arguments) || 0
: $indexOf(this, searchElement, arguments[1]);
}
});
/***/ },
/* 412 */
/*!******************************************************!*\
!*** ./~/core-js/modules/es6.array.last-index-of.js ***!
\******************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(/*! ./_export */ 237)
, toIObject = __webpack_require__(/*! ./_to-iobject */ 261)
, toInteger = __webpack_require__(/*! ./_to-integer */ 267)
, toLength = __webpack_require__(/*! ./_to-length */ 266)
, $native = [].lastIndexOf
, NEGATIVE_ZERO = !!$native && 1 / [1].lastIndexOf(1, -0) < 0;
$export($export.P + $export.F * (NEGATIVE_ZERO || !__webpack_require__(/*! ./_strict-method */ 397)($native)), 'Array', {
// 22.1.3.14 / 15.4.4.15 Array.prototype.lastIndexOf(searchElement [, fromIndex])
lastIndexOf: function lastIndexOf(searchElement /*, fromIndex = @[*-1] */){
// convert -0 to +0
if(NEGATIVE_ZERO)return $native.apply(this, arguments) || 0;
var O = toIObject(this)
, length = toLength(O.length)
, index = length - 1;
if(arguments.length > 1)index = Math.min(index, toInteger(arguments[1]));
if(index < 0)index = length + index;
for(;index >= 0; index--)if(index in O)if(O[index] === searchElement)return index || 0;
return -1;
}
});
/***/ },
/* 413 */
/*!****************************************************!*\
!*** ./~/core-js/modules/es6.array.copy-within.js ***!
\****************************************************/
/***/ function(module, exports, __webpack_require__) {
// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)
var $export = __webpack_require__(/*! ./_export */ 237);
$export($export.P, 'Array', {copyWithin: __webpack_require__(/*! ./_array-copy-within */ 414)});
__webpack_require__(/*! ./_add-to-unscopables */ 415)('copyWithin');
/***/ },
/* 414 */
/*!*************************************************!*\
!*** ./~/core-js/modules/_array-copy-within.js ***!
\*************************************************/
/***/ function(module, exports, __webpack_require__) {
// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)
'use strict';
var toObject = __webpack_require__(/*! ./_to-object */ 287)
, toIndex = __webpack_require__(/*! ./_to-index */ 268)
, toLength = __webpack_require__(/*! ./_to-length */ 266);
module.exports = [].copyWithin || function copyWithin(target/*= 0*/, start/*= 0, end = @length*/){
var O = toObject(this)
, len = toLength(O.length)
, to = toIndex(target, len)
, from = toIndex(start, len)
, end = arguments.length > 2 ? arguments[2] : undefined
, count = Math.min((end === undefined ? len : toIndex(end, len)) - from, len - to)
, inc = 1;
if(from < to && to < from + count){
inc = -1;
from += count - 1;
to += count - 1;
}
while(count-- > 0){
if(from in O)O[to] = O[from];
else delete O[to];
to += inc;
from += inc;
} return O;
};
/***/ },
/* 415 */
/*!**************************************************!*\
!*** ./~/core-js/modules/_add-to-unscopables.js ***!
\**************************************************/
/***/ function(module, exports, __webpack_require__) {
// 22.1.3.31 Array.prototype[@@unscopables]
var UNSCOPABLES = __webpack_require__(/*! ./_wks */ 254)('unscopables')
, ArrayProto = Array.prototype;
if(ArrayProto[UNSCOPABLES] == undefined)__webpack_require__(/*! ./_hide */ 239)(ArrayProto, UNSCOPABLES, {});
module.exports = function(key){
ArrayProto[UNSCOPABLES][key] = true;
};
/***/ },
/* 416 */
/*!*********************************************!*\
!*** ./~/core-js/modules/es6.array.fill.js ***!
\*********************************************/
/***/ function(module, exports, __webpack_require__) {
// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)
var $export = __webpack_require__(/*! ./_export */ 237);
$export($export.P, 'Array', {fill: __webpack_require__(/*! ./_array-fill */ 417)});
__webpack_require__(/*! ./_add-to-unscopables */ 415)('fill');
/***/ },
/* 417 */
/*!******************************************!*\
!*** ./~/core-js/modules/_array-fill.js ***!
\******************************************/
/***/ function(module, exports, __webpack_require__) {
// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)
'use strict';
var toObject = __webpack_require__(/*! ./_to-object */ 287)
, toIndex = __webpack_require__(/*! ./_to-index */ 268)
, toLength = __webpack_require__(/*! ./_to-length */ 266);
module.exports = function fill(value /*, start = 0, end = @length */){
var O = toObject(this)
, length = toLength(O.length)
, aLen = arguments.length
, index = toIndex(aLen > 1 ? arguments[1] : undefined, length)
, end = aLen > 2 ? arguments[2] : undefined
, endPos = end === undefined ? length : toIndex(end, length);
while(endPos > index)O[index++] = value;
return O;
};
/***/ },
/* 418 */
/*!*********************************************!*\
!*** ./~/core-js/modules/es6.array.find.js ***!
\*********************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined)
var $export = __webpack_require__(/*! ./_export */ 237)
, $find = __webpack_require__(/*! ./_array-methods */ 401)(5)
, KEY = 'find'
, forced = true;
// Shouldn't skip holes
if(KEY in [])Array(1)[KEY](function(){ forced = false; });
$export($export.P + $export.F * forced, 'Array', {
find: function find(callbackfn/*, that = undefined */){
return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
}
});
__webpack_require__(/*! ./_add-to-unscopables */ 415)(KEY);
/***/ },
/* 419 */
/*!***************************************************!*\
!*** ./~/core-js/modules/es6.array.find-index.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
// 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined)
var $export = __webpack_require__(/*! ./_export */ 237)
, $find = __webpack_require__(/*! ./_array-methods */ 401)(6)
, KEY = 'findIndex'
, forced = true;
// Shouldn't skip holes
if(KEY in [])Array(1)[KEY](function(){ forced = false; });
$export($export.P + $export.F * forced, 'Array', {
findIndex: function findIndex(callbackfn/*, that = undefined */){
return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
}
});
__webpack_require__(/*! ./_add-to-unscopables */ 415)(KEY);
/***/ },
/* 420 */
/*!************************************************!*\
!*** ./~/core-js/modules/es6.array.species.js ***!
\************************************************/
/***/ function(module, exports, __webpack_require__) {
__webpack_require__(/*! ./_set-species */ 421)('Array');
/***/ },
/* 421 */
/*!*******************************************!*\
!*** ./~/core-js/modules/_set-species.js ***!
\*******************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
var global = __webpack_require__(/*! ./_global */ 233)
, dP = __webpack_require__(/*! ./_object-dp */ 240)
, DESCRIPTORS = __webpack_require__(/*! ./_descriptors */ 235)
, SPECIES = __webpack_require__(/*! ./_wks */ 254)('species');
module.exports = function(KEY){
var C = global[KEY];
if(DESCRIPTORS && C && !C[SPECIES])dP.f(C, SPECIES, {
configurable: true,
get: function(){ return this; }
});
};
/***/ },
/* 422 */
/*!*************************************************!*\
!*** ./~/core-js/modules/es6.array.iterator.js ***!
\*************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
var addToUnscopables = __webpack_require__(/*! ./_add-to-unscopables */ 415)
, step = __webpack_require__(/*! ./_iter-step */ 423)
, Iterators = __webpack_require__(/*! ./_iterators */ 358)
, toIObject = __webpack_require__(/*! ./_to-iobject */ 261);
// 22.1.3.4 Array.prototype.entries()
// 22.1.3.13 Array.prototype.keys()
// 22.1.3.29 Array.prototype.values()
// 22.1.3.30 Array.prototype[@@iterator]()
module.exports = __webpack_require__(/*! ./_iter-define */ 357)(Array, 'Array', function(iterated, kind){
this._t = toIObject(iterated); // target
this._i = 0; // next index
this._k = kind; // kind
// 22.1.5.2.1 %ArrayIteratorPrototype%.next()
}, function(){
var O = this._t
, kind = this._k
, index = this._i++;
if(!O || index >= O.length){
this._t = undefined;
return step(1);
}
if(kind == 'keys' )return step(0, index);
if(kind == 'values')return step(0, O[index]);
return step(0, [index, O[index]]);
}, 'values');
// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
Iterators.Arguments = Iterators.Array;
addToUnscopables('keys');
addToUnscopables('values');
addToUnscopables('entries');
/***/ },
/* 423 */
/*!*****************************************!*\
!*** ./~/core-js/modules/_iter-step.js ***!
\*****************************************/
/***/ function(module, exports) {
module.exports = function(done, value){
return {value: value, done: !!done};
};
/***/ },
/* 424 */
/*!*****************************************************!*\
!*** ./~/core-js/modules/es6.regexp.constructor.js ***!
\*****************************************************/
/***/ function(module, exports, __webpack_require__) {
var global = __webpack_require__(/*! ./_global */ 233)
, inheritIfRequired = __webpack_require__(/*! ./_inherit-if-required */ 317)
, dP = __webpack_require__(/*! ./_object-dp */ 240).f
, gOPN = __webpack_require__(/*! ./_object-gopn */ 279).f
, isRegExp = __webpack_require__(/*! ./_is-regexp */ 363)
, $flags = __webpack_require__(/*! ./_flags */ 425)
, $RegExp = global.RegExp
, Base = $RegExp
, proto = $RegExp.prototype
, re1 = /a/g
, re2 = /a/g
// "new" creates a new object, old webkit buggy here
, CORRECT_NEW = new $RegExp(re1) !== re1;
if(__webpack_require__(/*! ./_descriptors */ 235) && (!CORRECT_NEW || __webpack_require__(/*! ./_fails */ 236)(function(){
re2[__webpack_require__(/*! ./_wks */ 254)('match')] = false;
// RegExp constructor can alter flags and IsRegExp works correct with @@match
return $RegExp(re1) != re1 || $RegExp(re2) == re2 || $RegExp(re1, 'i') != '/a/i';
}))){
$RegExp = function RegExp(p, f){
var tiRE = this instanceof $RegExp
, piRE = isRegExp(p)
, fiU = f === undefined;
return !tiRE && piRE && p.constructor === $RegExp && fiU ? p
: inheritIfRequired(CORRECT_NEW
? new Base(piRE && !fiU ? p.source : p, f)
: Base((piRE = p instanceof $RegExp) ? p.source : p, piRE && fiU ? $flags.call(p) : f)
, tiRE ? this : proto, $RegExp);
};
var proxy = function(key){
key in $RegExp || dP($RegExp, key, {
configurable: true,
get: function(){ return Base[key]; },
set: function(it){ Base[key] = it; }
});
};
for(var keys = gOPN(Base), i = 0; keys.length > i; )proxy(keys[i++]);
proto.constructor = $RegExp;
$RegExp.prototype = proto;
__webpack_require__(/*! ./_redefine */ 247)(global, 'RegExp', $RegExp);
}
__webpack_require__(/*! ./_set-species */ 421)('RegExp');
/***/ },
/* 425 */
/*!*************************************!*\
!*** ./~/core-js/modules/_flags.js ***!
\*************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
// 21.2.5.3 get RegExp.prototype.flags
var anObject = __webpack_require__(/*! ./_an-object */ 241);
module.exports = function(){
var that = anObject(this)
, result = '';
if(that.global) result += 'g';
if(that.ignoreCase) result += 'i';
if(that.multiline) result += 'm';
if(that.unicode) result += 'u';
if(that.sticky) result += 'y';
return result;
};
/***/ },
/* 426 */
/*!***************************************************!*\
!*** ./~/core-js/modules/es6.regexp.to-string.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
__webpack_require__(/*! ./es6.regexp.flags */ 427);
var anObject = __webpack_require__(/*! ./_an-object */ 241)
, $flags = __webpack_require__(/*! ./_flags */ 425)
, DESCRIPTORS = __webpack_require__(/*! ./_descriptors */ 235)
, TO_STRING = 'toString'
, $toString = /./[TO_STRING];
var define = function(fn){
__webpack_require__(/*! ./_redefine */ 247)(RegExp.prototype, TO_STRING, fn, true);
};
// 21.2.5.14 RegExp.prototype.toString()
if(__webpack_require__(/*! ./_fails */ 236)(function(){ return $toString.call({source: 'a', flags: 'b'}) != '/a/b'; })){
define(function toString(){
var R = anObject(this);
return '/'.concat(R.source, '/',
'flags' in R ? R.flags : !DESCRIPTORS && R instanceof RegExp ? $flags.call(R) : undefined);
});
// FF44- RegExp#toString has a wrong name
} else if($toString.name != TO_STRING){
define(function toString(){
return $toString.call(this);
});
}
/***/ },
/* 427 */
/*!***********************************************!*\
!*** ./~/core-js/modules/es6.regexp.flags.js ***!
\***********************************************/
/***/ function(module, exports, __webpack_require__) {
// 21.2.5.3 get RegExp.prototype.flags()
if(__webpack_require__(/*! ./_descriptors */ 235) && /./g.flags != 'g')__webpack_require__(/*! ./_object-dp */ 240).f(RegExp.prototype, 'flags', {
configurable: true,
get: __webpack_require__(/*! ./_flags */ 425)
});
/***/ },
/* 428 */
/*!***********************************************!*\
!*** ./~/core-js/modules/es6.regexp.match.js ***!
\***********************************************/
/***/ function(module, exports, __webpack_require__) {
// @@match logic
__webpack_require__(/*! ./_fix-re-wks */ 429)('match', 1, function(defined, MATCH, $match){
// 21.1.3.11 String.prototype.match(regexp)
return [function match(regexp){
'use strict';
var O = defined(this)
, fn = regexp == undefined ? undefined : regexp[MATCH];
return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));
}, $match];
});
/***/ },
/* 429 */
/*!******************************************!*\
!*** ./~/core-js/modules/_fix-re-wks.js ***!
\******************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
var hide = __webpack_require__(/*! ./_hide */ 239)
, redefine = __webpack_require__(/*! ./_redefine */ 247)
, fails = __webpack_require__(/*! ./_fails */ 236)
, defined = __webpack_require__(/*! ./_defined */ 264)
, wks = __webpack_require__(/*! ./_wks */ 254);
module.exports = function(KEY, length, exec){
var SYMBOL = wks(KEY)
, fns = exec(defined, SYMBOL, ''[KEY])
, strfn = fns[0]
, rxfn = fns[1];
if(fails(function(){
var O = {};
O[SYMBOL] = function(){ return 7; };
return ''[KEY](O) != 7;
})){
redefine(String.prototype, KEY, strfn);
hide(RegExp.prototype, SYMBOL, length == 2
// 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
// 21.2.5.11 RegExp.prototype[@@split](string, limit)
? function(string, arg){ return rxfn.call(string, this, arg); }
// 21.2.5.6 RegExp.prototype[@@match](string)
// 21.2.5.9 RegExp.prototype[@@search](string)
: function(string){ return rxfn.call(string, this); }
);
}
};
/***/ },
/* 430 */
/*!*************************************************!*\
!*** ./~/core-js/modules/es6.regexp.replace.js ***!
\*************************************************/
/***/ function(module, exports, __webpack_require__) {
// @@replace logic
__webpack_require__(/*! ./_fix-re-wks */ 429)('replace', 2, function(defined, REPLACE, $replace){
// 21.1.3.14 String.prototype.replace(searchValue, replaceValue)
return [function replace(searchValue, replaceValue){
'use strict';
var O = defined(this)
, fn = searchValue == undefined ? undefined : searchValue[REPLACE];
return fn !== undefined
? fn.call(searchValue, O, replaceValue)
: $replace.call(String(O), searchValue, replaceValue);
}, $replace];
});
/***/ },
/* 431 */
/*!************************************************!*\
!*** ./~/core-js/modules/es6.regexp.search.js ***!
\************************************************/
/***/ function(module, exports, __webpack_require__) {
// @@search logic
__webpack_require__(/*! ./_fix-re-wks */ 429)('search', 1, function(defined, SEARCH, $search){
// 21.1.3.15 String.prototype.search(regexp)
return [function search(regexp){
'use strict';
var O = defined(this)
, fn = regexp == undefined ? undefined : regexp[SEARCH];
return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O));
}, $search];
});
/***/ },
/* 432 */
/*!***********************************************!*\
!*** ./~/core-js/modules/es6.regexp.split.js ***!
\***********************************************/
/***/ function(module, exports, __webpack_require__) {
// @@split logic
__webpack_require__(/*! ./_fix-re-wks */ 429)('split', 2, function(defined, SPLIT, $split){
'use strict';
var isRegExp = __webpack_require__(/*! ./_is-regexp */ 363)
, _split = $split
, $push = [].push
, $SPLIT = 'split'
, LENGTH = 'length'
, LAST_INDEX = 'lastIndex';
if(
'abbc'[$SPLIT](/(b)*/)[1] == 'c' ||
'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 ||
'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 ||
'.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 ||
'.'[$SPLIT](/()()/)[LENGTH] > 1 ||
''[$SPLIT](/.?/)[LENGTH]
){
var NPCG = /()??/.exec('')[1] === undefined; // nonparticipating capturing group
// based on es5-shim implementation, need to rework it
$split = function(separator, limit){
var string = String(this);
if(separator === undefined && limit === 0)return [];
// If `separator` is not a regex, use native split
if(!isRegExp(separator))return _split.call(string, separator, limit);
var output = [];
var flags = (separator.ignoreCase ? 'i' : '') +
(separator.multiline ? 'm' : '') +
(separator.unicode ? 'u' : '') +
(separator.sticky ? 'y' : '');
var lastLastIndex = 0;
var splitLimit = limit === undefined ? 4294967295 : limit >>> 0;
// Make `global` and avoid `lastIndex` issues by working with a copy
var separatorCopy = new RegExp(separator.source, flags + 'g');
var separator2, match, lastIndex, lastLength, i;
// Doesn't need flags gy, but they don't hurt
if(!NPCG)separator2 = new RegExp('^' + separatorCopy.source + '$(?!\\s)', flags);
while(match = separatorCopy.exec(string)){
// `separatorCopy.lastIndex` is not reliable cross-browser
lastIndex = match.index + match[0][LENGTH];
if(lastIndex > lastLastIndex){
output.push(string.slice(lastLastIndex, match.index));
// Fix browsers whose `exec` methods don't consistently return `undefined` for NPCG
if(!NPCG && match[LENGTH] > 1)match[0].replace(separator2, function(){
for(i = 1; i < arguments[LENGTH] - 2; i++)if(arguments[i] === undefined)match[i] = undefined;
});
if(match[LENGTH] > 1 && match.index < string[LENGTH])$push.apply(output, match.slice(1));
lastLength = match[0][LENGTH];
lastLastIndex = lastIndex;
if(output[LENGTH] >= splitLimit)break;
}
if(separatorCopy[LAST_INDEX] === match.index)separatorCopy[LAST_INDEX]++; // Avoid an infinite loop
}
if(lastLastIndex === string[LENGTH]){
if(lastLength || !separatorCopy.test(''))output.push('');
} else output.push(string.slice(lastLastIndex));
return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output;
};
// Chakra, V8
} else if('0'[$SPLIT](undefined, 0)[LENGTH]){
$split = function(separator, limit){
return separator === undefined && limit === 0 ? [] : _split.call(this, separator, limit);
};
}
// 21.1.3.17 String.prototype.split(separator, limit)
return [function split(separator, limit){
var O = defined(this)
, fn = separator == undefined ? undefined : separator[SPLIT];
return fn !== undefined ? fn.call(separator, O, limit) : $split.call(String(O), separator, limit);
}, $split];
});
/***/ },
/* 433 */
/*!******************************************!*\
!*** ./~/core-js/modules/es6.promise.js ***!
\******************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
var LIBRARY = __webpack_require__(/*! ./_library */ 257)
, global = __webpack_require__(/*! ./_global */ 233)
, ctx = __webpack_require__(/*! ./_ctx */ 249)
, classof = __webpack_require__(/*! ./_classof */ 304)
, $export = __webpack_require__(/*! ./_export */ 237)
, isObject = __webpack_require__(/*! ./_is-object */ 242)
, aFunction = __webpack_require__(/*! ./_a-function */ 250)
, anInstance = __webpack_require__(/*! ./_an-instance */ 434)
, forOf = __webpack_require__(/*! ./_for-of */ 435)
, speciesConstructor = __webpack_require__(/*! ./_species-constructor */ 436)
, task = __webpack_require__(/*! ./_task */ 437).set
, microtask = __webpack_require__(/*! ./_microtask */ 438)()
, PROMISE = 'Promise'
, TypeError = global.TypeError
, process = global.process
, $Promise = global[PROMISE]
, process = global.process
, isNode = classof(process) == 'process'
, empty = function(){ /* empty */ }
, Internal, GenericPromiseCapability, Wrapper;
var USE_NATIVE = !!function(){
try {
// correct subclassing with @@species support
var promise = $Promise.resolve(1)
, FakePromise = (promise.constructor = {})[__webpack_require__(/*! ./_wks */ 254)('species')] = function(exec){ exec(empty, empty); };
// unhandled rejections tracking support, NodeJS Promise without it fails @@species test
return (isNode || typeof PromiseRejectionEvent == 'function') && promise.then(empty) instanceof FakePromise;
} catch(e){ /* empty */ }
}();
// helpers
var sameConstructor = function(a, b){
// with library wrapper special case
return a === b || a === $Promise && b === Wrapper;
};
var isThenable = function(it){
var then;
return isObject(it) && typeof (then = it.then) == 'function' ? then : false;
};
var newPromiseCapability = function(C){
return sameConstructor($Promise, C)
? new PromiseCapability(C)
: new GenericPromiseCapability(C);
};
var PromiseCapability = GenericPromiseCapability = function(C){
var resolve, reject;
this.promise = new C(function($$resolve, $$reject){
if(resolve !== undefined || reject !== undefined)throw TypeError('Bad Promise constructor');
resolve = $$resolve;
reject = $$reject;
});
this.resolve = aFunction(resolve);
this.reject = aFunction(reject);
};
var perform = function(exec){
try {
exec();
} catch(e){
return {error: e};
}
};
var notify = function(promise, isReject){
if(promise._n)return;
promise._n = true;
var chain = promise._c;
microtask(function(){
var value = promise._v
, ok = promise._s == 1
, i = 0;
var run = function(reaction){
var handler = ok ? reaction.ok : reaction.fail
, resolve = reaction.resolve
, reject = reaction.reject
, domain = reaction.domain
, result, then;
try {
if(handler){
if(!ok){
if(promise._h == 2)onHandleUnhandled(promise);
promise._h = 1;
}
if(handler === true)result = value;
else {
if(domain)domain.enter();
result = handler(value);
if(domain)domain.exit();
}
if(result === reaction.promise){
reject(TypeError('Promise-chain cycle'));
} else if(then = isThenable(result)){
then.call(result, resolve, reject);
} else resolve(result);
} else reject(value);
} catch(e){
reject(e);
}
};
while(chain.length > i)run(chain[i++]); // variable length - can't use forEach
promise._c = [];
promise._n = false;
if(isReject && !promise._h)onUnhandled(promise);
});
};
var onUnhandled = function(promise){
task.call(global, function(){
var value = promise._v
, abrupt, handler, console;
if(isUnhandled(promise)){
abrupt = perform(function(){
if(isNode){
process.emit('unhandledRejection', value, promise);
} else if(handler = global.onunhandledrejection){
handler({promise: promise, reason: value});
} else if((console = global.console) && console.error){
console.error('Unhandled promise rejection', value);
}
});
// Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
promise._h = isNode || isUnhandled(promise) ? 2 : 1;
} promise._a = undefined;
if(abrupt)throw abrupt.error;
});
};
var isUnhandled = function(promise){
if(promise._h == 1)return false;
var chain = promise._a || promise._c
, i = 0
, reaction;
while(chain.length > i){
reaction = chain[i++];
if(reaction.fail || !isUnhandled(reaction.promise))return false;
} return true;
};
var onHandleUnhandled = function(promise){
task.call(global, function(){
var handler;
if(isNode){
process.emit('rejectionHandled', promise);
} else if(handler = global.onrejectionhandled){
handler({promise: promise, reason: promise._v});
}
});
};
var $reject = function(value){
var promise = this;
if(promise._d)return;
promise._d = true;
promise = promise._w || promise; // unwrap
promise._v = value;
promise._s = 2;
if(!promise._a)promise._a = promise._c.slice();
notify(promise, true);
};
var $resolve = function(value){
var promise = this
, then;
if(promise._d)return;
promise._d = true;
promise = promise._w || promise; // unwrap
try {
if(promise === value)throw TypeError("Promise can't be resolved itself");
if(then = isThenable(value)){
microtask(function(){
var wrapper = {_w: promise, _d: false}; // wrap
try {
then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1));
} catch(e){
$reject.call(wrapper, e);
}
});
} else {
promise._v = value;
promise._s = 1;
notify(promise, false);
}
} catch(e){
$reject.call({_w: promise, _d: false}, e); // wrap
}
};
// constructor polyfill
if(!USE_NATIVE){
// 25.4.3.1 Promise(executor)
$Promise = function Promise(executor){
anInstance(this, $Promise, PROMISE, '_h');
aFunction(executor);
Internal.call(this);
try {
executor(ctx($resolve, this, 1), ctx($reject, this, 1));
} catch(err){
$reject.call(this, err);
}
};
Internal = function Promise(executor){
this._c = []; // <- awaiting reactions
this._a = undefined; // <- checked in isUnhandled reactions
this._s = 0; // <- state
this._d = false; // <- done
this._v = undefined; // <- value
this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled
this._n = false; // <- notify
};
Internal.prototype = __webpack_require__(/*! ./_redefine-all */ 439)($Promise.prototype, {
// 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)
then: function then(onFulfilled, onRejected){
var reaction = newPromiseCapability(speciesConstructor(this, $Promise));
reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;
reaction.fail = typeof onRejected == 'function' && onRejected;
reaction.domain = isNode ? process.domain : undefined;
this._c.push(reaction);
if(this._a)this._a.push(reaction);
if(this._s)notify(this, false);
return reaction.promise;
},
// 25.4.5.1 Promise.prototype.catch(onRejected)
'catch': function(onRejected){
return this.then(undefined, onRejected);
}
});
PromiseCapability = function(){
var promise = new Internal;
this.promise = promise;
this.resolve = ctx($resolve, promise, 1);
this.reject = ctx($reject, promise, 1);
};
}
$export($export.G + $export.W + $export.F * !USE_NATIVE, {Promise: $Promise});
__webpack_require__(/*! ./_set-to-string-tag */ 253)($Promise, PROMISE);
__webpack_require__(/*! ./_set-species */ 421)(PROMISE);
Wrapper = __webpack_require__(/*! ./_core */ 238)[PROMISE];
// statics
$export($export.S + $export.F * !USE_NATIVE, PROMISE, {
// 25.4.4.5 Promise.reject(r)
reject: function reject(r){
var capability = newPromiseCapability(this)
, $$reject = capability.reject;
$$reject(r);
return capability.promise;
}
});
$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, {
// 25.4.4.6 Promise.resolve(x)
resolve: function resolve(x){
// instanceof instead of internal slot check because we should fix it without replacement native Promise core
if(x instanceof $Promise && sameConstructor(x.constructor, this))return x;
var capability = newPromiseCapability(this)
, $$resolve = capability.resolve;
$$resolve(x);
return capability.promise;
}
});
$export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(/*! ./_iter-detect */ 394)(function(iter){
$Promise.all(iter)['catch'](empty);
})), PROMISE, {
// 25.4.4.1 Promise.all(iterable)
all: function all(iterable){
var C = this
, capability = newPromiseCapability(C)
, resolve = capability.resolve
, reject = capability.reject;
var abrupt = perform(function(){
var values = []
, index = 0
, remaining = 1;
forOf(iterable, false, function(promise){
var $index = index++
, alreadyCalled = false;
values.push(undefined);
remaining++;
C.resolve(promise).then(function(value){
if(alreadyCalled)return;
alreadyCalled = true;
values[$index] = value;
--remaining || resolve(values);
}, reject);
});
--remaining || resolve(values);
});
if(abrupt)reject(abrupt.error);
return capability.promise;
},
// 25.4.4.4 Promise.race(iterable)
race: function race(iterable){
var C = this
, capability = newPromiseCapability(C)
, reject = capability.reject;
var abrupt = perform(function(){
forOf(iterable, false, function(promise){
C.resolve(promise).then(capability.resolve, reject);
});
});
if(abrupt)reject(abrupt.error);
return capability.promise;
}
});
/***/ },
/* 434 */
/*!*******************************************!*\
!*** ./~/core-js/modules/_an-instance.js ***!
\*******************************************/
/***/ function(module, exports) {
module.exports = function(it, Constructor, name, forbiddenField){
if(!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)){
throw TypeError(name + ': incorrect invocation!');
} return it;
};
/***/ },
/* 435 */
/*!**************************************!*\
!*** ./~/core-js/modules/_for-of.js ***!
\**************************************/
/***/ function(module, exports, __webpack_require__) {
var ctx = __webpack_require__(/*! ./_ctx */ 249)
, call = __webpack_require__(/*! ./_iter-call */ 390)
, isArrayIter = __webpack_require__(/*! ./_is-array-iter */ 391)
, anObject = __webpack_require__(/*! ./_an-object */ 241)
, toLength = __webpack_require__(/*! ./_to-length */ 266)
, getIterFn = __webpack_require__(/*! ./core.get-iterator-method */ 393)
, BREAK = {}
, RETURN = {};
var exports = module.exports = function(iterable, entries, fn, that, ITERATOR){
var iterFn = ITERATOR ? function(){ return iterable; } : getIterFn(iterable)
, f = ctx(fn, that, entries ? 2 : 1)
, index = 0
, length, step, iterator, result;
if(typeof iterFn != 'function')throw TypeError(iterable + ' is not iterable!');
// fast case for arrays with default iterator
if(isArrayIter(iterFn))for(length = toLength(iterable.length); length > index; index++){
result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);
if(result === BREAK || result === RETURN)return result;
} else for(iterator = iterFn.call(iterable); !(step = iterator.next()).done; ){
result = call(iterator, f, step.value, entries);
if(result === BREAK || result === RETURN)return result;
}
};
exports.BREAK = BREAK;
exports.RETURN = RETURN;
/***/ },
/* 436 */
/*!***************************************************!*\
!*** ./~/core-js/modules/_species-constructor.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
// 7.3.20 SpeciesConstructor(O, defaultConstructor)
var anObject = __webpack_require__(/*! ./_an-object */ 241)
, aFunction = __webpack_require__(/*! ./_a-function */ 250)
, SPECIES = __webpack_require__(/*! ./_wks */ 254)('species');
module.exports = function(O, D){
var C = anObject(O).constructor, S;
return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S);
};
/***/ },
/* 437 */
/*!************************************!*\
!*** ./~/core-js/modules/_task.js ***!
\************************************/
/***/ function(module, exports, __webpack_require__) {
var ctx = __webpack_require__(/*! ./_ctx */ 249)
, invoke = __webpack_require__(/*! ./_invoke */ 307)
, html = __webpack_require__(/*! ./_html */ 277)
, cel = __webpack_require__(/*! ./_dom-create */ 244)
, global = __webpack_require__(/*! ./_global */ 233)
, process = global.process
, setTask = global.setImmediate
, clearTask = global.clearImmediate
, MessageChannel = global.MessageChannel
, counter = 0
, queue = {}
, ONREADYSTATECHANGE = 'onreadystatechange'
, defer, channel, port;
var run = function(){
var id = +this;
if(queue.hasOwnProperty(id)){
var fn = queue[id];
delete queue[id];
fn();
}
};
var listener = function(event){
run.call(event.data);
};
// Node.js 0.9+ & IE10+ has setImmediate, otherwise:
if(!setTask || !clearTask){
setTask = function setImmediate(fn){
var args = [], i = 1;
while(arguments.length > i)args.push(arguments[i++]);
queue[++counter] = function(){
invoke(typeof fn == 'function' ? fn : Function(fn), args);
};
defer(counter);
return counter;
};
clearTask = function clearImmediate(id){
delete queue[id];
};
// Node.js 0.8-
if(__webpack_require__(/*! ./_cof */ 263)(process) == 'process'){
defer = function(id){
process.nextTick(ctx(run, id, 1));
};
// Browsers with MessageChannel, includes WebWorkers
} else if(MessageChannel){
channel = new MessageChannel;
port = channel.port2;
channel.port1.onmessage = listener;
defer = ctx(port.postMessage, port, 1);
// Browsers with postMessage, skip WebWorkers
// IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
} else if(global.addEventListener && typeof postMessage == 'function' && !global.importScripts){
defer = function(id){
global.postMessage(id + '', '*');
};
global.addEventListener('message', listener, false);
// IE8-
} else if(ONREADYSTATECHANGE in cel('script')){
defer = function(id){
html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function(){
html.removeChild(this);
run.call(id);
};
};
// Rest old browsers
} else {
defer = function(id){
setTimeout(ctx(run, id, 1), 0);
};
}
}
module.exports = {
set: setTask,
clear: clearTask
};
/***/ },
/* 438 */
/*!*****************************************!*\
!*** ./~/core-js/modules/_microtask.js ***!
\*****************************************/
/***/ function(module, exports, __webpack_require__) {
var global = __webpack_require__(/*! ./_global */ 233)
, macrotask = __webpack_require__(/*! ./_task */ 437).set
, Observer = global.MutationObserver || global.WebKitMutationObserver
, process = global.process
, Promise = global.Promise
, isNode = __webpack_require__(/*! ./_cof */ 263)(process) == 'process';
module.exports = function(){
var head, last, notify;
var flush = function(){
var parent, fn;
if(isNode && (parent = process.domain))parent.exit();
while(head){
fn = head.fn;
head = head.next;
try {
fn();
} catch(e){
if(head)notify();
else last = undefined;
throw e;
}
} last = undefined;
if(parent)parent.enter();
};
// Node.js
if(isNode){
notify = function(){
process.nextTick(flush);
};
// browsers with MutationObserver
} else if(Observer){
var toggle = true
, node = document.createTextNode('');
new Observer(flush).observe(node, {characterData: true}); // eslint-disable-line no-new
notify = function(){
node.data = toggle = !toggle;
};
// environments with maybe non-completely correct, but existent Promise
} else if(Promise && Promise.resolve){
var promise = Promise.resolve();
notify = function(){
promise.then(flush);
};
// for other environments - macrotask based on:
// - setImmediate
// - MessageChannel
// - window.postMessag
// - onreadystatechange
// - setTimeout
} else {
notify = function(){
// strange IE + webpack dev server bug - use .call(global)
macrotask.call(global, flush);
};
}
return function(fn){
var task = {fn: fn, next: undefined};
if(last)last.next = task;
if(!head){
head = task;
notify();
} last = task;
};
};
/***/ },
/* 439 */
/*!********************************************!*\
!*** ./~/core-js/modules/_redefine-all.js ***!
\********************************************/
/***/ function(module, exports, __webpack_require__) {
var redefine = __webpack_require__(/*! ./_redefine */ 247);
module.exports = function(target, src, safe){
for(var key in src)redefine(target, key, src[key], safe);
return target;
};
/***/ },
/* 440 */
/*!**************************************!*\
!*** ./~/core-js/modules/es6.map.js ***!
\**************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
var strong = __webpack_require__(/*! ./_collection-strong */ 441);
// 23.1 Map Objects
module.exports = __webpack_require__(/*! ./_collection */ 442)('Map', function(get){
return function Map(){ return get(this, arguments.length > 0 ? arguments[0] : undefined); };
}, {
// 23.1.3.6 Map.prototype.get(key)
get: function get(key){
var entry = strong.getEntry(this, key);
return entry && entry.v;
},
// 23.1.3.9 Map.prototype.set(key, value)
set: function set(key, value){
return strong.def(this, key === 0 ? 0 : key, value);
}
}, strong, true);
/***/ },
/* 441 */
/*!*************************************************!*\
!*** ./~/core-js/modules/_collection-strong.js ***!
\*************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
var dP = __webpack_require__(/*! ./_object-dp */ 240).f
, create = __webpack_require__(/*! ./_object-create */ 275)
, redefineAll = __webpack_require__(/*! ./_redefine-all */ 439)
, ctx = __webpack_require__(/*! ./_ctx */ 249)
, anInstance = __webpack_require__(/*! ./_an-instance */ 434)
, defined = __webpack_require__(/*! ./_defined */ 264)
, forOf = __webpack_require__(/*! ./_for-of */ 435)
, $iterDefine = __webpack_require__(/*! ./_iter-define */ 357)
, step = __webpack_require__(/*! ./_iter-step */ 423)
, setSpecies = __webpack_require__(/*! ./_set-species */ 421)
, DESCRIPTORS = __webpack_require__(/*! ./_descriptors */ 235)
, fastKey = __webpack_require__(/*! ./_meta */ 251).fastKey
, SIZE = DESCRIPTORS ? '_s' : 'size';
var getEntry = function(that, key){
// fast case
var index = fastKey(key), entry;
if(index !== 'F')return that._i[index];
// frozen object case
for(entry = that._f; entry; entry = entry.n){
if(entry.k == key)return entry;
}
};
module.exports = {
getConstructor: function(wrapper, NAME, IS_MAP, ADDER){
var C = wrapper(function(that, iterable){
anInstance(that, C, NAME, '_i');
that._i = create(null); // index
that._f = undefined; // first entry
that._l = undefined; // last entry
that[SIZE] = 0; // size
if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that);
});
redefineAll(C.prototype, {
// 23.1.3.1 Map.prototype.clear()
// 23.2.3.2 Set.prototype.clear()
clear: function clear(){
for(var that = this, data = that._i, entry = that._f; entry; entry = entry.n){
entry.r = true;
if(entry.p)entry.p = entry.p.n = undefined;
delete data[entry.i];
}
that._f = that._l = undefined;
that[SIZE] = 0;
},
// 23.1.3.3 Map.prototype.delete(key)
// 23.2.3.4 Set.prototype.delete(value)
'delete': function(key){
var that = this
, entry = getEntry(that, key);
if(entry){
var next = entry.n
, prev = entry.p;
delete that._i[entry.i];
entry.r = true;
if(prev)prev.n = next;
if(next)next.p = prev;
if(that._f == entry)that._f = next;
if(that._l == entry)that._l = prev;
that[SIZE]--;
} return !!entry;
},
// 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)
// 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)
forEach: function forEach(callbackfn /*, that = undefined */){
anInstance(this, C, 'forEach');
var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3)
, entry;
while(entry = entry ? entry.n : this._f){
f(entry.v, entry.k, this);
// revert to the last existing entry
while(entry && entry.r)entry = entry.p;
}
},
// 23.1.3.7 Map.prototype.has(key)
// 23.2.3.7 Set.prototype.has(value)
has: function has(key){
return !!getEntry(this, key);
}
});
if(DESCRIPTORS)dP(C.prototype, 'size', {
get: function(){
return defined(this[SIZE]);
}
});
return C;
},
def: function(that, key, value){
var entry = getEntry(that, key)
, prev, index;
// change existing entry
if(entry){
entry.v = value;
// create new entry
} else {
that._l = entry = {
i: index = fastKey(key, true), // <- index
k: key, // <- key
v: value, // <- value
p: prev = that._l, // <- previous entry
n: undefined, // <- next entry
r: false // <- removed
};
if(!that._f)that._f = entry;
if(prev)prev.n = entry;
that[SIZE]++;
// add to index
if(index !== 'F')that._i[index] = entry;
} return that;
},
getEntry: getEntry,
setStrong: function(C, NAME, IS_MAP){
// add .keys, .values, .entries, [@@iterator]
// 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11
$iterDefine(C, NAME, function(iterated, kind){
this._t = iterated; // target
this._k = kind; // kind
this._l = undefined; // previous
}, function(){
var that = this
, kind = that._k
, entry = that._l;
// revert to the last existing entry
while(entry && entry.r)entry = entry.p;
// get next entry
if(!that._t || !(that._l = entry = entry ? entry.n : that._t._f)){
// or finish the iteration
that._t = undefined;
return step(1);
}
// return step by kind
if(kind == 'keys' )return step(0, entry.k);
if(kind == 'values')return step(0, entry.v);
return step(0, [entry.k, entry.v]);
}, IS_MAP ? 'entries' : 'values' , !IS_MAP, true);
// add [@@species], 23.1.2.2, 23.2.2.2
setSpecies(NAME);
}
};
/***/ },
/* 442 */
/*!******************************************!*\
!*** ./~/core-js/modules/_collection.js ***!
\******************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
var global = __webpack_require__(/*! ./_global */ 233)
, $export = __webpack_require__(/*! ./_export */ 237)
, redefine = __webpack_require__(/*! ./_redefine */ 247)
, redefineAll = __webpack_require__(/*! ./_redefine-all */ 439)
, meta = __webpack_require__(/*! ./_meta */ 251)
, forOf = __webpack_require__(/*! ./_for-of */ 435)
, anInstance = __webpack_require__(/*! ./_an-instance */ 434)
, isObject = __webpack_require__(/*! ./_is-object */ 242)
, fails = __webpack_require__(/*! ./_fails */ 236)
, $iterDetect = __webpack_require__(/*! ./_iter-detect */ 394)
, setToStringTag = __webpack_require__(/*! ./_set-to-string-tag */ 253)
, inheritIfRequired = __webpack_require__(/*! ./_inherit-if-required */ 317);
module.exports = function(NAME, wrapper, methods, common, IS_MAP, IS_WEAK){
var Base = global[NAME]
, C = Base
, ADDER = IS_MAP ? 'set' : 'add'
, proto = C && C.prototype
, O = {};
var fixMethod = function(KEY){
var fn = proto[KEY];
redefine(proto, KEY,
KEY == 'delete' ? function(a){
return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);
} : KEY == 'has' ? function has(a){
return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);
} : KEY == 'get' ? function get(a){
return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a);
} : KEY == 'add' ? function add(a){ fn.call(this, a === 0 ? 0 : a); return this; }
: function set(a, b){ fn.call(this, a === 0 ? 0 : a, b); return this; }
);
};
if(typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function(){
new C().entries().next();
}))){
// create collection constructor
C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER);
redefineAll(C.prototype, methods);
meta.NEED = true;
} else {
var instance = new C
// early implementations not supports chaining
, HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance
// V8 ~ Chromium 40- weak-collections throws on primitives, but should return false
, THROWS_ON_PRIMITIVES = fails(function(){ instance.has(1); })
// most early implementations doesn't supports iterables, most modern - not close it correctly
, ACCEPT_ITERABLES = $iterDetect(function(iter){ new C(iter); }) // eslint-disable-line no-new
// for early implementations -0 and +0 not the same
, BUGGY_ZERO = !IS_WEAK && fails(function(){
// V8 ~ Chromium 42- fails only with 5+ elements
var $instance = new C()
, index = 5;
while(index--)$instance[ADDER](index, index);
return !$instance.has(-0);
});
if(!ACCEPT_ITERABLES){
C = wrapper(function(target, iterable){
anInstance(target, C, NAME);
var that = inheritIfRequired(new Base, target, C);
if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that);
return that;
});
C.prototype = proto;
proto.constructor = C;
}
if(THROWS_ON_PRIMITIVES || BUGGY_ZERO){
fixMethod('delete');
fixMethod('has');
IS_MAP && fixMethod('get');
}
if(BUGGY_ZERO || HASNT_CHAINING)fixMethod(ADDER);
// weak collections should not contains .clear method
if(IS_WEAK && proto.clear)delete proto.clear;
}
setToStringTag(C, NAME);
O[NAME] = C;
$export($export.G + $export.W + $export.F * (C != Base), O);
if(!IS_WEAK)common.setStrong(C, NAME, IS_MAP);
return C;
};
/***/ },
/* 443 */
/*!**************************************!*\
!*** ./~/core-js/modules/es6.set.js ***!
\**************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
var strong = __webpack_require__(/*! ./_collection-strong */ 441);
// 23.2 Set Objects
module.exports = __webpack_require__(/*! ./_collection */ 442)('Set', function(get){
return function Set(){ return get(this, arguments.length > 0 ? arguments[0] : undefined); };
}, {
// 23.2.3.1 Set.prototype.add(value)
add: function add(value){
return strong.def(this, value = value === 0 ? 0 : value, value);
}
}, strong);
/***/ },
/* 444 */
/*!*******************************************!*\
!*** ./~/core-js/modules/es6.weak-map.js ***!
\*******************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
var each = __webpack_require__(/*! ./_array-methods */ 401)(0)
, redefine = __webpack_require__(/*! ./_redefine */ 247)
, meta = __webpack_require__(/*! ./_meta */ 251)
, assign = __webpack_require__(/*! ./_object-assign */ 298)
, weak = __webpack_require__(/*! ./_collection-weak */ 445)
, isObject = __webpack_require__(/*! ./_is-object */ 242)
, getWeak = meta.getWeak
, isExtensible = Object.isExtensible
, uncaughtFrozenStore = weak.ufstore
, tmp = {}
, InternalMap;
var wrapper = function(get){
return function WeakMap(){
return get(this, arguments.length > 0 ? arguments[0] : undefined);
};
};
var methods = {
// 23.3.3.3 WeakMap.prototype.get(key)
get: function get(key){
if(isObject(key)){
var data = getWeak(key);
if(data === true)return uncaughtFrozenStore(this).get(key);
return data ? data[this._i] : undefined;
}
},
// 23.3.3.5 WeakMap.prototype.set(key, value)
set: function set(key, value){
return weak.def(this, key, value);
}
};
// 23.3 WeakMap Objects
var $WeakMap = module.exports = __webpack_require__(/*! ./_collection */ 442)('WeakMap', wrapper, methods, weak, true, true);
// IE11 WeakMap frozen keys fix
if(new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7){
InternalMap = weak.getConstructor(wrapper);
assign(InternalMap.prototype, methods);
meta.NEED = true;
each(['delete', 'has', 'get', 'set'], function(key){
var proto = $WeakMap.prototype
, method = proto[key];
redefine(proto, key, function(a, b){
// store frozen objects on internal weakmap shim
if(isObject(a) && !isExtensible(a)){
if(!this._f)this._f = new InternalMap;
var result = this._f[key](a, b);
return key == 'set' ? this : result;
// store all the rest on native weakmap
} return method.call(this, a, b);
});
});
}
/***/ },
/* 445 */
/*!***********************************************!*\
!*** ./~/core-js/modules/_collection-weak.js ***!
\***********************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
var redefineAll = __webpack_require__(/*! ./_redefine-all */ 439)
, getWeak = __webpack_require__(/*! ./_meta */ 251).getWeak
, anObject = __webpack_require__(/*! ./_an-object */ 241)
, isObject = __webpack_require__(/*! ./_is-object */ 242)
, anInstance = __webpack_require__(/*! ./_an-instance */ 434)
, forOf = __webpack_require__(/*! ./_for-of */ 435)
, createArrayMethod = __webpack_require__(/*! ./_array-methods */ 401)
, $has = __webpack_require__(/*! ./_has */ 234)
, arrayFind = createArrayMethod(5)
, arrayFindIndex = createArrayMethod(6)
, id = 0;
// fallback for uncaught frozen keys
var uncaughtFrozenStore = function(that){
return that._l || (that._l = new UncaughtFrozenStore);
};
var UncaughtFrozenStore = function(){
this.a = [];
};
var findUncaughtFrozen = function(store, key){
return arrayFind(store.a, function(it){
return it[0] === key;
});
};
UncaughtFrozenStore.prototype = {
get: function(key){
var entry = findUncaughtFrozen(this, key);
if(entry)return entry[1];
},
has: function(key){
return !!findUncaughtFrozen(this, key);
},
set: function(key, value){
var entry = findUncaughtFrozen(this, key);
if(entry)entry[1] = value;
else this.a.push([key, value]);
},
'delete': function(key){
var index = arrayFindIndex(this.a, function(it){
return it[0] === key;
});
if(~index)this.a.splice(index, 1);
return !!~index;
}
};
module.exports = {
getConstructor: function(wrapper, NAME, IS_MAP, ADDER){
var C = wrapper(function(that, iterable){
anInstance(that, C, NAME, '_i');
that._i = id++; // collection id
that._l = undefined; // leak store for uncaught frozen objects
if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that);
});
redefineAll(C.prototype, {
// 23.3.3.2 WeakMap.prototype.delete(key)
// 23.4.3.3 WeakSet.prototype.delete(value)
'delete': function(key){
if(!isObject(key))return false;
var data = getWeak(key);
if(data === true)return uncaughtFrozenStore(this)['delete'](key);
return data && $has(data, this._i) && delete data[this._i];
},
// 23.3.3.4 WeakMap.prototype.has(key)
// 23.4.3.4 WeakSet.prototype.has(value)
has: function has(key){
if(!isObject(key))return false;
var data = getWeak(key);
if(data === true)return uncaughtFrozenStore(this).has(key);
return data && $has(data, this._i);
}
});
return C;
},
def: function(that, key, value){
var data = getWeak(anObject(key), true);
if(data === true)uncaughtFrozenStore(that).set(key, value);
else data[that._i] = value;
return that;
},
ufstore: uncaughtFrozenStore
};
/***/ },
/* 446 */
/*!*******************************************!*\
!*** ./~/core-js/modules/es6.weak-set.js ***!
\*******************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
var weak = __webpack_require__(/*! ./_collection-weak */ 445);
// 23.4 WeakSet Objects
__webpack_require__(/*! ./_collection */ 442)('WeakSet', function(get){
return function WeakSet(){ return get(this, arguments.length > 0 ? arguments[0] : undefined); };
}, {
// 23.4.3.1 WeakSet.prototype.add(value)
add: function add(value){
return weak.def(this, value, true);
}
}, weak, false, true);
/***/ },
/* 447 */
/*!*****************************************************!*\
!*** ./~/core-js/modules/es6.typed.array-buffer.js ***!
\*****************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(/*! ./_export */ 237)
, $typed = __webpack_require__(/*! ./_typed */ 448)
, buffer = __webpack_require__(/*! ./_typed-buffer */ 449)
, anObject = __webpack_require__(/*! ./_an-object */ 241)
, toIndex = __webpack_require__(/*! ./_to-index */ 268)
, toLength = __webpack_require__(/*! ./_to-length */ 266)
, isObject = __webpack_require__(/*! ./_is-object */ 242)
, ArrayBuffer = __webpack_require__(/*! ./_global */ 233).ArrayBuffer
, speciesConstructor = __webpack_require__(/*! ./_species-constructor */ 436)
, $ArrayBuffer = buffer.ArrayBuffer
, $DataView = buffer.DataView
, $isView = $typed.ABV && ArrayBuffer.isView
, $slice = $ArrayBuffer.prototype.slice
, VIEW = $typed.VIEW
, ARRAY_BUFFER = 'ArrayBuffer';
$export($export.G + $export.W + $export.F * (ArrayBuffer !== $ArrayBuffer), {ArrayBuffer: $ArrayBuffer});
$export($export.S + $export.F * !$typed.CONSTR, ARRAY_BUFFER, {
// 24.1.3.1 ArrayBuffer.isView(arg)
isView: function isView(it){
return $isView && $isView(it) || isObject(it) && VIEW in it;
}
});
$export($export.P + $export.U + $export.F * __webpack_require__(/*! ./_fails */ 236)(function(){
return !new $ArrayBuffer(2).slice(1, undefined).byteLength;
}), ARRAY_BUFFER, {
// 24.1.4.3 ArrayBuffer.prototype.slice(start, end)
slice: function slice(start, end){
if($slice !== undefined && end === undefined)return $slice.call(anObject(this), start); // FF fix
var len = anObject(this).byteLength
, first = toIndex(start, len)
, final = toIndex(end === undefined ? len : end, len)
, result = new (speciesConstructor(this, $ArrayBuffer))(toLength(final - first))
, viewS = new $DataView(this)
, viewT = new $DataView(result)
, index = 0;
while(first < final){
viewT.setUint8(index++, viewS.getUint8(first++));
} return result;
}
});
__webpack_require__(/*! ./_set-species */ 421)(ARRAY_BUFFER);
/***/ },
/* 448 */
/*!*************************************!*\
!*** ./~/core-js/modules/_typed.js ***!
\*************************************/
/***/ function(module, exports, __webpack_require__) {
var global = __webpack_require__(/*! ./_global */ 233)
, hide = __webpack_require__(/*! ./_hide */ 239)
, uid = __webpack_require__(/*! ./_uid */ 248)
, TYPED = uid('typed_array')
, VIEW = uid('view')
, ABV = !!(global.ArrayBuffer && global.DataView)
, CONSTR = ABV
, i = 0, l = 9, Typed;
var TypedArrayConstructors = (
'Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array'
).split(',');
while(i < l){
if(Typed = global[TypedArrayConstructors[i++]]){
hide(Typed.prototype, TYPED, true);
hide(Typed.prototype, VIEW, true);
} else CONSTR = false;
}
module.exports = {
ABV: ABV,
CONSTR: CONSTR,
TYPED: TYPED,
VIEW: VIEW
};
/***/ },
/* 449 */
/*!********************************************!*\
!*** ./~/core-js/modules/_typed-buffer.js ***!
\********************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
var global = __webpack_require__(/*! ./_global */ 233)
, DESCRIPTORS = __webpack_require__(/*! ./_descriptors */ 235)
, LIBRARY = __webpack_require__(/*! ./_library */ 257)
, $typed = __webpack_require__(/*! ./_typed */ 448)
, hide = __webpack_require__(/*! ./_hide */ 239)
, redefineAll = __webpack_require__(/*! ./_redefine-all */ 439)
, fails = __webpack_require__(/*! ./_fails */ 236)
, anInstance = __webpack_require__(/*! ./_an-instance */ 434)
, toInteger = __webpack_require__(/*! ./_to-integer */ 267)
, toLength = __webpack_require__(/*! ./_to-length */ 266)
, gOPN = __webpack_require__(/*! ./_object-gopn */ 279).f
, dP = __webpack_require__(/*! ./_object-dp */ 240).f
, arrayFill = __webpack_require__(/*! ./_array-fill */ 417)
, setToStringTag = __webpack_require__(/*! ./_set-to-string-tag */ 253)
, ARRAY_BUFFER = 'ArrayBuffer'
, DATA_VIEW = 'DataView'
, PROTOTYPE = 'prototype'
, WRONG_LENGTH = 'Wrong length!'
, WRONG_INDEX = 'Wrong index!'
, $ArrayBuffer = global[ARRAY_BUFFER]
, $DataView = global[DATA_VIEW]
, Math = global.Math
, RangeError = global.RangeError
, Infinity = global.Infinity
, BaseBuffer = $ArrayBuffer
, abs = Math.abs
, pow = Math.pow
, floor = Math.floor
, log = Math.log
, LN2 = Math.LN2
, BUFFER = 'buffer'
, BYTE_LENGTH = 'byteLength'
, BYTE_OFFSET = 'byteOffset'
, $BUFFER = DESCRIPTORS ? '_b' : BUFFER
, $LENGTH = DESCRIPTORS ? '_l' : BYTE_LENGTH
, $OFFSET = DESCRIPTORS ? '_o' : BYTE_OFFSET;
// IEEE754 conversions based on https://github.com/feross/ieee754
var packIEEE754 = function(value, mLen, nBytes){
var buffer = Array(nBytes)
, eLen = nBytes * 8 - mLen - 1
, eMax = (1 << eLen) - 1
, eBias = eMax >> 1
, rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0
, i = 0
, s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0
, e, m, c;
value = abs(value)
if(value != value || value === Infinity){
m = value != value ? 1 : 0;
e = eMax;
} else {
e = floor(log(value) / LN2);
if(value * (c = pow(2, -e)) < 1){
e--;
c *= 2;
}
if(e + eBias >= 1){
value += rt / c;
} else {
value += rt * pow(2, 1 - eBias);
}
if(value * c >= 2){
e++;
c /= 2;
}
if(e + eBias >= eMax){
m = 0;
e = eMax;
} else if(e + eBias >= 1){
m = (value * c - 1) * pow(2, mLen);
e = e + eBias;
} else {
m = value * pow(2, eBias - 1) * pow(2, mLen);
e = 0;
}
}
for(; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);
e = e << mLen | m;
eLen += mLen;
for(; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);
buffer[--i] |= s * 128;
return buffer;
};
var unpackIEEE754 = function(buffer, mLen, nBytes){
var eLen = nBytes * 8 - mLen - 1
, eMax = (1 << eLen) - 1
, eBias = eMax >> 1
, nBits = eLen - 7
, i = nBytes - 1
, s = buffer[i--]
, e = s & 127
, m;
s >>= 7;
for(; nBits > 0; e = e * 256 + buffer[i], i--, nBits -= 8);
m = e & (1 << -nBits) - 1;
e >>= -nBits;
nBits += mLen;
for(; nBits > 0; m = m * 256 + buffer[i], i--, nBits -= 8);
if(e === 0){
e = 1 - eBias;
} else if(e === eMax){
return m ? NaN : s ? -Infinity : Infinity;
} else {
m = m + pow(2, mLen);
e = e - eBias;
} return (s ? -1 : 1) * m * pow(2, e - mLen);
};
var unpackI32 = function(bytes){
return bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0];
};
var packI8 = function(it){
return [it & 0xff];
};
var packI16 = function(it){
return [it & 0xff, it >> 8 & 0xff];
};
var packI32 = function(it){
return [it & 0xff, it >> 8 & 0xff, it >> 16 & 0xff, it >> 24 & 0xff];
};
var packF64 = function(it){
return packIEEE754(it, 52, 8);
};
var packF32 = function(it){
return packIEEE754(it, 23, 4);
};
var addGetter = function(C, key, internal){
dP(C[PROTOTYPE], key, {get: function(){ return this[internal]; }});
};
var get = function(view, bytes, index, isLittleEndian){
var numIndex = +index
, intIndex = toInteger(numIndex);
if(numIndex != intIndex || intIndex < 0 || intIndex + bytes > view[$LENGTH])throw RangeError(WRONG_INDEX);
var store = view[$BUFFER]._b
, start = intIndex + view[$OFFSET]
, pack = store.slice(start, start + bytes);
return isLittleEndian ? pack : pack.reverse();
};
var set = function(view, bytes, index, conversion, value, isLittleEndian){
var numIndex = +index
, intIndex = toInteger(numIndex);
if(numIndex != intIndex || intIndex < 0 || intIndex + bytes > view[$LENGTH])throw RangeError(WRONG_INDEX);
var store = view[$BUFFER]._b
, start = intIndex + view[$OFFSET]
, pack = conversion(+value);
for(var i = 0; i < bytes; i++)store[start + i] = pack[isLittleEndian ? i : bytes - i - 1];
};
var validateArrayBufferArguments = function(that, length){
anInstance(that, $ArrayBuffer, ARRAY_BUFFER);
var numberLength = +length
, byteLength = toLength(numberLength);
if(numberLength != byteLength)throw RangeError(WRONG_LENGTH);
return byteLength;
};
if(!$typed.ABV){
$ArrayBuffer = function ArrayBuffer(length){
var byteLength = validateArrayBufferArguments(this, length);
this._b = arrayFill.call(Array(byteLength), 0);
this[$LENGTH] = byteLength;
};
$DataView = function DataView(buffer, byteOffset, byteLength){
anInstance(this, $DataView, DATA_VIEW);
anInstance(buffer, $ArrayBuffer, DATA_VIEW);
var bufferLength = buffer[$LENGTH]
, offset = toInteger(byteOffset);
if(offset < 0 || offset > bufferLength)throw RangeError('Wrong offset!');
byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength);
if(offset + byteLength > bufferLength)throw RangeError(WRONG_LENGTH);
this[$BUFFER] = buffer;
this[$OFFSET] = offset;
this[$LENGTH] = byteLength;
};
if(DESCRIPTORS){
addGetter($ArrayBuffer, BYTE_LENGTH, '_l');
addGetter($DataView, BUFFER, '_b');
addGetter($DataView, BYTE_LENGTH, '_l');
addGetter($DataView, BYTE_OFFSET, '_o');
}
redefineAll($DataView[PROTOTYPE], {
getInt8: function getInt8(byteOffset){
return get(this, 1, byteOffset)[0] << 24 >> 24;
},
getUint8: function getUint8(byteOffset){
return get(this, 1, byteOffset)[0];
},
getInt16: function getInt16(byteOffset /*, littleEndian */){
var bytes = get(this, 2, byteOffset, arguments[1]);
return (bytes[1] << 8 | bytes[0]) << 16 >> 16;
},
getUint16: function getUint16(byteOffset /*, littleEndian */){
var bytes = get(this, 2, byteOffset, arguments[1]);
return bytes[1] << 8 | bytes[0];
},
getInt32: function getInt32(byteOffset /*, littleEndian */){
return unpackI32(get(this, 4, byteOffset, arguments[1]));
},
getUint32: function getUint32(byteOffset /*, littleEndian */){
return unpackI32(get(this, 4, byteOffset, arguments[1])) >>> 0;
},
getFloat32: function getFloat32(byteOffset /*, littleEndian */){
return unpackIEEE754(get(this, 4, byteOffset, arguments[1]), 23, 4);
},
getFloat64: function getFloat64(byteOffset /*, littleEndian */){
return unpackIEEE754(get(this, 8, byteOffset, arguments[1]), 52, 8);
},
setInt8: function setInt8(byteOffset, value){
set(this, 1, byteOffset, packI8, value);
},
setUint8: function setUint8(byteOffset, value){
set(this, 1, byteOffset, packI8, value);
},
setInt16: function setInt16(byteOffset, value /*, littleEndian */){
set(this, 2, byteOffset, packI16, value, arguments[2]);
},
setUint16: function setUint16(byteOffset, value /*, littleEndian */){
set(this, 2, byteOffset, packI16, value, arguments[2]);
},
setInt32: function setInt32(byteOffset, value /*, littleEndian */){
set(this, 4, byteOffset, packI32, value, arguments[2]);
},
setUint32: function setUint32(byteOffset, value /*, littleEndian */){
set(this, 4, byteOffset, packI32, value, arguments[2]);
},
setFloat32: function setFloat32(byteOffset, value /*, littleEndian */){
set(this, 4, byteOffset, packF32, value, arguments[2]);
},
setFloat64: function setFloat64(byteOffset, value /*, littleEndian */){
set(this, 8, byteOffset, packF64, value, arguments[2]);
}
});
} else {
if(!fails(function(){
new $ArrayBuffer; // eslint-disable-line no-new
}) || !fails(function(){
new $ArrayBuffer(.5); // eslint-disable-line no-new
})){
$ArrayBuffer = function ArrayBuffer(length){
return new BaseBuffer(validateArrayBufferArguments(this, length));
};
var ArrayBufferProto = $ArrayBuffer[PROTOTYPE] = BaseBuffer[PROTOTYPE];
for(var keys = gOPN(BaseBuffer), j = 0, key; keys.length > j; ){
if(!((key = keys[j++]) in $ArrayBuffer))hide($ArrayBuffer, key, BaseBuffer[key]);
};
if(!LIBRARY)ArrayBufferProto.constructor = $ArrayBuffer;
}
// iOS Safari 7.x bug
var view = new $DataView(new $ArrayBuffer(2))
, $setInt8 = $DataView[PROTOTYPE].setInt8;
view.setInt8(0, 2147483648);
view.setInt8(1, 2147483649);
if(view.getInt8(0) || !view.getInt8(1))redefineAll($DataView[PROTOTYPE], {
setInt8: function setInt8(byteOffset, value){
$setInt8.call(this, byteOffset, value << 24 >> 24);
},
setUint8: function setUint8(byteOffset, value){
$setInt8.call(this, byteOffset, value << 24 >> 24);
}
}, true);
}
setToStringTag($ArrayBuffer, ARRAY_BUFFER);
setToStringTag($DataView, DATA_VIEW);
hide($DataView[PROTOTYPE], $typed.VIEW, true);
exports[ARRAY_BUFFER] = $ArrayBuffer;
exports[DATA_VIEW] = $DataView;
/***/ },
/* 450 */
/*!**************************************************!*\
!*** ./~/core-js/modules/es6.typed.data-view.js ***!
\**************************************************/
/***/ function(module, exports, __webpack_require__) {
var $export = __webpack_require__(/*! ./_export */ 237);
$export($export.G + $export.W + $export.F * !__webpack_require__(/*! ./_typed */ 448).ABV, {
DataView: __webpack_require__(/*! ./_typed-buffer */ 449).DataView
});
/***/ },
/* 451 */
/*!***************************************************!*\
!*** ./~/core-js/modules/es6.typed.int8-array.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
__webpack_require__(/*! ./_typed-array */ 452)('Int8', 1, function(init){
return function Int8Array(data, byteOffset, length){
return init(this, data, byteOffset, length);
};
});
/***/ },
/* 452 */
/*!*******************************************!*\
!*** ./~/core-js/modules/_typed-array.js ***!
\*******************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
if(__webpack_require__(/*! ./_descriptors */ 235)){
var LIBRARY = __webpack_require__(/*! ./_library */ 257)
, global = __webpack_require__(/*! ./_global */ 233)
, fails = __webpack_require__(/*! ./_fails */ 236)
, $export = __webpack_require__(/*! ./_export */ 237)
, $typed = __webpack_require__(/*! ./_typed */ 448)
, $buffer = __webpack_require__(/*! ./_typed-buffer */ 449)
, ctx = __webpack_require__(/*! ./_ctx */ 249)
, anInstance = __webpack_require__(/*! ./_an-instance */ 434)
, propertyDesc = __webpack_require__(/*! ./_property-desc */ 246)
, hide = __webpack_require__(/*! ./_hide */ 239)
, redefineAll = __webpack_require__(/*! ./_redefine-all */ 439)
, toInteger = __webpack_require__(/*! ./_to-integer */ 267)
, toLength = __webpack_require__(/*! ./_to-length */ 266)
, toIndex = __webpack_require__(/*! ./_to-index */ 268)
, toPrimitive = __webpack_require__(/*! ./_to-primitive */ 245)
, has = __webpack_require__(/*! ./_has */ 234)
, same = __webpack_require__(/*! ./_same-value */ 300)
, classof = __webpack_require__(/*! ./_classof */ 304)
, isObject = __webpack_require__(/*! ./_is-object */ 242)
, toObject = __webpack_require__(/*! ./_to-object */ 287)
, isArrayIter = __webpack_require__(/*! ./_is-array-iter */ 391)
, create = __webpack_require__(/*! ./_object-create */ 275)
, getPrototypeOf = __webpack_require__(/*! ./_object-gpo */ 288)
, gOPN = __webpack_require__(/*! ./_object-gopn */ 279).f
, getIterFn = __webpack_require__(/*! ./core.get-iterator-method */ 393)
, uid = __webpack_require__(/*! ./_uid */ 248)
, wks = __webpack_require__(/*! ./_wks */ 254)
, createArrayMethod = __webpack_require__(/*! ./_array-methods */ 401)
, createArrayIncludes = __webpack_require__(/*! ./_array-includes */ 265)
, speciesConstructor = __webpack_require__(/*! ./_species-constructor */ 436)
, ArrayIterators = __webpack_require__(/*! ./es6.array.iterator */ 422)
, Iterators = __webpack_require__(/*! ./_iterators */ 358)
, $iterDetect = __webpack_require__(/*! ./_iter-detect */ 394)
, setSpecies = __webpack_require__(/*! ./_set-species */ 421)
, arrayFill = __webpack_require__(/*! ./_array-fill */ 417)
, arrayCopyWithin = __webpack_require__(/*! ./_array-copy-within */ 414)
, $DP = __webpack_require__(/*! ./_object-dp */ 240)
, $GOPD = __webpack_require__(/*! ./_object-gopd */ 280)
, dP = $DP.f
, gOPD = $GOPD.f
, RangeError = global.RangeError
, TypeError = global.TypeError
, Uint8Array = global.Uint8Array
, ARRAY_BUFFER = 'ArrayBuffer'
, SHARED_BUFFER = 'Shared' + ARRAY_BUFFER
, BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT'
, PROTOTYPE = 'prototype'
, ArrayProto = Array[PROTOTYPE]
, $ArrayBuffer = $buffer.ArrayBuffer
, $DataView = $buffer.DataView
, arrayForEach = createArrayMethod(0)
, arrayFilter = createArrayMethod(2)
, arraySome = createArrayMethod(3)
, arrayEvery = createArrayMethod(4)
, arrayFind = createArrayMethod(5)
, arrayFindIndex = createArrayMethod(6)
, arrayIncludes = createArrayIncludes(true)
, arrayIndexOf = createArrayIncludes(false)
, arrayValues = ArrayIterators.values
, arrayKeys = ArrayIterators.keys
, arrayEntries = ArrayIterators.entries
, arrayLastIndexOf = ArrayProto.lastIndexOf
, arrayReduce = ArrayProto.reduce
, arrayReduceRight = ArrayProto.reduceRight
, arrayJoin = ArrayProto.join
, arraySort = ArrayProto.sort
, arraySlice = ArrayProto.slice
, arrayToString = ArrayProto.toString
, arrayToLocaleString = ArrayProto.toLocaleString
, ITERATOR = wks('iterator')
, TAG = wks('toStringTag')
, TYPED_CONSTRUCTOR = uid('typed_constructor')
, DEF_CONSTRUCTOR = uid('def_constructor')
, ALL_CONSTRUCTORS = $typed.CONSTR
, TYPED_ARRAY = $typed.TYPED
, VIEW = $typed.VIEW
, WRONG_LENGTH = 'Wrong length!';
var $map = createArrayMethod(1, function(O, length){
return allocate(speciesConstructor(O, O[DEF_CONSTRUCTOR]), length);
});
var LITTLE_ENDIAN = fails(function(){
return new Uint8Array(new Uint16Array([1]).buffer)[0] === 1;
});
var FORCED_SET = !!Uint8Array && !!Uint8Array[PROTOTYPE].set && fails(function(){
new Uint8Array(1).set({});
});
var strictToLength = function(it, SAME){
if(it === undefined)throw TypeError(WRONG_LENGTH);
var number = +it
, length = toLength(it);
if(SAME && !same(number, length))throw RangeError(WRONG_LENGTH);
return length;
};
var toOffset = function(it, BYTES){
var offset = toInteger(it);
if(offset < 0 || offset % BYTES)throw RangeError('Wrong offset!');
return offset;
};
var validate = function(it){
if(isObject(it) && TYPED_ARRAY in it)return it;
throw TypeError(it + ' is not a typed array!');
};
var allocate = function(C, length){
if(!(isObject(C) && TYPED_CONSTRUCTOR in C)){
throw TypeError('It is not a typed array constructor!');
} return new C(length);
};
var speciesFromList = function(O, list){
return fromList(speciesConstructor(O, O[DEF_CONSTRUCTOR]), list);
};
var fromList = function(C, list){
var index = 0
, length = list.length
, result = allocate(C, length);
while(length > index)result[index] = list[index++];
return result;
};
var addGetter = function(it, key, internal){
dP(it, key, {get: function(){ return this._d[internal]; }});
};
var $from = function from(source /*, mapfn, thisArg */){
var O = toObject(source)
, aLen = arguments.length
, mapfn = aLen > 1 ? arguments[1] : undefined
, mapping = mapfn !== undefined
, iterFn = getIterFn(O)
, i, length, values, result, step, iterator;
if(iterFn != undefined && !isArrayIter(iterFn)){
for(iterator = iterFn.call(O), values = [], i = 0; !(step = iterator.next()).done; i++){
values.push(step.value);
} O = values;
}
if(mapping && aLen > 2)mapfn = ctx(mapfn, arguments[2], 2);
for(i = 0, length = toLength(O.length), result = allocate(this, length); length > i; i++){
result[i] = mapping ? mapfn(O[i], i) : O[i];
}
return result;
};
var $of = function of(/*...items*/){
var index = 0
, length = arguments.length
, result = allocate(this, length);
while(length > index)result[index] = arguments[index++];
return result;
};
// iOS Safari 6.x fails here
var TO_LOCALE_BUG = !!Uint8Array && fails(function(){ arrayToLocaleString.call(new Uint8Array(1)); });
var $toLocaleString = function toLocaleString(){
return arrayToLocaleString.apply(TO_LOCALE_BUG ? arraySlice.call(validate(this)) : validate(this), arguments);
};
var proto = {
copyWithin: function copyWithin(target, start /*, end */){
return arrayCopyWithin.call(validate(this), target, start, arguments.length > 2 ? arguments[2] : undefined);
},
every: function every(callbackfn /*, thisArg */){
return arrayEvery(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
},
fill: function fill(value /*, start, end */){ // eslint-disable-line no-unused-vars
return arrayFill.apply(validate(this), arguments);
},
filter: function filter(callbackfn /*, thisArg */){
return speciesFromList(this, arrayFilter(validate(this), callbackfn,
arguments.length > 1 ? arguments[1] : undefined));
},
find: function find(predicate /*, thisArg */){
return arrayFind(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined);
},
findIndex: function findIndex(predicate /*, thisArg */){
return arrayFindIndex(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined);
},
forEach: function forEach(callbackfn /*, thisArg */){
arrayForEach(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
},
indexOf: function indexOf(searchElement /*, fromIndex */){
return arrayIndexOf(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);
},
includes: function includes(searchElement /*, fromIndex */){
return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);
},
join: function join(separator){ // eslint-disable-line no-unused-vars
return arrayJoin.apply(validate(this), arguments);
},
lastIndexOf: function lastIndexOf(searchElement /*, fromIndex */){ // eslint-disable-line no-unused-vars
return arrayLastIndexOf.apply(validate(this), arguments);
},
map: function map(mapfn /*, thisArg */){
return $map(validate(this), mapfn, arguments.length > 1 ? arguments[1] : undefined);
},
reduce: function reduce(callbackfn /*, initialValue */){ // eslint-disable-line no-unused-vars
return arrayReduce.apply(validate(this), arguments);
},
reduceRight: function reduceRight(callbackfn /*, initialValue */){ // eslint-disable-line no-unused-vars
return arrayReduceRight.apply(validate(this), arguments);
},
reverse: function reverse(){
var that = this
, length = validate(that).length
, middle = Math.floor(length / 2)
, index = 0
, value;
while(index < middle){
value = that[index];
that[index++] = that[--length];
that[length] = value;
} return that;
},
some: function some(callbackfn /*, thisArg */){
return arraySome(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
},
sort: function sort(comparefn){
return arraySort.call(validate(this), comparefn);
},
subarray: function subarray(begin, end){
var O = validate(this)
, length = O.length
, $begin = toIndex(begin, length);
return new (speciesConstructor(O, O[DEF_CONSTRUCTOR]))(
O.buffer,
O.byteOffset + $begin * O.BYTES_PER_ELEMENT,
toLength((end === undefined ? length : toIndex(end, length)) - $begin)
);
}
};
var $slice = function slice(start, end){
return speciesFromList(this, arraySlice.call(validate(this), start, end));
};
var $set = function set(arrayLike /*, offset */){
validate(this);
var offset = toOffset(arguments[1], 1)
, length = this.length
, src = toObject(arrayLike)
, len = toLength(src.length)
, index = 0;
if(len + offset > length)throw RangeError(WRONG_LENGTH);
while(index < len)this[offset + index] = src[index++];
};
var $iterators = {
entries: function entries(){
return arrayEntries.call(validate(this));
},
keys: function keys(){
return arrayKeys.call(validate(this));
},
values: function values(){
return arrayValues.call(validate(this));
}
};
var isTAIndex = function(target, key){
return isObject(target)
&& target[TYPED_ARRAY]
&& typeof key != 'symbol'
&& key in target
&& String(+key) == String(key);
};
var $getDesc = function getOwnPropertyDescriptor(target, key){
return isTAIndex(target, key = toPrimitive(key, true))
? propertyDesc(2, target[key])
: gOPD(target, key);
};
var $setDesc = function defineProperty(target, key, desc){
if(isTAIndex(target, key = toPrimitive(key, true))
&& isObject(desc)
&& has(desc, 'value')
&& !has(desc, 'get')
&& !has(desc, 'set')
// TODO: add validation descriptor w/o calling accessors
&& !desc.configurable
&& (!has(desc, 'writable') || desc.writable)
&& (!has(desc, 'enumerable') || desc.enumerable)
){
target[key] = desc.value;
return target;
} else return dP(target, key, desc);
};
if(!ALL_CONSTRUCTORS){
$GOPD.f = $getDesc;
$DP.f = $setDesc;
}
$export($export.S + $export.F * !ALL_CONSTRUCTORS, 'Object', {
getOwnPropertyDescriptor: $getDesc,
defineProperty: $setDesc
});
if(fails(function(){ arrayToString.call({}); })){
arrayToString = arrayToLocaleString = function toString(){
return arrayJoin.call(this);
}
}
var $TypedArrayPrototype$ = redefineAll({}, proto);
redefineAll($TypedArrayPrototype$, $iterators);
hide($TypedArrayPrototype$, ITERATOR, $iterators.values);
redefineAll($TypedArrayPrototype$, {
slice: $slice,
set: $set,
constructor: function(){ /* noop */ },
toString: arrayToString,
toLocaleString: $toLocaleString
});
addGetter($TypedArrayPrototype$, 'buffer', 'b');
addGetter($TypedArrayPrototype$, 'byteOffset', 'o');
addGetter($TypedArrayPrototype$, 'byteLength', 'l');
addGetter($TypedArrayPrototype$, 'length', 'e');
dP($TypedArrayPrototype$, TAG, {
get: function(){ return this[TYPED_ARRAY]; }
});
module.exports = function(KEY, BYTES, wrapper, CLAMPED){
CLAMPED = !!CLAMPED;
var NAME = KEY + (CLAMPED ? 'Clamped' : '') + 'Array'
, ISNT_UINT8 = NAME != 'Uint8Array'
, GETTER = 'get' + KEY
, SETTER = 'set' + KEY
, TypedArray = global[NAME]
, Base = TypedArray || {}
, TAC = TypedArray && getPrototypeOf(TypedArray)
, FORCED = !TypedArray || !$typed.ABV
, O = {}
, TypedArrayPrototype = TypedArray && TypedArray[PROTOTYPE];
var getter = function(that, index){
var data = that._d;
return data.v[GETTER](index * BYTES + data.o, LITTLE_ENDIAN);
};
var setter = function(that, index, value){
var data = that._d;
if(CLAMPED)value = (value = Math.round(value)) < 0 ? 0 : value > 0xff ? 0xff : value & 0xff;
data.v[SETTER](index * BYTES + data.o, value, LITTLE_ENDIAN);
};
var addElement = function(that, index){
dP(that, index, {
get: function(){
return getter(this, index);
},
set: function(value){
return setter(this, index, value);
},
enumerable: true
});
};
if(FORCED){
TypedArray = wrapper(function(that, data, $offset, $length){
anInstance(that, TypedArray, NAME, '_d');
var index = 0
, offset = 0
, buffer, byteLength, length, klass;
if(!isObject(data)){
length = strictToLength(data, true)
byteLength = length * BYTES;
buffer = new $ArrayBuffer(byteLength);
} else if(data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER){
buffer = data;
offset = toOffset($offset, BYTES);
var $len = data.byteLength;
if($length === undefined){
if($len % BYTES)throw RangeError(WRONG_LENGTH);
byteLength = $len - offset;
if(byteLength < 0)throw RangeError(WRONG_LENGTH);
} else {
byteLength = toLength($length) * BYTES;
if(byteLength + offset > $len)throw RangeError(WRONG_LENGTH);
}
length = byteLength / BYTES;
} else if(TYPED_ARRAY in data){
return fromList(TypedArray, data);
} else {
return $from.call(TypedArray, data);
}
hide(that, '_d', {
b: buffer,
o: offset,
l: byteLength,
e: length,
v: new $DataView(buffer)
});
while(index < length)addElement(that, index++);
});
TypedArrayPrototype = TypedArray[PROTOTYPE] = create($TypedArrayPrototype$);
hide(TypedArrayPrototype, 'constructor', TypedArray);
} else if(!$iterDetect(function(iter){
// V8 works with iterators, but fails in many other cases
// https://code.google.com/p/v8/issues/detail?id=4552
new TypedArray(null); // eslint-disable-line no-new
new TypedArray(iter); // eslint-disable-line no-new
}, true)){
TypedArray = wrapper(function(that, data, $offset, $length){
anInstance(that, TypedArray, NAME);
var klass;
// `ws` module bug, temporarily remove validation length for Uint8Array
// https://github.com/websockets/ws/pull/645
if(!isObject(data))return new Base(strictToLength(data, ISNT_UINT8));
if(data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER){
return $length !== undefined
? new Base(data, toOffset($offset, BYTES), $length)
: $offset !== undefined
? new Base(data, toOffset($offset, BYTES))
: new Base(data);
}
if(TYPED_ARRAY in data)return fromList(TypedArray, data);
return $from.call(TypedArray, data);
});
arrayForEach(TAC !== Function.prototype ? gOPN(Base).concat(gOPN(TAC)) : gOPN(Base), function(key){
if(!(key in TypedArray))hide(TypedArray, key, Base[key]);
});
TypedArray[PROTOTYPE] = TypedArrayPrototype;
if(!LIBRARY)TypedArrayPrototype.constructor = TypedArray;
}
var $nativeIterator = TypedArrayPrototype[ITERATOR]
, CORRECT_ITER_NAME = !!$nativeIterator && ($nativeIterator.name == 'values' || $nativeIterator.name == undefined)
, $iterator = $iterators.values;
hide(TypedArray, TYPED_CONSTRUCTOR, true);
hide(TypedArrayPrototype, TYPED_ARRAY, NAME);
hide(TypedArrayPrototype, VIEW, true);
hide(TypedArrayPrototype, DEF_CONSTRUCTOR, TypedArray);
if(CLAMPED ? new TypedArray(1)[TAG] != NAME : !(TAG in TypedArrayPrototype)){
dP(TypedArrayPrototype, TAG, {
get: function(){ return NAME; }
});
}
O[NAME] = TypedArray;
$export($export.G + $export.W + $export.F * (TypedArray != Base), O);
$export($export.S, NAME, {
BYTES_PER_ELEMENT: BYTES,
from: $from,
of: $of
});
if(!(BYTES_PER_ELEMENT in TypedArrayPrototype))hide(TypedArrayPrototype, BYTES_PER_ELEMENT, BYTES);
$export($export.P, NAME, proto);
setSpecies(NAME);
$export($export.P + $export.F * FORCED_SET, NAME, {set: $set});
$export($export.P + $export.F * !CORRECT_ITER_NAME, NAME, $iterators);
$export($export.P + $export.F * (TypedArrayPrototype.toString != arrayToString), NAME, {toString: arrayToString});
$export($export.P + $export.F * fails(function(){
new TypedArray(1).slice();
}), NAME, {slice: $slice});
$export($export.P + $export.F * (fails(function(){
return [1, 2].toLocaleString() != new TypedArray([1, 2]).toLocaleString()
}) || !fails(function(){
TypedArrayPrototype.toLocaleString.call([1, 2]);
})), NAME, {toLocaleString: $toLocaleString});
Iterators[NAME] = CORRECT_ITER_NAME ? $nativeIterator : $iterator;
if(!LIBRARY && !CORRECT_ITER_NAME)hide(TypedArrayPrototype, ITERATOR, $iterator);
};
} else module.exports = function(){ /* empty */ };
/***/ },
/* 453 */
/*!****************************************************!*\
!*** ./~/core-js/modules/es6.typed.uint8-array.js ***!
\****************************************************/
/***/ function(module, exports, __webpack_require__) {
__webpack_require__(/*! ./_typed-array */ 452)('Uint8', 1, function(init){
return function Uint8Array(data, byteOffset, length){
return init(this, data, byteOffset, length);
};
});
/***/ },
/* 454 */
/*!************************************************************!*\
!*** ./~/core-js/modules/es6.typed.uint8-clamped-array.js ***!
\************************************************************/
/***/ function(module, exports, __webpack_require__) {
__webpack_require__(/*! ./_typed-array */ 452)('Uint8', 1, function(init){
return function Uint8ClampedArray(data, byteOffset, length){
return init(this, data, byteOffset, length);
};
}, true);
/***/ },
/* 455 */
/*!****************************************************!*\
!*** ./~/core-js/modules/es6.typed.int16-array.js ***!
\****************************************************/
/***/ function(module, exports, __webpack_require__) {
__webpack_require__(/*! ./_typed-array */ 452)('Int16', 2, function(init){
return function Int16Array(data, byteOffset, length){
return init(this, data, byteOffset, length);
};
});
/***/ },
/* 456 */
/*!*****************************************************!*\
!*** ./~/core-js/modules/es6.typed.uint16-array.js ***!
\*****************************************************/
/***/ function(module, exports, __webpack_require__) {
__webpack_require__(/*! ./_typed-array */ 452)('Uint16', 2, function(init){
return function Uint16Array(data, byteOffset, length){
return init(this, data, byteOffset, length);
};
});
/***/ },
/* 457 */
/*!****************************************************!*\
!*** ./~/core-js/modules/es6.typed.int32-array.js ***!
\****************************************************/
/***/ function(module, exports, __webpack_require__) {
__webpack_require__(/*! ./_typed-array */ 452)('Int32', 4, function(init){
return function Int32Array(data, byteOffset, length){
return init(this, data, byteOffset, length);
};
});
/***/ },
/* 458 */
/*!*****************************************************!*\
!*** ./~/core-js/modules/es6.typed.uint32-array.js ***!
\*****************************************************/
/***/ function(module, exports, __webpack_require__) {
__webpack_require__(/*! ./_typed-array */ 452)('Uint32', 4, function(init){
return function Uint32Array(data, byteOffset, length){
return init(this, data, byteOffset, length);
};
});
/***/ },
/* 459 */
/*!******************************************************!*\
!*** ./~/core-js/modules/es6.typed.float32-array.js ***!
\******************************************************/
/***/ function(module, exports, __webpack_require__) {
__webpack_require__(/*! ./_typed-array */ 452)('Float32', 4, function(init){
return function Float32Array(data, byteOffset, length){
return init(this, data, byteOffset, length);
};
});
/***/ },
/* 460 */
/*!******************************************************!*\
!*** ./~/core-js/modules/es6.typed.float64-array.js ***!
\******************************************************/
/***/ function(module, exports, __webpack_require__) {
__webpack_require__(/*! ./_typed-array */ 452)('Float64', 8, function(init){
return function Float64Array(data, byteOffset, length){
return init(this, data, byteOffset, length);
};
});
/***/ },
/* 461 */
/*!************************************************!*\
!*** ./~/core-js/modules/es6.reflect.apply.js ***!
\************************************************/
/***/ function(module, exports, __webpack_require__) {
// 26.1.1 Reflect.apply(target, thisArgument, argumentsList)
var $export = __webpack_require__(/*! ./_export */ 237)
, aFunction = __webpack_require__(/*! ./_a-function */ 250)
, anObject = __webpack_require__(/*! ./_an-object */ 241)
, rApply = (__webpack_require__(/*! ./_global */ 233).Reflect || {}).apply
, fApply = Function.apply;
// MS Edge argumentsList argument is optional
$export($export.S + $export.F * !__webpack_require__(/*! ./_fails */ 236)(function(){
rApply(function(){});
}), 'Reflect', {
apply: function apply(target, thisArgument, argumentsList){
var T = aFunction(target)
, L = anObject(argumentsList);
return rApply ? rApply(T, thisArgument, L) : fApply.call(T, thisArgument, L);
}
});
/***/ },
/* 462 */
/*!****************************************************!*\
!*** ./~/core-js/modules/es6.reflect.construct.js ***!
\****************************************************/
/***/ function(module, exports, __webpack_require__) {
// 26.1.2 Reflect.construct(target, argumentsList [, newTarget])
var $export = __webpack_require__(/*! ./_export */ 237)
, create = __webpack_require__(/*! ./_object-create */ 275)
, aFunction = __webpack_require__(/*! ./_a-function */ 250)
, anObject = __webpack_require__(/*! ./_an-object */ 241)
, isObject = __webpack_require__(/*! ./_is-object */ 242)
, fails = __webpack_require__(/*! ./_fails */ 236)
, bind = __webpack_require__(/*! ./_bind */ 306)
, rConstruct = (__webpack_require__(/*! ./_global */ 233).Reflect || {}).construct;
// MS Edge supports only 2 arguments and argumentsList argument is optional
// FF Nightly sets third argument as `new.target`, but does not create `this` from it
var NEW_TARGET_BUG = fails(function(){
function F(){}
return !(rConstruct(function(){}, [], F) instanceof F);
});
var ARGS_BUG = !fails(function(){
rConstruct(function(){});
});
$export($export.S + $export.F * (NEW_TARGET_BUG || ARGS_BUG), 'Reflect', {
construct: function construct(Target, args /*, newTarget*/){
aFunction(Target);
anObject(args);
var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]);
if(ARGS_BUG && !NEW_TARGET_BUG)return rConstruct(Target, args, newTarget);
if(Target == newTarget){
// w/o altered newTarget, optimization for 0-4 arguments
switch(args.length){
case 0: return new Target;
case 1: return new Target(args[0]);
case 2: return new Target(args[0], args[1]);
case 3: return new Target(args[0], args[1], args[2]);
case 4: return new Target(args[0], args[1], args[2], args[3]);
}
// w/o altered newTarget, lot of arguments case
var $args = [null];
$args.push.apply($args, args);
return new (bind.apply(Target, $args));
}
// with altered newTarget, not support built-in constructors
var proto = newTarget.prototype
, instance = create(isObject(proto) ? proto : Object.prototype)
, result = Function.apply.call(Target, instance, args);
return isObject(result) ? result : instance;
}
});
/***/ },
/* 463 */
/*!**********************************************************!*\
!*** ./~/core-js/modules/es6.reflect.define-property.js ***!
\**********************************************************/
/***/ function(module, exports, __webpack_require__) {
// 26.1.3 Reflect.defineProperty(target, propertyKey, attributes)
var dP = __webpack_require__(/*! ./_object-dp */ 240)
, $export = __webpack_require__(/*! ./_export */ 237)
, anObject = __webpack_require__(/*! ./_an-object */ 241)
, toPrimitive = __webpack_require__(/*! ./_to-primitive */ 245);
// MS Edge has broken Reflect.defineProperty - throwing instead of returning false
$export($export.S + $export.F * __webpack_require__(/*! ./_fails */ 236)(function(){
Reflect.defineProperty(dP.f({}, 1, {value: 1}), 1, {value: 2});
}), 'Reflect', {
defineProperty: function defineProperty(target, propertyKey, attributes){
anObject(target);
propertyKey = toPrimitive(propertyKey, true);
anObject(attributes);
try {
dP.f(target, propertyKey, attributes);
return true;
} catch(e){
return false;
}
}
});
/***/ },
/* 464 */
/*!**********************************************************!*\
!*** ./~/core-js/modules/es6.reflect.delete-property.js ***!
\**********************************************************/
/***/ function(module, exports, __webpack_require__) {
// 26.1.4 Reflect.deleteProperty(target, propertyKey)
var $export = __webpack_require__(/*! ./_export */ 237)
, gOPD = __webpack_require__(/*! ./_object-gopd */ 280).f
, anObject = __webpack_require__(/*! ./_an-object */ 241);
$export($export.S, 'Reflect', {
deleteProperty: function deleteProperty(target, propertyKey){
var desc = gOPD(anObject(target), propertyKey);
return desc && !desc.configurable ? false : delete target[propertyKey];
}
});
/***/ },
/* 465 */
/*!****************************************************!*\
!*** ./~/core-js/modules/es6.reflect.enumerate.js ***!
\****************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
// 26.1.5 Reflect.enumerate(target)
var $export = __webpack_require__(/*! ./_export */ 237)
, anObject = __webpack_require__(/*! ./_an-object */ 241);
var Enumerate = function(iterated){
this._t = anObject(iterated); // target
this._i = 0; // next index
var keys = this._k = [] // keys
, key;
for(key in iterated)keys.push(key);
};
__webpack_require__(/*! ./_iter-create */ 359)(Enumerate, 'Object', function(){
var that = this
, keys = that._k
, key;
do {
if(that._i >= keys.length)return {value: undefined, done: true};
} while(!((key = keys[that._i++]) in that._t));
return {value: key, done: false};
});
$export($export.S, 'Reflect', {
enumerate: function enumerate(target){
return new Enumerate(target);
}
});
/***/ },
/* 466 */
/*!**********************************************!*\
!*** ./~/core-js/modules/es6.reflect.get.js ***!
\**********************************************/
/***/ function(module, exports, __webpack_require__) {
// 26.1.6 Reflect.get(target, propertyKey [, receiver])
var gOPD = __webpack_require__(/*! ./_object-gopd */ 280)
, getPrototypeOf = __webpack_require__(/*! ./_object-gpo */ 288)
, has = __webpack_require__(/*! ./_has */ 234)
, $export = __webpack_require__(/*! ./_export */ 237)
, isObject = __webpack_require__(/*! ./_is-object */ 242)
, anObject = __webpack_require__(/*! ./_an-object */ 241);
function get(target, propertyKey/*, receiver*/){
var receiver = arguments.length < 3 ? target : arguments[2]
, desc, proto;
if(anObject(target) === receiver)return target[propertyKey];
if(desc = gOPD.f(target, propertyKey))return has(desc, 'value')
? desc.value
: desc.get !== undefined
? desc.get.call(receiver)
: undefined;
if(isObject(proto = getPrototypeOf(target)))return get(proto, propertyKey, receiver);
}
$export($export.S, 'Reflect', {get: get});
/***/ },
/* 467 */
/*!**********************************************************************!*\
!*** ./~/core-js/modules/es6.reflect.get-own-property-descriptor.js ***!
\**********************************************************************/
/***/ function(module, exports, __webpack_require__) {
// 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey)
var gOPD = __webpack_require__(/*! ./_object-gopd */ 280)
, $export = __webpack_require__(/*! ./_export */ 237)
, anObject = __webpack_require__(/*! ./_an-object */ 241);
$export($export.S, 'Reflect', {
getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey){
return gOPD.f(anObject(target), propertyKey);
}
});
/***/ },
/* 468 */
/*!***********************************************************!*\
!*** ./~/core-js/modules/es6.reflect.get-prototype-of.js ***!
\***********************************************************/
/***/ function(module, exports, __webpack_require__) {
// 26.1.8 Reflect.getPrototypeOf(target)
var $export = __webpack_require__(/*! ./_export */ 237)
, getProto = __webpack_require__(/*! ./_object-gpo */ 288)
, anObject = __webpack_require__(/*! ./_an-object */ 241);
$export($export.S, 'Reflect', {
getPrototypeOf: function getPrototypeOf(target){
return getProto(anObject(target));
}
});
/***/ },
/* 469 */
/*!**********************************************!*\
!*** ./~/core-js/modules/es6.reflect.has.js ***!
\**********************************************/
/***/ function(module, exports, __webpack_require__) {
// 26.1.9 Reflect.has(target, propertyKey)
var $export = __webpack_require__(/*! ./_export */ 237);
$export($export.S, 'Reflect', {
has: function has(target, propertyKey){
return propertyKey in target;
}
});
/***/ },
/* 470 */
/*!********************************************************!*\
!*** ./~/core-js/modules/es6.reflect.is-extensible.js ***!
\********************************************************/
/***/ function(module, exports, __webpack_require__) {
// 26.1.10 Reflect.isExtensible(target)
var $export = __webpack_require__(/*! ./_export */ 237)
, anObject = __webpack_require__(/*! ./_an-object */ 241)
, $isExtensible = Object.isExtensible;
$export($export.S, 'Reflect', {
isExtensible: function isExtensible(target){
anObject(target);
return $isExtensible ? $isExtensible(target) : true;
}
});
/***/ },
/* 471 */
/*!***************************************************!*\
!*** ./~/core-js/modules/es6.reflect.own-keys.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
// 26.1.11 Reflect.ownKeys(target)
var $export = __webpack_require__(/*! ./_export */ 237);
$export($export.S, 'Reflect', {ownKeys: __webpack_require__(/*! ./_own-keys */ 472)});
/***/ },
/* 472 */
/*!****************************************!*\
!*** ./~/core-js/modules/_own-keys.js ***!
\****************************************/
/***/ function(module, exports, __webpack_require__) {
// all object keys, includes non-enumerable and symbols
var gOPN = __webpack_require__(/*! ./_object-gopn */ 279)
, gOPS = __webpack_require__(/*! ./_object-gops */ 272)
, anObject = __webpack_require__(/*! ./_an-object */ 241)
, Reflect = __webpack_require__(/*! ./_global */ 233).Reflect;
module.exports = Reflect && Reflect.ownKeys || function ownKeys(it){
var keys = gOPN.f(anObject(it))
, getSymbols = gOPS.f;
return getSymbols ? keys.concat(getSymbols(it)) : keys;
};
/***/ },
/* 473 */
/*!*************************************************************!*\
!*** ./~/core-js/modules/es6.reflect.prevent-extensions.js ***!
\*************************************************************/
/***/ function(module, exports, __webpack_require__) {
// 26.1.12 Reflect.preventExtensions(target)
var $export = __webpack_require__(/*! ./_export */ 237)
, anObject = __webpack_require__(/*! ./_an-object */ 241)
, $preventExtensions = Object.preventExtensions;
$export($export.S, 'Reflect', {
preventExtensions: function preventExtensions(target){
anObject(target);
try {
if($preventExtensions)$preventExtensions(target);
return true;
} catch(e){
return false;
}
}
});
/***/ },
/* 474 */
/*!**********************************************!*\
!*** ./~/core-js/modules/es6.reflect.set.js ***!
\**********************************************/
/***/ function(module, exports, __webpack_require__) {
// 26.1.13 Reflect.set(target, propertyKey, V [, receiver])
var dP = __webpack_require__(/*! ./_object-dp */ 240)
, gOPD = __webpack_require__(/*! ./_object-gopd */ 280)
, getPrototypeOf = __webpack_require__(/*! ./_object-gpo */ 288)
, has = __webpack_require__(/*! ./_has */ 234)
, $export = __webpack_require__(/*! ./_export */ 237)
, createDesc = __webpack_require__(/*! ./_property-desc */ 246)
, anObject = __webpack_require__(/*! ./_an-object */ 241)
, isObject = __webpack_require__(/*! ./_is-object */ 242);
function set(target, propertyKey, V/*, receiver*/){
var receiver = arguments.length < 4 ? target : arguments[3]
, ownDesc = gOPD.f(anObject(target), propertyKey)
, existingDescriptor, proto;
if(!ownDesc){
if(isObject(proto = getPrototypeOf(target))){
return set(proto, propertyKey, V, receiver);
}
ownDesc = createDesc(0);
}
if(has(ownDesc, 'value')){
if(ownDesc.writable === false || !isObject(receiver))return false;
existingDescriptor = gOPD.f(receiver, propertyKey) || createDesc(0);
existingDescriptor.value = V;
dP.f(receiver, propertyKey, existingDescriptor);
return true;
}
return ownDesc.set === undefined ? false : (ownDesc.set.call(receiver, V), true);
}
$export($export.S, 'Reflect', {set: set});
/***/ },
/* 475 */
/*!***********************************************************!*\
!*** ./~/core-js/modules/es6.reflect.set-prototype-of.js ***!
\***********************************************************/
/***/ function(module, exports, __webpack_require__) {
// 26.1.14 Reflect.setPrototypeOf(target, proto)
var $export = __webpack_require__(/*! ./_export */ 237)
, setProto = __webpack_require__(/*! ./_set-proto */ 302);
if(setProto)$export($export.S, 'Reflect', {
setPrototypeOf: function setPrototypeOf(target, proto){
setProto.check(target, proto);
try {
setProto.set(target, proto);
return true;
} catch(e){
return false;
}
}
});
/***/ },
/* 476 */
/*!*************************************************!*\
!*** ./~/core-js/modules/es7.array.includes.js ***!
\*************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
// https://github.com/tc39/Array.prototype.includes
var $export = __webpack_require__(/*! ./_export */ 237)
, $includes = __webpack_require__(/*! ./_array-includes */ 265)(true);
$export($export.P, 'Array', {
includes: function includes(el /*, fromIndex = 0 */){
return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
}
});
__webpack_require__(/*! ./_add-to-unscopables */ 415)('includes');
/***/ },
/* 477 */
/*!********************************************!*\
!*** ./~/core-js/modules/es7.string.at.js ***!
\********************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
// https://github.com/mathiasbynens/String.prototype.at
var $export = __webpack_require__(/*! ./_export */ 237)
, $at = __webpack_require__(/*! ./_string-at */ 356)(true);
$export($export.P, 'String', {
at: function at(pos){
return $at(this, pos);
}
});
/***/ },
/* 478 */
/*!***************************************************!*\
!*** ./~/core-js/modules/es7.string.pad-start.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
// https://github.com/tc39/proposal-string-pad-start-end
var $export = __webpack_require__(/*! ./_export */ 237)
, $pad = __webpack_require__(/*! ./_string-pad */ 479);
$export($export.P, 'String', {
padStart: function padStart(maxLength /*, fillString = ' ' */){
return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true);
}
});
/***/ },
/* 479 */
/*!******************************************!*\
!*** ./~/core-js/modules/_string-pad.js ***!
\******************************************/
/***/ function(module, exports, __webpack_require__) {
// https://github.com/tc39/proposal-string-pad-start-end
var toLength = __webpack_require__(/*! ./_to-length */ 266)
, repeat = __webpack_require__(/*! ./_string-repeat */ 320)
, defined = __webpack_require__(/*! ./_defined */ 264);
module.exports = function(that, maxLength, fillString, left){
var S = String(defined(that))
, stringLength = S.length
, fillStr = fillString === undefined ? ' ' : String(fillString)
, intMaxLength = toLength(maxLength);
if(intMaxLength <= stringLength || fillStr == '')return S;
var fillLen = intMaxLength - stringLength
, stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length));
if(stringFiller.length > fillLen)stringFiller = stringFiller.slice(0, fillLen);
return left ? stringFiller + S : S + stringFiller;
};
/***/ },
/* 480 */
/*!*************************************************!*\
!*** ./~/core-js/modules/es7.string.pad-end.js ***!
\*************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
// https://github.com/tc39/proposal-string-pad-start-end
var $export = __webpack_require__(/*! ./_export */ 237)
, $pad = __webpack_require__(/*! ./_string-pad */ 479);
$export($export.P, 'String', {
padEnd: function padEnd(maxLength /*, fillString = ' ' */){
return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false);
}
});
/***/ },
/* 481 */
/*!***************************************************!*\
!*** ./~/core-js/modules/es7.string.trim-left.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
// https://github.com/sebmarkbage/ecmascript-string-left-right-trim
__webpack_require__(/*! ./_string-trim */ 312)('trimLeft', function($trim){
return function trimLeft(){
return $trim(this, 1);
};
}, 'trimStart');
/***/ },
/* 482 */
/*!****************************************************!*\
!*** ./~/core-js/modules/es7.string.trim-right.js ***!
\****************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
// https://github.com/sebmarkbage/ecmascript-string-left-right-trim
__webpack_require__(/*! ./_string-trim */ 312)('trimRight', function($trim){
return function trimRight(){
return $trim(this, 2);
};
}, 'trimEnd');
/***/ },
/* 483 */
/*!***************************************************!*\
!*** ./~/core-js/modules/es7.string.match-all.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
// https://tc39.github.io/String.prototype.matchAll/
var $export = __webpack_require__(/*! ./_export */ 237)
, defined = __webpack_require__(/*! ./_defined */ 264)
, toLength = __webpack_require__(/*! ./_to-length */ 266)
, isRegExp = __webpack_require__(/*! ./_is-regexp */ 363)
, getFlags = __webpack_require__(/*! ./_flags */ 425)
, RegExpProto = RegExp.prototype;
var $RegExpStringIterator = function(regexp, string){
this._r = regexp;
this._s = string;
};
__webpack_require__(/*! ./_iter-create */ 359)($RegExpStringIterator, 'RegExp String', function next(){
var match = this._r.exec(this._s);
return {value: match, done: match === null};
});
$export($export.P, 'String', {
matchAll: function matchAll(regexp){
defined(this);
if(!isRegExp(regexp))throw TypeError(regexp + ' is not a regexp!');
var S = String(this)
, flags = 'flags' in RegExpProto ? String(regexp.flags) : getFlags.call(regexp)
, rx = new RegExp(regexp.source, ~flags.indexOf('g') ? flags : 'g' + flags);
rx.lastIndex = toLength(regexp.lastIndex);
return new $RegExpStringIterator(rx, S);
}
});
/***/ },
/* 484 */
/*!********************************************************!*\
!*** ./~/core-js/modules/es7.symbol.async-iterator.js ***!
\********************************************************/
/***/ function(module, exports, __webpack_require__) {
__webpack_require__(/*! ./_wks-define */ 256)('asyncIterator');
/***/ },
/* 485 */
/*!****************************************************!*\
!*** ./~/core-js/modules/es7.symbol.observable.js ***!
\****************************************************/
/***/ function(module, exports, __webpack_require__) {
__webpack_require__(/*! ./_wks-define */ 256)('observable');
/***/ },
/* 486 */
/*!**********************************************************************!*\
!*** ./~/core-js/modules/es7.object.get-own-property-descriptors.js ***!
\**********************************************************************/
/***/ function(module, exports, __webpack_require__) {
// https://github.com/tc39/proposal-object-getownpropertydescriptors
var $export = __webpack_require__(/*! ./_export */ 237)
, ownKeys = __webpack_require__(/*! ./_own-keys */ 472)
, toIObject = __webpack_require__(/*! ./_to-iobject */ 261)
, gOPD = __webpack_require__(/*! ./_object-gopd */ 280)
, createProperty = __webpack_require__(/*! ./_create-property */ 392);
$export($export.S, 'Object', {
getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object){
var O = toIObject(object)
, getDesc = gOPD.f
, keys = ownKeys(O)
, result = {}
, i = 0
, key;
while(keys.length > i)createProperty(result, key = keys[i++], getDesc(O, key));
return result;
}
});
/***/ },
/* 487 */
/*!************************************************!*\
!*** ./~/core-js/modules/es7.object.values.js ***!
\************************************************/
/***/ function(module, exports, __webpack_require__) {
// https://github.com/tc39/proposal-object-values-entries
var $export = __webpack_require__(/*! ./_export */ 237)
, $values = __webpack_require__(/*! ./_object-to-array */ 488)(false);
$export($export.S, 'Object', {
values: function values(it){
return $values(it);
}
});
/***/ },
/* 488 */
/*!***********************************************!*\
!*** ./~/core-js/modules/_object-to-array.js ***!
\***********************************************/
/***/ function(module, exports, __webpack_require__) {
var getKeys = __webpack_require__(/*! ./_object-keys */ 259)
, toIObject = __webpack_require__(/*! ./_to-iobject */ 261)
, isEnum = __webpack_require__(/*! ./_object-pie */ 273).f;
module.exports = function(isEntries){
return function(it){
var O = toIObject(it)
, keys = getKeys(O)
, length = keys.length
, i = 0
, result = []
, key;
while(length > i)if(isEnum.call(O, key = keys[i++])){
result.push(isEntries ? [key, O[key]] : O[key]);
} return result;
};
};
/***/ },
/* 489 */
/*!*************************************************!*\
!*** ./~/core-js/modules/es7.object.entries.js ***!
\*************************************************/
/***/ function(module, exports, __webpack_require__) {
// https://github.com/tc39/proposal-object-values-entries
var $export = __webpack_require__(/*! ./_export */ 237)
, $entries = __webpack_require__(/*! ./_object-to-array */ 488)(true);
$export($export.S, 'Object', {
entries: function entries(it){
return $entries(it);
}
});
/***/ },
/* 490 */
/*!*******************************************************!*\
!*** ./~/core-js/modules/es7.object.define-getter.js ***!
\*******************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(/*! ./_export */ 237)
, toObject = __webpack_require__(/*! ./_to-object */ 287)
, aFunction = __webpack_require__(/*! ./_a-function */ 250)
, $defineProperty = __webpack_require__(/*! ./_object-dp */ 240);
// B.2.2.2 Object.prototype.__defineGetter__(P, getter)
__webpack_require__(/*! ./_descriptors */ 235) && $export($export.P + __webpack_require__(/*! ./_object-forced-pam */ 491), 'Object', {
__defineGetter__: function __defineGetter__(P, getter){
$defineProperty.f(toObject(this), P, {get: aFunction(getter), enumerable: true, configurable: true});
}
});
/***/ },
/* 491 */
/*!*************************************************!*\
!*** ./~/core-js/modules/_object-forced-pam.js ***!
\*************************************************/
/***/ function(module, exports, __webpack_require__) {
// Forced replacement prototype accessors methods
module.exports = __webpack_require__(/*! ./_library */ 257)|| !__webpack_require__(/*! ./_fails */ 236)(function(){
var K = Math.random();
// In FF throws only define methods
__defineSetter__.call(null, K, function(){ /* empty */});
delete __webpack_require__(/*! ./_global */ 233)[K];
});
/***/ },
/* 492 */
/*!*******************************************************!*\
!*** ./~/core-js/modules/es7.object.define-setter.js ***!
\*******************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(/*! ./_export */ 237)
, toObject = __webpack_require__(/*! ./_to-object */ 287)
, aFunction = __webpack_require__(/*! ./_a-function */ 250)
, $defineProperty = __webpack_require__(/*! ./_object-dp */ 240);
// B.2.2.3 Object.prototype.__defineSetter__(P, setter)
__webpack_require__(/*! ./_descriptors */ 235) && $export($export.P + __webpack_require__(/*! ./_object-forced-pam */ 491), 'Object', {
__defineSetter__: function __defineSetter__(P, setter){
$defineProperty.f(toObject(this), P, {set: aFunction(setter), enumerable: true, configurable: true});
}
});
/***/ },
/* 493 */
/*!*******************************************************!*\
!*** ./~/core-js/modules/es7.object.lookup-getter.js ***!
\*******************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(/*! ./_export */ 237)
, toObject = __webpack_require__(/*! ./_to-object */ 287)
, toPrimitive = __webpack_require__(/*! ./_to-primitive */ 245)
, getPrototypeOf = __webpack_require__(/*! ./_object-gpo */ 288)
, getOwnPropertyDescriptor = __webpack_require__(/*! ./_object-gopd */ 280).f;
// B.2.2.4 Object.prototype.__lookupGetter__(P)
__webpack_require__(/*! ./_descriptors */ 235) && $export($export.P + __webpack_require__(/*! ./_object-forced-pam */ 491), 'Object', {
__lookupGetter__: function __lookupGetter__(P){
var O = toObject(this)
, K = toPrimitive(P, true)
, D;
do {
if(D = getOwnPropertyDescriptor(O, K))return D.get;
} while(O = getPrototypeOf(O));
}
});
/***/ },
/* 494 */
/*!*******************************************************!*\
!*** ./~/core-js/modules/es7.object.lookup-setter.js ***!
\*******************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
var $export = __webpack_require__(/*! ./_export */ 237)
, toObject = __webpack_require__(/*! ./_to-object */ 287)
, toPrimitive = __webpack_require__(/*! ./_to-primitive */ 245)
, getPrototypeOf = __webpack_require__(/*! ./_object-gpo */ 288)
, getOwnPropertyDescriptor = __webpack_require__(/*! ./_object-gopd */ 280).f;
// B.2.2.5 Object.prototype.__lookupSetter__(P)
__webpack_require__(/*! ./_descriptors */ 235) && $export($export.P + __webpack_require__(/*! ./_object-forced-pam */ 491), 'Object', {
__lookupSetter__: function __lookupSetter__(P){
var O = toObject(this)
, K = toPrimitive(P, true)
, D;
do {
if(D = getOwnPropertyDescriptor(O, K))return D.set;
} while(O = getPrototypeOf(O));
}
});
/***/ },
/* 495 */
/*!**********************************************!*\
!*** ./~/core-js/modules/es7.map.to-json.js ***!
\**********************************************/
/***/ function(module, exports, __webpack_require__) {
// https://github.com/DavidBruant/Map-Set.prototype.toJSON
var $export = __webpack_require__(/*! ./_export */ 237);
$export($export.P + $export.R, 'Map', {toJSON: __webpack_require__(/*! ./_collection-to-json */ 496)('Map')});
/***/ },
/* 496 */
/*!**************************************************!*\
!*** ./~/core-js/modules/_collection-to-json.js ***!
\**************************************************/
/***/ function(module, exports, __webpack_require__) {
// https://github.com/DavidBruant/Map-Set.prototype.toJSON
var classof = __webpack_require__(/*! ./_classof */ 304)
, from = __webpack_require__(/*! ./_array-from-iterable */ 497);
module.exports = function(NAME){
return function toJSON(){
if(classof(this) != NAME)throw TypeError(NAME + "#toJSON isn't generic");
return from(this);
};
};
/***/ },
/* 497 */
/*!***************************************************!*\
!*** ./~/core-js/modules/_array-from-iterable.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
var forOf = __webpack_require__(/*! ./_for-of */ 435);
module.exports = function(iter, ITERATOR){
var result = [];
forOf(iter, false, result.push, result, ITERATOR);
return result;
};
/***/ },
/* 498 */
/*!**********************************************!*\
!*** ./~/core-js/modules/es7.set.to-json.js ***!
\**********************************************/
/***/ function(module, exports, __webpack_require__) {
// https://github.com/DavidBruant/Map-Set.prototype.toJSON
var $export = __webpack_require__(/*! ./_export */ 237);
$export($export.P + $export.R, 'Set', {toJSON: __webpack_require__(/*! ./_collection-to-json */ 496)('Set')});
/***/ },
/* 499 */
/*!************************************************!*\
!*** ./~/core-js/modules/es7.system.global.js ***!
\************************************************/
/***/ function(module, exports, __webpack_require__) {
// https://github.com/ljharb/proposal-global
var $export = __webpack_require__(/*! ./_export */ 237);
$export($export.S, 'System', {global: __webpack_require__(/*! ./_global */ 233)});
/***/ },
/* 500 */
/*!*************************************************!*\
!*** ./~/core-js/modules/es7.error.is-error.js ***!
\*************************************************/
/***/ function(module, exports, __webpack_require__) {
// https://github.com/ljharb/proposal-is-error
var $export = __webpack_require__(/*! ./_export */ 237)
, cof = __webpack_require__(/*! ./_cof */ 263);
$export($export.S, 'Error', {
isError: function isError(it){
return cof(it) === 'Error';
}
});
/***/ },
/* 501 */
/*!*********************************************!*\
!*** ./~/core-js/modules/es7.math.iaddh.js ***!
\*********************************************/
/***/ function(module, exports, __webpack_require__) {
// https://gist.github.com/BrendanEich/4294d5c212a6d2254703
var $export = __webpack_require__(/*! ./_export */ 237);
$export($export.S, 'Math', {
iaddh: function iaddh(x0, x1, y0, y1){
var $x0 = x0 >>> 0
, $x1 = x1 >>> 0
, $y0 = y0 >>> 0;
return $x1 + (y1 >>> 0) + (($x0 & $y0 | ($x0 | $y0) & ~($x0 + $y0 >>> 0)) >>> 31) | 0;
}
});
/***/ },
/* 502 */
/*!*********************************************!*\
!*** ./~/core-js/modules/es7.math.isubh.js ***!
\*********************************************/
/***/ function(module, exports, __webpack_require__) {
// https://gist.github.com/BrendanEich/4294d5c212a6d2254703
var $export = __webpack_require__(/*! ./_export */ 237);
$export($export.S, 'Math', {
isubh: function isubh(x0, x1, y0, y1){
var $x0 = x0 >>> 0
, $x1 = x1 >>> 0
, $y0 = y0 >>> 0;
return $x1 - (y1 >>> 0) - ((~$x0 & $y0 | ~($x0 ^ $y0) & $x0 - $y0 >>> 0) >>> 31) | 0;
}
});
/***/ },
/* 503 */
/*!*********************************************!*\
!*** ./~/core-js/modules/es7.math.imulh.js ***!
\*********************************************/
/***/ function(module, exports, __webpack_require__) {
// https://gist.github.com/BrendanEich/4294d5c212a6d2254703
var $export = __webpack_require__(/*! ./_export */ 237);
$export($export.S, 'Math', {
imulh: function imulh(u, v){
var UINT16 = 0xffff
, $u = +u
, $v = +v
, u0 = $u & UINT16
, v0 = $v & UINT16
, u1 = $u >> 16
, v1 = $v >> 16
, t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16);
return u1 * v1 + (t >> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >> 16);
}
});
/***/ },
/* 504 */
/*!*********************************************!*\
!*** ./~/core-js/modules/es7.math.umulh.js ***!
\*********************************************/
/***/ function(module, exports, __webpack_require__) {
// https://gist.github.com/BrendanEich/4294d5c212a6d2254703
var $export = __webpack_require__(/*! ./_export */ 237);
$export($export.S, 'Math', {
umulh: function umulh(u, v){
var UINT16 = 0xffff
, $u = +u
, $v = +v
, u0 = $u & UINT16
, v0 = $v & UINT16
, u1 = $u >>> 16
, v1 = $v >>> 16
, t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16);
return u1 * v1 + (t >>> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >>> 16);
}
});
/***/ },
/* 505 */
/*!**********************************************************!*\
!*** ./~/core-js/modules/es7.reflect.define-metadata.js ***!
\**********************************************************/
/***/ function(module, exports, __webpack_require__) {
var metadata = __webpack_require__(/*! ./_metadata */ 506)
, anObject = __webpack_require__(/*! ./_an-object */ 241)
, toMetaKey = metadata.key
, ordinaryDefineOwnMetadata = metadata.set;
metadata.exp({defineMetadata: function defineMetadata(metadataKey, metadataValue, target, targetKey){
ordinaryDefineOwnMetadata(metadataKey, metadataValue, anObject(target), toMetaKey(targetKey));
}});
/***/ },
/* 506 */
/*!****************************************!*\
!*** ./~/core-js/modules/_metadata.js ***!
\****************************************/
/***/ function(module, exports, __webpack_require__) {
var Map = __webpack_require__(/*! ./es6.map */ 440)
, $export = __webpack_require__(/*! ./_export */ 237)
, shared = __webpack_require__(/*! ./_shared */ 252)('metadata')
, store = shared.store || (shared.store = new (__webpack_require__(/*! ./es6.weak-map */ 444)));
var getOrCreateMetadataMap = function(target, targetKey, create){
var targetMetadata = store.get(target);
if(!targetMetadata){
if(!create)return undefined;
store.set(target, targetMetadata = new Map);
}
var keyMetadata = targetMetadata.get(targetKey);
if(!keyMetadata){
if(!create)return undefined;
targetMetadata.set(targetKey, keyMetadata = new Map);
} return keyMetadata;
};
var ordinaryHasOwnMetadata = function(MetadataKey, O, P){
var metadataMap = getOrCreateMetadataMap(O, P, false);
return metadataMap === undefined ? false : metadataMap.has(MetadataKey);
};
var ordinaryGetOwnMetadata = function(MetadataKey, O, P){
var metadataMap = getOrCreateMetadataMap(O, P, false);
return metadataMap === undefined ? undefined : metadataMap.get(MetadataKey);
};
var ordinaryDefineOwnMetadata = function(MetadataKey, MetadataValue, O, P){
getOrCreateMetadataMap(O, P, true).set(MetadataKey, MetadataValue);
};
var ordinaryOwnMetadataKeys = function(target, targetKey){
var metadataMap = getOrCreateMetadataMap(target, targetKey, false)
, keys = [];
if(metadataMap)metadataMap.forEach(function(_, key){ keys.push(key); });
return keys;
};
var toMetaKey = function(it){
return it === undefined || typeof it == 'symbol' ? it : String(it);
};
var exp = function(O){
$export($export.S, 'Reflect', O);
};
module.exports = {
store: store,
map: getOrCreateMetadataMap,
has: ordinaryHasOwnMetadata,
get: ordinaryGetOwnMetadata,
set: ordinaryDefineOwnMetadata,
keys: ordinaryOwnMetadataKeys,
key: toMetaKey,
exp: exp
};
/***/ },
/* 507 */
/*!**********************************************************!*\
!*** ./~/core-js/modules/es7.reflect.delete-metadata.js ***!
\**********************************************************/
/***/ function(module, exports, __webpack_require__) {
var metadata = __webpack_require__(/*! ./_metadata */ 506)
, anObject = __webpack_require__(/*! ./_an-object */ 241)
, toMetaKey = metadata.key
, getOrCreateMetadataMap = metadata.map
, store = metadata.store;
metadata.exp({deleteMetadata: function deleteMetadata(metadataKey, target /*, targetKey */){
var targetKey = arguments.length < 3 ? undefined : toMetaKey(arguments[2])
, metadataMap = getOrCreateMetadataMap(anObject(target), targetKey, false);
if(metadataMap === undefined || !metadataMap['delete'](metadataKey))return false;
if(metadataMap.size)return true;
var targetMetadata = store.get(target);
targetMetadata['delete'](targetKey);
return !!targetMetadata.size || store['delete'](target);
}});
/***/ },
/* 508 */
/*!*******************************************************!*\
!*** ./~/core-js/modules/es7.reflect.get-metadata.js ***!
\*******************************************************/
/***/ function(module, exports, __webpack_require__) {
var metadata = __webpack_require__(/*! ./_metadata */ 506)
, anObject = __webpack_require__(/*! ./_an-object */ 241)
, getPrototypeOf = __webpack_require__(/*! ./_object-gpo */ 288)
, ordinaryHasOwnMetadata = metadata.has
, ordinaryGetOwnMetadata = metadata.get
, toMetaKey = metadata.key;
var ordinaryGetMetadata = function(MetadataKey, O, P){
var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P);
if(hasOwn)return ordinaryGetOwnMetadata(MetadataKey, O, P);
var parent = getPrototypeOf(O);
return parent !== null ? ordinaryGetMetadata(MetadataKey, parent, P) : undefined;
};
metadata.exp({getMetadata: function getMetadata(metadataKey, target /*, targetKey */){
return ordinaryGetMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2]));
}});
/***/ },
/* 509 */
/*!************************************************************!*\
!*** ./~/core-js/modules/es7.reflect.get-metadata-keys.js ***!
\************************************************************/
/***/ function(module, exports, __webpack_require__) {
var Set = __webpack_require__(/*! ./es6.set */ 443)
, from = __webpack_require__(/*! ./_array-from-iterable */ 497)
, metadata = __webpack_require__(/*! ./_metadata */ 506)
, anObject = __webpack_require__(/*! ./_an-object */ 241)
, getPrototypeOf = __webpack_require__(/*! ./_object-gpo */ 288)
, ordinaryOwnMetadataKeys = metadata.keys
, toMetaKey = metadata.key;
var ordinaryMetadataKeys = function(O, P){
var oKeys = ordinaryOwnMetadataKeys(O, P)
, parent = getPrototypeOf(O);
if(parent === null)return oKeys;
var pKeys = ordinaryMetadataKeys(parent, P);
return pKeys.length ? oKeys.length ? from(new Set(oKeys.concat(pKeys))) : pKeys : oKeys;
};
metadata.exp({getMetadataKeys: function getMetadataKeys(target /*, targetKey */){
return ordinaryMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1]));
}});
/***/ },
/* 510 */
/*!***********************************************************!*\
!*** ./~/core-js/modules/es7.reflect.get-own-metadata.js ***!
\***********************************************************/
/***/ function(module, exports, __webpack_require__) {
var metadata = __webpack_require__(/*! ./_metadata */ 506)
, anObject = __webpack_require__(/*! ./_an-object */ 241)
, ordinaryGetOwnMetadata = metadata.get
, toMetaKey = metadata.key;
metadata.exp({getOwnMetadata: function getOwnMetadata(metadataKey, target /*, targetKey */){
return ordinaryGetOwnMetadata(metadataKey, anObject(target)
, arguments.length < 3 ? undefined : toMetaKey(arguments[2]));
}});
/***/ },
/* 511 */
/*!****************************************************************!*\
!*** ./~/core-js/modules/es7.reflect.get-own-metadata-keys.js ***!
\****************************************************************/
/***/ function(module, exports, __webpack_require__) {
var metadata = __webpack_require__(/*! ./_metadata */ 506)
, anObject = __webpack_require__(/*! ./_an-object */ 241)
, ordinaryOwnMetadataKeys = metadata.keys
, toMetaKey = metadata.key;
metadata.exp({getOwnMetadataKeys: function getOwnMetadataKeys(target /*, targetKey */){
return ordinaryOwnMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1]));
}});
/***/ },
/* 512 */
/*!*******************************************************!*\
!*** ./~/core-js/modules/es7.reflect.has-metadata.js ***!
\*******************************************************/
/***/ function(module, exports, __webpack_require__) {
var metadata = __webpack_require__(/*! ./_metadata */ 506)
, anObject = __webpack_require__(/*! ./_an-object */ 241)
, getPrototypeOf = __webpack_require__(/*! ./_object-gpo */ 288)
, ordinaryHasOwnMetadata = metadata.has
, toMetaKey = metadata.key;
var ordinaryHasMetadata = function(MetadataKey, O, P){
var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P);
if(hasOwn)return true;
var parent = getPrototypeOf(O);
return parent !== null ? ordinaryHasMetadata(MetadataKey, parent, P) : false;
};
metadata.exp({hasMetadata: function hasMetadata(metadataKey, target /*, targetKey */){
return ordinaryHasMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2]));
}});
/***/ },
/* 513 */
/*!***********************************************************!*\
!*** ./~/core-js/modules/es7.reflect.has-own-metadata.js ***!
\***********************************************************/
/***/ function(module, exports, __webpack_require__) {
var metadata = __webpack_require__(/*! ./_metadata */ 506)
, anObject = __webpack_require__(/*! ./_an-object */ 241)
, ordinaryHasOwnMetadata = metadata.has
, toMetaKey = metadata.key;
metadata.exp({hasOwnMetadata: function hasOwnMetadata(metadataKey, target /*, targetKey */){
return ordinaryHasOwnMetadata(metadataKey, anObject(target)
, arguments.length < 3 ? undefined : toMetaKey(arguments[2]));
}});
/***/ },
/* 514 */
/*!***************************************************!*\
!*** ./~/core-js/modules/es7.reflect.metadata.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
var metadata = __webpack_require__(/*! ./_metadata */ 506)
, anObject = __webpack_require__(/*! ./_an-object */ 241)
, aFunction = __webpack_require__(/*! ./_a-function */ 250)
, toMetaKey = metadata.key
, ordinaryDefineOwnMetadata = metadata.set;
metadata.exp({metadata: function metadata(metadataKey, metadataValue){
return function decorator(target, targetKey){
ordinaryDefineOwnMetadata(
metadataKey, metadataValue,
(targetKey !== undefined ? anObject : aFunction)(target),
toMetaKey(targetKey)
);
};
}});
/***/ },
/* 515 */
/*!***************************************!*\
!*** ./~/core-js/modules/es7.asap.js ***!
\***************************************/
/***/ function(module, exports, __webpack_require__) {
// https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-09/sept-25.md#510-globalasap-for-enqueuing-a-microtask
var $export = __webpack_require__(/*! ./_export */ 237)
, microtask = __webpack_require__(/*! ./_microtask */ 438)()
, process = __webpack_require__(/*! ./_global */ 233).process
, isNode = __webpack_require__(/*! ./_cof */ 263)(process) == 'process';
$export($export.G, {
asap: function asap(fn){
var domain = isNode && process.domain;
microtask(domain ? domain.bind(fn) : fn);
}
});
/***/ },
/* 516 */
/*!*********************************************!*\
!*** ./~/core-js/modules/es7.observable.js ***!
\*********************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
// https://github.com/zenparsing/es-observable
var $export = __webpack_require__(/*! ./_export */ 237)
, global = __webpack_require__(/*! ./_global */ 233)
, core = __webpack_require__(/*! ./_core */ 238)
, microtask = __webpack_require__(/*! ./_microtask */ 438)()
, OBSERVABLE = __webpack_require__(/*! ./_wks */ 254)('observable')
, aFunction = __webpack_require__(/*! ./_a-function */ 250)
, anObject = __webpack_require__(/*! ./_an-object */ 241)
, anInstance = __webpack_require__(/*! ./_an-instance */ 434)
, redefineAll = __webpack_require__(/*! ./_redefine-all */ 439)
, hide = __webpack_require__(/*! ./_hide */ 239)
, forOf = __webpack_require__(/*! ./_for-of */ 435)
, RETURN = forOf.RETURN;
var getMethod = function(fn){
return fn == null ? undefined : aFunction(fn);
};
var cleanupSubscription = function(subscription){
var cleanup = subscription._c;
if(cleanup){
subscription._c = undefined;
cleanup();
}
};
var subscriptionClosed = function(subscription){
return subscription._o === undefined;
};
var closeSubscription = function(subscription){
if(!subscriptionClosed(subscription)){
subscription._o = undefined;
cleanupSubscription(subscription);
}
};
var Subscription = function(observer, subscriber){
anObject(observer);
this._c = undefined;
this._o = observer;
observer = new SubscriptionObserver(this);
try {
var cleanup = subscriber(observer)
, subscription = cleanup;
if(cleanup != null){
if(typeof cleanup.unsubscribe === 'function')cleanup = function(){ subscription.unsubscribe(); };
else aFunction(cleanup);
this._c = cleanup;
}
} catch(e){
observer.error(e);
return;
} if(subscriptionClosed(this))cleanupSubscription(this);
};
Subscription.prototype = redefineAll({}, {
unsubscribe: function unsubscribe(){ closeSubscription(this); }
});
var SubscriptionObserver = function(subscription){
this._s = subscription;
};
SubscriptionObserver.prototype = redefineAll({}, {
next: function next(value){
var subscription = this._s;
if(!subscriptionClosed(subscription)){
var observer = subscription._o;
try {
var m = getMethod(observer.next);
if(m)return m.call(observer, value);
} catch(e){
try {
closeSubscription(subscription);
} finally {
throw e;
}
}
}
},
error: function error(value){
var subscription = this._s;
if(subscriptionClosed(subscription))throw value;
var observer = subscription._o;
subscription._o = undefined;
try {
var m = getMethod(observer.error);
if(!m)throw value;
value = m.call(observer, value);
} catch(e){
try {
cleanupSubscription(subscription);
} finally {
throw e;
}
} cleanupSubscription(subscription);
return value;
},
complete: function complete(value){
var subscription = this._s;
if(!subscriptionClosed(subscription)){
var observer = subscription._o;
subscription._o = undefined;
try {
var m = getMethod(observer.complete);
value = m ? m.call(observer, value) : undefined;
} catch(e){
try {
cleanupSubscription(subscription);
} finally {
throw e;
}
} cleanupSubscription(subscription);
return value;
}
}
});
var $Observable = function Observable(subscriber){
anInstance(this, $Observable, 'Observable', '_f')._f = aFunction(subscriber);
};
redefineAll($Observable.prototype, {
subscribe: function subscribe(observer){
return new Subscription(observer, this._f);
},
forEach: function forEach(fn){
var that = this;
return new (core.Promise || global.Promise)(function(resolve, reject){
aFunction(fn);
var subscription = that.subscribe({
next : function(value){
try {
return fn(value);
} catch(e){
reject(e);
subscription.unsubscribe();
}
},
error: reject,
complete: resolve
});
});
}
});
redefineAll($Observable, {
from: function from(x){
var C = typeof this === 'function' ? this : $Observable;
var method = getMethod(anObject(x)[OBSERVABLE]);
if(method){
var observable = anObject(method.call(x));
return observable.constructor === C ? observable : new C(function(observer){
return observable.subscribe(observer);
});
}
return new C(function(observer){
var done = false;
microtask(function(){
if(!done){
try {
if(forOf(x, false, function(it){
observer.next(it);
if(done)return RETURN;
}) === RETURN)return;
} catch(e){
if(done)throw e;
observer.error(e);
return;
} observer.complete();
}
});
return function(){ done = true; };
});
},
of: function of(){
for(var i = 0, l = arguments.length, items = Array(l); i < l;)items[i] = arguments[i++];
return new (typeof this === 'function' ? this : $Observable)(function(observer){
var done = false;
microtask(function(){
if(!done){
for(var i = 0; i < items.length; ++i){
observer.next(items[i]);
if(done)return;
} observer.complete();
}
});
return function(){ done = true; };
});
}
});
hide($Observable.prototype, OBSERVABLE, function(){ return this; });
$export($export.G, {Observable: $Observable});
__webpack_require__(/*! ./_set-species */ 421)('Observable');
/***/ },
/* 517 */
/*!*****************************************!*\
!*** ./~/core-js/modules/web.timers.js ***!
\*****************************************/
/***/ function(module, exports, __webpack_require__) {
// ie9- setTimeout & setInterval additional parameters fix
var global = __webpack_require__(/*! ./_global */ 233)
, $export = __webpack_require__(/*! ./_export */ 237)
, invoke = __webpack_require__(/*! ./_invoke */ 307)
, partial = __webpack_require__(/*! ./_partial */ 518)
, navigator = global.navigator
, MSIE = !!navigator && /MSIE .\./.test(navigator.userAgent); // <- dirty ie9- check
var wrap = function(set){
return MSIE ? function(fn, time /*, ...args */){
return set(invoke(
partial,
[].slice.call(arguments, 2),
typeof fn == 'function' ? fn : Function(fn)
), time);
} : set;
};
$export($export.G + $export.B + $export.F * MSIE, {
setTimeout: wrap(global.setTimeout),
setInterval: wrap(global.setInterval)
});
/***/ },
/* 518 */
/*!***************************************!*\
!*** ./~/core-js/modules/_partial.js ***!
\***************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
var path = __webpack_require__(/*! ./_path */ 519)
, invoke = __webpack_require__(/*! ./_invoke */ 307)
, aFunction = __webpack_require__(/*! ./_a-function */ 250);
module.exports = function(/* ...pargs */){
var fn = aFunction(this)
, length = arguments.length
, pargs = Array(length)
, i = 0
, _ = path._
, holder = false;
while(length > i)if((pargs[i] = arguments[i++]) === _)holder = true;
return function(/* ...args */){
var that = this
, aLen = arguments.length
, j = 0, k = 0, args;
if(!holder && !aLen)return invoke(fn, pargs, that);
args = pargs.slice();
if(holder)for(;length > j; j++)if(args[j] === _)args[j] = arguments[k++];
while(aLen > k)args.push(arguments[k++]);
return invoke(fn, args, that);
};
};
/***/ },
/* 519 */
/*!************************************!*\
!*** ./~/core-js/modules/_path.js ***!
\************************************/
/***/ function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(/*! ./_global */ 233);
/***/ },
/* 520 */
/*!********************************************!*\
!*** ./~/core-js/modules/web.immediate.js ***!
\********************************************/
/***/ function(module, exports, __webpack_require__) {
var $export = __webpack_require__(/*! ./_export */ 237)
, $task = __webpack_require__(/*! ./_task */ 437);
$export($export.G + $export.B, {
setImmediate: $task.set,
clearImmediate: $task.clear
});
/***/ },
/* 521 */
/*!***********************************************!*\
!*** ./~/core-js/modules/web.dom.iterable.js ***!
\***********************************************/
/***/ function(module, exports, __webpack_require__) {
var $iterators = __webpack_require__(/*! ./es6.array.iterator */ 422)
, redefine = __webpack_require__(/*! ./_redefine */ 247)
, global = __webpack_require__(/*! ./_global */ 233)
, hide = __webpack_require__(/*! ./_hide */ 239)
, Iterators = __webpack_require__(/*! ./_iterators */ 358)
, wks = __webpack_require__(/*! ./_wks */ 254)
, ITERATOR = wks('iterator')
, TO_STRING_TAG = wks('toStringTag')
, ArrayValues = Iterators.Array;
for(var collections = ['NodeList', 'DOMTokenList', 'MediaList', 'StyleSheetList', 'CSSRuleList'], i = 0; i < 5; i++){
var NAME = collections[i]
, Collection = global[NAME]
, proto = Collection && Collection.prototype
, key;
if(proto){
if(!proto[ITERATOR])hide(proto, ITERATOR, ArrayValues);
if(!proto[TO_STRING_TAG])hide(proto, TO_STRING_TAG, NAME);
Iterators[NAME] = ArrayValues;
for(key in $iterators)if(!proto[key])redefine(proto, key, $iterators[key], true);
}
}
/***/ },
/* 522 */
/*!******************************************!*\
!*** ./~/regenerator-runtime/runtime.js ***!
\******************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global, process) {/**
* Copyright (c) 2014, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* https://raw.github.com/facebook/regenerator/master/LICENSE file. An
* additional grant of patent rights can be found in the PATENTS file in
* the same directory.
*/
!(function(global) {
"use strict";
var Op = Object.prototype;
var hasOwn = Op.hasOwnProperty;
var undefined; // More compressible than void 0.
var $Symbol = typeof Symbol === "function" ? Symbol : {};
var iteratorSymbol = $Symbol.iterator || "@@iterator";
var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
var inModule = typeof module === "object";
var runtime = global.regeneratorRuntime;
if (runtime) {
if (inModule) {
// If regeneratorRuntime is defined globally and we're in a module,
// make the exports object identical to regeneratorRuntime.
module.exports = runtime;
}
// Don't bother evaluating the rest of this file if the runtime was
// already defined globally.
return;
}
// Define the runtime globally (as expected by generated code) as either
// module.exports (if we're in a module) or a new, empty object.
runtime = global.regeneratorRuntime = inModule ? module.exports : {};
function wrap(innerFn, outerFn, self, tryLocsList) {
// If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
var generator = Object.create(protoGenerator.prototype);
var context = new Context(tryLocsList || []);
// The ._invoke method unifies the implementations of the .next,
// .throw, and .return methods.
generator._invoke = makeInvokeMethod(innerFn, self, context);
return generator;
}
runtime.wrap = wrap;
// Try/catch helper to minimize deoptimizations. Returns a completion
// record like context.tryEntries[i].completion. This interface could
// have been (and was previously) designed to take a closure to be
// invoked without arguments, but in all the cases we care about we
// already have an existing method we want to call, so there's no need
// to create a new function object. We can even get away with assuming
// the method takes exactly one argument, since that happens to be true
// in every case, so we don't have to touch the arguments object. The
// only additional allocation required is the completion record, which
// has a stable shape and so hopefully should be cheap to allocate.
function tryCatch(fn, obj, arg) {
try {
return { type: "normal", arg: fn.call(obj, arg) };
} catch (err) {
return { type: "throw", arg: err };
}
}
var GenStateSuspendedStart = "suspendedStart";
var GenStateSuspendedYield = "suspendedYield";
var GenStateExecuting = "executing";
var GenStateCompleted = "completed";
// Returning this object from the innerFn has the same effect as
// breaking out of the dispatch switch statement.
var ContinueSentinel = {};
// Dummy constructor functions that we use as the .constructor and
// .constructor.prototype properties for functions that return Generator
// objects. For full spec compliance, you may wish to configure your
// minifier not to mangle the names of these two functions.
function Generator() {}
function GeneratorFunction() {}
function GeneratorFunctionPrototype() {}
// This is a polyfill for %IteratorPrototype% for environments that
// don't natively support it.
var IteratorPrototype = {};
IteratorPrototype[iteratorSymbol] = function () {
return this;
};
var getProto = Object.getPrototypeOf;
var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
if (NativeIteratorPrototype &&
NativeIteratorPrototype !== Op &&
hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
// This environment has a native %IteratorPrototype%; use it instead
// of the polyfill.
IteratorPrototype = NativeIteratorPrototype;
}
var Gp = GeneratorFunctionPrototype.prototype =
Generator.prototype = Object.create(IteratorPrototype);
GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
GeneratorFunctionPrototype.constructor = GeneratorFunction;
GeneratorFunctionPrototype[toStringTagSymbol] =
GeneratorFunction.displayName = "GeneratorFunction";
// Helper for defining the .next, .throw, and .return methods of the
// Iterator interface in terms of a single ._invoke method.
function defineIteratorMethods(prototype) {
["next", "throw", "return"].forEach(function(method) {
prototype[method] = function(arg) {
return this._invoke(method, arg);
};
});
}
runtime.isGeneratorFunction = function(genFun) {
var ctor = typeof genFun === "function" && genFun.constructor;
return ctor
? ctor === GeneratorFunction ||
// For the native GeneratorFunction constructor, the best we can
// do is to check its .name property.
(ctor.displayName || ctor.name) === "GeneratorFunction"
: false;
};
runtime.mark = function(genFun) {
if (Object.setPrototypeOf) {
Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
} else {
genFun.__proto__ = GeneratorFunctionPrototype;
if (!(toStringTagSymbol in genFun)) {
genFun[toStringTagSymbol] = "GeneratorFunction";
}
}
genFun.prototype = Object.create(Gp);
return genFun;
};
// Within the body of any async function, `await x` is transformed to
// `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
// `hasOwn.call(value, "__await")` to determine if the yielded value is
// meant to be awaited.
runtime.awrap = function(arg) {
return { __await: arg };
};
function AsyncIterator(generator) {
function invoke(method, arg, resolve, reject) {
var record = tryCatch(generator[method], generator, arg);
if (record.type === "throw") {
reject(record.arg);
} else {
var result = record.arg;
var value = result.value;
if (value &&
typeof value === "object" &&
hasOwn.call(value, "__await")) {
return Promise.resolve(value.__await).then(function(value) {
invoke("next", value, resolve, reject);
}, function(err) {
invoke("throw", err, resolve, reject);
});
}
return Promise.resolve(value).then(function(unwrapped) {
// When a yielded Promise is resolved, its final value becomes
// the .value of the Promise<{value,done}> result for the
// current iteration. If the Promise is rejected, however, the
// result for this iteration will be rejected with the same
// reason. Note that rejections of yielded Promises are not
// thrown back into the generator function, as is the case
// when an awaited Promise is rejected. This difference in
// behavior between yield and await is important, because it
// allows the consumer to decide what to do with the yielded
// rejection (swallow it and continue, manually .throw it back
// into the generator, abandon iteration, whatever). With
// await, by contrast, there is no opportunity to examine the
// rejection reason outside the generator function, so the
// only option is to throw it from the await expression, and
// let the generator function handle the exception.
result.value = unwrapped;
resolve(result);
}, reject);
}
}
if (typeof process === "object" && process.domain) {
invoke = process.domain.bind(invoke);
}
var previousPromise;
function enqueue(method, arg) {
function callInvokeWithMethodAndArg() {
return new Promise(function(resolve, reject) {
invoke(method, arg, resolve, reject);
});
}
return previousPromise =
// If enqueue has been called before, then we want to wait until
// all previous Promises have been resolved before calling invoke,
// so that results are always delivered in the correct order. If
// enqueue has not been called before, then it is important to
// call invoke immediately, without waiting on a callback to fire,
// so that the async generator function has the opportunity to do
// any necessary setup in a predictable way. This predictability
// is why the Promise constructor synchronously invokes its
// executor callback, and why async functions synchronously
// execute code before the first await. Since we implement simple
// async functions in terms of async generators, it is especially
// important to get this right, even though it requires care.
previousPromise ? previousPromise.then(
callInvokeWithMethodAndArg,
// Avoid propagating failures to Promises returned by later
// invocations of the iterator.
callInvokeWithMethodAndArg
) : callInvokeWithMethodAndArg();
}
// Define the unified helper method that is used to implement .next,
// .throw, and .return (see defineIteratorMethods).
this._invoke = enqueue;
}
defineIteratorMethods(AsyncIterator.prototype);
runtime.AsyncIterator = AsyncIterator;
// Note that simple async functions are implemented on top of
// AsyncIterator objects; they just return a Promise for the value of
// the final result produced by the iterator.
runtime.async = function(innerFn, outerFn, self, tryLocsList) {
var iter = new AsyncIterator(
wrap(innerFn, outerFn, self, tryLocsList)
);
return runtime.isGeneratorFunction(outerFn)
? iter // If outerFn is a generator, return the full iterator.
: iter.next().then(function(result) {
return result.done ? result.value : iter.next();
});
};
function makeInvokeMethod(innerFn, self, context) {
var state = GenStateSuspendedStart;
return function invoke(method, arg) {
if (state === GenStateExecuting) {
throw new Error("Generator is already running");
}
if (state === GenStateCompleted) {
if (method === "throw") {
throw arg;
}
// Be forgiving, per 25.3.3.3.3 of the spec:
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
return doneResult();
}
while (true) {
var delegate = context.delegate;
if (delegate) {
if (method === "return" ||
(method === "throw" && delegate.iterator[method] === undefined)) {
// A return or throw (when the delegate iterator has no throw
// method) always terminates the yield* loop.
context.delegate = null;
// If the delegate iterator has a return method, give it a
// chance to clean up.
var returnMethod = delegate.iterator["return"];
if (returnMethod) {
var record = tryCatch(returnMethod, delegate.iterator, arg);
if (record.type === "throw") {
// If the return method threw an exception, let that
// exception prevail over the original return or throw.
method = "throw";
arg = record.arg;
continue;
}
}
if (method === "return") {
// Continue with the outer return, now that the delegate
// iterator has been terminated.
continue;
}
}
var record = tryCatch(
delegate.iterator[method],
delegate.iterator,
arg
);
if (record.type === "throw") {
context.delegate = null;
// Like returning generator.throw(uncaught), but without the
// overhead of an extra function call.
method = "throw";
arg = record.arg;
continue;
}
// Delegate generator ran and handled its own exceptions so
// regardless of what the method was, we continue as if it is
// "next" with an undefined arg.
method = "next";
arg = undefined;
var info = record.arg;
if (info.done) {
context[delegate.resultName] = info.value;
context.next = delegate.nextLoc;
} else {
state = GenStateSuspendedYield;
return info;
}
context.delegate = null;
}
if (method === "next") {
// Setting context._sent for legacy support of Babel's
// function.sent implementation.
context.sent = context._sent = arg;
} else if (method === "throw") {
if (state === GenStateSuspendedStart) {
state = GenStateCompleted;
throw arg;
}
if (context.dispatchException(arg)) {
// If the dispatched exception was caught by a catch block,
// then let that catch block handle the exception normally.
method = "next";
arg = undefined;
}
} else if (method === "return") {
context.abrupt("return", arg);
}
state = GenStateExecuting;
var record = tryCatch(innerFn, self, context);
if (record.type === "normal") {
// If an exception is thrown from innerFn, we leave state ===
// GenStateExecuting and loop back for another invocation.
state = context.done
? GenStateCompleted
: GenStateSuspendedYield;
var info = {
value: record.arg,
done: context.done
};
if (record.arg === ContinueSentinel) {
if (context.delegate && method === "next") {
// Deliberately forget the last sent value so that we don't
// accidentally pass it on to the delegate.
arg = undefined;
}
} else {
return info;
}
} else if (record.type === "throw") {
state = GenStateCompleted;
// Dispatch the exception by looping back around to the
// context.dispatchException(arg) call above.
method = "throw";
arg = record.arg;
}
}
};
}
// Define Generator.prototype.{next,throw,return} in terms of the
// unified ._invoke helper method.
defineIteratorMethods(Gp);
Gp[toStringTagSymbol] = "Generator";
Gp.toString = function() {
return "[object Generator]";
};
function pushTryEntry(locs) {
var entry = { tryLoc: locs[0] };
if (1 in locs) {
entry.catchLoc = locs[1];
}
if (2 in locs) {
entry.finallyLoc = locs[2];
entry.afterLoc = locs[3];
}
this.tryEntries.push(entry);
}
function resetTryEntry(entry) {
var record = entry.completion || {};
record.type = "normal";
delete record.arg;
entry.completion = record;
}
function Context(tryLocsList) {
// The root entry object (effectively a try statement without a catch
// or a finally block) gives us a place to store values thrown from
// locations where there is no enclosing try statement.
this.tryEntries = [{ tryLoc: "root" }];
tryLocsList.forEach(pushTryEntry, this);
this.reset(true);
}
runtime.keys = function(object) {
var keys = [];
for (var key in object) {
keys.push(key);
}
keys.reverse();
// Rather than returning an object with a next method, we keep
// things simple and return the next function itself.
return function next() {
while (keys.length) {
var key = keys.pop();
if (key in object) {
next.value = key;
next.done = false;
return next;
}
}
// To avoid creating an additional object, we just hang the .value
// and .done properties off the next function object itself. This
// also ensures that the minifier will not anonymize the function.
next.done = true;
return next;
};
};
function values(iterable) {
if (iterable) {
var iteratorMethod = iterable[iteratorSymbol];
if (iteratorMethod) {
return iteratorMethod.call(iterable);
}
if (typeof iterable.next === "function") {
return iterable;
}
if (!isNaN(iterable.length)) {
var i = -1, next = function next() {
while (++i < iterable.length) {
if (hasOwn.call(iterable, i)) {
next.value = iterable[i];
next.done = false;
return next;
}
}
next.value = undefined;
next.done = true;
return next;
};
return next.next = next;
}
}
// Return an iterator with no values.
return { next: doneResult };
}
runtime.values = values;
function doneResult() {
return { value: undefined, done: true };
}
Context.prototype = {
constructor: Context,
reset: function(skipTempReset) {
this.prev = 0;
this.next = 0;
// Resetting context._sent for legacy support of Babel's
// function.sent implementation.
this.sent = this._sent = undefined;
this.done = false;
this.delegate = null;
this.tryEntries.forEach(resetTryEntry);
if (!skipTempReset) {
for (var name in this) {
// Not sure about the optimal order of these conditions:
if (name.charAt(0) === "t" &&
hasOwn.call(this, name) &&
!isNaN(+name.slice(1))) {
this[name] = undefined;
}
}
}
},
stop: function() {
this.done = true;
var rootEntry = this.tryEntries[0];
var rootRecord = rootEntry.completion;
if (rootRecord.type === "throw") {
throw rootRecord.arg;
}
return this.rval;
},
dispatchException: function(exception) {
if (this.done) {
throw exception;
}
var context = this;
function handle(loc, caught) {
record.type = "throw";
record.arg = exception;
context.next = loc;
return !!caught;
}
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
var record = entry.completion;
if (entry.tryLoc === "root") {
// Exception thrown outside of any try block that could handle
// it, so set the completion value of the entire function to
// throw the exception.
return handle("end");
}
if (entry.tryLoc <= this.prev) {
var hasCatch = hasOwn.call(entry, "catchLoc");
var hasFinally = hasOwn.call(entry, "finallyLoc");
if (hasCatch && hasFinally) {
if (this.prev < entry.catchLoc) {
return handle(entry.catchLoc, true);
} else if (this.prev < entry.finallyLoc) {
return handle(entry.finallyLoc);
}
} else if (hasCatch) {
if (this.prev < entry.catchLoc) {
return handle(entry.catchLoc, true);
}
} else if (hasFinally) {
if (this.prev < entry.finallyLoc) {
return handle(entry.finallyLoc);
}
} else {
throw new Error("try statement without catch or finally");
}
}
}
},
abrupt: function(type, arg) {
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
if (entry.tryLoc <= this.prev &&
hasOwn.call(entry, "finallyLoc") &&
this.prev < entry.finallyLoc) {
var finallyEntry = entry;
break;
}
}
if (finallyEntry &&
(type === "break" ||
type === "continue") &&
finallyEntry.tryLoc <= arg &&
arg <= finallyEntry.finallyLoc) {
// Ignore the finally entry if control is not jumping to a
// location outside the try/catch block.
finallyEntry = null;
}
var record = finallyEntry ? finallyEntry.completion : {};
record.type = type;
record.arg = arg;
if (finallyEntry) {
this.next = finallyEntry.finallyLoc;
} else {
this.complete(record);
}
return ContinueSentinel;
},
complete: function(record, afterLoc) {
if (record.type === "throw") {
throw record.arg;
}
if (record.type === "break" ||
record.type === "continue") {
this.next = record.arg;
} else if (record.type === "return") {
this.rval = record.arg;
this.next = "end";
} else if (record.type === "normal" && afterLoc) {
this.next = afterLoc;
}
},
finish: function(finallyLoc) {
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
if (entry.finallyLoc === finallyLoc) {
this.complete(entry.completion, entry.afterLoc);
resetTryEntry(entry);
return ContinueSentinel;
}
}
},
"catch": function(tryLoc) {
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
if (entry.tryLoc === tryLoc) {
var record = entry.completion;
if (record.type === "throw") {
var thrown = record.arg;
resetTryEntry(entry);
}
return thrown;
}
}
// The context.catch method must only be called with a location
// argument that corresponds to a known catch block.
throw new Error("illegal catch attempt");
},
delegateYield: function(iterable, resultName, nextLoc) {
this.delegate = {
iterator: values(iterable),
resultName: resultName,
nextLoc: nextLoc
};
return ContinueSentinel;
}
};
})(
// Among the various tricks for obtaining a reference to the global
// object, this seems to be the most reliable technique that does not
// use indirect eval (which violates Content Security Policy).
typeof global === "object" ? global :
typeof window === "object" ? window :
typeof self === "object" ? self : this
);
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()), __webpack_require__(/*! ./../process/browser.js */ 4)))
/***/ },
/* 523 */
/*!***************************************!*\
!*** ./~/core-js/fn/regexp/escape.js ***!
\***************************************/
/***/ function(module, exports, __webpack_require__) {
__webpack_require__(/*! ../../modules/core.regexp.escape */ 524);
module.exports = __webpack_require__(/*! ../../modules/_core */ 238).RegExp.escape;
/***/ },
/* 524 */
/*!*************************************************!*\
!*** ./~/core-js/modules/core.regexp.escape.js ***!
\*************************************************/
/***/ function(module, exports, __webpack_require__) {
// https://github.com/benjamingr/RexExp.escape
var $export = __webpack_require__(/*! ./_export */ 237)
, $re = __webpack_require__(/*! ./_replacer */ 525)(/[\\^$*+?.()|[\]{}]/g, '\\$&');
$export($export.S, 'RegExp', {escape: function escape(it){ return $re(it); }});
/***/ },
/* 525 */
/*!****************************************!*\
!*** ./~/core-js/modules/_replacer.js ***!
\****************************************/
/***/ function(module, exports) {
module.exports = function(regExp, replace){
var replacer = replace === Object(replace) ? function(part){
return replace[part];
} : replace;
return function(it){
return String(it).replace(regExp, replacer);
};
};
/***/ },
/* 526 */
/*!****************************************************!*\
!*** ./~/isomorphic-fetch/fetch-npm-browserify.js ***!
\****************************************************/
/***/ function(module, exports, __webpack_require__) {
// the whatwg-fetch polyfill installs the fetch() function
// on the global object (window or self)
//
// Return that as the export for use in Webpack, Browserify etc.
__webpack_require__(/*! whatwg-fetch */ 527);
module.exports = self.fetch.bind(self);
/***/ },
/* 527 */
/*!*********************************!*\
!*** ./~/whatwg-fetch/fetch.js ***!
\*********************************/
/***/ function(module, exports) {
(function(self) {
'use strict';
if (self.fetch) {
return
}
var support = {
searchParams: 'URLSearchParams' in self,
iterable: 'Symbol' in self && 'iterator' in Symbol,
blob: 'FileReader' in self && 'Blob' in self && (function() {
try {
new Blob()
return true
} catch(e) {
return false
}
})(),
formData: 'FormData' in self,
arrayBuffer: 'ArrayBuffer' in self
}
if (support.arrayBuffer) {
var viewClasses = [
'[object Int8Array]',
'[object Uint8Array]',
'[object Uint8ClampedArray]',
'[object Int16Array]',
'[object Uint16Array]',
'[object Int32Array]',
'[object Uint32Array]',
'[object Float32Array]',
'[object Float64Array]'
]
var isDataView = function(obj) {
return obj && DataView.prototype.isPrototypeOf(obj)
}
var isArrayBufferView = ArrayBuffer.isView || function(obj) {
return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1
}
}
function normalizeName(name) {
if (typeof name !== 'string') {
name = String(name)
}
if (/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(name)) {
throw new TypeError('Invalid character in header field name')
}
return name.toLowerCase()
}
function normalizeValue(value) {
if (typeof value !== 'string') {
value = String(value)
}
return value
}
// Build a destructive iterator for the value list
function iteratorFor(items) {
var iterator = {
next: function() {
var value = items.shift()
return {done: value === undefined, value: value}
}
}
if (support.iterable) {
iterator[Symbol.iterator] = function() {
return iterator
}
}
return iterator
}
function Headers(headers) {
this.map = {}
if (headers instanceof Headers) {
headers.forEach(function(value, name) {
this.append(name, value)
}, this)
} else if (headers) {
Object.getOwnPropertyNames(headers).forEach(function(name) {
this.append(name, headers[name])
}, this)
}
}
Headers.prototype.append = function(name, value) {
name = normalizeName(name)
value = normalizeValue(value)
var oldValue = this.map[name]
this.map[name] = oldValue ? oldValue+','+value : value
}
Headers.prototype['delete'] = function(name) {
delete this.map[normalizeName(name)]
}
Headers.prototype.get = function(name) {
name = normalizeName(name)
return this.has(name) ? this.map[name] : null
}
Headers.prototype.has = function(name) {
return this.map.hasOwnProperty(normalizeName(name))
}
Headers.prototype.set = function(name, value) {
this.map[normalizeName(name)] = normalizeValue(value)
}
Headers.prototype.forEach = function(callback, thisArg) {
for (var name in this.map) {
if (this.map.hasOwnProperty(name)) {
callback.call(thisArg, this.map[name], name, this)
}
}
}
Headers.prototype.keys = function() {
var items = []
this.forEach(function(value, name) { items.push(name) })
return iteratorFor(items)
}
Headers.prototype.values = function() {
var items = []
this.forEach(function(value) { items.push(value) })
return iteratorFor(items)
}
Headers.prototype.entries = function() {
var items = []
this.forEach(function(value, name) { items.push([name, value]) })
return iteratorFor(items)
}
if (support.iterable) {
Headers.prototype[Symbol.iterator] = Headers.prototype.entries
}
function consumed(body) {
if (body.bodyUsed) {
return Promise.reject(new TypeError('Already read'))
}
body.bodyUsed = true
}
function fileReaderReady(reader) {
return new Promise(function(resolve, reject) {
reader.onload = function() {
resolve(reader.result)
}
reader.onerror = function() {
reject(reader.error)
}
})
}
function readBlobAsArrayBuffer(blob) {
var reader = new FileReader()
var promise = fileReaderReady(reader)
reader.readAsArrayBuffer(blob)
return promise
}
function readBlobAsText(blob) {
var reader = new FileReader()
var promise = fileReaderReady(reader)
reader.readAsText(blob)
return promise
}
function readArrayBufferAsText(buf) {
var view = new Uint8Array(buf)
var chars = new Array(view.length)
for (var i = 0; i < view.length; i++) {
chars[i] = String.fromCharCode(view[i])
}
return chars.join('')
}
function bufferClone(buf) {
if (buf.slice) {
return buf.slice(0)
} else {
var view = new Uint8Array(buf.byteLength)
view.set(new Uint8Array(buf))
return view.buffer
}
}
function Body() {
this.bodyUsed = false
this._initBody = function(body) {
this._bodyInit = body
if (!body) {
this._bodyText = ''
} else if (typeof body === 'string') {
this._bodyText = body
} else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
this._bodyBlob = body
} else if (support.formData && FormData.prototype.isPrototypeOf(body)) {
this._bodyFormData = body
} else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
this._bodyText = body.toString()
} else if (support.arrayBuffer && support.blob && isDataView(body)) {
this._bodyArrayBuffer = bufferClone(body.buffer)
// IE 10-11 can't handle a DataView body.
this._bodyInit = new Blob([this._bodyArrayBuffer])
} else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {
this._bodyArrayBuffer = bufferClone(body)
} else {
throw new Error('unsupported BodyInit type')
}
if (!this.headers.get('content-type')) {
if (typeof body === 'string') {
this.headers.set('content-type', 'text/plain;charset=UTF-8')
} else if (this._bodyBlob && this._bodyBlob.type) {
this.headers.set('content-type', this._bodyBlob.type)
} else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8')
}
}
}
if (support.blob) {
this.blob = function() {
var rejected = consumed(this)
if (rejected) {
return rejected
}
if (this._bodyBlob) {
return Promise.resolve(this._bodyBlob)
} else if (this._bodyArrayBuffer) {
return Promise.resolve(new Blob([this._bodyArrayBuffer]))
} else if (this._bodyFormData) {
throw new Error('could not read FormData body as blob')
} else {
return Promise.resolve(new Blob([this._bodyText]))
}
}
this.arrayBuffer = function() {
if (this._bodyArrayBuffer) {
return consumed(this) || Promise.resolve(this._bodyArrayBuffer)
} else {
return this.blob().then(readBlobAsArrayBuffer)
}
}
}
this.text = function() {
var rejected = consumed(this)
if (rejected) {
return rejected
}
if (this._bodyBlob) {
return readBlobAsText(this._bodyBlob)
} else if (this._bodyArrayBuffer) {
return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))
} else if (this._bodyFormData) {
throw new Error('could not read FormData body as text')
} else {
return Promise.resolve(this._bodyText)
}
}
if (support.formData) {
this.formData = function() {
return this.text().then(decode)
}
}
this.json = function() {
return this.text().then(JSON.parse)
}
return this
}
// HTTP methods whose capitalization should be normalized
var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']
function normalizeMethod(method) {
var upcased = method.toUpperCase()
return (methods.indexOf(upcased) > -1) ? upcased : method
}
function Request(input, options) {
options = options || {}
var body = options.body
if (typeof input === 'string') {
this.url = input
} else {
if (input.bodyUsed) {
throw new TypeError('Already read')
}
this.url = input.url
this.credentials = input.credentials
if (!options.headers) {
this.headers = new Headers(input.headers)
}
this.method = input.method
this.mode = input.mode
if (!body && input._bodyInit != null) {
body = input._bodyInit
input.bodyUsed = true
}
}
this.credentials = options.credentials || this.credentials || 'omit'
if (options.headers || !this.headers) {
this.headers = new Headers(options.headers)
}
this.method = normalizeMethod(options.method || this.method || 'GET')
this.mode = options.mode || this.mode || null
this.referrer = null
if ((this.method === 'GET' || this.method === 'HEAD') && body) {
throw new TypeError('Body not allowed for GET or HEAD requests')
}
this._initBody(body)
}
Request.prototype.clone = function() {
return new Request(this, { body: this._bodyInit })
}
function decode(body) {
var form = new FormData()
body.trim().split('&').forEach(function(bytes) {
if (bytes) {
var split = bytes.split('=')
var name = split.shift().replace(/\+/g, ' ')
var value = split.join('=').replace(/\+/g, ' ')
form.append(decodeURIComponent(name), decodeURIComponent(value))
}
})
return form
}
function parseHeaders(rawHeaders) {
var headers = new Headers()
rawHeaders.split('\r\n').forEach(function(line) {
var parts = line.split(':')
var key = parts.shift().trim()
if (key) {
var value = parts.join(':').trim()
headers.append(key, value)
}
})
return headers
}
Body.call(Request.prototype)
function Response(bodyInit, options) {
if (!options) {
options = {}
}
this.type = 'default'
this.status = 'status' in options ? options.status : 200
this.ok = this.status >= 200 && this.status < 300
this.statusText = 'statusText' in options ? options.statusText : 'OK'
this.headers = new Headers(options.headers)
this.url = options.url || ''
this._initBody(bodyInit)
}
Body.call(Response.prototype)
Response.prototype.clone = function() {
return new Response(this._bodyInit, {
status: this.status,
statusText: this.statusText,
headers: new Headers(this.headers),
url: this.url
})
}
Response.error = function() {
var response = new Response(null, {status: 0, statusText: ''})
response.type = 'error'
return response
}
var redirectStatuses = [301, 302, 303, 307, 308]
Response.redirect = function(url, status) {
if (redirectStatuses.indexOf(status) === -1) {
throw new RangeError('Invalid status code')
}
return new Response(null, {status: status, headers: {location: url}})
}
self.Headers = Headers
self.Request = Request
self.Response = Response
self.fetch = function(input, init) {
return new Promise(function(resolve, reject) {
var request = new Request(input, init)
var xhr = new XMLHttpRequest()
xhr.onload = function() {
var options = {
status: xhr.status,
statusText: xhr.statusText,
headers: parseHeaders(xhr.getAllResponseHeaders() || '')
}
options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL')
var body = 'response' in xhr ? xhr.response : xhr.responseText
resolve(new Response(body, options))
}
xhr.onerror = function() {
reject(new TypeError('Network request failed'))
}
xhr.ontimeout = function() {
reject(new TypeError('Network request failed'))
}
xhr.open(request.method, request.url, true)
if (request.credentials === 'include') {
xhr.withCredentials = true
}
if ('responseType' in xhr && support.blob) {
xhr.responseType = 'blob'
}
request.headers.forEach(function(value, name) {
xhr.setRequestHeader(name, value)
})
xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)
})
}
self.fetch.polyfill = true
})(typeof self !== 'undefined' ? self : this);
/***/ },
/* 528 */
/*!********************************!*\
!*** ./app/helpers/helpers.js ***!
\********************************/
/***/ function(module, exports) {
'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; };
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
var atomicUpdateRefIds = exports.atomicUpdateRefIds = function atomicUpdateRefIds(data) {
return function (previousState) {
return _extends({}, previousState, {
ebReferenceIds: [].concat(_toConsumableArray(previousState.ebReferenceIds), [data])
});
};
};
var allAreValid = exports.allAreValid = function allAreValid(validationFilterObject) {
var statuses = Object.values(validationFilterObject).map(function (_ref) {
var isValidated = _ref.isValidated;
return isValidated;
});
return !statuses.includes(false);
};
var isProduction = exports.isProduction = function isProduction() {
return window.location.origin.indexOf('jira.evbhome') !== -1;
};
/***/ },
/* 529 */
/*!***************************************!*\
!*** ./app/actions/action_helpers.js ***!
\***************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.mapToJiraFields = exports.JIRA_MAPPINGS = 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 _underscore = __webpack_require__(/*! underscore */ 530);
var _underscore2 = _interopRequireDefault(_underscore);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var JIRA_MAPPINGS = exports.JIRA_MAPPINGS = {
components: {
default: { components: [] }
},
description: {
default: { description: '' }
},
environment: {
// default is production
default: { 'customfield_11140': { id: '10680' } },
production: { 'customfield_11140': { id: '10680' } },
qa: { 'customfield_11140': { id: '10681' } },
stage: { 'customfield_11140': { id: '11853' } },
dev: { 'customfield_11140': { id: '12080' } }
},
eventID: {
default: { 'customfield_10024': '' }
},
issuetype: {
// default is bug
default: { issuetype: { id: '1' } },
bug: { issuetype: { id: '1' } }
},
labels: {
default: { labels: ['customer-sighting'] }
},
priority: {
// default is major
default: { priority: { id: '3' } },
blocker: { priority: { id: '1' } },
critical: { priority: { id: '2' } },
major: { priority: { id: '3' } },
minor: { priority: { id: '4' } },
trivial: { priority: { id: '5' } },
none: { priority: { id: '6' } }
},
project: {
// default is sup
default: { project: { id: '10011' } },
sup: { project: { id: '10011' } }
},
reporter: {
// default is ccummings
default: { reporter: 'ccummings' }
},
summary: {
// default is blank
default: { summary: '' }
},
userValue: {
// default is 0
default: { 'customfield_12341': '' }
}
};
var getJiraUserName = function getJiraUserName() {
return JIRA_MAPPINGS.reporter.reporter;
};
// converts normal markdown bold syntax to jira markdown flavor bolding syntax
var _markdownBold = function _markdownBold(text) {
var result = ''.concat(text);
var matches = text.match(/\*\*.+\*\*/g) || [];
matches.forEach(function (match) {
return result = result.replace(match, match.replace(/\*\*/g, '*'));
});
return result;
};
// converts normal markdown hyperlinks to jira markdown flavor hyperlinks
var _markdownLinks = function _markdownLinks(text) {
var hyperlinks = text.match(/\[.+\]\(.+\)/g) || [];
var formattedLinks = [];
var result = ''.concat(text);
hyperlinks.forEach(function (link) {
var linkText = /\[(.+)\]/g.exec(link)[1];
var url = /\((.+)\)/g.exec(link)[1];
formattedLinks.push('[' + linkText + '|' + url + ']');
});
hyperlinks.forEach(function (link, index) {
return result = result.replace(link, formattedLinks[index]);
});
return result;
};
// converts normal markdown to jira flavor markdown
var formatForJira = function formatForJira(text) {
return _markdownLinks(_markdownBold(text));
};
// constructs the Jira Ticket body text from the form data
var formatJiraTicketBody = function formatJiraTicketBody(data) {
var sep = '\n---\n';
var bodyFields = ['steps', 'references'];
var nonbodyFields = ['category', 'component', 'labels', 'priority', 'title'];
var extraFields = _underscore2.default.omit(data, bodyFields.concat(nonbodyFields));
var body = '';
bodyFields.forEach(function (field) {
return body += '' + data[field] + sep;
});
Object.keys(extraFields).forEach(function (fieldName) {
return body += '' + sep + fieldName + '\n' + extraFields[fieldName];
});
return body;
};
// accepts form data and returns the labels that should apply to the ticket
var labelData = function labelData(data) {
return data ? [] : [];
};
// TODO: implement prioritize
// accepts form data, and returns a jira priority
var prioritize = function prioritize(data) {
return data ? JIRA_MAPPINGS.priority.major.priority : JIRA_MAPPINGS.priority.major.priority;
};
// gets form data ready to upload
var serializeForm = function serializeForm(form) {
var data = {};
var value = void 0;
Object.keys(form).forEach(function (field) {
if (field === 'references') {
value = '+References:+\n';
form[field].fieldValue.forEach(function (e) {
return value += '* [' + e.text + '|' + e.lookupURL + ']\n';
});
} else if (field === 'steps') {
value = formatForJira(form[field].toString('markdown'));
} else {
value = form[field].value || form[field].fieldValue;
}
data[field] = value;
});
return data;
};
// TODO: implement file uploading
// gets files ready to upload to jira
var serializeFileUploads = function serializeFileUploads(files) {
return files;
};
var mapToJiraFields = exports.mapToJiraFields = function mapToJiraFields(form) {
var data = serializeForm(form);
var defaults = {};
Object.keys(JIRA_MAPPINGS).forEach(function (field) {
defaults = _extends({}, defaults, JIRA_MAPPINGS[field].default);
});
return {
fields: _extends({}, defaults, {
components: defaults.components.concat(data.components),
description: defaults.description.concat(formatJiraTicketBody(data)),
labels: defaults.labels.concat(labelData(data)),
priority: prioritize(data),
reporter: getJiraUserName(),
summary: defaults.summary.concat(data.title)
})
};
};
/***/ },
/* 530 */
/*!************************************!*\
!*** ./~/underscore/underscore.js ***!
\************************************/
/***/ function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// Underscore.js 1.8.3
// http://underscorejs.org
// (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
// Underscore may be freely distributed under the MIT license.
(function() {
// Baseline setup
// --------------
// Establish the root object, `window` in the browser, or `exports` on the server.
var root = this;
// Save the previous value of the `_` variable.
var previousUnderscore = root._;
// Save bytes in the minified (but not gzipped) version:
var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype;
// Create quick reference variables for speed access to core prototypes.
var
push = ArrayProto.push,
slice = ArrayProto.slice,
toString = ObjProto.toString,
hasOwnProperty = ObjProto.hasOwnProperty;
// All **ECMAScript 5** native function implementations that we hope to use
// are declared here.
var
nativeIsArray = Array.isArray,
nativeKeys = Object.keys,
nativeBind = FuncProto.bind,
nativeCreate = Object.create;
// Naked function reference for surrogate-prototype-swapping.
var Ctor = function(){};
// Create a safe reference to the Underscore object for use below.
var _ = function(obj) {
if (obj instanceof _) return obj;
if (!(this instanceof _)) return new _(obj);
this._wrapped = obj;
};
// Export the Underscore object for **Node.js**, with
// backwards-compatibility for the old `require()` API. If we're in
// the browser, add `_` as a global object.
if (true) {
if (typeof module !== 'undefined' && module.exports) {
exports = module.exports = _;
}
exports._ = _;
} else {
root._ = _;
}
// Current version.
_.VERSION = '1.8.3';
// Internal function that returns an efficient (for current engines) version
// of the passed-in callback, to be repeatedly applied in other Underscore
// functions.
var optimizeCb = function(func, context, argCount) {
if (context === void 0) return func;
switch (argCount == null ? 3 : argCount) {
case 1: return function(value) {
return func.call(context, value);
};
case 2: return function(value, other) {
return func.call(context, value, other);
};
case 3: return function(value, index, collection) {
return func.call(context, value, index, collection);
};
case 4: return function(accumulator, value, index, collection) {
return func.call(context, accumulator, value, index, collection);
};
}
return function() {
return func.apply(context, arguments);
};
};
// A mostly-internal function to generate callbacks that can be applied
// to each element in a collection, returning the desired result — either
// identity, an arbitrary callback, a property matcher, or a property accessor.
var cb = function(value, context, argCount) {
if (value == null) return _.identity;
if (_.isFunction(value)) return optimizeCb(value, context, argCount);
if (_.isObject(value)) return _.matcher(value);
return _.property(value);
};
_.iteratee = function(value, context) {
return cb(value, context, Infinity);
};
// An internal function for creating assigner functions.
var createAssigner = function(keysFunc, undefinedOnly) {
return function(obj) {
var length = arguments.length;
if (length < 2 || obj == null) return obj;
for (var index = 1; index < length; index++) {
var source = arguments[index],
keys = keysFunc(source),
l = keys.length;
for (var i = 0; i < l; i++) {
var key = keys[i];
if (!undefinedOnly || obj[key] === void 0) obj[key] = source[key];
}
}
return obj;
};
};
// An internal function for creating a new object that inherits from another.
var baseCreate = function(prototype) {
if (!_.isObject(prototype)) return {};
if (nativeCreate) return nativeCreate(prototype);
Ctor.prototype = prototype;
var result = new Ctor;
Ctor.prototype = null;
return result;
};
var property = function(key) {
return function(obj) {
return obj == null ? void 0 : obj[key];
};
};
// Helper for collection methods to determine whether a collection
// should be iterated as an array or as an object
// Related: http://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength
// Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094
var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1;
var getLength = property('length');
var isArrayLike = function(collection) {
var length = getLength(collection);
return typeof length == 'number' && length >= 0 && length <= MAX_ARRAY_INDEX;
};
// Collection Functions
// --------------------
// The cornerstone, an `each` implementation, aka `forEach`.
// Handles raw objects in addition to array-likes. Treats all
// sparse array-likes as if they were dense.
_.each = _.forEach = function(obj, iteratee, context) {
iteratee = optimizeCb(iteratee, context);
var i, length;
if (isArrayLike(obj)) {
for (i = 0, length = obj.length; i < length; i++) {
iteratee(obj[i], i, obj);
}
} else {
var keys = _.keys(obj);
for (i = 0, length = keys.length; i < length; i++) {
iteratee(obj[keys[i]], keys[i], obj);
}
}
return obj;
};
// Return the results of applying the iteratee to each element.
_.map = _.collect = function(obj, iteratee, context) {
iteratee = cb(iteratee, context);
var keys = !isArrayLike(obj) && _.keys(obj),
length = (keys || obj).length,
results = Array(length);
for (var index = 0; index < length; index++) {
var currentKey = keys ? keys[index] : index;
results[index] = iteratee(obj[currentKey], currentKey, obj);
}
return results;
};
// Create a reducing function iterating left or right.
function createReduce(dir) {
// Optimized iterator function as using arguments.length
// in the main function will deoptimize the, see #1991.
function iterator(obj, iteratee, memo, keys, index, length) {
for (; index >= 0 && index < length; index += dir) {
var currentKey = keys ? keys[index] : index;
memo = iteratee(memo, obj[currentKey], currentKey, obj);
}
return memo;
}
return function(obj, iteratee, memo, context) {
iteratee = optimizeCb(iteratee, context, 4);
var keys = !isArrayLike(obj) && _.keys(obj),
length = (keys || obj).length,
index = dir > 0 ? 0 : length - 1;
// Determine the initial value if none is provided.
if (arguments.length < 3) {
memo = obj[keys ? keys[index] : index];
index += dir;
}
return iterator(obj, iteratee, memo, keys, index, length);
};
}
// **Reduce** builds up a single result from a list of values, aka `inject`,
// or `foldl`.
_.reduce = _.foldl = _.inject = createReduce(1);
// The right-associative version of reduce, also known as `foldr`.
_.reduceRight = _.foldr = createReduce(-1);
// Return the first value which passes a truth test. Aliased as `detect`.
_.find = _.detect = function(obj, predicate, context) {
var key;
if (isArrayLike(obj)) {
key = _.findIndex(obj, predicate, context);
} else {
key = _.findKey(obj, predicate, context);
}
if (key !== void 0 && key !== -1) return obj[key];
};
// Return all the elements that pass a truth test.
// Aliased as `select`.
_.filter = _.select = function(obj, predicate, context) {
var results = [];
predicate = cb(predicate, context);
_.each(obj, function(value, index, list) {
if (predicate(value, index, list)) results.push(value);
});
return results;
};
// Return all the elements for which a truth test fails.
_.reject = function(obj, predicate, context) {
return _.filter(obj, _.negate(cb(predicate)), context);
};
// Determine whether all of the elements match a truth test.
// Aliased as `all`.
_.every = _.all = function(obj, predicate, context) {
predicate = cb(predicate, context);
var keys = !isArrayLike(obj) && _.keys(obj),
length = (keys || obj).length;
for (var index = 0; index < length; index++) {
var currentKey = keys ? keys[index] : index;
if (!predicate(obj[currentKey], currentKey, obj)) return false;
}
return true;
};
// Determine if at least one element in the object matches a truth test.
// Aliased as `any`.
_.some = _.any = function(obj, predicate, context) {
predicate = cb(predicate, context);
var keys = !isArrayLike(obj) && _.keys(obj),
length = (keys || obj).length;
for (var index = 0; index < length; index++) {
var currentKey = keys ? keys[index] : index;
if (predicate(obj[currentKey], currentKey, obj)) return true;
}
return false;
};
// Determine if the array or object contains a given item (using `===`).
// Aliased as `includes` and `include`.
_.contains = _.includes = _.include = function(obj, item, fromIndex, guard) {
if (!isArrayLike(obj)) obj = _.values(obj);
if (typeof fromIndex != 'number' || guard) fromIndex = 0;
return _.indexOf(obj, item, fromIndex) >= 0;
};
// Invoke a method (with arguments) on every item in a collection.
_.invoke = function(obj, method) {
var args = slice.call(arguments, 2);
var isFunc = _.isFunction(method);
return _.map(obj, function(value) {
var func = isFunc ? method : value[method];
return func == null ? func : func.apply(value, args);
});
};
// Convenience version of a common use case of `map`: fetching a property.
_.pluck = function(obj, key) {
return _.map(obj, _.property(key));
};
// Convenience version of a common use case of `filter`: selecting only objects
// containing specific `key:value` pairs.
_.where = function(obj, attrs) {
return _.filter(obj, _.matcher(attrs));
};
// Convenience version of a common use case of `find`: getting the first object
// containing specific `key:value` pairs.
_.findWhere = function(obj, attrs) {
return _.find(obj, _.matcher(attrs));
};
// Return the maximum element (or element-based computation).
_.max = function(obj, iteratee, context) {
var result = -Infinity, lastComputed = -Infinity,
value, computed;
if (iteratee == null && obj != null) {
obj = isArrayLike(obj) ? obj : _.values(obj);
for (var i = 0, length = obj.length; i < length; i++) {
value = obj[i];
if (value > result) {
result = value;
}
}
} else {
iteratee = cb(iteratee, context);
_.each(obj, function(value, index, list) {
computed = iteratee(value, index, list);
if (computed > lastComputed || computed === -Infinity && result === -Infinity) {
result = value;
lastComputed = computed;
}
});
}
return result;
};
// Return the minimum element (or element-based computation).
_.min = function(obj, iteratee, context) {
var result = Infinity, lastComputed = Infinity,
value, computed;
if (iteratee == null && obj != null) {
obj = isArrayLike(obj) ? obj : _.values(obj);
for (var i = 0, length = obj.length; i < length; i++) {
value = obj[i];
if (value < result) {
result = value;
}
}
} else {
iteratee = cb(iteratee, context);
_.each(obj, function(value, index, list) {
computed = iteratee(value, index, list);
if (computed < lastComputed || computed === Infinity && result === Infinity) {
result = value;
lastComputed = computed;
}
});
}
return result;
};
// Shuffle a collection, using the modern version of the
// [Fisher-Yates shuffle](http://en.wikipedia.org/wiki/Fisher–Yates_shuffle).
_.shuffle = function(obj) {
var set = isArrayLike(obj) ? obj : _.values(obj);
var length = set.length;
var shuffled = Array(length);
for (var index = 0, rand; index < length; index++) {
rand = _.random(0, index);
if (rand !== index) shuffled[index] = shuffled[rand];
shuffled[rand] = set[index];
}
return shuffled;
};
// Sample **n** random values from a collection.
// If **n** is not specified, returns a single random element.
// The internal `guard` argument allows it to work with `map`.
_.sample = function(obj, n, guard) {
if (n == null || guard) {
if (!isArrayLike(obj)) obj = _.values(obj);
return obj[_.random(obj.length - 1)];
}
return _.shuffle(obj).slice(0, Math.max(0, n));
};
// Sort the object's values by a criterion produced by an iteratee.
_.sortBy = function(obj, iteratee, context) {
iteratee = cb(iteratee, context);
return _.pluck(_.map(obj, function(value, index, list) {
return {
value: value,
index: index,
criteria: iteratee(value, index, list)
};
}).sort(function(left, right) {
var a = left.criteria;
var b = right.criteria;
if (a !== b) {
if (a > b || a === void 0) return 1;
if (a < b || b === void 0) return -1;
}
return left.index - right.index;
}), 'value');
};
// An internal function used for aggregate "group by" operations.
var group = function(behavior) {
return function(obj, iteratee, context) {
var result = {};
iteratee = cb(iteratee, context);
_.each(obj, function(value, index) {
var key = iteratee(value, index, obj);
behavior(result, value, key);
});
return result;
};
};
// Groups the object's values by a criterion. Pass either a string attribute
// to group by, or a function that returns the criterion.
_.groupBy = group(function(result, value, key) {
if (_.has(result, key)) result[key].push(value); else result[key] = [value];
});
// Indexes the object's values by a criterion, similar to `groupBy`, but for
// when you know that your index values will be unique.
_.indexBy = group(function(result, value, key) {
result[key] = value;
});
// Counts instances of an object that group by a certain criterion. Pass
// either a string attribute to count by, or a function that returns the
// criterion.
_.countBy = group(function(result, value, key) {
if (_.has(result, key)) result[key]++; else result[key] = 1;
});
// Safely create a real, live array from anything iterable.
_.toArray = function(obj) {
if (!obj) return [];
if (_.isArray(obj)) return slice.call(obj);
if (isArrayLike(obj)) return _.map(obj, _.identity);
return _.values(obj);
};
// Return the number of elements in an object.
_.size = function(obj) {
if (obj == null) return 0;
return isArrayLike(obj) ? obj.length : _.keys(obj).length;
};
// Split a collection into two arrays: one whose elements all satisfy the given
// predicate, and one whose elements all do not satisfy the predicate.
_.partition = function(obj, predicate, context) {
predicate = cb(predicate, context);
var pass = [], fail = [];
_.each(obj, function(value, key, obj) {
(predicate(value, key, obj) ? pass : fail).push(value);
});
return [pass, fail];
};
// Array Functions
// ---------------
// Get the first element of an array. Passing **n** will return the first N
// values in the array. Aliased as `head` and `take`. The **guard** check
// allows it to work with `_.map`.
_.first = _.head = _.take = function(array, n, guard) {
if (array == null) return void 0;
if (n == null || guard) return array[0];
return _.initial(array, array.length - n);
};
// Returns everything but the last entry of the array. Especially useful on
// the arguments object. Passing **n** will return all the values in
// the array, excluding the last N.
_.initial = function(array, n, guard) {
return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));
};
// Get the last element of an array. Passing **n** will return the last N
// values in the array.
_.last = function(array, n, guard) {
if (array == null) return void 0;
if (n == null || guard) return array[array.length - 1];
return _.rest(array, Math.max(0, array.length - n));
};
// Returns everything but the first entry of the array. Aliased as `tail` and `drop`.
// Especially useful on the arguments object. Passing an **n** will return
// the rest N values in the array.
_.rest = _.tail = _.drop = function(array, n, guard) {
return slice.call(array, n == null || guard ? 1 : n);
};
// Trim out all falsy values from an array.
_.compact = function(array) {
return _.filter(array, _.identity);
};
// Internal implementation of a recursive `flatten` function.
var flatten = function(input, shallow, strict, startIndex) {
var output = [], idx = 0;
for (var i = startIndex || 0, length = getLength(input); i < length; i++) {
var value = input[i];
if (isArrayLike(value) && (_.isArray(value) || _.isArguments(value))) {
//flatten current level of array or arguments object
if (!shallow) value = flatten(value, shallow, strict);
var j = 0, len = value.length;
output.length += len;
while (j < len) {
output[idx++] = value[j++];
}
} else if (!strict) {
output[idx++] = value;
}
}
return output;
};
// Flatten out an array, either recursively (by default), or just one level.
_.flatten = function(array, shallow) {
return flatten(array, shallow, false);
};
// Return a version of the array that does not contain the specified value(s).
_.without = function(array) {
return _.difference(array, slice.call(arguments, 1));
};
// Produce a duplicate-free version of the array. If the array has already
// been sorted, you have the option of using a faster algorithm.
// Aliased as `unique`.
_.uniq = _.unique = function(array, isSorted, iteratee, context) {
if (!_.isBoolean(isSorted)) {
context = iteratee;
iteratee = isSorted;
isSorted = false;
}
if (iteratee != null) iteratee = cb(iteratee, context);
var result = [];
var seen = [];
for (var i = 0, length = getLength(array); i < length; i++) {
var value = array[i],
computed = iteratee ? iteratee(value, i, array) : value;
if (isSorted) {
if (!i || seen !== computed) result.push(value);
seen = computed;
} else if (iteratee) {
if (!_.contains(seen, computed)) {
seen.push(computed);
result.push(value);
}
} else if (!_.contains(result, value)) {
result.push(value);
}
}
return result;
};
// Produce an array that contains the union: each distinct element from all of
// the passed-in arrays.
_.union = function() {
return _.uniq(flatten(arguments, true, true));
};
// Produce an array that contains every item shared between all the
// passed-in arrays.
_.intersection = function(array) {
var result = [];
var argsLength = arguments.length;
for (var i = 0, length = getLength(array); i < length; i++) {
var item = array[i];
if (_.contains(result, item)) continue;
for (var j = 1; j < argsLength; j++) {
if (!_.contains(arguments[j], item)) break;
}
if (j === argsLength) result.push(item);
}
return result;
};
// Take the difference between one array and a number of other arrays.
// Only the elements present in just the first array will remain.
_.difference = function(array) {
var rest = flatten(arguments, true, true, 1);
return _.filter(array, function(value){
return !_.contains(rest, value);
});
};
// Zip together multiple lists into a single array -- elements that share
// an index go together.
_.zip = function() {
return _.unzip(arguments);
};
// Complement of _.zip. Unzip accepts an array of arrays and groups
// each array's elements on shared indices
_.unzip = function(array) {
var length = array && _.max(array, getLength).length || 0;
var result = Array(length);
for (var index = 0; index < length; index++) {
result[index] = _.pluck(array, index);
}
return result;
};
// Converts lists into objects. Pass either a single array of `[key, value]`
// pairs, or two parallel arrays of the same length -- one of keys, and one of
// the corresponding values.
_.object = function(list, values) {
var result = {};
for (var i = 0, length = getLength(list); i < length; i++) {
if (values) {
result[list[i]] = values[i];
} else {
result[list[i][0]] = list[i][1];
}
}
return result;
};
// Generator function to create the findIndex and findLastIndex functions
function createPredicateIndexFinder(dir) {
return function(array, predicate, context) {
predicate = cb(predicate, context);
var length = getLength(array);
var index = dir > 0 ? 0 : length - 1;
for (; index >= 0 && index < length; index += dir) {
if (predicate(array[index], index, array)) return index;
}
return -1;
};
}
// Returns the first index on an array-like that passes a predicate test
_.findIndex = createPredicateIndexFinder(1);
_.findLastIndex = createPredicateIndexFinder(-1);
// Use a comparator function to figure out the smallest index at which
// an object should be inserted so as to maintain order. Uses binary search.
_.sortedIndex = function(array, obj, iteratee, context) {
iteratee = cb(iteratee, context, 1);
var value = iteratee(obj);
var low = 0, high = getLength(array);
while (low < high) {
var mid = Math.floor((low + high) / 2);
if (iteratee(array[mid]) < value) low = mid + 1; else high = mid;
}
return low;
};
// Generator function to create the indexOf and lastIndexOf functions
function createIndexFinder(dir, predicateFind, sortedIndex) {
return function(array, item, idx) {
var i = 0, length = getLength(array);
if (typeof idx == 'number') {
if (dir > 0) {
i = idx >= 0 ? idx : Math.max(idx + length, i);
} else {
length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;
}
} else if (sortedIndex && idx && length) {
idx = sortedIndex(array, item);
return array[idx] === item ? idx : -1;
}
if (item !== item) {
idx = predicateFind(slice.call(array, i, length), _.isNaN);
return idx >= 0 ? idx + i : -1;
}
for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {
if (array[idx] === item) return idx;
}
return -1;
};
}
// Return the position of the first occurrence of an item in an array,
// or -1 if the item is not included in the array.
// If the array is large and already in sort order, pass `true`
// for **isSorted** to use binary search.
_.indexOf = createIndexFinder(1, _.findIndex, _.sortedIndex);
_.lastIndexOf = createIndexFinder(-1, _.findLastIndex);
// Generate an integer Array containing an arithmetic progression. A port of
// the native Python `range()` function. See
// [the Python documentation](http://docs.python.org/library/functions.html#range).
_.range = function(start, stop, step) {
if (stop == null) {
stop = start || 0;
start = 0;
}
step = step || 1;
var length = Math.max(Math.ceil((stop - start) / step), 0);
var range = Array(length);
for (var idx = 0; idx < length; idx++, start += step) {
range[idx] = start;
}
return range;
};
// Function (ahem) Functions
// ------------------
// Determines whether to execute a function as a constructor
// or a normal function with the provided arguments
var executeBound = function(sourceFunc, boundFunc, context, callingContext, args) {
if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);
var self = baseCreate(sourceFunc.prototype);
var result = sourceFunc.apply(self, args);
if (_.isObject(result)) return result;
return self;
};
// Create a function bound to a given object (assigning `this`, and arguments,
// optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if
// available.
_.bind = function(func, context) {
if (nativeBind && func.bind === nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));
if (!_.isFunction(func)) throw new TypeError('Bind must be called on a function');
var args = slice.call(arguments, 2);
var bound = function() {
return executeBound(func, bound, context, this, args.concat(slice.call(arguments)));
};
return bound;
};
// Partially apply a function by creating a version that has had some of its
// arguments pre-filled, without changing its dynamic `this` context. _ acts
// as a placeholder, allowing any combination of arguments to be pre-filled.
_.partial = function(func) {
var boundArgs = slice.call(arguments, 1);
var bound = function() {
var position = 0, length = boundArgs.length;
var args = Array(length);
for (var i = 0; i < length; i++) {
args[i] = boundArgs[i] === _ ? arguments[position++] : boundArgs[i];
}
while (position < arguments.length) args.push(arguments[position++]);
return executeBound(func, bound, this, this, args);
};
return bound;
};
// Bind a number of an object's methods to that object. Remaining arguments
// are the method names to be bound. Useful for ensuring that all callbacks
// defined on an object belong to it.
_.bindAll = function(obj) {
var i, length = arguments.length, key;
if (length <= 1) throw new Error('bindAll must be passed function names');
for (i = 1; i < length; i++) {
key = arguments[i];
obj[key] = _.bind(obj[key], obj);
}
return obj;
};
// Memoize an expensive function by storing its results.
_.memoize = function(func, hasher) {
var memoize = function(key) {
var cache = memoize.cache;
var address = '' + (hasher ? hasher.apply(this, arguments) : key);
if (!_.has(cache, address)) cache[address] = func.apply(this, arguments);
return cache[address];
};
memoize.cache = {};
return memoize;
};
// Delays a function for the given number of milliseconds, and then calls
// it with the arguments supplied.
_.delay = function(func, wait) {
var args = slice.call(arguments, 2);
return setTimeout(function(){
return func.apply(null, args);
}, wait);
};
// Defers a function, scheduling it to run after the current call stack has
// cleared.
_.defer = _.partial(_.delay, _, 1);
// Returns a function, that, when invoked, will only be triggered at most once
// during a given window of time. Normally, the throttled function will run
// as much as it can, without ever going more than once per `wait` duration;
// but if you'd like to disable the execution on the leading edge, pass
// `{leading: false}`. To disable execution on the trailing edge, ditto.
_.throttle = function(func, wait, options) {
var context, args, result;
var timeout = null;
var previous = 0;
if (!options) options = {};
var later = function() {
previous = options.leading === false ? 0 : _.now();
timeout = null;
result = func.apply(context, args);
if (!timeout) context = args = null;
};
return function() {
var now = _.now();
if (!previous && options.leading === false) previous = now;
var remaining = wait - (now - previous);
context = this;
args = arguments;
if (remaining <= 0 || remaining > wait) {
if (timeout) {
clearTimeout(timeout);
timeout = null;
}
previous = now;
result = func.apply(context, args);
if (!timeout) context = args = null;
} else if (!timeout && options.trailing !== false) {
timeout = setTimeout(later, remaining);
}
return result;
};
};
// Returns a function, that, as long as it continues to be invoked, will not
// be triggered. The function will be called after it stops being called for
// N milliseconds. If `immediate` is passed, trigger the function on the
// leading edge, instead of the trailing.
_.debounce = function(func, wait, immediate) {
var timeout, args, context, timestamp, result;
var later = function() {
var last = _.now() - timestamp;
if (last < wait && last >= 0) {
timeout = setTimeout(later, wait - last);
} else {
timeout = null;
if (!immediate) {
result = func.apply(context, args);
if (!timeout) context = args = null;
}
}
};
return function() {
context = this;
args = arguments;
timestamp = _.now();
var callNow = immediate && !timeout;
if (!timeout) timeout = setTimeout(later, wait);
if (callNow) {
result = func.apply(context, args);
context = args = null;
}
return result;
};
};
// Returns the first function passed as an argument to the second,
// allowing you to adjust arguments, run code before and after, and
// conditionally execute the original function.
_.wrap = function(func, wrapper) {
return _.partial(wrapper, func);
};
// Returns a negated version of the passed-in predicate.
_.negate = function(predicate) {
return function() {
return !predicate.apply(this, arguments);
};
};
// Returns a function that is the composition of a list of functions, each
// consuming the return value of the function that follows.
_.compose = function() {
var args = arguments;
var start = args.length - 1;
return function() {
var i = start;
var result = args[start].apply(this, arguments);
while (i--) result = args[i].call(this, result);
return result;
};
};
// Returns a function that will only be executed on and after the Nth call.
_.after = function(times, func) {
return function() {
if (--times < 1) {
return func.apply(this, arguments);
}
};
};
// Returns a function that will only be executed up to (but not including) the Nth call.
_.before = function(times, func) {
var memo;
return function() {
if (--times > 0) {
memo = func.apply(this, arguments);
}
if (times <= 1) func = null;
return memo;
};
};
// Returns a function that will be executed at most one time, no matter how
// often you call it. Useful for lazy initialization.
_.once = _.partial(_.before, 2);
// Object Functions
// ----------------
// Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed.
var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString');
var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString',
'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString'];
function collectNonEnumProps(obj, keys) {
var nonEnumIdx = nonEnumerableProps.length;
var constructor = obj.constructor;
var proto = (_.isFunction(constructor) && constructor.prototype) || ObjProto;
// Constructor is a special case.
var prop = 'constructor';
if (_.has(obj, prop) && !_.contains(keys, prop)) keys.push(prop);
while (nonEnumIdx--) {
prop = nonEnumerableProps[nonEnumIdx];
if (prop in obj && obj[prop] !== proto[prop] && !_.contains(keys, prop)) {
keys.push(prop);
}
}
}
// Retrieve the names of an object's own properties.
// Delegates to **ECMAScript 5**'s native `Object.keys`
_.keys = function(obj) {
if (!_.isObject(obj)) return [];
if (nativeKeys) return nativeKeys(obj);
var keys = [];
for (var key in obj) if (_.has(obj, key)) keys.push(key);
// Ahem, IE < 9.
if (hasEnumBug) collectNonEnumProps(obj, keys);
return keys;
};
// Retrieve all the property names of an object.
_.allKeys = function(obj) {
if (!_.isObject(obj)) return [];
var keys = [];
for (var key in obj) keys.push(key);
// Ahem, IE < 9.
if (hasEnumBug) collectNonEnumProps(obj, keys);
return keys;
};
// Retrieve the values of an object's properties.
_.values = function(obj) {
var keys = _.keys(obj);
var length = keys.length;
var values = Array(length);
for (var i = 0; i < length; i++) {
values[i] = obj[keys[i]];
}
return values;
};
// Returns the results of applying the iteratee to each element of the object
// In contrast to _.map it returns an object
_.mapObject = function(obj, iteratee, context) {
iteratee = cb(iteratee, context);
var keys = _.keys(obj),
length = keys.length,
results = {},
currentKey;
for (var index = 0; index < length; index++) {
currentKey = keys[index];
results[currentKey] = iteratee(obj[currentKey], currentKey, obj);
}
return results;
};
// Convert an object into a list of `[key, value]` pairs.
_.pairs = function(obj) {
var keys = _.keys(obj);
var length = keys.length;
var pairs = Array(length);
for (var i = 0; i < length; i++) {
pairs[i] = [keys[i], obj[keys[i]]];
}
return pairs;
};
// Invert the keys and values of an object. The values must be serializable.
_.invert = function(obj) {
var result = {};
var keys = _.keys(obj);
for (var i = 0, length = keys.length; i < length; i++) {
result[obj[keys[i]]] = keys[i];
}
return result;
};
// Return a sorted list of the function names available on the object.
// Aliased as `methods`
_.functions = _.methods = function(obj) {
var names = [];
for (var key in obj) {
if (_.isFunction(obj[key])) names.push(key);
}
return names.sort();
};
// Extend a given object with all the properties in passed-in object(s).
_.extend = createAssigner(_.allKeys);
// Assigns a given object with all the own properties in the passed-in object(s)
// (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)
_.extendOwn = _.assign = createAssigner(_.keys);
// Returns the first key on an object that passes a predicate test
_.findKey = function(obj, predicate, context) {
predicate = cb(predicate, context);
var keys = _.keys(obj), key;
for (var i = 0, length = keys.length; i < length; i++) {
key = keys[i];
if (predicate(obj[key], key, obj)) return key;
}
};
// Return a copy of the object only containing the whitelisted properties.
_.pick = function(object, oiteratee, context) {
var result = {}, obj = object, iteratee, keys;
if (obj == null) return result;
if (_.isFunction(oiteratee)) {
keys = _.allKeys(obj);
iteratee = optimizeCb(oiteratee, context);
} else {
keys = flatten(arguments, false, false, 1);
iteratee = function(value, key, obj) { return key in obj; };
obj = Object(obj);
}
for (var i = 0, length = keys.length; i < length; i++) {
var key = keys[i];
var value = obj[key];
if (iteratee(value, key, obj)) result[key] = value;
}
return result;
};
// Return a copy of the object without the blacklisted properties.
_.omit = function(obj, iteratee, context) {
if (_.isFunction(iteratee)) {
iteratee = _.negate(iteratee);
} else {
var keys = _.map(flatten(arguments, false, false, 1), String);
iteratee = function(value, key) {
return !_.contains(keys, key);
};
}
return _.pick(obj, iteratee, context);
};
// Fill in a given object with default properties.
_.defaults = createAssigner(_.allKeys, true);
// Creates an object that inherits from the given prototype object.
// If additional properties are provided then they will be added to the
// created object.
_.create = function(prototype, props) {
var result = baseCreate(prototype);
if (props) _.extendOwn(result, props);
return result;
};
// Create a (shallow-cloned) duplicate of an object.
_.clone = function(obj) {
if (!_.isObject(obj)) return obj;
return _.isArray(obj) ? obj.slice() : _.extend({}, obj);
};
// Invokes interceptor with the obj, and then returns obj.
// The primary purpose of this method is to "tap into" a method chain, in
// order to perform operations on intermediate results within the chain.
_.tap = function(obj, interceptor) {
interceptor(obj);
return obj;
};
// Returns whether an object has a given set of `key:value` pairs.
_.isMatch = function(object, attrs) {
var keys = _.keys(attrs), length = keys.length;
if (object == null) return !length;
var obj = Object(object);
for (var i = 0; i < length; i++) {
var key = keys[i];
if (attrs[key] !== obj[key] || !(key in obj)) return false;
}
return true;
};
// Internal recursive comparison function for `isEqual`.
var eq = function(a, b, aStack, bStack) {
// Identical objects are equal. `0 === -0`, but they aren't identical.
// See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).
if (a === b) return a !== 0 || 1 / a === 1 / b;
// A strict comparison is necessary because `null == undefined`.
if (a == null || b == null) return a === b;
// Unwrap any wrapped objects.
if (a instanceof _) a = a._wrapped;
if (b instanceof _) b = b._wrapped;
// Compare `[[Class]]` names.
var className = toString.call(a);
if (className !== toString.call(b)) return false;
switch (className) {
// Strings, numbers, regular expressions, dates, and booleans are compared by value.
case '[object RegExp]':
// RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')
case '[object String]':
// Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is
// equivalent to `new String("5")`.
return '' + a === '' + b;
case '[object Number]':
// `NaN`s are equivalent, but non-reflexive.
// Object(NaN) is equivalent to NaN
if (+a !== +a) return +b !== +b;
// An `egal` comparison is performed for other numeric values.
return +a === 0 ? 1 / +a === 1 / b : +a === +b;
case '[object Date]':
case '[object Boolean]':
// Coerce dates and booleans to numeric primitive values. Dates are compared by their
// millisecond representations. Note that invalid dates with millisecond representations
// of `NaN` are not equivalent.
return +a === +b;
}
var areArrays = className === '[object Array]';
if (!areArrays) {
if (typeof a != 'object' || typeof b != 'object') return false;
// Objects with different constructors are not equivalent, but `Object`s or `Array`s
// from different frames are.
var aCtor = a.constructor, bCtor = b.constructor;
if (aCtor !== bCtor && !(_.isFunction(aCtor) && aCtor instanceof aCtor &&
_.isFunction(bCtor) && bCtor instanceof bCtor)
&& ('constructor' in a && 'constructor' in b)) {
return false;
}
}
// Assume equality for cyclic structures. The algorithm for detecting cyclic
// structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.
// Initializing stack of traversed objects.
// It's done here since we only need them for objects and arrays comparison.
aStack = aStack || [];
bStack = bStack || [];
var length = aStack.length;
while (length--) {
// Linear search. Performance is inversely proportional to the number of
// unique nested structures.
if (aStack[length] === a) return bStack[length] === b;
}
// Add the first object to the stack of traversed objects.
aStack.push(a);
bStack.push(b);
// Recursively compare objects and arrays.
if (areArrays) {
// Compare array lengths to determine if a deep comparison is necessary.
length = a.length;
if (length !== b.length) return false;
// Deep compare the contents, ignoring non-numeric properties.
while (length--) {
if (!eq(a[length], b[length], aStack, bStack)) return false;
}
} else {
// Deep compare objects.
var keys = _.keys(a), key;
length = keys.length;
// Ensure that both objects contain the same number of properties before comparing deep equality.
if (_.keys(b).length !== length) return false;
while (length--) {
// Deep compare each member
key = keys[length];
if (!(_.has(b, key) && eq(a[key], b[key], aStack, bStack))) return false;
}
}
// Remove the first object from the stack of traversed objects.
aStack.pop();
bStack.pop();
return true;
};
// Perform a deep comparison to check if two objects are equal.
_.isEqual = function(a, b) {
return eq(a, b);
};
// Is a given array, string, or object empty?
// An "empty" object has no enumerable own-properties.
_.isEmpty = function(obj) {
if (obj == null) return true;
if (isArrayLike(obj) && (_.isArray(obj) || _.isString(obj) || _.isArguments(obj))) return obj.length === 0;
return _.keys(obj).length === 0;
};
// Is a given value a DOM element?
_.isElement = function(obj) {
return !!(obj && obj.nodeType === 1);
};
// Is a given value an array?
// Delegates to ECMA5's native Array.isArray
_.isArray = nativeIsArray || function(obj) {
return toString.call(obj) === '[object Array]';
};
// Is a given variable an object?
_.isObject = function(obj) {
var type = typeof obj;
return type === 'function' || type === 'object' && !!obj;
};
// Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp, isError.
_.each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp', 'Error'], function(name) {
_['is' + name] = function(obj) {
return toString.call(obj) === '[object ' + name + ']';
};
});
// Define a fallback version of the method in browsers (ahem, IE < 9), where
// there isn't any inspectable "Arguments" type.
if (!_.isArguments(arguments)) {
_.isArguments = function(obj) {
return _.has(obj, 'callee');
};
}
// Optimize `isFunction` if appropriate. Work around some typeof bugs in old v8,
// IE 11 (#1621), and in Safari 8 (#1929).
if (typeof /./ != 'function' && typeof Int8Array != 'object') {
_.isFunction = function(obj) {
return typeof obj == 'function' || false;
};
}
// Is a given object a finite number?
_.isFinite = function(obj) {
return isFinite(obj) && !isNaN(parseFloat(obj));
};
// Is the given value `NaN`? (NaN is the only number which does not equal itself).
_.isNaN = function(obj) {
return _.isNumber(obj) && obj !== +obj;
};
// Is a given value a boolean?
_.isBoolean = function(obj) {
return obj === true || obj === false || toString.call(obj) === '[object Boolean]';
};
// Is a given value equal to null?
_.isNull = function(obj) {
return obj === null;
};
// Is a given variable undefined?
_.isUndefined = function(obj) {
return obj === void 0;
};
// Shortcut function for checking if an object has a given property directly
// on itself (in other words, not on a prototype).
_.has = function(obj, key) {
return obj != null && hasOwnProperty.call(obj, key);
};
// Utility Functions
// -----------------
// Run Underscore.js in *noConflict* mode, returning the `_` variable to its
// previous owner. Returns a reference to the Underscore object.
_.noConflict = function() {
root._ = previousUnderscore;
return this;
};
// Keep the identity function around for default iteratees.
_.identity = function(value) {
return value;
};
// Predicate-generating functions. Often useful outside of Underscore.
_.constant = function(value) {
return function() {
return value;
};
};
_.noop = function(){};
_.property = property;
// Generates a function for a given object that returns a given property.
_.propertyOf = function(obj) {
return obj == null ? function(){} : function(key) {
return obj[key];
};
};
// Returns a predicate for checking whether an object has a given set of
// `key:value` pairs.
_.matcher = _.matches = function(attrs) {
attrs = _.extendOwn({}, attrs);
return function(obj) {
return _.isMatch(obj, attrs);
};
};
// Run a function **n** times.
_.times = function(n, iteratee, context) {
var accum = Array(Math.max(0, n));
iteratee = optimizeCb(iteratee, context, 1);
for (var i = 0; i < n; i++) accum[i] = iteratee(i);
return accum;
};
// Return a random integer between min and max (inclusive).
_.random = function(min, max) {
if (max == null) {
max = min;
min = 0;
}
return min + Math.floor(Math.random() * (max - min + 1));
};
// A (possibly faster) way to get the current timestamp as an integer.
_.now = Date.now || function() {
return new Date().getTime();
};
// List of HTML entities for escaping.
var escapeMap = {
'&': '&',
'<': '<',
'>': '>',
'"': '"',
"'": ''',
'`': '`'
};
var unescapeMap = _.invert(escapeMap);
// Functions for escaping and unescaping strings to/from HTML interpolation.
var createEscaper = function(map) {
var escaper = function(match) {
return map[match];
};
// Regexes for identifying a key that needs to be escaped
var source = '(?:' + _.keys(map).join('|') + ')';
var testRegexp = RegExp(source);
var replaceRegexp = RegExp(source, 'g');
return function(string) {
string = string == null ? '' : '' + string;
return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;
};
};
_.escape = createEscaper(escapeMap);
_.unescape = createEscaper(unescapeMap);
// If the value of the named `property` is a function then invoke it with the
// `object` as context; otherwise, return it.
_.result = function(object, property, fallback) {
var value = object == null ? void 0 : object[property];
if (value === void 0) {
value = fallback;
}
return _.isFunction(value) ? value.call(object) : value;
};
// Generate a unique integer id (unique within the entire client session).
// Useful for temporary DOM ids.
var idCounter = 0;
_.uniqueId = function(prefix) {
var id = ++idCounter + '';
return prefix ? prefix + id : id;
};
// By default, Underscore uses ERB-style template delimiters, change the
// following template settings to use alternative delimiters.
_.templateSettings = {
evaluate : /<%([\s\S]+?)%>/g,
interpolate : /<%=([\s\S]+?)%>/g,
escape : /<%-([\s\S]+?)%>/g
};
// When customizing `templateSettings`, if you don't want to define an
// interpolation, evaluation or escaping regex, we need one that is
// guaranteed not to match.
var noMatch = /(.)^/;
// Certain characters need to be escaped so that they can be put into a
// string literal.
var escapes = {
"'": "'",
'\\': '\\',
'\r': 'r',
'\n': 'n',
'\u2028': 'u2028',
'\u2029': 'u2029'
};
var escaper = /\\|'|\r|\n|\u2028|\u2029/g;
var escapeChar = function(match) {
return '\\' + escapes[match];
};
// JavaScript micro-templating, similar to John Resig's implementation.
// Underscore templating handles arbitrary delimiters, preserves whitespace,
// and correctly escapes quotes within interpolated code.
// NB: `oldSettings` only exists for backwards compatibility.
_.template = function(text, settings, oldSettings) {
if (!settings && oldSettings) settings = oldSettings;
settings = _.defaults({}, settings, _.templateSettings);
// Combine delimiters into one regular expression via alternation.
var matcher = RegExp([
(settings.escape || noMatch).source,
(settings.interpolate || noMatch).source,
(settings.evaluate || noMatch).source
].join('|') + '|$', 'g');
// Compile the template source, escaping string literals appropriately.
var index = 0;
var source = "__p+='";
text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {
source += text.slice(index, offset).replace(escaper, escapeChar);
index = offset + match.length;
if (escape) {
source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'";
} else if (interpolate) {
source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'";
} else if (evaluate) {
source += "';\n" + evaluate + "\n__p+='";
}
// Adobe VMs need the match returned to produce the correct offest.
return match;
});
source += "';\n";
// If a variable is not specified, place data values in local scope.
if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n';
source = "var __t,__p='',__j=Array.prototype.join," +
"print=function(){__p+=__j.call(arguments,'');};\n" +
source + 'return __p;\n';
try {
var render = new Function(settings.variable || 'obj', '_', source);
} catch (e) {
e.source = source;
throw e;
}
var template = function(data) {
return render.call(this, data, _);
};
// Provide the compiled source as a convenience for precompilation.
var argument = settings.variable || 'obj';
template.source = 'function(' + argument + '){\n' + source + '}';
return template;
};
// Add a "chain" function. Start chaining a wrapped Underscore object.
_.chain = function(obj) {
var instance = _(obj);
instance._chain = true;
return instance;
};
// OOP
// ---------------
// If Underscore is called as a function, it returns a wrapped object that
// can be used OO-style. This wrapper holds altered versions of all the
// underscore functions. Wrapped objects may be chained.
// Helper function to continue chaining intermediate results.
var result = function(instance, obj) {
return instance._chain ? _(obj).chain() : obj;
};
// Add your own custom functions to the Underscore object.
_.mixin = function(obj) {
_.each(_.functions(obj), function(name) {
var func = _[name] = obj[name];
_.prototype[name] = function() {
var args = [this._wrapped];
push.apply(args, arguments);
return result(this, func.apply(_, args));
};
});
};
// Add all of the Underscore functions to the wrapper object.
_.mixin(_);
// Add all mutator Array functions to the wrapper.
_.each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
var method = ArrayProto[name];
_.prototype[name] = function() {
var obj = this._wrapped;
method.apply(obj, arguments);
if ((name === 'shift' || name === 'splice') && obj.length === 0) delete obj[0];
return result(this, obj);
};
});
// Add all accessor Array functions to the wrapper.
_.each(['concat', 'join', 'slice'], function(name) {
var method = ArrayProto[name];
_.prototype[name] = function() {
return result(this, method.apply(this._wrapped, arguments));
};
});
// Extracts the result from a wrapped and chained object.
_.prototype.value = function() {
return this._wrapped;
};
// Provide unwrapping proxy for some methods used in engine operations
// such as arithmetic and JSON stringification.
_.prototype.valueOf = _.prototype.toJSON = _.prototype.value;
_.prototype.toString = function() {
return '' + this._wrapped;
};
// AMD registration happens at the end for compatibility with AMD loaders
// that may not enforce next-turn semantics on modules. Even though general
// practice for AMD registration is to be anonymous, underscore registers
// as a named module because, like jQuery, it is a base library that is
// popular enough to be bundled in a third party lib, but not be part of
// an AMD load request. Those cases could generate an error when an
// anonymous define() is called outside of a loader request.
if (true) {
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function() {
return _;
}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
}
}.call(this));
/***/ },
/* 531 */
/*!*****************************************!*\
!*** ./app/helpers/submodalContexts.js ***!
\*****************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.stoStrHelp = exports.fastFileHelp = undefined;
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _semanticUiReact = __webpack_require__(/*! semantic-ui-react */ 532);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var ffhRead = function ffhRead() {
return _react2.default.createElement(
_semanticUiReact.Accordion,
{ defaultActiveIndex: 0, styled: true },
_react2.default.createElement(
_semanticUiReact.Accordion.Title,
{ as: 'h3' },
_react2.default.createElement(_semanticUiReact.Icon, { name: 'tasks' }),
'Details and References'
),
_react2.default.createElement(
_semanticUiReact.Accordion.Content,
{
style: { paddingLeft: '10px' }
},
_react2.default.createElement(_semanticUiReact.Header, {
as: 'h5',
content: 'This is where you begin your ticket by inputing basic data',
dividing: true
}),
_react2.default.createElement(
_semanticUiReact.List,
{ bulleted: true, relaxed: true },
_react2.default.createElement(
_semanticUiReact.List.Item,
null,
_react2.default.createElement(
'strong',
null,
'Summary:'
),
' This will be the name of your ticket and is a general overview of what you are observing'
),
_react2.default.createElement(
_semanticUiReact.List.Item,
null,
_react2.default.createElement(
'strong',
null,
'Category:'
),
' Select from a list of options to help define the impact of the reported issue'
),
_react2.default.createElement(
_semanticUiReact.List.Item,
null,
_react2.default.createElement(
'strong',
null,
'Component:'
),
' Select the element of the product relating to your issue'
),
_react2.default.createElement(
_semanticUiReact.List.Item,
null,
_react2.default.createElement(
'strong',
null,
'References:'
),
' Here you can paste in entire blobs of text and Fast File will pull out relevant details like EIDs and OIDs'
)
)
),
_react2.default.createElement(
_semanticUiReact.Accordion.Title,
{
as: 'h3'
},
_react2.default.createElement(_semanticUiReact.Icon, { name: 'ordered list' }),
'Steps'
),
_react2.default.createElement(
_semanticUiReact.Accordion.Content,
{
style: { paddingLeft: '10px' }
},
_react2.default.createElement(_semanticUiReact.Header, {
as: 'h5',
content: 'Here you can outline the steps needed for someone else to see the behavior you are reporting',
dividing: true
}),
_react2.default.createElement(
_semanticUiReact.List,
{ bulleted: true, relaxed: true },
_react2.default.createElement(
_semanticUiReact.List.Item,
null,
_react2.default.createElement(
'strong',
null,
'Observe:'
),
' These steps can include instructions to view a particular account, event, or order'
),
_react2.default.createElement(
_semanticUiReact.List.Item,
null,
_react2.default.createElement(
'strong',
null,
'Reproduce:'
),
' Steps to reproduce this issue from scratch in a brand new account or event'
)
)
),
_react2.default.createElement(
_semanticUiReact.Accordion.Title,
{
as: 'h3'
},
_react2.default.createElement(_semanticUiReact.Icon, { name: 'image' }),
'Screenshots & Files'
),
_react2.default.createElement(
_semanticUiReact.Accordion.Content,
{
style: { paddingLeft: '10px' }
},
_react2.default.createElement(_semanticUiReact.Header, {
as: 'h5',
content: 'Add pertinent files and attach screenshots that demonstrate your report',
dividing: true
}),
_react2.default.createElement(
_semanticUiReact.List,
{ bulleted: true, relaxed: true },
_react2.default.createElement(
_semanticUiReact.List.Item,
null,
_react2.default.createElement(
'strong',
null,
'Uploading:'
),
' Click on the uploader, or drag a file over the uploader'
),
_react2.default.createElement(
_semanticUiReact.List.Item,
null,
_react2.default.createElement(
'strong',
null,
'Preview:'
),
' You can preview or remove your files by clicking the buttons that appear when mousing over the thumbnail'
)
),
_react2.default.createElement('br', null)
)
);
};
var stohRead = function stohRead() {
return _react2.default.createElement(
_semanticUiReact.Accordion,
{ defaultActiveIndex: 0, styled: true },
_react2.default.createElement(
_semanticUiReact.Accordion.Title,
{ as: 'h3' },
_react2.default.createElement(_semanticUiReact.Icon, { name: 'image' }),
'Steps to ',
_react2.default.createElement(
'strong',
null,
'observe'
)
),
_react2.default.createElement(
_semanticUiReact.Accordion.Content,
{
style: { paddingLeft: '10px' }
},
_react2.default.createElement(_semanticUiReact.Header, {
as: 'h5',
content: 'Describe exactly how to experience the issue, step by step',
dividing: true
}),
_react2.default.createElement(
'p',
null,
'Steps to observe provide a walkthrough for seeing what the reporting user is seeing. This can include directions to view a particular event page. order, or report. These steps should be nearly identical to the steps you took when you observed the issue. It is good practice once you have written out the steps to follow them yourself to determine if you can observe the issue using only the information included within them. If not, consider updating the steps with the relevant information.'
)
),
_react2.default.createElement(
_semanticUiReact.Accordion.Title,
{
as: 'h3'
},
_react2.default.createElement(_semanticUiReact.Icon, { name: 'image' }),
'Steps to ',
_react2.default.createElement(
'strong',
null,
'reproduce'
)
),
_react2.default.createElement(
_semanticUiReact.Accordion.Content,
{
style: { paddingLeft: '10px' }
},
_react2.default.createElement(_semanticUiReact.Header, {
as: 'h5',
content: 'From a new account or event, describe how the issue can be observed',
dividing: true
}),
_react2.default.createElement(
'p',
null,
'Steps to reproduce are preferred when available, but certainly not required. Being able to observe the issue in a new account or event helps those investigating the issue determine the root cause. These steps often begin with \'create a new event\' and include detailed instructions on how a new Eventbrite user may encounter the reported issue. Just like with steps to observe, it is best practice to walk through these steps yourself after writing them to confirm that all the information needed to reproduce the behavior is included.'
)
)
);
};
var fastFileHelp = exports.fastFileHelp = {
embedId: 'nO6Sy6rx49k',
openStatus: false,
readContent: ffhRead,
title: 'How to use Fast File'
};
var stoStrHelp = exports.stoStrHelp = {
embedId: 'nO6Sy6rx49k',
openStatus: false,
readContent: stohRead,
title: 'What\'s the difference between STR and STO?'
};
/***/ },
/* 532 */
/*!****************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/index.js ***!
\****************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _Confirm = __webpack_require__(/*! ./addons/Confirm */ 533);
Object.defineProperty(exports, 'Confirm', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Confirm).default;
}
});
var _Portal = __webpack_require__(/*! ./addons/Portal */ 852);
Object.defineProperty(exports, 'Portal', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Portal).default;
}
});
var _Radio = __webpack_require__(/*! ./addons/Radio */ 875);
Object.defineProperty(exports, 'Radio', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Radio).default;
}
});
var _Select = __webpack_require__(/*! ./addons/Select */ 879);
Object.defineProperty(exports, 'Select', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Select).default;
}
});
var _TextArea = __webpack_require__(/*! ./addons/TextArea */ 901);
Object.defineProperty(exports, 'TextArea', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_TextArea).default;
}
});
var _Breadcrumb = __webpack_require__(/*! ./collections/Breadcrumb */ 903);
Object.defineProperty(exports, 'Breadcrumb', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Breadcrumb).default;
}
});
var _BreadcrumbDivider = __webpack_require__(/*! ./collections/Breadcrumb/BreadcrumbDivider */ 905);
Object.defineProperty(exports, 'BreadcrumbDivider', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_BreadcrumbDivider).default;
}
});
var _BreadcrumbSection = __webpack_require__(/*! ./collections/Breadcrumb/BreadcrumbSection */ 906);
Object.defineProperty(exports, 'BreadcrumbSection', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_BreadcrumbSection).default;
}
});
var _Form = __webpack_require__(/*! ./collections/Form */ 907);
Object.defineProperty(exports, 'Form', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Form).default;
}
});
var _FormButton = __webpack_require__(/*! ./collections/Form/FormButton */ 909);
Object.defineProperty(exports, 'FormButton', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_FormButton).default;
}
});
var _FormCheckbox = __webpack_require__(/*! ./collections/Form/FormCheckbox */ 911);
Object.defineProperty(exports, 'FormCheckbox', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_FormCheckbox).default;
}
});
var _FormDropdown = __webpack_require__(/*! ./collections/Form/FormDropdown */ 912);
Object.defineProperty(exports, 'FormDropdown', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_FormDropdown).default;
}
});
var _FormField = __webpack_require__(/*! ./collections/Form/FormField */ 910);
Object.defineProperty(exports, 'FormField', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_FormField).default;
}
});
var _FormGroup = __webpack_require__(/*! ./collections/Form/FormGroup */ 913);
Object.defineProperty(exports, 'FormGroup', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_FormGroup).default;
}
});
var _FormInput = __webpack_require__(/*! ./collections/Form/FormInput */ 914);
Object.defineProperty(exports, 'FormInput', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_FormInput).default;
}
});
var _FormRadio = __webpack_require__(/*! ./collections/Form/FormRadio */ 917);
Object.defineProperty(exports, 'FormRadio', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_FormRadio).default;
}
});
var _FormSelect = __webpack_require__(/*! ./collections/Form/FormSelect */ 918);
Object.defineProperty(exports, 'FormSelect', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_FormSelect).default;
}
});
var _FormTextArea = __webpack_require__(/*! ./collections/Form/FormTextArea */ 919);
Object.defineProperty(exports, 'FormTextArea', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_FormTextArea).default;
}
});
var _Grid = __webpack_require__(/*! ./collections/Grid */ 920);
Object.defineProperty(exports, 'Grid', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Grid).default;
}
});
var _GridColumn = __webpack_require__(/*! ./collections/Grid/GridColumn */ 922);
Object.defineProperty(exports, 'GridColumn', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_GridColumn).default;
}
});
var _GridRow = __webpack_require__(/*! ./collections/Grid/GridRow */ 923);
Object.defineProperty(exports, 'GridRow', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_GridRow).default;
}
});
var _Menu = __webpack_require__(/*! ./collections/Menu */ 924);
Object.defineProperty(exports, 'Menu', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Menu).default;
}
});
var _MenuHeader = __webpack_require__(/*! ./collections/Menu/MenuHeader */ 926);
Object.defineProperty(exports, 'MenuHeader', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_MenuHeader).default;
}
});
var _MenuItem = __webpack_require__(/*! ./collections/Menu/MenuItem */ 927);
Object.defineProperty(exports, 'MenuItem', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_MenuItem).default;
}
});
var _MenuMenu = __webpack_require__(/*! ./collections/Menu/MenuMenu */ 944);
Object.defineProperty(exports, 'MenuMenu', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_MenuMenu).default;
}
});
var _Message = __webpack_require__(/*! ./collections/Message */ 945);
Object.defineProperty(exports, 'Message', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Message).default;
}
});
var _MessageContent = __webpack_require__(/*! ./collections/Message/MessageContent */ 947);
Object.defineProperty(exports, 'MessageContent', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_MessageContent).default;
}
});
var _MessageHeader = __webpack_require__(/*! ./collections/Message/MessageHeader */ 948);
Object.defineProperty(exports, 'MessageHeader', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_MessageHeader).default;
}
});
var _MessageItem = __webpack_require__(/*! ./collections/Message/MessageItem */ 950);
Object.defineProperty(exports, 'MessageItem', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_MessageItem).default;
}
});
var _MessageList = __webpack_require__(/*! ./collections/Message/MessageList */ 949);
Object.defineProperty(exports, 'MessageList', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_MessageList).default;
}
});
var _Table = __webpack_require__(/*! ./collections/Table */ 951);
Object.defineProperty(exports, 'Table', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Table).default;
}
});
var _TableBody = __webpack_require__(/*! ./collections/Table/TableBody */ 953);
Object.defineProperty(exports, 'TableBody', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_TableBody).default;
}
});
var _TableCell = __webpack_require__(/*! ./collections/Table/TableCell */ 954);
Object.defineProperty(exports, 'TableCell', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_TableCell).default;
}
});
var _TableFooter = __webpack_require__(/*! ./collections/Table/TableFooter */ 955);
Object.defineProperty(exports, 'TableFooter', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_TableFooter).default;
}
});
var _TableHeader = __webpack_require__(/*! ./collections/Table/TableHeader */ 956);
Object.defineProperty(exports, 'TableHeader', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_TableHeader).default;
}
});
var _TableHeaderCell = __webpack_require__(/*! ./collections/Table/TableHeaderCell */ 957);
Object.defineProperty(exports, 'TableHeaderCell', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_TableHeaderCell).default;
}
});
var _TableRow = __webpack_require__(/*! ./collections/Table/TableRow */ 958);
Object.defineProperty(exports, 'TableRow', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_TableRow).default;
}
});
var _Button = __webpack_require__(/*! ./elements/Button/Button */ 844);
Object.defineProperty(exports, 'Button', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Button).default;
}
});
var _ButtonContent = __webpack_require__(/*! ./elements/Button/ButtonContent */ 862);
Object.defineProperty(exports, 'ButtonContent', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_ButtonContent).default;
}
});
var _ButtonGroup = __webpack_require__(/*! ./elements/Button/ButtonGroup */ 863);
Object.defineProperty(exports, 'ButtonGroup', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_ButtonGroup).default;
}
});
var _ButtonOr = __webpack_require__(/*! ./elements/Button/ButtonOr */ 864);
Object.defineProperty(exports, 'ButtonOr', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_ButtonOr).default;
}
});
var _Container = __webpack_require__(/*! ./elements/Container */ 959);
Object.defineProperty(exports, 'Container', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Container).default;
}
});
var _Divider = __webpack_require__(/*! ./elements/Divider */ 961);
Object.defineProperty(exports, 'Divider', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Divider).default;
}
});
var _Flag = __webpack_require__(/*! ./elements/Flag */ 896);
Object.defineProperty(exports, 'Flag', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Flag).default;
}
});
var _Header = __webpack_require__(/*! ./elements/Header */ 963);
Object.defineProperty(exports, 'Header', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Header).default;
}
});
var _HeaderContent = __webpack_require__(/*! ./elements/Header/HeaderContent */ 966);
Object.defineProperty(exports, 'HeaderContent', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_HeaderContent).default;
}
});
var _HeaderSubheader = __webpack_require__(/*! ./elements/Header/HeaderSubheader */ 965);
Object.defineProperty(exports, 'HeaderSubheader', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_HeaderSubheader).default;
}
});
var _Icon = __webpack_require__(/*! ./elements/Icon */ 874);
Object.defineProperty(exports, 'Icon', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Icon).default;
}
});
var _IconGroup = __webpack_require__(/*! ./elements/Icon/IconGroup */ 847);
Object.defineProperty(exports, 'IconGroup', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_IconGroup).default;
}
});
var _Image = __webpack_require__(/*! ./elements/Image */ 898);
Object.defineProperty(exports, 'Image', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Image).default;
}
});
var _ImageGroup = __webpack_require__(/*! ./elements/Image/ImageGroup */ 859);
Object.defineProperty(exports, 'ImageGroup', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_ImageGroup).default;
}
});
var _Input = __webpack_require__(/*! ./elements/Input */ 915);
Object.defineProperty(exports, 'Input', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Input).default;
}
});
var _Label = __webpack_require__(/*! ./elements/Label */ 893);
Object.defineProperty(exports, 'Label', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Label).default;
}
});
var _LabelDetail = __webpack_require__(/*! ./elements/Label/LabelDetail */ 860);
Object.defineProperty(exports, 'LabelDetail', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_LabelDetail).default;
}
});
var _LabelGroup = __webpack_require__(/*! ./elements/Label/LabelGroup */ 861);
Object.defineProperty(exports, 'LabelGroup', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_LabelGroup).default;
}
});
var _List = __webpack_require__(/*! ./elements/List */ 967);
Object.defineProperty(exports, 'List', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_List).default;
}
});
var _ListContent = __webpack_require__(/*! ./elements/List/ListContent */ 969);
Object.defineProperty(exports, 'ListContent', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_ListContent).default;
}
});
var _ListDescription = __webpack_require__(/*! ./elements/List/ListDescription */ 970);
Object.defineProperty(exports, 'ListDescription', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_ListDescription).default;
}
});
var _ListHeader = __webpack_require__(/*! ./elements/List/ListHeader */ 971);
Object.defineProperty(exports, 'ListHeader', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_ListHeader).default;
}
});
var _ListIcon = __webpack_require__(/*! ./elements/List/ListIcon */ 972);
Object.defineProperty(exports, 'ListIcon', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_ListIcon).default;
}
});
var _ListItem = __webpack_require__(/*! ./elements/List/ListItem */ 973);
Object.defineProperty(exports, 'ListItem', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_ListItem).default;
}
});
var _ListList = __webpack_require__(/*! ./elements/List/ListList */ 974);
Object.defineProperty(exports, 'ListList', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_ListList).default;
}
});
var _Loader = __webpack_require__(/*! ./elements/Loader */ 975);
Object.defineProperty(exports, 'Loader', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Loader).default;
}
});
var _Rail = __webpack_require__(/*! ./elements/Rail */ 977);
Object.defineProperty(exports, 'Rail', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Rail).default;
}
});
var _Reveal = __webpack_require__(/*! ./elements/Reveal */ 979);
Object.defineProperty(exports, 'Reveal', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Reveal).default;
}
});
var _RevealContent = __webpack_require__(/*! ./elements/Reveal/RevealContent */ 981);
Object.defineProperty(exports, 'RevealContent', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_RevealContent).default;
}
});
var _Segment = __webpack_require__(/*! ./elements/Segment */ 982);
Object.defineProperty(exports, 'Segment', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Segment).default;
}
});
var _SegmentGroup = __webpack_require__(/*! ./elements/Segment/SegmentGroup */ 984);
Object.defineProperty(exports, 'SegmentGroup', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_SegmentGroup).default;
}
});
var _Step = __webpack_require__(/*! ./elements/Step */ 985);
Object.defineProperty(exports, 'Step', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Step).default;
}
});
var _StepContent = __webpack_require__(/*! ./elements/Step/StepContent */ 987);
Object.defineProperty(exports, 'StepContent', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_StepContent).default;
}
});
var _StepDescription = __webpack_require__(/*! ./elements/Step/StepDescription */ 988);
Object.defineProperty(exports, 'StepDescription', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_StepDescription).default;
}
});
var _StepGroup = __webpack_require__(/*! ./elements/Step/StepGroup */ 990);
Object.defineProperty(exports, 'StepGroup', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_StepGroup).default;
}
});
var _StepTitle = __webpack_require__(/*! ./elements/Step/StepTitle */ 989);
Object.defineProperty(exports, 'StepTitle', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_StepTitle).default;
}
});
var _Accordion = __webpack_require__(/*! ./modules/Accordion/Accordion */ 991);
Object.defineProperty(exports, 'Accordion', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Accordion).default;
}
});
var _AccordionContent = __webpack_require__(/*! ./modules/Accordion/AccordionContent */ 992);
Object.defineProperty(exports, 'AccordionContent', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_AccordionContent).default;
}
});
var _AccordionTitle = __webpack_require__(/*! ./modules/Accordion/AccordionTitle */ 993);
Object.defineProperty(exports, 'AccordionTitle', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_AccordionTitle).default;
}
});
var _Checkbox = __webpack_require__(/*! ./modules/Checkbox */ 877);
Object.defineProperty(exports, 'Checkbox', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Checkbox).default;
}
});
var _Dimmer = __webpack_require__(/*! ./modules/Dimmer */ 850);
Object.defineProperty(exports, 'Dimmer', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Dimmer).default;
}
});
var _DimmerDimmable = __webpack_require__(/*! ./modules/Dimmer/DimmerDimmable */ 858);
Object.defineProperty(exports, 'DimmerDimmable', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_DimmerDimmable).default;
}
});
var _Dropdown = __webpack_require__(/*! ./modules/Dropdown */ 881);
Object.defineProperty(exports, 'Dropdown', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Dropdown).default;
}
});
var _DropdownDivider = __webpack_require__(/*! ./modules/Dropdown/DropdownDivider */ 894);
Object.defineProperty(exports, 'DropdownDivider', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_DropdownDivider).default;
}
});
var _DropdownHeader = __webpack_require__(/*! ./modules/Dropdown/DropdownHeader */ 899);
Object.defineProperty(exports, 'DropdownHeader', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_DropdownHeader).default;
}
});
var _DropdownItem = __webpack_require__(/*! ./modules/Dropdown/DropdownItem */ 895);
Object.defineProperty(exports, 'DropdownItem', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_DropdownItem).default;
}
});
var _DropdownMenu = __webpack_require__(/*! ./modules/Dropdown/DropdownMenu */ 900);
Object.defineProperty(exports, 'DropdownMenu', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_DropdownMenu).default;
}
});
var _Embed = __webpack_require__(/*! ./modules/Embed */ 994);
Object.defineProperty(exports, 'Embed', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Embed).default;
}
});
var _Modal = __webpack_require__(/*! ./modules/Modal */ 865);
Object.defineProperty(exports, 'Modal', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Modal).default;
}
});
var _ModalActions = __webpack_require__(/*! ./modules/Modal/ModalActions */ 872);
Object.defineProperty(exports, 'ModalActions', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_ModalActions).default;
}
});
var _ModalContent = __webpack_require__(/*! ./modules/Modal/ModalContent */ 871);
Object.defineProperty(exports, 'ModalContent', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_ModalContent).default;
}
});
var _ModalDescription = __webpack_require__(/*! ./modules/Modal/ModalDescription */ 873);
Object.defineProperty(exports, 'ModalDescription', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_ModalDescription).default;
}
});
var _ModalHeader = __webpack_require__(/*! ./modules/Modal/ModalHeader */ 870);
Object.defineProperty(exports, 'ModalHeader', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_ModalHeader).default;
}
});
var _Popup = __webpack_require__(/*! ./modules/Popup */ 996);
Object.defineProperty(exports, 'Popup', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Popup).default;
}
});
var _PopupContent = __webpack_require__(/*! ./modules/Popup/PopupContent */ 1001);
Object.defineProperty(exports, 'PopupContent', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_PopupContent).default;
}
});
var _PopupHeader = __webpack_require__(/*! ./modules/Popup/PopupHeader */ 1002);
Object.defineProperty(exports, 'PopupHeader', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_PopupHeader).default;
}
});
var _Progress = __webpack_require__(/*! ./modules/Progress */ 1003);
Object.defineProperty(exports, 'Progress', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Progress).default;
}
});
var _Rating = __webpack_require__(/*! ./modules/Rating */ 1008);
Object.defineProperty(exports, 'Rating', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Rating).default;
}
});
var _RatingIcon = __webpack_require__(/*! ./modules/Rating/RatingIcon */ 1010);
Object.defineProperty(exports, 'RatingIcon', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_RatingIcon).default;
}
});
var _Search = __webpack_require__(/*! ./modules/Search */ 1011);
Object.defineProperty(exports, 'Search', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Search).default;
}
});
var _SearchCategory = __webpack_require__(/*! ./modules/Search/SearchCategory */ 1016);
Object.defineProperty(exports, 'SearchCategory', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_SearchCategory).default;
}
});
var _SearchResult = __webpack_require__(/*! ./modules/Search/SearchResult */ 1017);
Object.defineProperty(exports, 'SearchResult', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_SearchResult).default;
}
});
var _SearchResults = __webpack_require__(/*! ./modules/Search/SearchResults */ 1018);
Object.defineProperty(exports, 'SearchResults', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_SearchResults).default;
}
});
var _Sidebar = __webpack_require__(/*! ./modules/Sidebar */ 1019);
Object.defineProperty(exports, 'Sidebar', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Sidebar).default;
}
});
var _SidebarPushable = __webpack_require__(/*! ./modules/Sidebar/SidebarPushable */ 1021);
Object.defineProperty(exports, 'SidebarPushable', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_SidebarPushable).default;
}
});
var _SidebarPusher = __webpack_require__(/*! ./modules/Sidebar/SidebarPusher */ 1022);
Object.defineProperty(exports, 'SidebarPusher', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_SidebarPusher).default;
}
});
var _Card = __webpack_require__(/*! ./views/Card/Card */ 1023);
Object.defineProperty(exports, 'Card', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Card).default;
}
});
var _CardContent = __webpack_require__(/*! ./views/Card/CardContent */ 1024);
Object.defineProperty(exports, 'CardContent', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_CardContent).default;
}
});
var _CardDescription = __webpack_require__(/*! ./views/Card/CardDescription */ 1025);
Object.defineProperty(exports, 'CardDescription', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_CardDescription).default;
}
});
var _CardGroup = __webpack_require__(/*! ./views/Card/CardGroup */ 1028);
Object.defineProperty(exports, 'CardGroup', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_CardGroup).default;
}
});
var _CardHeader = __webpack_require__(/*! ./views/Card/CardHeader */ 1026);
Object.defineProperty(exports, 'CardHeader', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_CardHeader).default;
}
});
var _CardMeta = __webpack_require__(/*! ./views/Card/CardMeta */ 1027);
Object.defineProperty(exports, 'CardMeta', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_CardMeta).default;
}
});
var _Comment = __webpack_require__(/*! ./views/Comment */ 1029);
Object.defineProperty(exports, 'Comment', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Comment).default;
}
});
var _CommentAction = __webpack_require__(/*! ./views/Comment/CommentAction */ 1031);
Object.defineProperty(exports, 'CommentAction', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_CommentAction).default;
}
});
var _CommentActions = __webpack_require__(/*! ./views/Comment/CommentActions */ 1032);
Object.defineProperty(exports, 'CommentActions', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_CommentActions).default;
}
});
var _CommentAuthor = __webpack_require__(/*! ./views/Comment/CommentAuthor */ 1033);
Object.defineProperty(exports, 'CommentAuthor', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_CommentAuthor).default;
}
});
var _CommentAvatar = __webpack_require__(/*! ./views/Comment/CommentAvatar */ 1034);
Object.defineProperty(exports, 'CommentAvatar', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_CommentAvatar).default;
}
});
var _CommentContent = __webpack_require__(/*! ./views/Comment/CommentContent */ 1035);
Object.defineProperty(exports, 'CommentContent', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_CommentContent).default;
}
});
var _CommentGroup = __webpack_require__(/*! ./views/Comment/CommentGroup */ 1036);
Object.defineProperty(exports, 'CommentGroup', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_CommentGroup).default;
}
});
var _CommentMetadata = __webpack_require__(/*! ./views/Comment/CommentMetadata */ 1037);
Object.defineProperty(exports, 'CommentMetadata', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_CommentMetadata).default;
}
});
var _CommentText = __webpack_require__(/*! ./views/Comment/CommentText */ 1038);
Object.defineProperty(exports, 'CommentText', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_CommentText).default;
}
});
var _Feed = __webpack_require__(/*! ./views/Feed */ 1039);
Object.defineProperty(exports, 'Feed', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Feed).default;
}
});
var _FeedContent = __webpack_require__(/*! ./views/Feed/FeedContent */ 1041);
Object.defineProperty(exports, 'FeedContent', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_FeedContent).default;
}
});
var _FeedDate = __webpack_require__(/*! ./views/Feed/FeedDate */ 1042);
Object.defineProperty(exports, 'FeedDate', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_FeedDate).default;
}
});
var _FeedEvent = __webpack_require__(/*! ./views/Feed/FeedEvent */ 1048);
Object.defineProperty(exports, 'FeedEvent', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_FeedEvent).default;
}
});
var _FeedExtra = __webpack_require__(/*! ./views/Feed/FeedExtra */ 1043);
Object.defineProperty(exports, 'FeedExtra', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_FeedExtra).default;
}
});
var _FeedLabel = __webpack_require__(/*! ./views/Feed/FeedLabel */ 1049);
Object.defineProperty(exports, 'FeedLabel', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_FeedLabel).default;
}
});
var _FeedLike = __webpack_require__(/*! ./views/Feed/FeedLike */ 1045);
Object.defineProperty(exports, 'FeedLike', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_FeedLike).default;
}
});
var _FeedMeta = __webpack_require__(/*! ./views/Feed/FeedMeta */ 1044);
Object.defineProperty(exports, 'FeedMeta', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_FeedMeta).default;
}
});
var _FeedSummary = __webpack_require__(/*! ./views/Feed/FeedSummary */ 1046);
Object.defineProperty(exports, 'FeedSummary', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_FeedSummary).default;
}
});
var _FeedUser = __webpack_require__(/*! ./views/Feed/FeedUser */ 1047);
Object.defineProperty(exports, 'FeedUser', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_FeedUser).default;
}
});
var _Item = __webpack_require__(/*! ./views/Item */ 1050);
Object.defineProperty(exports, 'Item', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Item).default;
}
});
var _ItemContent = __webpack_require__(/*! ./views/Item/ItemContent */ 1052);
Object.defineProperty(exports, 'ItemContent', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_ItemContent).default;
}
});
var _ItemDescription = __webpack_require__(/*! ./views/Item/ItemDescription */ 1054);
Object.defineProperty(exports, 'ItemDescription', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_ItemDescription).default;
}
});
var _ItemExtra = __webpack_require__(/*! ./views/Item/ItemExtra */ 1055);
Object.defineProperty(exports, 'ItemExtra', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_ItemExtra).default;
}
});
var _ItemGroup = __webpack_require__(/*! ./views/Item/ItemGroup */ 1057);
Object.defineProperty(exports, 'ItemGroup', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_ItemGroup).default;
}
});
var _ItemHeader = __webpack_require__(/*! ./views/Item/ItemHeader */ 1053);
Object.defineProperty(exports, 'ItemHeader', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_ItemHeader).default;
}
});
var _ItemImage = __webpack_require__(/*! ./views/Item/ItemImage */ 1058);
Object.defineProperty(exports, 'ItemImage', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_ItemImage).default;
}
});
var _ItemMeta = __webpack_require__(/*! ./views/Item/ItemMeta */ 1056);
Object.defineProperty(exports, 'ItemMeta', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_ItemMeta).default;
}
});
var _Statistic = __webpack_require__(/*! ./views/Statistic */ 1059);
Object.defineProperty(exports, 'Statistic', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Statistic).default;
}
});
var _StatisticGroup = __webpack_require__(/*! ./views/Statistic/StatisticGroup */ 1061);
Object.defineProperty(exports, 'StatisticGroup', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_StatisticGroup).default;
}
});
var _StatisticLabel = __webpack_require__(/*! ./views/Statistic/StatisticLabel */ 1062);
Object.defineProperty(exports, 'StatisticLabel', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_StatisticLabel).default;
}
});
var _StatisticValue = __webpack_require__(/*! ./views/Statistic/StatisticValue */ 1063);
Object.defineProperty(exports, 'StatisticValue', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_StatisticValue).default;
}
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/***/ },
/* 533 */
/*!*******************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/addons/Confirm/index.js ***!
\*******************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _Confirm = __webpack_require__(/*! ./Confirm */ 534);
var _Confirm2 = _interopRequireDefault(_Confirm);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = _Confirm2.default;
/***/ },
/* 534 */
/*!*********************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/addons/Confirm/Confirm.js ***!
\*********************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _has2 = __webpack_require__(/*! lodash/has */ 535);
var _has3 = _interopRequireDefault(_has2);
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__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _Button = __webpack_require__(/*! ../../elements/Button */ 843);
var _Button2 = _interopRequireDefault(_Button);
var _Modal = __webpack_require__(/*! ../../modules/Modal */ 865);
var _Modal2 = _interopRequireDefault(_Modal);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* A Confirm modal gives the user a choice to confirm or cancel an action
* @see Modal
*/
function Confirm(props) {
var open = props.open,
cancelButton = props.cancelButton,
confirmButton = props.confirmButton,
header = props.header,
content = props.content,
onConfirm = props.onConfirm,
onCancel = props.onCancel;
var rest = (0, _lib.getUnhandledProps)(Confirm, props);
// `open` is auto controlled by the Modal
// It cannot be present (even undefined) with `defaultOpen`
// only apply it if the user provided an open prop
var openProp = {};
if ((0, _has3.default)(props, 'open')) openProp.open = open;
return _react2.default.createElement(
_Modal2.default,
_extends({}, openProp, { size: 'small', onClose: onCancel }, rest),
header && _react2.default.createElement(
_Modal2.default.Header,
null,
header
),
content && _react2.default.createElement(
_Modal2.default.Content,
null,
content
),
_react2.default.createElement(
_Modal2.default.Actions,
null,
_react2.default.createElement(
_Button2.default,
{ onClick: onCancel },
cancelButton
),
_react2.default.createElement(
_Button2.default,
{ primary: true, onClick: onConfirm },
confirmButton
)
)
);
}
Confirm._meta = {
name: 'Confirm',
type: _lib.META.TYPES.ADDON
};
Confirm.propTypes = {
/** Whether or not the modal is visible */
open: _react.PropTypes.bool,
/** The cancel button text */
cancelButton: _react.PropTypes.string,
/** The OK button text */
confirmButton: _react.PropTypes.string,
/** The ModalHeader text */
header: _react.PropTypes.string,
/** The ModalContent text. */
content: _react.PropTypes.string,
/** Called when the OK button is clicked */
onConfirm: _react.PropTypes.func,
/** Called when the Cancel button is clicked */
onCancel: _react.PropTypes.func
};
Confirm.defaultProps = {
cancelButton: 'Cancel',
confirmButton: 'OK',
content: 'Are you sure?'
};
exports.default = Confirm;
/***/ },
/* 535 */
/*!*********************************************!*\
!*** ./~/semantic-ui-react/~/lodash/has.js ***!
\*********************************************/
/***/ function(module, exports, __webpack_require__) {
var baseHas = __webpack_require__(/*! ./_baseHas */ 536),
hasPath = __webpack_require__(/*! ./_hasPath */ 537);
/**
* Checks if `path` is a direct property of `object`.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The object to query.
* @param {Array|string} path The path to check.
* @returns {boolean} Returns `true` if `path` exists, else `false`.
* @example
*
* var object = { 'a': { 'b': 2 } };
* var other = _.create({ 'a': _.create({ 'b': 2 }) });
*
* _.has(object, 'a');
* // => true
*
* _.has(object, 'a.b');
* // => true
*
* _.has(object, ['a', 'b']);
* // => true
*
* _.has(other, 'a');
* // => false
*/
function has(object, path) {
return object != null && hasPath(object, path, baseHas);
}
module.exports = has;
/***/ },
/* 536 */
/*!**************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_baseHas.js ***!
\**************************************************/
/***/ function(module, exports) {
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* The base implementation of `_.has` without support for deep paths.
*
* @private
* @param {Object} [object] The object to query.
* @param {Array|string} key The key to check.
* @returns {boolean} Returns `true` if `key` exists, else `false`.
*/
function baseHas(object, key) {
return object != null && hasOwnProperty.call(object, key);
}
module.exports = baseHas;
/***/ },
/* 537 */
/*!**************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_hasPath.js ***!
\**************************************************/
/***/ function(module, exports, __webpack_require__) {
var castPath = __webpack_require__(/*! ./_castPath */ 538),
isArguments = __webpack_require__(/*! ./isArguments */ 587),
isArray = __webpack_require__(/*! ./isArray */ 539),
isIndex = __webpack_require__(/*! ./_isIndex */ 589),
isLength = __webpack_require__(/*! ./isLength */ 590),
toKey = __webpack_require__(/*! ./_toKey */ 591);
/**
* Checks if `path` exists on `object`.
*
* @private
* @param {Object} object The object to query.
* @param {Array|string} path The path to check.
* @param {Function} hasFunc The function to check properties.
* @returns {boolean} Returns `true` if `path` exists, else `false`.
*/
function hasPath(object, path, hasFunc) {
path = castPath(path, object);
var index = -1,
length = path.length,
result = false;
while (++index < length) {
var key = toKey(path[index]);
if (!(result = object != null && hasFunc(object, key))) {
break;
}
object = object[key];
}
if (result || ++index != length) {
return result;
}
length = object == null ? 0 : object.length;
return !!length && isLength(length) && isIndex(key, length) &&
(isArray(object) || isArguments(object));
}
module.exports = hasPath;
/***/ },
/* 538 */
/*!***************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_castPath.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
var isArray = __webpack_require__(/*! ./isArray */ 539),
isKey = __webpack_require__(/*! ./_isKey */ 540),
stringToPath = __webpack_require__(/*! ./_stringToPath */ 549),
toString = __webpack_require__(/*! ./toString */ 584);
/**
* Casts `value` to a path array if it's not one.
*
* @private
* @param {*} value The value to inspect.
* @param {Object} [object] The object to query keys on.
* @returns {Array} Returns the cast property path array.
*/
function castPath(value, object) {
if (isArray(value)) {
return value;
}
return isKey(value, object) ? [value] : stringToPath(toString(value));
}
module.exports = castPath;
/***/ },
/* 539 */
/*!*************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/isArray.js ***!
\*************************************************/
/***/ function(module, exports) {
/**
* Checks if `value` is classified as an `Array` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
* @example
*
* _.isArray([1, 2, 3]);
* // => true
*
* _.isArray(document.body.children);
* // => false
*
* _.isArray('abc');
* // => false
*
* _.isArray(_.noop);
* // => false
*/
var isArray = Array.isArray;
module.exports = isArray;
/***/ },
/* 540 */
/*!************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_isKey.js ***!
\************************************************/
/***/ function(module, exports, __webpack_require__) {
var isArray = __webpack_require__(/*! ./isArray */ 539),
isSymbol = __webpack_require__(/*! ./isSymbol */ 541);
/** Used to match property names within property paths. */
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
reIsPlainProp = /^\w*$/;
/**
* Checks if `value` is a property name and not a property path.
*
* @private
* @param {*} value The value to check.
* @param {Object} [object] The object to query keys on.
* @returns {boolean} Returns `true` if `value` is a property name, else `false`.
*/
function isKey(value, object) {
if (isArray(value)) {
return false;
}
var type = typeof value;
if (type == 'number' || type == 'symbol' || type == 'boolean' ||
value == null || isSymbol(value)) {
return true;
}
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
(object != null && value in Object(object));
}
module.exports = isKey;
/***/ },
/* 541 */
/*!**************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/isSymbol.js ***!
\**************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ 542),
isObjectLike = __webpack_require__(/*! ./isObjectLike */ 548);
/** `Object#toString` result references. */
var symbolTag = '[object Symbol]';
/**
* 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) && baseGetTag(value) == symbolTag);
}
module.exports = isSymbol;
/***/ },
/* 542 */
/*!*****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_baseGetTag.js ***!
\*****************************************************/
/***/ function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__(/*! ./_Symbol */ 543),
getRawTag = __webpack_require__(/*! ./_getRawTag */ 546),
objectToString = __webpack_require__(/*! ./_objectToString */ 547);
/** `Object#toString` result references. */
var nullTag = '[object Null]',
undefinedTag = '[object Undefined]';
/** Built-in value references. */
var 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);
}
module.exports = baseGetTag;
/***/ },
/* 543 */
/*!*************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_Symbol.js ***!
\*************************************************/
/***/ function(module, exports, __webpack_require__) {
var root = __webpack_require__(/*! ./_root */ 544);
/** Built-in value references. */
var Symbol = root.Symbol;
module.exports = Symbol;
/***/ },
/* 544 */
/*!***********************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_root.js ***!
\***********************************************/
/***/ function(module, exports, __webpack_require__) {
var freeGlobal = __webpack_require__(/*! ./_freeGlobal */ 545);
/** 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')();
module.exports = root;
/***/ },
/* 545 */
/*!*****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_freeGlobal.js ***!
\*****************************************************/
/***/ function(module, exports) {
/* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
module.exports = freeGlobal;
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
/***/ },
/* 546 */
/*!****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_getRawTag.js ***!
\****************************************************/
/***/ function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__(/*! ./_Symbol */ 543);
/** 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 symToStringTag = Symbol ? Symbol.toStringTag : undefined;
/**
* 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;
}
module.exports = getRawTag;
/***/ },
/* 547 */
/*!*********************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_objectToString.js ***!
\*********************************************************/
/***/ function(module, exports) {
/** 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 nativeObjectToString = objectProto.toString;
/**
* 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);
}
module.exports = objectToString;
/***/ },
/* 548 */
/*!******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/isObjectLike.js ***!
\******************************************************/
/***/ function(module, exports) {
/**
* 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 != null && typeof value == 'object';
}
module.exports = isObjectLike;
/***/ },
/* 549 */
/*!*******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_stringToPath.js ***!
\*******************************************************/
/***/ function(module, exports, __webpack_require__) {
var memoizeCapped = __webpack_require__(/*! ./_memoizeCapped */ 550);
/** Used to match property names within property paths. */
var reLeadingDot = /^\./,
rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
/** Used to match backslashes in property paths. */
var reEscapeChar = /\\(\\)?/g;
/**
* Converts `string` to a property path array.
*
* @private
* @param {string} string The string to convert.
* @returns {Array} Returns the property path array.
*/
var stringToPath = memoizeCapped(function(string) {
var result = [];
if (reLeadingDot.test(string)) {
result.push('');
}
string.replace(rePropName, function(match, number, quote, string) {
result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
});
return result;
});
module.exports = stringToPath;
/***/ },
/* 550 */
/*!********************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_memoizeCapped.js ***!
\********************************************************/
/***/ function(module, exports, __webpack_require__) {
var memoize = __webpack_require__(/*! ./memoize */ 551);
/** Used as the maximum memoize cache size. */
var MAX_MEMOIZE_SIZE = 500;
/**
* A specialized version of `_.memoize` which clears the memoized function's
* cache when it exceeds `MAX_MEMOIZE_SIZE`.
*
* @private
* @param {Function} func The function to have its output memoized.
* @returns {Function} Returns the new memoized function.
*/
function memoizeCapped(func) {
var result = memoize(func, function(key) {
if (cache.size === MAX_MEMOIZE_SIZE) {
cache.clear();
}
return key;
});
var cache = result.cache;
return result;
}
module.exports = memoizeCapped;
/***/ },
/* 551 */
/*!*************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/memoize.js ***!
\*************************************************/
/***/ function(module, exports, __webpack_require__) {
var MapCache = __webpack_require__(/*! ./_MapCache */ 552);
/** Error message constants. */
var FUNC_ERROR_TEXT = 'Expected a function';
/**
* Creates a function that memoizes the result of `func`. If `resolver` is
* provided, it determines the cache key for storing the result based on the
* arguments provided to the memoized function. By default, the first argument
* provided to the memoized function is used as the map cache key. The `func`
* is invoked with the `this` binding of the memoized function.
*
* **Note:** The cache is exposed as the `cache` property on the memoized
* function. Its creation may be customized by replacing the `_.memoize.Cache`
* constructor with one whose instances implement the
* [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
* method interface of `clear`, `delete`, `get`, `has`, and `set`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {Function} func The function to have its output memoized.
* @param {Function} [resolver] The function to resolve the cache key.
* @returns {Function} Returns the new memoized function.
* @example
*
* var object = { 'a': 1, 'b': 2 };
* var other = { 'c': 3, 'd': 4 };
*
* var values = _.memoize(_.values);
* values(object);
* // => [1, 2]
*
* values(other);
* // => [3, 4]
*
* object.a = 2;
* values(object);
* // => [1, 2]
*
* // Modify the result cache.
* values.cache.set(object, ['a', 'b']);
* values(object);
* // => ['a', 'b']
*
* // Replace `_.memoize.Cache`.
* _.memoize.Cache = WeakMap;
*/
function memoize(func, resolver) {
if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
throw new TypeError(FUNC_ERROR_TEXT);
}
var memoized = function() {
var args = arguments,
key = resolver ? resolver.apply(this, args) : args[0],
cache = memoized.cache;
if (cache.has(key)) {
return cache.get(key);
}
var result = func.apply(this, args);
memoized.cache = cache.set(key, result) || cache;
return result;
};
memoized.cache = new (memoize.Cache || MapCache);
return memoized;
}
// Expose `MapCache`.
memoize.Cache = MapCache;
module.exports = memoize;
/***/ },
/* 552 */
/*!***************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_MapCache.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
var mapCacheClear = __webpack_require__(/*! ./_mapCacheClear */ 553),
mapCacheDelete = __webpack_require__(/*! ./_mapCacheDelete */ 578),
mapCacheGet = __webpack_require__(/*! ./_mapCacheGet */ 581),
mapCacheHas = __webpack_require__(/*! ./_mapCacheHas */ 582),
mapCacheSet = __webpack_require__(/*! ./_mapCacheSet */ 583);
/**
* Creates a map cache object to store key-value pairs.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function MapCache(entries) {
var index = -1,
length = entries == null ? 0 : entries.length;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
// Add methods to `MapCache`.
MapCache.prototype.clear = mapCacheClear;
MapCache.prototype['delete'] = mapCacheDelete;
MapCache.prototype.get = mapCacheGet;
MapCache.prototype.has = mapCacheHas;
MapCache.prototype.set = mapCacheSet;
module.exports = MapCache;
/***/ },
/* 553 */
/*!********************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_mapCacheClear.js ***!
\********************************************************/
/***/ function(module, exports, __webpack_require__) {
var Hash = __webpack_require__(/*! ./_Hash */ 554),
ListCache = __webpack_require__(/*! ./_ListCache */ 569),
Map = __webpack_require__(/*! ./_Map */ 577);
/**
* Removes all key-value entries from the map.
*
* @private
* @name clear
* @memberOf MapCache
*/
function mapCacheClear() {
this.size = 0;
this.__data__ = {
'hash': new Hash,
'map': new (Map || ListCache),
'string': new Hash
};
}
module.exports = mapCacheClear;
/***/ },
/* 554 */
/*!***********************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_Hash.js ***!
\***********************************************/
/***/ function(module, exports, __webpack_require__) {
var hashClear = __webpack_require__(/*! ./_hashClear */ 555),
hashDelete = __webpack_require__(/*! ./_hashDelete */ 565),
hashGet = __webpack_require__(/*! ./_hashGet */ 566),
hashHas = __webpack_require__(/*! ./_hashHas */ 567),
hashSet = __webpack_require__(/*! ./_hashSet */ 568);
/**
* Creates a hash object.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function Hash(entries) {
var index = -1,
length = entries == null ? 0 : entries.length;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
// Add methods to `Hash`.
Hash.prototype.clear = hashClear;
Hash.prototype['delete'] = hashDelete;
Hash.prototype.get = hashGet;
Hash.prototype.has = hashHas;
Hash.prototype.set = hashSet;
module.exports = Hash;
/***/ },
/* 555 */
/*!****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_hashClear.js ***!
\****************************************************/
/***/ function(module, exports, __webpack_require__) {
var nativeCreate = __webpack_require__(/*! ./_nativeCreate */ 556);
/**
* Removes all key-value entries from the hash.
*
* @private
* @name clear
* @memberOf Hash
*/
function hashClear() {
this.__data__ = nativeCreate ? nativeCreate(null) : {};
this.size = 0;
}
module.exports = hashClear;
/***/ },
/* 556 */
/*!*******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_nativeCreate.js ***!
\*******************************************************/
/***/ function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(/*! ./_getNative */ 557);
/* Built-in method references that are verified to be native. */
var nativeCreate = getNative(Object, 'create');
module.exports = nativeCreate;
/***/ },
/* 557 */
/*!****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_getNative.js ***!
\****************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseIsNative = __webpack_require__(/*! ./_baseIsNative */ 558),
getValue = __webpack_require__(/*! ./_getValue */ 564);
/**
* Gets the native function at `key` of `object`.
*
* @private
* @param {Object} object The object to query.
* @param {string} key The key of the method to get.
* @returns {*} Returns the function if it's native, else `undefined`.
*/
function getNative(object, key) {
var value = getValue(object, key);
return baseIsNative(value) ? value : undefined;
}
module.exports = getNative;
/***/ },
/* 558 */
/*!*******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_baseIsNative.js ***!
\*******************************************************/
/***/ function(module, exports, __webpack_require__) {
var isFunction = __webpack_require__(/*! ./isFunction */ 559),
isMasked = __webpack_require__(/*! ./_isMasked */ 561),
isObject = __webpack_require__(/*! ./isObject */ 560),
toSource = __webpack_require__(/*! ./_toSource */ 563);
/**
* Used to match `RegExp`
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
*/
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
/** Used to detect host constructors (Safari). */
var reIsHostCtor = /^\[object .+?Constructor\]$/;
/** Used for built-in method references. */
var funcProto = Function.prototype,
objectProto = Object.prototype;
/** Used to resolve the decompiled source of functions. */
var funcToString = funcProto.toString;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/** Used to detect if a method is native. */
var reIsNative = RegExp('^' +
funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
);
/**
* The base implementation of `_.isNative` without bad shim checks.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a native function,
* else `false`.
*/
function baseIsNative(value) {
if (!isObject(value) || isMasked(value)) {
return false;
}
var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
return pattern.test(toSource(value));
}
module.exports = baseIsNative;
/***/ },
/* 559 */
/*!****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/isFunction.js ***!
\****************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ 542),
isObject = __webpack_require__(/*! ./isObject */ 560);
/** `Object#toString` result references. */
var asyncTag = '[object AsyncFunction]',
funcTag = '[object Function]',
genTag = '[object GeneratorFunction]',
proxyTag = '[object Proxy]';
/**
* 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;
}
module.exports = isFunction;
/***/ },
/* 560 */
/*!**************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/isObject.js ***!
\**************************************************/
/***/ function(module, exports) {
/**
* 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 = isObject;
/***/ },
/* 561 */
/*!***************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_isMasked.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
var coreJsData = __webpack_require__(/*! ./_coreJsData */ 562);
/** Used to detect methods masquerading as native. */
var maskSrcKey = (function() {
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
return uid ? ('Symbol(src)_1.' + uid) : '';
}());
/**
* Checks if `func` has its source masked.
*
* @private
* @param {Function} func The function to check.
* @returns {boolean} Returns `true` if `func` is masked, else `false`.
*/
function isMasked(func) {
return !!maskSrcKey && (maskSrcKey in func);
}
module.exports = isMasked;
/***/ },
/* 562 */
/*!*****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_coreJsData.js ***!
\*****************************************************/
/***/ function(module, exports, __webpack_require__) {
var root = __webpack_require__(/*! ./_root */ 544);
/** Used to detect overreaching core-js shims. */
var coreJsData = root['__core-js_shared__'];
module.exports = coreJsData;
/***/ },
/* 563 */
/*!***************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_toSource.js ***!
\***************************************************/
/***/ function(module, exports) {
/** Used for built-in method references. */
var funcProto = Function.prototype;
/** Used to resolve the decompiled source of functions. */
var funcToString = funcProto.toString;
/**
* Converts `func` to its source code.
*
* @private
* @param {Function} func The function to convert.
* @returns {string} Returns the source code.
*/
function toSource(func) {
if (func != null) {
try {
return funcToString.call(func);
} catch (e) {}
try {
return (func + '');
} catch (e) {}
}
return '';
}
module.exports = toSource;
/***/ },
/* 564 */
/*!***************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_getValue.js ***!
\***************************************************/
/***/ function(module, exports) {
/**
* Gets the value at `key` of `object`.
*
* @private
* @param {Object} [object] The object to query.
* @param {string} key The key of the property to get.
* @returns {*} Returns the property value.
*/
function getValue(object, key) {
return object == null ? undefined : object[key];
}
module.exports = getValue;
/***/ },
/* 565 */
/*!*****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_hashDelete.js ***!
\*****************************************************/
/***/ function(module, exports) {
/**
* Removes `key` and its value from the hash.
*
* @private
* @name delete
* @memberOf Hash
* @param {Object} hash The hash to modify.
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function hashDelete(key) {
var result = this.has(key) && delete this.__data__[key];
this.size -= result ? 1 : 0;
return result;
}
module.exports = hashDelete;
/***/ },
/* 566 */
/*!**************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_hashGet.js ***!
\**************************************************/
/***/ function(module, exports, __webpack_require__) {
var nativeCreate = __webpack_require__(/*! ./_nativeCreate */ 556);
/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Gets the hash value for `key`.
*
* @private
* @name get
* @memberOf Hash
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function hashGet(key) {
var data = this.__data__;
if (nativeCreate) {
var result = data[key];
return result === HASH_UNDEFINED ? undefined : result;
}
return hasOwnProperty.call(data, key) ? data[key] : undefined;
}
module.exports = hashGet;
/***/ },
/* 567 */
/*!**************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_hashHas.js ***!
\**************************************************/
/***/ function(module, exports, __webpack_require__) {
var nativeCreate = __webpack_require__(/*! ./_nativeCreate */ 556);
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Checks if a hash value for `key` exists.
*
* @private
* @name has
* @memberOf Hash
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function hashHas(key) {
var data = this.__data__;
return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
}
module.exports = hashHas;
/***/ },
/* 568 */
/*!**************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_hashSet.js ***!
\**************************************************/
/***/ function(module, exports, __webpack_require__) {
var nativeCreate = __webpack_require__(/*! ./_nativeCreate */ 556);
/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';
/**
* Sets the hash `key` to `value`.
*
* @private
* @name set
* @memberOf Hash
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the hash instance.
*/
function hashSet(key, value) {
var data = this.__data__;
this.size += this.has(key) ? 0 : 1;
data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
return this;
}
module.exports = hashSet;
/***/ },
/* 569 */
/*!****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_ListCache.js ***!
\****************************************************/
/***/ function(module, exports, __webpack_require__) {
var listCacheClear = __webpack_require__(/*! ./_listCacheClear */ 570),
listCacheDelete = __webpack_require__(/*! ./_listCacheDelete */ 571),
listCacheGet = __webpack_require__(/*! ./_listCacheGet */ 574),
listCacheHas = __webpack_require__(/*! ./_listCacheHas */ 575),
listCacheSet = __webpack_require__(/*! ./_listCacheSet */ 576);
/**
* Creates an list cache object.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function ListCache(entries) {
var index = -1,
length = entries == null ? 0 : entries.length;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
// Add methods to `ListCache`.
ListCache.prototype.clear = listCacheClear;
ListCache.prototype['delete'] = listCacheDelete;
ListCache.prototype.get = listCacheGet;
ListCache.prototype.has = listCacheHas;
ListCache.prototype.set = listCacheSet;
module.exports = ListCache;
/***/ },
/* 570 */
/*!*********************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_listCacheClear.js ***!
\*********************************************************/
/***/ function(module, exports) {
/**
* Removes all key-value entries from the list cache.
*
* @private
* @name clear
* @memberOf ListCache
*/
function listCacheClear() {
this.__data__ = [];
this.size = 0;
}
module.exports = listCacheClear;
/***/ },
/* 571 */
/*!**********************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_listCacheDelete.js ***!
\**********************************************************/
/***/ function(module, exports, __webpack_require__) {
var assocIndexOf = __webpack_require__(/*! ./_assocIndexOf */ 572);
/** Used for built-in method references. */
var arrayProto = Array.prototype;
/** Built-in value references. */
var splice = arrayProto.splice;
/**
* Removes `key` and its value from the list cache.
*
* @private
* @name delete
* @memberOf ListCache
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function listCacheDelete(key) {
var data = this.__data__,
index = assocIndexOf(data, key);
if (index < 0) {
return false;
}
var lastIndex = data.length - 1;
if (index == lastIndex) {
data.pop();
} else {
splice.call(data, index, 1);
}
--this.size;
return true;
}
module.exports = listCacheDelete;
/***/ },
/* 572 */
/*!*******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_assocIndexOf.js ***!
\*******************************************************/
/***/ function(module, exports, __webpack_require__) {
var eq = __webpack_require__(/*! ./eq */ 573);
/**
* Gets the index at which the `key` is found in `array` of key-value pairs.
*
* @private
* @param {Array} array The array to inspect.
* @param {*} key The key to search for.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function assocIndexOf(array, key) {
var length = array.length;
while (length--) {
if (eq(array[length][0], key)) {
return length;
}
}
return -1;
}
module.exports = assocIndexOf;
/***/ },
/* 573 */
/*!********************************************!*\
!*** ./~/semantic-ui-react/~/lodash/eq.js ***!
\********************************************/
/***/ function(module, exports) {
/**
* Performs a
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* comparison between two values to determine if they are equivalent.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
* @example
*
* var object = { 'a': 1 };
* var other = { 'a': 1 };
*
* _.eq(object, object);
* // => true
*
* _.eq(object, other);
* // => false
*
* _.eq('a', 'a');
* // => true
*
* _.eq('a', Object('a'));
* // => false
*
* _.eq(NaN, NaN);
* // => true
*/
function eq(value, other) {
return value === other || (value !== value && other !== other);
}
module.exports = eq;
/***/ },
/* 574 */
/*!*******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_listCacheGet.js ***!
\*******************************************************/
/***/ function(module, exports, __webpack_require__) {
var assocIndexOf = __webpack_require__(/*! ./_assocIndexOf */ 572);
/**
* Gets the list cache value for `key`.
*
* @private
* @name get
* @memberOf ListCache
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function listCacheGet(key) {
var data = this.__data__,
index = assocIndexOf(data, key);
return index < 0 ? undefined : data[index][1];
}
module.exports = listCacheGet;
/***/ },
/* 575 */
/*!*******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_listCacheHas.js ***!
\*******************************************************/
/***/ function(module, exports, __webpack_require__) {
var assocIndexOf = __webpack_require__(/*! ./_assocIndexOf */ 572);
/**
* Checks if a list cache value for `key` exists.
*
* @private
* @name has
* @memberOf ListCache
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function listCacheHas(key) {
return assocIndexOf(this.__data__, key) > -1;
}
module.exports = listCacheHas;
/***/ },
/* 576 */
/*!*******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_listCacheSet.js ***!
\*******************************************************/
/***/ function(module, exports, __webpack_require__) {
var assocIndexOf = __webpack_require__(/*! ./_assocIndexOf */ 572);
/**
* Sets the list cache `key` to `value`.
*
* @private
* @name set
* @memberOf ListCache
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the list cache instance.
*/
function listCacheSet(key, value) {
var data = this.__data__,
index = assocIndexOf(data, key);
if (index < 0) {
++this.size;
data.push([key, value]);
} else {
data[index][1] = value;
}
return this;
}
module.exports = listCacheSet;
/***/ },
/* 577 */
/*!**********************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_Map.js ***!
\**********************************************/
/***/ function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(/*! ./_getNative */ 557),
root = __webpack_require__(/*! ./_root */ 544);
/* Built-in method references that are verified to be native. */
var Map = getNative(root, 'Map');
module.exports = Map;
/***/ },
/* 578 */
/*!*********************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_mapCacheDelete.js ***!
\*********************************************************/
/***/ function(module, exports, __webpack_require__) {
var getMapData = __webpack_require__(/*! ./_getMapData */ 579);
/**
* Removes `key` and its value from the map.
*
* @private
* @name delete
* @memberOf MapCache
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function mapCacheDelete(key) {
var result = getMapData(this, key)['delete'](key);
this.size -= result ? 1 : 0;
return result;
}
module.exports = mapCacheDelete;
/***/ },
/* 579 */
/*!*****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_getMapData.js ***!
\*****************************************************/
/***/ function(module, exports, __webpack_require__) {
var isKeyable = __webpack_require__(/*! ./_isKeyable */ 580);
/**
* Gets the data for `map`.
*
* @private
* @param {Object} map The map to query.
* @param {string} key The reference key.
* @returns {*} Returns the map data.
*/
function getMapData(map, key) {
var data = map.__data__;
return isKeyable(key)
? data[typeof key == 'string' ? 'string' : 'hash']
: data.map;
}
module.exports = getMapData;
/***/ },
/* 580 */
/*!****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_isKeyable.js ***!
\****************************************************/
/***/ function(module, exports) {
/**
* Checks if `value` is suitable for use as unique object key.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is suitable, else `false`.
*/
function isKeyable(value) {
var type = typeof value;
return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
? (value !== '__proto__')
: (value === null);
}
module.exports = isKeyable;
/***/ },
/* 581 */
/*!******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_mapCacheGet.js ***!
\******************************************************/
/***/ function(module, exports, __webpack_require__) {
var getMapData = __webpack_require__(/*! ./_getMapData */ 579);
/**
* Gets the map value for `key`.
*
* @private
* @name get
* @memberOf MapCache
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function mapCacheGet(key) {
return getMapData(this, key).get(key);
}
module.exports = mapCacheGet;
/***/ },
/* 582 */
/*!******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_mapCacheHas.js ***!
\******************************************************/
/***/ function(module, exports, __webpack_require__) {
var getMapData = __webpack_require__(/*! ./_getMapData */ 579);
/**
* Checks if a map value for `key` exists.
*
* @private
* @name has
* @memberOf MapCache
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function mapCacheHas(key) {
return getMapData(this, key).has(key);
}
module.exports = mapCacheHas;
/***/ },
/* 583 */
/*!******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_mapCacheSet.js ***!
\******************************************************/
/***/ function(module, exports, __webpack_require__) {
var getMapData = __webpack_require__(/*! ./_getMapData */ 579);
/**
* Sets the map `key` to `value`.
*
* @private
* @name set
* @memberOf MapCache
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the map cache instance.
*/
function mapCacheSet(key, value) {
var data = getMapData(this, key),
size = data.size;
data.set(key, value);
this.size += data.size == size ? 0 : 1;
return this;
}
module.exports = mapCacheSet;
/***/ },
/* 584 */
/*!**************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/toString.js ***!
\**************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseToString = __webpack_require__(/*! ./_baseToString */ 585);
/**
* Converts `value` to a string. An empty string is returned for `null`
* and `undefined` values. The sign of `-0` is preserved.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to convert.
* @returns {string} Returns the converted string.
* @example
*
* _.toString(null);
* // => ''
*
* _.toString(-0);
* // => '-0'
*
* _.toString([1, 2, 3]);
* // => '1,2,3'
*/
function toString(value) {
return value == null ? '' : baseToString(value);
}
module.exports = toString;
/***/ },
/* 585 */
/*!*******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_baseToString.js ***!
\*******************************************************/
/***/ function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__(/*! ./_Symbol */ 543),
arrayMap = __webpack_require__(/*! ./_arrayMap */ 586),
isArray = __webpack_require__(/*! ./isArray */ 539),
isSymbol = __webpack_require__(/*! ./isSymbol */ 541);
/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0;
/** Used to convert symbols to primitives and strings. */
var symbolProto = Symbol ? Symbol.prototype : undefined,
symbolToString = symbolProto ? symbolProto.toString : undefined;
/**
* The base implementation of `_.toString` which doesn't convert nullish
* values to empty strings.
*
* @private
* @param {*} value The value to process.
* @returns {string} Returns the string.
*/
function baseToString(value) {
// Exit early for strings to avoid a performance hit in some environments.
if (typeof value == 'string') {
return value;
}
if (isArray(value)) {
// Recursively convert values (susceptible to call stack limits).
return arrayMap(value, baseToString) + '';
}
if (isSymbol(value)) {
return symbolToString ? symbolToString.call(value) : '';
}
var result = (value + '');
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
}
module.exports = baseToString;
/***/ },
/* 586 */
/*!***************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_arrayMap.js ***!
\***************************************************/
/***/ function(module, exports) {
/**
* A specialized version of `_.map` for arrays without support for iteratee
* shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns the new mapped array.
*/
function arrayMap(array, iteratee) {
var index = -1,
length = array == null ? 0 : array.length,
result = Array(length);
while (++index < length) {
result[index] = iteratee(array[index], index, array);
}
return result;
}
module.exports = arrayMap;
/***/ },
/* 587 */
/*!*****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/isArguments.js ***!
\*****************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseIsArguments = __webpack_require__(/*! ./_baseIsArguments */ 588),
isObjectLike = __webpack_require__(/*! ./isObjectLike */ 548);
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/** Built-in value references. */
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
/**
* Checks if `value` is likely an `arguments` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
* else `false`.
* @example
*
* _.isArguments(function() { return arguments; }());
* // => true
*
* _.isArguments([1, 2, 3]);
* // => false
*/
var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
!propertyIsEnumerable.call(value, 'callee');
};
module.exports = isArguments;
/***/ },
/* 588 */
/*!**********************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_baseIsArguments.js ***!
\**********************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ 542),
isObjectLike = __webpack_require__(/*! ./isObjectLike */ 548);
/** `Object#toString` result references. */
var argsTag = '[object Arguments]';
/**
* The base implementation of `_.isArguments`.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
*/
function baseIsArguments(value) {
return isObjectLike(value) && baseGetTag(value) == argsTag;
}
module.exports = baseIsArguments;
/***/ },
/* 589 */
/*!**************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_isIndex.js ***!
\**************************************************/
/***/ function(module, exports) {
/** Used as references for various `Number` constants. */
var MAX_SAFE_INTEGER = 9007199254740991;
/** Used to detect unsigned integer values. */
var reIsUint = /^(?:0|[1-9]\d*)$/;
/**
* Checks if `value` is a valid array-like index.
*
* @private
* @param {*} value The value to check.
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
*/
function isIndex(value, length) {
length = length == null ? MAX_SAFE_INTEGER : length;
return !!length &&
(typeof value == 'number' || reIsUint.test(value)) &&
(value > -1 && value % 1 == 0 && value < length);
}
module.exports = isIndex;
/***/ },
/* 590 */
/*!**************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/isLength.js ***!
\**************************************************/
/***/ function(module, exports) {
/** Used as references for various `Number` constants. */
var MAX_SAFE_INTEGER = 9007199254740991;
/**
* Checks if `value` is a valid array-like length.
*
* **Note:** This method is loosely based on
* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
* @example
*
* _.isLength(3);
* // => true
*
* _.isLength(Number.MIN_VALUE);
* // => false
*
* _.isLength(Infinity);
* // => false
*
* _.isLength('3');
* // => false
*/
function isLength(value) {
return typeof value == 'number' &&
value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
}
module.exports = isLength;
/***/ },
/* 591 */
/*!************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_toKey.js ***!
\************************************************/
/***/ function(module, exports, __webpack_require__) {
var isSymbol = __webpack_require__(/*! ./isSymbol */ 541);
/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0;
/**
* Converts `value` to a string key if it's not a string or symbol.
*
* @private
* @param {*} value The value to inspect.
* @returns {string|symbol} Returns the key.
*/
function toKey(value) {
if (typeof value == 'string' || isSymbol(value)) {
return value;
}
var result = (value + '');
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
}
module.exports = toKey;
/***/ },
/* 592 */
/*!********************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/lib/index.js ***!
\********************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.objectDiff = exports.numberToWord = exports.numberToWordMap = exports.keyboardKey = exports.SUI = exports.META = exports.leven = exports.isBrowser = exports.getElementType = exports.getUnhandledProps = exports.makeDebugger = exports.debug = exports.customPropTypes = exports.useVerticalAlignProp = exports.useTextAlignProp = exports.useWidthProp = exports.useKeyOrValueAndKey = exports.useValueAndKey = exports.useKeyOnly = exports.childrenUtils = exports.AutoControlledComponent = undefined;
var _AutoControlledComponent = __webpack_require__(/*! ./AutoControlledComponent */ 593);
Object.defineProperty(exports, 'AutoControlledComponent', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_AutoControlledComponent).default;
}
});
var _classNameBuilders = __webpack_require__(/*! ./classNameBuilders */ 693);
Object.defineProperty(exports, 'useKeyOnly', {
enumerable: true,
get: function get() {
return _classNameBuilders.useKeyOnly;
}
});
Object.defineProperty(exports, 'useValueAndKey', {
enumerable: true,
get: function get() {
return _classNameBuilders.useValueAndKey;
}
});
Object.defineProperty(exports, 'useKeyOrValueAndKey', {
enumerable: true,
get: function get() {
return _classNameBuilders.useKeyOrValueAndKey;
}
});
Object.defineProperty(exports, 'useWidthProp', {
enumerable: true,
get: function get() {
return _classNameBuilders.useWidthProp;
}
});
Object.defineProperty(exports, 'useTextAlignProp', {
enumerable: true,
get: function get() {
return _classNameBuilders.useTextAlignProp;
}
});
Object.defineProperty(exports, 'useVerticalAlignProp', {
enumerable: true,
get: function get() {
return _classNameBuilders.useVerticalAlignProp;
}
});
var _debug = __webpack_require__(/*! ./debug */ 695);
Object.defineProperty(exports, 'debug', {
enumerable: true,
get: function get() {
return _debug.debug;
}
});
Object.defineProperty(exports, 'makeDebugger', {
enumerable: true,
get: function get() {
return _debug.makeDebugger;
}
});
var _factories = __webpack_require__(/*! ./factories */ 700);
Object.keys(_factories).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
return _factories[key];
}
});
});
var _getUnhandledProps = __webpack_require__(/*! ./getUnhandledProps */ 706);
Object.defineProperty(exports, 'getUnhandledProps', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_getUnhandledProps).default;
}
});
var _getElementType = __webpack_require__(/*! ./getElementType */ 707);
Object.defineProperty(exports, 'getElementType', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_getElementType).default;
}
});
var _isBrowser = __webpack_require__(/*! ./isBrowser */ 696);
Object.defineProperty(exports, 'isBrowser', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_isBrowser).default;
}
});
var _leven = __webpack_require__(/*! ./leven */ 708);
Object.defineProperty(exports, 'leven', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_leven).default;
}
});
var _keyboardKey = __webpack_require__(/*! ./keyboardKey */ 709);
Object.defineProperty(exports, 'keyboardKey', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_keyboardKey).default;
}
});
var _numberToWord = __webpack_require__(/*! ./numberToWord */ 694);
Object.defineProperty(exports, 'numberToWordMap', {
enumerable: true,
get: function get() {
return _numberToWord.numberToWordMap;
}
});
Object.defineProperty(exports, 'numberToWord', {
enumerable: true,
get: function get() {
return _numberToWord.numberToWord;
}
});
var _objectDiff = __webpack_require__(/*! ./objectDiff */ 711);
Object.defineProperty(exports, 'objectDiff', {
enumerable: true,
get: function get() {
return _objectDiff.objectDiff;
}
});
var _childrenUtils2 = __webpack_require__(/*! ./childrenUtils */ 715);
var _childrenUtils = _interopRequireWildcard(_childrenUtils2);
var _customPropTypes2 = __webpack_require__(/*! ./customPropTypes */ 722);
var _customPropTypes = _interopRequireWildcard(_customPropTypes2);
var _META2 = __webpack_require__(/*! ./META */ 835);
var _META = _interopRequireWildcard(_META2);
var _SUI2 = __webpack_require__(/*! ./SUI */ 842);
var _SUI = _interopRequireWildcard(_SUI2);
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 _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.childrenUtils = _childrenUtils;
exports.customPropTypes = _customPropTypes;
exports.META = _META;
exports.SUI = _SUI;
/***/ },
/* 593 */
/*!**************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/lib/AutoControlledComponent.js ***!
\**************************************************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getAutoControlledStateValue = undefined;
var _difference2 = __webpack_require__(/*! lodash/difference */ 594);
var _difference3 = _interopRequireDefault(_difference2);
var _isUndefined2 = __webpack_require__(/*! lodash/isUndefined */ 621);
var _isUndefined3 = _interopRequireDefault(_isUndefined2);
var _startsWith2 = __webpack_require__(/*! lodash/startsWith */ 622);
var _startsWith3 = _interopRequireDefault(_startsWith2);
var _filter2 = __webpack_require__(/*! lodash/filter */ 627);
var _filter3 = _interopRequireDefault(_filter2);
var _isEmpty2 = __webpack_require__(/*! lodash/isEmpty */ 685);
var _isEmpty3 = _interopRequireDefault(_isEmpty2);
var _keys2 = __webpack_require__(/*! lodash/keys */ 634);
var _keys3 = _interopRequireDefault(_keys2);
var _intersection2 = __webpack_require__(/*! lodash/intersection */ 686);
var _intersection3 = _interopRequireDefault(_intersection2);
var _has2 = __webpack_require__(/*! lodash/has */ 535);
var _has3 = _interopRequireDefault(_has2);
var _each2 = __webpack_require__(/*! lodash/each */ 689);
var _each3 = _interopRequireDefault(_each2);
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__(/*! react */ 2);
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; } /* eslint-disable no-console */
/**
* Why choose inheritance over a HOC? Multiple advantages for this particular use case.
* In short, we need identical functionality to setState(), unless there is a prop defined
* for the state key. Also:
*
* 1. Single Renders
* Calling trySetState() in constructor(), componentWillMount(), or componentWillReceiveProps()
* does not cause two renders. Consumers and tests do not have to wait two renders to get state.
* See www.react.run/4kJFdKoxb/27 for an example of this issue.
*
* 2. Simple Testing
* Using a HOC means you must either test the undecorated component or test through the decorator.
* Testing the undecorated component means you must mock the decorator functionality.
* Testing through the HOC means you can not simply shallow render your component.
*
* 3. Statics
* HOC wrap instances, so statics are no longer accessible. They can be hoisted, but this is more
* looping over properties and storing references. We rely heavily on statics for testing and sub
* components.
*
* 4. Instance Methods
* Some instance methods may be exposed to users via refs. Again, these are lost with HOC unless
* hoisted and exposed by the HOC.
*/
var getDefaultPropName = function getDefaultPropName(prop) {
return 'default' + (prop[0].toUpperCase() + prop.slice(1));
};
/**
* Return the auto controlled state value for a give prop. The initial value is chosen in this order:
* - regular props
* - then, default props
* - then, initial state
* - then, `checked` defaults to false
* - then, `value` defaults to '' or [] if props.multiple
* - else, undefined
*
* @param {string} propName A prop name
* @param {object} [props] A props object
* @param {object} [state] A state object
* @param {boolean} [includeDefaults=false] Whether or not to heed the default props or initial state
*/
var getAutoControlledStateValue = exports.getAutoControlledStateValue = function getAutoControlledStateValue(propName, props, state) {
var includeDefaults = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
// regular props
var propValue = props[propName];
if (propValue !== undefined) return propValue;
if (includeDefaults) {
// defaultProps
var defaultProp = props[getDefaultPropName(propName)];
if (defaultProp !== undefined) return defaultProp;
// initial state - state may be null or undefined
if (state) {
var initialState = state[propName];
if (initialState !== undefined) return initialState;
}
}
// React doesn't allow changing from uncontrolled to controlled components,
// default checked/value if they were not present.
if (propName === 'checked') return false;
if (propName === 'value') return props.multiple ? [] : '';
// otherwise, undefined
};
var AutoControlledComponent = function (_Component) {
_inherits(AutoControlledComponent, _Component);
function AutoControlledComponent() {
var _ref;
var _temp, _this, _ret;
_classCallCheck(this, AutoControlledComponent);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = AutoControlledComponent.__proto__ || Object.getPrototypeOf(AutoControlledComponent)).call.apply(_ref, [this].concat(args))), _this), _this.trySetState = function (maybeState, state) {
var autoControlledProps = _this.constructor.autoControlledProps;
if (process.env.NODE_ENV !== 'production') {
var name = _this.constructor.name;
// warn about failed attempts to setState for keys not listed in autoControlledProps
var illegalKeys = (0, _difference3.default)((0, _keys3.default)(maybeState), autoControlledProps);
if (!(0, _isEmpty3.default)(illegalKeys)) {
console.error([name + ' called trySetState() with controlled props: "' + illegalKeys + '".', 'State will not be set.', 'Only props in static autoControlledProps will be set on state.'].join(' '));
}
}
var newState = Object.keys(maybeState).reduce(function (acc, prop) {
// ignore props defined by the parent
if (_this.props[prop] !== undefined) return acc;
// ignore props not listed in auto controlled props
if (autoControlledProps.indexOf(prop) === -1) return acc;
acc[prop] = maybeState[prop];
return acc;
}, {});
if (state) newState = _extends({}, newState, state);
if (Object.keys(newState).length > 0) _this.setState(newState);
}, _temp), _possibleConstructorReturn(_this, _ret);
}
_createClass(AutoControlledComponent, [{
key: 'componentWillMount',
value: function componentWillMount() {
var _this2 = this;
var autoControlledProps = this.constructor.autoControlledProps;
if (process.env.NODE_ENV !== 'production') {
(function () {
var _constructor = _this2.constructor,
defaultProps = _constructor.defaultProps,
name = _constructor.name,
propTypes = _constructor.propTypes;
// require static autoControlledProps
if (!autoControlledProps) {
console.error('Auto controlled ' + name + ' must specify a static autoControlledProps array.');
}
// require propTypes
(0, _each3.default)(autoControlledProps, function (prop) {
var defaultProp = getDefaultPropName(prop);
// regular prop
if (!(0, _has3.default)(propTypes, defaultProp)) {
console.error(name + ' is missing "' + defaultProp + '" propTypes validation for auto controlled prop "' + prop + '".');
}
// its default prop
if (!(0, _has3.default)(propTypes, prop)) {
console.error(name + ' is missing propTypes validation for auto controlled prop "' + prop + '".');
}
});
// prevent autoControlledProps in defaultProps
//
// When setting state, auto controlled props values always win (so the parent can manage them).
// It is not reasonable to decipher the difference between props from the parent and defaultProps.
// Allowing defaultProps results in trySetState always deferring to the defaultProp value.
// Auto controlled props also listed in defaultProps can never be updated.
//
// To set defaults for an AutoControlled prop, you can set the initial state in the
// constructor or by using an ES7 property initializer:
// https://babeljs.io/blog/2015/06/07/react-on-es6-plus#property-initializers
var illegalDefaults = (0, _intersection3.default)(autoControlledProps, (0, _keys3.default)(defaultProps));
if (!(0, _isEmpty3.default)(illegalDefaults)) {
console.error(['Do not set defaultProps for autoControlledProps. You can set defaults by', 'setting state in the constructor or using an ES7 property initializer', '(https://babeljs.io/blog/2015/06/07/react-on-es6-plus#property-initializers)', 'See ' + name + ' props: "' + illegalDefaults + '".'].join(' '));
}
// prevent listing defaultProps in autoControlledProps
//
// Default props are automatically handled.
// Listing defaults in autoControlledProps would result in allowing defaultDefaultValue props.
var illegalAutoControlled = (0, _filter3.default)(autoControlledProps, function (prop) {
return (0, _startsWith3.default)(prop, 'default');
});
if (!(0, _isEmpty3.default)(illegalAutoControlled)) {
console.error(['Do not add default props to autoControlledProps.', 'Default props are automatically handled.', 'See ' + name + ' autoControlledProps: "' + illegalAutoControlled + '".'].join(' '));
}
})();
}
// Auto controlled props are copied to state.
// Set initial state by copying auto controlled props to state.
// Also look for the default prop for any auto controlled props (foo => defaultFoo)
// so we can set initial values from defaults.
var initialAutoControlledState = autoControlledProps.reduce(function (acc, prop) {
acc[prop] = getAutoControlledStateValue(prop, _this2.props, _this2.state, true);
if (process.env.NODE_ENV !== 'production') {
var defaultPropName = getDefaultPropName(prop);
var _name = _this2.constructor.name;
// prevent defaultFoo={} along side foo={}
if (defaultPropName in _this2.props && prop in _this2.props) {
console.error(_name + ' prop "' + prop + '" is auto controlled. Specify either ' + defaultPropName + ' or ' + prop + ', but not both.');
}
}
return acc;
}, {});
this.state = _extends({}, this.state, initialAutoControlledState);
}
}, {
key: 'componentWillReceiveProps',
value: function componentWillReceiveProps(nextProps) {
var _this3 = this;
var autoControlledProps = this.constructor.autoControlledProps;
// Solve the next state for autoControlledProps
var newState = autoControlledProps.reduce(function (acc, prop) {
var isNextUndefined = (0, _isUndefined3.default)(nextProps[prop]);
var propWasRemoved = !(0, _isUndefined3.default)(_this3.props[prop]) && isNextUndefined;
// if next is defined then use its value
if (!isNextUndefined) acc[prop] = nextProps[prop];
// reinitialize state for props just removed / set undefined
else if (propWasRemoved) acc[prop] = getAutoControlledStateValue(prop, nextProps);
return acc;
}, {});
if (Object.keys(newState).length > 0) this.setState(newState);
}
/**
* Safely attempt to set state for props that might be controlled by the user.
* Second argument is a state object that is always passed to setState.
* @param {object} maybeState State that corresponds to controlled props.
* @param {object} [state] Actual state, useful when you also need to setState.
*/
}]);
return AutoControlledComponent;
}(_react.Component);
exports.default = AutoControlledComponent;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../../../process/browser.js */ 4)))
/***/ },
/* 594 */
/*!****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/difference.js ***!
\****************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseDifference = __webpack_require__(/*! ./_baseDifference */ 595),
baseFlatten = __webpack_require__(/*! ./_baseFlatten */ 607),
baseRest = __webpack_require__(/*! ./_baseRest */ 610),
isArrayLikeObject = __webpack_require__(/*! ./isArrayLikeObject */ 619);
/**
* Creates an array of `array` values not included in the other given arrays
* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons. The order and references of result values are
* determined by the first array.
*
* **Note:** Unlike `_.pullAll`, this method returns a new array.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to inspect.
* @param {...Array} [values] The values to exclude.
* @returns {Array} Returns the new array of filtered values.
* @see _.without, _.xor
* @example
*
* _.difference([2, 1], [2, 3]);
* // => [1]
*/
var difference = baseRest(function(array, values) {
return isArrayLikeObject(array)
? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
: [];
});
module.exports = difference;
/***/ },
/* 595 */
/*!*********************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_baseDifference.js ***!
\*********************************************************/
/***/ function(module, exports, __webpack_require__) {
var SetCache = __webpack_require__(/*! ./_SetCache */ 596),
arrayIncludes = __webpack_require__(/*! ./_arrayIncludes */ 599),
arrayIncludesWith = __webpack_require__(/*! ./_arrayIncludesWith */ 604),
arrayMap = __webpack_require__(/*! ./_arrayMap */ 586),
baseUnary = __webpack_require__(/*! ./_baseUnary */ 605),
cacheHas = __webpack_require__(/*! ./_cacheHas */ 606);
/** Used as the size to enable large array optimizations. */
var LARGE_ARRAY_SIZE = 200;
/**
* The base implementation of methods like `_.difference` without support
* for excluding multiple arrays or iteratee shorthands.
*
* @private
* @param {Array} array The array to inspect.
* @param {Array} values The values to exclude.
* @param {Function} [iteratee] The iteratee invoked per element.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new array of filtered values.
*/
function baseDifference(array, values, iteratee, comparator) {
var index = -1,
includes = arrayIncludes,
isCommon = true,
length = array.length,
result = [],
valuesLength = values.length;
if (!length) {
return result;
}
if (iteratee) {
values = arrayMap(values, baseUnary(iteratee));
}
if (comparator) {
includes = arrayIncludesWith;
isCommon = false;
}
else if (values.length >= LARGE_ARRAY_SIZE) {
includes = cacheHas;
isCommon = false;
values = new SetCache(values);
}
outer:
while (++index < length) {
var value = array[index],
computed = iteratee == null ? value : iteratee(value);
value = (comparator || value !== 0) ? value : 0;
if (isCommon && computed === computed) {
var valuesIndex = valuesLength;
while (valuesIndex--) {
if (values[valuesIndex] === computed) {
continue outer;
}
}
result.push(value);
}
else if (!includes(values, computed, comparator)) {
result.push(value);
}
}
return result;
}
module.exports = baseDifference;
/***/ },
/* 596 */
/*!***************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_SetCache.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
var MapCache = __webpack_require__(/*! ./_MapCache */ 552),
setCacheAdd = __webpack_require__(/*! ./_setCacheAdd */ 597),
setCacheHas = __webpack_require__(/*! ./_setCacheHas */ 598);
/**
*
* Creates an array cache object to store unique values.
*
* @private
* @constructor
* @param {Array} [values] The values to cache.
*/
function SetCache(values) {
var index = -1,
length = values == null ? 0 : values.length;
this.__data__ = new MapCache;
while (++index < length) {
this.add(values[index]);
}
}
// Add methods to `SetCache`.
SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
SetCache.prototype.has = setCacheHas;
module.exports = SetCache;
/***/ },
/* 597 */
/*!******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_setCacheAdd.js ***!
\******************************************************/
/***/ function(module, exports) {
/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';
/**
* Adds `value` to the array cache.
*
* @private
* @name add
* @memberOf SetCache
* @alias push
* @param {*} value The value to cache.
* @returns {Object} Returns the cache instance.
*/
function setCacheAdd(value) {
this.__data__.set(value, HASH_UNDEFINED);
return this;
}
module.exports = setCacheAdd;
/***/ },
/* 598 */
/*!******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_setCacheHas.js ***!
\******************************************************/
/***/ function(module, exports) {
/**
* Checks if `value` is in the array cache.
*
* @private
* @name has
* @memberOf SetCache
* @param {*} value The value to search for.
* @returns {number} Returns `true` if `value` is found, else `false`.
*/
function setCacheHas(value) {
return this.__data__.has(value);
}
module.exports = setCacheHas;
/***/ },
/* 599 */
/*!********************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_arrayIncludes.js ***!
\********************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseIndexOf = __webpack_require__(/*! ./_baseIndexOf */ 600);
/**
* A specialized version of `_.includes` for arrays without support for
* specifying an index to search from.
*
* @private
* @param {Array} [array] The array to inspect.
* @param {*} target The value to search for.
* @returns {boolean} Returns `true` if `target` is found, else `false`.
*/
function arrayIncludes(array, value) {
var length = array == null ? 0 : array.length;
return !!length && baseIndexOf(array, value, 0) > -1;
}
module.exports = arrayIncludes;
/***/ },
/* 600 */
/*!******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_baseIndexOf.js ***!
\******************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseFindIndex = __webpack_require__(/*! ./_baseFindIndex */ 601),
baseIsNaN = __webpack_require__(/*! ./_baseIsNaN */ 602),
strictIndexOf = __webpack_require__(/*! ./_strictIndexOf */ 603);
/**
* The base implementation of `_.indexOf` without `fromIndex` bounds checks.
*
* @private
* @param {Array} array The array to inspect.
* @param {*} value The value to search for.
* @param {number} fromIndex The index to search from.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function baseIndexOf(array, value, fromIndex) {
return value === value
? strictIndexOf(array, value, fromIndex)
: baseFindIndex(array, baseIsNaN, fromIndex);
}
module.exports = baseIndexOf;
/***/ },
/* 601 */
/*!********************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_baseFindIndex.js ***!
\********************************************************/
/***/ function(module, exports) {
/**
* The base implementation of `_.findIndex` and `_.findLastIndex` without
* support for iteratee shorthands.
*
* @private
* @param {Array} array The array to inspect.
* @param {Function} predicate The function invoked per iteration.
* @param {number} fromIndex The index to search from.
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function baseFindIndex(array, predicate, fromIndex, fromRight) {
var length = array.length,
index = fromIndex + (fromRight ? 1 : -1);
while ((fromRight ? index-- : ++index < length)) {
if (predicate(array[index], index, array)) {
return index;
}
}
return -1;
}
module.exports = baseFindIndex;
/***/ },
/* 602 */
/*!****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_baseIsNaN.js ***!
\****************************************************/
/***/ function(module, exports) {
/**
* The base implementation of `_.isNaN` without support for number objects.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
*/
function baseIsNaN(value) {
return value !== value;
}
module.exports = baseIsNaN;
/***/ },
/* 603 */
/*!********************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_strictIndexOf.js ***!
\********************************************************/
/***/ function(module, exports) {
/**
* A specialized version of `_.indexOf` which performs strict equality
* comparisons of values, i.e. `===`.
*
* @private
* @param {Array} array The array to inspect.
* @param {*} value The value to search for.
* @param {number} fromIndex The index to search from.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function strictIndexOf(array, value, fromIndex) {
var index = fromIndex - 1,
length = array.length;
while (++index < length) {
if (array[index] === value) {
return index;
}
}
return -1;
}
module.exports = strictIndexOf;
/***/ },
/* 604 */
/*!************************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_arrayIncludesWith.js ***!
\************************************************************/
/***/ function(module, exports) {
/**
* This function is like `arrayIncludes` except that it accepts a comparator.
*
* @private
* @param {Array} [array] The array to inspect.
* @param {*} target The value to search for.
* @param {Function} comparator The comparator invoked per element.
* @returns {boolean} Returns `true` if `target` is found, else `false`.
*/
function arrayIncludesWith(array, value, comparator) {
var index = -1,
length = array == null ? 0 : array.length;
while (++index < length) {
if (comparator(value, array[index])) {
return true;
}
}
return false;
}
module.exports = arrayIncludesWith;
/***/ },
/* 605 */
/*!****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_baseUnary.js ***!
\****************************************************/
/***/ function(module, exports) {
/**
* The base implementation of `_.unary` without support for storing metadata.
*
* @private
* @param {Function} func The function to cap arguments for.
* @returns {Function} Returns the new capped function.
*/
function baseUnary(func) {
return function(value) {
return func(value);
};
}
module.exports = baseUnary;
/***/ },
/* 606 */
/*!***************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_cacheHas.js ***!
\***************************************************/
/***/ function(module, exports) {
/**
* Checks if a `cache` value for `key` exists.
*
* @private
* @param {Object} cache The cache to query.
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function cacheHas(cache, key) {
return cache.has(key);
}
module.exports = cacheHas;
/***/ },
/* 607 */
/*!******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_baseFlatten.js ***!
\******************************************************/
/***/ function(module, exports, __webpack_require__) {
var arrayPush = __webpack_require__(/*! ./_arrayPush */ 608),
isFlattenable = __webpack_require__(/*! ./_isFlattenable */ 609);
/**
* The base implementation of `_.flatten` with support for restricting flattening.
*
* @private
* @param {Array} array The array to flatten.
* @param {number} depth The maximum recursion depth.
* @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
* @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
* @param {Array} [result=[]] The initial result value.
* @returns {Array} Returns the new flattened array.
*/
function baseFlatten(array, depth, predicate, isStrict, result) {
var index = -1,
length = array.length;
predicate || (predicate = isFlattenable);
result || (result = []);
while (++index < length) {
var value = array[index];
if (depth > 0 && predicate(value)) {
if (depth > 1) {
// Recursively flatten arrays (susceptible to call stack limits).
baseFlatten(value, depth - 1, predicate, isStrict, result);
} else {
arrayPush(result, value);
}
} else if (!isStrict) {
result[result.length] = value;
}
}
return result;
}
module.exports = baseFlatten;
/***/ },
/* 608 */
/*!****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_arrayPush.js ***!
\****************************************************/
/***/ function(module, exports) {
/**
* Appends the elements of `values` to `array`.
*
* @private
* @param {Array} array The array to modify.
* @param {Array} values The values to append.
* @returns {Array} Returns `array`.
*/
function arrayPush(array, values) {
var index = -1,
length = values.length,
offset = array.length;
while (++index < length) {
array[offset + index] = values[index];
}
return array;
}
module.exports = arrayPush;
/***/ },
/* 609 */
/*!********************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_isFlattenable.js ***!
\********************************************************/
/***/ function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__(/*! ./_Symbol */ 543),
isArguments = __webpack_require__(/*! ./isArguments */ 587),
isArray = __webpack_require__(/*! ./isArray */ 539);
/** Built-in value references. */
var spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;
/**
* Checks if `value` is a flattenable `arguments` object or array.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
*/
function isFlattenable(value) {
return isArray(value) || isArguments(value) ||
!!(spreadableSymbol && value && value[spreadableSymbol]);
}
module.exports = isFlattenable;
/***/ },
/* 610 */
/*!***************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_baseRest.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
var identity = __webpack_require__(/*! ./identity */ 611),
overRest = __webpack_require__(/*! ./_overRest */ 612),
setToString = __webpack_require__(/*! ./_setToString */ 614);
/**
* The base implementation of `_.rest` which doesn't validate or coerce arguments.
*
* @private
* @param {Function} func The function to apply a rest parameter to.
* @param {number} [start=func.length-1] The start position of the rest parameter.
* @returns {Function} Returns the new function.
*/
function baseRest(func, start) {
return setToString(overRest(func, start, identity), func + '');
}
module.exports = baseRest;
/***/ },
/* 611 */
/*!**************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/identity.js ***!
\**************************************************/
/***/ function(module, exports) {
/**
* This method returns the first argument it receives.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Util
* @param {*} value Any value.
* @returns {*} Returns `value`.
* @example
*
* var object = { 'a': 1 };
*
* console.log(_.identity(object) === object);
* // => true
*/
function identity(value) {
return value;
}
module.exports = identity;
/***/ },
/* 612 */
/*!***************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_overRest.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
var apply = __webpack_require__(/*! ./_apply */ 613);
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max;
/**
* A specialized version of `baseRest` which transforms the rest array.
*
* @private
* @param {Function} func The function to apply a rest parameter to.
* @param {number} [start=func.length-1] The start position of the rest parameter.
* @param {Function} transform The rest array transform.
* @returns {Function} Returns the new function.
*/
function overRest(func, start, transform) {
start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
return function() {
var args = arguments,
index = -1,
length = nativeMax(args.length - start, 0),
array = Array(length);
while (++index < length) {
array[index] = args[start + index];
}
index = -1;
var otherArgs = Array(start + 1);
while (++index < start) {
otherArgs[index] = args[index];
}
otherArgs[start] = transform(array);
return apply(func, this, otherArgs);
};
}
module.exports = overRest;
/***/ },
/* 613 */
/*!************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_apply.js ***!
\************************************************/
/***/ function(module, exports) {
/**
* A faster alternative to `Function#apply`, this function invokes `func`
* with the `this` binding of `thisArg` and the arguments of `args`.
*
* @private
* @param {Function} func The function to invoke.
* @param {*} thisArg The `this` binding of `func`.
* @param {Array} args The arguments to invoke `func` with.
* @returns {*} Returns the result of `func`.
*/
function apply(func, thisArg, args) {
switch (args.length) {
case 0: return func.call(thisArg);
case 1: return func.call(thisArg, args[0]);
case 2: return func.call(thisArg, args[0], args[1]);
case 3: return func.call(thisArg, args[0], args[1], args[2]);
}
return func.apply(thisArg, args);
}
module.exports = apply;
/***/ },
/* 614 */
/*!******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_setToString.js ***!
\******************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseSetToString = __webpack_require__(/*! ./_baseSetToString */ 615),
shortOut = __webpack_require__(/*! ./_shortOut */ 618);
/**
* Sets the `toString` method of `func` to return `string`.
*
* @private
* @param {Function} func The function to modify.
* @param {Function} string The `toString` result.
* @returns {Function} Returns `func`.
*/
var setToString = shortOut(baseSetToString);
module.exports = setToString;
/***/ },
/* 615 */
/*!**********************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_baseSetToString.js ***!
\**********************************************************/
/***/ function(module, exports, __webpack_require__) {
var constant = __webpack_require__(/*! ./constant */ 616),
defineProperty = __webpack_require__(/*! ./_defineProperty */ 617),
identity = __webpack_require__(/*! ./identity */ 611);
/**
* The base implementation of `setToString` without support for hot loop shorting.
*
* @private
* @param {Function} func The function to modify.
* @param {Function} string The `toString` result.
* @returns {Function} Returns `func`.
*/
var baseSetToString = !defineProperty ? identity : function(func, string) {
return defineProperty(func, 'toString', {
'configurable': true,
'enumerable': false,
'value': constant(string),
'writable': true
});
};
module.exports = baseSetToString;
/***/ },
/* 616 */
/*!**************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/constant.js ***!
\**************************************************/
/***/ function(module, exports) {
/**
* Creates a function that returns `value`.
*
* @static
* @memberOf _
* @since 2.4.0
* @category Util
* @param {*} value The value to return from the new function.
* @returns {Function} Returns the new constant function.
* @example
*
* var objects = _.times(2, _.constant({ 'a': 1 }));
*
* console.log(objects);
* // => [{ 'a': 1 }, { 'a': 1 }]
*
* console.log(objects[0] === objects[1]);
* // => true
*/
function constant(value) {
return function() {
return value;
};
}
module.exports = constant;
/***/ },
/* 617 */
/*!*********************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_defineProperty.js ***!
\*********************************************************/
/***/ function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(/*! ./_getNative */ 557);
var defineProperty = (function() {
try {
var func = getNative(Object, 'defineProperty');
func({}, '', {});
return func;
} catch (e) {}
}());
module.exports = defineProperty;
/***/ },
/* 618 */
/*!***************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_shortOut.js ***!
\***************************************************/
/***/ function(module, exports) {
/** Used to detect hot functions by number of calls within a span of milliseconds. */
var HOT_COUNT = 800,
HOT_SPAN = 16;
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeNow = Date.now;
/**
* Creates a function that'll short out and invoke `identity` instead
* of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
* milliseconds.
*
* @private
* @param {Function} func The function to restrict.
* @returns {Function} Returns the new shortable function.
*/
function shortOut(func) {
var count = 0,
lastCalled = 0;
return function() {
var stamp = nativeNow(),
remaining = HOT_SPAN - (stamp - lastCalled);
lastCalled = stamp;
if (remaining > 0) {
if (++count >= HOT_COUNT) {
return arguments[0];
}
} else {
count = 0;
}
return func.apply(undefined, arguments);
};
}
module.exports = shortOut;
/***/ },
/* 619 */
/*!***********************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/isArrayLikeObject.js ***!
\***********************************************************/
/***/ function(module, exports, __webpack_require__) {
var isArrayLike = __webpack_require__(/*! ./isArrayLike */ 620),
isObjectLike = __webpack_require__(/*! ./isObjectLike */ 548);
/**
* This method is like `_.isArrayLike` except that it also checks if `value`
* is an object.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an array-like object,
* else `false`.
* @example
*
* _.isArrayLikeObject([1, 2, 3]);
* // => true
*
* _.isArrayLikeObject(document.body.children);
* // => true
*
* _.isArrayLikeObject('abc');
* // => false
*
* _.isArrayLikeObject(_.noop);
* // => false
*/
function isArrayLikeObject(value) {
return isObjectLike(value) && isArrayLike(value);
}
module.exports = isArrayLikeObject;
/***/ },
/* 620 */
/*!*****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/isArrayLike.js ***!
\*****************************************************/
/***/ function(module, exports, __webpack_require__) {
var isFunction = __webpack_require__(/*! ./isFunction */ 559),
isLength = __webpack_require__(/*! ./isLength */ 590);
/**
* Checks if `value` is array-like. A value is considered array-like if it's
* not a function and has a `value.length` that's an integer greater than or
* equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is array-like, else `false`.
* @example
*
* _.isArrayLike([1, 2, 3]);
* // => true
*
* _.isArrayLike(document.body.children);
* // => true
*
* _.isArrayLike('abc');
* // => true
*
* _.isArrayLike(_.noop);
* // => false
*/
function isArrayLike(value) {
return value != null && isLength(value.length) && !isFunction(value);
}
module.exports = isArrayLike;
/***/ },
/* 621 */
/*!*****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/isUndefined.js ***!
\*****************************************************/
/***/ function(module, exports) {
/**
* Checks if `value` is `undefined`.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
* @example
*
* _.isUndefined(void 0);
* // => true
*
* _.isUndefined(null);
* // => false
*/
function isUndefined(value) {
return value === undefined;
}
module.exports = isUndefined;
/***/ },
/* 622 */
/*!****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/startsWith.js ***!
\****************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseClamp = __webpack_require__(/*! ./_baseClamp */ 623),
baseToString = __webpack_require__(/*! ./_baseToString */ 585),
toInteger = __webpack_require__(/*! ./toInteger */ 624),
toString = __webpack_require__(/*! ./toString */ 584);
/**
* Checks if `string` starts with the given target string.
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to inspect.
* @param {string} [target] The string to search for.
* @param {number} [position=0] The position to search from.
* @returns {boolean} Returns `true` if `string` starts with `target`,
* else `false`.
* @example
*
* _.startsWith('abc', 'a');
* // => true
*
* _.startsWith('abc', 'b');
* // => false
*
* _.startsWith('abc', 'b', 1);
* // => true
*/
function startsWith(string, target, position) {
string = toString(string);
position = position == null
? 0
: baseClamp(toInteger(position), 0, string.length);
target = baseToString(target);
return string.slice(position, position + target.length) == target;
}
module.exports = startsWith;
/***/ },
/* 623 */
/*!****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_baseClamp.js ***!
\****************************************************/
/***/ function(module, exports) {
/**
* The base implementation of `_.clamp` which doesn't coerce arguments.
*
* @private
* @param {number} number The number to clamp.
* @param {number} [lower] The lower bound.
* @param {number} upper The upper bound.
* @returns {number} Returns the clamped number.
*/
function baseClamp(number, lower, upper) {
if (number === number) {
if (upper !== undefined) {
number = number <= upper ? number : upper;
}
if (lower !== undefined) {
number = number >= lower ? number : lower;
}
}
return number;
}
module.exports = baseClamp;
/***/ },
/* 624 */
/*!***************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/toInteger.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
var toFinite = __webpack_require__(/*! ./toFinite */ 625);
/**
* Converts `value` to an integer.
*
* **Note:** This method is loosely based on
* [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to convert.
* @returns {number} Returns the converted integer.
* @example
*
* _.toInteger(3.2);
* // => 3
*
* _.toInteger(Number.MIN_VALUE);
* // => 0
*
* _.toInteger(Infinity);
* // => 1.7976931348623157e+308
*
* _.toInteger('3.2');
* // => 3
*/
function toInteger(value) {
var result = toFinite(value),
remainder = result % 1;
return result === result ? (remainder ? result - remainder : result) : 0;
}
module.exports = toInteger;
/***/ },
/* 625 */
/*!**************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/toFinite.js ***!
\**************************************************/
/***/ function(module, exports, __webpack_require__) {
var toNumber = __webpack_require__(/*! ./toNumber */ 626);
/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0,
MAX_INTEGER = 1.7976931348623157e+308;
/**
* Converts `value` to a finite number.
*
* @static
* @memberOf _
* @since 4.12.0
* @category Lang
* @param {*} value The value to convert.
* @returns {number} Returns the converted number.
* @example
*
* _.toFinite(3.2);
* // => 3.2
*
* _.toFinite(Number.MIN_VALUE);
* // => 5e-324
*
* _.toFinite(Infinity);
* // => 1.7976931348623157e+308
*
* _.toFinite('3.2');
* // => 3.2
*/
function toFinite(value) {
if (!value) {
return value === 0 ? value : 0;
}
value = toNumber(value);
if (value === INFINITY || value === -INFINITY) {
var sign = (value < 0 ? -1 : 1);
return sign * MAX_INTEGER;
}
return value === value ? value : 0;
}
module.exports = toFinite;
/***/ },
/* 626 */
/*!**************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/toNumber.js ***!
\**************************************************/
/***/ function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(/*! ./isObject */ 560),
isSymbol = __webpack_require__(/*! ./isSymbol */ 541);
/** Used as references for various `Number` constants. */
var NAN = 0 / 0;
/** 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;
/**
* 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;
/***/ },
/* 627 */
/*!************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/filter.js ***!
\************************************************/
/***/ function(module, exports, __webpack_require__) {
var arrayFilter = __webpack_require__(/*! ./_arrayFilter */ 628),
baseFilter = __webpack_require__(/*! ./_baseFilter */ 629),
baseIteratee = __webpack_require__(/*! ./_baseIteratee */ 647),
isArray = __webpack_require__(/*! ./isArray */ 539);
/**
* Iterates over elements of `collection`, returning an array of all elements
* `predicate` returns truthy for. The predicate is invoked with three
* arguments: (value, index|key, collection).
*
* **Note:** Unlike `_.remove`, this method returns a new array.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @returns {Array} Returns the new filtered array.
* @see _.reject
* @example
*
* var users = [
* { 'user': 'barney', 'age': 36, 'active': true },
* { 'user': 'fred', 'age': 40, 'active': false }
* ];
*
* _.filter(users, function(o) { return !o.active; });
* // => objects for ['fred']
*
* // The `_.matches` iteratee shorthand.
* _.filter(users, { 'age': 36, 'active': true });
* // => objects for ['barney']
*
* // The `_.matchesProperty` iteratee shorthand.
* _.filter(users, ['active', false]);
* // => objects for ['fred']
*
* // The `_.property` iteratee shorthand.
* _.filter(users, 'active');
* // => objects for ['barney']
*/
function filter(collection, predicate) {
var func = isArray(collection) ? arrayFilter : baseFilter;
return func(collection, baseIteratee(predicate, 3));
}
module.exports = filter;
/***/ },
/* 628 */
/*!******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_arrayFilter.js ***!
\******************************************************/
/***/ function(module, exports) {
/**
* A specialized version of `_.filter` for arrays without support for
* iteratee shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} predicate The function invoked per iteration.
* @returns {Array} Returns the new filtered array.
*/
function arrayFilter(array, predicate) {
var index = -1,
length = array == null ? 0 : array.length,
resIndex = 0,
result = [];
while (++index < length) {
var value = array[index];
if (predicate(value, index, array)) {
result[resIndex++] = value;
}
}
return result;
}
module.exports = arrayFilter;
/***/ },
/* 629 */
/*!*****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_baseFilter.js ***!
\*****************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseEach = __webpack_require__(/*! ./_baseEach */ 630);
/**
* The base implementation of `_.filter` without support for iteratee shorthands.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} predicate The function invoked per iteration.
* @returns {Array} Returns the new filtered array.
*/
function baseFilter(collection, predicate) {
var result = [];
baseEach(collection, function(value, index, collection) {
if (predicate(value, index, collection)) {
result.push(value);
}
});
return result;
}
module.exports = baseFilter;
/***/ },
/* 630 */
/*!***************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_baseEach.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseForOwn = __webpack_require__(/*! ./_baseForOwn */ 631),
createBaseEach = __webpack_require__(/*! ./_createBaseEach */ 646);
/**
* The base implementation of `_.forEach` without support for iteratee shorthands.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array|Object} Returns `collection`.
*/
var baseEach = createBaseEach(baseForOwn);
module.exports = baseEach;
/***/ },
/* 631 */
/*!*****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_baseForOwn.js ***!
\*****************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseFor = __webpack_require__(/*! ./_baseFor */ 632),
keys = __webpack_require__(/*! ./keys */ 634);
/**
* The base implementation of `_.forOwn` without support for iteratee shorthands.
*
* @private
* @param {Object} object The object to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Object} Returns `object`.
*/
function baseForOwn(object, iteratee) {
return object && baseFor(object, iteratee, keys);
}
module.exports = baseForOwn;
/***/ },
/* 632 */
/*!**************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_baseFor.js ***!
\**************************************************/
/***/ function(module, exports, __webpack_require__) {
var createBaseFor = __webpack_require__(/*! ./_createBaseFor */ 633);
/**
* The base implementation of `baseForOwn` which iterates over `object`
* properties returned by `keysFunc` and invokes `iteratee` for each property.
* Iteratee functions may exit iteration early by explicitly returning `false`.
*
* @private
* @param {Object} object The object to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @param {Function} keysFunc The function to get the keys of `object`.
* @returns {Object} Returns `object`.
*/
var baseFor = createBaseFor();
module.exports = baseFor;
/***/ },
/* 633 */
/*!********************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_createBaseFor.js ***!
\********************************************************/
/***/ function(module, exports) {
/**
* Creates a base function for methods like `_.forIn` and `_.forOwn`.
*
* @private
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {Function} Returns the new base function.
*/
function createBaseFor(fromRight) {
return function(object, iteratee, keysFunc) {
var index = -1,
iterable = Object(object),
props = keysFunc(object),
length = props.length;
while (length--) {
var key = props[fromRight ? length : ++index];
if (iteratee(iterable[key], key, iterable) === false) {
break;
}
}
return object;
};
}
module.exports = createBaseFor;
/***/ },
/* 634 */
/*!**********************************************!*\
!*** ./~/semantic-ui-react/~/lodash/keys.js ***!
\**********************************************/
/***/ function(module, exports, __webpack_require__) {
var arrayLikeKeys = __webpack_require__(/*! ./_arrayLikeKeys */ 635),
baseKeys = __webpack_require__(/*! ./_baseKeys */ 642),
isArrayLike = __webpack_require__(/*! ./isArrayLike */ 620);
/**
* Creates an array of the own enumerable property names of `object`.
*
* **Note:** Non-object values are coerced to objects. See the
* [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
* for more details.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.keys(new Foo);
* // => ['a', 'b'] (iteration order is not guaranteed)
*
* _.keys('hi');
* // => ['0', '1']
*/
function keys(object) {
return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
}
module.exports = keys;
/***/ },
/* 635 */
/*!********************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_arrayLikeKeys.js ***!
\********************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseTimes = __webpack_require__(/*! ./_baseTimes */ 636),
isArguments = __webpack_require__(/*! ./isArguments */ 587),
isArray = __webpack_require__(/*! ./isArray */ 539),
isBuffer = __webpack_require__(/*! ./isBuffer */ 637),
isIndex = __webpack_require__(/*! ./_isIndex */ 589),
isTypedArray = __webpack_require__(/*! ./isTypedArray */ 639);
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Creates an array of the enumerable property names of the array-like `value`.
*
* @private
* @param {*} value The value to query.
* @param {boolean} inherited Specify returning inherited property names.
* @returns {Array} Returns the array of property names.
*/
function arrayLikeKeys(value, inherited) {
var isArr = isArray(value),
isArg = !isArr && isArguments(value),
isBuff = !isArr && !isArg && isBuffer(value),
isType = !isArr && !isArg && !isBuff && isTypedArray(value),
skipIndexes = isArr || isArg || isBuff || isType,
result = skipIndexes ? baseTimes(value.length, String) : [],
length = result.length;
for (var key in value) {
if ((inherited || hasOwnProperty.call(value, key)) &&
!(skipIndexes && (
// Safari 9 has enumerable `arguments.length` in strict mode.
key == 'length' ||
// Node.js 0.10 has enumerable non-index properties on buffers.
(isBuff && (key == 'offset' || key == 'parent')) ||
// PhantomJS 2 has enumerable non-index properties on typed arrays.
(isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
// Skip index properties.
isIndex(key, length)
))) {
result.push(key);
}
}
return result;
}
module.exports = arrayLikeKeys;
/***/ },
/* 636 */
/*!****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_baseTimes.js ***!
\****************************************************/
/***/ function(module, exports) {
/**
* The base implementation of `_.times` without support for iteratee shorthands
* or max array length checks.
*
* @private
* @param {number} n The number of times to invoke `iteratee`.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns the array of results.
*/
function baseTimes(n, iteratee) {
var index = -1,
result = Array(n);
while (++index < n) {
result[index] = iteratee(index);
}
return result;
}
module.exports = baseTimes;
/***/ },
/* 637 */
/*!**************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/isBuffer.js ***!
\**************************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__(/*! ./_root */ 544),
stubFalse = __webpack_require__(/*! ./stubFalse */ 638);
/** Detect free variable `exports`. */
var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
/** Detect free variable `module`. */
var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
/** Detect the popular CommonJS extension `module.exports`. */
var moduleExports = freeModule && freeModule.exports === freeExports;
/** Built-in value references. */
var Buffer = moduleExports ? root.Buffer : undefined;
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
/**
* Checks if `value` is a buffer.
*
* @static
* @memberOf _
* @since 4.3.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
* @example
*
* _.isBuffer(new Buffer(2));
* // => true
*
* _.isBuffer(new Uint8Array(2));
* // => false
*/
var isBuffer = nativeIsBuffer || stubFalse;
module.exports = isBuffer;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../../webpack/buildin/module.js */ 193)(module)))
/***/ },
/* 638 */
/*!***************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/stubFalse.js ***!
\***************************************************/
/***/ function(module, exports) {
/**
* This method returns `false`.
*
* @static
* @memberOf _
* @since 4.13.0
* @category Util
* @returns {boolean} Returns `false`.
* @example
*
* _.times(2, _.stubFalse);
* // => [false, false]
*/
function stubFalse() {
return false;
}
module.exports = stubFalse;
/***/ },
/* 639 */
/*!******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/isTypedArray.js ***!
\******************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseIsTypedArray = __webpack_require__(/*! ./_baseIsTypedArray */ 640),
baseUnary = __webpack_require__(/*! ./_baseUnary */ 605),
nodeUtil = __webpack_require__(/*! ./_nodeUtil */ 641);
/* Node.js helper references. */
var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
/**
* Checks if `value` is classified as a typed array.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
* @example
*
* _.isTypedArray(new Uint8Array);
* // => true
*
* _.isTypedArray([]);
* // => false
*/
var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
module.exports = isTypedArray;
/***/ },
/* 640 */
/*!***********************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_baseIsTypedArray.js ***!
\***********************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ 542),
isLength = __webpack_require__(/*! ./isLength */ 590),
isObjectLike = __webpack_require__(/*! ./isObjectLike */ 548);
/** `Object#toString` result references. */
var argsTag = '[object Arguments]',
arrayTag = '[object Array]',
boolTag = '[object Boolean]',
dateTag = '[object Date]',
errorTag = '[object Error]',
funcTag = '[object Function]',
mapTag = '[object Map]',
numberTag = '[object Number]',
objectTag = '[object Object]',
regexpTag = '[object RegExp]',
setTag = '[object Set]',
stringTag = '[object String]',
weakMapTag = '[object WeakMap]';
var arrayBufferTag = '[object ArrayBuffer]',
dataViewTag = '[object DataView]',
float32Tag = '[object Float32Array]',
float64Tag = '[object Float64Array]',
int8Tag = '[object Int8Array]',
int16Tag = '[object Int16Array]',
int32Tag = '[object Int32Array]',
uint8Tag = '[object Uint8Array]',
uint8ClampedTag = '[object Uint8ClampedArray]',
uint16Tag = '[object Uint16Array]',
uint32Tag = '[object Uint32Array]';
/** Used to identify `toStringTag` values of typed arrays. */
var typedArrayTags = {};
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
typedArrayTags[uint32Tag] = true;
typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
typedArrayTags[errorTag] = typedArrayTags[funcTag] =
typedArrayTags[mapTag] = typedArrayTags[numberTag] =
typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
typedArrayTags[setTag] = typedArrayTags[stringTag] =
typedArrayTags[weakMapTag] = false;
/**
* The base implementation of `_.isTypedArray` without Node.js optimizations.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
*/
function baseIsTypedArray(value) {
return isObjectLike(value) &&
isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
}
module.exports = baseIsTypedArray;
/***/ },
/* 641 */
/*!***************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_nodeUtil.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(module) {var freeGlobal = __webpack_require__(/*! ./_freeGlobal */ 545);
/** Detect free variable `exports`. */
var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
/** Detect free variable `module`. */
var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
/** Detect the popular CommonJS extension `module.exports`. */
var moduleExports = freeModule && freeModule.exports === freeExports;
/** Detect free variable `process` from Node.js. */
var freeProcess = moduleExports && freeGlobal.process;
/** Used to access faster Node.js helpers. */
var nodeUtil = (function() {
try {
return freeProcess && freeProcess.binding && freeProcess.binding('util');
} catch (e) {}
}());
module.exports = nodeUtil;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../../webpack/buildin/module.js */ 193)(module)))
/***/ },
/* 642 */
/*!***************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_baseKeys.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
var isPrototype = __webpack_require__(/*! ./_isPrototype */ 643),
nativeKeys = __webpack_require__(/*! ./_nativeKeys */ 644);
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
*/
function baseKeys(object) {
if (!isPrototype(object)) {
return nativeKeys(object);
}
var result = [];
for (var key in Object(object)) {
if (hasOwnProperty.call(object, key) && key != 'constructor') {
result.push(key);
}
}
return result;
}
module.exports = baseKeys;
/***/ },
/* 643 */
/*!******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_isPrototype.js ***!
\******************************************************/
/***/ function(module, exports) {
/** Used for built-in method references. */
var objectProto = Object.prototype;
/**
* Checks if `value` is likely a prototype object.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
*/
function isPrototype(value) {
var Ctor = value && value.constructor,
proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
return value === proto;
}
module.exports = isPrototype;
/***/ },
/* 644 */
/*!*****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_nativeKeys.js ***!
\*****************************************************/
/***/ function(module, exports, __webpack_require__) {
var overArg = __webpack_require__(/*! ./_overArg */ 645);
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeKeys = overArg(Object.keys, Object);
module.exports = nativeKeys;
/***/ },
/* 645 */
/*!**************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_overArg.js ***!
\**************************************************/
/***/ function(module, exports) {
/**
* Creates a unary function that invokes `func` with its argument transformed.
*
* @private
* @param {Function} func The function to wrap.
* @param {Function} transform The argument transform.
* @returns {Function} Returns the new function.
*/
function overArg(func, transform) {
return function(arg) {
return func(transform(arg));
};
}
module.exports = overArg;
/***/ },
/* 646 */
/*!*********************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_createBaseEach.js ***!
\*********************************************************/
/***/ function(module, exports, __webpack_require__) {
var isArrayLike = __webpack_require__(/*! ./isArrayLike */ 620);
/**
* Creates a `baseEach` or `baseEachRight` function.
*
* @private
* @param {Function} eachFunc The function to iterate over a collection.
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {Function} Returns the new base function.
*/
function createBaseEach(eachFunc, fromRight) {
return function(collection, iteratee) {
if (collection == null) {
return collection;
}
if (!isArrayLike(collection)) {
return eachFunc(collection, iteratee);
}
var length = collection.length,
index = fromRight ? length : -1,
iterable = Object(collection);
while ((fromRight ? index-- : ++index < length)) {
if (iteratee(iterable[index], index, iterable) === false) {
break;
}
}
return collection;
};
}
module.exports = createBaseEach;
/***/ },
/* 647 */
/*!*******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_baseIteratee.js ***!
\*******************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseMatches = __webpack_require__(/*! ./_baseMatches */ 648),
baseMatchesProperty = __webpack_require__(/*! ./_baseMatchesProperty */ 677),
identity = __webpack_require__(/*! ./identity */ 611),
isArray = __webpack_require__(/*! ./isArray */ 539),
property = __webpack_require__(/*! ./property */ 682);
/**
* The base implementation of `_.iteratee`.
*
* @private
* @param {*} [value=_.identity] The value to convert to an iteratee.
* @returns {Function} Returns the iteratee.
*/
function baseIteratee(value) {
// Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
// See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
if (typeof value == 'function') {
return value;
}
if (value == null) {
return identity;
}
if (typeof value == 'object') {
return isArray(value)
? baseMatchesProperty(value[0], value[1])
: baseMatches(value);
}
return property(value);
}
module.exports = baseIteratee;
/***/ },
/* 648 */
/*!******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_baseMatches.js ***!
\******************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseIsMatch = __webpack_require__(/*! ./_baseIsMatch */ 649),
getMatchData = __webpack_require__(/*! ./_getMatchData */ 674),
matchesStrictComparable = __webpack_require__(/*! ./_matchesStrictComparable */ 676);
/**
* The base implementation of `_.matches` which doesn't clone `source`.
*
* @private
* @param {Object} source The object of property values to match.
* @returns {Function} Returns the new spec function.
*/
function baseMatches(source) {
var matchData = getMatchData(source);
if (matchData.length == 1 && matchData[0][2]) {
return matchesStrictComparable(matchData[0][0], matchData[0][1]);
}
return function(object) {
return object === source || baseIsMatch(object, source, matchData);
};
}
module.exports = baseMatches;
/***/ },
/* 649 */
/*!******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_baseIsMatch.js ***!
\******************************************************/
/***/ function(module, exports, __webpack_require__) {
var Stack = __webpack_require__(/*! ./_Stack */ 650),
baseIsEqual = __webpack_require__(/*! ./_baseIsEqual */ 656);
/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1,
COMPARE_UNORDERED_FLAG = 2;
/**
* The base implementation of `_.isMatch` without support for iteratee shorthands.
*
* @private
* @param {Object} object The object to inspect.
* @param {Object} source The object of property values to match.
* @param {Array} matchData The property names, values, and compare flags to match.
* @param {Function} [customizer] The function to customize comparisons.
* @returns {boolean} Returns `true` if `object` is a match, else `false`.
*/
function baseIsMatch(object, source, matchData, customizer) {
var index = matchData.length,
length = index,
noCustomizer = !customizer;
if (object == null) {
return !length;
}
object = Object(object);
while (index--) {
var data = matchData[index];
if ((noCustomizer && data[2])
? data[1] !== object[data[0]]
: !(data[0] in object)
) {
return false;
}
}
while (++index < length) {
data = matchData[index];
var key = data[0],
objValue = object[key],
srcValue = data[1];
if (noCustomizer && data[2]) {
if (objValue === undefined && !(key in object)) {
return false;
}
} else {
var stack = new Stack;
if (customizer) {
var result = customizer(objValue, srcValue, key, object, source, stack);
}
if (!(result === undefined
? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
: result
)) {
return false;
}
}
}
return true;
}
module.exports = baseIsMatch;
/***/ },
/* 650 */
/*!************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_Stack.js ***!
\************************************************/
/***/ function(module, exports, __webpack_require__) {
var ListCache = __webpack_require__(/*! ./_ListCache */ 569),
stackClear = __webpack_require__(/*! ./_stackClear */ 651),
stackDelete = __webpack_require__(/*! ./_stackDelete */ 652),
stackGet = __webpack_require__(/*! ./_stackGet */ 653),
stackHas = __webpack_require__(/*! ./_stackHas */ 654),
stackSet = __webpack_require__(/*! ./_stackSet */ 655);
/**
* Creates a stack cache object to store key-value pairs.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function Stack(entries) {
var data = this.__data__ = new ListCache(entries);
this.size = data.size;
}
// Add methods to `Stack`.
Stack.prototype.clear = stackClear;
Stack.prototype['delete'] = stackDelete;
Stack.prototype.get = stackGet;
Stack.prototype.has = stackHas;
Stack.prototype.set = stackSet;
module.exports = Stack;
/***/ },
/* 651 */
/*!*****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_stackClear.js ***!
\*****************************************************/
/***/ function(module, exports, __webpack_require__) {
var ListCache = __webpack_require__(/*! ./_ListCache */ 569);
/**
* Removes all key-value entries from the stack.
*
* @private
* @name clear
* @memberOf Stack
*/
function stackClear() {
this.__data__ = new ListCache;
this.size = 0;
}
module.exports = stackClear;
/***/ },
/* 652 */
/*!******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_stackDelete.js ***!
\******************************************************/
/***/ function(module, exports) {
/**
* Removes `key` and its value from the stack.
*
* @private
* @name delete
* @memberOf Stack
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function stackDelete(key) {
var data = this.__data__,
result = data['delete'](key);
this.size = data.size;
return result;
}
module.exports = stackDelete;
/***/ },
/* 653 */
/*!***************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_stackGet.js ***!
\***************************************************/
/***/ function(module, exports) {
/**
* Gets the stack value for `key`.
*
* @private
* @name get
* @memberOf Stack
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function stackGet(key) {
return this.__data__.get(key);
}
module.exports = stackGet;
/***/ },
/* 654 */
/*!***************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_stackHas.js ***!
\***************************************************/
/***/ function(module, exports) {
/**
* Checks if a stack value for `key` exists.
*
* @private
* @name has
* @memberOf Stack
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function stackHas(key) {
return this.__data__.has(key);
}
module.exports = stackHas;
/***/ },
/* 655 */
/*!***************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_stackSet.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
var ListCache = __webpack_require__(/*! ./_ListCache */ 569),
Map = __webpack_require__(/*! ./_Map */ 577),
MapCache = __webpack_require__(/*! ./_MapCache */ 552);
/** Used as the size to enable large array optimizations. */
var LARGE_ARRAY_SIZE = 200;
/**
* Sets the stack `key` to `value`.
*
* @private
* @name set
* @memberOf Stack
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the stack cache instance.
*/
function stackSet(key, value) {
var data = this.__data__;
if (data instanceof ListCache) {
var pairs = data.__data__;
if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
pairs.push([key, value]);
this.size = ++data.size;
return this;
}
data = this.__data__ = new MapCache(pairs);
}
data.set(key, value);
this.size = data.size;
return this;
}
module.exports = stackSet;
/***/ },
/* 656 */
/*!******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_baseIsEqual.js ***!
\******************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseIsEqualDeep = __webpack_require__(/*! ./_baseIsEqualDeep */ 657),
isObjectLike = __webpack_require__(/*! ./isObjectLike */ 548);
/**
* The base implementation of `_.isEqual` which supports partial comparisons
* and tracks traversed objects.
*
* @private
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @param {boolean} bitmask The bitmask flags.
* 1 - Unordered comparison
* 2 - Partial comparison
* @param {Function} [customizer] The function to customize comparisons.
* @param {Object} [stack] Tracks traversed `value` and `other` objects.
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
*/
function baseIsEqual(value, other, bitmask, customizer, stack) {
if (value === other) {
return true;
}
if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
return value !== value && other !== other;
}
return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
}
module.exports = baseIsEqual;
/***/ },
/* 657 */
/*!**********************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_baseIsEqualDeep.js ***!
\**********************************************************/
/***/ function(module, exports, __webpack_require__) {
var Stack = __webpack_require__(/*! ./_Stack */ 650),
equalArrays = __webpack_require__(/*! ./_equalArrays */ 658),
equalByTag = __webpack_require__(/*! ./_equalByTag */ 660),
equalObjects = __webpack_require__(/*! ./_equalObjects */ 664),
getTag = __webpack_require__(/*! ./_getTag */ 669),
isArray = __webpack_require__(/*! ./isArray */ 539),
isBuffer = __webpack_require__(/*! ./isBuffer */ 637),
isTypedArray = __webpack_require__(/*! ./isTypedArray */ 639);
/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1;
/** `Object#toString` result references. */
var argsTag = '[object Arguments]',
arrayTag = '[object Array]',
objectTag = '[object Object]';
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* A specialized version of `baseIsEqual` for arrays and objects which performs
* deep comparisons and tracks traversed objects enabling objects with circular
* references to be compared.
*
* @private
* @param {Object} object The object to compare.
* @param {Object} other The other object to compare.
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
* @param {Function} customizer The function to customize comparisons.
* @param {Function} equalFunc The function to determine equivalents of values.
* @param {Object} [stack] Tracks traversed `object` and `other` objects.
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
*/
function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
var objIsArr = isArray(object),
othIsArr = isArray(other),
objTag = objIsArr ? arrayTag : getTag(object),
othTag = othIsArr ? arrayTag : getTag(other);
objTag = objTag == argsTag ? objectTag : objTag;
othTag = othTag == argsTag ? objectTag : othTag;
var objIsObj = objTag == objectTag,
othIsObj = othTag == objectTag,
isSameTag = objTag == othTag;
if (isSameTag && isBuffer(object)) {
if (!isBuffer(other)) {
return false;
}
objIsArr = true;
objIsObj = false;
}
if (isSameTag && !objIsObj) {
stack || (stack = new Stack);
return (objIsArr || isTypedArray(object))
? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
: equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
}
if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
if (objIsWrapped || othIsWrapped) {
var objUnwrapped = objIsWrapped ? object.value() : object,
othUnwrapped = othIsWrapped ? other.value() : other;
stack || (stack = new Stack);
return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
}
}
if (!isSameTag) {
return false;
}
stack || (stack = new Stack);
return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
}
module.exports = baseIsEqualDeep;
/***/ },
/* 658 */
/*!******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_equalArrays.js ***!
\******************************************************/
/***/ function(module, exports, __webpack_require__) {
var SetCache = __webpack_require__(/*! ./_SetCache */ 596),
arraySome = __webpack_require__(/*! ./_arraySome */ 659),
cacheHas = __webpack_require__(/*! ./_cacheHas */ 606);
/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1,
COMPARE_UNORDERED_FLAG = 2;
/**
* A specialized version of `baseIsEqualDeep` for arrays with support for
* partial deep comparisons.
*
* @private
* @param {Array} array The array to compare.
* @param {Array} other The other array to compare.
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
* @param {Function} customizer The function to customize comparisons.
* @param {Function} equalFunc The function to determine equivalents of values.
* @param {Object} stack Tracks traversed `array` and `other` objects.
* @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
*/
function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
arrLength = array.length,
othLength = other.length;
if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
return false;
}
// Assume cyclic values are equal.
var stacked = stack.get(array);
if (stacked && stack.get(other)) {
return stacked == other;
}
var index = -1,
result = true,
seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
stack.set(array, other);
stack.set(other, array);
// Ignore non-index properties.
while (++index < arrLength) {
var arrValue = array[index],
othValue = other[index];
if (customizer) {
var compared = isPartial
? customizer(othValue, arrValue, index, other, array, stack)
: customizer(arrValue, othValue, index, array, other, stack);
}
if (compared !== undefined) {
if (compared) {
continue;
}
result = false;
break;
}
// Recursively compare arrays (susceptible to call stack limits).
if (seen) {
if (!arraySome(other, function(othValue, othIndex) {
if (!cacheHas(seen, othIndex) &&
(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
return seen.push(othIndex);
}
})) {
result = false;
break;
}
} else if (!(
arrValue === othValue ||
equalFunc(arrValue, othValue, bitmask, customizer, stack)
)) {
result = false;
break;
}
}
stack['delete'](array);
stack['delete'](other);
return result;
}
module.exports = equalArrays;
/***/ },
/* 659 */
/*!****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_arraySome.js ***!
\****************************************************/
/***/ function(module, exports) {
/**
* A specialized version of `_.some` for arrays without support for iteratee
* shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} predicate The function invoked per iteration.
* @returns {boolean} Returns `true` if any element passes the predicate check,
* else `false`.
*/
function arraySome(array, predicate) {
var index = -1,
length = array == null ? 0 : array.length;
while (++index < length) {
if (predicate(array[index], index, array)) {
return true;
}
}
return false;
}
module.exports = arraySome;
/***/ },
/* 660 */
/*!*****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_equalByTag.js ***!
\*****************************************************/
/***/ function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__(/*! ./_Symbol */ 543),
Uint8Array = __webpack_require__(/*! ./_Uint8Array */ 661),
eq = __webpack_require__(/*! ./eq */ 573),
equalArrays = __webpack_require__(/*! ./_equalArrays */ 658),
mapToArray = __webpack_require__(/*! ./_mapToArray */ 662),
setToArray = __webpack_require__(/*! ./_setToArray */ 663);
/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1,
COMPARE_UNORDERED_FLAG = 2;
/** `Object#toString` result references. */
var boolTag = '[object Boolean]',
dateTag = '[object Date]',
errorTag = '[object Error]',
mapTag = '[object Map]',
numberTag = '[object Number]',
regexpTag = '[object RegExp]',
setTag = '[object Set]',
stringTag = '[object String]',
symbolTag = '[object Symbol]';
var arrayBufferTag = '[object ArrayBuffer]',
dataViewTag = '[object DataView]';
/** Used to convert symbols to primitives and strings. */
var symbolProto = Symbol ? Symbol.prototype : undefined,
symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
/**
* A specialized version of `baseIsEqualDeep` for comparing objects of
* the same `toStringTag`.
*
* **Note:** This function only supports comparing values with tags of
* `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
*
* @private
* @param {Object} object The object to compare.
* @param {Object} other The other object to compare.
* @param {string} tag The `toStringTag` of the objects to compare.
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
* @param {Function} customizer The function to customize comparisons.
* @param {Function} equalFunc The function to determine equivalents of values.
* @param {Object} stack Tracks traversed `object` and `other` objects.
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
*/
function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
switch (tag) {
case dataViewTag:
if ((object.byteLength != other.byteLength) ||
(object.byteOffset != other.byteOffset)) {
return false;
}
object = object.buffer;
other = other.buffer;
case arrayBufferTag:
if ((object.byteLength != other.byteLength) ||
!equalFunc(new Uint8Array(object), new Uint8Array(other))) {
return false;
}
return true;
case boolTag:
case dateTag:
case numberTag:
// Coerce booleans to `1` or `0` and dates to milliseconds.
// Invalid dates are coerced to `NaN`.
return eq(+object, +other);
case errorTag:
return object.name == other.name && object.message == other.message;
case regexpTag:
case stringTag:
// Coerce regexes to strings and treat strings, primitives and objects,
// as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
// for more details.
return object == (other + '');
case mapTag:
var convert = mapToArray;
case setTag:
var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
convert || (convert = setToArray);
if (object.size != other.size && !isPartial) {
return false;
}
// Assume cyclic values are equal.
var stacked = stack.get(object);
if (stacked) {
return stacked == other;
}
bitmask |= COMPARE_UNORDERED_FLAG;
// Recursively compare objects (susceptible to call stack limits).
stack.set(object, other);
var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
stack['delete'](object);
return result;
case symbolTag:
if (symbolValueOf) {
return symbolValueOf.call(object) == symbolValueOf.call(other);
}
}
return false;
}
module.exports = equalByTag;
/***/ },
/* 661 */
/*!*****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_Uint8Array.js ***!
\*****************************************************/
/***/ function(module, exports, __webpack_require__) {
var root = __webpack_require__(/*! ./_root */ 544);
/** Built-in value references. */
var Uint8Array = root.Uint8Array;
module.exports = Uint8Array;
/***/ },
/* 662 */
/*!*****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_mapToArray.js ***!
\*****************************************************/
/***/ function(module, exports) {
/**
* Converts `map` to its key-value pairs.
*
* @private
* @param {Object} map The map to convert.
* @returns {Array} Returns the key-value pairs.
*/
function mapToArray(map) {
var index = -1,
result = Array(map.size);
map.forEach(function(value, key) {
result[++index] = [key, value];
});
return result;
}
module.exports = mapToArray;
/***/ },
/* 663 */
/*!*****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_setToArray.js ***!
\*****************************************************/
/***/ function(module, exports) {
/**
* Converts `set` to an array of its values.
*
* @private
* @param {Object} set The set to convert.
* @returns {Array} Returns the values.
*/
function setToArray(set) {
var index = -1,
result = Array(set.size);
set.forEach(function(value) {
result[++index] = value;
});
return result;
}
module.exports = setToArray;
/***/ },
/* 664 */
/*!*******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_equalObjects.js ***!
\*******************************************************/
/***/ function(module, exports, __webpack_require__) {
var getAllKeys = __webpack_require__(/*! ./_getAllKeys */ 665);
/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1;
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* A specialized version of `baseIsEqualDeep` for objects with support for
* partial deep comparisons.
*
* @private
* @param {Object} object The object to compare.
* @param {Object} other The other object to compare.
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
* @param {Function} customizer The function to customize comparisons.
* @param {Function} equalFunc The function to determine equivalents of values.
* @param {Object} stack Tracks traversed `object` and `other` objects.
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
*/
function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
objProps = getAllKeys(object),
objLength = objProps.length,
othProps = getAllKeys(other),
othLength = othProps.length;
if (objLength != othLength && !isPartial) {
return false;
}
var index = objLength;
while (index--) {
var key = objProps[index];
if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
return false;
}
}
// Assume cyclic values are equal.
var stacked = stack.get(object);
if (stacked && stack.get(other)) {
return stacked == other;
}
var result = true;
stack.set(object, other);
stack.set(other, object);
var skipCtor = isPartial;
while (++index < objLength) {
key = objProps[index];
var objValue = object[key],
othValue = other[key];
if (customizer) {
var compared = isPartial
? customizer(othValue, objValue, key, other, object, stack)
: customizer(objValue, othValue, key, object, other, stack);
}
// Recursively compare objects (susceptible to call stack limits).
if (!(compared === undefined
? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
: compared
)) {
result = false;
break;
}
skipCtor || (skipCtor = key == 'constructor');
}
if (result && !skipCtor) {
var objCtor = object.constructor,
othCtor = other.constructor;
// Non `Object` object instances with different constructors are not equal.
if (objCtor != othCtor &&
('constructor' in object && 'constructor' in other) &&
!(typeof objCtor == 'function' && objCtor instanceof objCtor &&
typeof othCtor == 'function' && othCtor instanceof othCtor)) {
result = false;
}
}
stack['delete'](object);
stack['delete'](other);
return result;
}
module.exports = equalObjects;
/***/ },
/* 665 */
/*!*****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_getAllKeys.js ***!
\*****************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseGetAllKeys = __webpack_require__(/*! ./_baseGetAllKeys */ 666),
getSymbols = __webpack_require__(/*! ./_getSymbols */ 667),
keys = __webpack_require__(/*! ./keys */ 634);
/**
* Creates an array of own enumerable property names and symbols of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names and symbols.
*/
function getAllKeys(object) {
return baseGetAllKeys(object, keys, getSymbols);
}
module.exports = getAllKeys;
/***/ },
/* 666 */
/*!*********************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_baseGetAllKeys.js ***!
\*********************************************************/
/***/ function(module, exports, __webpack_require__) {
var arrayPush = __webpack_require__(/*! ./_arrayPush */ 608),
isArray = __webpack_require__(/*! ./isArray */ 539);
/**
* The base implementation of `getAllKeys` and `getAllKeysIn` which uses
* `keysFunc` and `symbolsFunc` to get the enumerable property names and
* symbols of `object`.
*
* @private
* @param {Object} object The object to query.
* @param {Function} keysFunc The function to get the keys of `object`.
* @param {Function} symbolsFunc The function to get the symbols of `object`.
* @returns {Array} Returns the array of property names and symbols.
*/
function baseGetAllKeys(object, keysFunc, symbolsFunc) {
var result = keysFunc(object);
return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
}
module.exports = baseGetAllKeys;
/***/ },
/* 667 */
/*!*****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_getSymbols.js ***!
\*****************************************************/
/***/ function(module, exports, __webpack_require__) {
var arrayFilter = __webpack_require__(/*! ./_arrayFilter */ 628),
stubArray = __webpack_require__(/*! ./stubArray */ 668);
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Built-in value references. */
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeGetSymbols = Object.getOwnPropertySymbols;
/**
* Creates an array of the own enumerable symbols of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of symbols.
*/
var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
if (object == null) {
return [];
}
object = Object(object);
return arrayFilter(nativeGetSymbols(object), function(symbol) {
return propertyIsEnumerable.call(object, symbol);
});
};
module.exports = getSymbols;
/***/ },
/* 668 */
/*!***************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/stubArray.js ***!
\***************************************************/
/***/ function(module, exports) {
/**
* This method returns a new empty array.
*
* @static
* @memberOf _
* @since 4.13.0
* @category Util
* @returns {Array} Returns the new empty array.
* @example
*
* var arrays = _.times(2, _.stubArray);
*
* console.log(arrays);
* // => [[], []]
*
* console.log(arrays[0] === arrays[1]);
* // => false
*/
function stubArray() {
return [];
}
module.exports = stubArray;
/***/ },
/* 669 */
/*!*************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_getTag.js ***!
\*************************************************/
/***/ function(module, exports, __webpack_require__) {
var DataView = __webpack_require__(/*! ./_DataView */ 670),
Map = __webpack_require__(/*! ./_Map */ 577),
Promise = __webpack_require__(/*! ./_Promise */ 671),
Set = __webpack_require__(/*! ./_Set */ 672),
WeakMap = __webpack_require__(/*! ./_WeakMap */ 673),
baseGetTag = __webpack_require__(/*! ./_baseGetTag */ 542),
toSource = __webpack_require__(/*! ./_toSource */ 563);
/** `Object#toString` result references. */
var mapTag = '[object Map]',
objectTag = '[object Object]',
promiseTag = '[object Promise]',
setTag = '[object Set]',
weakMapTag = '[object WeakMap]';
var dataViewTag = '[object DataView]';
/** Used to detect maps, sets, and weakmaps. */
var dataViewCtorString = toSource(DataView),
mapCtorString = toSource(Map),
promiseCtorString = toSource(Promise),
setCtorString = toSource(Set),
weakMapCtorString = toSource(WeakMap);
/**
* Gets the `toStringTag` of `value`.
*
* @private
* @param {*} value The value to query.
* @returns {string} Returns the `toStringTag`.
*/
var getTag = baseGetTag;
// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
(Map && getTag(new Map) != mapTag) ||
(Promise && getTag(Promise.resolve()) != promiseTag) ||
(Set && getTag(new Set) != setTag) ||
(WeakMap && getTag(new WeakMap) != weakMapTag)) {
getTag = function(value) {
var result = baseGetTag(value),
Ctor = result == objectTag ? value.constructor : undefined,
ctorString = Ctor ? toSource(Ctor) : '';
if (ctorString) {
switch (ctorString) {
case dataViewCtorString: return dataViewTag;
case mapCtorString: return mapTag;
case promiseCtorString: return promiseTag;
case setCtorString: return setTag;
case weakMapCtorString: return weakMapTag;
}
}
return result;
};
}
module.exports = getTag;
/***/ },
/* 670 */
/*!***************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_DataView.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(/*! ./_getNative */ 557),
root = __webpack_require__(/*! ./_root */ 544);
/* Built-in method references that are verified to be native. */
var DataView = getNative(root, 'DataView');
module.exports = DataView;
/***/ },
/* 671 */
/*!**************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_Promise.js ***!
\**************************************************/
/***/ function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(/*! ./_getNative */ 557),
root = __webpack_require__(/*! ./_root */ 544);
/* Built-in method references that are verified to be native. */
var Promise = getNative(root, 'Promise');
module.exports = Promise;
/***/ },
/* 672 */
/*!**********************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_Set.js ***!
\**********************************************/
/***/ function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(/*! ./_getNative */ 557),
root = __webpack_require__(/*! ./_root */ 544);
/* Built-in method references that are verified to be native. */
var Set = getNative(root, 'Set');
module.exports = Set;
/***/ },
/* 673 */
/*!**************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_WeakMap.js ***!
\**************************************************/
/***/ function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(/*! ./_getNative */ 557),
root = __webpack_require__(/*! ./_root */ 544);
/* Built-in method references that are verified to be native. */
var WeakMap = getNative(root, 'WeakMap');
module.exports = WeakMap;
/***/ },
/* 674 */
/*!*******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_getMatchData.js ***!
\*******************************************************/
/***/ function(module, exports, __webpack_require__) {
var isStrictComparable = __webpack_require__(/*! ./_isStrictComparable */ 675),
keys = __webpack_require__(/*! ./keys */ 634);
/**
* Gets the property names, values, and compare flags of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the match data of `object`.
*/
function getMatchData(object) {
var result = keys(object),
length = result.length;
while (length--) {
var key = result[length],
value = object[key];
result[length] = [key, value, isStrictComparable(value)];
}
return result;
}
module.exports = getMatchData;
/***/ },
/* 675 */
/*!*************************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_isStrictComparable.js ***!
\*************************************************************/
/***/ function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(/*! ./isObject */ 560);
/**
* Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` if suitable for strict
* equality comparisons, else `false`.
*/
function isStrictComparable(value) {
return value === value && !isObject(value);
}
module.exports = isStrictComparable;
/***/ },
/* 676 */
/*!******************************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_matchesStrictComparable.js ***!
\******************************************************************/
/***/ function(module, exports) {
/**
* A specialized version of `matchesProperty` for source values suitable
* for strict equality comparisons, i.e. `===`.
*
* @private
* @param {string} key The key of the property to get.
* @param {*} srcValue The value to match.
* @returns {Function} Returns the new spec function.
*/
function matchesStrictComparable(key, srcValue) {
return function(object) {
if (object == null) {
return false;
}
return object[key] === srcValue &&
(srcValue !== undefined || (key in Object(object)));
};
}
module.exports = matchesStrictComparable;
/***/ },
/* 677 */
/*!**************************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_baseMatchesProperty.js ***!
\**************************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseIsEqual = __webpack_require__(/*! ./_baseIsEqual */ 656),
get = __webpack_require__(/*! ./get */ 678),
hasIn = __webpack_require__(/*! ./hasIn */ 680),
isKey = __webpack_require__(/*! ./_isKey */ 540),
isStrictComparable = __webpack_require__(/*! ./_isStrictComparable */ 675),
matchesStrictComparable = __webpack_require__(/*! ./_matchesStrictComparable */ 676),
toKey = __webpack_require__(/*! ./_toKey */ 591);
/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1,
COMPARE_UNORDERED_FLAG = 2;
/**
* The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
*
* @private
* @param {string} path The path of the property to get.
* @param {*} srcValue The value to match.
* @returns {Function} Returns the new spec function.
*/
function baseMatchesProperty(path, srcValue) {
if (isKey(path) && isStrictComparable(srcValue)) {
return matchesStrictComparable(toKey(path), srcValue);
}
return function(object) {
var objValue = get(object, path);
return (objValue === undefined && objValue === srcValue)
? hasIn(object, path)
: baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
};
}
module.exports = baseMatchesProperty;
/***/ },
/* 678 */
/*!*********************************************!*\
!*** ./~/semantic-ui-react/~/lodash/get.js ***!
\*********************************************/
/***/ function(module, exports, __webpack_require__) {
var baseGet = __webpack_require__(/*! ./_baseGet */ 679);
/**
* Gets the value at `path` of `object`. If the resolved value is
* `undefined`, the `defaultValue` is returned in its place.
*
* @static
* @memberOf _
* @since 3.7.0
* @category Object
* @param {Object} object The object to query.
* @param {Array|string} path The path of the property to get.
* @param {*} [defaultValue] The value returned for `undefined` resolved values.
* @returns {*} Returns the resolved value.
* @example
*
* var object = { 'a': [{ 'b': { 'c': 3 } }] };
*
* _.get(object, 'a[0].b.c');
* // => 3
*
* _.get(object, ['a', '0', 'b', 'c']);
* // => 3
*
* _.get(object, 'a.b.c', 'default');
* // => 'default'
*/
function get(object, path, defaultValue) {
var result = object == null ? undefined : baseGet(object, path);
return result === undefined ? defaultValue : result;
}
module.exports = get;
/***/ },
/* 679 */
/*!**************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_baseGet.js ***!
\**************************************************/
/***/ function(module, exports, __webpack_require__) {
var castPath = __webpack_require__(/*! ./_castPath */ 538),
toKey = __webpack_require__(/*! ./_toKey */ 591);
/**
* The base implementation of `_.get` without support for default values.
*
* @private
* @param {Object} object The object to query.
* @param {Array|string} path The path of the property to get.
* @returns {*} Returns the resolved value.
*/
function baseGet(object, path) {
path = castPath(path, object);
var index = 0,
length = path.length;
while (object != null && index < length) {
object = object[toKey(path[index++])];
}
return (index && index == length) ? object : undefined;
}
module.exports = baseGet;
/***/ },
/* 680 */
/*!***********************************************!*\
!*** ./~/semantic-ui-react/~/lodash/hasIn.js ***!
\***********************************************/
/***/ function(module, exports, __webpack_require__) {
var baseHasIn = __webpack_require__(/*! ./_baseHasIn */ 681),
hasPath = __webpack_require__(/*! ./_hasPath */ 537);
/**
* Checks if `path` is a direct or inherited property of `object`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Object
* @param {Object} object The object to query.
* @param {Array|string} path The path to check.
* @returns {boolean} Returns `true` if `path` exists, else `false`.
* @example
*
* var object = _.create({ 'a': _.create({ 'b': 2 }) });
*
* _.hasIn(object, 'a');
* // => true
*
* _.hasIn(object, 'a.b');
* // => true
*
* _.hasIn(object, ['a', 'b']);
* // => true
*
* _.hasIn(object, 'b');
* // => false
*/
function hasIn(object, path) {
return object != null && hasPath(object, path, baseHasIn);
}
module.exports = hasIn;
/***/ },
/* 681 */
/*!****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_baseHasIn.js ***!
\****************************************************/
/***/ function(module, exports) {
/**
* The base implementation of `_.hasIn` without support for deep paths.
*
* @private
* @param {Object} [object] The object to query.
* @param {Array|string} key The key to check.
* @returns {boolean} Returns `true` if `key` exists, else `false`.
*/
function baseHasIn(object, key) {
return object != null && key in Object(object);
}
module.exports = baseHasIn;
/***/ },
/* 682 */
/*!**************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/property.js ***!
\**************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseProperty = __webpack_require__(/*! ./_baseProperty */ 683),
basePropertyDeep = __webpack_require__(/*! ./_basePropertyDeep */ 684),
isKey = __webpack_require__(/*! ./_isKey */ 540),
toKey = __webpack_require__(/*! ./_toKey */ 591);
/**
* Creates a function that returns the value at `path` of a given object.
*
* @static
* @memberOf _
* @since 2.4.0
* @category Util
* @param {Array|string} path The path of the property to get.
* @returns {Function} Returns the new accessor function.
* @example
*
* var objects = [
* { 'a': { 'b': 2 } },
* { 'a': { 'b': 1 } }
* ];
*
* _.map(objects, _.property('a.b'));
* // => [2, 1]
*
* _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
* // => [1, 2]
*/
function property(path) {
return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
}
module.exports = property;
/***/ },
/* 683 */
/*!*******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_baseProperty.js ***!
\*******************************************************/
/***/ function(module, exports) {
/**
* The base implementation of `_.property` without support for deep paths.
*
* @private
* @param {string} key The key of the property to get.
* @returns {Function} Returns the new accessor function.
*/
function baseProperty(key) {
return function(object) {
return object == null ? undefined : object[key];
};
}
module.exports = baseProperty;
/***/ },
/* 684 */
/*!***********************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_basePropertyDeep.js ***!
\***********************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseGet = __webpack_require__(/*! ./_baseGet */ 679);
/**
* A specialized version of `baseProperty` which supports deep paths.
*
* @private
* @param {Array|string} path The path of the property to get.
* @returns {Function} Returns the new accessor function.
*/
function basePropertyDeep(path) {
return function(object) {
return baseGet(object, path);
};
}
module.exports = basePropertyDeep;
/***/ },
/* 685 */
/*!*************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/isEmpty.js ***!
\*************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseKeys = __webpack_require__(/*! ./_baseKeys */ 642),
getTag = __webpack_require__(/*! ./_getTag */ 669),
isArguments = __webpack_require__(/*! ./isArguments */ 587),
isArray = __webpack_require__(/*! ./isArray */ 539),
isArrayLike = __webpack_require__(/*! ./isArrayLike */ 620),
isBuffer = __webpack_require__(/*! ./isBuffer */ 637),
isPrototype = __webpack_require__(/*! ./_isPrototype */ 643),
isTypedArray = __webpack_require__(/*! ./isTypedArray */ 639);
/** `Object#toString` result references. */
var mapTag = '[object Map]',
setTag = '[object Set]';
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Checks if `value` is an empty object, collection, map, or set.
*
* Objects are considered empty if they have no own enumerable string keyed
* properties.
*
* Array-like values such as `arguments` objects, arrays, buffers, strings, or
* jQuery-like collections are considered empty if they have a `length` of `0`.
* Similarly, maps and sets are considered empty if they have a `size` of `0`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is empty, else `false`.
* @example
*
* _.isEmpty(null);
* // => true
*
* _.isEmpty(true);
* // => true
*
* _.isEmpty(1);
* // => true
*
* _.isEmpty([1, 2, 3]);
* // => false
*
* _.isEmpty({ 'a': 1 });
* // => false
*/
function isEmpty(value) {
if (value == null) {
return true;
}
if (isArrayLike(value) &&
(isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
isBuffer(value) || isTypedArray(value) || isArguments(value))) {
return !value.length;
}
var tag = getTag(value);
if (tag == mapTag || tag == setTag) {
return !value.size;
}
if (isPrototype(value)) {
return !baseKeys(value).length;
}
for (var key in value) {
if (hasOwnProperty.call(value, key)) {
return false;
}
}
return true;
}
module.exports = isEmpty;
/***/ },
/* 686 */
/*!******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/intersection.js ***!
\******************************************************/
/***/ function(module, exports, __webpack_require__) {
var arrayMap = __webpack_require__(/*! ./_arrayMap */ 586),
baseIntersection = __webpack_require__(/*! ./_baseIntersection */ 687),
baseRest = __webpack_require__(/*! ./_baseRest */ 610),
castArrayLikeObject = __webpack_require__(/*! ./_castArrayLikeObject */ 688);
/**
* Creates an array of unique values that are included in all given arrays
* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons. The order and references of result values are
* determined by the first array.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @returns {Array} Returns the new array of intersecting values.
* @example
*
* _.intersection([2, 1], [2, 3]);
* // => [2]
*/
var intersection = baseRest(function(arrays) {
var mapped = arrayMap(arrays, castArrayLikeObject);
return (mapped.length && mapped[0] === arrays[0])
? baseIntersection(mapped)
: [];
});
module.exports = intersection;
/***/ },
/* 687 */
/*!***********************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_baseIntersection.js ***!
\***********************************************************/
/***/ function(module, exports, __webpack_require__) {
var SetCache = __webpack_require__(/*! ./_SetCache */ 596),
arrayIncludes = __webpack_require__(/*! ./_arrayIncludes */ 599),
arrayIncludesWith = __webpack_require__(/*! ./_arrayIncludesWith */ 604),
arrayMap = __webpack_require__(/*! ./_arrayMap */ 586),
baseUnary = __webpack_require__(/*! ./_baseUnary */ 605),
cacheHas = __webpack_require__(/*! ./_cacheHas */ 606);
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMin = Math.min;
/**
* The base implementation of methods like `_.intersection`, without support
* for iteratee shorthands, that accepts an array of arrays to inspect.
*
* @private
* @param {Array} arrays The arrays to inspect.
* @param {Function} [iteratee] The iteratee invoked per element.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new array of shared values.
*/
function baseIntersection(arrays, iteratee, comparator) {
var includes = comparator ? arrayIncludesWith : arrayIncludes,
length = arrays[0].length,
othLength = arrays.length,
othIndex = othLength,
caches = Array(othLength),
maxLength = Infinity,
result = [];
while (othIndex--) {
var array = arrays[othIndex];
if (othIndex && iteratee) {
array = arrayMap(array, baseUnary(iteratee));
}
maxLength = nativeMin(array.length, maxLength);
caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
? new SetCache(othIndex && array)
: undefined;
}
array = arrays[0];
var index = -1,
seen = caches[0];
outer:
while (++index < length && result.length < maxLength) {
var value = array[index],
computed = iteratee ? iteratee(value) : value;
value = (comparator || value !== 0) ? value : 0;
if (!(seen
? cacheHas(seen, computed)
: includes(result, computed, comparator)
)) {
othIndex = othLength;
while (--othIndex) {
var cache = caches[othIndex];
if (!(cache
? cacheHas(cache, computed)
: includes(arrays[othIndex], computed, comparator))
) {
continue outer;
}
}
if (seen) {
seen.push(computed);
}
result.push(value);
}
}
return result;
}
module.exports = baseIntersection;
/***/ },
/* 688 */
/*!**************************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_castArrayLikeObject.js ***!
\**************************************************************/
/***/ function(module, exports, __webpack_require__) {
var isArrayLikeObject = __webpack_require__(/*! ./isArrayLikeObject */ 619);
/**
* Casts `value` to an empty array if it's not an array like object.
*
* @private
* @param {*} value The value to inspect.
* @returns {Array|Object} Returns the cast array-like object.
*/
function castArrayLikeObject(value) {
return isArrayLikeObject(value) ? value : [];
}
module.exports = castArrayLikeObject;
/***/ },
/* 689 */
/*!**********************************************!*\
!*** ./~/semantic-ui-react/~/lodash/each.js ***!
\**********************************************/
/***/ function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(/*! ./forEach */ 690);
/***/ },
/* 690 */
/*!*************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/forEach.js ***!
\*************************************************/
/***/ function(module, exports, __webpack_require__) {
var arrayEach = __webpack_require__(/*! ./_arrayEach */ 691),
baseEach = __webpack_require__(/*! ./_baseEach */ 630),
castFunction = __webpack_require__(/*! ./_castFunction */ 692),
isArray = __webpack_require__(/*! ./isArray */ 539);
/**
* Iterates over elements of `collection` and invokes `iteratee` for each element.
* The iteratee is invoked with three arguments: (value, index|key, collection).
* Iteratee functions may exit iteration early by explicitly returning `false`.
*
* **Note:** As with other "Collections" methods, objects with a "length"
* property are iterated like arrays. To avoid this behavior use `_.forIn`
* or `_.forOwn` for object iteration.
*
* @static
* @memberOf _
* @since 0.1.0
* @alias each
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Array|Object} Returns `collection`.
* @see _.forEachRight
* @example
*
* _.forEach([1, 2], function(value) {
* console.log(value);
* });
* // => Logs `1` then `2`.
*
* _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
* console.log(key);
* });
* // => Logs 'a' then 'b' (iteration order is not guaranteed).
*/
function forEach(collection, iteratee) {
var func = isArray(collection) ? arrayEach : baseEach;
return func(collection, castFunction(iteratee));
}
module.exports = forEach;
/***/ },
/* 691 */
/*!****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_arrayEach.js ***!
\****************************************************/
/***/ function(module, exports) {
/**
* A specialized version of `_.forEach` for arrays without support for
* iteratee shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns `array`.
*/
function arrayEach(array, iteratee) {
var index = -1,
length = array == null ? 0 : array.length;
while (++index < length) {
if (iteratee(array[index], index, array) === false) {
break;
}
}
return array;
}
module.exports = arrayEach;
/***/ },
/* 692 */
/*!*******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_castFunction.js ***!
\*******************************************************/
/***/ function(module, exports, __webpack_require__) {
var identity = __webpack_require__(/*! ./identity */ 611);
/**
* Casts `value` to `identity` if it's not a function.
*
* @private
* @param {*} value The value to inspect.
* @returns {Function} Returns cast function.
*/
function castFunction(value) {
return typeof value == 'function' ? value : identity;
}
module.exports = castFunction;
/***/ },
/* 693 */
/*!********************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/lib/classNameBuilders.js ***!
\********************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.useVerticalAlignProp = exports.useTextAlignProp = exports.useWidthProp = exports.useKeyOrValueAndKey = exports.useValueAndKey = exports.useKeyOnly = undefined;
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; }; /*
* There are 4 prop patterns used to build up the className for a component.
* Each utility here is meant for use in a classnames() argument.
*
* There is no util for valueOnly() because it would simply return val.
* Use the prop value inline instead.
* <Label size='big' />
* <div class="ui big label"></div>
*/
var _numberToWord = __webpack_require__(/*! ./numberToWord */ 694);
/**
* Props where only the prop key is used in the className.
* @param {*} val A props value
* @param {string} key A props key
*
* @example
* <Label tag />
* <div class="ui tag label"></div>
*/
var useKeyOnly = exports.useKeyOnly = function useKeyOnly(val, key) {
return val && key;
};
/**
* Props that require both a key and value to create a className.
* @param {*} val A props value
* @param {string} key A props key
*
* @example
* <Label corner='left' />
* <div class="ui left corner label"></div>
*/
var useValueAndKey = exports.useValueAndKey = function useValueAndKey(val, key) {
return val && val !== true && val + ' ' + key;
};
/**
* Props whose key will be used in className, or value and key.
* @param {*} val A props value
* @param {string} key A props key
*
* @example Key Only
* <Label pointing />
* <div class="ui pointing label"></div>
*
* @example Key and Value
* <Label pointing='left' />
* <div class="ui left pointing label"></div>
*/
var useKeyOrValueAndKey = exports.useKeyOrValueAndKey = function useKeyOrValueAndKey(val, key) {
return val && (val === true ? key : val + ' ' + key);
};
//
// Prop to className exceptions
//
/**
* Create "X", "X wide" and "equal width" classNames.
* "X" is a numberToWord value and "wide" is configurable.
* @param {*} val The prop value
* @param {string} [widthClass=''] The class
* @param {boolean} [canEqual=false] Flag that indicates possibility of "equal" value
*
* @example
* <Grid columns='equal' />
* <div class="ui equal width grid"></div>
*
* <Form widths='equal' />
* <div class="ui equal width form"></div>
*
* <FieldGroup widths='equal' />
* <div class="equal width fields"></div>
*
* @example
* <Grid columns={4} />
* <div class="ui four column grid"></div>
*/
var useWidthProp = exports.useWidthProp = function useWidthProp(val) {
var widthClass = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
var canEqual = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
if (canEqual && val === 'equal') {
return 'equal width';
}
var valType = typeof val === 'undefined' ? 'undefined' : _typeof(val);
if ((valType === 'string' || valType === 'number') && widthClass) {
return (0, _numberToWord.numberToWord)(val) + ' ' + widthClass;
}
return (0, _numberToWord.numberToWord)(val);
};
/**
* The "textAlign" prop follows the useValueAndKey except when the value is "justified'.
* In this case, only the class "justified" is used, ignoring the "aligned" class.
* @param {*} val The value of the "textAlign" prop
*
* @example
* <Container textAlign='justified' />
* <div class="ui justified container"></div>
*
* @example
* <Container textAlign='left' />
* <div class="ui left aligned container"></div>
*/
var useTextAlignProp = exports.useTextAlignProp = function useTextAlignProp(val) {
return val === 'justified' ? 'justified' : useValueAndKey(val, 'aligned');
};
/**
* The "verticalAlign" prop follows the useValueAndKey.
*
* @param {*} val The value of the "verticalAlign" prop
*
* @example
* <Grid verticalAlign='middle' />
* <div class="ui middle aligned grid"></div>
*/
var useVerticalAlignProp = exports.useVerticalAlignProp = function useVerticalAlignProp(val) {
return useValueAndKey(val, 'aligned');
};
/***/ },
/* 694 */
/*!***************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/lib/numberToWord.js ***!
\***************************************************************/
/***/ function(module, exports) {
'use strict';
Object.defineProperty(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; };
exports.numberToWord = numberToWord;
var numberToWordMap = exports.numberToWordMap = {
1: 'one',
2: 'two',
3: 'three',
4: 'four',
5: 'five',
6: 'six',
7: 'seven',
8: 'eight',
9: 'nine',
10: 'ten',
11: 'eleven',
12: 'twelve',
13: 'thirteen',
14: 'fourteen',
15: 'fifteen',
16: 'sixteen'
};
/**
* Return the number word for numbers 1-16.
* Returns strings or numbers as is if there is no corresponding word.
* Returns an empty string if value is not a string or number.
* @param {string|number} value The value to convert to a word.
* @returns {string}
*/
function numberToWord(value) {
var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);
if (type === 'string' || type === 'number') {
return numberToWordMap[value] || value;
}
return '';
}
/***/ },
/* 695 */
/*!********************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/lib/debug.js ***!
\********************************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.debug = exports.makeDebugger = undefined;
var _isBrowser = __webpack_require__(/*! ./isBrowser */ 696);
var _isBrowser2 = _interopRequireDefault(_isBrowser);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var _debug = void 0;
var noop = function noop() {
return undefined;
};
if (_isBrowser2.default && process.env.NODE_ENV !== 'production' && process.env.NODE_ENV !== 'test') {
// Heads Up!
// https://github.com/visionmedia/debug/pull/331
//
// debug now clears storage on load, grab the debug settings before require('debug').
// We try/catch here as Safari throws on localStorage access in private mode or with cookies disabled.
var DEBUG = void 0;
try {
DEBUG = window.localStorage.debug;
} catch (e) {
/* eslint-disable no-console */
console.error('Semantic-UI-React could not enable debug.');
console.error(e);
/* eslint-enable no-console */
}
_debug = __webpack_require__(/*! debug */ 697);
// enable what ever settings we got from storage
_debug.enable(DEBUG);
} else {
_debug = function _debug() {
return noop;
};
}
/**
* Create a namespaced debug function.
* @param {String} namespace Usually a component name.
* @example
* import { makeDebugger } from 'src/lib'
* const debug = makeDebugger('namespace')
*
* debug('Some message')
* @returns {Function}
*/
var makeDebugger = exports.makeDebugger = function makeDebugger(namespace) {
return _debug('semanticUIReact:' + namespace);
};
/**
* Default debugger, simple log.
* @example
* import { debug } from 'src/lib'
* debug('Some message')
*/
var debug = exports.debug = makeDebugger('log');
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../../../process/browser.js */ 4)))
/***/ },
/* 696 */
/*!************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/lib/isBrowser.js ***!
\************************************************************/
/***/ function(module, exports) {
'use strict';
Object.defineProperty(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; };
var hasDocument = (typeof document === 'undefined' ? 'undefined' : _typeof(document)) === 'object' && document !== null;
var hasWindow = (typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object' && window !== null && window.self === window;
exports.default = hasDocument && hasWindow;
/***/ },
/* 697 */
/*!****************************************************!*\
!*** ./~/semantic-ui-react/~/debug/src/browser.js ***!
\****************************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* This is the web browser implementation of `debug()`.
*
* Expose `debug()` as the module.
*/
exports = module.exports = __webpack_require__(/*! ./debug */ 698);
exports.log = log;
exports.formatArgs = formatArgs;
exports.save = save;
exports.load = load;
exports.useColors = useColors;
exports.storage = 'undefined' != typeof chrome
&& 'undefined' != typeof chrome.storage
? chrome.storage.local
: localstorage();
/**
* Colors.
*/
exports.colors = [
'lightseagreen',
'forestgreen',
'goldenrod',
'dodgerblue',
'darkorchid',
'crimson'
];
/**
* Currently only WebKit-based Web Inspectors, Firefox >= v31,
* and the Firebug extension (any Firefox version) are known
* to support "%c" CSS customizations.
*
* TODO: add a `localStorage` variable to explicitly enable/disable colors
*/
function useColors() {
// NB: In an Electron preload script, document will be defined but not fully
// initialized. Since we know we're in Chrome, we'll just detect this case
// explicitly
if (typeof window !== 'undefined' && window && typeof window.process !== 'undefined' && window.process.type === 'renderer') {
return true;
}
// is webkit? http://stackoverflow.com/a/16459606/376773
// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
return (typeof document !== 'undefined' && document && 'WebkitAppearance' in document.documentElement.style) ||
// is firebug? http://stackoverflow.com/a/398120/376773
(typeof window !== 'undefined' && window && window.console && (console.firebug || (console.exception && console.table))) ||
// is firefox >= v31?
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
(typeof navigator !== 'undefined' && navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
// double check webkit in userAgent just in case we are in a worker
(typeof navigator !== 'undefined' && navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
}
/**
* Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
*/
exports.formatters.j = function(v) {
try {
return JSON.stringify(v);
} catch (err) {
return '[UnexpectedJSONParseError]: ' + err.message;
}
};
/**
* Colorize log arguments if enabled.
*
* @api public
*/
function formatArgs(args) {
var useColors = this.useColors;
args[0] = (useColors ? '%c' : '')
+ this.namespace
+ (useColors ? ' %c' : ' ')
+ args[0]
+ (useColors ? '%c ' : ' ')
+ '+' + exports.humanize(this.diff);
if (!useColors) return;
var c = 'color: ' + this.color;
args.splice(1, 0, c, 'color: inherit')
// the final "%c" is somewhat tricky, because there could be other
// arguments passed either before or after the %c, so we need to
// figure out the correct index to insert the CSS into
var index = 0;
var lastC = 0;
args[0].replace(/%[a-zA-Z%]/g, function(match) {
if ('%%' === match) return;
index++;
if ('%c' === match) {
// we only are interested in the *last* %c
// (the user may have provided their own)
lastC = index;
}
});
args.splice(lastC, 0, c);
}
/**
* Invokes `console.log()` when available.
* No-op when `console.log` is not a "function".
*
* @api public
*/
function log() {
// this hackery is required for IE8/9, where
// the `console.log` function doesn't have 'apply'
return 'object' === typeof console
&& console.log
&& Function.prototype.apply.call(console.log, console, arguments);
}
/**
* Save `namespaces`.
*
* @param {String} namespaces
* @api private
*/
function save(namespaces) {
try {
if (null == namespaces) {
exports.storage.removeItem('debug');
} else {
exports.storage.debug = namespaces;
}
} catch(e) {}
}
/**
* Load `namespaces`.
*
* @return {String} returns the previously persisted debug modes
* @api private
*/
function load() {
try {
return exports.storage.debug;
} catch(e) {}
// If debug isn't set in LS, and we're in Electron, try to load $DEBUG
if (typeof process !== 'undefined' && 'env' in process) {
return process.env.DEBUG;
}
}
/**
* Enable namespaces listed in `localStorage.debug` initially.
*/
exports.enable(load());
/**
* Localstorage attempts to return the localstorage.
*
* This is necessary because safari throws
* when a user disables cookies/localstorage
* and you attempt to access it.
*
* @return {LocalStorage}
* @api private
*/
function localstorage() {
try {
return window.localStorage;
} catch (e) {}
}
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../../../process/browser.js */ 4)))
/***/ },
/* 698 */
/*!**************************************************!*\
!*** ./~/semantic-ui-react/~/debug/src/debug.js ***!
\**************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* This is the common logic for both the Node.js and web browser
* implementations of `debug()`.
*
* Expose `debug()` as the module.
*/
exports = module.exports = createDebug.debug = createDebug.default = createDebug;
exports.coerce = coerce;
exports.disable = disable;
exports.enable = enable;
exports.enabled = enabled;
exports.humanize = __webpack_require__(/*! ms */ 699);
/**
* The currently active debug mode names, and names to skip.
*/
exports.names = [];
exports.skips = [];
/**
* Map of special "%n" handling functions, for the debug "format" argument.
*
* Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
*/
exports.formatters = {};
/**
* Previous log timestamp.
*/
var prevTime;
/**
* Select a color.
* @param {String} namespace
* @return {Number}
* @api private
*/
function selectColor(namespace) {
var hash = 0, i;
for (i in namespace) {
hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
hash |= 0; // Convert to 32bit integer
}
return exports.colors[Math.abs(hash) % exports.colors.length];
}
/**
* Create a debugger with the given `namespace`.
*
* @param {String} namespace
* @return {Function}
* @api public
*/
function createDebug(namespace) {
function debug() {
// disabled?
if (!debug.enabled) return;
var self = debug;
// set `diff` timestamp
var curr = +new Date();
var ms = curr - (prevTime || curr);
self.diff = ms;
self.prev = prevTime;
self.curr = curr;
prevTime = curr;
// turn the `arguments` into a proper Array
var args = new Array(arguments.length);
for (var i = 0; i < args.length; i++) {
args[i] = arguments[i];
}
args[0] = exports.coerce(args[0]);
if ('string' !== typeof args[0]) {
// anything else let's inspect with %O
args.unshift('%O');
}
// apply any `formatters` transformations
var index = 0;
args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {
// if we encounter an escaped % then don't increase the array index
if (match === '%%') return match;
index++;
var formatter = exports.formatters[format];
if ('function' === typeof formatter) {
var val = args[index];
match = formatter.call(self, val);
// now we need to remove `args[index]` since it's inlined in the `format`
args.splice(index, 1);
index--;
}
return match;
});
// apply env-specific formatting (colors, etc.)
exports.formatArgs.call(self, args);
var logFn = debug.log || exports.log || console.log.bind(console);
logFn.apply(self, args);
}
debug.namespace = namespace;
debug.enabled = exports.enabled(namespace);
debug.useColors = exports.useColors();
debug.color = selectColor(namespace);
// env-specific initialization logic for debug instances
if ('function' === typeof exports.init) {
exports.init(debug);
}
return debug;
}
/**
* Enables a debug mode by namespaces. This can include modes
* separated by a colon and wildcards.
*
* @param {String} namespaces
* @api public
*/
function enable(namespaces) {
exports.save(namespaces);
var split = (namespaces || '').split(/[\s,]+/);
var len = split.length;
for (var i = 0; i < len; i++) {
if (!split[i]) continue; // ignore empty strings
namespaces = split[i].replace(/\*/g, '.*?');
if (namespaces[0] === '-') {
exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
} else {
exports.names.push(new RegExp('^' + namespaces + '$'));
}
}
}
/**
* Disable debug output.
*
* @api public
*/
function disable() {
exports.enable('');
}
/**
* Returns true if the given mode name is enabled, false otherwise.
*
* @param {String} name
* @return {Boolean}
* @api public
*/
function enabled(name) {
var i, len;
for (i = 0, len = exports.skips.length; i < len; i++) {
if (exports.skips[i].test(name)) {
return false;
}
}
for (i = 0, len = exports.names.length; i < len; i++) {
if (exports.names[i].test(name)) {
return true;
}
}
return false;
}
/**
* Coerce `val`.
*
* @param {Mixed} val
* @return {Mixed}
* @api private
*/
function coerce(val) {
if (val instanceof Error) return val.stack || val.message;
return val;
}
/***/ },
/* 699 */
/*!*******************************************!*\
!*** ./~/semantic-ui-react/~/ms/index.js ***!
\*******************************************/
/***/ function(module, exports) {
/**
* Helpers.
*/
var s = 1000
var m = s * 60
var h = m * 60
var d = h * 24
var y = d * 365.25
/**
* Parse or format the given `val`.
*
* Options:
*
* - `long` verbose formatting [false]
*
* @param {String|Number} val
* @param {Object} options
* @throws {Error} throw an error if val is not a non-empty string or a number
* @return {String|Number}
* @api public
*/
module.exports = function (val, options) {
options = options || {}
var type = typeof val
if (type === 'string' && val.length > 0) {
return parse(val)
} else if (type === 'number' && isNaN(val) === false) {
return options.long ?
fmtLong(val) :
fmtShort(val)
}
throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val))
}
/**
* Parse the given `str` and return milliseconds.
*
* @param {String} str
* @return {Number}
* @api private
*/
function parse(str) {
str = String(str)
if (str.length > 10000) {
return
}
var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str)
if (!match) {
return
}
var n = parseFloat(match[1])
var type = (match[2] || 'ms').toLowerCase()
switch (type) {
case 'years':
case 'year':
case 'yrs':
case 'yr':
case 'y':
return n * y
case 'days':
case 'day':
case 'd':
return n * d
case 'hours':
case 'hour':
case 'hrs':
case 'hr':
case 'h':
return n * h
case 'minutes':
case 'minute':
case 'mins':
case 'min':
case 'm':
return n * m
case 'seconds':
case 'second':
case 'secs':
case 'sec':
case 's':
return n * s
case 'milliseconds':
case 'millisecond':
case 'msecs':
case 'msec':
case 'ms':
return n
default:
return undefined
}
}
/**
* Short format for `ms`.
*
* @param {Number} ms
* @return {String}
* @api private
*/
function fmtShort(ms) {
if (ms >= d) {
return Math.round(ms / d) + 'd'
}
if (ms >= h) {
return Math.round(ms / h) + 'h'
}
if (ms >= m) {
return Math.round(ms / m) + 'm'
}
if (ms >= s) {
return Math.round(ms / s) + 's'
}
return ms + 'ms'
}
/**
* Long format for `ms`.
*
* @param {Number} ms
* @return {String}
* @api private
*/
function fmtLong(ms) {
return plural(ms, d, 'day') ||
plural(ms, h, 'hour') ||
plural(ms, m, 'minute') ||
plural(ms, s, 'second') ||
ms + ' ms'
}
/**
* Pluralization helper.
*/
function plural(ms, n, name) {
if (ms < n) {
return
}
if (ms < n * 1.5) {
return Math.floor(ms / n) + ' ' + name
}
return Math.ceil(ms / n) + ' ' + name + 's'
}
/***/ },
/* 700 */
/*!************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/lib/factories.js ***!
\************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.createHTMLLabel = exports.createHTMLInput = exports.createHTMLImage = exports.getChildKey = undefined;
var _has2 = __webpack_require__(/*! lodash/has */ 535);
var _has3 = _interopRequireDefault(_has2);
var _isFunction2 = __webpack_require__(/*! lodash/isFunction */ 559);
var _isFunction3 = _interopRequireDefault(_isFunction2);
var _isArray2 = __webpack_require__(/*! lodash/isArray */ 539);
var _isArray3 = _interopRequireDefault(_isArray2);
var _isNumber2 = __webpack_require__(/*! lodash/isNumber */ 701);
var _isNumber3 = _interopRequireDefault(_isNumber2);
var _isString2 = __webpack_require__(/*! lodash/isString */ 702);
var _isString3 = _interopRequireDefault(_isString2);
var _isPlainObject2 = __webpack_require__(/*! lodash/isPlainObject */ 703);
var _isPlainObject3 = _interopRequireDefault(_isPlainObject2);
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; };
exports.createShorthand = createShorthand;
exports.createShorthandFactory = createShorthandFactory;
var _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// ============================================================
// Factory Utilities
// ============================================================
/**
* A pure function that generates a unique child key hash code from an element's props.
*
* @param {object} props A ReactElement's props object.
* @returns {number}
*/
var getChildKey = exports.getChildKey = function getChildKey(props) {
var key = props.key,
childKey = props.childKey;
// already defines a key
if (key) return key;
// defines a childKey function or value
if (childKey) return typeof childKey === 'function' ? childKey(props) : childKey;
// 1. Stringify props to a short as possible run on string of key/values.
// 2. Don't stringify entire functions, use the function name || 'f'.
// 3. Generate a short hash number from the string.
// props : { color: 'red', onClick: handleClick }
// string : 'color:"red",onClick:handleClick'
// hash : 110042245
return Object.keys(props).map(function (name) {
var val = props[name];
var type = typeof val === 'undefined' ? 'undefined' : _typeof(val);
var valueString = type === 'string' && val || type === 'number' && val || type === 'boolean' && (val ? 'true' : 'false') || type === 'function' && (val.name || 'function') || Array.isArray(val) && ['[', val.join(','), ']'].join('') || val === null && 'null' || type === 'object' && ['{', Object.keys(val).map(function (k) {
return [k, ':', val[k]].join('');
}), '}'].join('') || val === undefined && 'undefined';
return [name, ':', valueString].join('');
}).join(',');
};
// ============================================================
// Factories
// ============================================================
/**
* A more robust React.createElement. It can create elements from primitive values.
*
* @param {function|string} Component A ReactClass or string
* @param {function} mapValueToProps A function that maps a primitive value to the Component props
* @param {string|object|function} val The value to create a ReactElement from
* @param {object|function} [defaultProps={}] Default props object or function (called with regular props).
* @param {boolean} generateKey Whether or not to generate a child key, useful for collections.
* @returns {object|null}
*/
function createShorthand(Component, mapValueToProps, val) {
var defaultProps = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
var generateKey = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
if (typeof Component !== 'function' && typeof Component !== 'string') {
throw new Error('createShorthandFactory() Component must be a string or function.');
}
// short circuit for disabling shorthand
if (val === null) return null;
var isReactElement = (0, _react.isValidElement)(val);
var isPropsObject = (0, _isPlainObject3.default)(val);
var isPrimitiveValue = (0, _isString3.default)(val) || (0, _isNumber3.default)(val) || (0, _isArray3.default)(val);
// ----------------------------------------
// Build up props
// ----------------------------------------
// User's props
var usersProps = isReactElement && val.props || isPropsObject && val || isPrimitiveValue && mapValueToProps(val);
// Default props
defaultProps = (0, _isFunction3.default)(defaultProps) ? defaultProps(usersProps) : defaultProps;
// Merge props and className
var props = _extends({}, defaultProps, usersProps);
if ((0, _has3.default)(usersProps, 'className') || (0, _has3.default)(defaultProps.className)) {
props.className = (0, _classnames2.default)(defaultProps.className, usersProps.className); // eslint-disable-line react/prop-types
}
// Generate child key
if (generateKey) props.key = getChildKey(props); // eslint-disable-line react/prop-types
// ----------------------------------------
// Create Element
// ----------------------------------------
// Clone ReactElements
if (isReactElement) return (0, _react.cloneElement)(val, props);
// Create ReactElements from built up props
if (isPrimitiveValue || isPropsObject) return _react2.default.createElement(Component, props);
// Otherwise null
return null;
}
// ============================================================
// Factories Creators
// ============================================================
function createShorthandFactory(Component, mapValueToProps, generateKey) {
if (typeof Component !== 'function' && typeof Component !== 'string') {
throw new Error('createShorthandFactory() Component must be a string or function.');
}
return function (val, defaultProps) {
return createShorthand(Component, mapValueToProps, val, defaultProps, generateKey);
};
}
// ============================================================
// HTML Factories
// ============================================================
var createHTMLImage = exports.createHTMLImage = createShorthandFactory('img', function (value) {
return { src: value };
});
var createHTMLInput = exports.createHTMLInput = createShorthandFactory('input', function (value) {
return { type: value };
});
var createHTMLLabel = exports.createHTMLLabel = createShorthandFactory('label', function (value) {
return { children: value };
});
/***/ },
/* 701 */
/*!**************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/isNumber.js ***!
\**************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ 542),
isObjectLike = __webpack_require__(/*! ./isObjectLike */ 548);
/** `Object#toString` result references. */
var numberTag = '[object Number]';
/**
* Checks if `value` is classified as a `Number` primitive or object.
*
* **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
* classified as numbers, use the `_.isFinite` method.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a number, else `false`.
* @example
*
* _.isNumber(3);
* // => true
*
* _.isNumber(Number.MIN_VALUE);
* // => true
*
* _.isNumber(Infinity);
* // => true
*
* _.isNumber('3');
* // => false
*/
function isNumber(value) {
return typeof value == 'number' ||
(isObjectLike(value) && baseGetTag(value) == numberTag);
}
module.exports = isNumber;
/***/ },
/* 702 */
/*!**************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/isString.js ***!
\**************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ 542),
isArray = __webpack_require__(/*! ./isArray */ 539),
isObjectLike = __webpack_require__(/*! ./isObjectLike */ 548);
/** `Object#toString` result references. */
var stringTag = '[object String]';
/**
* Checks if `value` is classified as a `String` primitive or object.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a string, else `false`.
* @example
*
* _.isString('abc');
* // => true
*
* _.isString(1);
* // => false
*/
function isString(value) {
return typeof value == 'string' ||
(!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
}
module.exports = isString;
/***/ },
/* 703 */
/*!*******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/isPlainObject.js ***!
\*******************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ 542),
getPrototype = __webpack_require__(/*! ./_getPrototype */ 704),
isObjectLike = __webpack_require__(/*! ./isObjectLike */ 548);
/** `Object#toString` result references. */
var objectTag = '[object Object]';
/** Used for built-in method references. */
var funcProto = Function.prototype,
objectProto = Object.prototype;
/** Used to resolve the decompiled source of functions. */
var funcToString = funcProto.toString;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/** Used to infer the `Object` constructor. */
var objectCtorString = funcToString.call(Object);
/**
* Checks if `value` is a plain object, that is, an object created by the
* `Object` constructor or one with a `[[Prototype]]` of `null`.
*
* @static
* @memberOf _
* @since 0.8.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
* @example
*
* function Foo() {
* this.a = 1;
* }
*
* _.isPlainObject(new Foo);
* // => false
*
* _.isPlainObject([1, 2, 3]);
* // => false
*
* _.isPlainObject({ 'x': 0, 'y': 0 });
* // => true
*
* _.isPlainObject(Object.create(null));
* // => true
*/
function isPlainObject(value) {
if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
return false;
}
var proto = getPrototype(value);
if (proto === null) {
return true;
}
var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
return typeof Ctor == 'function' && Ctor instanceof Ctor &&
funcToString.call(Ctor) == objectCtorString;
}
module.exports = isPlainObject;
/***/ },
/* 704 */
/*!*******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_getPrototype.js ***!
\*******************************************************/
/***/ function(module, exports, __webpack_require__) {
var overArg = __webpack_require__(/*! ./_overArg */ 645);
/** Built-in value references. */
var getPrototype = overArg(Object.getPrototypeOf, Object);
module.exports = getPrototype;
/***/ },
/* 705 */
/*!*******************************!*\
!*** ./~/classnames/index.js ***!
\*******************************/
/***/ 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;
}
}());
/***/ },
/* 706 */
/*!********************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/lib/getUnhandledProps.js ***!
\********************************************************************/
/***/ function(module, exports) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
/**
* Push all `source` array elements to the `target` array if they don't already exist in `target`.
*
* @param {Array} source - An array of elements to add to the `target`
* @param {Array} target - An array to receive unique elements from the `source`
* @returns {Array} Mutated `target` array
*/
var pushUnique = function pushUnique(source, target) {
return source.forEach(function (x) {
if (target.indexOf(x) === -1) target.push(x);
});
};
/**
* Returns an object consisting of props beyond the scope of the Component.
* Useful for getting and spreading unknown props from the user.
* @param {function} Component A function or ReactClass.
* @param {object} props A ReactElement props object
* @returns {{}} A shallow copy of the prop object
*/
var getUnhandledProps = function getUnhandledProps(Component, props) {
var autoControlledProps = Component.autoControlledProps,
defaultProps = Component.defaultProps,
propTypes = Component.propTypes;
var handledProps = Component.handledProps;
// ----------------------------------------
// Calculate handledProps once and cache
// ----------------------------------------
if (!handledProps) {
handledProps = [];
if (autoControlledProps) pushUnique(autoControlledProps, handledProps);
if (defaultProps) pushUnique(Object.keys(defaultProps), handledProps);
if (propTypes) pushUnique(Object.keys(propTypes), handledProps);
Component.handledProps = handledProps;
}
// ----------------------------------------
// Return _unhandled_ props
// ----------------------------------------
return Object.keys(props).reduce(function (acc, prop) {
if (prop === 'childKey') return acc;
if (handledProps.indexOf(prop) === -1) acc[prop] = props[prop];
return acc;
}, {});
};
exports.default = getUnhandledProps;
/***/ },
/* 707 */
/*!*****************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/lib/getElementType.js ***!
\*****************************************************************/
/***/ function(module, exports) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
/**
* Returns a createElement() type based on the props of the Component.
* Useful for calculating what type a component should render as.
*
* @param {function} Component A function or ReactClass.
* @param {object} props A ReactElement props object
* @param {function} [getDefault] A function that returns a default element type.
* @returns {string|function} A ReactElement type
*/
function getElementType(Component, props, getDefault) {
var _Component$defaultPro = Component.defaultProps,
defaultProps = _Component$defaultPro === undefined ? {} : _Component$defaultPro;
// ----------------------------------------
// user defined "as" element type
if (props.as && props.as !== defaultProps.as) return props.as;
// ----------------------------------------
// computed default element type
if (getDefault) {
var computedDefault = getDefault();
if (computedDefault) return computedDefault;
}
// ----------------------------------------
// infer anchor links
if (props.href) return 'a';
// ----------------------------------------
// use defaultProp or 'div'
return defaultProps.as || 'div';
}
exports.default = getElementType;
/***/ },
/* 708 */
/*!********************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/lib/leven.js ***!
\********************************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
// Copy of sindre's leven, wrapped in dead code elimination for production
// https://github.com/sindresorhus/leven/blob/master/index.js
var leven = function leven() {
return 0;
};
if (process.env.NODE_ENV !== 'production') {
(function () {
/* eslint-disable complexity, no-nested-ternary */
var arr = [];
var charCodeCache = [];
leven = function leven(a, b) {
if (a === b) return 0;
var aLen = a.length;
var bLen = b.length;
if (aLen === 0) return bLen;
if (bLen === 0) return aLen;
var bCharCode = void 0;
var ret = void 0;
var tmp = void 0;
var tmp2 = void 0;
var i = 0;
var j = 0;
while (i < aLen) {
charCodeCache[i] = a.charCodeAt(i);
arr[i] = ++i;
}
while (j < bLen) {
bCharCode = b.charCodeAt(j);
tmp = j++;
ret = j;
for (i = 0; i < aLen; i++) {
tmp2 = bCharCode === charCodeCache[i] ? tmp : tmp + 1;
tmp = arr[i];
ret = arr[i] = tmp > ret ? tmp2 > ret ? ret + 1 : tmp2 : tmp2 > tmp ? tmp + 1 : tmp2;
}
}
return ret;
};
})();
}
exports.default = leven;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../../../process/browser.js */ 4)))
/***/ },
/* 709 */
/*!**************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/lib/keyboardKey.js ***!
\**************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _isObject2 = __webpack_require__(/*! lodash/isObject */ 560);
var _isObject3 = _interopRequireDefault(_isObject2);
var _times2 = __webpack_require__(/*! lodash/times */ 710);
var _times3 = _interopRequireDefault(_times2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* All previous KeyboardEvent key identifying properties are deprecated in favor of `key`.
* Unfortunately, `key` is not yet fully supported.
* @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key
*/
var codes = {
// ----------------------------------------
// By Code
// ----------------------------------------
3: 'Cancel',
6: 'Help',
8: 'Backspace',
9: 'Tab',
12: 'Clear',
13: 'Enter',
16: 'Shift',
17: 'Control',
18: 'Alt',
19: 'Pause',
20: 'CapsLock',
27: 'Escape',
28: 'Convert',
29: 'NonConvert',
30: 'Accept',
31: 'ModeChange',
32: ' ',
33: 'PageUp',
34: 'PageDown',
35: 'End',
36: 'Home',
37: 'ArrowLeft',
38: 'ArrowUp',
39: 'ArrowRight',
40: 'ArrowDown',
41: 'Select',
42: 'Print',
43: 'Execute',
44: 'PrintScreen',
45: 'Insert',
46: 'Delete',
48: ['0', ')'],
49: ['1', '!'],
50: ['2', '@'],
51: ['3', '#'],
52: ['4', '$'],
53: ['5', '%'],
54: ['6', '^'],
55: ['7', '&'],
56: ['8', '*'],
57: ['9', '('],
91: 'OS',
93: 'ContextMenu',
144: 'NumLock',
145: 'ScrollLock',
181: 'VolumeMute',
182: 'VolumeDown',
183: 'VolumeUp',
186: [';', ':'],
187: ['=', '+'],
188: [',', '<'],
189: ['-', '_'],
190: ['.', '>'],
191: ['/', '?'],
192: ['`', '~'],
219: ['[', '{'],
220: ['\\', '|'],
221: [']', '}'],
222: ["'", '"'],
224: 'Meta',
225: 'AltGraph',
246: 'Attn',
247: 'CrSel',
248: 'ExSel',
249: 'EraseEof',
250: 'Play',
251: 'ZoomOut'
};
// Function Keys (F1-24)
(0, _times3.default)(24, function (i) {
return codes[112 + i] = 'F' + (i + 1);
});
// Alphabet (a-Z)
(0, _times3.default)(26, function (i) {
var n = i + 65;
codes[n] = [String.fromCharCode(n + 32), String.fromCharCode(n)];
});
var keyboardKey = {
codes: codes,
/**
* Get the `keyCode` or `which` value from a keyboard event or `key` name.
* @param {string|object} name A keyboard event like object or `key` name.
* @param {string} [name.key] If object, it must have one of these keys.
* @param {string} [name.keyCode] If object, it must have one of these keys.
* @param {string} [name.which] If object, it must have one of these keys.
* @returns {*}
*/
getCode: function getCode(name) {
if ((0, _isObject3.default)(name)) {
return name.keyCode || name.which || this[name.key];
}
return this[name];
},
/**
* Get the key name from a keyboard event, `keyCode`, or `which` value.
* @param {number|object} code A keyboard event like object or key name.
* @param {number} [code.keyCode] If object, it must have one of these keys.
* @param {number} [code.which] If object, it must have one of these keys.
* @param {number} [code.shiftKey] If object, it must have one of these keys.
* @returns {*}
*/
getName: function getName(code) {
var isEvent = (0, _isObject3.default)(code);
var name = codes[isEvent ? code.keyCode || code.which : code];
if (Array.isArray(name)) {
if (isEvent) {
name = name[code.shiftKey ? 1 : 0];
} else {
name = name[0];
}
}
return name;
},
// ----------------------------------------
// By Name
// ----------------------------------------
// declare these manually for static analysis
Cancel: 3,
Help: 6,
Backspace: 8,
Tab: 9,
Clear: 12,
Enter: 13,
Shift: 16,
Control: 17,
Alt: 18,
Pause: 19,
CapsLock: 20,
Escape: 27,
Convert: 28,
NonConvert: 29,
Accept: 30,
ModeChange: 31,
' ': 32,
PageUp: 33,
PageDown: 34,
End: 35,
Home: 36,
ArrowLeft: 37,
ArrowUp: 38,
ArrowRight: 39,
ArrowDown: 40,
Select: 41,
Print: 42,
Execute: 43,
PrintScreen: 44,
Insert: 45,
Delete: 46,
0: 48, ')': 48,
1: 49, '!': 49,
2: 50, '@': 50,
3: 51, '#': 51,
4: 52, $: 52,
5: 53, '%': 53,
6: 54, '^': 54,
7: 55, '&': 55,
8: 56, '*': 56,
9: 57, '(': 57,
a: 65, A: 65,
b: 66, B: 66,
c: 67, C: 67,
d: 68, D: 68,
e: 69, E: 69,
f: 70, F: 70,
g: 71, G: 71,
h: 72, H: 72,
i: 73, I: 73,
j: 74, J: 74,
k: 75, K: 75,
l: 76, L: 76,
m: 77, M: 77,
n: 78, N: 78,
o: 79, O: 79,
p: 80, P: 80,
q: 81, Q: 81,
r: 82, R: 82,
s: 83, S: 83,
t: 84, T: 84,
u: 85, U: 85,
v: 86, V: 86,
w: 87, W: 87,
x: 88, X: 88,
y: 89, Y: 89,
z: 90, Z: 90,
OS: 91,
ContextMenu: 93,
F1: 112,
F2: 113,
F3: 114,
F4: 115,
F5: 116,
F6: 117,
F7: 118,
F8: 119,
F9: 120,
F10: 121,
F11: 122,
F12: 123,
F13: 124,
F14: 125,
F15: 126,
F16: 127,
F17: 128,
F18: 129,
F19: 130,
F20: 131,
F21: 132,
F22: 133,
F23: 134,
F24: 135,
NumLock: 144,
ScrollLock: 145,
VolumeMute: 181,
VolumeDown: 182,
VolumeUp: 183,
';': 186, ':': 186,
'=': 187, '+': 187,
',': 188, '<': 188,
'-': 189, _: 189,
'.': 190, '>': 190,
'/': 191, '?': 191,
'`': 192, '~': 192,
'[': 219, '{': 219,
'\\': 220, '\|': 220,
']': 221, '}': 221,
"'": 222, '"': 222,
Meta: 224,
AltGraph: 225,
Attn: 246,
CrSel: 247,
ExSel: 248,
EraseEof: 249,
Play: 250,
ZoomOut: 251
};
// ----------------------------------------
// By Alias
// ----------------------------------------
// provide dot-notation accessible keys for all key names
keyboardKey.Spacebar = keyboardKey[' '];
keyboardKey.Digit0 = keyboardKey['0'];
keyboardKey.Digit1 = keyboardKey['1'];
keyboardKey.Digit2 = keyboardKey['2'];
keyboardKey.Digit3 = keyboardKey['3'];
keyboardKey.Digit4 = keyboardKey['4'];
keyboardKey.Digit5 = keyboardKey['5'];
keyboardKey.Digit6 = keyboardKey['6'];
keyboardKey.Digit7 = keyboardKey['7'];
keyboardKey.Digit8 = keyboardKey['8'];
keyboardKey.Digit9 = keyboardKey['9'];
keyboardKey.Tilde = keyboardKey['~'];
keyboardKey.GraveAccent = keyboardKey['`'];
keyboardKey.ExclamationPoint = keyboardKey['!'];
keyboardKey.AtSign = keyboardKey['@'];
keyboardKey.PoundSign = keyboardKey['#'];
keyboardKey.PercentSign = keyboardKey['%'];
keyboardKey.Caret = keyboardKey['^'];
keyboardKey.Ampersand = keyboardKey['&'];
keyboardKey.PlusSign = keyboardKey['+'];
keyboardKey.MinusSign = keyboardKey['-'];
keyboardKey.EqualsSign = keyboardKey['='];
keyboardKey.DivisionSign = keyboardKey['/'];
keyboardKey.MultiplicationSign = keyboardKey['*'];
keyboardKey.Comma = keyboardKey[','];
keyboardKey.Decimal = keyboardKey['.'];
keyboardKey.Colon = keyboardKey[':'];
keyboardKey.Semicolon = keyboardKey[';'];
keyboardKey.Pipe = keyboardKey['|'];
keyboardKey.BackSlash = keyboardKey['\\'];
keyboardKey.QuestionMark = keyboardKey['?'];
keyboardKey.SingleQuote = keyboardKey['"'];
keyboardKey.DoubleQuote = keyboardKey['"'];
keyboardKey.LeftCurlyBrace = keyboardKey['{'];
keyboardKey.RightCurlyBrace = keyboardKey['}'];
keyboardKey.LeftParenthesis = keyboardKey['('];
keyboardKey.RightParenthesis = keyboardKey[')'];
keyboardKey.LeftAngleBracket = keyboardKey['<'];
keyboardKey.RightAngleBracket = keyboardKey['>'];
keyboardKey.LeftSquareBracket = keyboardKey['['];
keyboardKey.RightSquareBracket = keyboardKey[']'];
exports.default = keyboardKey;
/***/ },
/* 710 */
/*!***********************************************!*\
!*** ./~/semantic-ui-react/~/lodash/times.js ***!
\***********************************************/
/***/ function(module, exports, __webpack_require__) {
var baseTimes = __webpack_require__(/*! ./_baseTimes */ 636),
castFunction = __webpack_require__(/*! ./_castFunction */ 692),
toInteger = __webpack_require__(/*! ./toInteger */ 624);
/** Used as references for various `Number` constants. */
var MAX_SAFE_INTEGER = 9007199254740991;
/** Used as references for the maximum length and index of an array. */
var MAX_ARRAY_LENGTH = 4294967295;
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMin = Math.min;
/**
* Invokes the iteratee `n` times, returning an array of the results of
* each invocation. The iteratee is invoked with one argument; (index).
*
* @static
* @since 0.1.0
* @memberOf _
* @category Util
* @param {number} n The number of times to invoke `iteratee`.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Array} Returns the array of results.
* @example
*
* _.times(3, String);
* // => ['0', '1', '2']
*
* _.times(4, _.constant(0));
* // => [0, 0, 0, 0]
*/
function times(n, iteratee) {
n = toInteger(n);
if (n < 1 || n > MAX_SAFE_INTEGER) {
return [];
}
var index = MAX_ARRAY_LENGTH,
length = nativeMin(n, MAX_ARRAY_LENGTH);
iteratee = castFunction(iteratee);
n -= MAX_ARRAY_LENGTH;
var result = baseTimes(length, iteratee);
while (++index < n) {
iteratee(index);
}
return result;
}
module.exports = times;
/***/ },
/* 711 */
/*!*************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/lib/objectDiff.js ***!
\*************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.objectDiff = undefined;
var _isEqual2 = __webpack_require__(/*! lodash/isEqual */ 712);
var _isEqual3 = _interopRequireDefault(_isEqual2);
var _has2 = __webpack_require__(/*! lodash/has */ 535);
var _has3 = _interopRequireDefault(_has2);
var _transform2 = __webpack_require__(/*! lodash/transform */ 713);
var _transform3 = _interopRequireDefault(_transform2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Naive and inefficient object difference, intended for development / debugging use only.
* Deleted keys are shown as [DELETED].
* @param {{}} source The source object
* @param {{}} target The target object.
* @returns {{}} A new object containing new/modified/deleted keys.
* @example
* import { objectDiff } from 'src/lib'
*
* const a = { key: 'val', foo: 'bar' }
* const b = { key: 'val', foo: 'baz' }
*
* objectDiff(a, b)
* //=> { foo: 'baz' }
*/
var objectDiff = exports.objectDiff = function objectDiff(source, target) {
return (0, _transform3.default)(source, function (res, val, key) {
// deleted keys
if (!(0, _has3.default)(target, key)) res[key] = '[DELETED]';
// new keys / changed values
else if (!(0, _isEqual3.default)(val, target[key])) res[key] = target[key];
}, {});
};
/***/ },
/* 712 */
/*!*************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/isEqual.js ***!
\*************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseIsEqual = __webpack_require__(/*! ./_baseIsEqual */ 656);
/**
* Performs a deep comparison between two values to determine if they are
* equivalent.
*
* **Note:** This method supports comparing arrays, array buffers, booleans,
* date objects, error objects, maps, numbers, `Object` objects, regexes,
* sets, strings, symbols, and typed arrays. `Object` objects are compared
* by their own, not inherited, enumerable properties. Functions and DOM
* nodes are compared by strict equality, i.e. `===`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
* @example
*
* var object = { 'a': 1 };
* var other = { 'a': 1 };
*
* _.isEqual(object, other);
* // => true
*
* object === other;
* // => false
*/
function isEqual(value, other) {
return baseIsEqual(value, other);
}
module.exports = isEqual;
/***/ },
/* 713 */
/*!***************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/transform.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
var arrayEach = __webpack_require__(/*! ./_arrayEach */ 691),
baseCreate = __webpack_require__(/*! ./_baseCreate */ 714),
baseForOwn = __webpack_require__(/*! ./_baseForOwn */ 631),
baseIteratee = __webpack_require__(/*! ./_baseIteratee */ 647),
getPrototype = __webpack_require__(/*! ./_getPrototype */ 704),
isArray = __webpack_require__(/*! ./isArray */ 539),
isBuffer = __webpack_require__(/*! ./isBuffer */ 637),
isFunction = __webpack_require__(/*! ./isFunction */ 559),
isObject = __webpack_require__(/*! ./isObject */ 560),
isTypedArray = __webpack_require__(/*! ./isTypedArray */ 639);
/**
* An alternative to `_.reduce`; this method transforms `object` to a new
* `accumulator` object which is the result of running each of its own
* enumerable string keyed properties thru `iteratee`, with each invocation
* potentially mutating the `accumulator` object. If `accumulator` is not
* provided, a new object with the same `[[Prototype]]` will be used. The
* iteratee is invoked with four arguments: (accumulator, value, key, object).
* Iteratee functions may exit iteration early by explicitly returning `false`.
*
* @static
* @memberOf _
* @since 1.3.0
* @category Object
* @param {Object} object The object to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @param {*} [accumulator] The custom accumulator value.
* @returns {*} Returns the accumulated value.
* @example
*
* _.transform([2, 3, 4], function(result, n) {
* result.push(n *= n);
* return n % 2 == 0;
* }, []);
* // => [4, 9]
*
* _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
* (result[value] || (result[value] = [])).push(key);
* }, {});
* // => { '1': ['a', 'c'], '2': ['b'] }
*/
function transform(object, iteratee, accumulator) {
var isArr = isArray(object),
isArrLike = isArr || isBuffer(object) || isTypedArray(object);
iteratee = baseIteratee(iteratee, 4);
if (accumulator == null) {
var Ctor = object && object.constructor;
if (isArrLike) {
accumulator = isArr ? new Ctor : [];
}
else if (isObject(object)) {
accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
}
else {
accumulator = {};
}
}
(isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
return iteratee(accumulator, value, index, object);
});
return accumulator;
}
module.exports = transform;
/***/ },
/* 714 */
/*!*****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_baseCreate.js ***!
\*****************************************************/
/***/ function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(/*! ./isObject */ 560);
/** Built-in value references. */
var objectCreate = Object.create;
/**
* The base implementation of `_.create` without support for assigning
* properties to the created object.
*
* @private
* @param {Object} proto The object to inherit from.
* @returns {Object} Returns the new object.
*/
var baseCreate = (function() {
function object() {}
return function(proto) {
if (!isObject(proto)) {
return {};
}
if (objectCreate) {
return objectCreate(proto);
}
object.prototype = proto;
var result = new object;
object.prototype = undefined;
return result;
};
}());
module.exports = baseCreate;
/***/ },
/* 715 */
/*!****************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/lib/childrenUtils.js ***!
\****************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.findByType = exports.someByType = undefined;
var _find2 = __webpack_require__(/*! lodash/find */ 716);
var _find3 = _interopRequireDefault(_find2);
var _some2 = __webpack_require__(/*! lodash/some */ 719);
var _some3 = _interopRequireDefault(_some2);
var _react = __webpack_require__(/*! react */ 2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Determine if child by type exists in children.
* @param {Object} children The children prop of a component.
* @param {string|Function} type An html tag name string or React component.
* @returns {Boolean}
*/
var someByType = exports.someByType = function someByType(children, type) {
return (0, _some3.default)(_react.Children.toArray(children), { type: type });
};
/**
* Find child by type.
* @param {Object} children The children prop of a component.
* @param {string|Function} type An html tag name string or React component.
* @returns {undefined|Object}
*/
var findByType = exports.findByType = function findByType(children, type) {
return (0, _find3.default)(_react.Children.toArray(children), { type: type });
};
/***/ },
/* 716 */
/*!**********************************************!*\
!*** ./~/semantic-ui-react/~/lodash/find.js ***!
\**********************************************/
/***/ function(module, exports, __webpack_require__) {
var createFind = __webpack_require__(/*! ./_createFind */ 717),
findIndex = __webpack_require__(/*! ./findIndex */ 718);
/**
* Iterates over elements of `collection`, returning the first element
* `predicate` returns truthy for. The predicate is invoked with three
* arguments: (value, index|key, collection).
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to inspect.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @param {number} [fromIndex=0] The index to search from.
* @returns {*} Returns the matched element, else `undefined`.
* @example
*
* var users = [
* { 'user': 'barney', 'age': 36, 'active': true },
* { 'user': 'fred', 'age': 40, 'active': false },
* { 'user': 'pebbles', 'age': 1, 'active': true }
* ];
*
* _.find(users, function(o) { return o.age < 40; });
* // => object for 'barney'
*
* // The `_.matches` iteratee shorthand.
* _.find(users, { 'age': 1, 'active': true });
* // => object for 'pebbles'
*
* // The `_.matchesProperty` iteratee shorthand.
* _.find(users, ['active', false]);
* // => object for 'fred'
*
* // The `_.property` iteratee shorthand.
* _.find(users, 'active');
* // => object for 'barney'
*/
var find = createFind(findIndex);
module.exports = find;
/***/ },
/* 717 */
/*!*****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_createFind.js ***!
\*****************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseIteratee = __webpack_require__(/*! ./_baseIteratee */ 647),
isArrayLike = __webpack_require__(/*! ./isArrayLike */ 620),
keys = __webpack_require__(/*! ./keys */ 634);
/**
* Creates a `_.find` or `_.findLast` function.
*
* @private
* @param {Function} findIndexFunc The function to find the collection index.
* @returns {Function} Returns the new find function.
*/
function createFind(findIndexFunc) {
return function(collection, predicate, fromIndex) {
var iterable = Object(collection);
if (!isArrayLike(collection)) {
var iteratee = baseIteratee(predicate, 3);
collection = keys(collection);
predicate = function(key) { return iteratee(iterable[key], key, iterable); };
}
var index = findIndexFunc(collection, predicate, fromIndex);
return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
};
}
module.exports = createFind;
/***/ },
/* 718 */
/*!***************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/findIndex.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseFindIndex = __webpack_require__(/*! ./_baseFindIndex */ 601),
baseIteratee = __webpack_require__(/*! ./_baseIteratee */ 647),
toInteger = __webpack_require__(/*! ./toInteger */ 624);
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max;
/**
* This method is like `_.find` except that it returns the index of the first
* element `predicate` returns truthy for instead of the element itself.
*
* @static
* @memberOf _
* @since 1.1.0
* @category Array
* @param {Array} array The array to inspect.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @param {number} [fromIndex=0] The index to search from.
* @returns {number} Returns the index of the found element, else `-1`.
* @example
*
* var users = [
* { 'user': 'barney', 'active': false },
* { 'user': 'fred', 'active': false },
* { 'user': 'pebbles', 'active': true }
* ];
*
* _.findIndex(users, function(o) { return o.user == 'barney'; });
* // => 0
*
* // The `_.matches` iteratee shorthand.
* _.findIndex(users, { 'user': 'fred', 'active': false });
* // => 1
*
* // The `_.matchesProperty` iteratee shorthand.
* _.findIndex(users, ['active', false]);
* // => 0
*
* // The `_.property` iteratee shorthand.
* _.findIndex(users, 'active');
* // => 2
*/
function findIndex(array, predicate, fromIndex) {
var length = array == null ? 0 : array.length;
if (!length) {
return -1;
}
var index = fromIndex == null ? 0 : toInteger(fromIndex);
if (index < 0) {
index = nativeMax(length + index, 0);
}
return baseFindIndex(array, baseIteratee(predicate, 3), index);
}
module.exports = findIndex;
/***/ },
/* 719 */
/*!**********************************************!*\
!*** ./~/semantic-ui-react/~/lodash/some.js ***!
\**********************************************/
/***/ function(module, exports, __webpack_require__) {
var arraySome = __webpack_require__(/*! ./_arraySome */ 659),
baseIteratee = __webpack_require__(/*! ./_baseIteratee */ 647),
baseSome = __webpack_require__(/*! ./_baseSome */ 720),
isArray = __webpack_require__(/*! ./isArray */ 539),
isIterateeCall = __webpack_require__(/*! ./_isIterateeCall */ 721);
/**
* Checks if `predicate` returns truthy for **any** element of `collection`.
* Iteration is stopped once `predicate` returns truthy. The predicate is
* invoked with three arguments: (value, index|key, collection).
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {boolean} Returns `true` if any element passes the predicate check,
* else `false`.
* @example
*
* _.some([null, 0, 'yes', false], Boolean);
* // => true
*
* var users = [
* { 'user': 'barney', 'active': true },
* { 'user': 'fred', 'active': false }
* ];
*
* // The `_.matches` iteratee shorthand.
* _.some(users, { 'user': 'barney', 'active': false });
* // => false
*
* // The `_.matchesProperty` iteratee shorthand.
* _.some(users, ['active', false]);
* // => true
*
* // The `_.property` iteratee shorthand.
* _.some(users, 'active');
* // => true
*/
function some(collection, predicate, guard) {
var func = isArray(collection) ? arraySome : baseSome;
if (guard && isIterateeCall(collection, predicate, guard)) {
predicate = undefined;
}
return func(collection, baseIteratee(predicate, 3));
}
module.exports = some;
/***/ },
/* 720 */
/*!***************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_baseSome.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseEach = __webpack_require__(/*! ./_baseEach */ 630);
/**
* The base implementation of `_.some` without support for iteratee shorthands.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} predicate The function invoked per iteration.
* @returns {boolean} Returns `true` if any element passes the predicate check,
* else `false`.
*/
function baseSome(collection, predicate) {
var result;
baseEach(collection, function(value, index, collection) {
result = predicate(value, index, collection);
return !result;
});
return !!result;
}
module.exports = baseSome;
/***/ },
/* 721 */
/*!*********************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_isIterateeCall.js ***!
\*********************************************************/
/***/ function(module, exports, __webpack_require__) {
var eq = __webpack_require__(/*! ./eq */ 573),
isArrayLike = __webpack_require__(/*! ./isArrayLike */ 620),
isIndex = __webpack_require__(/*! ./_isIndex */ 589),
isObject = __webpack_require__(/*! ./isObject */ 560);
/**
* Checks if the given arguments are from an iteratee call.
*
* @private
* @param {*} value The potential iteratee value argument.
* @param {*} index The potential iteratee index or key argument.
* @param {*} object The potential iteratee object argument.
* @returns {boolean} Returns `true` if the arguments are from an iteratee call,
* else `false`.
*/
function isIterateeCall(value, index, object) {
if (!isObject(object)) {
return false;
}
var type = typeof index;
if (type == 'number'
? (isArrayLike(object) && isIndex(index, object.length))
: (type == 'string' && index in object)
) {
return eq(object[index], value);
}
return false;
}
module.exports = isIterateeCall;
/***/ },
/* 722 */
/*!******************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/lib/customPropTypes.js ***!
\******************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.deprecate = exports.collectionShorthand = exports.itemShorthand = exports.contentShorthand = exports.demand = exports.givenProps = exports.some = exports.every = exports.disallow = exports.suggest = exports.as = undefined;
var _isObject2 = __webpack_require__(/*! lodash/fp/isObject */ 723);
var _isObject3 = _interopRequireDefault(_isObject2);
var _pick2 = __webpack_require__(/*! lodash/fp/pick */ 797);
var _pick3 = _interopRequireDefault(_pick2);
var _keys2 = __webpack_require__(/*! lodash/fp/keys */ 802);
var _keys3 = _interopRequireDefault(_keys2);
var _isPlainObject2 = __webpack_require__(/*! lodash/fp/isPlainObject */ 803);
var _isPlainObject3 = _interopRequireDefault(_isPlainObject2);
var _isFunction2 = __webpack_require__(/*! lodash/fp/isFunction */ 804);
var _isFunction3 = _interopRequireDefault(_isFunction2);
var _compact2 = __webpack_require__(/*! lodash/fp/compact */ 805);
var _compact3 = _interopRequireDefault(_compact2);
var _take2 = __webpack_require__(/*! lodash/fp/take */ 807);
var _take3 = _interopRequireDefault(_take2);
var _sortBy2 = __webpack_require__(/*! lodash/fp/sortBy */ 810);
var _sortBy3 = _interopRequireDefault(_sortBy2);
var _sum2 = __webpack_require__(/*! lodash/fp/sum */ 817);
var _sum3 = _interopRequireDefault(_sum2);
var _min2 = __webpack_require__(/*! lodash/fp/min */ 820);
var _min3 = _interopRequireDefault(_min2);
var _map2 = __webpack_require__(/*! lodash/fp/map */ 824);
var _map3 = _interopRequireDefault(_map2);
var _flow2 = __webpack_require__(/*! lodash/fp/flow */ 826);
var _flow3 = _interopRequireDefault(_flow2);
var _includes2 = __webpack_require__(/*! lodash/fp/includes */ 829);
var _includes3 = _interopRequireDefault(_includes2);
var _isNil2 = __webpack_require__(/*! lodash/fp/isNil */ 833);
var _isNil3 = _interopRequireDefault(_isNil2);
var _react = __webpack_require__(/*! react */ 2);
var _leven = __webpack_require__(/*! ./leven */ 708);
var _leven2 = _interopRequireDefault(_leven);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
var typeOf = function typeOf() {
var _Object$prototype$toS;
return (_Object$prototype$toS = Object.prototype.toString).call.apply(_Object$prototype$toS, arguments);
};
/**
* Ensure a component can render as a give prop value.
*/
var as = exports.as = function as() {
return _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.func]).apply(undefined, arguments);
};
/**
* Similar to PropTypes.oneOf but shows closest matches.
* Word order is ignored allowing `left chevron` to match `chevron left`.
* Useful for very large lists of options (e.g. Icon name, Flag name, etc.)
* @param {string[]} suggestions An array of allowed values.
*/
var suggest = exports.suggest = function suggest(suggestions) {
return function (props, propName, componentName) {
if (!Array.isArray(suggestions)) {
throw new Error(['Invalid argument supplied to suggest, expected an instance of array.', ' See `' + propName + '` prop in `' + componentName + '`.'].join(''));
}
var propValue = props[propName];
// skip if prop is undefined or is included in the suggestions
if ((0, _isNil3.default)(propValue) || propValue === false || (0, _includes3.default)(propValue, suggestions)) return;
// find best suggestions
var propValueWords = propValue.split(' ');
/* eslint-disable max-nested-callbacks */
var bestMatches = (0, _flow3.default)((0, _map3.default)(function (suggestion) {
var suggestionWords = suggestion.split(' ');
var propValueScore = (0, _flow3.default)((0, _map3.default)(function (x) {
return (0, _map3.default)(function (y) {
return (0, _leven2.default)(x, y);
}, suggestionWords);
}), (0, _map3.default)(_min3.default), _sum3.default)(propValueWords);
var suggestionScore = (0, _flow3.default)((0, _map3.default)(function (x) {
return (0, _map3.default)(function (y) {
return (0, _leven2.default)(x, y);
}, propValueWords);
}), (0, _map3.default)(_min3.default), _sum3.default)(suggestionWords);
return { suggestion: suggestion, score: propValueScore + suggestionScore };
}), (0, _sortBy3.default)(['score', 'suggestion']), (0, _take3.default)(3))(suggestions);
/* eslint-enable max-nested-callbacks */
// skip if a match scored 0
// since we're matching on words (classNames) this allows any word order to pass validation
// e.g. `left chevron` vs `chevron left`
if (bestMatches.some(function (x) {
return x.score === 0;
})) return;
return new Error(['Invalid prop `' + propName + '` of value `' + propValue + '` supplied to `' + componentName + '`.', '\n\nInstead of `' + propValue + '`, did you mean:', bestMatches.map(function (x) {
return '\n - ' + x.suggestion;
}).join(''), '\n'].join(''));
};
};
/**
* Disallow other props form being defined with this prop.
* @param {string[]} disallowedProps An array of props that cannot be used with this prop.
*/
var disallow = exports.disallow = function disallow(disallowedProps) {
return function (props, propName, componentName) {
if (!Array.isArray(disallowedProps)) {
throw new Error(['Invalid argument supplied to disallow, expected an instance of array.', ' See `' + propName + '` prop in `' + componentName + '`.'].join(''));
}
// skip if prop is undefined
if ((0, _isNil3.default)(props[propName]) || props[propName] === false) return;
// find disallowed props with values
var disallowed = disallowedProps.reduce(function (acc, disallowedProp) {
if (!(0, _isNil3.default)(props[disallowedProp]) && props[disallowedProp] !== false) {
return [].concat(_toConsumableArray(acc), [disallowedProp]);
}
return acc;
}, []);
if (disallowed.length > 0) {
return new Error(['Prop `' + propName + '` in `' + componentName + '` conflicts with props: `' + disallowed.join('`, `') + '`.', 'They cannot be defined together, choose one or the other.'].join(' '));
}
};
};
/**
* Ensure a prop adherers to multiple prop type validators.
* @param {function[]} validators An array of propType functions.
*/
var every = exports.every = function every(validators) {
return function (props, propName, componentName) {
for (var _len = arguments.length, rest = Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
rest[_key - 3] = arguments[_key];
}
if (!Array.isArray(validators)) {
throw new Error(['Invalid argument supplied to every, expected an instance of array.', 'See `' + propName + '` prop in `' + componentName + '`.'].join(' '));
}
var errors = (0, _flow3.default)((0, _map3.default)(function (validator) {
if (typeof validator !== 'function') {
throw new Error('every() argument "validators" should contain functions, found: ' + typeOf(validator) + '.');
}
return validator.apply(undefined, [props, propName, componentName].concat(rest));
}), _compact3.default)(validators);
// we can only return one error at a time
return errors[0];
};
};
/**
* Ensure a prop adherers to at least one of the given prop type validators.
* @param {function[]} validators An array of propType functions.
*/
var some = exports.some = function some(validators) {
return function (props, propName, componentName) {
for (var _len2 = arguments.length, rest = Array(_len2 > 3 ? _len2 - 3 : 0), _key2 = 3; _key2 < _len2; _key2++) {
rest[_key2 - 3] = arguments[_key2];
}
if (!Array.isArray(validators)) {
throw new Error(['Invalid argument supplied to some, expected an instance of array.', 'See `' + propName + '` prop in `' + componentName + '`.'].join(' '));
}
var errors = (0, _compact3.default)((0, _map3.default)(validators, function (validator) {
if (!(0, _isFunction3.default)(validator)) {
throw new Error('some() argument "validators" should contain functions, found: ' + typeOf(validator) + '.');
}
return validator.apply(undefined, [props, propName, componentName].concat(rest));
}));
// fail only if all validators failed
if (errors.length === validators.length) {
var error = new Error('One of these validators must pass:');
error.message += '\n' + (0, _map3.default)(errors, function (err, i) {
return '[' + (i + 1) + ']: ' + err.message;
}).join('\n');
return error;
}
};
};
/**
* Ensure a validator passes only when a component has a given propsShape.
* @param {object} propsShape An object describing the prop shape.
* @param {function} validator A propType function.
*/
var givenProps = exports.givenProps = function givenProps(propsShape, validator) {
return function (props, propName, componentName) {
for (var _len3 = arguments.length, rest = Array(_len3 > 3 ? _len3 - 3 : 0), _key3 = 3; _key3 < _len3; _key3++) {
rest[_key3 - 3] = arguments[_key3];
}
if (!(0, _isPlainObject3.default)(propsShape)) {
throw new Error(['Invalid argument supplied to givenProps, expected an object.', 'See `' + propName + '` prop in `' + componentName + '`.'].join(' '));
}
if (typeof validator !== 'function') {
throw new Error(['Invalid argument supplied to givenProps, expected a function.', 'See `' + propName + '` prop in `' + componentName + '`.'].join(' '));
}
var shouldValidate = (0, _keys3.default)(propsShape).every(function (key) {
var val = propsShape[key];
// require propShape validators to pass or prop values to match
return typeof val === 'function' ? !val.apply(undefined, [props, key, componentName].concat(rest)) : val === props[propName];
});
if (!shouldValidate) return;
var error = validator.apply(undefined, [props, propName, componentName].concat(rest));
if (error) {
// poor mans shallow pretty print, prevents JSON circular reference errors
var prettyProps = '{ ' + (0, _keys3.default)((0, _pick3.default)((0, _keys3.default)(propsShape), props)).map(function (key) {
var val = props[key];
var renderedValue = val;
if (typeof val === 'string') renderedValue = '"' + val + '"';else if (Array.isArray(val)) renderedValue = '[' + val.join(', ') + ']';else if ((0, _isObject3.default)(val)) renderedValue = '{...}';
return key + ': ' + renderedValue;
}).join(', ') + ' }';
error.message = 'Given props ' + prettyProps + ': ' + error.message;
return error;
}
};
};
/**
* Define prop dependencies by requiring other props.
* @param {string[]} requiredProps An array of required prop names.
*/
var demand = exports.demand = function demand(requiredProps) {
return function (props, propName, componentName) {
if (!Array.isArray(requiredProps)) {
throw new Error(['Invalid `requiredProps` argument supplied to require, expected an instance of array.', ' See `' + propName + '` prop in `' + componentName + '`.'].join(''));
}
// skip if prop is undefined
if (props[propName] === undefined) return;
var missingRequired = requiredProps.filter(function (requiredProp) {
return props[requiredProp] === undefined;
});
if (missingRequired.length > 0) {
return new Error('`' + propName + '` prop in `' + componentName + '` requires props: `' + missingRequired.join('`, `') + '`.');
}
};
};
/**
* Ensure a component can render as a node passed as a prop value in place of children.
*/
var contentShorthand = exports.contentShorthand = function contentShorthand() {
return every([disallow(['children']), _react.PropTypes.node]).apply(undefined, arguments);
};
/**
* Item shorthand is a description of a component that can be a literal,
* a props object, or an element.
*/
var itemShorthand = exports.itemShorthand = function itemShorthand() {
return every([disallow(['children']), _react.PropTypes.oneOfType([_react.PropTypes.array, _react.PropTypes.node, _react.PropTypes.object])]).apply(undefined, arguments);
};
/**
* Collection shorthand ensures a prop is an array of item shorthand.
*/
var collectionShorthand = exports.collectionShorthand = function collectionShorthand() {
return every([disallow(['children']), _react.PropTypes.arrayOf(itemShorthand)]).apply(undefined, arguments);
};
/**
* Show a deprecated warning for component props with a help message and optional validator.
* @param {string} help A help message to display with the deprecation warning.
* @param {function} [validator] A propType function.
*/
var deprecate = exports.deprecate = function deprecate(help, validator) {
return function (props, propName, componentName) {
for (var _len4 = arguments.length, args = Array(_len4 > 3 ? _len4 - 3 : 0), _key4 = 3; _key4 < _len4; _key4++) {
args[_key4 - 3] = arguments[_key4];
}
if (typeof help !== 'string') {
throw new Error(['Invalid `help` argument supplied to deprecate, expected a string.', 'See `' + propName + '` prop in `' + componentName + '`.'].join(' '));
}
// skip if prop is undefined
if (props[propName] === undefined) return;
// deprecation error and help
var error = new Error('The `' + propName + '` prop in `' + componentName + '` is deprecated.');
if (help) error.message += ' ' + help;
// add optional validation error message
if (validator) {
if (typeof validator === 'function') {
var validationError = validator.apply(undefined, [props, propName, componentName].concat(args));
if (validationError) {
error.message = error.message + ' ' + validationError.message;
}
} else {
throw new Error(['Invalid argument supplied to deprecate, expected a function.', 'See `' + propName + '` prop in `' + componentName + '`.'].join(' '));
}
}
return error;
};
};
/***/ },
/* 723 */
/*!*****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/fp/isObject.js ***!
\*****************************************************/
/***/ function(module, exports, __webpack_require__) {
var convert = __webpack_require__(/*! ./convert */ 724),
func = convert('isObject', __webpack_require__(/*! ../isObject */ 560), __webpack_require__(/*! ./_falseOptions */ 796));
func.placeholder = __webpack_require__(/*! ./placeholder */ 727);
module.exports = func;
/***/ },
/* 724 */
/*!****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/fp/convert.js ***!
\****************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseConvert = __webpack_require__(/*! ./_baseConvert */ 725),
util = __webpack_require__(/*! ./_util */ 728);
/**
* Converts `func` of `name` to an immutable auto-curried iteratee-first data-last
* version with conversion `options` applied. If `name` is an object its methods
* will be converted.
*
* @param {string} name The name of the function to wrap.
* @param {Function} [func] The function to wrap.
* @param {Object} [options] The options object. See `baseConvert` for more details.
* @returns {Function|Object} Returns the converted function or object.
*/
function convert(name, func, options) {
return baseConvert(util, name, func, options);
}
module.exports = convert;
/***/ },
/* 725 */
/*!*********************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/fp/_baseConvert.js ***!
\*********************************************************/
/***/ function(module, exports, __webpack_require__) {
var mapping = __webpack_require__(/*! ./_mapping */ 726),
fallbackHolder = __webpack_require__(/*! ./placeholder */ 727);
/** Built-in value reference. */
var push = Array.prototype.push;
/**
* Creates a function, with an arity of `n`, that invokes `func` with the
* arguments it receives.
*
* @private
* @param {Function} func The function to wrap.
* @param {number} n The arity of the new function.
* @returns {Function} Returns the new function.
*/
function baseArity(func, n) {
return n == 2
? function(a, b) { return func.apply(undefined, arguments); }
: function(a) { return func.apply(undefined, arguments); };
}
/**
* Creates a function that invokes `func`, with up to `n` arguments, ignoring
* any additional arguments.
*
* @private
* @param {Function} func The function to cap arguments for.
* @param {number} n The arity cap.
* @returns {Function} Returns the new function.
*/
function baseAry(func, n) {
return n == 2
? function(a, b) { return func(a, b); }
: function(a) { return func(a); };
}
/**
* Creates a clone of `array`.
*
* @private
* @param {Array} array The array to clone.
* @returns {Array} Returns the cloned array.
*/
function cloneArray(array) {
var length = array ? array.length : 0,
result = Array(length);
while (length--) {
result[length] = array[length];
}
return result;
}
/**
* Creates a function that clones a given object using the assignment `func`.
*
* @private
* @param {Function} func The assignment function.
* @returns {Function} Returns the new cloner function.
*/
function createCloner(func) {
return function(object) {
return func({}, object);
};
}
/**
* A specialized version of `_.spread` which flattens the spread array into
* the arguments of the invoked `func`.
*
* @private
* @param {Function} func The function to spread arguments over.
* @param {number} start The start position of the spread.
* @returns {Function} Returns the new function.
*/
function flatSpread(func, start) {
return function() {
var length = arguments.length,
lastIndex = length - 1,
args = Array(length);
while (length--) {
args[length] = arguments[length];
}
var array = args[start],
otherArgs = args.slice(0, start);
if (array) {
push.apply(otherArgs, array);
}
if (start != lastIndex) {
push.apply(otherArgs, args.slice(start + 1));
}
return func.apply(this, otherArgs);
};
}
/**
* Creates a function that wraps `func` and uses `cloner` to clone the first
* argument it receives.
*
* @private
* @param {Function} func The function to wrap.
* @param {Function} cloner The function to clone arguments.
* @returns {Function} Returns the new immutable function.
*/
function wrapImmutable(func, cloner) {
return function() {
var length = arguments.length;
if (!length) {
return;
}
var args = Array(length);
while (length--) {
args[length] = arguments[length];
}
var result = args[0] = cloner.apply(undefined, args);
func.apply(undefined, args);
return result;
};
}
/**
* The base implementation of `convert` which accepts a `util` object of methods
* required to perform conversions.
*
* @param {Object} util The util object.
* @param {string} name The name of the function to convert.
* @param {Function} func The function to convert.
* @param {Object} [options] The options object.
* @param {boolean} [options.cap=true] Specify capping iteratee arguments.
* @param {boolean} [options.curry=true] Specify currying.
* @param {boolean} [options.fixed=true] Specify fixed arity.
* @param {boolean} [options.immutable=true] Specify immutable operations.
* @param {boolean} [options.rearg=true] Specify rearranging arguments.
* @returns {Function|Object} Returns the converted function or object.
*/
function baseConvert(util, name, func, options) {
var setPlaceholder,
isLib = typeof name == 'function',
isObj = name === Object(name);
if (isObj) {
options = func;
func = name;
name = undefined;
}
if (func == null) {
throw new TypeError;
}
options || (options = {});
var config = {
'cap': 'cap' in options ? options.cap : true,
'curry': 'curry' in options ? options.curry : true,
'fixed': 'fixed' in options ? options.fixed : true,
'immutable': 'immutable' in options ? options.immutable : true,
'rearg': 'rearg' in options ? options.rearg : true
};
var forceCurry = ('curry' in options) && options.curry,
forceFixed = ('fixed' in options) && options.fixed,
forceRearg = ('rearg' in options) && options.rearg,
placeholder = isLib ? func : fallbackHolder,
pristine = isLib ? func.runInContext() : undefined;
var helpers = isLib ? func : {
'ary': util.ary,
'assign': util.assign,
'clone': util.clone,
'curry': util.curry,
'forEach': util.forEach,
'isArray': util.isArray,
'isFunction': util.isFunction,
'iteratee': util.iteratee,
'keys': util.keys,
'rearg': util.rearg,
'toInteger': util.toInteger,
'toPath': util.toPath
};
var ary = helpers.ary,
assign = helpers.assign,
clone = helpers.clone,
curry = helpers.curry,
each = helpers.forEach,
isArray = helpers.isArray,
isFunction = helpers.isFunction,
keys = helpers.keys,
rearg = helpers.rearg,
toInteger = helpers.toInteger,
toPath = helpers.toPath;
var aryMethodKeys = keys(mapping.aryMethod);
var wrappers = {
'castArray': function(castArray) {
return function() {
var value = arguments[0];
return isArray(value)
? castArray(cloneArray(value))
: castArray.apply(undefined, arguments);
};
},
'iteratee': function(iteratee) {
return function() {
var func = arguments[0],
arity = arguments[1],
result = iteratee(func, arity),
length = result.length;
if (config.cap && typeof arity == 'number') {
arity = arity > 2 ? (arity - 2) : 1;
return (length && length <= arity) ? result : baseAry(result, arity);
}
return result;
};
},
'mixin': function(mixin) {
return function(source) {
var func = this;
if (!isFunction(func)) {
return mixin(func, Object(source));
}
var pairs = [];
each(keys(source), function(key) {
if (isFunction(source[key])) {
pairs.push([key, func.prototype[key]]);
}
});
mixin(func, Object(source));
each(pairs, function(pair) {
var value = pair[1];
if (isFunction(value)) {
func.prototype[pair[0]] = value;
} else {
delete func.prototype[pair[0]];
}
});
return func;
};
},
'nthArg': function(nthArg) {
return function(n) {
var arity = n < 0 ? 1 : (toInteger(n) + 1);
return curry(nthArg(n), arity);
};
},
'rearg': function(rearg) {
return function(func, indexes) {
var arity = indexes ? indexes.length : 0;
return curry(rearg(func, indexes), arity);
};
},
'runInContext': function(runInContext) {
return function(context) {
return baseConvert(util, runInContext(context), options);
};
}
};
/*--------------------------------------------------------------------------*/
/**
* Casts `func` to a function with an arity capped iteratee if needed.
*
* @private
* @param {string} name The name of the function to inspect.
* @param {Function} func The function to inspect.
* @returns {Function} Returns the cast function.
*/
function castCap(name, func) {
if (config.cap) {
var indexes = mapping.iterateeRearg[name];
if (indexes) {
return iterateeRearg(func, indexes);
}
var n = !isLib && mapping.iterateeAry[name];
if (n) {
return iterateeAry(func, n);
}
}
return func;
}
/**
* Casts `func` to a curried function if needed.
*
* @private
* @param {string} name The name of the function to inspect.
* @param {Function} func The function to inspect.
* @param {number} n The arity of `func`.
* @returns {Function} Returns the cast function.
*/
function castCurry(name, func, n) {
return (forceCurry || (config.curry && n > 1))
? curry(func, n)
: func;
}
/**
* Casts `func` to a fixed arity function if needed.
*
* @private
* @param {string} name The name of the function to inspect.
* @param {Function} func The function to inspect.
* @param {number} n The arity cap.
* @returns {Function} Returns the cast function.
*/
function castFixed(name, func, n) {
if (config.fixed && (forceFixed || !mapping.skipFixed[name])) {
var data = mapping.methodSpread[name],
start = data && data.start;
return start === undefined ? ary(func, n) : flatSpread(func, start);
}
return func;
}
/**
* Casts `func` to an rearged function if needed.
*
* @private
* @param {string} name The name of the function to inspect.
* @param {Function} func The function to inspect.
* @param {number} n The arity of `func`.
* @returns {Function} Returns the cast function.
*/
function castRearg(name, func, n) {
return (config.rearg && n > 1 && (forceRearg || !mapping.skipRearg[name]))
? rearg(func, mapping.methodRearg[name] || mapping.aryRearg[n])
: func;
}
/**
* Creates a clone of `object` by `path`.
*
* @private
* @param {Object} object The object to clone.
* @param {Array|string} path The path to clone by.
* @returns {Object} Returns the cloned object.
*/
function cloneByPath(object, path) {
path = toPath(path);
var index = -1,
length = path.length,
lastIndex = length - 1,
result = clone(Object(object)),
nested = result;
while (nested != null && ++index < length) {
var key = path[index],
value = nested[key];
if (value != null) {
nested[path[index]] = clone(index == lastIndex ? value : Object(value));
}
nested = nested[key];
}
return result;
}
/**
* Converts `lodash` to an immutable auto-curried iteratee-first data-last
* version with conversion `options` applied.
*
* @param {Object} [options] The options object. See `baseConvert` for more details.
* @returns {Function} Returns the converted `lodash`.
*/
function convertLib(options) {
return _.runInContext.convert(options)(undefined);
}
/**
* Create a converter function for `func` of `name`.
*
* @param {string} name The name of the function to convert.
* @param {Function} func The function to convert.
* @returns {Function} Returns the new converter function.
*/
function createConverter(name, func) {
var realName = mapping.aliasToReal[name] || name,
methodName = mapping.remap[realName] || realName,
oldOptions = options;
return function(options) {
var newUtil = isLib ? pristine : helpers,
newFunc = isLib ? pristine[methodName] : func,
newOptions = assign(assign({}, oldOptions), options);
return baseConvert(newUtil, realName, newFunc, newOptions);
};
}
/**
* Creates a function that wraps `func` to invoke its iteratee, with up to `n`
* arguments, ignoring any additional arguments.
*
* @private
* @param {Function} func The function to cap iteratee arguments for.
* @param {number} n The arity cap.
* @returns {Function} Returns the new function.
*/
function iterateeAry(func, n) {
return overArg(func, function(func) {
return typeof func == 'function' ? baseAry(func, n) : func;
});
}
/**
* Creates a function that wraps `func` to invoke its iteratee with arguments
* arranged according to the specified `indexes` where the argument value at
* the first index is provided as the first argument, the argument value at
* the second index is provided as the second argument, and so on.
*
* @private
* @param {Function} func The function to rearrange iteratee arguments for.
* @param {number[]} indexes The arranged argument indexes.
* @returns {Function} Returns the new function.
*/
function iterateeRearg(func, indexes) {
return overArg(func, function(func) {
var n = indexes.length;
return baseArity(rearg(baseAry(func, n), indexes), n);
});
}
/**
* Creates a function that invokes `func` with its first argument transformed.
*
* @private
* @param {Function} func The function to wrap.
* @param {Function} transform The argument transform.
* @returns {Function} Returns the new function.
*/
function overArg(func, transform) {
return function() {
var length = arguments.length;
if (!length) {
return func();
}
var args = Array(length);
while (length--) {
args[length] = arguments[length];
}
var index = config.rearg ? 0 : (length - 1);
args[index] = transform(args[index]);
return func.apply(undefined, args);
};
}
/**
* Creates a function that wraps `func` and applys the conversions
* rules by `name`.
*
* @private
* @param {string} name The name of the function to wrap.
* @param {Function} func The function to wrap.
* @returns {Function} Returns the converted function.
*/
function wrap(name, func) {
var result,
realName = mapping.aliasToReal[name] || name,
wrapped = func,
wrapper = wrappers[realName];
if (wrapper) {
wrapped = wrapper(func);
}
else if (config.immutable) {
if (mapping.mutate.array[realName]) {
wrapped = wrapImmutable(func, cloneArray);
}
else if (mapping.mutate.object[realName]) {
wrapped = wrapImmutable(func, createCloner(func));
}
else if (mapping.mutate.set[realName]) {
wrapped = wrapImmutable(func, cloneByPath);
}
}
each(aryMethodKeys, function(aryKey) {
each(mapping.aryMethod[aryKey], function(otherName) {
if (realName == otherName) {
var data = mapping.methodSpread[realName],
afterRearg = data && data.afterRearg;
result = afterRearg
? castFixed(realName, castRearg(realName, wrapped, aryKey), aryKey)
: castRearg(realName, castFixed(realName, wrapped, aryKey), aryKey);
result = castCap(realName, result);
result = castCurry(realName, result, aryKey);
return false;
}
});
return !result;
});
result || (result = wrapped);
if (result == func) {
result = forceCurry ? curry(result, 1) : function() {
return func.apply(this, arguments);
};
}
result.convert = createConverter(realName, func);
if (mapping.placeholder[realName]) {
setPlaceholder = true;
result.placeholder = func.placeholder = placeholder;
}
return result;
}
/*--------------------------------------------------------------------------*/
if (!isObj) {
return wrap(name, func);
}
var _ = func;
// Convert methods by ary cap.
var pairs = [];
each(aryMethodKeys, function(aryKey) {
each(mapping.aryMethod[aryKey], function(key) {
var func = _[mapping.remap[key] || key];
if (func) {
pairs.push([key, wrap(key, func)]);
}
});
});
// Convert remaining methods.
each(keys(_), function(key) {
var func = _[key];
if (typeof func == 'function') {
var length = pairs.length;
while (length--) {
if (pairs[length][0] == key) {
return;
}
}
func.convert = createConverter(key, func);
pairs.push([key, func]);
}
});
// Assign to `_` leaving `_.prototype` unchanged to allow chaining.
each(pairs, function(pair) {
_[pair[0]] = pair[1];
});
_.convert = convertLib;
if (setPlaceholder) {
_.placeholder = placeholder;
}
// Assign aliases.
each(keys(_), function(key) {
each(mapping.realToAlias[key] || [], function(alias) {
_[alias] = _[key];
});
});
return _;
}
module.exports = baseConvert;
/***/ },
/* 726 */
/*!*****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/fp/_mapping.js ***!
\*****************************************************/
/***/ function(module, exports) {
/** Used to map aliases to their real names. */
exports.aliasToReal = {
// Lodash aliases.
'each': 'forEach',
'eachRight': 'forEachRight',
'entries': 'toPairs',
'entriesIn': 'toPairsIn',
'extend': 'assignIn',
'extendAll': 'assignInAll',
'extendAllWith': 'assignInAllWith',
'extendWith': 'assignInWith',
'first': 'head',
// Methods that are curried variants of others.
'conforms': 'conformsTo',
'matches': 'isMatch',
'property': 'get',
// Ramda aliases.
'__': 'placeholder',
'F': 'stubFalse',
'T': 'stubTrue',
'all': 'every',
'allPass': 'overEvery',
'always': 'constant',
'any': 'some',
'anyPass': 'overSome',
'apply': 'spread',
'assoc': 'set',
'assocPath': 'set',
'complement': 'negate',
'compose': 'flowRight',
'contains': 'includes',
'dissoc': 'unset',
'dissocPath': 'unset',
'dropLast': 'dropRight',
'dropLastWhile': 'dropRightWhile',
'equals': 'isEqual',
'identical': 'eq',
'indexBy': 'keyBy',
'init': 'initial',
'invertObj': 'invert',
'juxt': 'over',
'omitAll': 'omit',
'nAry': 'ary',
'path': 'get',
'pathEq': 'matchesProperty',
'pathOr': 'getOr',
'paths': 'at',
'pickAll': 'pick',
'pipe': 'flow',
'pluck': 'map',
'prop': 'get',
'propEq': 'matchesProperty',
'propOr': 'getOr',
'props': 'at',
'symmetricDifference': 'xor',
'symmetricDifferenceBy': 'xorBy',
'symmetricDifferenceWith': 'xorWith',
'takeLast': 'takeRight',
'takeLastWhile': 'takeRightWhile',
'unapply': 'rest',
'unnest': 'flatten',
'useWith': 'overArgs',
'where': 'conformsTo',
'whereEq': 'isMatch',
'zipObj': 'zipObject'
};
/** Used to map ary to method names. */
exports.aryMethod = {
'1': [
'assignAll', 'assignInAll', 'attempt', 'castArray', 'ceil', 'create',
'curry', 'curryRight', 'defaultsAll', 'defaultsDeepAll', 'floor', 'flow',
'flowRight', 'fromPairs', 'invert', 'iteratee', 'memoize', 'method', 'mergeAll',
'methodOf', 'mixin', 'nthArg', 'over', 'overEvery', 'overSome','rest', 'reverse',
'round', 'runInContext', 'spread', 'template', 'trim', 'trimEnd', 'trimStart',
'uniqueId', 'words', 'zipAll'
],
'2': [
'add', 'after', 'ary', 'assign', 'assignAllWith', 'assignIn', 'assignInAllWith',
'at', 'before', 'bind', 'bindAll', 'bindKey', 'chunk', 'cloneDeepWith',
'cloneWith', 'concat', 'conformsTo', 'countBy', 'curryN', 'curryRightN',
'debounce', 'defaults', 'defaultsDeep', 'defaultTo', 'delay', 'difference',
'divide', 'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith', 'eq',
'every', 'filter', 'find', 'findIndex', 'findKey', 'findLast', 'findLastIndex',
'findLastKey', 'flatMap', 'flatMapDeep', 'flattenDepth', 'forEach',
'forEachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight', 'get',
'groupBy', 'gt', 'gte', 'has', 'hasIn', 'includes', 'indexOf', 'intersection',
'invertBy', 'invoke', 'invokeMap', 'isEqual', 'isMatch', 'join', 'keyBy',
'lastIndexOf', 'lt', 'lte', 'map', 'mapKeys', 'mapValues', 'matchesProperty',
'maxBy', 'meanBy', 'merge', 'mergeAllWith', 'minBy', 'multiply', 'nth', 'omit',
'omitBy', 'overArgs', 'pad', 'padEnd', 'padStart', 'parseInt', 'partial',
'partialRight', 'partition', 'pick', 'pickBy', 'propertyOf', 'pull', 'pullAll',
'pullAt', 'random', 'range', 'rangeRight', 'rearg', 'reject', 'remove',
'repeat', 'restFrom', 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex',
'sortedIndexOf', 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy',
'split', 'spreadFrom', 'startsWith', 'subtract', 'sumBy', 'take', 'takeRight',
'takeRightWhile', 'takeWhile', 'tap', 'throttle', 'thru', 'times', 'trimChars',
'trimCharsEnd', 'trimCharsStart', 'truncate', 'union', 'uniqBy', 'uniqWith',
'unset', 'unzipWith', 'without', 'wrap', 'xor', 'zip', 'zipObject',
'zipObjectDeep'
],
'3': [
'assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith',
'findFrom', 'findIndexFrom', 'findLastFrom', 'findLastIndexFrom', 'getOr',
'includesFrom', 'indexOfFrom', 'inRange', 'intersectionBy', 'intersectionWith',
'invokeArgs', 'invokeArgsMap', 'isEqualWith', 'isMatchWith', 'flatMapDepth',
'lastIndexOfFrom', 'mergeWith', 'orderBy', 'padChars', 'padCharsEnd',
'padCharsStart', 'pullAllBy', 'pullAllWith', 'rangeStep', 'rangeStepRight',
'reduce', 'reduceRight', 'replace', 'set', 'slice', 'sortedIndexBy',
'sortedLastIndexBy', 'transform', 'unionBy', 'unionWith', 'update', 'xorBy',
'xorWith', 'zipWith'
],
'4': [
'fill', 'setWith', 'updateWith'
]
};
/** Used to map ary to rearg configs. */
exports.aryRearg = {
'2': [1, 0],
'3': [2, 0, 1],
'4': [3, 2, 0, 1]
};
/** Used to map method names to their iteratee ary. */
exports.iterateeAry = {
'dropRightWhile': 1,
'dropWhile': 1,
'every': 1,
'filter': 1,
'find': 1,
'findFrom': 1,
'findIndex': 1,
'findIndexFrom': 1,
'findKey': 1,
'findLast': 1,
'findLastFrom': 1,
'findLastIndex': 1,
'findLastIndexFrom': 1,
'findLastKey': 1,
'flatMap': 1,
'flatMapDeep': 1,
'flatMapDepth': 1,
'forEach': 1,
'forEachRight': 1,
'forIn': 1,
'forInRight': 1,
'forOwn': 1,
'forOwnRight': 1,
'map': 1,
'mapKeys': 1,
'mapValues': 1,
'partition': 1,
'reduce': 2,
'reduceRight': 2,
'reject': 1,
'remove': 1,
'some': 1,
'takeRightWhile': 1,
'takeWhile': 1,
'times': 1,
'transform': 2
};
/** Used to map method names to iteratee rearg configs. */
exports.iterateeRearg = {
'mapKeys': [1],
'reduceRight': [1, 0]
};
/** Used to map method names to rearg configs. */
exports.methodRearg = {
'assignInAllWith': [1, 0],
'assignInWith': [1, 2, 0],
'assignAllWith': [1, 0],
'assignWith': [1, 2, 0],
'differenceBy': [1, 2, 0],
'differenceWith': [1, 2, 0],
'getOr': [2, 1, 0],
'intersectionBy': [1, 2, 0],
'intersectionWith': [1, 2, 0],
'isEqualWith': [1, 2, 0],
'isMatchWith': [2, 1, 0],
'mergeAllWith': [1, 0],
'mergeWith': [1, 2, 0],
'padChars': [2, 1, 0],
'padCharsEnd': [2, 1, 0],
'padCharsStart': [2, 1, 0],
'pullAllBy': [2, 1, 0],
'pullAllWith': [2, 1, 0],
'rangeStep': [1, 2, 0],
'rangeStepRight': [1, 2, 0],
'setWith': [3, 1, 2, 0],
'sortedIndexBy': [2, 1, 0],
'sortedLastIndexBy': [2, 1, 0],
'unionBy': [1, 2, 0],
'unionWith': [1, 2, 0],
'updateWith': [3, 1, 2, 0],
'xorBy': [1, 2, 0],
'xorWith': [1, 2, 0],
'zipWith': [1, 2, 0]
};
/** Used to map method names to spread configs. */
exports.methodSpread = {
'assignAll': { 'start': 0 },
'assignAllWith': { 'start': 0 },
'assignInAll': { 'start': 0 },
'assignInAllWith': { 'start': 0 },
'defaultsAll': { 'start': 0 },
'defaultsDeepAll': { 'start': 0 },
'invokeArgs': { 'start': 2 },
'invokeArgsMap': { 'start': 2 },
'mergeAll': { 'start': 0 },
'mergeAllWith': { 'start': 0 },
'partial': { 'start': 1 },
'partialRight': { 'start': 1 },
'without': { 'start': 1 },
'zipAll': { 'start': 0 }
};
/** Used to identify methods which mutate arrays or objects. */
exports.mutate = {
'array': {
'fill': true,
'pull': true,
'pullAll': true,
'pullAllBy': true,
'pullAllWith': true,
'pullAt': true,
'remove': true,
'reverse': true
},
'object': {
'assign': true,
'assignAll': true,
'assignAllWith': true,
'assignIn': true,
'assignInAll': true,
'assignInAllWith': true,
'assignInWith': true,
'assignWith': true,
'defaults': true,
'defaultsAll': true,
'defaultsDeep': true,
'defaultsDeepAll': true,
'merge': true,
'mergeAll': true,
'mergeAllWith': true,
'mergeWith': true,
},
'set': {
'set': true,
'setWith': true,
'unset': true,
'update': true,
'updateWith': true
}
};
/** Used to track methods with placeholder support */
exports.placeholder = {
'bind': true,
'bindKey': true,
'curry': true,
'curryRight': true,
'partial': true,
'partialRight': true
};
/** Used to map real names to their aliases. */
exports.realToAlias = (function() {
var hasOwnProperty = Object.prototype.hasOwnProperty,
object = exports.aliasToReal,
result = {};
for (var key in object) {
var value = object[key];
if (hasOwnProperty.call(result, value)) {
result[value].push(key);
} else {
result[value] = [key];
}
}
return result;
}());
/** Used to map method names to other names. */
exports.remap = {
'assignAll': 'assign',
'assignAllWith': 'assignWith',
'assignInAll': 'assignIn',
'assignInAllWith': 'assignInWith',
'curryN': 'curry',
'curryRightN': 'curryRight',
'defaultsAll': 'defaults',
'defaultsDeepAll': 'defaultsDeep',
'findFrom': 'find',
'findIndexFrom': 'findIndex',
'findLastFrom': 'findLast',
'findLastIndexFrom': 'findLastIndex',
'getOr': 'get',
'includesFrom': 'includes',
'indexOfFrom': 'indexOf',
'invokeArgs': 'invoke',
'invokeArgsMap': 'invokeMap',
'lastIndexOfFrom': 'lastIndexOf',
'mergeAll': 'merge',
'mergeAllWith': 'mergeWith',
'padChars': 'pad',
'padCharsEnd': 'padEnd',
'padCharsStart': 'padStart',
'propertyOf': 'get',
'rangeStep': 'range',
'rangeStepRight': 'rangeRight',
'restFrom': 'rest',
'spreadFrom': 'spread',
'trimChars': 'trim',
'trimCharsEnd': 'trimEnd',
'trimCharsStart': 'trimStart',
'zipAll': 'zip'
};
/** Used to track methods that skip fixing their arity. */
exports.skipFixed = {
'castArray': true,
'flow': true,
'flowRight': true,
'iteratee': true,
'mixin': true,
'rearg': true,
'runInContext': true
};
/** Used to track methods that skip rearranging arguments. */
exports.skipRearg = {
'add': true,
'assign': true,
'assignIn': true,
'bind': true,
'bindKey': true,
'concat': true,
'difference': true,
'divide': true,
'eq': true,
'gt': true,
'gte': true,
'isEqual': true,
'lt': true,
'lte': true,
'matchesProperty': true,
'merge': true,
'multiply': true,
'overArgs': true,
'partial': true,
'partialRight': true,
'propertyOf': true,
'random': true,
'range': true,
'rangeRight': true,
'subtract': true,
'zip': true,
'zipObject': true,
'zipObjectDeep': true
};
/***/ },
/* 727 */
/*!********************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/fp/placeholder.js ***!
\********************************************************/
/***/ function(module, exports) {
/**
* The default argument placeholder value for methods.
*
* @type {Object}
*/
module.exports = {};
/***/ },
/* 728 */
/*!**************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/fp/_util.js ***!
\**************************************************/
/***/ function(module, exports, __webpack_require__) {
module.exports = {
'ary': __webpack_require__(/*! ../ary */ 729),
'assign': __webpack_require__(/*! ../_baseAssign */ 762),
'clone': __webpack_require__(/*! ../clone */ 766),
'curry': __webpack_require__(/*! ../curry */ 790),
'forEach': __webpack_require__(/*! ../_arrayEach */ 691),
'isArray': __webpack_require__(/*! ../isArray */ 539),
'isFunction': __webpack_require__(/*! ../isFunction */ 559),
'iteratee': __webpack_require__(/*! ../iteratee */ 791),
'keys': __webpack_require__(/*! ../_baseKeys */ 642),
'rearg': __webpack_require__(/*! ../rearg */ 792),
'toInteger': __webpack_require__(/*! ../toInteger */ 624),
'toPath': __webpack_require__(/*! ../toPath */ 795)
};
/***/ },
/* 729 */
/*!*********************************************!*\
!*** ./~/semantic-ui-react/~/lodash/ary.js ***!
\*********************************************/
/***/ function(module, exports, __webpack_require__) {
var createWrap = __webpack_require__(/*! ./_createWrap */ 730);
/** Used to compose bitmasks for function metadata. */
var WRAP_ARY_FLAG = 128;
/**
* Creates a function that invokes `func`, with up to `n` arguments,
* ignoring any additional arguments.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Function
* @param {Function} func The function to cap arguments for.
* @param {number} [n=func.length] The arity cap.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Function} Returns the new capped function.
* @example
*
* _.map(['6', '8', '10'], _.ary(parseInt, 1));
* // => [6, 8, 10]
*/
function ary(func, n, guard) {
n = guard ? undefined : n;
n = (func && n == null) ? func.length : n;
return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
}
module.exports = ary;
/***/ },
/* 730 */
/*!*****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_createWrap.js ***!
\*****************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseSetData = __webpack_require__(/*! ./_baseSetData */ 731),
createBind = __webpack_require__(/*! ./_createBind */ 733),
createCurry = __webpack_require__(/*! ./_createCurry */ 735),
createHybrid = __webpack_require__(/*! ./_createHybrid */ 736),
createPartial = __webpack_require__(/*! ./_createPartial */ 760),
getData = __webpack_require__(/*! ./_getData */ 744),
mergeData = __webpack_require__(/*! ./_mergeData */ 761),
setData = __webpack_require__(/*! ./_setData */ 752),
setWrapToString = __webpack_require__(/*! ./_setWrapToString */ 753),
toInteger = __webpack_require__(/*! ./toInteger */ 624);
/** Error message constants. */
var FUNC_ERROR_TEXT = 'Expected a function';
/** Used to compose bitmasks for function metadata. */
var WRAP_BIND_FLAG = 1,
WRAP_BIND_KEY_FLAG = 2,
WRAP_CURRY_FLAG = 8,
WRAP_CURRY_RIGHT_FLAG = 16,
WRAP_PARTIAL_FLAG = 32,
WRAP_PARTIAL_RIGHT_FLAG = 64;
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max;
/**
* Creates a function that either curries or invokes `func` with optional
* `this` binding and partially applied arguments.
*
* @private
* @param {Function|string} func The function or method name to wrap.
* @param {number} bitmask The bitmask flags.
* 1 - `_.bind`
* 2 - `_.bindKey`
* 4 - `_.curry` or `_.curryRight` of a bound function
* 8 - `_.curry`
* 16 - `_.curryRight`
* 32 - `_.partial`
* 64 - `_.partialRight`
* 128 - `_.rearg`
* 256 - `_.ary`
* 512 - `_.flip`
* @param {*} [thisArg] The `this` binding of `func`.
* @param {Array} [partials] The arguments to be partially applied.
* @param {Array} [holders] The `partials` placeholder indexes.
* @param {Array} [argPos] The argument positions of the new function.
* @param {number} [ary] The arity cap of `func`.
* @param {number} [arity] The arity of `func`.
* @returns {Function} Returns the new wrapped function.
*/
function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
if (!isBindKey && typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
var length = partials ? partials.length : 0;
if (!length) {
bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
partials = holders = undefined;
}
ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
arity = arity === undefined ? arity : toInteger(arity);
length -= holders ? holders.length : 0;
if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
var partialsRight = partials,
holdersRight = holders;
partials = holders = undefined;
}
var data = isBindKey ? undefined : getData(func);
var newData = [
func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
argPos, ary, arity
];
if (data) {
mergeData(newData, data);
}
func = newData[0];
bitmask = newData[1];
thisArg = newData[2];
partials = newData[3];
holders = newData[4];
arity = newData[9] = newData[9] === undefined
? (isBindKey ? 0 : func.length)
: nativeMax(newData[9] - length, 0);
if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
}
if (!bitmask || bitmask == WRAP_BIND_FLAG) {
var result = createBind(func, bitmask, thisArg);
} else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
result = createCurry(func, bitmask, arity);
} else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
result = createPartial(func, bitmask, thisArg, partials);
} else {
result = createHybrid.apply(undefined, newData);
}
var setter = data ? baseSetData : setData;
return setWrapToString(setter(result, newData), func, bitmask);
}
module.exports = createWrap;
/***/ },
/* 731 */
/*!******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_baseSetData.js ***!
\******************************************************/
/***/ function(module, exports, __webpack_require__) {
var identity = __webpack_require__(/*! ./identity */ 611),
metaMap = __webpack_require__(/*! ./_metaMap */ 732);
/**
* The base implementation of `setData` without support for hot loop shorting.
*
* @private
* @param {Function} func The function to associate metadata with.
* @param {*} data The metadata.
* @returns {Function} Returns `func`.
*/
var baseSetData = !metaMap ? identity : function(func, data) {
metaMap.set(func, data);
return func;
};
module.exports = baseSetData;
/***/ },
/* 732 */
/*!**************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_metaMap.js ***!
\**************************************************/
/***/ function(module, exports, __webpack_require__) {
var WeakMap = __webpack_require__(/*! ./_WeakMap */ 673);
/** Used to store function metadata. */
var metaMap = WeakMap && new WeakMap;
module.exports = metaMap;
/***/ },
/* 733 */
/*!*****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_createBind.js ***!
\*****************************************************/
/***/ function(module, exports, __webpack_require__) {
var createCtor = __webpack_require__(/*! ./_createCtor */ 734),
root = __webpack_require__(/*! ./_root */ 544);
/** Used to compose bitmasks for function metadata. */
var WRAP_BIND_FLAG = 1;
/**
* Creates a function that wraps `func` to invoke it with the optional `this`
* binding of `thisArg`.
*
* @private
* @param {Function} func The function to wrap.
* @param {number} bitmask The bitmask flags. See `createWrap` for more details.
* @param {*} [thisArg] The `this` binding of `func`.
* @returns {Function} Returns the new wrapped function.
*/
function createBind(func, bitmask, thisArg) {
var isBind = bitmask & WRAP_BIND_FLAG,
Ctor = createCtor(func);
function wrapper() {
var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
return fn.apply(isBind ? thisArg : this, arguments);
}
return wrapper;
}
module.exports = createBind;
/***/ },
/* 734 */
/*!*****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_createCtor.js ***!
\*****************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseCreate = __webpack_require__(/*! ./_baseCreate */ 714),
isObject = __webpack_require__(/*! ./isObject */ 560);
/**
* Creates a function that produces an instance of `Ctor` regardless of
* whether it was invoked as part of a `new` expression or by `call` or `apply`.
*
* @private
* @param {Function} Ctor The constructor to wrap.
* @returns {Function} Returns the new wrapped function.
*/
function createCtor(Ctor) {
return function() {
// Use a `switch` statement to work with class constructors. See
// http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
// for more details.
var args = arguments;
switch (args.length) {
case 0: return new Ctor;
case 1: return new Ctor(args[0]);
case 2: return new Ctor(args[0], args[1]);
case 3: return new Ctor(args[0], args[1], args[2]);
case 4: return new Ctor(args[0], args[1], args[2], args[3]);
case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
}
var thisBinding = baseCreate(Ctor.prototype),
result = Ctor.apply(thisBinding, args);
// Mimic the constructor's `return` behavior.
// See https://es5.github.io/#x13.2.2 for more details.
return isObject(result) ? result : thisBinding;
};
}
module.exports = createCtor;
/***/ },
/* 735 */
/*!******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_createCurry.js ***!
\******************************************************/
/***/ function(module, exports, __webpack_require__) {
var apply = __webpack_require__(/*! ./_apply */ 613),
createCtor = __webpack_require__(/*! ./_createCtor */ 734),
createHybrid = __webpack_require__(/*! ./_createHybrid */ 736),
createRecurry = __webpack_require__(/*! ./_createRecurry */ 740),
getHolder = __webpack_require__(/*! ./_getHolder */ 757),
replaceHolders = __webpack_require__(/*! ./_replaceHolders */ 759),
root = __webpack_require__(/*! ./_root */ 544);
/**
* Creates a function that wraps `func` to enable currying.
*
* @private
* @param {Function} func The function to wrap.
* @param {number} bitmask The bitmask flags. See `createWrap` for more details.
* @param {number} arity The arity of `func`.
* @returns {Function} Returns the new wrapped function.
*/
function createCurry(func, bitmask, arity) {
var Ctor = createCtor(func);
function wrapper() {
var length = arguments.length,
args = Array(length),
index = length,
placeholder = getHolder(wrapper);
while (index--) {
args[index] = arguments[index];
}
var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
? []
: replaceHolders(args, placeholder);
length -= holders.length;
if (length < arity) {
return createRecurry(
func, bitmask, createHybrid, wrapper.placeholder, undefined,
args, holders, undefined, undefined, arity - length);
}
var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
return apply(fn, this, args);
}
return wrapper;
}
module.exports = createCurry;
/***/ },
/* 736 */
/*!*******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_createHybrid.js ***!
\*******************************************************/
/***/ function(module, exports, __webpack_require__) {
var composeArgs = __webpack_require__(/*! ./_composeArgs */ 737),
composeArgsRight = __webpack_require__(/*! ./_composeArgsRight */ 738),
countHolders = __webpack_require__(/*! ./_countHolders */ 739),
createCtor = __webpack_require__(/*! ./_createCtor */ 734),
createRecurry = __webpack_require__(/*! ./_createRecurry */ 740),
getHolder = __webpack_require__(/*! ./_getHolder */ 757),
reorder = __webpack_require__(/*! ./_reorder */ 758),
replaceHolders = __webpack_require__(/*! ./_replaceHolders */ 759),
root = __webpack_require__(/*! ./_root */ 544);
/** Used to compose bitmasks for function metadata. */
var WRAP_BIND_FLAG = 1,
WRAP_BIND_KEY_FLAG = 2,
WRAP_CURRY_FLAG = 8,
WRAP_CURRY_RIGHT_FLAG = 16,
WRAP_ARY_FLAG = 128,
WRAP_FLIP_FLAG = 512;
/**
* Creates a function that wraps `func` to invoke it with optional `this`
* binding of `thisArg`, partial application, and currying.
*
* @private
* @param {Function|string} func The function or method name to wrap.
* @param {number} bitmask The bitmask flags. See `createWrap` for more details.
* @param {*} [thisArg] The `this` binding of `func`.
* @param {Array} [partials] The arguments to prepend to those provided to
* the new function.
* @param {Array} [holders] The `partials` placeholder indexes.
* @param {Array} [partialsRight] The arguments to append to those provided
* to the new function.
* @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
* @param {Array} [argPos] The argument positions of the new function.
* @param {number} [ary] The arity cap of `func`.
* @param {number} [arity] The arity of `func`.
* @returns {Function} Returns the new wrapped function.
*/
function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
var isAry = bitmask & WRAP_ARY_FLAG,
isBind = bitmask & WRAP_BIND_FLAG,
isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
isFlip = bitmask & WRAP_FLIP_FLAG,
Ctor = isBindKey ? undefined : createCtor(func);
function wrapper() {
var length = arguments.length,
args = Array(length),
index = length;
while (index--) {
args[index] = arguments[index];
}
if (isCurried) {
var placeholder = getHolder(wrapper),
holdersCount = countHolders(args, placeholder);
}
if (partials) {
args = composeArgs(args, partials, holders, isCurried);
}
if (partialsRight) {
args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
}
length -= holdersCount;
if (isCurried && length < arity) {
var newHolders = replaceHolders(args, placeholder);
return createRecurry(
func, bitmask, createHybrid, wrapper.placeholder, thisArg,
args, newHolders, argPos, ary, arity - length
);
}
var thisBinding = isBind ? thisArg : this,
fn = isBindKey ? thisBinding[func] : func;
length = args.length;
if (argPos) {
args = reorder(args, argPos);
} else if (isFlip && length > 1) {
args.reverse();
}
if (isAry && ary < length) {
args.length = ary;
}
if (this && this !== root && this instanceof wrapper) {
fn = Ctor || createCtor(fn);
}
return fn.apply(thisBinding, args);
}
return wrapper;
}
module.exports = createHybrid;
/***/ },
/* 737 */
/*!******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_composeArgs.js ***!
\******************************************************/
/***/ function(module, exports) {
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max;
/**
* Creates an array that is the composition of partially applied arguments,
* placeholders, and provided arguments into a single array of arguments.
*
* @private
* @param {Array} args The provided arguments.
* @param {Array} partials The arguments to prepend to those provided.
* @param {Array} holders The `partials` placeholder indexes.
* @params {boolean} [isCurried] Specify composing for a curried function.
* @returns {Array} Returns the new array of composed arguments.
*/
function composeArgs(args, partials, holders, isCurried) {
var argsIndex = -1,
argsLength = args.length,
holdersLength = holders.length,
leftIndex = -1,
leftLength = partials.length,
rangeLength = nativeMax(argsLength - holdersLength, 0),
result = Array(leftLength + rangeLength),
isUncurried = !isCurried;
while (++leftIndex < leftLength) {
result[leftIndex] = partials[leftIndex];
}
while (++argsIndex < holdersLength) {
if (isUncurried || argsIndex < argsLength) {
result[holders[argsIndex]] = args[argsIndex];
}
}
while (rangeLength--) {
result[leftIndex++] = args[argsIndex++];
}
return result;
}
module.exports = composeArgs;
/***/ },
/* 738 */
/*!***********************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_composeArgsRight.js ***!
\***********************************************************/
/***/ function(module, exports) {
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max;
/**
* This function is like `composeArgs` except that the arguments composition
* is tailored for `_.partialRight`.
*
* @private
* @param {Array} args The provided arguments.
* @param {Array} partials The arguments to append to those provided.
* @param {Array} holders The `partials` placeholder indexes.
* @params {boolean} [isCurried] Specify composing for a curried function.
* @returns {Array} Returns the new array of composed arguments.
*/
function composeArgsRight(args, partials, holders, isCurried) {
var argsIndex = -1,
argsLength = args.length,
holdersIndex = -1,
holdersLength = holders.length,
rightIndex = -1,
rightLength = partials.length,
rangeLength = nativeMax(argsLength - holdersLength, 0),
result = Array(rangeLength + rightLength),
isUncurried = !isCurried;
while (++argsIndex < rangeLength) {
result[argsIndex] = args[argsIndex];
}
var offset = argsIndex;
while (++rightIndex < rightLength) {
result[offset + rightIndex] = partials[rightIndex];
}
while (++holdersIndex < holdersLength) {
if (isUncurried || argsIndex < argsLength) {
result[offset + holders[holdersIndex]] = args[argsIndex++];
}
}
return result;
}
module.exports = composeArgsRight;
/***/ },
/* 739 */
/*!*******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_countHolders.js ***!
\*******************************************************/
/***/ function(module, exports) {
/**
* Gets the number of `placeholder` occurrences in `array`.
*
* @private
* @param {Array} array The array to inspect.
* @param {*} placeholder The placeholder to search for.
* @returns {number} Returns the placeholder count.
*/
function countHolders(array, placeholder) {
var length = array.length,
result = 0;
while (length--) {
if (array[length] === placeholder) {
++result;
}
}
return result;
}
module.exports = countHolders;
/***/ },
/* 740 */
/*!********************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_createRecurry.js ***!
\********************************************************/
/***/ function(module, exports, __webpack_require__) {
var isLaziable = __webpack_require__(/*! ./_isLaziable */ 741),
setData = __webpack_require__(/*! ./_setData */ 752),
setWrapToString = __webpack_require__(/*! ./_setWrapToString */ 753);
/** Used to compose bitmasks for function metadata. */
var WRAP_BIND_FLAG = 1,
WRAP_BIND_KEY_FLAG = 2,
WRAP_CURRY_BOUND_FLAG = 4,
WRAP_CURRY_FLAG = 8,
WRAP_PARTIAL_FLAG = 32,
WRAP_PARTIAL_RIGHT_FLAG = 64;
/**
* Creates a function that wraps `func` to continue currying.
*
* @private
* @param {Function} func The function to wrap.
* @param {number} bitmask The bitmask flags. See `createWrap` for more details.
* @param {Function} wrapFunc The function to create the `func` wrapper.
* @param {*} placeholder The placeholder value.
* @param {*} [thisArg] The `this` binding of `func`.
* @param {Array} [partials] The arguments to prepend to those provided to
* the new function.
* @param {Array} [holders] The `partials` placeholder indexes.
* @param {Array} [argPos] The argument positions of the new function.
* @param {number} [ary] The arity cap of `func`.
* @param {number} [arity] The arity of `func`.
* @returns {Function} Returns the new wrapped function.
*/
function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
var isCurry = bitmask & WRAP_CURRY_FLAG,
newHolders = isCurry ? holders : undefined,
newHoldersRight = isCurry ? undefined : holders,
newPartials = isCurry ? partials : undefined,
newPartialsRight = isCurry ? undefined : partials;
bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
}
var newData = [
func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
newHoldersRight, argPos, ary, arity
];
var result = wrapFunc.apply(undefined, newData);
if (isLaziable(func)) {
setData(result, newData);
}
result.placeholder = placeholder;
return setWrapToString(result, func, bitmask);
}
module.exports = createRecurry;
/***/ },
/* 741 */
/*!*****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_isLaziable.js ***!
\*****************************************************/
/***/ function(module, exports, __webpack_require__) {
var LazyWrapper = __webpack_require__(/*! ./_LazyWrapper */ 742),
getData = __webpack_require__(/*! ./_getData */ 744),
getFuncName = __webpack_require__(/*! ./_getFuncName */ 746),
lodash = __webpack_require__(/*! ./wrapperLodash */ 748);
/**
* Checks if `func` has a lazy counterpart.
*
* @private
* @param {Function} func The function to check.
* @returns {boolean} Returns `true` if `func` has a lazy counterpart,
* else `false`.
*/
function isLaziable(func) {
var funcName = getFuncName(func),
other = lodash[funcName];
if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
return false;
}
if (func === other) {
return true;
}
var data = getData(other);
return !!data && func === data[0];
}
module.exports = isLaziable;
/***/ },
/* 742 */
/*!******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_LazyWrapper.js ***!
\******************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseCreate = __webpack_require__(/*! ./_baseCreate */ 714),
baseLodash = __webpack_require__(/*! ./_baseLodash */ 743);
/** Used as references for the maximum length and index of an array. */
var MAX_ARRAY_LENGTH = 4294967295;
/**
* Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
*
* @private
* @constructor
* @param {*} value The value to wrap.
*/
function LazyWrapper(value) {
this.__wrapped__ = value;
this.__actions__ = [];
this.__dir__ = 1;
this.__filtered__ = false;
this.__iteratees__ = [];
this.__takeCount__ = MAX_ARRAY_LENGTH;
this.__views__ = [];
}
// Ensure `LazyWrapper` is an instance of `baseLodash`.
LazyWrapper.prototype = baseCreate(baseLodash.prototype);
LazyWrapper.prototype.constructor = LazyWrapper;
module.exports = LazyWrapper;
/***/ },
/* 743 */
/*!*****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_baseLodash.js ***!
\*****************************************************/
/***/ function(module, exports) {
/**
* The function whose prototype chain sequence wrappers inherit from.
*
* @private
*/
function baseLodash() {
// No operation performed.
}
module.exports = baseLodash;
/***/ },
/* 744 */
/*!**************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_getData.js ***!
\**************************************************/
/***/ function(module, exports, __webpack_require__) {
var metaMap = __webpack_require__(/*! ./_metaMap */ 732),
noop = __webpack_require__(/*! ./noop */ 745);
/**
* Gets metadata for `func`.
*
* @private
* @param {Function} func The function to query.
* @returns {*} Returns the metadata for `func`.
*/
var getData = !metaMap ? noop : function(func) {
return metaMap.get(func);
};
module.exports = getData;
/***/ },
/* 745 */
/*!**********************************************!*\
!*** ./~/semantic-ui-react/~/lodash/noop.js ***!
\**********************************************/
/***/ function(module, exports) {
/**
* This method returns `undefined`.
*
* @static
* @memberOf _
* @since 2.3.0
* @category Util
* @example
*
* _.times(2, _.noop);
* // => [undefined, undefined]
*/
function noop() {
// No operation performed.
}
module.exports = noop;
/***/ },
/* 746 */
/*!******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_getFuncName.js ***!
\******************************************************/
/***/ function(module, exports, __webpack_require__) {
var realNames = __webpack_require__(/*! ./_realNames */ 747);
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Gets the name of `func`.
*
* @private
* @param {Function} func The function to query.
* @returns {string} Returns the function name.
*/
function getFuncName(func) {
var result = (func.name + ''),
array = realNames[result],
length = hasOwnProperty.call(realNames, result) ? array.length : 0;
while (length--) {
var data = array[length],
otherFunc = data.func;
if (otherFunc == null || otherFunc == func) {
return data.name;
}
}
return result;
}
module.exports = getFuncName;
/***/ },
/* 747 */
/*!****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_realNames.js ***!
\****************************************************/
/***/ function(module, exports) {
/** Used to lookup unminified function names. */
var realNames = {};
module.exports = realNames;
/***/ },
/* 748 */
/*!*******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/wrapperLodash.js ***!
\*******************************************************/
/***/ function(module, exports, __webpack_require__) {
var LazyWrapper = __webpack_require__(/*! ./_LazyWrapper */ 742),
LodashWrapper = __webpack_require__(/*! ./_LodashWrapper */ 749),
baseLodash = __webpack_require__(/*! ./_baseLodash */ 743),
isArray = __webpack_require__(/*! ./isArray */ 539),
isObjectLike = __webpack_require__(/*! ./isObjectLike */ 548),
wrapperClone = __webpack_require__(/*! ./_wrapperClone */ 750);
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Creates a `lodash` object which wraps `value` to enable implicit method
* chain sequences. Methods that operate on and return arrays, collections,
* and functions can be chained together. Methods that retrieve a single value
* or may return a primitive value will automatically end the chain sequence
* and return the unwrapped value. Otherwise, the value must be unwrapped
* with `_#value`.
*
* Explicit chain sequences, which must be unwrapped with `_#value`, may be
* enabled using `_.chain`.
*
* The execution of chained methods is lazy, that is, it's deferred until
* `_#value` is implicitly or explicitly called.
*
* Lazy evaluation allows several methods to support shortcut fusion.
* Shortcut fusion is an optimization to merge iteratee calls; this avoids
* the creation of intermediate arrays and can greatly reduce the number of
* iteratee executions. Sections of a chain sequence qualify for shortcut
* fusion if the section is applied to an array and iteratees accept only
* one argument. The heuristic for whether a section qualifies for shortcut
* fusion is subject to change.
*
* Chaining is supported in custom builds as long as the `_#value` method is
* directly or indirectly included in the build.
*
* In addition to lodash methods, wrappers have `Array` and `String` methods.
*
* The wrapper `Array` methods are:
* `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
*
* The wrapper `String` methods are:
* `replace` and `split`
*
* The wrapper methods that support shortcut fusion are:
* `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
* `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
* `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
*
* The chainable wrapper methods are:
* `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
* `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
* `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
* `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
* `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
* `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
* `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
* `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
* `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
* `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
* `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
* `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
* `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
* `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
* `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
* `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
* `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
* `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
* `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
* `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
* `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
* `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
* `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
* `zipObject`, `zipObjectDeep`, and `zipWith`
*
* The wrapper methods that are **not** chainable by default are:
* `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
* `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
* `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
* `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
* `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
* `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
* `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
* `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
* `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
* `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
* `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
* `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
* `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
* `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
* `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
* `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
* `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
* `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
* `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
* `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
* `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
* `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
* `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
* `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
* `upperFirst`, `value`, and `words`
*
* @name _
* @constructor
* @category Seq
* @param {*} value The value to wrap in a `lodash` instance.
* @returns {Object} Returns the new `lodash` wrapper instance.
* @example
*
* function square(n) {
* return n * n;
* }
*
* var wrapped = _([1, 2, 3]);
*
* // Returns an unwrapped value.
* wrapped.reduce(_.add);
* // => 6
*
* // Returns a wrapped value.
* var squares = wrapped.map(square);
*
* _.isArray(squares);
* // => false
*
* _.isArray(squares.value());
* // => true
*/
function lodash(value) {
if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
if (value instanceof LodashWrapper) {
return value;
}
if (hasOwnProperty.call(value, '__wrapped__')) {
return wrapperClone(value);
}
}
return new LodashWrapper(value);
}
// Ensure wrappers are instances of `baseLodash`.
lodash.prototype = baseLodash.prototype;
lodash.prototype.constructor = lodash;
module.exports = lodash;
/***/ },
/* 749 */
/*!********************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_LodashWrapper.js ***!
\********************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseCreate = __webpack_require__(/*! ./_baseCreate */ 714),
baseLodash = __webpack_require__(/*! ./_baseLodash */ 743);
/**
* The base constructor for creating `lodash` wrapper objects.
*
* @private
* @param {*} value The value to wrap.
* @param {boolean} [chainAll] Enable explicit method chain sequences.
*/
function LodashWrapper(value, chainAll) {
this.__wrapped__ = value;
this.__actions__ = [];
this.__chain__ = !!chainAll;
this.__index__ = 0;
this.__values__ = undefined;
}
LodashWrapper.prototype = baseCreate(baseLodash.prototype);
LodashWrapper.prototype.constructor = LodashWrapper;
module.exports = LodashWrapper;
/***/ },
/* 750 */
/*!*******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_wrapperClone.js ***!
\*******************************************************/
/***/ function(module, exports, __webpack_require__) {
var LazyWrapper = __webpack_require__(/*! ./_LazyWrapper */ 742),
LodashWrapper = __webpack_require__(/*! ./_LodashWrapper */ 749),
copyArray = __webpack_require__(/*! ./_copyArray */ 751);
/**
* Creates a clone of `wrapper`.
*
* @private
* @param {Object} wrapper The wrapper to clone.
* @returns {Object} Returns the cloned wrapper.
*/
function wrapperClone(wrapper) {
if (wrapper instanceof LazyWrapper) {
return wrapper.clone();
}
var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
result.__actions__ = copyArray(wrapper.__actions__);
result.__index__ = wrapper.__index__;
result.__values__ = wrapper.__values__;
return result;
}
module.exports = wrapperClone;
/***/ },
/* 751 */
/*!****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_copyArray.js ***!
\****************************************************/
/***/ function(module, exports) {
/**
* Copies the values of `source` to `array`.
*
* @private
* @param {Array} source The array to copy values from.
* @param {Array} [array=[]] The array to copy values to.
* @returns {Array} Returns `array`.
*/
function copyArray(source, array) {
var index = -1,
length = source.length;
array || (array = Array(length));
while (++index < length) {
array[index] = source[index];
}
return array;
}
module.exports = copyArray;
/***/ },
/* 752 */
/*!**************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_setData.js ***!
\**************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseSetData = __webpack_require__(/*! ./_baseSetData */ 731),
shortOut = __webpack_require__(/*! ./_shortOut */ 618);
/**
* Sets metadata for `func`.
*
* **Note:** If this function becomes hot, i.e. is invoked a lot in a short
* period of time, it will trip its breaker and transition to an identity
* function to avoid garbage collection pauses in V8. See
* [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
* for more details.
*
* @private
* @param {Function} func The function to associate metadata with.
* @param {*} data The metadata.
* @returns {Function} Returns `func`.
*/
var setData = shortOut(baseSetData);
module.exports = setData;
/***/ },
/* 753 */
/*!**********************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_setWrapToString.js ***!
\**********************************************************/
/***/ function(module, exports, __webpack_require__) {
var getWrapDetails = __webpack_require__(/*! ./_getWrapDetails */ 754),
insertWrapDetails = __webpack_require__(/*! ./_insertWrapDetails */ 755),
setToString = __webpack_require__(/*! ./_setToString */ 614),
updateWrapDetails = __webpack_require__(/*! ./_updateWrapDetails */ 756);
/**
* Sets the `toString` method of `wrapper` to mimic the source of `reference`
* with wrapper details in a comment at the top of the source body.
*
* @private
* @param {Function} wrapper The function to modify.
* @param {Function} reference The reference function.
* @param {number} bitmask The bitmask flags. See `createWrap` for more details.
* @returns {Function} Returns `wrapper`.
*/
function setWrapToString(wrapper, reference, bitmask) {
var source = (reference + '');
return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
}
module.exports = setWrapToString;
/***/ },
/* 754 */
/*!*********************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_getWrapDetails.js ***!
\*********************************************************/
/***/ function(module, exports) {
/** Used to match wrap detail comments. */
var reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
reSplitDetails = /,? & /;
/**
* Extracts wrapper details from the `source` body comment.
*
* @private
* @param {string} source The source to inspect.
* @returns {Array} Returns the wrapper details.
*/
function getWrapDetails(source) {
var match = source.match(reWrapDetails);
return match ? match[1].split(reSplitDetails) : [];
}
module.exports = getWrapDetails;
/***/ },
/* 755 */
/*!************************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_insertWrapDetails.js ***!
\************************************************************/
/***/ function(module, exports) {
/** Used to match wrap detail comments. */
var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;
/**
* Inserts wrapper `details` in a comment at the top of the `source` body.
*
* @private
* @param {string} source The source to modify.
* @returns {Array} details The details to insert.
* @returns {string} Returns the modified source.
*/
function insertWrapDetails(source, details) {
var length = details.length;
if (!length) {
return source;
}
var lastIndex = length - 1;
details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
details = details.join(length > 2 ? ', ' : ' ');
return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
}
module.exports = insertWrapDetails;
/***/ },
/* 756 */
/*!************************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_updateWrapDetails.js ***!
\************************************************************/
/***/ function(module, exports, __webpack_require__) {
var arrayEach = __webpack_require__(/*! ./_arrayEach */ 691),
arrayIncludes = __webpack_require__(/*! ./_arrayIncludes */ 599);
/** Used to compose bitmasks for function metadata. */
var WRAP_BIND_FLAG = 1,
WRAP_BIND_KEY_FLAG = 2,
WRAP_CURRY_FLAG = 8,
WRAP_CURRY_RIGHT_FLAG = 16,
WRAP_PARTIAL_FLAG = 32,
WRAP_PARTIAL_RIGHT_FLAG = 64,
WRAP_ARY_FLAG = 128,
WRAP_REARG_FLAG = 256,
WRAP_FLIP_FLAG = 512;
/** Used to associate wrap methods with their bit flags. */
var wrapFlags = [
['ary', WRAP_ARY_FLAG],
['bind', WRAP_BIND_FLAG],
['bindKey', WRAP_BIND_KEY_FLAG],
['curry', WRAP_CURRY_FLAG],
['curryRight', WRAP_CURRY_RIGHT_FLAG],
['flip', WRAP_FLIP_FLAG],
['partial', WRAP_PARTIAL_FLAG],
['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
['rearg', WRAP_REARG_FLAG]
];
/**
* Updates wrapper `details` based on `bitmask` flags.
*
* @private
* @returns {Array} details The details to modify.
* @param {number} bitmask The bitmask flags. See `createWrap` for more details.
* @returns {Array} Returns `details`.
*/
function updateWrapDetails(details, bitmask) {
arrayEach(wrapFlags, function(pair) {
var value = '_.' + pair[0];
if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
details.push(value);
}
});
return details.sort();
}
module.exports = updateWrapDetails;
/***/ },
/* 757 */
/*!****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_getHolder.js ***!
\****************************************************/
/***/ function(module, exports) {
/**
* Gets the argument placeholder value for `func`.
*
* @private
* @param {Function} func The function to inspect.
* @returns {*} Returns the placeholder value.
*/
function getHolder(func) {
var object = func;
return object.placeholder;
}
module.exports = getHolder;
/***/ },
/* 758 */
/*!**************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_reorder.js ***!
\**************************************************/
/***/ function(module, exports, __webpack_require__) {
var copyArray = __webpack_require__(/*! ./_copyArray */ 751),
isIndex = __webpack_require__(/*! ./_isIndex */ 589);
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMin = Math.min;
/**
* Reorder `array` according to the specified indexes where the element at
* the first index is assigned as the first element, the element at
* the second index is assigned as the second element, and so on.
*
* @private
* @param {Array} array The array to reorder.
* @param {Array} indexes The arranged array indexes.
* @returns {Array} Returns `array`.
*/
function reorder(array, indexes) {
var arrLength = array.length,
length = nativeMin(indexes.length, arrLength),
oldArray = copyArray(array);
while (length--) {
var index = indexes[length];
array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
}
return array;
}
module.exports = reorder;
/***/ },
/* 759 */
/*!*********************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_replaceHolders.js ***!
\*********************************************************/
/***/ function(module, exports) {
/** Used as the internal argument placeholder. */
var PLACEHOLDER = '__lodash_placeholder__';
/**
* Replaces all `placeholder` elements in `array` with an internal placeholder
* and returns an array of their indexes.
*
* @private
* @param {Array} array The array to modify.
* @param {*} placeholder The placeholder to replace.
* @returns {Array} Returns the new array of placeholder indexes.
*/
function replaceHolders(array, placeholder) {
var index = -1,
length = array.length,
resIndex = 0,
result = [];
while (++index < length) {
var value = array[index];
if (value === placeholder || value === PLACEHOLDER) {
array[index] = PLACEHOLDER;
result[resIndex++] = index;
}
}
return result;
}
module.exports = replaceHolders;
/***/ },
/* 760 */
/*!********************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_createPartial.js ***!
\********************************************************/
/***/ function(module, exports, __webpack_require__) {
var apply = __webpack_require__(/*! ./_apply */ 613),
createCtor = __webpack_require__(/*! ./_createCtor */ 734),
root = __webpack_require__(/*! ./_root */ 544);
/** Used to compose bitmasks for function metadata. */
var WRAP_BIND_FLAG = 1;
/**
* Creates a function that wraps `func` to invoke it with the `this` binding
* of `thisArg` and `partials` prepended to the arguments it receives.
*
* @private
* @param {Function} func The function to wrap.
* @param {number} bitmask The bitmask flags. See `createWrap` for more details.
* @param {*} thisArg The `this` binding of `func`.
* @param {Array} partials The arguments to prepend to those provided to
* the new function.
* @returns {Function} Returns the new wrapped function.
*/
function createPartial(func, bitmask, thisArg, partials) {
var isBind = bitmask & WRAP_BIND_FLAG,
Ctor = createCtor(func);
function wrapper() {
var argsIndex = -1,
argsLength = arguments.length,
leftIndex = -1,
leftLength = partials.length,
args = Array(leftLength + argsLength),
fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
while (++leftIndex < leftLength) {
args[leftIndex] = partials[leftIndex];
}
while (argsLength--) {
args[leftIndex++] = arguments[++argsIndex];
}
return apply(fn, isBind ? thisArg : this, args);
}
return wrapper;
}
module.exports = createPartial;
/***/ },
/* 761 */
/*!****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_mergeData.js ***!
\****************************************************/
/***/ function(module, exports, __webpack_require__) {
var composeArgs = __webpack_require__(/*! ./_composeArgs */ 737),
composeArgsRight = __webpack_require__(/*! ./_composeArgsRight */ 738),
replaceHolders = __webpack_require__(/*! ./_replaceHolders */ 759);
/** Used as the internal argument placeholder. */
var PLACEHOLDER = '__lodash_placeholder__';
/** Used to compose bitmasks for function metadata. */
var WRAP_BIND_FLAG = 1,
WRAP_BIND_KEY_FLAG = 2,
WRAP_CURRY_BOUND_FLAG = 4,
WRAP_CURRY_FLAG = 8,
WRAP_ARY_FLAG = 128,
WRAP_REARG_FLAG = 256;
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMin = Math.min;
/**
* Merges the function metadata of `source` into `data`.
*
* Merging metadata reduces the number of wrappers used to invoke a function.
* This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
* may be applied regardless of execution order. Methods like `_.ary` and
* `_.rearg` modify function arguments, making the order in which they are
* executed important, preventing the merging of metadata. However, we make
* an exception for a safe combined case where curried functions have `_.ary`
* and or `_.rearg` applied.
*
* @private
* @param {Array} data The destination metadata.
* @param {Array} source The source metadata.
* @returns {Array} Returns `data`.
*/
function mergeData(data, source) {
var bitmask = data[1],
srcBitmask = source[1],
newBitmask = bitmask | srcBitmask,
isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
var isCombo =
((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
// Exit early if metadata can't be merged.
if (!(isCommon || isCombo)) {
return data;
}
// Use source `thisArg` if available.
if (srcBitmask & WRAP_BIND_FLAG) {
data[2] = source[2];
// Set when currying a bound function.
newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
}
// Compose partial arguments.
var value = source[3];
if (value) {
var partials = data[3];
data[3] = partials ? composeArgs(partials, value, source[4]) : value;
data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
}
// Compose partial right arguments.
value = source[5];
if (value) {
partials = data[5];
data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
}
// Use source `argPos` if available.
value = source[7];
if (value) {
data[7] = value;
}
// Use source `ary` if it's smaller.
if (srcBitmask & WRAP_ARY_FLAG) {
data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
}
// Use source `arity` if one is not provided.
if (data[9] == null) {
data[9] = source[9];
}
// Use source `func` and merge bitmasks.
data[0] = source[0];
data[1] = newBitmask;
return data;
}
module.exports = mergeData;
/***/ },
/* 762 */
/*!*****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_baseAssign.js ***!
\*****************************************************/
/***/ function(module, exports, __webpack_require__) {
var copyObject = __webpack_require__(/*! ./_copyObject */ 763),
keys = __webpack_require__(/*! ./keys */ 634);
/**
* The base implementation of `_.assign` without support for multiple sources
* or `customizer` functions.
*
* @private
* @param {Object} object The destination object.
* @param {Object} source The source object.
* @returns {Object} Returns `object`.
*/
function baseAssign(object, source) {
return object && copyObject(source, keys(source), object);
}
module.exports = baseAssign;
/***/ },
/* 763 */
/*!*****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_copyObject.js ***!
\*****************************************************/
/***/ function(module, exports, __webpack_require__) {
var assignValue = __webpack_require__(/*! ./_assignValue */ 764),
baseAssignValue = __webpack_require__(/*! ./_baseAssignValue */ 765);
/**
* Copies properties of `source` to `object`.
*
* @private
* @param {Object} source The object to copy properties from.
* @param {Array} props The property identifiers to copy.
* @param {Object} [object={}] The object to copy properties to.
* @param {Function} [customizer] The function to customize copied values.
* @returns {Object} Returns `object`.
*/
function copyObject(source, props, object, customizer) {
var isNew = !object;
object || (object = {});
var index = -1,
length = props.length;
while (++index < length) {
var key = props[index];
var newValue = customizer
? customizer(object[key], source[key], key, object, source)
: undefined;
if (newValue === undefined) {
newValue = source[key];
}
if (isNew) {
baseAssignValue(object, key, newValue);
} else {
assignValue(object, key, newValue);
}
}
return object;
}
module.exports = copyObject;
/***/ },
/* 764 */
/*!******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_assignValue.js ***!
\******************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseAssignValue = __webpack_require__(/*! ./_baseAssignValue */ 765),
eq = __webpack_require__(/*! ./eq */ 573);
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Assigns `value` to `key` of `object` if the existing value is not equivalent
* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons.
*
* @private
* @param {Object} object The object to modify.
* @param {string} key The key of the property to assign.
* @param {*} value The value to assign.
*/
function assignValue(object, key, value) {
var objValue = object[key];
if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
(value === undefined && !(key in object))) {
baseAssignValue(object, key, value);
}
}
module.exports = assignValue;
/***/ },
/* 765 */
/*!**********************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_baseAssignValue.js ***!
\**********************************************************/
/***/ function(module, exports, __webpack_require__) {
var defineProperty = __webpack_require__(/*! ./_defineProperty */ 617);
/**
* The base implementation of `assignValue` and `assignMergeValue` without
* value checks.
*
* @private
* @param {Object} object The object to modify.
* @param {string} key The key of the property to assign.
* @param {*} value The value to assign.
*/
function baseAssignValue(object, key, value) {
if (key == '__proto__' && defineProperty) {
defineProperty(object, key, {
'configurable': true,
'enumerable': true,
'value': value,
'writable': true
});
} else {
object[key] = value;
}
}
module.exports = baseAssignValue;
/***/ },
/* 766 */
/*!***********************************************!*\
!*** ./~/semantic-ui-react/~/lodash/clone.js ***!
\***********************************************/
/***/ function(module, exports, __webpack_require__) {
var baseClone = __webpack_require__(/*! ./_baseClone */ 767);
/** Used to compose bitmasks for cloning. */
var CLONE_SYMBOLS_FLAG = 4;
/**
* Creates a shallow clone of `value`.
*
* **Note:** This method is loosely based on the
* [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
* and supports cloning arrays, array buffers, booleans, date objects, maps,
* numbers, `Object` objects, regexes, sets, strings, symbols, and typed
* arrays. The own enumerable properties of `arguments` objects are cloned
* as plain objects. An empty object is returned for uncloneable values such
* as error objects, functions, DOM nodes, and WeakMaps.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to clone.
* @returns {*} Returns the cloned value.
* @see _.cloneDeep
* @example
*
* var objects = [{ 'a': 1 }, { 'b': 2 }];
*
* var shallow = _.clone(objects);
* console.log(shallow[0] === objects[0]);
* // => true
*/
function clone(value) {
return baseClone(value, CLONE_SYMBOLS_FLAG);
}
module.exports = clone;
/***/ },
/* 767 */
/*!****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_baseClone.js ***!
\****************************************************/
/***/ function(module, exports, __webpack_require__) {
var Stack = __webpack_require__(/*! ./_Stack */ 650),
arrayEach = __webpack_require__(/*! ./_arrayEach */ 691),
assignValue = __webpack_require__(/*! ./_assignValue */ 764),
baseAssign = __webpack_require__(/*! ./_baseAssign */ 762),
baseAssignIn = __webpack_require__(/*! ./_baseAssignIn */ 768),
cloneBuffer = __webpack_require__(/*! ./_cloneBuffer */ 772),
copyArray = __webpack_require__(/*! ./_copyArray */ 751),
copySymbols = __webpack_require__(/*! ./_copySymbols */ 773),
copySymbolsIn = __webpack_require__(/*! ./_copySymbolsIn */ 774),
getAllKeys = __webpack_require__(/*! ./_getAllKeys */ 665),
getAllKeysIn = __webpack_require__(/*! ./_getAllKeysIn */ 776),
getTag = __webpack_require__(/*! ./_getTag */ 669),
initCloneArray = __webpack_require__(/*! ./_initCloneArray */ 777),
initCloneByTag = __webpack_require__(/*! ./_initCloneByTag */ 778),
initCloneObject = __webpack_require__(/*! ./_initCloneObject */ 789),
isArray = __webpack_require__(/*! ./isArray */ 539),
isBuffer = __webpack_require__(/*! ./isBuffer */ 637),
isObject = __webpack_require__(/*! ./isObject */ 560),
keys = __webpack_require__(/*! ./keys */ 634);
/** Used to compose bitmasks for cloning. */
var CLONE_DEEP_FLAG = 1,
CLONE_FLAT_FLAG = 2,
CLONE_SYMBOLS_FLAG = 4;
/** `Object#toString` result references. */
var argsTag = '[object Arguments]',
arrayTag = '[object Array]',
boolTag = '[object Boolean]',
dateTag = '[object Date]',
errorTag = '[object Error]',
funcTag = '[object Function]',
genTag = '[object GeneratorFunction]',
mapTag = '[object Map]',
numberTag = '[object Number]',
objectTag = '[object Object]',
regexpTag = '[object RegExp]',
setTag = '[object Set]',
stringTag = '[object String]',
symbolTag = '[object Symbol]',
weakMapTag = '[object WeakMap]';
var arrayBufferTag = '[object ArrayBuffer]',
dataViewTag = '[object DataView]',
float32Tag = '[object Float32Array]',
float64Tag = '[object Float64Array]',
int8Tag = '[object Int8Array]',
int16Tag = '[object Int16Array]',
int32Tag = '[object Int32Array]',
uint8Tag = '[object Uint8Array]',
uint8ClampedTag = '[object Uint8ClampedArray]',
uint16Tag = '[object Uint16Array]',
uint32Tag = '[object Uint32Array]';
/** Used to identify `toStringTag` values supported by `_.clone`. */
var cloneableTags = {};
cloneableTags[argsTag] = cloneableTags[arrayTag] =
cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
cloneableTags[boolTag] = cloneableTags[dateTag] =
cloneableTags[float32Tag] = cloneableTags[float64Tag] =
cloneableTags[int8Tag] = cloneableTags[int16Tag] =
cloneableTags[int32Tag] = cloneableTags[mapTag] =
cloneableTags[numberTag] = cloneableTags[objectTag] =
cloneableTags[regexpTag] = cloneableTags[setTag] =
cloneableTags[stringTag] = cloneableTags[symbolTag] =
cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
cloneableTags[errorTag] = cloneableTags[funcTag] =
cloneableTags[weakMapTag] = false;
/**
* The base implementation of `_.clone` and `_.cloneDeep` which tracks
* traversed objects.
*
* @private
* @param {*} value The value to clone.
* @param {boolean} bitmask The bitmask flags.
* 1 - Deep clone
* 2 - Flatten inherited properties
* 4 - Clone symbols
* @param {Function} [customizer] The function to customize cloning.
* @param {string} [key] The key of `value`.
* @param {Object} [object] The parent object of `value`.
* @param {Object} [stack] Tracks traversed objects and their clone counterparts.
* @returns {*} Returns the cloned value.
*/
function baseClone(value, bitmask, customizer, key, object, stack) {
var result,
isDeep = bitmask & CLONE_DEEP_FLAG,
isFlat = bitmask & CLONE_FLAT_FLAG,
isFull = bitmask & CLONE_SYMBOLS_FLAG;
if (customizer) {
result = object ? customizer(value, key, object, stack) : customizer(value);
}
if (result !== undefined) {
return result;
}
if (!isObject(value)) {
return value;
}
var isArr = isArray(value);
if (isArr) {
result = initCloneArray(value);
if (!isDeep) {
return copyArray(value, result);
}
} else {
var tag = getTag(value),
isFunc = tag == funcTag || tag == genTag;
if (isBuffer(value)) {
return cloneBuffer(value, isDeep);
}
if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
result = (isFlat || isFunc) ? {} : initCloneObject(value);
if (!isDeep) {
return isFlat
? copySymbolsIn(value, baseAssignIn(result, value))
: copySymbols(value, baseAssign(result, value));
}
} else {
if (!cloneableTags[tag]) {
return object ? value : {};
}
result = initCloneByTag(value, tag, baseClone, isDeep);
}
}
// Check for circular references and return its corresponding clone.
stack || (stack = new Stack);
var stacked = stack.get(value);
if (stacked) {
return stacked;
}
stack.set(value, result);
var keysFunc = isFull
? (isFlat ? getAllKeysIn : getAllKeys)
: (isFlat ? keysIn : keys);
var props = isArr ? undefined : keysFunc(value);
arrayEach(props || value, function(subValue, key) {
if (props) {
key = subValue;
subValue = value[key];
}
// Recursively populate clone (susceptible to call stack limits).
assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
});
return result;
}
module.exports = baseClone;
/***/ },
/* 768 */
/*!*******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_baseAssignIn.js ***!
\*******************************************************/
/***/ function(module, exports, __webpack_require__) {
var copyObject = __webpack_require__(/*! ./_copyObject */ 763),
keysIn = __webpack_require__(/*! ./keysIn */ 769);
/**
* The base implementation of `_.assignIn` without support for multiple sources
* or `customizer` functions.
*
* @private
* @param {Object} object The destination object.
* @param {Object} source The source object.
* @returns {Object} Returns `object`.
*/
function baseAssignIn(object, source) {
return object && copyObject(source, keysIn(source), object);
}
module.exports = baseAssignIn;
/***/ },
/* 769 */
/*!************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/keysIn.js ***!
\************************************************/
/***/ function(module, exports, __webpack_require__) {
var arrayLikeKeys = __webpack_require__(/*! ./_arrayLikeKeys */ 635),
baseKeysIn = __webpack_require__(/*! ./_baseKeysIn */ 770),
isArrayLike = __webpack_require__(/*! ./isArrayLike */ 620);
/**
* Creates an array of the own and inherited enumerable property names of `object`.
*
* **Note:** Non-object values are coerced to objects.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Object
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.keysIn(new Foo);
* // => ['a', 'b', 'c'] (iteration order is not guaranteed)
*/
function keysIn(object) {
return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
}
module.exports = keysIn;
/***/ },
/* 770 */
/*!*****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_baseKeysIn.js ***!
\*****************************************************/
/***/ function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(/*! ./isObject */ 560),
isPrototype = __webpack_require__(/*! ./_isPrototype */ 643),
nativeKeysIn = __webpack_require__(/*! ./_nativeKeysIn */ 771);
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
*/
function baseKeysIn(object) {
if (!isObject(object)) {
return nativeKeysIn(object);
}
var isProto = isPrototype(object),
result = [];
for (var key in object) {
if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
result.push(key);
}
}
return result;
}
module.exports = baseKeysIn;
/***/ },
/* 771 */
/*!*******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_nativeKeysIn.js ***!
\*******************************************************/
/***/ function(module, exports) {
/**
* This function is like
* [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
* except that it includes inherited enumerable properties.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
*/
function nativeKeysIn(object) {
var result = [];
if (object != null) {
for (var key in Object(object)) {
result.push(key);
}
}
return result;
}
module.exports = nativeKeysIn;
/***/ },
/* 772 */
/*!******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_cloneBuffer.js ***!
\******************************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__(/*! ./_root */ 544);
/** Detect free variable `exports`. */
var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
/** Detect free variable `module`. */
var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
/** Detect the popular CommonJS extension `module.exports`. */
var moduleExports = freeModule && freeModule.exports === freeExports;
/** Built-in value references. */
var Buffer = moduleExports ? root.Buffer : undefined,
allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;
/**
* Creates a clone of `buffer`.
*
* @private
* @param {Buffer} buffer The buffer to clone.
* @param {boolean} [isDeep] Specify a deep clone.
* @returns {Buffer} Returns the cloned buffer.
*/
function cloneBuffer(buffer, isDeep) {
if (isDeep) {
return buffer.slice();
}
var length = buffer.length,
result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
buffer.copy(result);
return result;
}
module.exports = cloneBuffer;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../../webpack/buildin/module.js */ 193)(module)))
/***/ },
/* 773 */
/*!******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_copySymbols.js ***!
\******************************************************/
/***/ function(module, exports, __webpack_require__) {
var copyObject = __webpack_require__(/*! ./_copyObject */ 763),
getSymbols = __webpack_require__(/*! ./_getSymbols */ 667);
/**
* Copies own symbols of `source` to `object`.
*
* @private
* @param {Object} source The object to copy symbols from.
* @param {Object} [object={}] The object to copy symbols to.
* @returns {Object} Returns `object`.
*/
function copySymbols(source, object) {
return copyObject(source, getSymbols(source), object);
}
module.exports = copySymbols;
/***/ },
/* 774 */
/*!********************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_copySymbolsIn.js ***!
\********************************************************/
/***/ function(module, exports, __webpack_require__) {
var copyObject = __webpack_require__(/*! ./_copyObject */ 763),
getSymbolsIn = __webpack_require__(/*! ./_getSymbolsIn */ 775);
/**
* Copies own and inherited symbols of `source` to `object`.
*
* @private
* @param {Object} source The object to copy symbols from.
* @param {Object} [object={}] The object to copy symbols to.
* @returns {Object} Returns `object`.
*/
function copySymbolsIn(source, object) {
return copyObject(source, getSymbolsIn(source), object);
}
module.exports = copySymbolsIn;
/***/ },
/* 775 */
/*!*******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_getSymbolsIn.js ***!
\*******************************************************/
/***/ function(module, exports, __webpack_require__) {
var arrayPush = __webpack_require__(/*! ./_arrayPush */ 608),
getPrototype = __webpack_require__(/*! ./_getPrototype */ 704),
getSymbols = __webpack_require__(/*! ./_getSymbols */ 667),
stubArray = __webpack_require__(/*! ./stubArray */ 668);
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeGetSymbols = Object.getOwnPropertySymbols;
/**
* Creates an array of the own and inherited enumerable symbols of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of symbols.
*/
var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
var result = [];
while (object) {
arrayPush(result, getSymbols(object));
object = getPrototype(object);
}
return result;
};
module.exports = getSymbolsIn;
/***/ },
/* 776 */
/*!*******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_getAllKeysIn.js ***!
\*******************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseGetAllKeys = __webpack_require__(/*! ./_baseGetAllKeys */ 666),
getSymbolsIn = __webpack_require__(/*! ./_getSymbolsIn */ 775),
keysIn = __webpack_require__(/*! ./keysIn */ 769);
/**
* Creates an array of own and inherited enumerable property names and
* symbols of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names and symbols.
*/
function getAllKeysIn(object) {
return baseGetAllKeys(object, keysIn, getSymbolsIn);
}
module.exports = getAllKeysIn;
/***/ },
/* 777 */
/*!*********************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_initCloneArray.js ***!
\*********************************************************/
/***/ function(module, exports) {
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Initializes an array clone.
*
* @private
* @param {Array} array The array to clone.
* @returns {Array} Returns the initialized clone.
*/
function initCloneArray(array) {
var length = array.length,
result = array.constructor(length);
// Add properties assigned by `RegExp#exec`.
if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
result.index = array.index;
result.input = array.input;
}
return result;
}
module.exports = initCloneArray;
/***/ },
/* 778 */
/*!*********************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_initCloneByTag.js ***!
\*********************************************************/
/***/ function(module, exports, __webpack_require__) {
var cloneArrayBuffer = __webpack_require__(/*! ./_cloneArrayBuffer */ 779),
cloneDataView = __webpack_require__(/*! ./_cloneDataView */ 780),
cloneMap = __webpack_require__(/*! ./_cloneMap */ 781),
cloneRegExp = __webpack_require__(/*! ./_cloneRegExp */ 784),
cloneSet = __webpack_require__(/*! ./_cloneSet */ 785),
cloneSymbol = __webpack_require__(/*! ./_cloneSymbol */ 787),
cloneTypedArray = __webpack_require__(/*! ./_cloneTypedArray */ 788);
/** `Object#toString` result references. */
var boolTag = '[object Boolean]',
dateTag = '[object Date]',
mapTag = '[object Map]',
numberTag = '[object Number]',
regexpTag = '[object RegExp]',
setTag = '[object Set]',
stringTag = '[object String]',
symbolTag = '[object Symbol]';
var arrayBufferTag = '[object ArrayBuffer]',
dataViewTag = '[object DataView]',
float32Tag = '[object Float32Array]',
float64Tag = '[object Float64Array]',
int8Tag = '[object Int8Array]',
int16Tag = '[object Int16Array]',
int32Tag = '[object Int32Array]',
uint8Tag = '[object Uint8Array]',
uint8ClampedTag = '[object Uint8ClampedArray]',
uint16Tag = '[object Uint16Array]',
uint32Tag = '[object Uint32Array]';
/**
* Initializes an object clone based on its `toStringTag`.
*
* **Note:** This function only supports cloning values with tags of
* `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
*
* @private
* @param {Object} object The object to clone.
* @param {string} tag The `toStringTag` of the object to clone.
* @param {Function} cloneFunc The function to clone values.
* @param {boolean} [isDeep] Specify a deep clone.
* @returns {Object} Returns the initialized clone.
*/
function initCloneByTag(object, tag, cloneFunc, isDeep) {
var Ctor = object.constructor;
switch (tag) {
case arrayBufferTag:
return cloneArrayBuffer(object);
case boolTag:
case dateTag:
return new Ctor(+object);
case dataViewTag:
return cloneDataView(object, isDeep);
case float32Tag: case float64Tag:
case int8Tag: case int16Tag: case int32Tag:
case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
return cloneTypedArray(object, isDeep);
case mapTag:
return cloneMap(object, isDeep, cloneFunc);
case numberTag:
case stringTag:
return new Ctor(object);
case regexpTag:
return cloneRegExp(object);
case setTag:
return cloneSet(object, isDeep, cloneFunc);
case symbolTag:
return cloneSymbol(object);
}
}
module.exports = initCloneByTag;
/***/ },
/* 779 */
/*!***********************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_cloneArrayBuffer.js ***!
\***********************************************************/
/***/ function(module, exports, __webpack_require__) {
var Uint8Array = __webpack_require__(/*! ./_Uint8Array */ 661);
/**
* Creates a clone of `arrayBuffer`.
*
* @private
* @param {ArrayBuffer} arrayBuffer The array buffer to clone.
* @returns {ArrayBuffer} Returns the cloned array buffer.
*/
function cloneArrayBuffer(arrayBuffer) {
var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
new Uint8Array(result).set(new Uint8Array(arrayBuffer));
return result;
}
module.exports = cloneArrayBuffer;
/***/ },
/* 780 */
/*!********************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_cloneDataView.js ***!
\********************************************************/
/***/ function(module, exports, __webpack_require__) {
var cloneArrayBuffer = __webpack_require__(/*! ./_cloneArrayBuffer */ 779);
/**
* Creates a clone of `dataView`.
*
* @private
* @param {Object} dataView The data view to clone.
* @param {boolean} [isDeep] Specify a deep clone.
* @returns {Object} Returns the cloned data view.
*/
function cloneDataView(dataView, isDeep) {
var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
}
module.exports = cloneDataView;
/***/ },
/* 781 */
/*!***************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_cloneMap.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
var addMapEntry = __webpack_require__(/*! ./_addMapEntry */ 782),
arrayReduce = __webpack_require__(/*! ./_arrayReduce */ 783),
mapToArray = __webpack_require__(/*! ./_mapToArray */ 662);
/** Used to compose bitmasks for cloning. */
var CLONE_DEEP_FLAG = 1;
/**
* Creates a clone of `map`.
*
* @private
* @param {Object} map The map to clone.
* @param {Function} cloneFunc The function to clone values.
* @param {boolean} [isDeep] Specify a deep clone.
* @returns {Object} Returns the cloned map.
*/
function cloneMap(map, isDeep, cloneFunc) {
var array = isDeep ? cloneFunc(mapToArray(map), CLONE_DEEP_FLAG) : mapToArray(map);
return arrayReduce(array, addMapEntry, new map.constructor);
}
module.exports = cloneMap;
/***/ },
/* 782 */
/*!******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_addMapEntry.js ***!
\******************************************************/
/***/ function(module, exports) {
/**
* Adds the key-value `pair` to `map`.
*
* @private
* @param {Object} map The map to modify.
* @param {Array} pair The key-value pair to add.
* @returns {Object} Returns `map`.
*/
function addMapEntry(map, pair) {
// Don't return `map.set` because it's not chainable in IE 11.
map.set(pair[0], pair[1]);
return map;
}
module.exports = addMapEntry;
/***/ },
/* 783 */
/*!******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_arrayReduce.js ***!
\******************************************************/
/***/ function(module, exports) {
/**
* A specialized version of `_.reduce` for arrays without support for
* iteratee shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @param {*} [accumulator] The initial value.
* @param {boolean} [initAccum] Specify using the first element of `array` as
* the initial value.
* @returns {*} Returns the accumulated value.
*/
function arrayReduce(array, iteratee, accumulator, initAccum) {
var index = -1,
length = array == null ? 0 : array.length;
if (initAccum && length) {
accumulator = array[++index];
}
while (++index < length) {
accumulator = iteratee(accumulator, array[index], index, array);
}
return accumulator;
}
module.exports = arrayReduce;
/***/ },
/* 784 */
/*!******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_cloneRegExp.js ***!
\******************************************************/
/***/ function(module, exports) {
/** Used to match `RegExp` flags from their coerced string values. */
var reFlags = /\w*$/;
/**
* Creates a clone of `regexp`.
*
* @private
* @param {Object} regexp The regexp to clone.
* @returns {Object} Returns the cloned regexp.
*/
function cloneRegExp(regexp) {
var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
result.lastIndex = regexp.lastIndex;
return result;
}
module.exports = cloneRegExp;
/***/ },
/* 785 */
/*!***************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_cloneSet.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
var addSetEntry = __webpack_require__(/*! ./_addSetEntry */ 786),
arrayReduce = __webpack_require__(/*! ./_arrayReduce */ 783),
setToArray = __webpack_require__(/*! ./_setToArray */ 663);
/** Used to compose bitmasks for cloning. */
var CLONE_DEEP_FLAG = 1;
/**
* Creates a clone of `set`.
*
* @private
* @param {Object} set The set to clone.
* @param {Function} cloneFunc The function to clone values.
* @param {boolean} [isDeep] Specify a deep clone.
* @returns {Object} Returns the cloned set.
*/
function cloneSet(set, isDeep, cloneFunc) {
var array = isDeep ? cloneFunc(setToArray(set), CLONE_DEEP_FLAG) : setToArray(set);
return arrayReduce(array, addSetEntry, new set.constructor);
}
module.exports = cloneSet;
/***/ },
/* 786 */
/*!******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_addSetEntry.js ***!
\******************************************************/
/***/ function(module, exports) {
/**
* Adds `value` to `set`.
*
* @private
* @param {Object} set The set to modify.
* @param {*} value The value to add.
* @returns {Object} Returns `set`.
*/
function addSetEntry(set, value) {
// Don't return `set.add` because it's not chainable in IE 11.
set.add(value);
return set;
}
module.exports = addSetEntry;
/***/ },
/* 787 */
/*!******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_cloneSymbol.js ***!
\******************************************************/
/***/ function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__(/*! ./_Symbol */ 543);
/** Used to convert symbols to primitives and strings. */
var symbolProto = Symbol ? Symbol.prototype : undefined,
symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
/**
* Creates a clone of the `symbol` object.
*
* @private
* @param {Object} symbol The symbol object to clone.
* @returns {Object} Returns the cloned symbol object.
*/
function cloneSymbol(symbol) {
return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
}
module.exports = cloneSymbol;
/***/ },
/* 788 */
/*!**********************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_cloneTypedArray.js ***!
\**********************************************************/
/***/ function(module, exports, __webpack_require__) {
var cloneArrayBuffer = __webpack_require__(/*! ./_cloneArrayBuffer */ 779);
/**
* Creates a clone of `typedArray`.
*
* @private
* @param {Object} typedArray The typed array to clone.
* @param {boolean} [isDeep] Specify a deep clone.
* @returns {Object} Returns the cloned typed array.
*/
function cloneTypedArray(typedArray, isDeep) {
var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
}
module.exports = cloneTypedArray;
/***/ },
/* 789 */
/*!**********************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_initCloneObject.js ***!
\**********************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseCreate = __webpack_require__(/*! ./_baseCreate */ 714),
getPrototype = __webpack_require__(/*! ./_getPrototype */ 704),
isPrototype = __webpack_require__(/*! ./_isPrototype */ 643);
/**
* Initializes an object clone.
*
* @private
* @param {Object} object The object to clone.
* @returns {Object} Returns the initialized clone.
*/
function initCloneObject(object) {
return (typeof object.constructor == 'function' && !isPrototype(object))
? baseCreate(getPrototype(object))
: {};
}
module.exports = initCloneObject;
/***/ },
/* 790 */
/*!***********************************************!*\
!*** ./~/semantic-ui-react/~/lodash/curry.js ***!
\***********************************************/
/***/ function(module, exports, __webpack_require__) {
var createWrap = __webpack_require__(/*! ./_createWrap */ 730);
/** Used to compose bitmasks for function metadata. */
var WRAP_CURRY_FLAG = 8;
/**
* Creates a function that accepts arguments of `func` and either invokes
* `func` returning its result, if at least `arity` number of arguments have
* been provided, or returns a function that accepts the remaining `func`
* arguments, and so on. The arity of `func` may be specified if `func.length`
* is not sufficient.
*
* The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
* may be used as a placeholder for provided arguments.
*
* **Note:** This method doesn't set the "length" property of curried functions.
*
* @static
* @memberOf _
* @since 2.0.0
* @category Function
* @param {Function} func The function to curry.
* @param {number} [arity=func.length] The arity of `func`.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Function} Returns the new curried function.
* @example
*
* var abc = function(a, b, c) {
* return [a, b, c];
* };
*
* var curried = _.curry(abc);
*
* curried(1)(2)(3);
* // => [1, 2, 3]
*
* curried(1, 2)(3);
* // => [1, 2, 3]
*
* curried(1, 2, 3);
* // => [1, 2, 3]
*
* // Curried with placeholders.
* curried(1)(_, 3)(2);
* // => [1, 2, 3]
*/
function curry(func, arity, guard) {
arity = guard ? undefined : arity;
var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
result.placeholder = curry.placeholder;
return result;
}
// Assign default placeholders.
curry.placeholder = {};
module.exports = curry;
/***/ },
/* 791 */
/*!**************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/iteratee.js ***!
\**************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseClone = __webpack_require__(/*! ./_baseClone */ 767),
baseIteratee = __webpack_require__(/*! ./_baseIteratee */ 647);
/** Used to compose bitmasks for cloning. */
var CLONE_DEEP_FLAG = 1;
/**
* Creates a function that invokes `func` with the arguments of the created
* function. If `func` is a property name, the created function returns the
* property value for a given element. If `func` is an array or object, the
* created function returns `true` for elements that contain the equivalent
* source properties, otherwise it returns `false`.
*
* @static
* @since 4.0.0
* @memberOf _
* @category Util
* @param {*} [func=_.identity] The value to convert to a callback.
* @returns {Function} Returns the callback.
* @example
*
* var users = [
* { 'user': 'barney', 'age': 36, 'active': true },
* { 'user': 'fred', 'age': 40, 'active': false }
* ];
*
* // The `_.matches` iteratee shorthand.
* _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
* // => [{ 'user': 'barney', 'age': 36, 'active': true }]
*
* // The `_.matchesProperty` iteratee shorthand.
* _.filter(users, _.iteratee(['user', 'fred']));
* // => [{ 'user': 'fred', 'age': 40 }]
*
* // The `_.property` iteratee shorthand.
* _.map(users, _.iteratee('user'));
* // => ['barney', 'fred']
*
* // Create custom iteratee shorthands.
* _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
* return !_.isRegExp(func) ? iteratee(func) : function(string) {
* return func.test(string);
* };
* });
*
* _.filter(['abc', 'def'], /ef/);
* // => ['def']
*/
function iteratee(func) {
return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
}
module.exports = iteratee;
/***/ },
/* 792 */
/*!***********************************************!*\
!*** ./~/semantic-ui-react/~/lodash/rearg.js ***!
\***********************************************/
/***/ function(module, exports, __webpack_require__) {
var createWrap = __webpack_require__(/*! ./_createWrap */ 730),
flatRest = __webpack_require__(/*! ./_flatRest */ 793);
/** Used to compose bitmasks for function metadata. */
var WRAP_REARG_FLAG = 256;
/**
* Creates a function that invokes `func` with arguments arranged according
* to the specified `indexes` where the argument value at the first index is
* provided as the first argument, the argument value at the second index is
* provided as the second argument, and so on.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Function
* @param {Function} func The function to rearrange arguments for.
* @param {...(number|number[])} indexes The arranged argument indexes.
* @returns {Function} Returns the new function.
* @example
*
* var rearged = _.rearg(function(a, b, c) {
* return [a, b, c];
* }, [2, 0, 1]);
*
* rearged('b', 'c', 'a')
* // => ['a', 'b', 'c']
*/
var rearg = flatRest(function(func, indexes) {
return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
});
module.exports = rearg;
/***/ },
/* 793 */
/*!***************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_flatRest.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
var flatten = __webpack_require__(/*! ./flatten */ 794),
overRest = __webpack_require__(/*! ./_overRest */ 612),
setToString = __webpack_require__(/*! ./_setToString */ 614);
/**
* A specialized version of `baseRest` which flattens the rest array.
*
* @private
* @param {Function} func The function to apply a rest parameter to.
* @returns {Function} Returns the new function.
*/
function flatRest(func) {
return setToString(overRest(func, undefined, flatten), func + '');
}
module.exports = flatRest;
/***/ },
/* 794 */
/*!*************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/flatten.js ***!
\*************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseFlatten = __webpack_require__(/*! ./_baseFlatten */ 607);
/**
* Flattens `array` a single level deep.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to flatten.
* @returns {Array} Returns the new flattened array.
* @example
*
* _.flatten([1, [2, [3, [4]], 5]]);
* // => [1, 2, [3, [4]], 5]
*/
function flatten(array) {
var length = array == null ? 0 : array.length;
return length ? baseFlatten(array, 1) : [];
}
module.exports = flatten;
/***/ },
/* 795 */
/*!************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/toPath.js ***!
\************************************************/
/***/ function(module, exports, __webpack_require__) {
var arrayMap = __webpack_require__(/*! ./_arrayMap */ 586),
copyArray = __webpack_require__(/*! ./_copyArray */ 751),
isArray = __webpack_require__(/*! ./isArray */ 539),
isSymbol = __webpack_require__(/*! ./isSymbol */ 541),
stringToPath = __webpack_require__(/*! ./_stringToPath */ 549),
toKey = __webpack_require__(/*! ./_toKey */ 591),
toString = __webpack_require__(/*! ./toString */ 584);
/**
* Converts `value` to a property path array.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Util
* @param {*} value The value to convert.
* @returns {Array} Returns the new property path array.
* @example
*
* _.toPath('a.b.c');
* // => ['a', 'b', 'c']
*
* _.toPath('a[0].b.c');
* // => ['a', '0', 'b', 'c']
*/
function toPath(value) {
if (isArray(value)) {
return arrayMap(value, toKey);
}
return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
}
module.exports = toPath;
/***/ },
/* 796 */
/*!**********************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/fp/_falseOptions.js ***!
\**********************************************************/
/***/ function(module, exports) {
module.exports = {
'cap': false,
'curry': false,
'fixed': false,
'immutable': false,
'rearg': false
};
/***/ },
/* 797 */
/*!*************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/fp/pick.js ***!
\*************************************************/
/***/ function(module, exports, __webpack_require__) {
var convert = __webpack_require__(/*! ./convert */ 724),
func = convert('pick', __webpack_require__(/*! ../pick */ 798));
func.placeholder = __webpack_require__(/*! ./placeholder */ 727);
module.exports = func;
/***/ },
/* 798 */
/*!**********************************************!*\
!*** ./~/semantic-ui-react/~/lodash/pick.js ***!
\**********************************************/
/***/ function(module, exports, __webpack_require__) {
var basePick = __webpack_require__(/*! ./_basePick */ 799),
flatRest = __webpack_require__(/*! ./_flatRest */ 793);
/**
* Creates an object composed of the picked `object` properties.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The source object.
* @param {...(string|string[])} [paths] The property paths to pick.
* @returns {Object} Returns the new object.
* @example
*
* var object = { 'a': 1, 'b': '2', 'c': 3 };
*
* _.pick(object, ['a', 'c']);
* // => { 'a': 1, 'c': 3 }
*/
var pick = flatRest(function(object, paths) {
return object == null ? {} : basePick(object, paths);
});
module.exports = pick;
/***/ },
/* 799 */
/*!***************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_basePick.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
var basePickBy = __webpack_require__(/*! ./_basePickBy */ 800),
hasIn = __webpack_require__(/*! ./hasIn */ 680);
/**
* The base implementation of `_.pick` without support for individual
* property identifiers.
*
* @private
* @param {Object} object The source object.
* @param {string[]} paths The property paths to pick.
* @returns {Object} Returns the new object.
*/
function basePick(object, paths) {
return basePickBy(object, paths, function(value, path) {
return hasIn(object, path);
});
}
module.exports = basePick;
/***/ },
/* 800 */
/*!*****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_basePickBy.js ***!
\*****************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseGet = __webpack_require__(/*! ./_baseGet */ 679),
baseSet = __webpack_require__(/*! ./_baseSet */ 801),
castPath = __webpack_require__(/*! ./_castPath */ 538);
/**
* The base implementation of `_.pickBy` without support for iteratee shorthands.
*
* @private
* @param {Object} object The source object.
* @param {string[]} paths The property paths to pick.
* @param {Function} predicate The function invoked per property.
* @returns {Object} Returns the new object.
*/
function basePickBy(object, paths, predicate) {
var index = -1,
length = paths.length,
result = {};
while (++index < length) {
var path = paths[index],
value = baseGet(object, path);
if (predicate(value, path)) {
baseSet(result, castPath(path, object), value);
}
}
return result;
}
module.exports = basePickBy;
/***/ },
/* 801 */
/*!**************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_baseSet.js ***!
\**************************************************/
/***/ function(module, exports, __webpack_require__) {
var assignValue = __webpack_require__(/*! ./_assignValue */ 764),
castPath = __webpack_require__(/*! ./_castPath */ 538),
isIndex = __webpack_require__(/*! ./_isIndex */ 589),
isObject = __webpack_require__(/*! ./isObject */ 560),
toKey = __webpack_require__(/*! ./_toKey */ 591);
/**
* The base implementation of `_.set`.
*
* @private
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to set.
* @param {*} value The value to set.
* @param {Function} [customizer] The function to customize path creation.
* @returns {Object} Returns `object`.
*/
function baseSet(object, path, value, customizer) {
if (!isObject(object)) {
return object;
}
path = castPath(path, object);
var index = -1,
length = path.length,
lastIndex = length - 1,
nested = object;
while (nested != null && ++index < length) {
var key = toKey(path[index]),
newValue = value;
if (index != lastIndex) {
var objValue = nested[key];
newValue = customizer ? customizer(objValue, key, nested) : undefined;
if (newValue === undefined) {
newValue = isObject(objValue)
? objValue
: (isIndex(path[index + 1]) ? [] : {});
}
}
assignValue(nested, key, newValue);
nested = nested[key];
}
return object;
}
module.exports = baseSet;
/***/ },
/* 802 */
/*!*************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/fp/keys.js ***!
\*************************************************/
/***/ function(module, exports, __webpack_require__) {
var convert = __webpack_require__(/*! ./convert */ 724),
func = convert('keys', __webpack_require__(/*! ../keys */ 634), __webpack_require__(/*! ./_falseOptions */ 796));
func.placeholder = __webpack_require__(/*! ./placeholder */ 727);
module.exports = func;
/***/ },
/* 803 */
/*!**********************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/fp/isPlainObject.js ***!
\**********************************************************/
/***/ function(module, exports, __webpack_require__) {
var convert = __webpack_require__(/*! ./convert */ 724),
func = convert('isPlainObject', __webpack_require__(/*! ../isPlainObject */ 703), __webpack_require__(/*! ./_falseOptions */ 796));
func.placeholder = __webpack_require__(/*! ./placeholder */ 727);
module.exports = func;
/***/ },
/* 804 */
/*!*******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/fp/isFunction.js ***!
\*******************************************************/
/***/ function(module, exports, __webpack_require__) {
var convert = __webpack_require__(/*! ./convert */ 724),
func = convert('isFunction', __webpack_require__(/*! ../isFunction */ 559), __webpack_require__(/*! ./_falseOptions */ 796));
func.placeholder = __webpack_require__(/*! ./placeholder */ 727);
module.exports = func;
/***/ },
/* 805 */
/*!****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/fp/compact.js ***!
\****************************************************/
/***/ function(module, exports, __webpack_require__) {
var convert = __webpack_require__(/*! ./convert */ 724),
func = convert('compact', __webpack_require__(/*! ../compact */ 806), __webpack_require__(/*! ./_falseOptions */ 796));
func.placeholder = __webpack_require__(/*! ./placeholder */ 727);
module.exports = func;
/***/ },
/* 806 */
/*!*************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/compact.js ***!
\*************************************************/
/***/ function(module, exports) {
/**
* Creates an array with all falsey values removed. The values `false`, `null`,
* `0`, `""`, `undefined`, and `NaN` are falsey.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to compact.
* @returns {Array} Returns the new array of filtered values.
* @example
*
* _.compact([0, 1, false, 2, '', 3]);
* // => [1, 2, 3]
*/
function compact(array) {
var index = -1,
length = array == null ? 0 : array.length,
resIndex = 0,
result = [];
while (++index < length) {
var value = array[index];
if (value) {
result[resIndex++] = value;
}
}
return result;
}
module.exports = compact;
/***/ },
/* 807 */
/*!*************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/fp/take.js ***!
\*************************************************/
/***/ function(module, exports, __webpack_require__) {
var convert = __webpack_require__(/*! ./convert */ 724),
func = convert('take', __webpack_require__(/*! ../take */ 808));
func.placeholder = __webpack_require__(/*! ./placeholder */ 727);
module.exports = func;
/***/ },
/* 808 */
/*!**********************************************!*\
!*** ./~/semantic-ui-react/~/lodash/take.js ***!
\**********************************************/
/***/ function(module, exports, __webpack_require__) {
var baseSlice = __webpack_require__(/*! ./_baseSlice */ 809),
toInteger = __webpack_require__(/*! ./toInteger */ 624);
/**
* Creates a slice of `array` with `n` elements taken from the beginning.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to query.
* @param {number} [n=1] The number of elements to take.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Array} Returns the slice of `array`.
* @example
*
* _.take([1, 2, 3]);
* // => [1]
*
* _.take([1, 2, 3], 2);
* // => [1, 2]
*
* _.take([1, 2, 3], 5);
* // => [1, 2, 3]
*
* _.take([1, 2, 3], 0);
* // => []
*/
function take(array, n, guard) {
if (!(array && array.length)) {
return [];
}
n = (guard || n === undefined) ? 1 : toInteger(n);
return baseSlice(array, 0, n < 0 ? 0 : n);
}
module.exports = take;
/***/ },
/* 809 */
/*!****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_baseSlice.js ***!
\****************************************************/
/***/ function(module, exports) {
/**
* The base implementation of `_.slice` without an iteratee call guard.
*
* @private
* @param {Array} array The array to slice.
* @param {number} [start=0] The start position.
* @param {number} [end=array.length] The end position.
* @returns {Array} Returns the slice of `array`.
*/
function baseSlice(array, start, end) {
var index = -1,
length = array.length;
if (start < 0) {
start = -start > length ? 0 : (length + start);
}
end = end > length ? length : end;
if (end < 0) {
end += length;
}
length = start > end ? 0 : ((end - start) >>> 0);
start >>>= 0;
var result = Array(length);
while (++index < length) {
result[index] = array[index + start];
}
return result;
}
module.exports = baseSlice;
/***/ },
/* 810 */
/*!***************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/fp/sortBy.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
var convert = __webpack_require__(/*! ./convert */ 724),
func = convert('sortBy', __webpack_require__(/*! ../sortBy */ 811));
func.placeholder = __webpack_require__(/*! ./placeholder */ 727);
module.exports = func;
/***/ },
/* 811 */
/*!************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/sortBy.js ***!
\************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseFlatten = __webpack_require__(/*! ./_baseFlatten */ 607),
baseOrderBy = __webpack_require__(/*! ./_baseOrderBy */ 812),
baseRest = __webpack_require__(/*! ./_baseRest */ 610),
isIterateeCall = __webpack_require__(/*! ./_isIterateeCall */ 721);
/**
* Creates an array of elements, sorted in ascending order by the results of
* running each element in a collection thru each iteratee. This method
* performs a stable sort, that is, it preserves the original sort order of
* equal elements. The iteratees are invoked with one argument: (value).
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {...(Function|Function[])} [iteratees=[_.identity]]
* The iteratees to sort by.
* @returns {Array} Returns the new sorted array.
* @example
*
* var users = [
* { 'user': 'fred', 'age': 48 },
* { 'user': 'barney', 'age': 36 },
* { 'user': 'fred', 'age': 40 },
* { 'user': 'barney', 'age': 34 }
* ];
*
* _.sortBy(users, [function(o) { return o.user; }]);
* // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
*
* _.sortBy(users, ['user', 'age']);
* // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]]
*/
var sortBy = baseRest(function(collection, iteratees) {
if (collection == null) {
return [];
}
var length = iteratees.length;
if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
iteratees = [];
} else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
iteratees = [iteratees[0]];
}
return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
});
module.exports = sortBy;
/***/ },
/* 812 */
/*!******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_baseOrderBy.js ***!
\******************************************************/
/***/ function(module, exports, __webpack_require__) {
var arrayMap = __webpack_require__(/*! ./_arrayMap */ 586),
baseIteratee = __webpack_require__(/*! ./_baseIteratee */ 647),
baseMap = __webpack_require__(/*! ./_baseMap */ 813),
baseSortBy = __webpack_require__(/*! ./_baseSortBy */ 814),
baseUnary = __webpack_require__(/*! ./_baseUnary */ 605),
compareMultiple = __webpack_require__(/*! ./_compareMultiple */ 815),
identity = __webpack_require__(/*! ./identity */ 611);
/**
* The base implementation of `_.orderBy` without param guards.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
* @param {string[]} orders The sort orders of `iteratees`.
* @returns {Array} Returns the new sorted array.
*/
function baseOrderBy(collection, iteratees, orders) {
var index = -1;
iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(baseIteratee));
var result = baseMap(collection, function(value, key, collection) {
var criteria = arrayMap(iteratees, function(iteratee) {
return iteratee(value);
});
return { 'criteria': criteria, 'index': ++index, 'value': value };
});
return baseSortBy(result, function(object, other) {
return compareMultiple(object, other, orders);
});
}
module.exports = baseOrderBy;
/***/ },
/* 813 */
/*!**************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_baseMap.js ***!
\**************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseEach = __webpack_require__(/*! ./_baseEach */ 630),
isArrayLike = __webpack_require__(/*! ./isArrayLike */ 620);
/**
* The base implementation of `_.map` without support for iteratee shorthands.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns the new mapped array.
*/
function baseMap(collection, iteratee) {
var index = -1,
result = isArrayLike(collection) ? Array(collection.length) : [];
baseEach(collection, function(value, key, collection) {
result[++index] = iteratee(value, key, collection);
});
return result;
}
module.exports = baseMap;
/***/ },
/* 814 */
/*!*****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_baseSortBy.js ***!
\*****************************************************/
/***/ function(module, exports) {
/**
* The base implementation of `_.sortBy` which uses `comparer` to define the
* sort order of `array` and replaces criteria objects with their corresponding
* values.
*
* @private
* @param {Array} array The array to sort.
* @param {Function} comparer The function to define sort order.
* @returns {Array} Returns `array`.
*/
function baseSortBy(array, comparer) {
var length = array.length;
array.sort(comparer);
while (length--) {
array[length] = array[length].value;
}
return array;
}
module.exports = baseSortBy;
/***/ },
/* 815 */
/*!**********************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_compareMultiple.js ***!
\**********************************************************/
/***/ function(module, exports, __webpack_require__) {
var compareAscending = __webpack_require__(/*! ./_compareAscending */ 816);
/**
* Used by `_.orderBy` to compare multiple properties of a value to another
* and stable sort them.
*
* If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
* specify an order of "desc" for descending or "asc" for ascending sort order
* of corresponding values.
*
* @private
* @param {Object} object The object to compare.
* @param {Object} other The other object to compare.
* @param {boolean[]|string[]} orders The order to sort by for each property.
* @returns {number} Returns the sort order indicator for `object`.
*/
function compareMultiple(object, other, orders) {
var index = -1,
objCriteria = object.criteria,
othCriteria = other.criteria,
length = objCriteria.length,
ordersLength = orders.length;
while (++index < length) {
var result = compareAscending(objCriteria[index], othCriteria[index]);
if (result) {
if (index >= ordersLength) {
return result;
}
var order = orders[index];
return result * (order == 'desc' ? -1 : 1);
}
}
// Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
// that causes it, under certain circumstances, to provide the same value for
// `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
// for more details.
//
// This also ensures a stable sort in V8 and other engines.
// See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
return object.index - other.index;
}
module.exports = compareMultiple;
/***/ },
/* 816 */
/*!***********************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_compareAscending.js ***!
\***********************************************************/
/***/ function(module, exports, __webpack_require__) {
var isSymbol = __webpack_require__(/*! ./isSymbol */ 541);
/**
* Compares values to sort them in ascending order.
*
* @private
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {number} Returns the sort order indicator for `value`.
*/
function compareAscending(value, other) {
if (value !== other) {
var valIsDefined = value !== undefined,
valIsNull = value === null,
valIsReflexive = value === value,
valIsSymbol = isSymbol(value);
var othIsDefined = other !== undefined,
othIsNull = other === null,
othIsReflexive = other === other,
othIsSymbol = isSymbol(other);
if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
(valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
(valIsNull && othIsDefined && othIsReflexive) ||
(!valIsDefined && othIsReflexive) ||
!valIsReflexive) {
return 1;
}
if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
(othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
(othIsNull && valIsDefined && valIsReflexive) ||
(!othIsDefined && valIsReflexive) ||
!othIsReflexive) {
return -1;
}
}
return 0;
}
module.exports = compareAscending;
/***/ },
/* 817 */
/*!************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/fp/sum.js ***!
\************************************************/
/***/ function(module, exports, __webpack_require__) {
var convert = __webpack_require__(/*! ./convert */ 724),
func = convert('sum', __webpack_require__(/*! ../sum */ 818), __webpack_require__(/*! ./_falseOptions */ 796));
func.placeholder = __webpack_require__(/*! ./placeholder */ 727);
module.exports = func;
/***/ },
/* 818 */
/*!*********************************************!*\
!*** ./~/semantic-ui-react/~/lodash/sum.js ***!
\*********************************************/
/***/ function(module, exports, __webpack_require__) {
var baseSum = __webpack_require__(/*! ./_baseSum */ 819),
identity = __webpack_require__(/*! ./identity */ 611);
/**
* Computes the sum of the values in `array`.
*
* @static
* @memberOf _
* @since 3.4.0
* @category Math
* @param {Array} array The array to iterate over.
* @returns {number} Returns the sum.
* @example
*
* _.sum([4, 2, 8, 6]);
* // => 20
*/
function sum(array) {
return (array && array.length)
? baseSum(array, identity)
: 0;
}
module.exports = sum;
/***/ },
/* 819 */
/*!**************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_baseSum.js ***!
\**************************************************/
/***/ function(module, exports) {
/**
* The base implementation of `_.sum` and `_.sumBy` without support for
* iteratee shorthands.
*
* @private
* @param {Array} array The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {number} Returns the sum.
*/
function baseSum(array, iteratee) {
var result,
index = -1,
length = array.length;
while (++index < length) {
var current = iteratee(array[index]);
if (current !== undefined) {
result = result === undefined ? current : (result + current);
}
}
return result;
}
module.exports = baseSum;
/***/ },
/* 820 */
/*!************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/fp/min.js ***!
\************************************************/
/***/ function(module, exports, __webpack_require__) {
var convert = __webpack_require__(/*! ./convert */ 724),
func = convert('min', __webpack_require__(/*! ../min */ 821), __webpack_require__(/*! ./_falseOptions */ 796));
func.placeholder = __webpack_require__(/*! ./placeholder */ 727);
module.exports = func;
/***/ },
/* 821 */
/*!*********************************************!*\
!*** ./~/semantic-ui-react/~/lodash/min.js ***!
\*********************************************/
/***/ function(module, exports, __webpack_require__) {
var baseExtremum = __webpack_require__(/*! ./_baseExtremum */ 822),
baseLt = __webpack_require__(/*! ./_baseLt */ 823),
identity = __webpack_require__(/*! ./identity */ 611);
/**
* Computes the minimum value of `array`. If `array` is empty or falsey,
* `undefined` is returned.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Math
* @param {Array} array The array to iterate over.
* @returns {*} Returns the minimum value.
* @example
*
* _.min([4, 2, 8, 6]);
* // => 2
*
* _.min([]);
* // => undefined
*/
function min(array) {
return (array && array.length)
? baseExtremum(array, identity, baseLt)
: undefined;
}
module.exports = min;
/***/ },
/* 822 */
/*!*******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_baseExtremum.js ***!
\*******************************************************/
/***/ function(module, exports, __webpack_require__) {
var isSymbol = __webpack_require__(/*! ./isSymbol */ 541);
/**
* The base implementation of methods like `_.max` and `_.min` which accepts a
* `comparator` to determine the extremum value.
*
* @private
* @param {Array} array The array to iterate over.
* @param {Function} iteratee The iteratee invoked per iteration.
* @param {Function} comparator The comparator used to compare values.
* @returns {*} Returns the extremum value.
*/
function baseExtremum(array, iteratee, comparator) {
var index = -1,
length = array.length;
while (++index < length) {
var value = array[index],
current = iteratee(value);
if (current != null && (computed === undefined
? (current === current && !isSymbol(current))
: comparator(current, computed)
)) {
var computed = current,
result = value;
}
}
return result;
}
module.exports = baseExtremum;
/***/ },
/* 823 */
/*!*************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_baseLt.js ***!
\*************************************************/
/***/ function(module, exports) {
/**
* The base implementation of `_.lt` which doesn't coerce arguments.
*
* @private
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if `value` is less than `other`,
* else `false`.
*/
function baseLt(value, other) {
return value < other;
}
module.exports = baseLt;
/***/ },
/* 824 */
/*!************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/fp/map.js ***!
\************************************************/
/***/ function(module, exports, __webpack_require__) {
var convert = __webpack_require__(/*! ./convert */ 724),
func = convert('map', __webpack_require__(/*! ../map */ 825));
func.placeholder = __webpack_require__(/*! ./placeholder */ 727);
module.exports = func;
/***/ },
/* 825 */
/*!*********************************************!*\
!*** ./~/semantic-ui-react/~/lodash/map.js ***!
\*********************************************/
/***/ function(module, exports, __webpack_require__) {
var arrayMap = __webpack_require__(/*! ./_arrayMap */ 586),
baseIteratee = __webpack_require__(/*! ./_baseIteratee */ 647),
baseMap = __webpack_require__(/*! ./_baseMap */ 813),
isArray = __webpack_require__(/*! ./isArray */ 539);
/**
* Creates an array of values by running each element in `collection` thru
* `iteratee`. The iteratee is invoked with three arguments:
* (value, index|key, collection).
*
* Many lodash methods are guarded to work as iteratees for methods like
* `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
*
* The guarded methods are:
* `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
* `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
* `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
* `template`, `trim`, `trimEnd`, `trimStart`, and `words`
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Array} Returns the new mapped array.
* @example
*
* function square(n) {
* return n * n;
* }
*
* _.map([4, 8], square);
* // => [16, 64]
*
* _.map({ 'a': 4, 'b': 8 }, square);
* // => [16, 64] (iteration order is not guaranteed)
*
* var users = [
* { 'user': 'barney' },
* { 'user': 'fred' }
* ];
*
* // The `_.property` iteratee shorthand.
* _.map(users, 'user');
* // => ['barney', 'fred']
*/
function map(collection, iteratee) {
var func = isArray(collection) ? arrayMap : baseMap;
return func(collection, baseIteratee(iteratee, 3));
}
module.exports = map;
/***/ },
/* 826 */
/*!*************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/fp/flow.js ***!
\*************************************************/
/***/ function(module, exports, __webpack_require__) {
var convert = __webpack_require__(/*! ./convert */ 724),
func = convert('flow', __webpack_require__(/*! ../flow */ 827));
func.placeholder = __webpack_require__(/*! ./placeholder */ 727);
module.exports = func;
/***/ },
/* 827 */
/*!**********************************************!*\
!*** ./~/semantic-ui-react/~/lodash/flow.js ***!
\**********************************************/
/***/ function(module, exports, __webpack_require__) {
var createFlow = __webpack_require__(/*! ./_createFlow */ 828);
/**
* Creates a function that returns the result of invoking the given functions
* with the `this` binding of the created function, where each successive
* invocation is supplied the return value of the previous.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Util
* @param {...(Function|Function[])} [funcs] The functions to invoke.
* @returns {Function} Returns the new composite function.
* @see _.flowRight
* @example
*
* function square(n) {
* return n * n;
* }
*
* var addSquare = _.flow([_.add, square]);
* addSquare(1, 2);
* // => 9
*/
var flow = createFlow();
module.exports = flow;
/***/ },
/* 828 */
/*!*****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_createFlow.js ***!
\*****************************************************/
/***/ function(module, exports, __webpack_require__) {
var LodashWrapper = __webpack_require__(/*! ./_LodashWrapper */ 749),
flatRest = __webpack_require__(/*! ./_flatRest */ 793),
getData = __webpack_require__(/*! ./_getData */ 744),
getFuncName = __webpack_require__(/*! ./_getFuncName */ 746),
isArray = __webpack_require__(/*! ./isArray */ 539),
isLaziable = __webpack_require__(/*! ./_isLaziable */ 741);
/** Error message constants. */
var FUNC_ERROR_TEXT = 'Expected a function';
/** Used to compose bitmasks for function metadata. */
var WRAP_CURRY_FLAG = 8,
WRAP_PARTIAL_FLAG = 32,
WRAP_ARY_FLAG = 128,
WRAP_REARG_FLAG = 256;
/**
* Creates a `_.flow` or `_.flowRight` function.
*
* @private
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {Function} Returns the new flow function.
*/
function createFlow(fromRight) {
return flatRest(function(funcs) {
var length = funcs.length,
index = length,
prereq = LodashWrapper.prototype.thru;
if (fromRight) {
funcs.reverse();
}
while (index--) {
var func = funcs[index];
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
var wrapper = new LodashWrapper([], true);
}
}
index = wrapper ? index : length;
while (++index < length) {
func = funcs[index];
var funcName = getFuncName(func),
data = funcName == 'wrapper' ? getData(func) : undefined;
if (data && isLaziable(data[0]) &&
data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
!data[4].length && data[9] == 1
) {
wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
} else {
wrapper = (func.length == 1 && isLaziable(func))
? wrapper[funcName]()
: wrapper.thru(func);
}
}
return function() {
var args = arguments,
value = args[0];
if (wrapper && args.length == 1 && isArray(value)) {
return wrapper.plant(value).value();
}
var index = 0,
result = length ? funcs[index].apply(this, args) : value;
while (++index < length) {
result = funcs[index].call(this, result);
}
return result;
};
});
}
module.exports = createFlow;
/***/ },
/* 829 */
/*!*****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/fp/includes.js ***!
\*****************************************************/
/***/ function(module, exports, __webpack_require__) {
var convert = __webpack_require__(/*! ./convert */ 724),
func = convert('includes', __webpack_require__(/*! ../includes */ 830));
func.placeholder = __webpack_require__(/*! ./placeholder */ 727);
module.exports = func;
/***/ },
/* 830 */
/*!**************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/includes.js ***!
\**************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseIndexOf = __webpack_require__(/*! ./_baseIndexOf */ 600),
isArrayLike = __webpack_require__(/*! ./isArrayLike */ 620),
isString = __webpack_require__(/*! ./isString */ 702),
toInteger = __webpack_require__(/*! ./toInteger */ 624),
values = __webpack_require__(/*! ./values */ 831);
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max;
/**
* Checks if `value` is in `collection`. If `collection` is a string, it's
* checked for a substring of `value`, otherwise
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* is used for equality comparisons. If `fromIndex` is negative, it's used as
* the offset from the end of `collection`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object|string} collection The collection to inspect.
* @param {*} value The value to search for.
* @param {number} [fromIndex=0] The index to search from.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
* @returns {boolean} Returns `true` if `value` is found, else `false`.
* @example
*
* _.includes([1, 2, 3], 1);
* // => true
*
* _.includes([1, 2, 3], 1, 2);
* // => false
*
* _.includes({ 'a': 1, 'b': 2 }, 1);
* // => true
*
* _.includes('abcd', 'bc');
* // => true
*/
function includes(collection, value, fromIndex, guard) {
collection = isArrayLike(collection) ? collection : values(collection);
fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
var length = collection.length;
if (fromIndex < 0) {
fromIndex = nativeMax(length + fromIndex, 0);
}
return isString(collection)
? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
: (!!length && baseIndexOf(collection, value, fromIndex) > -1);
}
module.exports = includes;
/***/ },
/* 831 */
/*!************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/values.js ***!
\************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseValues = __webpack_require__(/*! ./_baseValues */ 832),
keys = __webpack_require__(/*! ./keys */ 634);
/**
* Creates an array of the own enumerable string keyed property values of `object`.
*
* **Note:** Non-object values are coerced to objects.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property values.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.values(new Foo);
* // => [1, 2] (iteration order is not guaranteed)
*
* _.values('hi');
* // => ['h', 'i']
*/
function values(object) {
return object == null ? [] : baseValues(object, keys(object));
}
module.exports = values;
/***/ },
/* 832 */
/*!*****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_baseValues.js ***!
\*****************************************************/
/***/ function(module, exports, __webpack_require__) {
var arrayMap = __webpack_require__(/*! ./_arrayMap */ 586);
/**
* The base implementation of `_.values` and `_.valuesIn` which creates an
* array of `object` property values corresponding to the property names
* of `props`.
*
* @private
* @param {Object} object The object to query.
* @param {Array} props The property names to get values for.
* @returns {Object} Returns the array of property values.
*/
function baseValues(object, props) {
return arrayMap(props, function(key) {
return object[key];
});
}
module.exports = baseValues;
/***/ },
/* 833 */
/*!**************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/fp/isNil.js ***!
\**************************************************/
/***/ function(module, exports, __webpack_require__) {
var convert = __webpack_require__(/*! ./convert */ 724),
func = convert('isNil', __webpack_require__(/*! ../isNil */ 834), __webpack_require__(/*! ./_falseOptions */ 796));
func.placeholder = __webpack_require__(/*! ./placeholder */ 727);
module.exports = func;
/***/ },
/* 834 */
/*!***********************************************!*\
!*** ./~/semantic-ui-react/~/lodash/isNil.js ***!
\***********************************************/
/***/ function(module, exports) {
/**
* Checks if `value` is `null` or `undefined`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is nullish, else `false`.
* @example
*
* _.isNil(null);
* // => true
*
* _.isNil(void 0);
* // => true
*
* _.isNil(NaN);
* // => false
*/
function isNil(value) {
return value == null;
}
module.exports = isNil;
/***/ },
/* 835 */
/*!*******************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/lib/META.js ***!
\*******************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.isPrivate = exports.isChild = exports.isParent = exports.isModule = exports.isView = exports.isElement = exports.isCollection = exports.isAddon = exports.isType = exports.isMeta = exports.TYPES = undefined;
var _startsWith2 = __webpack_require__(/*! lodash/fp/startsWith */ 836);
var _startsWith3 = _interopRequireDefault(_startsWith2);
var _has2 = __webpack_require__(/*! lodash/fp/has */ 837);
var _has3 = _interopRequireDefault(_has2);
var _eq2 = __webpack_require__(/*! lodash/fp/eq */ 838);
var _eq3 = _interopRequireDefault(_eq2);
var _flow2 = __webpack_require__(/*! lodash/fp/flow */ 826);
var _flow3 = _interopRequireDefault(_flow2);
var _curry2 = __webpack_require__(/*! lodash/fp/curry */ 839);
var _curry3 = _interopRequireDefault(_curry2);
var _get2 = __webpack_require__(/*! lodash/fp/get */ 840);
var _get3 = _interopRequireDefault(_get2);
var _includes2 = __webpack_require__(/*! lodash/fp/includes */ 829);
var _includes3 = _interopRequireDefault(_includes2);
var _values2 = __webpack_require__(/*! lodash/fp/values */ 841);
var _values3 = _interopRequireDefault(_values2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var TYPES = exports.TYPES = {
ADDON: 'addon',
COLLECTION: 'collection',
ELEMENT: 'element',
VIEW: 'view',
MODULE: 'module'
};
var TYPE_VALUES = (0, _values3.default)(TYPES);
/**
* Determine if an object qualifies as a META object.
* It must have the required keys and valid values.
* @private
* @param {Object} _meta A proposed component _meta object.
* @returns {Boolean}
*/
var isMeta = exports.isMeta = function isMeta(_meta) {
return (0, _includes3.default)((0, _get3.default)('type', _meta), TYPE_VALUES);
};
/**
* Extract a component's _meta object and optional key.
* Handles literal _meta objects, classes with _meta, objects with _meta
* @private
* @param {function|object} metaArg A class, a component instance, or meta object..
* @returns {object|string|undefined}
*/
var getMeta = function getMeta(metaArg) {
// literal
if (isMeta(metaArg)) return metaArg;
// from prop
else if (isMeta((0, _get3.default)('_meta', metaArg))) return metaArg._meta;
// from class
else if (isMeta((0, _get3.default)('constructor._meta', metaArg))) return metaArg.constructor._meta;
};
var metaHasKeyValue = (0, _curry3.default)(function (key, val, metaArg) {
return (0, _flow3.default)(getMeta, (0, _get3.default)(key), (0, _eq3.default)(val))(metaArg);
});
var isType = exports.isType = metaHasKeyValue('type');
// ----------------------------------------
// Export
// ----------------------------------------
// type
var isAddon = exports.isAddon = isType(TYPES.ADDON);
var isCollection = exports.isCollection = isType(TYPES.COLLECTION);
var isElement = exports.isElement = isType(TYPES.ELEMENT);
var isView = exports.isView = isType(TYPES.VIEW);
var isModule = exports.isModule = isType(TYPES.MODULE);
// parent
var isParent = exports.isParent = (0, _flow3.default)(getMeta, (0, _has3.default)('parent'), (0, _eq3.default)(false));
var isChild = exports.isChild = (0, _flow3.default)(getMeta, (0, _has3.default)('parent'));
// other
var isPrivate = exports.isPrivate = (0, _flow3.default)(getMeta, (0, _get3.default)('name'), (0, _startsWith3.default)('_'));
/***/ },
/* 836 */
/*!*******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/fp/startsWith.js ***!
\*******************************************************/
/***/ function(module, exports, __webpack_require__) {
var convert = __webpack_require__(/*! ./convert */ 724),
func = convert('startsWith', __webpack_require__(/*! ../startsWith */ 622));
func.placeholder = __webpack_require__(/*! ./placeholder */ 727);
module.exports = func;
/***/ },
/* 837 */
/*!************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/fp/has.js ***!
\************************************************/
/***/ function(module, exports, __webpack_require__) {
var convert = __webpack_require__(/*! ./convert */ 724),
func = convert('has', __webpack_require__(/*! ../has */ 535));
func.placeholder = __webpack_require__(/*! ./placeholder */ 727);
module.exports = func;
/***/ },
/* 838 */
/*!***********************************************!*\
!*** ./~/semantic-ui-react/~/lodash/fp/eq.js ***!
\***********************************************/
/***/ function(module, exports, __webpack_require__) {
var convert = __webpack_require__(/*! ./convert */ 724),
func = convert('eq', __webpack_require__(/*! ../eq */ 573));
func.placeholder = __webpack_require__(/*! ./placeholder */ 727);
module.exports = func;
/***/ },
/* 839 */
/*!**************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/fp/curry.js ***!
\**************************************************/
/***/ function(module, exports, __webpack_require__) {
var convert = __webpack_require__(/*! ./convert */ 724),
func = convert('curry', __webpack_require__(/*! ../curry */ 790));
func.placeholder = __webpack_require__(/*! ./placeholder */ 727);
module.exports = func;
/***/ },
/* 840 */
/*!************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/fp/get.js ***!
\************************************************/
/***/ function(module, exports, __webpack_require__) {
var convert = __webpack_require__(/*! ./convert */ 724),
func = convert('get', __webpack_require__(/*! ../get */ 678));
func.placeholder = __webpack_require__(/*! ./placeholder */ 727);
module.exports = func;
/***/ },
/* 841 */
/*!***************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/fp/values.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
var convert = __webpack_require__(/*! ./convert */ 724),
func = convert('values', __webpack_require__(/*! ../values */ 831), __webpack_require__(/*! ./_falseOptions */ 796));
func.placeholder = __webpack_require__(/*! ./placeholder */ 727);
module.exports = func;
/***/ },
/* 842 */
/*!******************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/lib/SUI.js ***!
\******************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ICONS_AND_ALIASES = exports.ICON_ALIASES = exports.ICONS = exports.NETWORKS_AND_WEBSITE_ICONS = exports.PAYMENT_OPTIONS_ICONS = exports.CURRENCY_ICONS = exports.TEXT_EDITOR_ICONS = exports.TABLES_ICONS = exports.MAP_LOCATIONS_TRANSPORTATION_ICONS = exports.AUDIO_ICONS = exports.RATING_ICONS = exports.TECHNOLOGIES_ICONS = exports.FILE_SYSTEM_ICONS = exports.COMPUTER_ICONS = exports.MOBILE_ICONS = exports.POINTERS_ICONS = exports.MEDIA_ICONS = exports.ITEM_SELECTION_ICONS = exports.SHAPES_ICONS = exports.LITERAL_OBJECTS_ICONS = exports.VIEW_ADJUSTMENT_ICONS = exports.ACCESSIBILITY_ICONS = exports.GENDER_SEXUALITY_ICONS = exports.USERS_ICONS = exports.MESSAGES_ICONS = exports.USER_ACTIONS_ICONS = exports.WEB_CONTENT_ICONS = exports.WIDTHS = exports.VERTICAL_ALIGNMENTS = exports.TEXT_ALIGNMENTS = exports.SIZES = exports.FLOATS = exports.COLORS = undefined;
var _values2 = __webpack_require__(/*! lodash/values */ 831);
var _values3 = _interopRequireDefault(_values2);
var _keys2 = __webpack_require__(/*! lodash/keys */ 634);
var _keys3 = _interopRequireDefault(_keys2);
var _numberToWord = __webpack_require__(/*! ./numberToWord */ 694);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
var COLORS = exports.COLORS = ['red', 'orange', 'yellow', 'olive', 'green', 'teal', 'blue', 'violet', 'purple', 'pink', 'brown', 'grey', 'black'];
var FLOATS = exports.FLOATS = ['left', 'right'];
var SIZES = exports.SIZES = ['mini', 'tiny', 'small', 'medium', 'large', 'big', 'huge', 'massive'];
var TEXT_ALIGNMENTS = exports.TEXT_ALIGNMENTS = ['left', 'center', 'right', 'justified'];
var VERTICAL_ALIGNMENTS = exports.VERTICAL_ALIGNMENTS = ['bottom', 'middle', 'top'];
var WIDTHS = exports.WIDTHS = [].concat(_toConsumableArray((0, _keys3.default)(_numberToWord.numberToWordMap)), _toConsumableArray((0, _keys3.default)(_numberToWord.numberToWordMap).map(Number)), _toConsumableArray((0, _values3.default)(_numberToWord.numberToWordMap)));
// Generated from:
// https://github.com/Semantic-Org/Semantic-UI/blob/master/dist/components/icon.css
var WEB_CONTENT_ICONS = exports.WEB_CONTENT_ICONS = ['search', 'mail outline', 'signal', 'setting', 'home', 'inbox', 'browser', 'tag', 'tags', 'image', 'calendar', 'comment', 'shop', 'comments', 'external', 'privacy', 'settings', 'comments', 'external', 'trophy', 'payment', 'feed', 'alarm outline', 'tasks', 'cloud', 'lab', 'mail', 'dashboard', 'comment outline', 'comments outline', 'sitemap', 'idea', 'alarm', 'terminal', 'code', 'protect', 'calendar outline', 'ticket', 'external square', 'bug', 'mail square', 'history', 'options', 'text telephone', 'find', 'wifi', 'alarm mute', 'alarm mute outline', 'copyright', 'at', 'eyedropper', 'paint brush', 'heartbeat', 'mouse pointer', 'hourglass empty', 'hourglass start', 'hourglass half', 'hourglass end', 'hourglass full', 'hand pointer', 'trademark', 'registered', 'creative commons', 'add to calendar', 'remove from calendar', 'delete calendar', 'checked calendar', 'industry', 'shopping bag', 'shopping basket', 'hashtag', 'percent'];
var USER_ACTIONS_ICONS = exports.USER_ACTIONS_ICONS = ['wait', 'download', 'repeat', 'refresh', 'lock', 'bookmark', 'print', 'write', 'adjust', 'theme', 'edit', 'external share', 'ban', 'mail forward', 'share', 'expand', 'compress', 'unhide', 'hide', 'random', 'retweet', 'sign out', 'pin', 'sign in', 'upload', 'call', 'remove bookmark', 'call square', 'unlock', 'configure', 'filter', 'wizard', 'undo', 'exchange', 'cloud download', 'cloud upload', 'reply', 'reply all', 'erase', 'unlock alternate', 'write square', 'share square', 'archive', 'translate', 'recycle', 'send', 'send outline', 'share alternate', 'share alternate square', 'add to cart', 'in cart', 'add user', 'remove user', 'object group', 'object ungroup', 'clone', 'talk', 'talk outline'];
var MESSAGES_ICONS = exports.MESSAGES_ICONS = ['help circle', 'info circle', 'warning circle', 'warning sign', 'announcement', 'help', 'info', 'warning', 'birthday', 'help circle outline'];
var USERS_ICONS = exports.USERS_ICONS = ['user', 'users', 'doctor', 'handicap', 'student', 'child', 'spy'];
var GENDER_SEXUALITY_ICONS = exports.GENDER_SEXUALITY_ICONS = ['female', 'male', 'woman', 'man', 'non binary transgender', 'intergender', 'transgender', 'lesbian', 'gay', 'heterosexual', 'other gender', 'other gender vertical', 'other gender horizontal', 'neuter', 'genderless'];
var ACCESSIBILITY_ICONS = exports.ACCESSIBILITY_ICONS = ['universal access', 'wheelchair', 'blind', 'audio description', 'volume control phone', 'braille', 'asl', 'assistive listening systems', 'deafness', 'sign language', 'low vision'];
var VIEW_ADJUSTMENT_ICONS = exports.VIEW_ADJUSTMENT_ICONS = ['block layout', 'grid layout', 'list layout', 'zoom', 'zoom out', 'resize vertical', 'resize horizontal', 'maximize', 'crop'];
var LITERAL_OBJECTS_ICONS = exports.LITERAL_OBJECTS_ICONS = ['cocktail', 'road', 'flag', 'book', 'gift', 'leaf', 'fire', 'plane', 'magnet', 'lemon', 'world', 'travel', 'shipping', 'money', 'legal', 'lightning', 'umbrella', 'treatment', 'suitcase', 'bar', 'flag outline', 'flag checkered', 'puzzle', 'fire extinguisher', 'rocket', 'anchor', 'bullseye', 'sun', 'moon', 'fax', 'life ring', 'bomb', 'soccer', 'calculator', 'diamond', 'sticky note', 'sticky note outline', 'law', 'hand peace', 'hand rock', 'hand paper', 'hand scissors', 'hand lizard', 'hand spock', 'tv'];
var SHAPES_ICONS = exports.SHAPES_ICONS = ['crosshairs', 'asterisk', 'square outline', 'certificate', 'square', 'quote left', 'quote right', 'spinner', 'circle', 'ellipsis horizontal', 'ellipsis vertical', 'cube', 'cubes', 'circle notched', 'circle thin'];
var ITEM_SELECTION_ICONS = exports.ITEM_SELECTION_ICONS = ['checkmark', 'remove', 'checkmark box', 'move', 'add circle', 'minus circle', 'remove circle', 'check circle', 'remove circle outline', 'check circle outline', 'plus', 'minus', 'add square', 'radio', 'minus square', 'minus square outline', 'check square', 'selected radio', 'plus square outline', 'toggle off', 'toggle on'];
var MEDIA_ICONS = exports.MEDIA_ICONS = ['film', 'sound', 'photo', 'bar chart', 'camera retro', 'newspaper', 'area chart', 'pie chart', 'line chart'];
var POINTERS_ICONS = exports.POINTERS_ICONS = ['arrow circle outline down', 'arrow circle outline up', 'chevron left', 'chevron right', 'arrow left', 'arrow right', 'arrow up', 'arrow down', 'chevron up', 'chevron down', 'pointing right', 'pointing left', 'pointing up', 'pointing down', 'arrow circle left', 'arrow circle right', 'arrow circle up', 'arrow circle down', 'caret down', 'caret up', 'caret left', 'caret right', 'angle double left', 'angle double right', 'angle double up', 'angle double down', 'angle left', 'angle right', 'angle up', 'angle down', 'chevron circle left', 'chevron circle right', 'chevron circle up', 'chevron circle down', 'toggle down', 'toggle up', 'toggle right', 'long arrow down', 'long arrow up', 'long arrow left', 'long arrow right', 'arrow circle outline right', 'arrow circle outline left', 'toggle left'];
var MOBILE_ICONS = exports.MOBILE_ICONS = ['tablet', 'mobile', 'battery full', 'battery high', 'battery medium', 'battery low', 'battery empty'];
var COMPUTER_ICONS = exports.COMPUTER_ICONS = ['power', 'trash outline', 'disk outline', 'desktop', 'laptop', 'game', 'keyboard', 'plug'];
var FILE_SYSTEM_ICONS = exports.FILE_SYSTEM_ICONS = ['trash', 'file outline', 'folder', 'folder open', 'file text outline', 'folder outline', 'folder open outline', 'level up', 'level down', 'file', 'file text', 'file pdf outline', 'file word outline', 'file excel outline', 'file powerpoint outline', 'file image outline', 'file archive outline', 'file audio outline', 'file video outline', 'file code outline'];
var TECHNOLOGIES_ICONS = exports.TECHNOLOGIES_ICONS = ['qrcode', 'barcode', 'rss', 'fork', 'html5', 'css3', 'rss square', 'openid', 'database', 'server', 'usb', 'bluetooth', 'bluetooth alternative'];
var RATING_ICONS = exports.RATING_ICONS = ['heart', 'star', 'empty star', 'thumbs outline up', 'thumbs outline down', 'star half', 'empty heart', 'smile', 'frown', 'meh', 'star half empty', 'thumbs up', 'thumbs down'];
var AUDIO_ICONS = exports.AUDIO_ICONS = ['music', 'video play outline', 'volume off', 'volume down', 'volume up', 'record', 'step backward', 'fast backward', 'backward', 'play', 'pause', 'stop', 'forward', 'fast forward', 'step forward', 'eject', 'unmute', 'mute', 'video play', 'closed captioning', 'pause circle', 'pause circle outline', 'stop circle', 'stop circle outline'];
var MAP_LOCATIONS_TRANSPORTATION_ICONS = exports.MAP_LOCATIONS_TRANSPORTATION_ICONS = ['marker', 'coffee', 'food', 'building outline', 'hospital', 'emergency', 'first aid', 'military', 'h', 'location arrow', 'compass', 'space shuttle', 'university', 'building', 'paw', 'spoon', 'car', 'taxi', 'tree', 'bicycle', 'bus', 'ship', 'motorcycle', 'street view', 'hotel', 'train', 'subway', 'map pin', 'map signs', 'map outline', 'map'];
var TABLES_ICONS = exports.TABLES_ICONS = ['table', 'columns', 'sort', 'sort descending', 'sort ascending', 'sort alphabet ascending', 'sort alphabet descending', 'sort content ascending', 'sort content descending', 'sort numeric ascending', 'sort numeric descending'];
var TEXT_EDITOR_ICONS = exports.TEXT_EDITOR_ICONS = ['font', 'bold', 'italic', 'text height', 'text width', 'align left', 'align center', 'align right', 'align justify', 'list', 'outdent', 'indent', 'linkify', 'cut', 'copy', 'attach', 'save', 'content', 'unordered list', 'ordered list', 'strikethrough', 'underline', 'paste', 'unlinkify', 'superscript', 'subscript', 'header', 'paragraph', 'text cursor'];
var CURRENCY_ICONS = exports.CURRENCY_ICONS = ['euro', 'pound', 'dollar', 'rupee', 'yen', 'ruble', 'won', 'bitcoin', 'lira', 'shekel'];
var PAYMENT_OPTIONS_ICONS = exports.PAYMENT_OPTIONS_ICONS = ['paypal', 'google wallet', 'visa', 'mastercard', 'discover', 'american express', 'paypal card', 'stripe', 'japan credit bureau', 'diners club', 'credit card alternative'];
var NETWORKS_AND_WEBSITE_ICONS = exports.NETWORKS_AND_WEBSITE_ICONS = ['twitter square', 'facebook square', 'linkedin square', 'github square', 'twitter', 'facebook f', 'github', 'pinterest', 'pinterest square', 'google plus square', 'google plus', 'linkedin', 'github alternate', 'maxcdn', 'youtube square', 'youtube', 'xing', 'xing square', 'youtube play', 'dropbox', 'stack overflow', 'instagram', 'flickr', 'adn', 'bitbucket', 'bitbucket square', 'tumblr', 'tumblr square', 'apple', 'windows', 'android', 'linux', 'dribble', 'skype', 'foursquare', 'trello', 'gittip', 'vk', 'weibo', 'renren', 'pagelines', 'stack exchange', 'vimeo square', 'slack', 'wordpress', 'yahoo', 'google', 'reddit', 'reddit square', 'stumbleupon circle', 'stumbleupon', 'delicious', 'digg', 'pied piper', 'pied piper alternate', 'drupal', 'joomla', 'behance', 'behance square', 'steam', 'steam square', 'spotify', 'deviantart', 'soundcloud', 'vine', 'codepen', 'jsfiddle', 'rebel', 'empire', 'git square', 'git', 'hacker news', 'tencent weibo', 'qq', 'wechat', 'slideshare', 'twitch', 'yelp', 'lastfm', 'lastfm square', 'ioxhost', 'angellist', 'meanpath', 'buysellads', 'connectdevelop', 'dashcube', 'forumbee', 'leanpub', 'sellsy', 'shirtsinbulk', 'simplybuilt', 'skyatlas', 'facebook', 'pinterest', 'whatsapp', 'viacoin', 'medium', 'y combinator', 'optinmonster', 'opencart', 'expeditedssl', 'gg', 'gg circle', 'tripadvisor', 'odnoklassniki', 'odnoklassniki square', 'pocket', 'wikipedia', 'safari', 'chrome', 'firefox', 'opera', 'internet explorer', 'contao', '500px', 'amazon', 'houzz', 'vimeo', 'black tie', 'fonticons', 'reddit alien', 'microsoft edge', 'codiepie', 'modx', 'fort awesome', 'product hunt', 'mixcloud', 'scribd', 'gitlab', 'wpbeginner', 'wpforms', 'envira gallery', 'glide', 'glide g', 'viadeo', 'viadeo square', 'snapchat', 'snapchat ghost', 'snapchat square', 'pied piper hat', 'first order', 'yoast', 'themeisle', 'google plus circle', 'font awesome'];
var ICONS = exports.ICONS = [].concat(WEB_CONTENT_ICONS, USER_ACTIONS_ICONS, MESSAGES_ICONS, USERS_ICONS, GENDER_SEXUALITY_ICONS, ACCESSIBILITY_ICONS, VIEW_ADJUSTMENT_ICONS, LITERAL_OBJECTS_ICONS, SHAPES_ICONS, ITEM_SELECTION_ICONS, MEDIA_ICONS, POINTERS_ICONS, MOBILE_ICONS, COMPUTER_ICONS, FILE_SYSTEM_ICONS, TECHNOLOGIES_ICONS, RATING_ICONS, AUDIO_ICONS, MAP_LOCATIONS_TRANSPORTATION_ICONS, TABLES_ICONS, TEXT_EDITOR_ICONS, CURRENCY_ICONS, PAYMENT_OPTIONS_ICONS, NETWORKS_AND_WEBSITE_ICONS);
var ICON_ALIASES = exports.ICON_ALIASES = ['like', 'favorite', 'video', 'check', 'close', 'cancel', 'delete', 'x', 'zoom in', 'magnify', 'shutdown', 'clock', 'time', 'play circle outline', 'headphone', 'camera', 'video camera', 'picture', 'pencil', 'compose', 'point', 'tint', 'signup', 'plus circle', 'question circle', 'dont', 'minimize', 'add', 'exclamation circle', 'attention', 'eye', 'exclamation triangle', 'shuffle', 'chat', 'cart', 'shopping cart', 'bar graph', 'key', 'cogs', 'discussions', 'like outline', 'dislike outline', 'heart outline', 'log out', 'thumb tack', 'winner', 'phone', 'bookmark outline', 'phone square', 'credit card', 'hdd outline', 'bullhorn', 'bell outline', 'hand outline right', 'hand outline left', 'hand outline up', 'hand outline down', 'globe', 'wrench', 'briefcase', 'group', 'linkify', 'chain', 'flask', 'sidebar', 'bars', 'list ul', 'list ol', 'numbered list', 'magic', 'truck', 'currency', 'triangle down', 'dropdown', 'triangle up', 'triangle left', 'triangle right', 'envelope', 'conversation', 'rain', 'clipboard', 'lightbulb', 'bell', 'ambulance', 'medkit', 'fighter jet', 'beer', 'plus square', 'computer', 'circle outline', 'gamepad', 'star half full', 'broken chain', 'question', 'exclamation', 'eraser', 'microphone', 'microphone slash', 'shield', 'target', 'play circle', 'pencil square', 'eur', 'gbp', 'usd', 'inr', 'cny', 'rmb', 'jpy', 'rouble', 'rub', 'krw', 'btc', 'gratipay', 'zip', 'dot circle outline', 'try', 'graduation', 'circle outline', 'sliders', 'weixin', 'tty', 'teletype', 'binoculars', 'power cord', 'wifi', 'visa card', 'mastercard card', 'discover card', 'amex', 'american express card', 'stripe card', 'bell slash', 'bell slash outline', 'area graph', 'pie graph', 'line graph', 'cc', 'sheqel', 'ils', 'plus cart', 'arrow down cart', 'detective', 'venus', 'mars', 'mercury', 'intersex', 'venus double', 'female homosexual', 'mars double', 'male homosexual', 'venus mars', 'mars stroke', 'mars alternate', 'mars vertical', 'mars stroke vertical', 'mars horizontal', 'mars stroke horizontal', 'asexual', 'facebook official', 'user plus', 'user times', 'user close', 'user cancel', 'user delete', 'user x', 'bed', 'yc', 'ycombinator', 'battery four', 'battery three', 'battery three quarters', 'battery two', 'battery half', 'battery one', 'battery quarter', 'battery zero', 'i cursor', 'jcb', 'japan credit bureau card', 'diners club card', 'balance', 'hourglass outline', 'hourglass zero', 'hourglass one', 'hourglass two', 'hourglass three', 'hourglass four', 'grab', 'hand victory', 'tm', 'r circle', 'television', 'five hundred pixels', 'calendar plus', 'calendar minus', 'calendar times', 'calendar check', 'factory', 'commenting', 'commenting outline', 'edge', 'ms edge', 'wordpress beginner', 'wordpress forms', 'envira', 'question circle outline', 'assistive listening devices', 'als', 'ald', 'asl interpreting', 'deaf', 'american sign language interpreting', 'hard of hearing', 'signing', 'new pied piper', 'theme isle', 'google plus official', 'fa'];
var ICONS_AND_ALIASES = exports.ICONS_AND_ALIASES = [].concat(_toConsumableArray(ICONS), ICON_ALIASES);
/***/ },
/* 843 */
/*!********************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/elements/Button/index.js ***!
\********************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _Button = __webpack_require__(/*! ./Button */ 844);
var _Button2 = _interopRequireDefault(_Button);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = _Button2.default;
/***/ },
/* 844 */
/*!*********************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/elements/Button/Button.js ***!
\*********************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _Icon = __webpack_require__(/*! ../Icon/Icon */ 845);
var _Icon2 = _interopRequireDefault(_Icon);
var _Label = __webpack_require__(/*! ../Label/Label */ 848);
var _Label2 = _interopRequireDefault(_Label);
var _ButtonContent = __webpack_require__(/*! ./ButtonContent */ 862);
var _ButtonContent2 = _interopRequireDefault(_ButtonContent);
var _ButtonGroup = __webpack_require__(/*! ./ButtonGroup */ 863);
var _ButtonGroup2 = _interopRequireDefault(_ButtonGroup);
var _ButtonOr = __webpack_require__(/*! ./ButtonOr */ 864);
var _ButtonOr2 = _interopRequireDefault(_ButtonOr);
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; }
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
var debug = (0, _lib.makeDebugger)('button');
var _meta = {
name: 'Button',
type: _lib.META.TYPES.ELEMENT,
props: {
animated: ['fade', 'vertical'],
attached: ['left', 'right', 'top', 'bottom'],
color: [].concat(_toConsumableArray(_lib.SUI.COLORS), ['facebook', 'twitter', 'google plus', 'vk', 'linkedin', 'instagram', 'youtube']),
floated: _lib.SUI.FLOATS,
labelPosition: ['right', 'left'],
size: _lib.SUI.SIZES
}
};
/**
* A Button indicates a possible user action
* @see Form
* @see Icon
* @see Label
*/
var Button = function (_Component) {
_inherits(Button, _Component);
function Button() {
var _ref;
var _temp, _this, _ret;
_classCallCheck(this, Button);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Button.__proto__ || Object.getPrototypeOf(Button)).call.apply(_ref, [this].concat(args))), _this), _this.handleClick = function (e) {
var _this$props = _this.props,
disabled = _this$props.disabled,
onClick = _this$props.onClick;
if (disabled) {
e.preventDefault();
return;
}
if (onClick) onClick(e, _this.props);
}, _temp), _possibleConstructorReturn(_this, _ret);
}
_createClass(Button, [{
key: 'render',
value: function render() {
var _props = this.props,
active = _props.active,
animated = _props.animated,
attached = _props.attached,
basic = _props.basic,
children = _props.children,
circular = _props.circular,
className = _props.className,
color = _props.color,
compact = _props.compact,
content = _props.content,
disabled = _props.disabled,
floated = _props.floated,
fluid = _props.fluid,
icon = _props.icon,
inverted = _props.inverted,
label = _props.label,
labelPosition = _props.labelPosition,
loading = _props.loading,
negative = _props.negative,
positive = _props.positive,
primary = _props.primary,
secondary = _props.secondary,
size = _props.size,
tabIndex = _props.tabIndex,
toggle = _props.toggle;
var labeledClasses = (0, _classnames2.default)((0, _lib.useKeyOrValueAndKey)(labelPosition || !!label, 'labeled'));
var baseClasses = (0, _classnames2.default)(color, size, (0, _lib.useKeyOnly)(active, 'active'), (0, _lib.useKeyOrValueAndKey)(animated, 'animated'), (0, _lib.useKeyOrValueAndKey)(attached, 'attached'), (0, _lib.useKeyOnly)(basic, 'basic'), (0, _lib.useKeyOnly)(circular, 'circular'), (0, _lib.useKeyOnly)(compact, 'compact'), (0, _lib.useKeyOnly)(disabled, 'disabled'), (0, _lib.useValueAndKey)(floated, 'floated'), (0, _lib.useKeyOnly)(fluid, 'fluid'), (0, _lib.useKeyOnly)(icon === true || icon && (labelPosition || !children && !content), 'icon'), (0, _lib.useKeyOnly)(inverted, 'inverted'), (0, _lib.useKeyOnly)(loading, 'loading'), (0, _lib.useKeyOnly)(negative, 'negative'), (0, _lib.useKeyOnly)(positive, 'positive'), (0, _lib.useKeyOnly)(primary, 'primary'), (0, _lib.useKeyOnly)(secondary, 'secondary'), (0, _lib.useKeyOnly)(toggle, 'toggle'));
var rest = (0, _lib.getUnhandledProps)(Button, this.props);
var ElementType = (0, _lib.getElementType)(Button, this.props, function () {
if (!(0, _isNil3.default)(label) || !(0, _isNil3.default)(attached)) return 'div';
});
var computedTabIndex = void 0;
if (!(0, _isNil3.default)(tabIndex)) computedTabIndex = tabIndex;else if (disabled) computedTabIndex = -1;else if (ElementType === 'div') computedTabIndex = 0;
if (!(0, _isNil3.default)(children)) {
var _classes = (0, _classnames2.default)('ui', baseClasses, labeledClasses, 'button', className);
debug('render children:', { classes: _classes });
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: _classes, tabIndex: computedTabIndex, onClick: this.handleClick }),
children
);
}
var labelElement = _Label2.default.create(label, {
basic: true,
pointing: labelPosition === 'left' ? 'right' : 'left'
});
if (labelElement) {
var _classes2 = (0, _classnames2.default)('ui', baseClasses, 'button', className);
var containerClasses = (0, _classnames2.default)('ui', labeledClasses, 'button', className);
debug('render label:', { classes: _classes2, containerClasses: containerClasses }, this.props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: containerClasses, onClick: this.handleClick }),
labelPosition === 'left' && labelElement,
_react2.default.createElement(
'button',
{ className: _classes2 },
_Icon2.default.create(icon),
' ',
content
),
(labelPosition === 'right' || !labelPosition) && labelElement
);
}
if (!(0, _isNil3.default)(icon) && (0, _isNil3.default)(label)) {
var _classes3 = (0, _classnames2.default)('ui', labeledClasses, baseClasses, 'button', className);
debug('render icon && !label:', { classes: _classes3 });
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: _classes3, tabIndex: computedTabIndex, onClick: this.handleClick }),
_Icon2.default.create(icon),
' ',
content
);
}
var classes = (0, _classnames2.default)('ui', labeledClasses, baseClasses, 'button', className);
debug('render default:', { classes: classes });
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes, tabIndex: computedTabIndex, onClick: this.handleClick }),
content
);
}
}]);
return Button;
}(_react.Component);
Button.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** A button can show it is currently the active user selection */
active: _react.PropTypes.bool,
/** A button can animate to show hidden content */
animated: _react.PropTypes.oneOfType([_react.PropTypes.bool, _react.PropTypes.oneOf(_meta.props.animated)]),
/** A button can be attached to the top or bottom of other content */
attached: _react.PropTypes.oneOf(_meta.props.attached),
/** A basic button is less pronounced */
basic: _react.PropTypes.bool,
/** Primary content. */
children: _lib.customPropTypes.every([_react.PropTypes.node, _lib.customPropTypes.disallow(['label']), _lib.customPropTypes.givenProps({
icon: _react.PropTypes.oneOfType([_react.PropTypes.string.isRequired, _react.PropTypes.object.isRequired, _react.PropTypes.element.isRequired])
}, _lib.customPropTypes.disallow(['icon']))]),
/** A button can be circular */
circular: _react.PropTypes.bool,
/** Additional classes. */
className: _react.PropTypes.string,
/** Shorthand for primary content. */
content: _lib.customPropTypes.contentShorthand,
/** A button can have different colors */
color: _react.PropTypes.oneOf(_meta.props.color),
/** A button can reduce its padding to fit into tighter spaces */
compact: _react.PropTypes.bool,
/** A button can show it is currently unable to be interacted with */
disabled: _react.PropTypes.bool,
/** A button can be aligned to the left or right of its container */
floated: _react.PropTypes.oneOf(_meta.props.floated),
/** A button can take the width of its container */
fluid: _react.PropTypes.bool,
/** Add an Icon by name, props object, or pass an <Icon /> */
icon: _lib.customPropTypes.some([_react.PropTypes.bool, _react.PropTypes.string, _react.PropTypes.object, _react.PropTypes.element]),
/** A button can be formatted to appear on dark backgrounds */
inverted: _react.PropTypes.bool,
/** A labeled button can format a Label or Icon to appear on the left or right */
labelPosition: _react.PropTypes.oneOf(_meta.props.labelPosition),
/** Add a Label by text, props object, or pass a <Label /> */
label: _lib.customPropTypes.some([_react.PropTypes.string, _react.PropTypes.object, _react.PropTypes.element]),
/** A button can show a loading indicator */
loading: _react.PropTypes.bool,
/** A button can hint towards a negative consequence */
negative: _react.PropTypes.bool,
/**
* Called after user's click.
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All props.
*/
onClick: _react.PropTypes.func,
/** A button can hint towards a positive consequence */
positive: _react.PropTypes.bool,
/** A button can be formatted to show different levels of emphasis */
primary: _react.PropTypes.bool,
/** A button can be formatted to show different levels of emphasis */
secondary: _react.PropTypes.bool,
/** A button can have different sizes */
size: _react.PropTypes.oneOf(_meta.props.size),
/** A button can receive focus. */
tabIndex: _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.number]),
/** A button can be formatted to toggle on and off */
toggle: _react.PropTypes.bool
};
Button.defaultProps = {
as: 'button'
};
Button._meta = _meta;
Button.Content = _ButtonContent2.default;
Button.Group = _ButtonGroup2.default;
Button.Or = _ButtonOr2.default;
Button.create = (0, _lib.createShorthandFactory)(Button, function (value) {
return { content: value };
});
exports.default = Button;
/***/ },
/* 845 */
/*!*****************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/elements/Icon/Icon.js ***!
\*****************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _without2 = __webpack_require__(/*! lodash/without */ 846);
var _without3 = _interopRequireDefault(_without2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _IconGroup = __webpack_require__(/*! ./IconGroup */ 847);
var _IconGroup2 = _interopRequireDefault(_IconGroup);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* An icon is a glyph used to represent something else
* @see Image
*/
function Icon(props) {
var bordered = props.bordered,
className = props.className,
circular = props.circular,
color = props.color,
corner = props.corner,
disabled = props.disabled,
fitted = props.fitted,
flipped = props.flipped,
inverted = props.inverted,
link = props.link,
loading = props.loading,
name = props.name,
rotated = props.rotated,
size = props.size;
var classes = (0, _classnames2.default)(size, color, (0, _lib.useKeyOnly)(bordered, 'bordered'), (0, _lib.useKeyOnly)(circular, 'circular'), (0, _lib.useKeyOnly)(corner, 'corner'), (0, _lib.useKeyOnly)(disabled, 'disabled'), (0, _lib.useKeyOnly)(fitted, 'fitted'), (0, _lib.useValueAndKey)(flipped, 'flipped'), (0, _lib.useKeyOnly)(inverted, 'inverted'), (0, _lib.useKeyOnly)(link, 'link'), (0, _lib.useKeyOnly)(loading, 'loading'), (0, _lib.useValueAndKey)(rotated, 'rotated'), name, className, 'icon');
var rest = (0, _lib.getUnhandledProps)(Icon, props);
var ElementType = (0, _lib.getElementType)(Icon, props);
return _react2.default.createElement(ElementType, _extends({}, rest, { 'aria-hidden': 'true', className: classes }));
}
Icon.Group = _IconGroup2.default;
Icon._meta = {
name: 'Icon',
type: _lib.META.TYPES.ELEMENT,
props: {
color: _lib.SUI.COLORS,
flipped: ['horizontally', 'vertically'],
name: _lib.SUI.ICONS_AND_ALIASES,
rotated: ['clockwise', 'counterclockwise'],
size: (0, _without3.default)(_lib.SUI.SIZES, 'medium')
}
};
Icon.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Formatted to appear bordered */
bordered: _react.PropTypes.bool,
/** Additional classes. */
className: _react.PropTypes.string,
/** Icon can formatted to appear circular */
circular: _react.PropTypes.bool,
/** Color of the icon. */
color: _react.PropTypes.oneOf(Icon._meta.props.color),
/** Icons can display a smaller corner icon */
corner: _react.PropTypes.bool,
/** Show that the icon is inactive */
disabled: _react.PropTypes.bool,
/** Fitted, without space to left or right of Icon. */
fitted: _react.PropTypes.bool,
/** Icon can flipped */
flipped: _react.PropTypes.oneOf(Icon._meta.props.flipped),
/** Formatted to have its colors inverted for contrast */
inverted: _react.PropTypes.bool,
/** Name of the icon */
name: _lib.customPropTypes.suggest(Icon._meta.props.name),
/** Icon can be formatted as a link */
link: _react.PropTypes.bool,
/** Icon can be used as a simple loader */
loading: _react.PropTypes.bool,
/** Icon can rotated */
rotated: _react.PropTypes.oneOf(Icon._meta.props.rotated),
/** Size of the icon. */
size: _react.PropTypes.oneOf(Icon._meta.props.size)
};
Icon.defaultProps = {
as: 'i'
};
Icon.create = (0, _lib.createShorthandFactory)(Icon, function (value) {
return { name: value };
});
exports.default = Icon;
/***/ },
/* 846 */
/*!*************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/without.js ***!
\*************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseDifference = __webpack_require__(/*! ./_baseDifference */ 595),
baseRest = __webpack_require__(/*! ./_baseRest */ 610),
isArrayLikeObject = __webpack_require__(/*! ./isArrayLikeObject */ 619);
/**
* Creates an array excluding all given values using
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons.
*
* **Note:** Unlike `_.pull`, this method returns a new array.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to inspect.
* @param {...*} [values] The values to exclude.
* @returns {Array} Returns the new array of filtered values.
* @see _.difference, _.xor
* @example
*
* _.without([2, 1, 2, 3], 1, 2);
* // => [3]
*/
var without = baseRest(function(array, values) {
return isArrayLikeObject(array)
? baseDifference(array, values)
: [];
});
module.exports = without;
/***/ },
/* 847 */
/*!**********************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/elements/Icon/IconGroup.js ***!
\**********************************************************************/
/***/ 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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Several icons can be used together as a group
*/
function IconGroup(props) {
var children = props.children,
className = props.className,
size = props.size;
var classes = (0, _classnames2.default)(size, 'icons', className);
var rest = (0, _lib.getUnhandledProps)(IconGroup, props);
var ElementType = (0, _lib.getElementType)(IconGroup, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
IconGroup._meta = {
name: 'IconGroup',
parent: 'Icon',
type: _lib.META.TYPES.ELEMENT,
props: {
size: _lib.SUI.SIZES
}
};
IconGroup.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** Size of the icon group. */
size: _react.PropTypes.oneOf(IconGroup._meta.props.size)
};
IconGroup.defaultProps = {
as: 'i'
};
exports.default = IconGroup;
/***/ },
/* 848 */
/*!*******************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/elements/Label/Label.js ***!
\*******************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _isUndefined2 = __webpack_require__(/*! lodash/isUndefined */ 621);
var _isUndefined3 = _interopRequireDefault(_isUndefined2);
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _Icon = __webpack_require__(/*! ../Icon/Icon */ 845);
var _Icon2 = _interopRequireDefault(_Icon);
var _Image = __webpack_require__(/*! ../Image/Image */ 849);
var _Image2 = _interopRequireDefault(_Image);
var _LabelDetail = __webpack_require__(/*! ./LabelDetail */ 860);
var _LabelDetail2 = _interopRequireDefault(_LabelDetail);
var _LabelGroup = __webpack_require__(/*! ./LabelGroup */ 861);
var _LabelGroup2 = _interopRequireDefault(_LabelGroup);
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 _meta = {
name: 'Label',
type: _lib.META.TYPES.ELEMENT,
props: {
attached: ['top', 'bottom', 'top right', 'top left', 'bottom left', 'bottom right'],
color: _lib.SUI.COLORS,
corner: ['left', 'right'],
pointing: ['above', 'below', 'left', 'right'],
ribbon: ['right'],
size: _lib.SUI.SIZES
}
};
/**
* A label displays content classification
*/
var Label = function (_Component) {
_inherits(Label, _Component);
function Label() {
var _ref;
var _temp, _this, _ret;
_classCallCheck(this, Label);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Label.__proto__ || Object.getPrototypeOf(Label)).call.apply(_ref, [this].concat(args))), _this), _this.handleClick = function (e) {
var onClick = _this.props.onClick;
if (onClick) onClick(e, _this.props);
}, _this.handleRemove = function (e) {
var onRemove = _this.props.onRemove;
if (onRemove) onRemove(e, _this.props);
}, _temp), _possibleConstructorReturn(_this, _ret);
}
_createClass(Label, [{
key: 'render',
value: function render() {
var _props = this.props,
active = _props.active,
attached = _props.attached,
basic = _props.basic,
children = _props.children,
circular = _props.circular,
className = _props.className,
color = _props.color,
content = _props.content,
corner = _props.corner,
detail = _props.detail,
empty = _props.empty,
floating = _props.floating,
horizontal = _props.horizontal,
icon = _props.icon,
image = _props.image,
onRemove = _props.onRemove,
pointing = _props.pointing,
removeIcon = _props.removeIcon,
ribbon = _props.ribbon,
size = _props.size,
tag = _props.tag;
var pointingClass = pointing === true && 'pointing' || (pointing === 'left' || pointing === 'right') && pointing + ' pointing' || (pointing === 'above' || pointing === 'below') && 'pointing ' + pointing;
var classes = (0, _classnames2.default)('ui', color, pointingClass, size, (0, _lib.useKeyOnly)(active, 'active'), (0, _lib.useKeyOnly)(basic, 'basic'), (0, _lib.useKeyOnly)(circular, 'circular'), (0, _lib.useKeyOnly)(empty, 'empty'), (0, _lib.useKeyOnly)(floating, 'floating'), (0, _lib.useKeyOnly)(horizontal, 'horizontal'), (0, _lib.useKeyOnly)(image === true, 'image'), (0, _lib.useKeyOnly)(tag, 'tag'), (0, _lib.useKeyOrValueAndKey)(corner, 'corner'), (0, _lib.useKeyOrValueAndKey)(ribbon, 'ribbon'), (0, _lib.useValueAndKey)(attached, 'attached'), 'label', className);
var rest = (0, _lib.getUnhandledProps)(Label, this.props);
var ElementType = (0, _lib.getElementType)(Label, this.props);
if (!(0, _isNil3.default)(children)) {
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes, onClick: this.handleClick }),
children
);
}
var removeIconShorthand = (0, _isUndefined3.default)(removeIcon) ? 'delete' : removeIcon;
return _react2.default.createElement(
ElementType,
_extends({ className: classes, onClick: this.handleClick }, rest),
_Icon2.default.create(icon),
typeof image !== 'boolean' && _Image2.default.create(image),
content,
(0, _lib.createShorthand)(_LabelDetail2.default, function (val) {
return { content: val };
}, detail),
onRemove && _Icon2.default.create(removeIconShorthand, { onClick: this.handleRemove })
);
}
}]);
return Label;
}(_react.Component);
// Label is not yet defined inside the class
// Do not use a static property initializer
Label.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** A label can be active. */
active: _react.PropTypes.bool,
/** A label can attach to a content segment. */
attached: _react.PropTypes.oneOf(_meta.props.attached),
/** A label can reduce its complexity. */
basic: _react.PropTypes.bool,
/** Primary content. */
children: _react.PropTypes.node,
/** A label can be circular. */
circular: _react.PropTypes.bool,
/** Additional classes. */
className: _react.PropTypes.string,
/** Color of the label. */
color: _react.PropTypes.oneOf(_meta.props.color),
/** Shorthand for primary content. */
content: _lib.customPropTypes.contentShorthand,
/** A label can position itself in the corner of an element. */
corner: _react.PropTypes.oneOfType([_react.PropTypes.bool, _react.PropTypes.oneOf(_meta.props.corner)]),
/** Shorthand for LabelDetail. */
detail: _lib.customPropTypes.itemShorthand,
/** Formats the label as a dot. */
empty: _lib.customPropTypes.every([_lib.customPropTypes.demand(['circular']), _react.PropTypes.bool]),
/** Float above another element in the upper right corner. */
floating: _react.PropTypes.bool,
/** A horizontal label is formatted to label content along-side it horizontally. */
horizontal: _react.PropTypes.bool,
/** Shorthand for Icon. */
icon: _lib.customPropTypes.itemShorthand,
/** A label can be formatted to emphasize an image or prop can be used as shorthand for Image. */
image: _react.PropTypes.oneOfType([_react.PropTypes.bool, _lib.customPropTypes.itemShorthand]),
/** A label can point to content next to it. */
pointing: _react.PropTypes.oneOfType([_react.PropTypes.bool, _react.PropTypes.oneOf(_meta.props.pointing)]),
/**
* Called on click.
*
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All props.
*/
onClick: _react.PropTypes.func,
/**
* Adds an "x" icon, called when "x" is clicked.
*
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All props.
*/
onRemove: _react.PropTypes.func,
/** Shorthand for Icon to appear as the last child and trigger onRemove. */
removeIcon: _lib.customPropTypes.itemShorthand,
/** A label can appear as a ribbon attaching itself to an element. */
ribbon: _react.PropTypes.oneOfType([_react.PropTypes.bool, _react.PropTypes.oneOf(_meta.props.ribbon)]),
/** A label can have different sizes. */
size: _react.PropTypes.oneOf(_meta.props.size),
/** A label can appear as a tag. */
tag: _react.PropTypes.bool
};
Label._meta = _meta;
Label.Detail = _LabelDetail2.default;
Label.Group = _LabelGroup2.default;
exports.default = Label;
Label.create = (0, _lib.createShorthandFactory)(Label, function (value) {
return { content: value };
});
/***/ },
/* 849 */
/*!*******************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/elements/Image/Image.js ***!
\*******************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _Dimmer = __webpack_require__(/*! ../../modules/Dimmer */ 850);
var _Dimmer2 = _interopRequireDefault(_Dimmer);
var _Label = __webpack_require__(/*! ../Label/Label */ 848);
var _Label2 = _interopRequireDefault(_Label);
var _ImageGroup = __webpack_require__(/*! ./ImageGroup */ 859);
var _ImageGroup2 = _interopRequireDefault(_ImageGroup);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* An image is a graphic representation of something.
* @see Icon
*/
function Image(props) {
var alt = props.alt,
avatar = props.avatar,
bordered = props.bordered,
centered = props.centered,
children = props.children,
className = props.className,
dimmer = props.dimmer,
disabled = props.disabled,
floated = props.floated,
fluid = props.fluid,
height = props.height,
hidden = props.hidden,
href = props.href,
inline = props.inline,
label = props.label,
shape = props.shape,
size = props.size,
spaced = props.spaced,
src = props.src,
verticalAlign = props.verticalAlign,
width = props.width,
wrapped = props.wrapped,
ui = props.ui;
var classes = (0, _classnames2.default)((0, _lib.useKeyOnly)(ui, 'ui'), size, shape, (0, _lib.useKeyOnly)(avatar, 'avatar'), (0, _lib.useKeyOnly)(bordered, 'bordered'), (0, _lib.useKeyOnly)(centered, 'centered'), (0, _lib.useKeyOnly)(disabled, 'disabled'), (0, _lib.useKeyOnly)(fluid, 'fluid'), (0, _lib.useKeyOnly)(hidden, 'hidden'), (0, _lib.useKeyOnly)(inline, 'inline'), (0, _lib.useKeyOrValueAndKey)(spaced, 'spaced'), (0, _lib.useValueAndKey)(floated, 'floated'), (0, _lib.useVerticalAlignProp)(verticalAlign, 'aligned'), 'image', className);
var rest = (0, _lib.getUnhandledProps)(Image, props);
var ElementType = (0, _lib.getElementType)(Image, props, function () {
if (!(0, _isNil3.default)(dimmer) || !(0, _isNil3.default)(label) || !(0, _isNil3.default)(wrapped) || !(0, _isNil3.default)(children)) return 'div';
});
if (!(0, _isNil3.default)(children)) {
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
var rootProps = _extends({}, rest, { className: classes });
var imgTagProps = { alt: alt, src: src, height: height, width: width };
if (ElementType === 'img') return _react2.default.createElement(ElementType, _extends({}, rootProps, imgTagProps));
return _react2.default.createElement(
ElementType,
_extends({}, rootProps, { href: href }),
_Dimmer2.default.create(dimmer),
_Label2.default.create(label),
_react2.default.createElement('img', imgTagProps)
);
}
Image.Group = _ImageGroup2.default;
Image._meta = {
name: 'Image',
type: _lib.META.TYPES.ELEMENT,
props: {
verticalAlign: _lib.SUI.VERTICAL_ALIGNMENTS,
floated: _lib.SUI.FLOATS,
shape: ['rounded', 'circular'],
size: _lib.SUI.SIZES,
spaced: ['left', 'right']
}
};
Image.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Alternate text for the image specified. */
alt: _react.PropTypes.string,
/** An image may be formatted to appear inline with text as an avatar. */
avatar: _react.PropTypes.bool,
/** An image may include a border to emphasize the edges of white or transparent content. */
bordered: _react.PropTypes.bool,
/** An image can appear centered in a content block. */
centered: _react.PropTypes.bool,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** An image can show that it is disabled and cannot be selected. */
disabled: _react.PropTypes.bool,
/** Shorthand for Dimmer. */
dimmer: _lib.customPropTypes.itemShorthand,
/** An image can sit to the left or right of other content. */
floated: _react.PropTypes.oneOf(Image._meta.props.floated),
/** An image can take up the width of its container. */
fluid: _lib.customPropTypes.every([_react.PropTypes.bool, _lib.customPropTypes.disallow(['size'])]),
/** The img element height attribute. */
height: _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.number]),
/** An image can be hidden. */
hidden: _react.PropTypes.bool,
/** Renders the Image as an <a> tag with this href. */
href: _react.PropTypes.string,
/** An image may appear inline. */
inline: _react.PropTypes.bool,
/** Shorthand for Label. */
label: _lib.customPropTypes.itemShorthand,
/** An image may appear rounded or circular. */
shape: _react.PropTypes.oneOf(Image._meta.props.shape),
/** An image may appear at different sizes. */
size: _react.PropTypes.oneOf(Image._meta.props.size),
/** An image can specify that it needs an additional spacing to separate it from nearby content. */
spaced: _react.PropTypes.oneOfType([_react.PropTypes.bool, _react.PropTypes.oneOf(Image._meta.props.spaced)]),
/** Specifies the URL of the image. */
src: _react.PropTypes.string,
/** Whether or not to add the ui className. */
ui: _react.PropTypes.bool,
/** An image can specify its vertical alignment */
verticalAlign: _react.PropTypes.oneOf(Image._meta.props.verticalAlign),
/** The img element width attribute */
width: _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.number]),
/** An image can render wrapped in a `div.ui.image` as alternative HTML markup */
wrapped: _lib.customPropTypes.every([_react.PropTypes.bool,
// these props wrap the image in an a tag already
_lib.customPropTypes.disallow(['href'])])
};
Image.defaultProps = {
as: 'img',
ui: true
};
Image.create = (0, _lib.createShorthandFactory)(Image, function (value) {
return { src: value };
});
exports.default = Image;
/***/ },
/* 850 */
/*!*******************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/modules/Dimmer/index.js ***!
\*******************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _Dimmer = __webpack_require__(/*! ./Dimmer */ 851);
var _Dimmer2 = _interopRequireDefault(_Dimmer);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = _Dimmer2.default;
/***/ },
/* 851 */
/*!********************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/modules/Dimmer/Dimmer.js ***!
\********************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _Portal = __webpack_require__(/*! ../../addons/Portal */ 852);
var _Portal2 = _interopRequireDefault(_Portal);
var _DimmerDimmable = __webpack_require__(/*! ./DimmerDimmable */ 858);
var _DimmerDimmable2 = _interopRequireDefault(_DimmerDimmable);
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 _meta = {
name: 'Dimmer',
type: _lib.META.TYPES.MODULE
};
/**
* A dimmer hides distractions to focus attention on particular content.
*/
var Dimmer = function (_Component) {
_inherits(Dimmer, _Component);
function Dimmer() {
var _ref;
var _temp, _this, _ret;
_classCallCheck(this, Dimmer);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Dimmer.__proto__ || Object.getPrototypeOf(Dimmer)).call.apply(_ref, [this].concat(args))), _this), _this.handlePortalMount = function () {
if (_lib.isBrowser) document.body.classList.add('dimmed', 'dimmable');
}, _this.handlePortalUnmount = function () {
if (_lib.isBrowser) document.body.classList.remove('dimmed', 'dimmable');
}, _this.handleClick = function (e) {
var _this$props = _this.props,
onClick = _this$props.onClick,
onClickOutside = _this$props.onClickOutside;
if (onClick) onClick(e, _this.props);
if (_this.center && _this.center !== e.target && _this.center.contains(e.target)) return;
if (onClickOutside) onClickOutside(e, _this.props);
}, _temp), _possibleConstructorReturn(_this, _ret);
}
_createClass(Dimmer, [{
key: 'render',
value: function render() {
var _this2 = this;
var _props = this.props,
active = _props.active,
children = _props.children,
className = _props.className,
content = _props.content,
disabled = _props.disabled,
inverted = _props.inverted,
page = _props.page,
simple = _props.simple;
var classes = (0, _classnames2.default)('ui', (0, _lib.useKeyOnly)(active, 'active transition visible'), (0, _lib.useKeyOnly)(disabled, 'disabled'), (0, _lib.useKeyOnly)(inverted, 'inverted'), (0, _lib.useKeyOnly)(page, 'page'), (0, _lib.useKeyOnly)(simple, 'simple'), 'dimmer', className);
var rest = (0, _lib.getUnhandledProps)(Dimmer, this.props);
var ElementType = (0, _lib.getElementType)(Dimmer, this.props);
var childrenJSX = ((0, _isNil3.default)(children) ? content : children) && _react2.default.createElement(
'div',
{ className: 'content' },
_react2.default.createElement(
'div',
{ className: 'center', ref: function ref(center) {
return _this2.center = center;
} },
(0, _isNil3.default)(children) ? content : children
)
);
if (page) {
return _react2.default.createElement(
_Portal2.default,
{
closeOnEscape: false,
closeOnDocumentClick: false,
onMount: this.handlePortalMount,
onUnmount: this.handlePortalUnmount,
open: active,
openOnTriggerClick: false
},
_react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes, onClick: this.handleClick }),
childrenJSX
)
);
}
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes, onClick: this.handleClick }),
childrenJSX
);
}
}]);
return Dimmer;
}(_react.Component);
// Dimmer is not yet defined inside the class
// Do not use a static property initializer
Dimmer.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** An active dimmer will dim its parent container. */
active: _react.PropTypes.bool,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** Shorthand for primary content. */
content: _lib.customPropTypes.contentShorthand,
/** A disabled dimmer cannot be activated */
disabled: _react.PropTypes.bool,
/**
* Called on click.
*
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All props.
*/
onClick: _react.PropTypes.func,
/**
* Handles click outside Dimmer's content, but inside Dimmer area.
*
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All props.
*/
onClickOutside: _react.PropTypes.func,
/** A dimmer can be formatted to have its colors inverted. */
inverted: _react.PropTypes.bool,
/** A dimmer can be formatted to be fixed to the page. */
page: _react.PropTypes.bool,
/** A dimmer can be controlled with simple prop. */
simple: _react.PropTypes.bool
};
Dimmer._meta = _meta;
Dimmer.Dimmable = _DimmerDimmable2.default;
exports.default = Dimmer;
Dimmer.create = (0, _lib.createShorthandFactory)(Dimmer, function (value) {
return { content: value };
});
/***/ },
/* 852 */
/*!******************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/addons/Portal/index.js ***!
\******************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _Portal = __webpack_require__(/*! ./Portal */ 853);
var _Portal2 = _interopRequireDefault(_Portal);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = _Portal2.default;
/***/ },
/* 853 */
/*!*******************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/addons/Portal/Portal.js ***!
\*******************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _invoke2 = __webpack_require__(/*! lodash/invoke */ 854);
var _invoke3 = _interopRequireDefault(_invoke2);
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__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _reactDom = __webpack_require__(/*! react-dom */ 33);
var _reactDom2 = _interopRequireDefault(_reactDom);
var _lib = __webpack_require__(/*! ../../lib */ 592);
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 debug = (0, _lib.makeDebugger)('portal');
var _meta = {
name: 'Portal',
type: _lib.META.TYPES.ADDON
};
/**
* A component that allows you to render children outside their parent.
* @see Modal
*/
var Portal = function (_Component) {
_inherits(Portal, _Component);
function Portal() {
var _ref;
var _temp, _this, _ret;
_classCallCheck(this, Portal);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Portal.__proto__ || Object.getPrototypeOf(Portal)).call.apply(_ref, [this].concat(args))), _this), _this.state = {}, _this.handleDocumentClick = function (e) {
var _this$props = _this.props,
closeOnDocumentClick = _this$props.closeOnDocumentClick,
closeOnRootNodeClick = _this$props.closeOnRootNodeClick;
// If not mounted, no portal, or event happened in the portal, ignore it
if (!_this.node || !_this.portal || _this.portal.contains(e.target)) return;
if (closeOnDocumentClick || closeOnRootNodeClick && _this.node.contains(e.target)) {
debug('handleDocumentClick()');
e.stopPropagation();
_this.close(e);
}
}, _this.handleEscape = function (e) {
if (!_this.props.closeOnEscape) return;
if (_lib.keyboardKey.getCode(e) !== _lib.keyboardKey.Escape) return;
debug('handleEscape()');
e.preventDefault();
_this.close(e);
}, _this.handlePortalMouseLeave = function (e) {
var _this$props2 = _this.props,
closeOnPortalMouseLeave = _this$props2.closeOnPortalMouseLeave,
mouseLeaveDelay = _this$props2.mouseLeaveDelay;
if (!closeOnPortalMouseLeave) return;
debug('handlePortalMouseLeave()');
_this.mouseLeaveTimer = _this.closeWithTimeout(e, mouseLeaveDelay);
}, _this.handlePortalMouseEnter = function (e) {
// In order to enable mousing from the trigger to the portal, we need to
// clear the mouseleave timer that was set when leaving the trigger.
var closeOnPortalMouseLeave = _this.props.closeOnPortalMouseLeave;
if (!closeOnPortalMouseLeave) return;
debug('handlePortalMouseEnter()');
clearTimeout(_this.mouseLeaveTimer);
}, _this.handleTriggerBlur = function (e) {
var _this$props3 = _this.props,
trigger = _this$props3.trigger,
closeOnTriggerBlur = _this$props3.closeOnTriggerBlur;
// Call original event handler
(0, _invoke3.default)(trigger, 'props.onBlur', e);
if (!closeOnTriggerBlur) return;
debug('handleTriggerBlur()');
_this.close(e);
}, _this.handleTriggerClick = function (e) {
var _this$props4 = _this.props,
trigger = _this$props4.trigger,
closeOnTriggerClick = _this$props4.closeOnTriggerClick,
openOnTriggerClick = _this$props4.openOnTriggerClick;
var open = _this.state.open;
// Call original event handler
(0, _invoke3.default)(trigger, 'props.onClick', e);
if (open && closeOnTriggerClick) {
debug('handleTriggerClick() - close');
e.stopPropagation();
_this.close(e);
} else if (!open && openOnTriggerClick) {
debug('handleTriggerClick() - open');
e.stopPropagation();
_this.open(e);
}
// Prevents handleDocumentClick from closing the portal when
// openOnTriggerFocus is set. Focus shifts on mousedown so the portal opens
// before the click finishes so it may actually wind up on the document.
e.nativeEvent.stopImmediatePropagation();
}, _this.handleTriggerFocus = function (e) {
var _this$props5 = _this.props,
trigger = _this$props5.trigger,
openOnTriggerFocus = _this$props5.openOnTriggerFocus;
// Call original event handler
(0, _invoke3.default)(trigger, 'props.onFocus', e);
if (!openOnTriggerFocus) return;
debug('handleTriggerFocus()');
_this.open(e);
}, _this.handleTriggerMouseLeave = function (e) {
clearTimeout(_this.mouseEnterTimer);
var _this$props6 = _this.props,
trigger = _this$props6.trigger,
closeOnTriggerMouseLeave = _this$props6.closeOnTriggerMouseLeave,
mouseLeaveDelay = _this$props6.mouseLeaveDelay;
// Call original event handler
(0, _invoke3.default)(trigger, 'props.onMouseLeave', e);
if (!closeOnTriggerMouseLeave) return;
debug('handleTriggerMouseLeave()');
_this.mouseLeaveTimer = _this.closeWithTimeout(e, mouseLeaveDelay);
}, _this.handleTriggerMouseEnter = function (e) {
clearTimeout(_this.mouseLeaveTimer);
var _this$props7 = _this.props,
trigger = _this$props7.trigger,
mouseEnterDelay = _this$props7.mouseEnterDelay,
openOnTriggerMouseEnter = _this$props7.openOnTriggerMouseEnter;
// Call original event handler
(0, _invoke3.default)(trigger, 'props.onMouseEnter', _this.handleTriggerMouseEnter);
if (!openOnTriggerMouseEnter) return;
debug('handleTriggerMouseEnter()');
_this.mouseEnterTimer = _this.openWithTimeout(e, mouseEnterDelay);
}, _this.open = function (e) {
debug('open()');
var onOpen = _this.props.onOpen;
if (onOpen) onOpen(e, _this.props);
_this.trySetState({ open: true });
}, _this.openWithTimeout = function (e, delay) {
// React wipes the entire event object and suggests using e.persist() if
// you need the event for async access. However, even with e.persist
// certain required props (e.g. currentTarget) are null so we're forced to clone.
var eventClone = _extends({}, e);
return setTimeout(function () {
return _this.open(eventClone);
}, delay || 0);
}, _this.close = function (e) {
debug('close()');
var onClose = _this.props.onClose;
if (onClose) onClose(e, _this.props);
_this.trySetState({ open: false });
}, _this.closeWithTimeout = function (e, delay) {
// React wipes the entire event object and suggests using e.persist() if
// you need the event for async access. However, even with e.persist
// certain required props (e.g. currentTarget) are null so we're forced to clone.
var eventClone = _extends({}, e);
return setTimeout(function () {
return _this.close(eventClone);
}, delay || 0);
}, _this.mountPortal = function () {
if (!_lib.isBrowser || _this.node) return;
debug('mountPortal()');
var _this$props8 = _this.props,
mountNode = _this$props8.mountNode,
prepend = _this$props8.prepend;
_this.node = document.createElement('div');
if (prepend) {
mountNode.insertBefore(_this.node, mountNode.firstElementChild);
} else {
mountNode.appendChild(_this.node);
}
document.addEventListener('click', _this.handleDocumentClick);
document.addEventListener('keydown', _this.handleEscape);
var onMount = _this.props.onMount;
if (onMount) onMount(null, _this.props);
}, _this.unmountPortal = function () {
if (!_lib.isBrowser || !_this.node) return;
debug('unmountPortal()');
_reactDom2.default.unmountComponentAtNode(_this.node);
_this.node.parentNode.removeChild(_this.node);
_this.portal.removeEventListener('mouseleave', _this.handlePortalMouseLeave);
_this.portal.removeEventListener('mouseenter', _this.handlePortalMouseEnter);
_this.node = null;
_this.portal = null;
document.removeEventListener('click', _this.handleDocumentClick);
document.removeEventListener('keydown', _this.handleEscape);
var onUnmount = _this.props.onUnmount;
if (onUnmount) onUnmount(null, _this.props);
}, _temp), _possibleConstructorReturn(_this, _ret);
}
_createClass(Portal, [{
key: 'componentDidMount',
value: function componentDidMount() {
this.renderPortal();
}
}, {
key: 'componentDidUpdate',
value: function componentDidUpdate(prevProps, prevState) {
// NOTE: Ideally the portal rendering would happen in the render() function
// but React gives a warning about not being pure and suggests doing it
// within this method.
// If the portal is open, render (or re-render) the portal and child.
this.renderPortal();
if (prevState.open && !this.state.open) {
debug('portal closed');
this.unmountPortal();
}
}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {
this.unmountPortal();
// Clean up timers
clearTimeout(this.mouseEnterTimer);
clearTimeout(this.mouseLeaveTimer);
}
// ----------------------------------------
// Document Event Handlers
// ----------------------------------------
// ----------------------------------------
// Component Event Handlers
// ----------------------------------------
// ----------------------------------------
// Behavior
// ----------------------------------------
}, {
key: 'renderPortal',
value: function renderPortal() {
if (!this.state.open) return;
debug('renderPortal()');
var _props = this.props,
children = _props.children,
className = _props.className;
this.mountPortal();
// Server side rendering
if (!_lib.isBrowser) return null;
this.node.className = className || '';
// when re-rendering, first remove listeners before re-adding them to the new node
if (this.portal) {
this.portal.removeEventListener('mouseleave', this.handlePortalMouseLeave);
this.portal.removeEventListener('mouseenter', this.handlePortalMouseEnter);
}
_reactDom2.default.unstable_renderSubtreeIntoContainer(this, _react.Children.only(children), this.node);
this.portal = this.node.firstElementChild;
this.portal.addEventListener('mouseleave', this.handlePortalMouseLeave);
this.portal.addEventListener('mouseenter', this.handlePortalMouseEnter);
}
}, {
key: 'render',
value: function render() {
var trigger = this.props.trigger;
if (!trigger) return null;
return _react2.default.cloneElement(trigger, {
onBlur: this.handleTriggerBlur,
onClick: this.handleTriggerClick,
onFocus: this.handleTriggerFocus,
onMouseLeave: this.handleTriggerMouseLeave,
onMouseEnter: this.handleTriggerMouseEnter
});
}
}]);
return Portal;
}(_lib.AutoControlledComponent);
Portal.propTypes = {
/** Primary content. */
children: _react.PropTypes.node.isRequired,
/** Additional classes. */
className: _react.PropTypes.string,
/**
* Controls whether or not the portal should close on a click on the portal background.
* NOTE: This differs from closeOnDocumentClick:
* - DocumentClick - any click not within the portal
* - RootNodeClick - a click not within the portal but within the portal's wrapper
*/
closeOnRootNodeClick: _lib.customPropTypes.every([_lib.customPropTypes.disallow(['closeOnDocumentClick']), _react.PropTypes.bool]),
/** Controls whether or not the portal should close on a click outside. */
closeOnDocumentClick: _lib.customPropTypes.every([_lib.customPropTypes.disallow(['closeOnRootNodeClick']), _react.PropTypes.bool]),
/** Controls whether or not the portal should close when escape is pressed is displayed. */
closeOnEscape: _react.PropTypes.bool,
/**
* Controls whether or not the portal should close when mousing out of the portal.
* NOTE: This will prevent `closeOnTriggerMouseLeave` when mousing over the
* gap from the trigger to the portal.
*/
closeOnPortalMouseLeave: _react.PropTypes.bool,
/** Controls whether or not the portal should close on blur of the trigger. */
closeOnTriggerBlur: _react.PropTypes.bool,
/** Controls whether or not the portal should close on click of the trigger. */
closeOnTriggerClick: _react.PropTypes.bool,
/** Controls whether or not the portal should close when mousing out of the trigger. */
closeOnTriggerMouseLeave: _react.PropTypes.bool,
/** Initial value of open. */
defaultOpen: _react.PropTypes.bool,
/** The node where the portal should mount. */
mountNode: _react.PropTypes.any,
/** Milliseconds to wait before closing on mouse leave */
mouseLeaveDelay: _react.PropTypes.number,
/** Milliseconds to wait before opening on mouse over */
mouseEnterDelay: _react.PropTypes.number,
/**
* Called when a close event happens
*
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All props.
*/
onClose: _react.PropTypes.func,
/**
* Called when the portal is mounted on the DOM
*
* @param {null}
* @param {object} data - All props.
*/
onMount: _react.PropTypes.func,
/**
* Called when an open event happens
*
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All props.
*/
onOpen: _react.PropTypes.func,
/**
* Called when the portal is unmounted from the DOM
*
* @param {null}
* @param {object} data - All props.
*/
onUnmount: _react.PropTypes.func,
/** Controls whether or not the portal is displayed. */
open: _react.PropTypes.bool,
/** Controls whether or not the portal should open when the trigger is clicked. */
openOnTriggerClick: _react.PropTypes.bool,
/** Controls whether or not the portal should open on focus of the trigger. */
openOnTriggerFocus: _react.PropTypes.bool,
/** Controls whether or not the portal should open when mousing over the trigger. */
openOnTriggerMouseEnter: _react.PropTypes.bool,
/** Controls whether the portal should be prepended to the mountNode instead of appended. */
prepend: _react.PropTypes.bool,
/** Element to be rendered in-place where the portal is defined. */
trigger: _react.PropTypes.node
};
Portal.defaultProps = {
closeOnDocumentClick: true,
closeOnEscape: true,
openOnTriggerClick: true,
mountNode: _lib.isBrowser ? document.body : null
};
Portal.autoControlledProps = ['open'];
Portal._meta = _meta;
exports.default = Portal;
/***/ },
/* 854 */
/*!************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/invoke.js ***!
\************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseInvoke = __webpack_require__(/*! ./_baseInvoke */ 855),
baseRest = __webpack_require__(/*! ./_baseRest */ 610);
/**
* Invokes the method at `path` of `object`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Object
* @param {Object} object The object to query.
* @param {Array|string} path The path of the method to invoke.
* @param {...*} [args] The arguments to invoke the method with.
* @returns {*} Returns the result of the invoked method.
* @example
*
* var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
*
* _.invoke(object, 'a[0].b.c.slice', 1, 3);
* // => [2, 3]
*/
var invoke = baseRest(baseInvoke);
module.exports = invoke;
/***/ },
/* 855 */
/*!*****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_baseInvoke.js ***!
\*****************************************************/
/***/ function(module, exports, __webpack_require__) {
var apply = __webpack_require__(/*! ./_apply */ 613),
castPath = __webpack_require__(/*! ./_castPath */ 538),
last = __webpack_require__(/*! ./last */ 856),
parent = __webpack_require__(/*! ./_parent */ 857),
toKey = __webpack_require__(/*! ./_toKey */ 591);
/**
* The base implementation of `_.invoke` without support for individual
* method arguments.
*
* @private
* @param {Object} object The object to query.
* @param {Array|string} path The path of the method to invoke.
* @param {Array} args The arguments to invoke the method with.
* @returns {*} Returns the result of the invoked method.
*/
function baseInvoke(object, path, args) {
path = castPath(path, object);
object = parent(object, path);
var func = object == null ? object : object[toKey(last(path))];
return func == null ? undefined : apply(func, object, args);
}
module.exports = baseInvoke;
/***/ },
/* 856 */
/*!**********************************************!*\
!*** ./~/semantic-ui-react/~/lodash/last.js ***!
\**********************************************/
/***/ function(module, exports) {
/**
* Gets the last element of `array`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to query.
* @returns {*} Returns the last element of `array`.
* @example
*
* _.last([1, 2, 3]);
* // => 3
*/
function last(array) {
var length = array == null ? 0 : array.length;
return length ? array[length - 1] : undefined;
}
module.exports = last;
/***/ },
/* 857 */
/*!*************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_parent.js ***!
\*************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseGet = __webpack_require__(/*! ./_baseGet */ 679),
baseSlice = __webpack_require__(/*! ./_baseSlice */ 809);
/**
* Gets the parent value at `path` of `object`.
*
* @private
* @param {Object} object The object to query.
* @param {Array} path The path to get the parent value of.
* @returns {*} Returns the parent value.
*/
function parent(object, path) {
return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
}
module.exports = parent;
/***/ },
/* 858 */
/*!****************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/modules/Dimmer/DimmerDimmable.js ***!
\****************************************************************************/
/***/ 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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* A dimmable sub-component for Dimmer.
*/
function DimmerDimmable(props) {
var blurring = props.blurring,
className = props.className,
children = props.children,
dimmed = props.dimmed;
var classes = (0, _classnames2.default)((0, _lib.useKeyOnly)(blurring, 'blurring'), (0, _lib.useKeyOnly)(dimmed, 'dimmed'), 'dimmable', className);
var rest = (0, _lib.getUnhandledProps)(DimmerDimmable, props);
var ElementType = (0, _lib.getElementType)(DimmerDimmable, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
DimmerDimmable._meta = {
name: 'DimmerDimmable',
type: _lib.META.TYPES.MODULE,
parent: 'Dimmer'
};
DimmerDimmable.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** A dimmable element can blur its contents. */
blurring: _react.PropTypes.bool,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** Controls whether or not the dim is displayed. */
dimmed: _react.PropTypes.bool
};
exports.default = DimmerDimmable;
/***/ },
/* 859 */
/*!************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/elements/Image/ImageGroup.js ***!
\************************************************************************/
/***/ 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__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* A group of images
*/
function ImageGroup(props) {
var children = props.children,
className = props.className,
size = props.size;
var classes = (0, _classnames2.default)('ui', size, className, 'images');
var rest = (0, _lib.getUnhandledProps)(ImageGroup, props);
var ElementType = (0, _lib.getElementType)(ImageGroup, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
ImageGroup._meta = {
name: 'ImageGroup',
parent: 'Image',
type: _lib.META.TYPES.ELEMENT,
props: {
size: _lib.SUI.SIZES
}
};
ImageGroup.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** A group of images can be formatted to have the same size. */
size: _react.PropTypes.oneOf(ImageGroup._meta.props.size)
};
exports.default = ImageGroup;
/***/ },
/* 860 */
/*!*************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/elements/Label/LabelDetail.js ***!
\*************************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function LabelDetail(props) {
var children = props.children,
className = props.className,
content = props.content;
var classes = (0, _classnames2.default)('detail', className);
var rest = (0, _lib.getUnhandledProps)(LabelDetail, props);
var ElementType = (0, _lib.getElementType)(LabelDetail, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
(0, _isNil3.default)(children) ? content : children
);
}
LabelDetail._meta = {
name: 'LabelDetail',
parent: 'Label',
type: _lib.META.TYPES.ELEMENT
};
LabelDetail.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** Shorthand for primary content. */
content: _lib.customPropTypes.contentShorthand
};
exports.default = LabelDetail;
/***/ },
/* 861 */
/*!************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/elements/Label/LabelGroup.js ***!
\************************************************************************/
/***/ 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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function LabelGroup(props) {
var children = props.children,
circular = props.circular,
className = props.className,
color = props.color,
size = props.size,
tag = props.tag;
var classes = (0, _classnames2.default)('ui', color, size, (0, _lib.useKeyOnly)(circular, 'circular'), (0, _lib.useKeyOnly)(tag, 'tag'), 'labels', className);
var rest = (0, _lib.getUnhandledProps)(LabelGroup, props);
var ElementType = (0, _lib.getElementType)(LabelGroup, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
LabelGroup._meta = {
name: 'LabelGroup',
parent: 'Label',
type: _lib.META.TYPES.ELEMENT,
props: {
color: _lib.SUI.COLORS,
size: _lib.SUI.SIZES
}
};
LabelGroup.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Labels can share shapes. */
circular: _react.PropTypes.bool,
/** Additional classes. */
className: _react.PropTypes.string,
/** Label group can share colors together. */
color: _react.PropTypes.oneOf(LabelGroup._meta.props.color),
/** Label group can share sizes together. */
size: _react.PropTypes.oneOf(LabelGroup._meta.props.size),
/** Label group can share tag formatting. */
tag: _react.PropTypes.bool
};
exports.default = LabelGroup;
/***/ },
/* 862 */
/*!****************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/elements/Button/ButtonContent.js ***!
\****************************************************************************/
/***/ 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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Used in some Button types, such as `animated`
*/
function ButtonContent(props) {
var children = props.children,
className = props.className,
hidden = props.hidden,
visible = props.visible;
var classes = (0, _classnames2.default)((0, _lib.useKeyOnly)(visible, 'visible'), (0, _lib.useKeyOnly)(hidden, 'hidden'), 'content', className);
var rest = (0, _lib.getUnhandledProps)(ButtonContent, props);
var ElementType = (0, _lib.getElementType)(ButtonContent, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
ButtonContent._meta = {
name: 'ButtonContent',
parent: 'Button',
type: _lib.META.TYPES.ELEMENT
};
ButtonContent.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Additional classes. */
className: _react.PropTypes.string,
/** Primary content. */
children: _react.PropTypes.node,
/** Initially hidden, visible on hover */
hidden: _react.PropTypes.bool,
/** Initially visible, hidden on hover */
visible: _react.PropTypes.bool
};
exports.default = ButtonContent;
/***/ },
/* 863 */
/*!**************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/elements/Button/ButtonGroup.js ***!
\**************************************************************************/
/***/ 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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Button.Group
*/
function ButtonGroup(props) {
var attached = props.attached,
basic = props.basic,
children = props.children,
className = props.className,
color = props.color,
compact = props.compact,
fluid = props.fluid,
icon = props.icon,
inverted = props.inverted,
labeled = props.labeled,
negative = props.negative,
positive = props.positive,
primary = props.primary,
secondary = props.secondary,
size = props.size,
toggle = props.toggle,
vertical = props.vertical,
widths = props.widths;
var classes = (0, _classnames2.default)('ui', size, color, (0, _lib.useValueAndKey)(attached, 'attached'), (0, _lib.useKeyOnly)(basic, 'basic'), (0, _lib.useKeyOnly)(compact, 'compact'), (0, _lib.useKeyOnly)(fluid, 'fluid'), (0, _lib.useKeyOnly)(icon, 'icon'), (0, _lib.useKeyOnly)(inverted, 'inverted'), (0, _lib.useKeyOnly)(labeled, 'labeled'), (0, _lib.useKeyOnly)(negative, 'negative'), (0, _lib.useKeyOnly)(positive, 'positive'), (0, _lib.useKeyOnly)(primary, 'primary'), (0, _lib.useKeyOnly)(secondary, 'secondary'), (0, _lib.useKeyOnly)(toggle, 'toggle'), (0, _lib.useKeyOnly)(vertical, 'vertical'), (0, _lib.useWidthProp)(widths), 'buttons', className);
var rest = (0, _lib.getUnhandledProps)(ButtonGroup, props);
var ElementType = (0, _lib.getElementType)(ButtonGroup, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
ButtonGroup._meta = {
name: 'ButtonGroup',
parent: 'Button',
type: _lib.META.TYPES.ELEMENT,
props: {
attached: ['left', 'right', 'top', 'bottom'],
color: _lib.SUI.COLORS,
size: _lib.SUI.SIZES,
widths: _lib.SUI.WIDTHS
}
};
ButtonGroup.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** A button can be attached to the top or bottom of other content */
attached: _react.PropTypes.oneOf(ButtonGroup._meta.props.attached),
/** Groups can be less pronounced */
basic: _react.PropTypes.bool,
/** Additional classes. */
className: _react.PropTypes.string,
/** Primary content. */
children: _react.PropTypes.node,
/** Groups can have a shared color */
color: _react.PropTypes.oneOf(ButtonGroup._meta.props.color),
/** Groups can reduce their padding to fit into tighter spaces */
compact: _react.PropTypes.bool,
/** Groups can take the width of their container */
fluid: _react.PropTypes.bool,
/** Groups can be formatted as icons */
icon: _react.PropTypes.bool,
/** Groups can be formatted to appear on dark backgrounds */
inverted: _react.PropTypes.bool,
/** Groups can be formatted as labeled icon buttons */
labeled: _react.PropTypes.bool,
/** Groups can hint towards a negative consequence */
negative: _react.PropTypes.bool,
/** Groups can hint towards a positive consequence */
positive: _react.PropTypes.bool,
/** Groups can be formatted to show different levels of emphasis */
primary: _react.PropTypes.bool,
/** Groups can be formatted to show different levels of emphasis */
secondary: _react.PropTypes.bool,
/** Groups can have different sizes */
size: _react.PropTypes.oneOf(ButtonGroup._meta.props.size),
/** Groups can be formatted to toggle on and off */
toggle: _react.PropTypes.bool,
/** Groups can be formatted to appear vertically */
vertical: _react.PropTypes.bool,
/** Groups can have their widths divided evenly */
widths: _react.PropTypes.oneOf(ButtonGroup._meta.props.widths)
};
exports.default = ButtonGroup;
/***/ },
/* 864 */
/*!***********************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/elements/Button/ButtonOr.js ***!
\***********************************************************************/
/***/ 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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Used in some Button types, such as `animated`
*/
function ButtonOr(props) {
var className = props.className;
var classes = (0, _classnames2.default)('or', className);
var rest = (0, _lib.getUnhandledProps)(ButtonOr, props);
var ElementType = (0, _lib.getElementType)(ButtonOr, props);
return _react2.default.createElement(ElementType, _extends({}, rest, { className: classes }));
}
ButtonOr._meta = {
name: 'ButtonOr',
parent: 'Button',
type: _lib.META.TYPES.ELEMENT
};
ButtonOr.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Additional classes. */
className: _react.PropTypes.string
};
exports.default = ButtonOr;
/***/ },
/* 865 */
/*!******************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/modules/Modal/index.js ***!
\******************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _Modal = __webpack_require__(/*! ./Modal */ 866);
var _Modal2 = _interopRequireDefault(_Modal);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = _Modal2.default;
/***/ },
/* 866 */
/*!******************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/modules/Modal/Modal.js ***!
\******************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _pick2 = __webpack_require__(/*! lodash/pick */ 798);
var _pick3 = _interopRequireDefault(_pick2);
var _omit2 = __webpack_require__(/*! lodash/omit */ 867);
var _omit3 = _interopRequireDefault(_omit2);
var _keys2 = __webpack_require__(/*! lodash/keys */ 634);
var _keys3 = _interopRequireDefault(_keys2);
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__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _ModalHeader = __webpack_require__(/*! ./ModalHeader */ 870);
var _ModalHeader2 = _interopRequireDefault(_ModalHeader);
var _ModalContent = __webpack_require__(/*! ./ModalContent */ 871);
var _ModalContent2 = _interopRequireDefault(_ModalContent);
var _ModalActions = __webpack_require__(/*! ./ModalActions */ 872);
var _ModalActions2 = _interopRequireDefault(_ModalActions);
var _ModalDescription = __webpack_require__(/*! ./ModalDescription */ 873);
var _ModalDescription2 = _interopRequireDefault(_ModalDescription);
var _Icon = __webpack_require__(/*! ../../elements/Icon */ 874);
var _Icon2 = _interopRequireDefault(_Icon);
var _Portal = __webpack_require__(/*! ../../addons/Portal */ 852);
var _Portal2 = _interopRequireDefault(_Portal);
var _lib = __webpack_require__(/*! ../../lib */ 592);
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 debug = (0, _lib.makeDebugger)('modal');
var _meta = {
name: 'Modal',
type: _lib.META.TYPES.MODULE,
props: {
size: ['fullscreen', 'large', 'small'],
dimmer: ['inverted', 'blurring']
}
};
/**
* A modal displays content that temporarily blocks interactions with the main view of a site
* @see Confirm
* @see Portal
*/
var Modal = function (_Component) {
_inherits(Modal, _Component);
function Modal() {
var _ref;
var _temp, _this, _ret;
_classCallCheck(this, Modal);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Modal.__proto__ || Object.getPrototypeOf(Modal)).call.apply(_ref, [this].concat(args))), _this), _this.state = {}, _this.handleClose = function (e) {
debug('close()');
var onClose = _this.props.onClose;
if (onClose) onClose(e, _this.props);
_this.trySetState({ open: false });
}, _this.handleOpen = function (e) {
debug('open()');
var onOpen = _this.props.onOpen;
if (onOpen) onOpen(e, _this.props);
_this.trySetState({ open: true });
}, _this.handlePortalMount = function (e) {
debug('handlePortalMount()');
var _this$props = _this.props,
dimmer = _this$props.dimmer,
mountNode = _this$props.mountNode;
if (dimmer) {
debug('adding dimmer');
mountNode.classList.add('dimmable', 'dimmed');
if (dimmer === 'blurring') {
debug('adding blurred dimmer');
mountNode.classList.add('blurring');
}
}
_this.setPosition();
var onMount = _this.props.onMount;
if (onMount) onMount(e, _this.props);
}, _this.handlePortalUnmount = function (e) {
debug('handlePortalUnmount()');
// Always remove all dimmer classes.
// If the dimmer value changes while the modal is open, then removing its
// current value could leave cruft classes previously added.
var mountNode = _this.props.mountNode;
mountNode.classList.remove('blurring', 'dimmable', 'dimmed', 'scrollable');
cancelAnimationFrame(_this.animationRequestId);
var onUnmount = _this.props.onUnmount;
if (onUnmount) onUnmount(e, _this.props);
}, _this.setPosition = function () {
if (_this._modalNode) {
var mountNode = _this.props.mountNode;
var _this$_modalNode$getB = _this._modalNode.getBoundingClientRect(),
height = _this$_modalNode$getB.height;
var marginTop = -Math.round(height / 2);
var scrolling = height >= window.innerHeight;
var newState = {};
if (_this.state.marginTop !== marginTop) {
newState.marginTop = marginTop;
}
if (_this.state.scrolling !== scrolling) {
newState.scrolling = scrolling;
if (scrolling) {
mountNode.classList.add('scrolling');
} else {
mountNode.classList.remove('scrolling');
}
}
if (Object.keys(newState).length > 0) _this.setState(newState);
}
_this.animationRequestId = requestAnimationFrame(_this.setPosition);
}, _temp), _possibleConstructorReturn(_this, _ret);
}
_createClass(Modal, [{
key: 'componentWillUnmount',
value: function componentWillUnmount() {
debug('componentWillUnmount()');
this.handlePortalUnmount();
}
}, {
key: 'render',
value: function render() {
var _this2 = this;
var open = this.state.open;
var _props = this.props,
basic = _props.basic,
children = _props.children,
className = _props.className,
closeIcon = _props.closeIcon,
dimmer = _props.dimmer,
mountNode = _props.mountNode,
size = _props.size;
// Short circuit when server side rendering
if (!_lib.isBrowser) return null;
var _state = this.state,
marginTop = _state.marginTop,
scrolling = _state.scrolling;
var classes = (0, _classnames2.default)('ui', size, (0, _lib.useKeyOnly)(basic, 'basic'), (0, _lib.useKeyOnly)(scrolling, 'scrolling'), 'modal transition visible active', className);
var unhandled = (0, _lib.getUnhandledProps)(Modal, this.props);
var portalPropNames = (0, _keys3.default)(_Portal2.default.propTypes);
var rest = (0, _omit3.default)(unhandled, portalPropNames);
var portalProps = (0, _pick3.default)(unhandled, portalPropNames);
var ElementType = (0, _lib.getElementType)(Modal, this.props);
var closeIconName = closeIcon === true ? 'close' : closeIcon;
var modalJSX = _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes, style: { marginTop: marginTop }, ref: function ref(c) {
return _this2._modalNode = c;
} }),
_Icon2.default.create(closeIconName, { onClick: this.handleClose }),
children
);
// wrap dimmer modals
var dimmerClasses = !dimmer ? null : (0, _classnames2.default)('ui', dimmer === 'inverted' && 'inverted', 'page modals dimmer transition visible active');
// Heads up!
//
// The SUI CSS selector to prevent the modal itself from blurring requires an immediate .dimmer child:
// .blurring.dimmed.dimmable>:not(.dimmer) { ... }
//
// The .blurring.dimmed.dimmable is the body, so that all body content inside is blurred.
// We need the immediate child to be the dimmer to :not() blur the modal itself!
// Otherwise, the portal div is also blurred, blurring the modal.
//
// We cannot them wrap the modalJSX in an actual <Dimmer /> instead, we apply the dimmer classes to the <Portal />.
return _react2.default.createElement(
_Portal2.default,
_extends({
closeOnRootNodeClick: true,
closeOnDocumentClick: false
}, portalProps, {
className: dimmerClasses,
mountNode: mountNode,
onClose: this.handleClose,
onMount: this.handlePortalMount,
onOpen: this.handleOpen,
onUnmount: this.handlePortalUnmount,
open: open
}),
modalJSX
);
}
}]);
return Modal;
}(_lib.AutoControlledComponent);
Modal.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** Icon */
closeIcon: _react.PropTypes.oneOfType([_react.PropTypes.node, _react.PropTypes.object, _react.PropTypes.bool]),
/** A modal can reduce its complexity */
basic: _react.PropTypes.bool,
/** Initial value of open. */
defaultOpen: _react.PropTypes.bool,
/** A modal can appear in a dimmer */
dimmer: _react.PropTypes.oneOfType([_react.PropTypes.bool, _react.PropTypes.oneOf(_meta.props.dimmer)]),
/** The node where the modal should mount.. */
mountNode: _react.PropTypes.any,
/**
* Called when a close event happens
*
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All props.
*/
onClose: _react.PropTypes.func,
/**
* Called when the portal is mounted on the DOM
*
* @param {null}
* @param {object} data - All props.
*/
onMount: _react.PropTypes.func,
/**
* Called when an open event happens
*
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All props.
*/
onOpen: _react.PropTypes.func,
/**
* Called when the portal is unmounted from the DOM
*
* @param {null}
* @param {object} data - All props.
*/
onUnmount: _react.PropTypes.func,
/** Controls whether or not the Modal is displayed. */
open: _react.PropTypes.bool,
/** A modal can vary in size */
size: _react.PropTypes.oneOf(_meta.props.size)
};
Modal.defaultProps = {
dimmer: true,
// Do not access document when server side rendering
mountNode: _lib.isBrowser ? document.body : null
};
Modal.autoControlledProps = ['open'];
Modal._meta = _meta;
Modal.Header = _ModalHeader2.default;
Modal.Content = _ModalContent2.default;
Modal.Description = _ModalDescription2.default;
Modal.Actions = _ModalActions2.default;
exports.default = Modal;
/***/ },
/* 867 */
/*!**********************************************!*\
!*** ./~/semantic-ui-react/~/lodash/omit.js ***!
\**********************************************/
/***/ function(module, exports, __webpack_require__) {
var arrayMap = __webpack_require__(/*! ./_arrayMap */ 586),
baseClone = __webpack_require__(/*! ./_baseClone */ 767),
baseUnset = __webpack_require__(/*! ./_baseUnset */ 868),
castPath = __webpack_require__(/*! ./_castPath */ 538),
copyObject = __webpack_require__(/*! ./_copyObject */ 763),
customOmitClone = __webpack_require__(/*! ./_customOmitClone */ 869),
flatRest = __webpack_require__(/*! ./_flatRest */ 793),
getAllKeysIn = __webpack_require__(/*! ./_getAllKeysIn */ 776);
/** Used to compose bitmasks for cloning. */
var CLONE_DEEP_FLAG = 1,
CLONE_FLAT_FLAG = 2,
CLONE_SYMBOLS_FLAG = 4;
/**
* The opposite of `_.pick`; this method creates an object composed of the
* own and inherited enumerable property paths of `object` that are not omitted.
*
* **Note:** This method is considerably slower than `_.pick`.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The source object.
* @param {...(string|string[])} [paths] The property paths to omit.
* @returns {Object} Returns the new object.
* @example
*
* var object = { 'a': 1, 'b': '2', 'c': 3 };
*
* _.omit(object, ['a', 'c']);
* // => { 'b': '2' }
*/
var omit = flatRest(function(object, paths) {
var result = {};
if (object == null) {
return result;
}
var isDeep = false;
paths = arrayMap(paths, function(path) {
path = castPath(path, object);
isDeep || (isDeep = path.length > 1);
return path;
});
copyObject(object, getAllKeysIn(object), result);
if (isDeep) {
result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
}
var length = paths.length;
while (length--) {
baseUnset(result, paths[length]);
}
return result;
});
module.exports = omit;
/***/ },
/* 868 */
/*!****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_baseUnset.js ***!
\****************************************************/
/***/ function(module, exports, __webpack_require__) {
var castPath = __webpack_require__(/*! ./_castPath */ 538),
last = __webpack_require__(/*! ./last */ 856),
parent = __webpack_require__(/*! ./_parent */ 857),
toKey = __webpack_require__(/*! ./_toKey */ 591);
/**
* The base implementation of `_.unset`.
*
* @private
* @param {Object} object The object to modify.
* @param {Array|string} path The property path to unset.
* @returns {boolean} Returns `true` if the property is deleted, else `false`.
*/
function baseUnset(object, path) {
path = castPath(path, object);
object = parent(object, path);
return object == null || delete object[toKey(last(path))];
}
module.exports = baseUnset;
/***/ },
/* 869 */
/*!**********************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_customOmitClone.js ***!
\**********************************************************/
/***/ function(module, exports, __webpack_require__) {
var isPlainObject = __webpack_require__(/*! ./isPlainObject */ 703);
/**
* Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
* objects.
*
* @private
* @param {*} value The value to inspect.
* @param {string} key The key of the property to inspect.
* @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
*/
function customOmitClone(value) {
return isPlainObject(value) ? undefined : value;
}
module.exports = customOmitClone;
/***/ },
/* 870 */
/*!************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/modules/Modal/ModalHeader.js ***!
\************************************************************************/
/***/ 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__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function ModalHeader(props) {
var children = props.children,
className = props.className;
var classes = (0, _classnames2.default)(className, 'header');
var rest = (0, _lib.getUnhandledProps)(ModalHeader, props);
var ElementType = (0, _lib.getElementType)(ModalHeader, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
ModalHeader._meta = {
name: 'ModalHeader',
type: _lib.META.TYPES.MODULE,
parent: 'Modal'
};
ModalHeader.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string
};
exports.default = ModalHeader;
/***/ },
/* 871 */
/*!*************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/modules/Modal/ModalContent.js ***!
\*************************************************************************/
/***/ 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__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function ModalContent(props) {
var children = props.children,
image = props.image,
className = props.className;
var classes = (0, _classnames2.default)(className, (0, _lib.useKeyOnly)(image, 'image'), 'content');
var rest = (0, _lib.getUnhandledProps)(ModalContent, props);
var ElementType = (0, _lib.getElementType)(ModalContent, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
ModalContent._meta = {
name: 'ModalContent',
type: _lib.META.TYPES.MODULE,
parent: 'Modal'
};
ModalContent.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** A modal can contain image content */
image: _react.PropTypes.bool
};
exports.default = ModalContent;
/***/ },
/* 872 */
/*!*************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/modules/Modal/ModalActions.js ***!
\*************************************************************************/
/***/ 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__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function ModalActions(props) {
var children = props.children,
className = props.className;
var classes = (0, _classnames2.default)(className, 'actions');
var rest = (0, _lib.getUnhandledProps)(ModalActions, props);
var ElementType = (0, _lib.getElementType)(ModalActions, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
ModalActions._meta = {
name: 'ModalActions',
type: _lib.META.TYPES.MODULE,
parent: 'Modal'
};
ModalActions.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string
};
exports.default = ModalActions;
/***/ },
/* 873 */
/*!*****************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/modules/Modal/ModalDescription.js ***!
\*****************************************************************************/
/***/ 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__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function ModalDescription(props) {
var children = props.children,
className = props.className;
var classes = (0, _classnames2.default)(className, 'description');
var rest = (0, _lib.getUnhandledProps)(ModalDescription, props);
var ElementType = (0, _lib.getElementType)(ModalDescription, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
ModalDescription._meta = {
name: 'ModalDescription',
type: _lib.META.TYPES.MODULE,
parent: 'Modal'
};
ModalDescription.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string
};
exports.default = ModalDescription;
/***/ },
/* 874 */
/*!******************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/elements/Icon/index.js ***!
\******************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _Icon = __webpack_require__(/*! ./Icon */ 845);
var _Icon2 = _interopRequireDefault(_Icon);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = _Icon2.default;
/***/ },
/* 875 */
/*!*****************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/addons/Radio/index.js ***!
\*****************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _Radio = __webpack_require__(/*! ./Radio */ 876);
var _Radio2 = _interopRequireDefault(_Radio);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = _Radio2.default;
/***/ },
/* 876 */
/*!*****************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/addons/Radio/Radio.js ***!
\*****************************************************************/
/***/ 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__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _Checkbox = __webpack_require__(/*! ../../modules/Checkbox */ 877);
var _Checkbox2 = _interopRequireDefault(_Checkbox);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* A Radio is sugar for <Checkbox radio />.
* Useful for exclusive groups of sliders or toggles.
* @see Checkbox
* @see Form
*/
function Radio(props) {
var slider = props.slider,
toggle = props.toggle,
type = props.type;
var rest = (0, _lib.getUnhandledProps)(Radio, props);
// const ElementType = getElementType(Radio, props)
// radio, slider, toggle are exclusive
// use an undefined radio if slider or toggle are present
var radio = !(slider || toggle) || undefined;
return _react2.default.createElement(_Checkbox2.default, _extends({}, rest, { type: type, radio: radio, slider: slider, toggle: toggle }));
}
Radio._meta = {
name: 'Radio',
type: _lib.META.TYPES.ADDON,
props: {
type: _Checkbox2.default._meta.props.type
}
};
Radio.propTypes = {
/** Format to emphasize the current selection state */
slider: _Checkbox2.default.propTypes.slider,
/** Format to show an on or off choice */
toggle: _Checkbox2.default.propTypes.toggle,
/** HTML input type, either checkbox or radio. */
type: _react.PropTypes.oneOf(Radio._meta.props.type)
};
Radio.defaultProps = {
type: 'radio'
};
exports.default = Radio;
/***/ },
/* 877 */
/*!*********************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/modules/Checkbox/index.js ***!
\*********************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _Checkbox = __webpack_require__(/*! ./Checkbox */ 878);
var _Checkbox2 = _interopRequireDefault(_Checkbox);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = _Checkbox2.default;
/***/ },
/* 878 */
/*!************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/modules/Checkbox/Checkbox.js ***!
\************************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _isNil2 = __webpack_require__(/*! lodash/fp/isNil */ 833);
var _isNil3 = _interopRequireDefault(_isNil2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
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 debug = (0, _lib.makeDebugger)('checkbox');
var _meta = {
name: 'Checkbox',
type: _lib.META.TYPES.MODULE,
props: {
type: ['checkbox', 'radio']
}
};
/**
* A checkbox allows a user to select a value from a small set of options, often binary
* @see Form
* @see Radio
*/
var Checkbox = function (_Component) {
_inherits(Checkbox, _Component);
function Checkbox() {
var _ref;
var _temp, _this, _ret;
_classCallCheck(this, Checkbox);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Checkbox.__proto__ || Object.getPrototypeOf(Checkbox)).call.apply(_ref, [this].concat(args))), _this), _this.state = {}, _this.canToggle = function () {
var _this$props = _this.props,
disabled = _this$props.disabled,
radio = _this$props.radio,
readOnly = _this$props.readOnly;
var checked = _this.state.checked;
return !disabled && !readOnly && !(radio && checked);
}, _this.handleRef = function (c) {
_this.checkboxRef = c;
}, _this.handleClick = function (e) {
debug('handleClick()');
var _this$props2 = _this.props,
onChange = _this$props2.onChange,
onClick = _this$props2.onClick;
var _this$state = _this.state,
checked = _this$state.checked,
indeterminate = _this$state.indeterminate;
if (_this.canToggle()) {
if (onClick) onClick(e, _extends({}, _this.props, { checked: !!checked, indeterminate: !!indeterminate }));
if (onChange) onChange(e, _extends({}, _this.props, { checked: !checked, indeterminate: false }));
_this.trySetState({ checked: !checked, indeterminate: false });
}
}, _this.setIndeterminate = function () {
var indeterminate = _this.state.indeterminate;
if (_this.checkboxRef) _this.checkboxRef.indeterminate = !!indeterminate;
}, _temp), _possibleConstructorReturn(_this, _ret);
}
_createClass(Checkbox, [{
key: 'componentDidMount',
value: function componentDidMount() {
this.setIndeterminate();
}
}, {
key: 'componentDidUpdate',
value: function componentDidUpdate() {
this.setIndeterminate();
}
// Note: You can't directly set the indeterminate prop on the input, so we
// need to maintain a ref to the input and set it manually whenever the
// component updates.
}, {
key: 'render',
value: function render() {
var _props = this.props,
className = _props.className,
disabled = _props.disabled,
label = _props.label,
name = _props.name,
radio = _props.radio,
readOnly = _props.readOnly,
slider = _props.slider,
tabIndex = _props.tabIndex,
toggle = _props.toggle,
type = _props.type,
value = _props.value;
var _state = this.state,
checked = _state.checked,
indeterminate = _state.indeterminate;
var classes = (0, _classnames2.default)('ui', (0, _lib.useKeyOnly)(checked, 'checked'), (0, _lib.useKeyOnly)(disabled, 'disabled'), (0, _lib.useKeyOnly)(indeterminate, 'indeterminate'),
// auto apply fitted class to compact white space when there is no label
// http://semantic-ui.com/modules/checkbox.html#fitted
(0, _lib.useKeyOnly)(!label, 'fitted'), (0, _lib.useKeyOnly)(radio, 'radio'), (0, _lib.useKeyOnly)(readOnly, 'read-only'), (0, _lib.useKeyOnly)(slider, 'slider'), (0, _lib.useKeyOnly)(toggle, 'toggle'), 'checkbox', className);
var rest = (0, _lib.getUnhandledProps)(Checkbox, this.props);
var ElementType = (0, _lib.getElementType)(Checkbox, this.props);
var computedTabIndex = void 0;
if (!(0, _isNil3.default)(tabIndex)) computedTabIndex = tabIndex;else computedTabIndex = disabled ? -1 : 0;
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes, onClick: this.handleClick, onChange: this.handleClick }),
_react2.default.createElement('input', {
checked: checked,
className: 'hidden',
name: name,
readOnly: true,
ref: this.handleRef,
tabIndex: computedTabIndex,
type: type,
value: value
}),
(0, _lib.createHTMLLabel)(label) || _react2.default.createElement('label', null)
);
}
}]);
return Checkbox;
}(_lib.AutoControlledComponent);
Checkbox.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Whether or not checkbox is checked. */
checked: _react.PropTypes.bool,
/** Additional classes. */
className: _react.PropTypes.string,
/** The initial value of checked. */
defaultChecked: _react.PropTypes.bool,
/** Whether or not checkbox is indeterminate. */
defaultIndeterminate: _react.PropTypes.bool,
/** A checkbox can appear disabled and be unable to change states */
disabled: _react.PropTypes.bool,
/** Removes padding for a label. Auto applied when there is no label. */
fitted: _react.PropTypes.bool,
/** Whether or not checkbox is indeterminate. */
indeterminate: _react.PropTypes.bool,
/** The text of the associated label element. */
label: _lib.customPropTypes.itemShorthand,
/** The HTML input name. */
name: _react.PropTypes.string,
/**
* Called when the user attempts to change the checked state.
*
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All props and proposed checked/indeterminate state.
*/
onChange: _react.PropTypes.func,
/**
* Called when the checkbox or label is clicked.
*
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All props and current checked/indeterminate state.
*/
onClick: _react.PropTypes.func,
/** Format as a radio element. This means it is an exclusive option.*/
radio: _lib.customPropTypes.every([_react.PropTypes.bool, _lib.customPropTypes.disallow(['slider', 'toggle'])]),
/** A checkbox can be read-only and unable to change states */
readOnly: _react.PropTypes.bool,
/** Format to emphasize the current selection state */
slider: _lib.customPropTypes.every([_react.PropTypes.bool, _lib.customPropTypes.disallow(['radio', 'toggle'])]),
/** Format to show an on or off choice */
toggle: _lib.customPropTypes.every([_react.PropTypes.bool, _lib.customPropTypes.disallow(['radio', 'slider'])]),
/** HTML input type, either checkbox or radio. */
type: _react.PropTypes.oneOf(_meta.props.type),
/** The HTML input value. */
value: _react.PropTypes.string,
/** A checkbox can receive focus. */
tabIndex: _react.PropTypes.oneOfType([_react.PropTypes.number, _react.PropTypes.string])
};
Checkbox.defaultProps = {
type: 'checkbox'
};
Checkbox.autoControlledProps = ['checked', 'indeterminate'];
Checkbox._meta = _meta;
exports.default = Checkbox;
/***/ },
/* 879 */
/*!******************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/addons/Select/index.js ***!
\******************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _Select = __webpack_require__(/*! ./Select */ 880);
var _Select2 = _interopRequireDefault(_Select);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = _Select2.default;
/***/ },
/* 880 */
/*!*******************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/addons/Select/Select.js ***!
\*******************************************************************/
/***/ 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__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _Dropdown = __webpack_require__(/*! ../../modules/Dropdown */ 881);
var _Dropdown2 = _interopRequireDefault(_Dropdown);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* A Select is sugar for <Dropdown selection />.
* @see Dropdown
* @see Form
*/
function Select(props) {
return _react2.default.createElement(_Dropdown2.default, _extends({}, props, { selection: true }));
}
Select._meta = {
name: 'Select',
type: _lib.META.TYPES.ADDON
};
Select.Divider = _Dropdown2.default.Divider;
Select.Header = _Dropdown2.default.Header;
Select.Item = _Dropdown2.default.Item;
Select.Menu = _Dropdown2.default.Menu;
exports.default = Select;
/***/ },
/* 881 */
/*!*********************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/modules/Dropdown/index.js ***!
\*********************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _Dropdown = __webpack_require__(/*! ./Dropdown */ 882);
var _Dropdown2 = _interopRequireDefault(_Dropdown);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = _Dropdown2.default;
/***/ },
/* 882 */
/*!************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/modules/Dropdown/Dropdown.js ***!
\************************************************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _compact2 = __webpack_require__(/*! lodash/compact */ 806);
var _compact3 = _interopRequireDefault(_compact2);
var _map2 = __webpack_require__(/*! lodash/map */ 825);
var _map3 = _interopRequireDefault(_map2);
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
var _every2 = __webpack_require__(/*! lodash/every */ 883);
var _every3 = _interopRequireDefault(_every2);
var _without2 = __webpack_require__(/*! lodash/without */ 846);
var _without3 = _interopRequireDefault(_without2);
var _findIndex2 = __webpack_require__(/*! lodash/findIndex */ 718);
var _findIndex3 = _interopRequireDefault(_findIndex2);
var _find2 = __webpack_require__(/*! lodash/find */ 716);
var _find3 = _interopRequireDefault(_find2);
var _reduce2 = __webpack_require__(/*! lodash/reduce */ 886);
var _reduce3 = _interopRequireDefault(_reduce2);
var _some2 = __webpack_require__(/*! lodash/some */ 719);
var _some3 = _interopRequireDefault(_some2);
var _escapeRegExp2 = __webpack_require__(/*! lodash/escapeRegExp */ 888);
var _escapeRegExp3 = _interopRequireDefault(_escapeRegExp2);
var _filter2 = __webpack_require__(/*! lodash/filter */ 627);
var _filter3 = _interopRequireDefault(_filter2);
var _isFunction2 = __webpack_require__(/*! lodash/isFunction */ 559);
var _isFunction3 = _interopRequireDefault(_isFunction2);
var _dropRight2 = __webpack_require__(/*! lodash/dropRight */ 889);
var _dropRight3 = _interopRequireDefault(_dropRight2);
var _isEmpty2 = __webpack_require__(/*! lodash/isEmpty */ 685);
var _isEmpty3 = _interopRequireDefault(_isEmpty2);
var _union2 = __webpack_require__(/*! lodash/union */ 890);
var _union3 = _interopRequireDefault(_union2);
var _get3 = __webpack_require__(/*! lodash/get */ 678);
var _get4 = _interopRequireDefault(_get3);
var _includes2 = __webpack_require__(/*! lodash/includes */ 830);
var _includes3 = _interopRequireDefault(_includes2);
var _has2 = __webpack_require__(/*! lodash/has */ 535);
var _has3 = _interopRequireDefault(_has2);
var _isEqual2 = __webpack_require__(/*! lodash/isEqual */ 712);
var _isEqual3 = _interopRequireDefault(_isEqual2);
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 _get2 = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
var _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _Icon = __webpack_require__(/*! ../../elements/Icon */ 874);
var _Icon2 = _interopRequireDefault(_Icon);
var _Label = __webpack_require__(/*! ../../elements/Label */ 893);
var _Label2 = _interopRequireDefault(_Label);
var _DropdownDivider = __webpack_require__(/*! ./DropdownDivider */ 894);
var _DropdownDivider2 = _interopRequireDefault(_DropdownDivider);
var _DropdownItem = __webpack_require__(/*! ./DropdownItem */ 895);
var _DropdownItem2 = _interopRequireDefault(_DropdownItem);
var _DropdownHeader = __webpack_require__(/*! ./DropdownHeader */ 899);
var _DropdownHeader2 = _interopRequireDefault(_DropdownHeader);
var _DropdownMenu = __webpack_require__(/*! ./DropdownMenu */ 900);
var _DropdownMenu2 = _interopRequireDefault(_DropdownMenu);
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 debug = (0, _lib.makeDebugger)('dropdown');
var _meta = {
name: 'Dropdown',
type: _lib.META.TYPES.MODULE,
props: {
pointing: ['left', 'right', 'top', 'top left', 'top right', 'bottom', 'bottom left', 'bottom right'],
additionPosition: ['top', 'bottom']
}
};
/**
* A dropdown allows a user to select a value from a series of options.
* @see Form
* @see Select
*/
var Dropdown = function (_Component) {
_inherits(Dropdown, _Component);
function Dropdown() {
var _ref;
var _temp, _this, _ret;
_classCallCheck(this, Dropdown);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Dropdown.__proto__ || Object.getPrototypeOf(Dropdown)).call.apply(_ref, [this].concat(args))), _this), _this.handleChange = function (e, value) {
debug('handleChange()');
debug(value);
var onChange = _this.props.onChange;
if (onChange) onChange(e, _extends({}, _this.props, { value: value }));
}, _this.closeOnEscape = function (e) {
if (_lib.keyboardKey.getCode(e) !== _lib.keyboardKey.Escape) return;
e.preventDefault();
_this.close();
}, _this.moveSelectionOnKeyDown = function (e) {
debug('moveSelectionOnKeyDown()');
debug(_lib.keyboardKey.getName(e));
switch (_lib.keyboardKey.getCode(e)) {
case _lib.keyboardKey.ArrowDown:
e.preventDefault();
_this.moveSelectionBy(1);
break;
case _lib.keyboardKey.ArrowUp:
e.preventDefault();
_this.moveSelectionBy(-1);
break;
default:
break;
}
}, _this.openOnSpace = function (e) {
debug('openOnSpace()');
if (_lib.keyboardKey.getCode(e) !== _lib.keyboardKey.Spacebar) return;
if (_this.state.open) return;
e.preventDefault();
_this.open(e);
}, _this.openOnArrow = function (e) {
debug('openOnArrow()');
var code = _lib.keyboardKey.getCode(e);
if (!(0, _includes3.default)([_lib.keyboardKey.ArrowDown, _lib.keyboardKey.ArrowUp], code)) return;
if (_this.state.open) return;
e.preventDefault();
_this.open(e);
}, _this.selectHighlightedItem = function (e) {
var open = _this.state.open;
var _this$props = _this.props,
multiple = _this$props.multiple,
onAddItem = _this$props.onAddItem;
var item = _this.getSelectedItem();
var value = (0, _get4.default)(item, 'value');
// prevent selecting null if there was no selected item value
// prevent selecting duplicate items when the dropdown is closed
if (!value || !open) return;
// notify the onAddItem prop if this is a new value
if (onAddItem && item['data-additional']) {
onAddItem(e, _extends({}, _this.props, { value: value }));
}
// notify the onChange prop that the user is trying to change value
if (multiple) {
// state value may be undefined
var newValue = (0, _union3.default)(_this.state.value, [value]);
_this.setValue(newValue);
_this.handleChange(e, newValue);
} else {
_this.setValue(value);
_this.handleChange(e, value);
_this.close();
}
}, _this.selectItemOnEnter = function (e) {
debug('selectItemOnEnter()');
debug(_lib.keyboardKey.getName(e));
if (_lib.keyboardKey.getCode(e) !== _lib.keyboardKey.Enter) return;
e.preventDefault();
_this.selectHighlightedItem(e);
}, _this.removeItemOnBackspace = function (e) {
debug('removeItemOnBackspace()');
debug(_lib.keyboardKey.getName(e));
if (_lib.keyboardKey.getCode(e) !== _lib.keyboardKey.Backspace) return;
var _this$props2 = _this.props,
multiple = _this$props2.multiple,
search = _this$props2.search;
var _this$state = _this.state,
searchQuery = _this$state.searchQuery,
value = _this$state.value;
if (searchQuery || !search || !multiple || (0, _isEmpty3.default)(value)) return;
e.preventDefault();
// remove most recent value
var newValue = (0, _dropRight3.default)(value);
_this.setValue(newValue);
_this.handleChange(e, newValue);
}, _this.closeOnDocumentClick = function (e) {
debug('closeOnDocumentClick()');
debug(e);
// If event happened in the dropdown, ignore it
if (_this._dropdown && (0, _isFunction3.default)(_this._dropdown.contains) && _this._dropdown.contains(e.target)) return;
_this.close();
}, _this.handleMouseDown = function (e) {
debug('handleMouseDown()');
var onMouseDown = _this.props.onMouseDown;
if (onMouseDown) onMouseDown(e, _this.props);
_this.isMouseDown = true;
// Do not access document when server side rendering
if (!_lib.isBrowser) return;
document.addEventListener('mouseup', _this.handleDocumentMouseUp);
}, _this.handleDocumentMouseUp = function () {
debug('handleDocumentMouseUp()');
_this.isMouseDown = false;
// Do not access document when server side rendering
if (!_lib.isBrowser) return;
document.removeEventListener('mouseup', _this.handleDocumentMouseUp);
}, _this.handleClick = function (e) {
debug('handleClick()', e);
var onClick = _this.props.onClick;
if (onClick) onClick(e, _this.props);
// prevent closeOnDocumentClick()
e.stopPropagation();
_this.toggle(e);
}, _this.handleItemClick = function (e, item) {
debug('handleItemClick()');
debug(item);
var _this$props3 = _this.props,
multiple = _this$props3.multiple,
onAddItem = _this$props3.onAddItem;
var value = item.value;
// prevent toggle() in handleClick()
e.stopPropagation();
// prevent closeOnDocumentClick() if multiple or item is disabled
if (multiple || item.disabled) {
e.nativeEvent.stopImmediatePropagation();
}
if (item.disabled) return;
// notify the onAddItem prop if this is a new value
if (onAddItem && item['data-additional']) {
onAddItem(e, _extends({}, _this.props, { value: value }));
}
// notify the onChange prop that the user is trying to change value
if (multiple) {
var newValue = (0, _union3.default)(_this.state.value, [value]);
_this.setValue(newValue);
_this.handleChange(e, newValue);
} else {
_this.setValue(value);
_this.handleChange(e, value);
_this.close();
}
}, _this.handleFocus = function (e) {
debug('handleFocus()');
var onFocus = _this.props.onFocus;
if (onFocus) onFocus(e, _this.props);
_this.setState({ focus: true });
}, _this.handleBlur = function (e) {
debug('handleBlur()');
var _this$props4 = _this.props,
multiple = _this$props4.multiple,
onBlur = _this$props4.onBlur,
selectOnBlur = _this$props4.selectOnBlur;
// do not "blur" when the mouse is down inside of the Dropdown
if (_this.isMouseDown) return;
if (onBlur) onBlur(e, _this.props);
if (selectOnBlur && !multiple) _this.selectHighlightedItem(e);
_this.setState({ focus: false, searchQuery: '' });
}, _this.handleSearchChange = function (e) {
debug('handleSearchChange()');
debug(e.target.value);
// prevent propagating to this.props.onChange()
e.stopPropagation();
var _this$props5 = _this.props,
search = _this$props5.search,
onSearchChange = _this$props5.onSearchChange;
var open = _this.state.open;
var newQuery = e.target.value;
if (onSearchChange) onSearchChange(e, newQuery);
// open search dropdown on search query
if (search && newQuery && !open) _this.open();
_this.setState({
selectedIndex: _this.getEnabledIndices()[0],
searchQuery: newQuery
});
}, _this.getMenuOptions = function () {
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _this.state.value;
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _this.props.options;
var _this$props6 = _this.props,
multiple = _this$props6.multiple,
search = _this$props6.search,
allowAdditions = _this$props6.allowAdditions,
additionPosition = _this$props6.additionPosition,
additionLabel = _this$props6.additionLabel;
var searchQuery = _this.state.searchQuery;
var filteredOptions = options;
// filter out active options
if (multiple) {
filteredOptions = (0, _filter3.default)(filteredOptions, function (opt) {
return !(0, _includes3.default)(value, opt.value);
});
}
// filter by search query
if (search && searchQuery) {
if ((0, _isFunction3.default)(search)) {
filteredOptions = search(filteredOptions, searchQuery);
} else {
(function () {
var re = new RegExp((0, _escapeRegExp3.default)(searchQuery), 'i');
filteredOptions = (0, _filter3.default)(filteredOptions, function (opt) {
return re.test(opt.text);
});
})();
}
}
// insert the "add" item
if (allowAdditions && search && searchQuery && !(0, _some3.default)(filteredOptions, { text: searchQuery })) {
var additionLabelElement = _react2.default.isValidElement(additionLabel) ? _react2.default.cloneElement(additionLabel, { key: 'label' }) : additionLabel || '';
var addItem = {
// by using an array, we can pass multiple elements, but when doing so
// we must specify a `key` for React to know which one is which
text: [additionLabelElement, _react2.default.createElement(
'b',
{ key: 'addition' },
searchQuery
)],
value: searchQuery,
className: 'addition',
'data-additional': true
};
if (additionPosition === 'top') filteredOptions.unshift(addItem);else filteredOptions.push(addItem);
}
return filteredOptions;
}, _this.getSelectedItem = function () {
var selectedIndex = _this.state.selectedIndex;
var options = _this.getMenuOptions();
return (0, _get4.default)(options, '[' + selectedIndex + ']');
}, _this.getEnabledIndices = function (givenOptions) {
var options = givenOptions || _this.getMenuOptions();
return (0, _reduce3.default)(options, function (memo, item, index) {
if (!item.disabled) memo.push(index);
return memo;
}, []);
}, _this.getItemByValue = function (value) {
var options = _this.props.options;
return (0, _find3.default)(options, { value: value });
}, _this.getMenuItemIndexByValue = function (value, givenOptions) {
var options = givenOptions || _this.getMenuOptions();
return (0, _findIndex3.default)(options, ['value', value]);
}, _this.getDropdownAriaOptions = function (ElementType) {
var _this$props7 = _this.props,
loading = _this$props7.loading,
disabled = _this$props7.disabled,
search = _this$props7.search,
multiple = _this$props7.multiple;
var open = _this.state.open;
var ariaOptions = {
role: search ? 'combobox' : 'listbox',
'aria-busy': loading,
'aria-disabled': disabled,
'aria-expanded': !!open
};
if (ariaOptions.role === 'listbox') {
ariaOptions['aria-multiselectable'] = multiple;
}
return ariaOptions;
}, _this.setValue = function (value) {
debug('setValue()');
debug('value', value);
var newState = {
searchQuery: ''
};
_this.trySetState({ value: value }, newState);
_this.setSelectedIndex(value);
}, _this.setSelectedIndex = function () {
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _this.state.value;
var optionsProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _this.props.options;
var multiple = _this.props.multiple;
var selectedIndex = _this.state.selectedIndex;
var options = _this.getMenuOptions(value, optionsProps);
var enabledIndicies = _this.getEnabledIndices(options);
var newSelectedIndex = void 0;
// update the selected index
if (!selectedIndex || selectedIndex < 0) {
var firstIndex = enabledIndicies[0];
// Select the currently active item, if none, use the first item.
// Multiple selects remove active items from the list,
// their initial selected index should be 0.
newSelectedIndex = multiple ? firstIndex : _this.getMenuItemIndexByValue(value, options) || enabledIndicies[0];
} else if (multiple) {
// multiple selects remove options from the menu as they are made active
// keep the selected index within range of the remaining items
if (selectedIndex >= options.length - 1) {
newSelectedIndex = enabledIndicies[enabledIndicies.length - 1];
}
} else {
var activeIndex = _this.getMenuItemIndexByValue(value, options);
// regular selects can only have one active item
// set the selected index to the currently active item
newSelectedIndex = (0, _includes3.default)(enabledIndicies, activeIndex) ? activeIndex : undefined;
}
if (!newSelectedIndex || newSelectedIndex < 0) {
newSelectedIndex = enabledIndicies[0];
}
_this.setState({ selectedIndex: newSelectedIndex });
}, _this.handleLabelClick = function (e, labelProps) {
debug('handleLabelClick()');
// prevent focusing search input on click
e.stopPropagation();
_this.setState({ selectedLabel: labelProps.value });
var onLabelClick = _this.props.onLabelClick;
if (onLabelClick) onLabelClick(e, labelProps);
}, _this.handleLabelRemove = function (e, labelProps) {
debug('handleLabelRemove()');
// prevent focusing search input on click
e.stopPropagation();
var value = _this.state.value;
var newValue = (0, _without3.default)(value, labelProps.value);
debug('label props:', labelProps);
debug('current value:', value);
debug('remove value:', labelProps.value);
debug('new value:', newValue);
_this.setValue(newValue);
_this.handleChange(e, newValue);
}, _this.moveSelectionBy = function (offset) {
var startIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _this.state.selectedIndex;
debug('moveSelectionBy()');
debug('offset: ' + offset);
var options = _this.getMenuOptions();
var lastIndex = options.length - 1;
// Prevent infinite loop
if ((0, _every3.default)(options, 'disabled')) return;
// next is after last, wrap to beginning
// next is before first, wrap to end
var nextIndex = startIndex + offset;
if (nextIndex > lastIndex) nextIndex = 0;else if (nextIndex < 0) nextIndex = lastIndex;
if (options[nextIndex].disabled) return _this.moveSelectionBy(offset, nextIndex);
_this.setState({ selectedIndex: nextIndex });
_this.scrollSelectedItemIntoView();
}, _this.scrollSelectedItemIntoView = function () {
debug('scrollSelectedItemIntoView()');
// Do not access document when server side rendering
if (!_lib.isBrowser) return;
var menu = document.querySelector('.ui.dropdown.active.visible .menu.visible');
var item = menu.querySelector('.item.selected');
debug('menu: ' + menu);
debug('item: ' + item);
var isOutOfUpperView = item.offsetTop < menu.scrollTop;
var isOutOfLowerView = item.offsetTop + item.clientHeight > menu.scrollTop + menu.clientHeight;
if (isOutOfUpperView) {
menu.scrollTop = item.offsetTop;
} else if (isOutOfLowerView) {
menu.scrollTop = item.offsetTop + item.clientHeight - menu.clientHeight;
}
}, _this.open = function (e) {
debug('open()');
var _this$props8 = _this.props,
disabled = _this$props8.disabled,
onOpen = _this$props8.onOpen,
search = _this$props8.search;
if (disabled) return;
if (search && _this._search) _this._search.focus();
if (onOpen) onOpen(e, _this.props);
_this.trySetState({ open: true });
}, _this.close = function (e) {
debug('close()');
var onClose = _this.props.onClose;
if (onClose) onClose(e, _this.props);
_this.trySetState({ open: false });
}, _this.handleClose = function () {
debug('handleClose()');
// https://github.com/Semantic-Org/Semantic-UI-React/issues/627
// Blur the Dropdown on close so it is blurred after selecting an item.
// This is to prevent it from re-opening when switching tabs after selecting an item.
_this._dropdown.blur();
// We need to keep the virtual model in sync with the browser focus change
// https://github.com/Semantic-Org/Semantic-UI-React/issues/692
_this.setState({ focus: false });
}, _this.toggle = function (e) {
return _this.state.open ? _this.close(e) : _this.open(e);
}, _this.renderText = function () {
var _this$props9 = _this.props,
multiple = _this$props9.multiple,
placeholder = _this$props9.placeholder,
search = _this$props9.search,
text = _this$props9.text;
var _this$state2 = _this.state,
searchQuery = _this$state2.searchQuery,
value = _this$state2.value,
open = _this$state2.open;
var hasValue = multiple ? !(0, _isEmpty3.default)(value) : !(0, _isNil3.default)(value) && value !== '';
var classes = (0, _classnames2.default)(placeholder && !hasValue && 'default', 'text', search && searchQuery && 'filtered');
var _text = placeholder;
if (searchQuery) {
_text = null;
} else if (text) {
_text = text;
} else if (open && !multiple) {
_text = (0, _get4.default)(_this.getSelectedItem(), 'text');
} else if (hasValue) {
_text = (0, _get4.default)(_this.getItemByValue(value), 'text');
}
return _react2.default.createElement(
'div',
{ className: classes },
_text
);
}, _this.renderHiddenInput = function () {
debug('renderHiddenInput()');
var value = _this.state.value;
var _this$props10 = _this.props,
multiple = _this$props10.multiple,
name = _this$props10.name,
options = _this$props10.options,
selection = _this$props10.selection;
debug('name: ' + name);
debug('selection: ' + selection);
debug('value: ' + value);
if (!selection) return null;
// a dropdown without an active item will have an empty string value
return _react2.default.createElement(
'select',
{ type: 'hidden', 'aria-hidden': 'true', name: name, value: value, multiple: multiple },
_react2.default.createElement('option', { value: '' }),
(0, _map3.default)(options, function (option) {
return _react2.default.createElement(
'option',
{ key: option.value, value: option.value },
option.text
);
})
);
}, _this.renderSearchInput = function () {
var _this$props11 = _this.props,
disabled = _this$props11.disabled,
search = _this$props11.search,
name = _this$props11.name,
tabIndex = _this$props11.tabIndex;
var searchQuery = _this.state.searchQuery;
if (!search) return null;
// tabIndex
var computedTabIndex = void 0;
if (!(0, _isNil3.default)(tabIndex)) computedTabIndex = tabIndex;else computedTabIndex = disabled ? -1 : 0;
// resize the search input, temporarily show the sizer so we can measure it
var searchWidth = void 0;
if (_this._sizer && searchQuery) {
_this._sizer.style.display = 'inline';
_this._sizer.textContent = searchQuery;
searchWidth = Math.ceil(_this._sizer.getBoundingClientRect().width);
_this._sizer.style.removeProperty('display');
}
return _react2.default.createElement('input', {
value: searchQuery,
type: 'text',
'aria-autocomplete': 'list',
onChange: _this.handleSearchChange,
className: 'search',
name: [name, 'search'].join('-'),
autoComplete: 'off',
tabIndex: computedTabIndex,
style: { width: searchWidth },
ref: function ref(c) {
return _this._search = c;
}
});
}, _this.renderSearchSizer = function () {
var _this$props12 = _this.props,
search = _this$props12.search,
multiple = _this$props12.multiple;
if (!(search && multiple)) return null;
return _react2.default.createElement('span', { className: 'sizer', ref: function ref(c) {
return _this._sizer = c;
} });
}, _this.renderLabels = function () {
debug('renderLabels()');
var _this$props13 = _this.props,
multiple = _this$props13.multiple,
renderLabel = _this$props13.renderLabel;
var _this$state3 = _this.state,
selectedLabel = _this$state3.selectedLabel,
value = _this$state3.value;
if (!multiple || (0, _isEmpty3.default)(value)) {
return;
}
var selectedItems = (0, _map3.default)(value, _this.getItemByValue);
debug('selectedItems', selectedItems);
// if no item could be found for a given state value the selected item will be undefined
// compact the selectedItems so we only have actual objects left
return (0, _map3.default)((0, _compact3.default)(selectedItems), function (item, index) {
var defaultLabelProps = {
active: item.value === selectedLabel,
as: 'a',
key: item.value,
onClick: _this.handleLabelClick,
onRemove: _this.handleLabelRemove,
value: item.value
};
return _Label2.default.create(renderLabel(item, index, defaultLabelProps), defaultLabelProps);
});
}, _this.renderOptions = function () {
var _this$props14 = _this.props,
multiple = _this$props14.multiple,
search = _this$props14.search,
noResultsMessage = _this$props14.noResultsMessage;
var _this$state4 = _this.state,
selectedIndex = _this$state4.selectedIndex,
value = _this$state4.value;
var options = _this.getMenuOptions();
if (noResultsMessage !== null && search && (0, _isEmpty3.default)(options)) {
return _react2.default.createElement(
'div',
{ className: 'message' },
noResultsMessage
);
}
var isActive = multiple ? function (optValue) {
return (0, _includes3.default)(value, optValue);
} : function (optValue) {
return optValue === value;
};
return (0, _map3.default)(options, function (opt, i) {
return _react2.default.createElement(_DropdownItem2.default, _extends({
key: opt.value + '-' + i,
active: isActive(opt.value),
onClick: _this.handleItemClick,
selected: selectedIndex === i
}, opt, {
// Needed for handling click events on disabled items
style: _extends({}, opt.style, { pointerEvents: 'all' })
}));
});
}, _this.renderMenu = function () {
var _this$props15 = _this.props,
children = _this$props15.children,
header = _this$props15.header;
var open = _this.state.open;
var menuClasses = open ? 'visible' : '';
var ariaOptions = _this.getDropdownMenuAriaOptions();
// single menu child
if (!(0, _isNil3.default)(children)) {
var menuChild = _react.Children.only(children);
var className = (0, _classnames2.default)(menuClasses, menuChild.props.className);
return (0, _react.cloneElement)(menuChild, _extends({ className: className }, ariaOptions));
}
return _react2.default.createElement(
_DropdownMenu2.default,
_extends({}, ariaOptions, { className: menuClasses }),
(0, _lib.createShorthand)(_DropdownHeader2.default, function (val) {
return { content: val };
}, header),
_this.renderOptions()
);
}, _temp), _possibleConstructorReturn(_this, _ret);
}
_createClass(Dropdown, [{
key: 'componentWillMount',
value: function componentWillMount() {
if (_get2(Dropdown.prototype.__proto__ || Object.getPrototypeOf(Dropdown.prototype), 'componentWillMount', this)) _get2(Dropdown.prototype.__proto__ || Object.getPrototypeOf(Dropdown.prototype), 'componentWillMount', this).call(this);
debug('componentWillMount()');
var _state = this.state,
open = _state.open,
value = _state.value;
this.setValue(value);
if (open) this.open();
}
}, {
key: 'shouldComponentUpdate',
value: function shouldComponentUpdate(nextProps, nextState) {
return !(0, _isEqual3.default)(nextProps, this.props) || !(0, _isEqual3.default)(nextState, this.state);
}
}, {
key: 'componentWillReceiveProps',
value: function componentWillReceiveProps(nextProps) {
_get2(Dropdown.prototype.__proto__ || Object.getPrototypeOf(Dropdown.prototype), 'componentWillReceiveProps', this).call(this, nextProps);
debug('componentWillReceiveProps()');
// TODO objectDiff still runs in prod, stop it
debug('to props:', (0, _lib.objectDiff)(this.props, nextProps));
/* eslint-disable no-console */
if (process.env.NODE_ENV !== 'production') {
// in development, validate value type matches dropdown type
var isNextValueArray = Array.isArray(nextProps.value);
var hasValue = (0, _has3.default)(nextProps, 'value');
if (hasValue && nextProps.multiple && !isNextValueArray) {
console.error('Dropdown `value` must be an array when `multiple` is set.' + (' Received type: `' + Object.prototype.toString.call(nextProps.value) + '`.'));
} else if (hasValue && !nextProps.multiple && isNextValueArray) {
console.error('Dropdown `value` must not be an array when `multiple` is not set.' + ' Either set `multiple={true}` or use a string or number value.');
}
}
/* eslint-enable no-console */
if (!(0, _isEqual3.default)(nextProps.value, this.props.value)) {
debug('value changed, setting', nextProps.value);
this.setValue(nextProps.value);
}
if (!(0, _isEqual3.default)(nextProps.options, this.props.options)) {
this.setSelectedIndex(undefined, nextProps.options);
}
}
}, {
key: 'componentDidUpdate',
value: function componentDidUpdate(prevProps, prevState) {
// eslint-disable-line complexity
debug('componentDidUpdate()');
// TODO objectDiff still runs in prod, stop it
debug('to state:', (0, _lib.objectDiff)(prevState, this.state));
// Do not access document when server side rendering
if (!_lib.isBrowser) return;
// focused / blurred
if (!prevState.focus && this.state.focus) {
debug('dropdown focused');
if (!this.isMouseDown) {
debug('mouse is not down, opening');
this.open();
}
if (!this.state.open) {
document.addEventListener('keydown', this.openOnArrow);
document.addEventListener('keydown', this.openOnSpace);
} else {
document.addEventListener('keydown', this.moveSelectionOnKeyDown);
document.addEventListener('keydown', this.selectItemOnEnter);
document.addEventListener('keydown', this.removeItemOnBackspace);
}
} else if (prevState.focus && !this.state.focus) {
debug('dropdown blurred');
if (!this.isMouseDown) {
debug('mouse is not down, closing');
this.close();
}
document.removeEventListener('keydown', this.openOnArrow);
document.removeEventListener('keydown', this.openOnSpace);
document.removeEventListener('keydown', this.moveSelectionOnKeyDown);
document.removeEventListener('keydown', this.selectItemOnEnter);
document.removeEventListener('keydown', this.removeItemOnBackspace);
}
// opened / closed
if (!prevState.open && this.state.open) {
debug('dropdown opened');
document.addEventListener('keydown', this.closeOnEscape);
document.addEventListener('keydown', this.moveSelectionOnKeyDown);
document.addEventListener('keydown', this.selectItemOnEnter);
document.addEventListener('keydown', this.removeItemOnBackspace);
document.addEventListener('click', this.closeOnDocumentClick);
document.removeEventListener('keydown', this.openOnArrow);
document.removeEventListener('keydown', this.openOnSpace);
} else if (prevState.open && !this.state.open) {
debug('dropdown closed');
this.handleClose();
document.removeEventListener('keydown', this.closeOnEscape);
document.removeEventListener('keydown', this.moveSelectionOnKeyDown);
document.removeEventListener('keydown', this.selectItemOnEnter);
document.removeEventListener('keydown', this.removeItemOnBackspace);
document.removeEventListener('click', this.closeOnDocumentClick);
}
}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {
debug('componentWillUnmount()');
// Do not access document when server side rendering
if (!_lib.isBrowser) return;
document.removeEventListener('keydown', this.openOnArrow);
document.removeEventListener('keydown', this.openOnSpace);
document.removeEventListener('keydown', this.moveSelectionOnKeyDown);
document.removeEventListener('keydown', this.selectItemOnEnter);
document.removeEventListener('keydown', this.removeItemOnBackspace);
document.removeEventListener('keydown', this.closeOnEscape);
document.removeEventListener('click', this.closeOnDocumentClick);
}
// ----------------------------------------
// Document Event Handlers
// ----------------------------------------
// onChange needs to receive a value
// can't rely on props.value if we are controlled
// ----------------------------------------
// Component Event Handlers
// ----------------------------------------
// ----------------------------------------
// Getters
// ----------------------------------------
// There are times when we need to calculate the options based on a value
// that hasn't yet been persisted to state.
}, {
key: 'getDropdownMenuAriaOptions',
value: function getDropdownMenuAriaOptions() {
var _props = this.props,
search = _props.search,
multiple = _props.multiple;
var ariaOptions = {};
if (search) {
ariaOptions['aria-multiselectable'] = multiple;
ariaOptions.role = 'listbox';
}
return ariaOptions;
}
// ----------------------------------------
// Setters
// ----------------------------------------
// ----------------------------------------
// Behavior
// ----------------------------------------
// ----------------------------------------
// Render
// ----------------------------------------
}, {
key: 'render',
value: function render() {
var _this2 = this;
debug('render()');
debug('props', this.props);
debug('state', this.state);
var open = this.state.open;
var _props2 = this.props,
basic = _props2.basic,
button = _props2.button,
className = _props2.className,
compact = _props2.compact,
fluid = _props2.fluid,
floating = _props2.floating,
icon = _props2.icon,
inline = _props2.inline,
labeled = _props2.labeled,
multiple = _props2.multiple,
pointing = _props2.pointing,
search = _props2.search,
selection = _props2.selection,
simple = _props2.simple,
loading = _props2.loading,
error = _props2.error,
disabled = _props2.disabled,
scrolling = _props2.scrolling,
tabIndex = _props2.tabIndex,
trigger = _props2.trigger;
// Classes
var classes = (0, _classnames2.default)('ui', (0, _lib.useKeyOnly)(open, 'active visible'), (0, _lib.useKeyOnly)(disabled, 'disabled'), (0, _lib.useKeyOnly)(error, 'error'), (0, _lib.useKeyOnly)(loading, 'loading'), (0, _lib.useKeyOnly)(basic, 'basic'), (0, _lib.useKeyOnly)(button, 'button'), (0, _lib.useKeyOnly)(compact, 'compact'), (0, _lib.useKeyOnly)(fluid, 'fluid'), (0, _lib.useKeyOnly)(floating, 'floating'), (0, _lib.useKeyOnly)(inline, 'inline'),
// TODO: consider augmentation to render Dropdowns as Button/Menu, solves icon/link item issues
// https://github.com/Semantic-Org/Semantic-UI-React/issues/401#issuecomment-240487229
// TODO: the icon class is only required when a dropdown is a button
// useKeyOnly(icon, 'icon'),
(0, _lib.useKeyOnly)(labeled, 'labeled'),
// TODO: linkItem is required only when Menu child, add dynamically
// useKeyOnly(linkItem, 'link item'),
(0, _lib.useKeyOnly)(multiple, 'multiple'), (0, _lib.useKeyOnly)(search, 'search'), (0, _lib.useKeyOnly)(selection, 'selection'), (0, _lib.useKeyOnly)(simple, 'simple'), (0, _lib.useKeyOnly)(scrolling, 'scrolling'), (0, _lib.useKeyOrValueAndKey)(pointing, 'pointing'), className, 'dropdown');
var rest = (0, _lib.getUnhandledProps)(Dropdown, this.props);
var ElementType = (0, _lib.getElementType)(Dropdown, this.props);
var ariaOptions = this.getDropdownAriaOptions(ElementType, this.props);
var computedTabIndex = void 0;
if (!(0, _isNil3.default)(tabIndex)) {
computedTabIndex = tabIndex;
} else if (!search) {
// don't set a root node tabIndex as the search input has its own tabIndex
computedTabIndex = disabled ? -1 : 0;
}
return _react2.default.createElement(
ElementType,
_extends({}, rest, ariaOptions, {
className: classes,
onBlur: this.handleBlur,
onClick: this.handleClick,
onMouseDown: this.handleMouseDown,
onFocus: this.handleFocus,
onChange: this.handleChange,
tabIndex: computedTabIndex,
ref: function ref(c) {
return _this2._dropdown = c;
}
}),
this.renderHiddenInput(),
this.renderLabels(),
this.renderSearchInput(),
this.renderSearchSizer(),
trigger || this.renderText(),
_Icon2.default.create(icon),
this.renderMenu()
);
}
}]);
return Dropdown;
}(_lib.AutoControlledComponent);
Dropdown.propTypes = {
/**
* Allow user additions to the list of options (boolean).
* Requires the use of `selection`, `options` and `search`.
*/
allowAdditions: _lib.customPropTypes.every([_lib.customPropTypes.demand(['options', 'selection', 'search']), _react.PropTypes.bool]),
/** Position of the `Add: ...` option in the dropdown list ('top' or 'bottom'). */
additionPosition: _react.PropTypes.oneOf(_meta.props.additionPosition),
/** Label prefixed to an option added by a user. */
additionLabel: _react.PropTypes.oneOfType([_react.PropTypes.element, _react.PropTypes.string]),
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** A Dropdown can reduce its complexity */
basic: _react.PropTypes.bool,
/** Format the Dropdown to appear as a button. */
button: _react.PropTypes.bool,
/** Primary content. */
children: _lib.customPropTypes.every([_lib.customPropTypes.disallow(['options', 'selection']), _lib.customPropTypes.givenProps({ children: _react.PropTypes.any.isRequired }, _react2.default.PropTypes.element.isRequired)]),
/** Additional classes. */
className: _react.PropTypes.string,
/** A compact dropdown has no minimum width. */
compact: _react.PropTypes.bool,
/** Initial value of open. */
defaultOpen: _react.PropTypes.bool,
/** Currently selected label in multi-select. */
defaultSelectedLabel: _lib.customPropTypes.every([_lib.customPropTypes.demand(['multiple']), _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.number])]),
/** Initial value or value array if multiple. */
defaultValue: _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.number, _react.PropTypes.arrayOf(_react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.number]))]),
/** A disabled dropdown menu or item does not allow user interaction. */
disabled: _react.PropTypes.bool,
/** An errored dropdown can alert a user to a problem. */
error: _react.PropTypes.bool,
/** A dropdown menu can contain floated content. */
floating: _react.PropTypes.bool,
/** A dropdown can take the full width of its parent */
fluid: _react.PropTypes.bool,
/** A dropdown menu can contain a header. */
header: _react.PropTypes.node,
/** Shorthand for Icon. */
icon: _react.PropTypes.oneOfType([_react.PropTypes.node, _react.PropTypes.object]),
/** A dropdown can be formatted to appear inline in other content. */
inline: _react.PropTypes.bool,
/** A dropdown can be labeled. */
labeled: _react.PropTypes.bool,
// linkItem: PropTypes.bool,
/** A dropdown can show that it is currently loading data. */
loading: _react.PropTypes.bool,
/** A selection dropdown can allow multiple selections. */
multiple: _react.PropTypes.bool,
/** Name of the hidden input which holds the value. */
name: _react.PropTypes.string,
/** Message to display when there are no results. */
noResultsMessage: _react.PropTypes.string,
/**
* Called when a user adds a new item. Use this to update the options list.
*
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All props and the new item's value.
*/
onAddItem: _react.PropTypes.func,
/**
* Called on blur.
*
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All props.
*/
onBlur: _react.PropTypes.func,
/**
* Called when the user attempts to change the value.
*
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All props and proposed value.
*/
onChange: _react.PropTypes.func,
/**
* Called when a close event happens.
*
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All props.
*/
onClose: _react.PropTypes.func,
/**
* Called when a multi-select label is clicked.
*
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All label props.
*/
onLabelClick: _react.PropTypes.func,
/**
* Called when an open event happens.
*
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All props.
*/
onOpen: _react.PropTypes.func,
/**
* Called on search input change.
*
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {string} value - Current value of search input.
*/
onSearchChange: _react.PropTypes.func,
/**
* Called on click.
*
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All props.
*/
onClick: _react.PropTypes.func,
/**
* Called on focus.
*
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All props.
*/
onFocus: _react.PropTypes.func,
/**
* Called on mousedown.
*
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All props.
*/
onMouseDown: _react.PropTypes.func,
/** Controls whether or not the dropdown menu is displayed. */
open: _react.PropTypes.bool,
/** Array of Dropdown.Item props e.g. `{ text: '', value: '' }` */
options: _lib.customPropTypes.every([_lib.customPropTypes.disallow(['children']), _react.PropTypes.arrayOf(_react.PropTypes.shape(_DropdownItem2.default.propTypes))]),
/** Placeholder text. */
placeholder: _react.PropTypes.string,
/** A dropdown can be formatted so that its menu is pointing. */
pointing: _react.PropTypes.oneOfType([_react.PropTypes.bool, _react.PropTypes.oneOf(_meta.props.pointing)]),
/**
* A function that takes (data, index, defaultLabelProps) and returns
* shorthand for Label .
*/
renderLabel: _react.PropTypes.func,
/** A dropdown can have its menu scroll. */
scrolling: _react.PropTypes.bool,
/**
* A selection dropdown can allow a user to search through a large list of choices.
* Pass a function here to replace the default search.
*/
search: _react.PropTypes.oneOfType([_react.PropTypes.bool, _react.PropTypes.func]),
// TODO 'searchInMenu' or 'search='in menu' or ??? How to handle this markup and functionality?
/** Currently selected label in multi-select. */
selectedLabel: _lib.customPropTypes.every([_lib.customPropTypes.demand(['multiple']), _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.number])]),
/** A dropdown can be used to select between choices in a form. */
selection: _lib.customPropTypes.every([_lib.customPropTypes.disallow(['children']), _lib.customPropTypes.demand(['options']), _react.PropTypes.bool]),
/** Define whether the highlighted item should be selected on blur. */
selectOnBlur: _react.PropTypes.bool,
/** A simple dropdown can open without Javascript. */
simple: _react.PropTypes.bool,
/** A dropdown can receive focus. */
tabIndex: _react.PropTypes.oneOfType([_react.PropTypes.number, _react.PropTypes.string]),
/** The text displayed in the dropdown, usually for the active item. */
text: _react.PropTypes.string,
/** Custom element to trigger the menu to become visible. Takes place of 'text'. */
trigger: _lib.customPropTypes.every([_lib.customPropTypes.disallow(['selection', 'text']), _react.PropTypes.node]),
/** Current value or value array if multiple. Creates a controlled component. */
value: _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.number, _react.PropTypes.arrayOf(_react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.number]))])
};
Dropdown.defaultProps = {
additionLabel: 'Add ',
additionPosition: 'top',
icon: 'dropdown',
noResultsMessage: 'No results found.',
renderLabel: function renderLabel(_ref2) {
var text = _ref2.text;
return text;
},
selectOnBlur: true
};
Dropdown.autoControlledProps = ['open', 'value', 'selectedLabel'];
Dropdown._meta = _meta;
Dropdown.Divider = _DropdownDivider2.default;
Dropdown.Header = _DropdownHeader2.default;
Dropdown.Item = _DropdownItem2.default;
Dropdown.Menu = _DropdownMenu2.default;
exports.default = Dropdown;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../../../../process/browser.js */ 4)))
/***/ },
/* 883 */
/*!***********************************************!*\
!*** ./~/semantic-ui-react/~/lodash/every.js ***!
\***********************************************/
/***/ function(module, exports, __webpack_require__) {
var arrayEvery = __webpack_require__(/*! ./_arrayEvery */ 884),
baseEvery = __webpack_require__(/*! ./_baseEvery */ 885),
baseIteratee = __webpack_require__(/*! ./_baseIteratee */ 647),
isArray = __webpack_require__(/*! ./isArray */ 539),
isIterateeCall = __webpack_require__(/*! ./_isIterateeCall */ 721);
/**
* Checks if `predicate` returns truthy for **all** elements of `collection`.
* Iteration is stopped once `predicate` returns falsey. The predicate is
* invoked with three arguments: (value, index|key, collection).
*
* **Note:** This method returns `true` for
* [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
* [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
* elements of empty collections.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {boolean} Returns `true` if all elements pass the predicate check,
* else `false`.
* @example
*
* _.every([true, 1, null, 'yes'], Boolean);
* // => false
*
* var users = [
* { 'user': 'barney', 'age': 36, 'active': false },
* { 'user': 'fred', 'age': 40, 'active': false }
* ];
*
* // The `_.matches` iteratee shorthand.
* _.every(users, { 'user': 'barney', 'active': false });
* // => false
*
* // The `_.matchesProperty` iteratee shorthand.
* _.every(users, ['active', false]);
* // => true
*
* // The `_.property` iteratee shorthand.
* _.every(users, 'active');
* // => false
*/
function every(collection, predicate, guard) {
var func = isArray(collection) ? arrayEvery : baseEvery;
if (guard && isIterateeCall(collection, predicate, guard)) {
predicate = undefined;
}
return func(collection, baseIteratee(predicate, 3));
}
module.exports = every;
/***/ },
/* 884 */
/*!*****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_arrayEvery.js ***!
\*****************************************************/
/***/ function(module, exports) {
/**
* A specialized version of `_.every` for arrays without support for
* iteratee shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} predicate The function invoked per iteration.
* @returns {boolean} Returns `true` if all elements pass the predicate check,
* else `false`.
*/
function arrayEvery(array, predicate) {
var index = -1,
length = array == null ? 0 : array.length;
while (++index < length) {
if (!predicate(array[index], index, array)) {
return false;
}
}
return true;
}
module.exports = arrayEvery;
/***/ },
/* 885 */
/*!****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_baseEvery.js ***!
\****************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseEach = __webpack_require__(/*! ./_baseEach */ 630);
/**
* The base implementation of `_.every` without support for iteratee shorthands.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} predicate The function invoked per iteration.
* @returns {boolean} Returns `true` if all elements pass the predicate check,
* else `false`
*/
function baseEvery(collection, predicate) {
var result = true;
baseEach(collection, function(value, index, collection) {
result = !!predicate(value, index, collection);
return result;
});
return result;
}
module.exports = baseEvery;
/***/ },
/* 886 */
/*!************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/reduce.js ***!
\************************************************/
/***/ function(module, exports, __webpack_require__) {
var arrayReduce = __webpack_require__(/*! ./_arrayReduce */ 783),
baseEach = __webpack_require__(/*! ./_baseEach */ 630),
baseIteratee = __webpack_require__(/*! ./_baseIteratee */ 647),
baseReduce = __webpack_require__(/*! ./_baseReduce */ 887),
isArray = __webpack_require__(/*! ./isArray */ 539);
/**
* Reduces `collection` to a value which is the accumulated result of running
* each element in `collection` thru `iteratee`, where each successive
* invocation is supplied the return value of the previous. If `accumulator`
* is not given, the first element of `collection` is used as the initial
* value. The iteratee is invoked with four arguments:
* (accumulator, value, index|key, collection).
*
* Many lodash methods are guarded to work as iteratees for methods like
* `_.reduce`, `_.reduceRight`, and `_.transform`.
*
* The guarded methods are:
* `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
* and `sortBy`
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @param {*} [accumulator] The initial value.
* @returns {*} Returns the accumulated value.
* @see _.reduceRight
* @example
*
* _.reduce([1, 2], function(sum, n) {
* return sum + n;
* }, 0);
* // => 3
*
* _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
* (result[value] || (result[value] = [])).push(key);
* return result;
* }, {});
* // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
*/
function reduce(collection, iteratee, accumulator) {
var func = isArray(collection) ? arrayReduce : baseReduce,
initAccum = arguments.length < 3;
return func(collection, baseIteratee(iteratee, 4), accumulator, initAccum, baseEach);
}
module.exports = reduce;
/***/ },
/* 887 */
/*!*****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_baseReduce.js ***!
\*****************************************************/
/***/ function(module, exports) {
/**
* The base implementation of `_.reduce` and `_.reduceRight`, without support
* for iteratee shorthands, which iterates over `collection` using `eachFunc`.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @param {*} accumulator The initial value.
* @param {boolean} initAccum Specify using the first or last element of
* `collection` as the initial value.
* @param {Function} eachFunc The function to iterate over `collection`.
* @returns {*} Returns the accumulated value.
*/
function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
eachFunc(collection, function(value, index, collection) {
accumulator = initAccum
? (initAccum = false, value)
: iteratee(accumulator, value, index, collection);
});
return accumulator;
}
module.exports = baseReduce;
/***/ },
/* 888 */
/*!******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/escapeRegExp.js ***!
\******************************************************/
/***/ function(module, exports, __webpack_require__) {
var toString = __webpack_require__(/*! ./toString */ 584);
/**
* Used to match `RegExp`
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
*/
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
reHasRegExpChar = RegExp(reRegExpChar.source);
/**
* Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
* "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to escape.
* @returns {string} Returns the escaped string.
* @example
*
* _.escapeRegExp('[lodash](https://lodash.com/)');
* // => '\[lodash\]\(https://lodash\.com/\)'
*/
function escapeRegExp(string) {
string = toString(string);
return (string && reHasRegExpChar.test(string))
? string.replace(reRegExpChar, '\\$&')
: string;
}
module.exports = escapeRegExp;
/***/ },
/* 889 */
/*!***************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/dropRight.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseSlice = __webpack_require__(/*! ./_baseSlice */ 809),
toInteger = __webpack_require__(/*! ./toInteger */ 624);
/**
* Creates a slice of `array` with `n` elements dropped from the end.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Array
* @param {Array} array The array to query.
* @param {number} [n=1] The number of elements to drop.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Array} Returns the slice of `array`.
* @example
*
* _.dropRight([1, 2, 3]);
* // => [1, 2]
*
* _.dropRight([1, 2, 3], 2);
* // => [1]
*
* _.dropRight([1, 2, 3], 5);
* // => []
*
* _.dropRight([1, 2, 3], 0);
* // => [1, 2, 3]
*/
function dropRight(array, n, guard) {
var length = array == null ? 0 : array.length;
if (!length) {
return [];
}
n = (guard || n === undefined) ? 1 : toInteger(n);
n = length - n;
return baseSlice(array, 0, n < 0 ? 0 : n);
}
module.exports = dropRight;
/***/ },
/* 890 */
/*!***********************************************!*\
!*** ./~/semantic-ui-react/~/lodash/union.js ***!
\***********************************************/
/***/ function(module, exports, __webpack_require__) {
var baseFlatten = __webpack_require__(/*! ./_baseFlatten */ 607),
baseRest = __webpack_require__(/*! ./_baseRest */ 610),
baseUniq = __webpack_require__(/*! ./_baseUniq */ 891),
isArrayLikeObject = __webpack_require__(/*! ./isArrayLikeObject */ 619);
/**
* Creates an array of unique values, in order, from all given arrays using
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @returns {Array} Returns the new array of combined values.
* @example
*
* _.union([2], [1, 2]);
* // => [2, 1]
*/
var union = baseRest(function(arrays) {
return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
});
module.exports = union;
/***/ },
/* 891 */
/*!***************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_baseUniq.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
var SetCache = __webpack_require__(/*! ./_SetCache */ 596),
arrayIncludes = __webpack_require__(/*! ./_arrayIncludes */ 599),
arrayIncludesWith = __webpack_require__(/*! ./_arrayIncludesWith */ 604),
cacheHas = __webpack_require__(/*! ./_cacheHas */ 606),
createSet = __webpack_require__(/*! ./_createSet */ 892),
setToArray = __webpack_require__(/*! ./_setToArray */ 663);
/** Used as the size to enable large array optimizations. */
var LARGE_ARRAY_SIZE = 200;
/**
* The base implementation of `_.uniqBy` without support for iteratee shorthands.
*
* @private
* @param {Array} array The array to inspect.
* @param {Function} [iteratee] The iteratee invoked per element.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new duplicate free array.
*/
function baseUniq(array, iteratee, comparator) {
var index = -1,
includes = arrayIncludes,
length = array.length,
isCommon = true,
result = [],
seen = result;
if (comparator) {
isCommon = false;
includes = arrayIncludesWith;
}
else if (length >= LARGE_ARRAY_SIZE) {
var set = iteratee ? null : createSet(array);
if (set) {
return setToArray(set);
}
isCommon = false;
includes = cacheHas;
seen = new SetCache;
}
else {
seen = iteratee ? [] : result;
}
outer:
while (++index < length) {
var value = array[index],
computed = iteratee ? iteratee(value) : value;
value = (comparator || value !== 0) ? value : 0;
if (isCommon && computed === computed) {
var seenIndex = seen.length;
while (seenIndex--) {
if (seen[seenIndex] === computed) {
continue outer;
}
}
if (iteratee) {
seen.push(computed);
}
result.push(value);
}
else if (!includes(seen, computed, comparator)) {
if (seen !== result) {
seen.push(computed);
}
result.push(value);
}
}
return result;
}
module.exports = baseUniq;
/***/ },
/* 892 */
/*!****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_createSet.js ***!
\****************************************************/
/***/ function(module, exports, __webpack_require__) {
var Set = __webpack_require__(/*! ./_Set */ 672),
noop = __webpack_require__(/*! ./noop */ 745),
setToArray = __webpack_require__(/*! ./_setToArray */ 663);
/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0;
/**
* Creates a set object of `values`.
*
* @private
* @param {Array} values The values to add to the set.
* @returns {Object} Returns the new set.
*/
var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
return new Set(values);
};
module.exports = createSet;
/***/ },
/* 893 */
/*!*******************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/elements/Label/index.js ***!
\*******************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _Label = __webpack_require__(/*! ./Label */ 848);
var _Label2 = _interopRequireDefault(_Label);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = _Label2.default;
/***/ },
/* 894 */
/*!*******************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/modules/Dropdown/DropdownDivider.js ***!
\*******************************************************************************/
/***/ 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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function DropdownDivider(props) {
var className = props.className;
var classes = (0, _classnames2.default)('divider', className);
var rest = (0, _lib.getUnhandledProps)(DropdownDivider, props);
var ElementType = (0, _lib.getElementType)(DropdownDivider, props);
return _react2.default.createElement(ElementType, _extends({}, rest, { className: classes }));
}
DropdownDivider._meta = {
name: 'DropdownDivider',
parent: 'Dropdown',
type: _lib.META.TYPES.MODULE
};
DropdownDivider.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Additional classes. */
className: _react.PropTypes.string
};
exports.default = DropdownDivider;
/***/ },
/* 895 */
/*!****************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/modules/Dropdown/DropdownItem.js ***!
\****************************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _Flag = __webpack_require__(/*! ../../elements/Flag */ 896);
var _Flag2 = _interopRequireDefault(_Flag);
var _Icon = __webpack_require__(/*! ../../elements/Icon */ 874);
var _Icon2 = _interopRequireDefault(_Icon);
var _Image = __webpack_require__(/*! ../../elements/Image */ 898);
var _Image2 = _interopRequireDefault(_Image);
var _Label = __webpack_require__(/*! ../../elements/Label */ 893);
var _Label2 = _interopRequireDefault(_Label);
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; }
/**
* An item sub-component for Dropdown component
*/
var DropdownItem = function (_Component) {
_inherits(DropdownItem, _Component);
function DropdownItem() {
var _ref;
var _temp, _this, _ret;
_classCallCheck(this, DropdownItem);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = DropdownItem.__proto__ || Object.getPrototypeOf(DropdownItem)).call.apply(_ref, [this].concat(args))), _this), _this.handleClick = function (e) {
var onClick = _this.props.onClick;
if (onClick) onClick(e, _this.props);
}, _temp), _possibleConstructorReturn(_this, _ret);
}
_createClass(DropdownItem, [{
key: 'render',
value: function render() {
var _props = this.props,
active = _props.active,
children = _props.children,
className = _props.className,
content = _props.content,
disabled = _props.disabled,
description = _props.description,
flag = _props.flag,
icon = _props.icon,
image = _props.image,
label = _props.label,
selected = _props.selected,
text = _props.text;
var classes = (0, _classnames2.default)((0, _lib.useKeyOnly)(active, 'active'), (0, _lib.useKeyOnly)(disabled, 'disabled'), (0, _lib.useKeyOnly)(selected, 'selected'), 'item', className);
// add default dropdown icon if item contains another menu
var iconName = (0, _isNil3.default)(icon) ? _lib.childrenUtils.someByType(children, 'DropdownMenu') && 'dropdown' : icon;
var rest = (0, _lib.getUnhandledProps)(DropdownItem, this.props);
var ElementType = (0, _lib.getElementType)(DropdownItem, this.props);
var ariaOptions = {
role: 'option',
'aria-disabled': disabled,
'aria-checked': active,
'aria-selected': selected
};
if (!(0, _isNil3.default)(children)) {
return _react2.default.createElement(
ElementType,
_extends({}, rest, ariaOptions, { className: classes, onClick: this.handleClick }),
children
);
}
var flagElement = _Flag2.default.create(flag);
var iconElement = _Icon2.default.create(iconName);
var imageElement = _Image2.default.create(image);
var labelElement = _Label2.default.create(label);
var descriptionElement = (0, _lib.createShorthand)('span', function (val) {
return { className: 'description', children: val };
}, description);
if (descriptionElement) {
return _react2.default.createElement(
ElementType,
_extends({}, rest, ariaOptions, { className: classes, onClick: this.handleClick }),
imageElement,
iconElement,
flagElement,
labelElement,
descriptionElement,
(0, _lib.createShorthand)('span', function (val) {
return { className: 'text', children: val };
}, content || text)
);
}
return _react2.default.createElement(
ElementType,
_extends({}, rest, ariaOptions, { className: classes, onClick: this.handleClick }),
imageElement,
iconElement,
flagElement,
labelElement,
content || text
);
}
}]);
return DropdownItem;
}(_react.Component);
DropdownItem.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Style as the currently chosen item. */
active: _react.PropTypes.bool,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** Shorthand for primary content. */
content: _lib.customPropTypes.contentShorthand,
/** Additional text with less emphasis. */
description: _lib.customPropTypes.itemShorthand,
/** A dropdown item can be disabled. */
disabled: _react.PropTypes.bool,
/** Shorthand for Flag. */
flag: _lib.customPropTypes.itemShorthand,
/** Shorthand for Icon. */
icon: _lib.customPropTypes.itemShorthand,
/** Shorthand for Image. */
image: _lib.customPropTypes.itemShorthand,
/** Shorthand for Label. */
label: _lib.customPropTypes.itemShorthand,
/**
* The item currently selected by keyboard shortcut.
* This is not the active item.
*/
selected: _react.PropTypes.bool,
/** Display text. */
text: _lib.customPropTypes.contentShorthand,
/** Stored value */
value: _react.PropTypes.oneOfType([_react.PropTypes.number, _react.PropTypes.string]),
/**
* Called on click.
*
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All props.
*/
onClick: _react.PropTypes.func
};
DropdownItem._meta = {
name: 'DropdownItem',
parent: 'Dropdown',
type: _lib.META.TYPES.MODULE
};
exports.default = DropdownItem;
/***/ },
/* 896 */
/*!******************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/elements/Flag/index.js ***!
\******************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _Flag = __webpack_require__(/*! ./Flag */ 897);
var _Flag2 = _interopRequireDefault(_Flag);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = _Flag2.default;
/***/ },
/* 897 */
/*!*****************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/elements/Flag/Flag.js ***!
\*****************************************************************/
/***/ 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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var names = ['ad', 'andorra', 'ae', 'united arab emirates', 'uae', 'af', 'afghanistan', 'ag', 'antigua', 'ai', 'anguilla', 'al', 'albania', 'am', 'armenia', 'an', 'netherlands antilles', 'ao', 'angola', 'ar', 'argentina', 'as', 'american samoa', 'at', 'austria', 'au', 'australia', 'aw', 'aruba', 'ax', 'aland islands', 'az', 'azerbaijan', 'ba', 'bosnia', 'bb', 'barbados', 'bd', 'bangladesh', 'be', 'belgium', 'bf', 'burkina faso', 'bg', 'bulgaria', 'bh', 'bahrain', 'bi', 'burundi', 'bj', 'benin', 'bm', 'bermuda', 'bn', 'brunei', 'bo', 'bolivia', 'br', 'brazil', 'bs', 'bahamas', 'bt', 'bhutan', 'bv', 'bouvet island', 'bw', 'botswana', 'by', 'belarus', 'bz', 'belize', 'ca', 'canada', 'cc', 'cocos islands', 'cd', 'congo', 'cf', 'central african republic', 'cg', 'congo brazzaville', 'ch', 'switzerland', 'ci', 'cote divoire', 'ck', 'cook islands', 'cl', 'chile', 'cm', 'cameroon', 'cn', 'china', 'co', 'colombia', 'cr', 'costa rica', 'cs', 'cu', 'cuba', 'cv', 'cape verde', 'cx', 'christmas island', 'cy', 'cyprus', 'cz', 'czech republic', 'de', 'germany', 'dj', 'djibouti', 'dk', 'denmark', 'dm', 'dominica', 'do', 'dominican republic', 'dz', 'algeria', 'ec', 'ecuador', 'ee', 'estonia', 'eg', 'egypt', 'eh', 'western sahara', 'er', 'eritrea', 'es', 'spain', 'et', 'ethiopia', 'eu', 'european union', 'fi', 'finland', 'fj', 'fiji', 'fk', 'falkland islands', 'fm', 'micronesia', 'fo', 'faroe islands', 'fr', 'france', 'ga', 'gabon', 'gb', 'united kingdom', 'gd', 'grenada', 'ge', 'georgia', 'gf', 'french guiana', 'gh', 'ghana', 'gi', 'gibraltar', 'gl', 'greenland', 'gm', 'gambia', 'gn', 'guinea', 'gp', 'guadeloupe', 'gq', 'equatorial guinea', 'gr', 'greece', 'gs', 'sandwich islands', 'gt', 'guatemala', 'gu', 'guam', 'gw', 'guinea-bissau', 'gy', 'guyana', 'hk', 'hong kong', 'hm', 'heard island', 'hn', 'honduras', 'hr', 'croatia', 'ht', 'haiti', 'hu', 'hungary', 'id', 'indonesia', 'ie', 'ireland', 'il', 'israel', 'in', 'india', 'io', 'indian ocean territory', 'iq', 'iraq', 'ir', 'iran', 'is', 'iceland', 'it', 'italy', 'jm', 'jamaica', 'jo', 'jordan', 'jp', 'japan', 'ke', 'kenya', 'kg', 'kyrgyzstan', 'kh', 'cambodia', 'ki', 'kiribati', 'km', 'comoros', 'kn', 'saint kitts and nevis', 'kp', 'north korea', 'kr', 'south korea', 'kw', 'kuwait', 'ky', 'cayman islands', 'kz', 'kazakhstan', 'la', 'laos', 'lb', 'lebanon', 'lc', 'saint lucia', 'li', 'liechtenstein', 'lk', 'sri lanka', 'lr', 'liberia', 'ls', 'lesotho', 'lt', 'lithuania', 'lu', 'luxembourg', 'lv', 'latvia', 'ly', 'libya', 'ma', 'morocco', 'mc', 'monaco', 'md', 'moldova', 'me', 'montenegro', 'mg', 'madagascar', 'mh', 'marshall islands', 'mk', 'macedonia', 'ml', 'mali', 'mm', 'myanmar', 'burma', 'mn', 'mongolia', 'mo', 'macau', 'mp', 'northern mariana islands', 'mq', 'martinique', 'mr', 'mauritania', 'ms', 'montserrat', 'mt', 'malta', 'mu', 'mauritius', 'mv', 'maldives', 'mw', 'malawi', 'mx', 'mexico', 'my', 'malaysia', 'mz', 'mozambique', 'na', 'namibia', 'nc', 'new caledonia', 'ne', 'niger', 'nf', 'norfolk island', 'ng', 'nigeria', 'ni', 'nicaragua', 'nl', 'netherlands', 'no', 'norway', 'np', 'nepal', 'nr', 'nauru', 'nu', 'niue', 'nz', 'new zealand', 'om', 'oman', 'pa', 'panama', 'pe', 'peru', 'pf', 'french polynesia', 'pg', 'new guinea', 'ph', 'philippines', 'pk', 'pakistan', 'pl', 'poland', 'pm', 'saint pierre', 'pn', 'pitcairn islands', 'pr', 'puerto rico', 'ps', 'palestine', 'pt', 'portugal', 'pw', 'palau', 'py', 'paraguay', 'qa', 'qatar', 're', 'reunion', 'ro', 'romania', 'rs', 'serbia', 'ru', 'russia', 'rw', 'rwanda', 'sa', 'saudi arabia', 'sb', 'solomon islands', 'sc', 'seychelles', 'gb sct', 'scotland', 'sd', 'sudan', 'se', 'sweden', 'sg', 'singapore', 'sh', 'saint helena', 'si', 'slovenia', 'sj', 'svalbard', 'jan mayen', 'sk', 'slovakia', 'sl', 'sierra leone', 'sm', 'san marino', 'sn', 'senegal', 'so', 'somalia', 'sr', 'suriname', 'st', 'sao tome', 'sv', 'el salvador', 'sy', 'syria', 'sz', 'swaziland', 'tc', 'caicos islands', 'td', 'chad', 'tf', 'french territories', 'tg', 'togo', 'th', 'thailand', 'tj', 'tajikistan', 'tk', 'tokelau', 'tl', 'timorleste', 'tm', 'turkmenistan', 'tn', 'tunisia', 'to', 'tonga', 'tr', 'turkey', 'tt', 'trinidad', 'tv', 'tuvalu', 'tw', 'taiwan', 'tz', 'tanzania', 'ua', 'ukraine', 'ug', 'uganda', 'um', 'us minor islands', 'us', 'america', 'united states', 'uy', 'uruguay', 'uz', 'uzbekistan', 'va', 'vatican city', 'vc', 'saint vincent', 've', 'venezuela', 'vg', 'british virgin islands', 'vi', 'us virgin islands', 'vn', 'vietnam', 'vu', 'vanuatu', 'gb wls', 'wales', 'wf', 'wallis and futuna', 'ws', 'samoa', 'ye', 'yemen', 'yt', 'mayotte', 'za', 'south africa', 'zm', 'zambia', 'zw', 'zimbabwe'];
function Flag(props) {
var className = props.className,
name = props.name;
var classes = (0, _classnames2.default)(name, className, 'flag');
var rest = (0, _lib.getUnhandledProps)(Flag, props);
var ElementType = (0, _lib.getElementType)(Flag, props);
return _react2.default.createElement(ElementType, _extends({}, rest, { className: classes }));
}
Flag._meta = {
name: 'Flag',
type: _lib.META.TYPES.ELEMENT,
props: {
name: names
}
};
Flag.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Additional classes. */
className: _react.PropTypes.string,
/** Flag name, can use the two digit country code, the full name, or a common alias */
name: _lib.customPropTypes.suggest(Flag._meta.props.name)
};
Flag.defaultProps = {
as: 'i'
};
Flag.create = (0, _lib.createShorthandFactory)(Flag, function (value) {
return { name: value };
});
exports.default = Flag;
/***/ },
/* 898 */
/*!*******************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/elements/Image/index.js ***!
\*******************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _Image = __webpack_require__(/*! ./Image */ 849);
var _Image2 = _interopRequireDefault(_Image);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = _Image2.default;
/***/ },
/* 899 */
/*!******************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/modules/Dropdown/DropdownHeader.js ***!
\******************************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _Icon = __webpack_require__(/*! ../../elements/Icon */ 874);
var _Icon2 = _interopRequireDefault(_Icon);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function DropdownHeader(props) {
var children = props.children,
className = props.className,
content = props.content,
icon = props.icon;
var classes = (0, _classnames2.default)('header', className);
var rest = (0, _lib.getUnhandledProps)(DropdownHeader, props);
var ElementType = (0, _lib.getElementType)(DropdownHeader, props);
if (!(0, _isNil3.default)(children)) {
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
_Icon2.default.create(icon),
content
);
}
DropdownHeader._meta = {
name: 'DropdownHeader',
parent: 'Dropdown',
type: _lib.META.TYPES.MODULE
};
DropdownHeader.propTypes = {
/** An element type to render as (string or function) */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** Shorthand for primary content. */
content: _lib.customPropTypes.contentShorthand,
/** Shorthand for Icon. */
icon: _lib.customPropTypes.itemShorthand
};
exports.default = DropdownHeader;
/***/ },
/* 900 */
/*!****************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/modules/Dropdown/DropdownMenu.js ***!
\****************************************************************************/
/***/ 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__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function DropdownMenu(props) {
var children = props.children,
className = props.className,
scrolling = props.scrolling;
var classes = (0, _classnames2.default)((0, _lib.useKeyOnly)(scrolling, 'scrolling'), 'menu transition', className);
var rest = (0, _lib.getUnhandledProps)(DropdownMenu, props);
var ElementType = (0, _lib.getElementType)(DropdownMenu, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
DropdownMenu._meta = {
name: 'DropdownMenu',
parent: 'Dropdown',
type: _lib.META.TYPES.MODULE
};
DropdownMenu.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** A dropdown menu can scroll. */
scrolling: _react.PropTypes.bool
};
exports.default = DropdownMenu;
/***/ },
/* 901 */
/*!********************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/addons/TextArea/index.js ***!
\********************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _TextArea = __webpack_require__(/*! ./TextArea */ 902);
var _TextArea2 = _interopRequireDefault(_TextArea);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = _TextArea2.default;
/***/ },
/* 902 */
/*!***********************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/addons/TextArea/TextArea.js ***!
\***********************************************************************/
/***/ 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__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
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; }
/**
* A TextArea can be used to allow for extended user input.
* @see Form
*/
var TextArea = function (_Component) {
_inherits(TextArea, _Component);
function TextArea() {
var _ref;
var _temp, _this, _ret;
_classCallCheck(this, TextArea);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = TextArea.__proto__ || Object.getPrototypeOf(TextArea)).call.apply(_ref, [this].concat(args))), _this), _this.handleChange = function (e) {
var onChange = _this.props.onChange;
if (onChange) onChange(e, _extends({}, _this.props, { value: e.target && e.target.value }));
_this.updateHeight(e.target);
}, _this.removeAutoHeightStyles = function () {
_this.rootNode.removeAttribute('rows');
_this.rootNode.style.height = null;
_this.rootNode.style.minHeight = null;
_this.rootNode.style.resize = null;
}, _this.updateHeight = function () {
if (!_this.rootNode) return;
var autoHeight = _this.props.autoHeight;
if (!autoHeight) return;
var _window$getComputedSt = window.getComputedStyle(_this.rootNode),
borderTopWidth = _window$getComputedSt.borderTopWidth,
borderBottomWidth = _window$getComputedSt.borderBottomWidth;
borderTopWidth = parseInt(borderTopWidth, 10);
borderBottomWidth = parseInt(borderBottomWidth, 10);
_this.rootNode.rows = '1';
_this.rootNode.style.minHeight = '0';
_this.rootNode.style.resize = 'none';
_this.rootNode.style.height = 'auto';
_this.rootNode.style.height = _this.rootNode.scrollHeight + borderTopWidth + borderBottomWidth + 'px';
}, _temp), _possibleConstructorReturn(_this, _ret);
}
_createClass(TextArea, [{
key: 'componentDidMount',
value: function componentDidMount() {
this.updateHeight();
}
}, {
key: 'componentDidUpdate',
value: function componentDidUpdate(prevProps, prevState) {
// removed autoHeight
if (!this.props.autoHeight && prevProps.autoHeight) {
this.removeAutoHeightStyles();
}
// added autoHeight or value changed
if (this.props.autoHeight && !prevProps.autoHeight || prevProps.value !== this.props.value) {
this.updateHeight();
}
}
}, {
key: 'render',
value: function render() {
var _this2 = this;
var value = this.props.value;
var rest = (0, _lib.getUnhandledProps)(TextArea, this.props);
var ElementType = (0, _lib.getElementType)(TextArea, this.props);
return _react2.default.createElement(ElementType, _extends({}, rest, {
value: value,
onChange: this.handleChange,
ref: function ref(c) {
return _this2.rootNode = c;
}
}));
}
}]);
return TextArea;
}(_react.Component);
TextArea._meta = {
name: 'TextArea',
type: _lib.META.TYPES.ADDON
};
TextArea.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Indicates whether height of the textarea fits the content or not */
autoHeight: _react.PropTypes.bool,
/**
* Called on change.
* @param {SyntheticEvent} event - The React SyntheticEvent object
* @param {object} data - All props and the event value.
*/
onChange: _react.PropTypes.func,
/** The value of the textarea. */
value: _react.PropTypes.string
};
TextArea.defaultProps = {
as: 'textarea'
};
exports.default = TextArea;
/***/ },
/* 903 */
/*!***************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/collections/Breadcrumb/index.js ***!
\***************************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _Breadcrumb = __webpack_require__(/*! ./Breadcrumb */ 904);
var _Breadcrumb2 = _interopRequireDefault(_Breadcrumb);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = _Breadcrumb2.default;
/***/ },
/* 904 */
/*!********************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/collections/Breadcrumb/Breadcrumb.js ***!
\********************************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _without2 = __webpack_require__(/*! lodash/without */ 846);
var _without3 = _interopRequireDefault(_without2);
var _map2 = __webpack_require__(/*! lodash/map */ 825);
var _map3 = _interopRequireDefault(_map2);
var _each2 = __webpack_require__(/*! lodash/each */ 689);
var _each3 = _interopRequireDefault(_each2);
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _BreadcrumbDivider = __webpack_require__(/*! ./BreadcrumbDivider */ 905);
var _BreadcrumbDivider2 = _interopRequireDefault(_BreadcrumbDivider);
var _BreadcrumbSection = __webpack_require__(/*! ./BreadcrumbSection */ 906);
var _BreadcrumbSection2 = _interopRequireDefault(_BreadcrumbSection);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* A breadcrumb is used to show hierarchy between content.
*/
function Breadcrumb(props) {
var children = props.children,
className = props.className,
divider = props.divider,
icon = props.icon,
size = props.size,
sections = props.sections;
var classes = (0, _classnames2.default)('ui', className, size, 'breadcrumb');
var rest = (0, _lib.getUnhandledProps)(Breadcrumb, props);
var ElementType = (0, _lib.getElementType)(Breadcrumb, props);
if (!(0, _isNil3.default)(children)) {
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
var childElements = [];
(0, _each3.default)(sections, function (section, index) {
// section
var breadcrumbSection = _BreadcrumbSection2.default.create(section);
childElements.push(breadcrumbSection);
// divider
if (index !== sections.length - 1) {
// TODO generate a key from breadcrumbSection.props once this is merged:
// https://github.com/Semantic-Org/Semantic-UI-React/pull/645
//
// Stringify the props of the section as the divider key.
//
// Section: { content: 'Home', link: true, onClick: handleClick }
// Divider key: content=Home|link=true|onClick=handleClick
var key = void 0;
if (section.key) {
key = section.key + '_divider';
} else {
key = (0, _map3.default)(breadcrumbSection.props, function (v, k) {
return k + '=' + (typeof v === 'function' ? v.name || 'func' : v);
}).join('|');
}
childElements.push(_BreadcrumbDivider2.default.create({ content: divider, icon: icon, key: key }));
}
});
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
childElements
);
}
Breadcrumb._meta = {
name: 'Breadcrumb',
type: _lib.META.TYPES.COLLECTION,
props: {
size: (0, _without3.default)(_lib.SUI.SIZES, 'medium')
}
};
Breadcrumb.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** Shorthand for primary content of the Breadcrumb.Divider. */
divider: _lib.customPropTypes.every([_lib.customPropTypes.disallow(['icon']), _lib.customPropTypes.contentShorthand]),
/** For use with the sections prop. Render as an `Icon` component with `divider` class instead of a `div` in
* Breadcrumb.Divider. */
icon: _lib.customPropTypes.every([_lib.customPropTypes.disallow(['divider']), _lib.customPropTypes.itemShorthand]),
/** Shorthand array of props for Breadcrumb.Section. */
sections: _lib.customPropTypes.collectionShorthand,
/** Size of Breadcrumb */
size: _react.PropTypes.oneOf(Breadcrumb._meta.props.size)
};
Breadcrumb.Divider = _BreadcrumbDivider2.default;
Breadcrumb.Section = _BreadcrumbSection2.default;
exports.default = Breadcrumb;
/***/ },
/* 905 */
/*!***************************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/collections/Breadcrumb/BreadcrumbDivider.js ***!
\***************************************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _Icon = __webpack_require__(/*! ../../elements/Icon */ 874);
var _Icon2 = _interopRequireDefault(_Icon);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* A divider sub-component for Breadcrumb component.
*/
function BreadcrumbDivider(props) {
var children = props.children,
content = props.content,
icon = props.icon,
className = props.className;
var classes = (0, _classnames2.default)(className, 'divider');
var rest = (0, _lib.getUnhandledProps)(BreadcrumbDivider, props);
var ElementType = (0, _lib.getElementType)(BreadcrumbDivider, props);
var iconElement = _Icon2.default.create(icon, _extends({}, rest, { className: classes }));
if (iconElement) return iconElement;
var breadcrumbContent = void 0;
if ((0, _isNil3.default)(content)) {
breadcrumbContent = (0, _isNil3.default)(children) ? '/' : children;
} else {
breadcrumbContent = content;
}
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
breadcrumbContent
);
}
BreadcrumbDivider._meta = {
name: 'BreadcrumbDivider',
type: _lib.META.TYPES.COLLECTION,
parent: 'Breadcrumb'
};
BreadcrumbDivider.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** Shorthand for primary content. */
content: _lib.customPropTypes.contentShorthand,
/** Render as an `Icon` component with `divider` class instead of a `div`. */
icon: _lib.customPropTypes.itemShorthand
};
BreadcrumbDivider.create = (0, _lib.createShorthandFactory)(BreadcrumbDivider, function (icon) {
return { icon: icon };
});
exports.default = BreadcrumbDivider;
/***/ },
/* 906 */
/*!***************************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/collections/Breadcrumb/BreadcrumbSection.js ***!
\***************************************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
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; }
/**
* A section sub-component for Breadcrumb component
*/
var BreadcrumbSection = function (_Component) {
_inherits(BreadcrumbSection, _Component);
function BreadcrumbSection() {
var _ref;
var _temp, _this, _ret;
_classCallCheck(this, BreadcrumbSection);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = BreadcrumbSection.__proto__ || Object.getPrototypeOf(BreadcrumbSection)).call.apply(_ref, [this].concat(args))), _this), _this.handleClick = function (e) {
var onClick = _this.props.onClick;
if (onClick) onClick(e, _this.props);
}, _temp), _possibleConstructorReturn(_this, _ret);
}
_createClass(BreadcrumbSection, [{
key: 'render',
value: function render() {
var _props = this.props,
active = _props.active,
children = _props.children,
className = _props.className,
content = _props.content,
href = _props.href,
link = _props.link,
onClick = _props.onClick;
var classes = (0, _classnames2.default)((0, _lib.useKeyOnly)(active, 'active'), 'section', className);
var rest = (0, _lib.getUnhandledProps)(BreadcrumbSection, this.props);
var ElementType = (0, _lib.getElementType)(BreadcrumbSection, this.props, function () {
if (link || onClick) return 'a';
});
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes, href: href, onClick: this.handleClick }),
(0, _isNil3.default)(children) ? content : children
);
}
}]);
return BreadcrumbSection;
}(_react.Component);
BreadcrumbSection.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Style as the currently active section. */
active: _react.PropTypes.bool,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** Shorthand for primary content. */
content: _lib.customPropTypes.contentShorthand,
/** Render as an `a` tag instead of a `div`. */
link: _lib.customPropTypes.every([_lib.customPropTypes.disallow(['href']), _react.PropTypes.bool]),
/** Render as an `a` tag instead of a `div` and adds the href attribute. */
href: _lib.customPropTypes.every([_lib.customPropTypes.disallow(['link']), _react.PropTypes.string]),
/**
* Called on click. When passed, the component will render as an `a`
* tag by default instead of a `div`.
*
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All props.
*/
onClick: _react.PropTypes.func
};
BreadcrumbSection._meta = {
name: 'BreadcrumbSection',
type: _lib.META.TYPES.COLLECTION,
parent: 'Breadcrumb'
};
exports.default = BreadcrumbSection;
BreadcrumbSection.create = (0, _lib.createShorthandFactory)(BreadcrumbSection, function (content) {
return { content: content, link: true };
}, true);
/***/ },
/* 907 */
/*!*********************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/collections/Form/index.js ***!
\*********************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _Form = __webpack_require__(/*! ./Form */ 908);
var _Form2 = _interopRequireDefault(_Form);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = _Form2.default;
/***/ },
/* 908 */
/*!********************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/collections/Form/Form.js ***!
\********************************************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _without2 = __webpack_require__(/*! lodash/without */ 846);
var _without3 = _interopRequireDefault(_without2);
var _map2 = __webpack_require__(/*! lodash/map */ 825);
var _map3 = _interopRequireDefault(_map2);
var _find2 = __webpack_require__(/*! lodash/find */ 716);
var _find3 = _interopRequireDefault(_find2);
var _filter2 = __webpack_require__(/*! lodash/filter */ 627);
var _filter3 = _interopRequireDefault(_filter2);
var _each2 = __webpack_require__(/*! lodash/each */ 689);
var _each3 = _interopRequireDefault(_each2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _FormButton = __webpack_require__(/*! ./FormButton */ 909);
var _FormButton2 = _interopRequireDefault(_FormButton);
var _FormCheckbox = __webpack_require__(/*! ./FormCheckbox */ 911);
var _FormCheckbox2 = _interopRequireDefault(_FormCheckbox);
var _FormDropdown = __webpack_require__(/*! ./FormDropdown */ 912);
var _FormDropdown2 = _interopRequireDefault(_FormDropdown);
var _FormField = __webpack_require__(/*! ./FormField */ 910);
var _FormField2 = _interopRequireDefault(_FormField);
var _FormGroup = __webpack_require__(/*! ./FormGroup */ 913);
var _FormGroup2 = _interopRequireDefault(_FormGroup);
var _FormInput = __webpack_require__(/*! ./FormInput */ 914);
var _FormInput2 = _interopRequireDefault(_FormInput);
var _FormRadio = __webpack_require__(/*! ./FormRadio */ 917);
var _FormRadio2 = _interopRequireDefault(_FormRadio);
var _FormSelect = __webpack_require__(/*! ./FormSelect */ 918);
var _FormSelect2 = _interopRequireDefault(_FormSelect);
var _FormTextArea = __webpack_require__(/*! ./FormTextArea */ 919);
var _FormTextArea2 = _interopRequireDefault(_FormTextArea);
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; }
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; }
var debug = (0, _lib.makeDebugger)('form');
var getNodeName = function getNodeName(_ref) {
var name = _ref.name;
return name;
};
var debugSerializedResult = function debugSerializedResult() {
return undefined;
};
if (process.NODE_ENV !== 'production') {
// debug serialized values
debugSerializedResult = function debugSerializedResult(json, name, node) {
debug('serialized ' + JSON.stringify(_defineProperty({}, name, json[name])) + ' from:', node);
};
// warn about form nodes missing a "name"
getNodeName = function getNodeName(node) {
var name = node.name;
if (!name) {
var errorMessage = ['Encountered a form control node without a name attribute.', 'Each node in a group should have a name.', 'Otherwise, the node will serialize as { "undefined": <value> }.'].join(' ');
console.error(errorMessage, node); // eslint-disable-line no-console
}
return name;
};
}
function formSerializer(formNode) {
debug('formSerializer()');
var json = {};
// handle empty formNode ref
if (!formNode) return json;
// ----------------------------------------
// Checkboxes
// Single: { name: value|bool }
// Group: { name: [value|bool, ...] }
(0, _each3.default)(formNode.querySelectorAll('input[type="checkbox"]'), function (node, index, arr) {
var name = getNodeName(node);
var checkboxesByName = (0, _filter3.default)(arr, { name: name });
// single: (value|checked)
if (checkboxesByName.length === 1) {
json[name] = node.checked && node.value !== 'on' ? node.value : node.checked;
debugSerializedResult(json, name, node);
return;
}
// groups (checked): [value, ...]
if (!Array.isArray(json[name])) json[name] = [];
if (node.checked) json[name].push(node.value);
debugSerializedResult(json, name, node);
// in dev, warn about multiple checkboxes with a default browser value of "on"
if (process.NODE_ENV !== 'production' && node.value === 'on') {
var errorMessage = ["Encountered a checkbox in a group with the default browser value 'on'.", 'Each checkbox in a group should have a unique value.', "Otherwise, the checkbox value will serialize as ['on', ...]."].join(' ');
console.error(errorMessage, node, formNode); // eslint-disable-line no-console
}
});
// ----------------------------------------
// Radios
// checked: { name: checked value }
// none: { name: null }
(0, _each3.default)(formNode.querySelectorAll('input[type="radio"]'), function (node, index, arr) {
var name = getNodeName(node);
var checkedRadio = (0, _find3.default)(arr, { name: name, checked: true });
if (checkedRadio) {
json[name] = checkedRadio.value;
} else {
json[name] = null;
}
debugSerializedResult(json, name, node);
// in dev, warn about radios with a default browser value of "on"
if (process.NODE_ENV !== 'production' && node.value === 'on') {
var errorMessage = ["Encountered a radio with the default browser value 'on'.", 'Each radio should have a unique value.', "Otherwise, the radio value will serialize as { [name]: 'on' }."].join(' ');
console.error(errorMessage, node, formNode); // eslint-disable-line no-console
}
});
// ----------------------------------------
// Other inputs
// { name: value }
(0, _each3.default)(formNode.querySelectorAll('input:not([type="radio"]):not([type="checkbox"])'), function (node) {
var name = getNodeName(node);
json[name] = node.value;
debugSerializedResult(json, name, node);
});
// ----------------------------------------
// Other inputs and text areas
// { name: value }
(0, _each3.default)(formNode.querySelectorAll('textarea'), function (node) {
var name = getNodeName(node);
json[name] = node.value;
debugSerializedResult(json, name, node);
});
// ----------------------------------------
// Selects
// single: { name: value }
// multiple: { name: [value, ...] }
(0, _each3.default)(formNode.querySelectorAll('select'), function (node) {
var name = getNodeName(node);
if (node.multiple) {
json[name] = (0, _map3.default)((0, _filter3.default)(node.querySelectorAll('option'), 'selected'), 'value');
} else {
json[name] = node.value;
}
debugSerializedResult(json, name, node);
});
return json;
}
var _meta = {
name: 'Form',
type: _lib.META.TYPES.COLLECTION,
props: {
widths: ['equal'],
size: (0, _without3.default)(_lib.SUI.SIZES, 'medium')
}
};
/**
* A Form displays a set of related user input fields in a structured way.
* @see Button
* @see Checkbox
* @see Dropdown
* @see Input
* @see Message
* @see Radio
* @see Select
* @see TextArea
*/
var Form = function (_Component) {
_inherits(Form, _Component);
function Form() {
var _ref2;
var _temp, _this, _ret;
_classCallCheck(this, Form);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref2 = Form.__proto__ || Object.getPrototypeOf(Form)).call.apply(_ref2, [this].concat(args))), _this), _this._form = null, _this.handleRef = function (c) {
return _this._form = _this._form || c;
}, _this.handleSubmit = function (e) {
var _this$props = _this.props,
onSubmit = _this$props.onSubmit,
serializer = _this$props.serializer;
if (onSubmit) onSubmit(e, _extends({}, _this.props, { formData: serializer(_this._form) }));
}, _temp), _possibleConstructorReturn(_this, _ret);
}
_createClass(Form, [{
key: 'render',
value: function render() {
var _props = this.props,
children = _props.children,
className = _props.className,
error = _props.error,
loading = _props.loading,
reply = _props.reply,
size = _props.size,
success = _props.success,
warning = _props.warning,
widths = _props.widths;
var classes = (0, _classnames2.default)('ui', size, (0, _lib.useKeyOnly)(error, 'error'), (0, _lib.useKeyOnly)(loading, 'loading'), (0, _lib.useKeyOnly)(reply, 'reply'), (0, _lib.useKeyOnly)(success, 'success'), (0, _lib.useKeyOnly)(warning, 'warning'), (0, _lib.useWidthProp)(widths, null, true), 'form', className);
var rest = (0, _lib.getUnhandledProps)(Form, this.props);
var ElementType = (0, _lib.getElementType)(Form, this.props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes, ref: this.handleRef, onSubmit: this.handleSubmit }),
children
);
}
}]);
return Form;
}(_react.Component);
Form.defaultProps = {
as: 'form',
serializer: formSerializer
};
Form.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** Automatically show any error Message children */
error: _react.PropTypes.bool,
/** Automatically show a loading indicator */
loading: _react.PropTypes.bool,
/**
* Called on submit
*
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All props and the form's serialized values.
*/
onSubmit: _react.PropTypes.func,
/** A comment can contain a form to reply to a comment. This may have arbitrary content. */
reply: _react.PropTypes.bool,
/** Called onSubmit with the form node that returns the serialized form object */
serializer: _react.PropTypes.func,
/** A form can vary in size */
size: _react.PropTypes.oneOf(_meta.props.size),
/** Automatically show any success Message children */
success: _react.PropTypes.bool,
/** Automatically show any warning Message children */
warning: _react.PropTypes.bool,
/** Forms can automatically divide fields to be equal width */
widths: _react.PropTypes.oneOf(_meta.props.widths)
};
Form._meta = _meta;
Form.Field = _FormField2.default;
Form.Button = _FormButton2.default;
Form.Checkbox = _FormCheckbox2.default;
Form.Dropdown = _FormDropdown2.default;
Form.Group = _FormGroup2.default;
Form.Input = _FormInput2.default;
Form.Radio = _FormRadio2.default;
Form.Select = _FormSelect2.default;
Form.TextArea = _FormTextArea2.default;
exports.default = Form;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../../../../process/browser.js */ 4)))
/***/ },
/* 909 */
/*!**************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/collections/Form/FormButton.js ***!
\**************************************************************************/
/***/ 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__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _Button = __webpack_require__(/*! ../../elements/Button */ 843);
var _Button2 = _interopRequireDefault(_Button);
var _FormField = __webpack_require__(/*! ./FormField */ 910);
var _FormField2 = _interopRequireDefault(_FormField);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Sugar for <Form.Field control={Button} />
* @see Button
* @see Form
*/
function FormButton(props) {
var control = props.control;
var rest = (0, _lib.getUnhandledProps)(FormButton, props);
var ElementType = (0, _lib.getElementType)(FormButton, props);
return _react2.default.createElement(ElementType, _extends({}, rest, { control: control }));
}
FormButton._meta = {
name: 'FormButton',
parent: 'Form',
type: _lib.META.TYPES.COLLECTION
};
FormButton.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** A FormField control prop */
control: _FormField2.default.propTypes.control
};
FormButton.defaultProps = {
as: _FormField2.default,
control: _Button2.default
};
exports.default = FormButton;
/***/ },
/* 910 */
/*!*************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/collections/Form/FormField.js ***!
\*************************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _Checkbox = __webpack_require__(/*! ../../modules/Checkbox */ 877);
var _Checkbox2 = _interopRequireDefault(_Checkbox);
var _Radio = __webpack_require__(/*! ../../addons/Radio */ 875);
var _Radio2 = _interopRequireDefault(_Radio);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* A field is a form element containing a label and an input
* @see Form
* @see Button
* @see Checkbox
* @see Dropdown
* @see Input
* @see Radio
* @see Select
* @see TextArea
*/
function FormField(props) {
var children = props.children,
className = props.className,
control = props.control,
disabled = props.disabled,
error = props.error,
inline = props.inline,
label = props.label,
required = props.required,
type = props.type,
width = props.width;
var classes = (0, _classnames2.default)((0, _lib.useKeyOnly)(disabled, 'disabled'), (0, _lib.useKeyOnly)(error, 'error'), (0, _lib.useKeyOnly)(inline, 'inline'), (0, _lib.useKeyOnly)(required, 'required'), (0, _lib.useWidthProp)(width, 'wide'), 'field', className);
var rest = (0, _lib.getUnhandledProps)(FormField, props);
var ElementType = (0, _lib.getElementType)(FormField, props);
// ----------------------------------------
// No Control
// ----------------------------------------
if ((0, _isNil3.default)(control)) {
if ((0, _isNil3.default)(label)) return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
(0, _lib.createHTMLLabel)(label)
);
}
// ----------------------------------------
// Checkbox/Radio Control
// ----------------------------------------
var controlProps = _extends({}, rest, { children: children, required: required, type: type });
// wrap HTML checkboxes/radios in the label
if (control === 'input' && (type === 'checkbox' || type === 'radio')) {
return _react2.default.createElement(
ElementType,
{ className: classes },
_react2.default.createElement(
'label',
null,
(0, _react.createElement)(control, controlProps),
' ',
label
)
);
}
// pass label prop to controls that support it
if (control === _Checkbox2.default || control === _Radio2.default) {
return _react2.default.createElement(
ElementType,
{ className: classes },
(0, _react.createElement)(control, _extends({}, controlProps, { label: label }))
);
}
// ----------------------------------------
// Other Control
// ----------------------------------------
return _react2.default.createElement(
ElementType,
{ className: classes },
(0, _lib.createHTMLLabel)(label),
(0, _react.createElement)(control, controlProps)
);
}
FormField._meta = {
name: 'FormField',
parent: 'Form',
type: _lib.META.TYPES.COLLECTION,
props: {
width: _lib.SUI.WIDTHS,
control: ['button', 'input', 'select', 'textarea']
}
};
FormField.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/**
* A form control component (i.e. Dropdown) or HTML tagName (i.e. 'input').
* Extra FormField props are passed to the control component.
* Mutually exclusive with children.
*/
control: _lib.customPropTypes.some([_react.PropTypes.func, _react.PropTypes.oneOf(FormField._meta.props.control)]),
/** Individual fields may be disabled */
disabled: _react.PropTypes.bool,
/** Individual fields may display an error state */
error: _react.PropTypes.bool,
/** A field can have its label next to instead of above it */
inline: _react.PropTypes.bool,
// Heads Up!
// Do not disallow children with `label` shorthand
// The `control` might accept a `label` prop and `children`
/** Mutually exclusive with children. */
label: _react.PropTypes.oneOfType([_react.PropTypes.node, _react.PropTypes.object]),
/** A field can show that input is mandatory. Requires a label. */
required: _lib.customPropTypes.every([_lib.customPropTypes.demand(['label']), _react.PropTypes.bool]),
/** Passed to the control component (i.e. <input type='password' />) */
type: _lib.customPropTypes.every([_lib.customPropTypes.demand(['control'])]),
/** A field can specify its width in grid columns */
width: _react.PropTypes.oneOf(FormField._meta.props.width)
};
exports.default = FormField;
/***/ },
/* 911 */
/*!****************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/collections/Form/FormCheckbox.js ***!
\****************************************************************************/
/***/ 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__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _Checkbox = __webpack_require__(/*! ../../modules/Checkbox */ 877);
var _Checkbox2 = _interopRequireDefault(_Checkbox);
var _FormField = __webpack_require__(/*! ./FormField */ 910);
var _FormField2 = _interopRequireDefault(_FormField);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Sugar for <Form.Field control={Checkbox} />
* @see Checkbox
* @see Form
*/
function FormCheckbox(props) {
var control = props.control;
var rest = (0, _lib.getUnhandledProps)(FormCheckbox, props);
var ElementType = (0, _lib.getElementType)(FormCheckbox, props);
return _react2.default.createElement(ElementType, _extends({}, rest, { control: control }));
}
FormCheckbox._meta = {
name: 'FormCheckbox',
parent: 'Form',
type: _lib.META.TYPES.COLLECTION
};
FormCheckbox.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** A FormField control prop */
control: _FormField2.default.propTypes.control
};
FormCheckbox.defaultProps = {
as: _FormField2.default,
control: _Checkbox2.default
};
exports.default = FormCheckbox;
/***/ },
/* 912 */
/*!****************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/collections/Form/FormDropdown.js ***!
\****************************************************************************/
/***/ 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__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _Dropdown = __webpack_require__(/*! ../../modules/Dropdown */ 881);
var _Dropdown2 = _interopRequireDefault(_Dropdown);
var _FormField = __webpack_require__(/*! ./FormField */ 910);
var _FormField2 = _interopRequireDefault(_FormField);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Sugar for <Form.Field control={Dropdown} />
* @see Dropdown
* @see Form
*/
function FormDropdown(props) {
var control = props.control;
var rest = (0, _lib.getUnhandledProps)(FormDropdown, props);
var ElementType = (0, _lib.getElementType)(FormDropdown, props);
return _react2.default.createElement(ElementType, _extends({}, rest, { control: control }));
}
FormDropdown._meta = {
name: 'FormDropdown',
parent: 'Form',
type: _lib.META.TYPES.COLLECTION
};
FormDropdown.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** A FormField control prop */
control: _FormField2.default.propTypes.control
};
FormDropdown.defaultProps = {
as: _FormField2.default,
control: _Dropdown2.default
};
exports.default = FormDropdown;
/***/ },
/* 913 */
/*!*************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/collections/Form/FormGroup.js ***!
\*************************************************************************/
/***/ 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__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
/**
* A set of fields can appear grouped together
* @see Form
*/
function FormGroup(props) {
var children = props.children,
className = props.className,
grouped = props.grouped,
inline = props.inline,
widths = props.widths;
var classes = (0, _classnames2.default)((0, _lib.useWidthProp)(widths, null, true), (0, _lib.useKeyOnly)(inline, 'inline'), (0, _lib.useKeyOnly)(grouped, 'grouped'), 'fields', className);
var rest = (0, _lib.getUnhandledProps)(FormGroup, props);
var ElementType = (0, _lib.getElementType)(FormGroup, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
FormGroup._meta = {
name: 'FormGroup',
parent: 'Form',
type: _lib.META.TYPES.COLLECTION,
props: {
widths: [].concat(_toConsumableArray(_lib.SUI.WIDTHS), ['equal'])
}
};
FormGroup.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** Fields can show related choices */
grouped: _lib.customPropTypes.every([_lib.customPropTypes.disallow(['inline']), _react.PropTypes.bool]),
/** Multiple fields may be inline in a row */
inline: _lib.customPropTypes.every([_lib.customPropTypes.disallow(['grouped']), _react.PropTypes.bool]),
/** Fields Groups can specify their width in grid columns or automatically divide fields to be equal width */
widths: _react.PropTypes.oneOf(FormGroup._meta.props.widths)
};
FormGroup.defaultProps = {
as: 'div'
};
exports.default = FormGroup;
/***/ },
/* 914 */
/*!*************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/collections/Form/FormInput.js ***!
\*************************************************************************/
/***/ 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__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _Input = __webpack_require__(/*! ../../elements/Input */ 915);
var _Input2 = _interopRequireDefault(_Input);
var _FormField = __webpack_require__(/*! ./FormField */ 910);
var _FormField2 = _interopRequireDefault(_FormField);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Sugar for <Form.Field control={Input} />
* @see Form
* @see Input
*/
function FormInput(props) {
var control = props.control;
var rest = (0, _lib.getUnhandledProps)(FormInput, props);
var ElementType = (0, _lib.getElementType)(FormInput, props);
return _react2.default.createElement(ElementType, _extends({}, rest, { control: control }));
}
FormInput._meta = {
name: 'FormInput',
parent: 'Form',
type: _lib.META.TYPES.COLLECTION
};
FormInput.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** A FormField control prop */
control: _FormField2.default.propTypes.control
};
FormInput.defaultProps = {
as: _FormField2.default,
control: _Input2.default
};
exports.default = FormInput;
/***/ },
/* 915 */
/*!*******************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/elements/Input/index.js ***!
\*******************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _Input = __webpack_require__(/*! ./Input */ 916);
var _Input2 = _interopRequireDefault(_Input);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = _Input2.default;
/***/ },
/* 916 */
/*!*******************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/elements/Input/Input.js ***!
\*******************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.htmlInputPropNames = undefined;
var _includes2 = __webpack_require__(/*! lodash/includes */ 830);
var _includes3 = _interopRequireDefault(_includes2);
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
var _pick2 = __webpack_require__(/*! lodash/pick */ 798);
var _pick3 = _interopRequireDefault(_pick2);
var _omit2 = __webpack_require__(/*! lodash/omit */ 867);
var _omit3 = _interopRequireDefault(_omit2);
var _get2 = __webpack_require__(/*! lodash/get */ 678);
var _get3 = _interopRequireDefault(_get2);
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__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _Button = __webpack_require__(/*! ../../elements/Button */ 843);
var _Button2 = _interopRequireDefault(_Button);
var _Icon = __webpack_require__(/*! ../../elements/Icon */ 874);
var _Icon2 = _interopRequireDefault(_Icon);
var _Label = __webpack_require__(/*! ../../elements/Label */ 893);
var _Label2 = _interopRequireDefault(_Label);
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 htmlInputPropNames = exports.htmlInputPropNames = [
// REACT
'selected', 'defaultValue', 'defaultChecked',
// LIMITED HTML PROPS
'autoComplete', 'autoFocus', 'checked', 'form', 'max', 'maxLength', 'min', 'name', 'pattern', 'placeholder', 'readOnly', 'required', 'step', 'type', 'value',
// Heads Up!
// Do not pass disabled, it duplicates the SUI CSS opacity rule.
// 'disabled',
// EVENTS
// keyboard
'onKeyDown', 'onKeyPress', 'onKeyUp',
// focus
'onFocus', 'onBlur',
// form
'onChange', 'onInput',
// mouse
'onClick', 'onContextMenu', 'onDrag', 'onDragEnd', 'onDragEnter', 'onDragExit', 'onDragLeave', 'onDragOver', 'onDragStart', 'onDrop', 'onMouseDown', 'onMouseEnter', 'onMouseLeave', 'onMouseMove', 'onMouseOut', 'onMouseOver', 'onMouseUp',
// selection
'onSelect',
// touch
'onTouchCancel', 'onTouchEnd', 'onTouchMove', 'onTouchStart'];
var _meta = {
name: 'Input',
type: _lib.META.TYPES.ELEMENT,
props: {
actionPosition: ['left'],
iconPosition: ['left'],
labelPosition: ['left', 'right', 'left corner', 'right corner'],
size: _lib.SUI.SIZES
}
};
/**
* An Input is a field used to elicit a response from a user
* @see Button
* @see Form
* @see Icon
* @see Label
*/
var Input = function (_Component) {
_inherits(Input, _Component);
function Input() {
var _ref;
var _temp, _this, _ret;
_classCallCheck(this, Input);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Input.__proto__ || Object.getPrototypeOf(Input)).call.apply(_ref, [this].concat(args))), _this), _this.handleChange = function (e) {
var value = (0, _get3.default)(e, 'target.value');
var onChange = _this.props.onChange;
if (onChange) onChange(e, _extends({}, _this.props, { value: value }));
}, _temp), _possibleConstructorReturn(_this, _ret);
}
_createClass(Input, [{
key: 'render',
value: function render() {
var _props = this.props,
action = _props.action,
actionPosition = _props.actionPosition,
children = _props.children,
className = _props.className,
disabled = _props.disabled,
error = _props.error,
focus = _props.focus,
fluid = _props.fluid,
icon = _props.icon,
iconPosition = _props.iconPosition,
inverted = _props.inverted,
label = _props.label,
labelPosition = _props.labelPosition,
loading = _props.loading,
onChange = _props.onChange,
size = _props.size,
tabIndex = _props.tabIndex,
type = _props.type,
input = _props.input,
transparent = _props.transparent;
var classes = (0, _classnames2.default)('ui', size, (0, _lib.useValueAndKey)(actionPosition, 'action') || (0, _lib.useKeyOnly)(action, 'action'), (0, _lib.useKeyOnly)(disabled, 'disabled'), (0, _lib.useKeyOnly)(error, 'error'), (0, _lib.useKeyOnly)(focus, 'focus'), (0, _lib.useKeyOnly)(fluid, 'fluid'), (0, _lib.useKeyOnly)(inverted, 'inverted'), (0, _lib.useValueAndKey)(labelPosition, 'labeled') || (0, _lib.useKeyOnly)(label, 'labeled'), (0, _lib.useKeyOnly)(loading, 'loading'), (0, _lib.useKeyOnly)(transparent, 'transparent'), (0, _lib.useValueAndKey)(iconPosition, 'icon') || (0, _lib.useKeyOnly)(icon, 'icon'), className, 'input');
var unhandled = (0, _lib.getUnhandledProps)(Input, this.props);
var rest = (0, _omit3.default)(unhandled, htmlInputPropNames);
var htmlInputProps = (0, _pick3.default)(this.props, htmlInputPropNames);
if (onChange) htmlInputProps.onChange = this.handleChange;
var ElementType = (0, _lib.getElementType)(Input, this.props);
// tabIndex
if (!(0, _isNil3.default)(tabIndex)) htmlInputProps.tabIndex = tabIndex;else if (disabled) htmlInputProps.tabIndex = -1;
// Render with children
// ----------------------------------------
if (!(0, _isNil3.default)(children)) {
// add htmlInputProps to the `<input />` child
var childElements = _react.Children.map(children, function (child) {
if (child.type !== 'input') return child;
return (0, _react.cloneElement)(child, _extends({}, htmlInputProps, child.props));
});
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
childElements
);
}
// Render Shorthand
// ----------------------------------------
var actionElement = _Button2.default.create(action, function (elProps) {
return {
className: (0, _classnames2.default)(
// all action components should have the button className
!(0, _includes3.default)(elProps.className, 'button') && 'button')
};
});
var iconElement = _Icon2.default.create(icon);
var labelElement = _Label2.default.create(label, function (elProps) {
return {
className: (0, _classnames2.default)(
// all label components should have the label className
!(0, _includes3.default)(elProps.className, 'label') && 'label',
// add 'left|right corner'
(0, _includes3.default)(labelPosition, 'corner') && labelPosition)
};
});
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
actionPosition === 'left' && actionElement,
iconPosition === 'left' && iconElement,
labelPosition !== 'right' && labelElement,
(0, _lib.createHTMLInput)(input || type, htmlInputProps),
actionPosition !== 'left' && actionElement,
iconPosition !== 'left' && iconElement,
labelPosition === 'right' && labelElement
);
}
}]);
return Input;
}(_react.Component);
Input.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** An Input can be formatted to alert the user to an action they may perform */
action: _react.PropTypes.oneOfType([_react.PropTypes.bool, _lib.customPropTypes.itemShorthand]),
/** An action can appear along side an Input on the left or right */
actionPosition: _react.PropTypes.oneOf(_meta.props.actionPosition),
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** An Input field can show that it is disabled */
disabled: _react.PropTypes.bool,
/** An Input field can show the data contains errors */
error: _react.PropTypes.bool,
/** An Input field can show a user is currently interacting with it */
focus: _react.PropTypes.bool,
/** Take on the size of it's container */
fluid: _react.PropTypes.bool,
/** Optional Icon to display inside the Input */
icon: _react.PropTypes.oneOfType([_react.PropTypes.bool, _lib.customPropTypes.itemShorthand]),
/** An Icon can appear inside an Input on the left or right */
iconPosition: _react.PropTypes.oneOf(_meta.props.iconPosition),
/** Format to appear on dark backgrounds */
inverted: _react.PropTypes.bool,
/** Shorthand for creating the HTML Input */
input: _lib.customPropTypes.itemShorthand,
/** Optional Label to display along side the Input */
label: _lib.customPropTypes.itemShorthand,
/** A Label can appear outside an Input on the left or right */
labelPosition: _react.PropTypes.oneOf(_meta.props.labelPosition),
/** An Icon Input field can show that it is currently loading data */
loading: _react.PropTypes.bool,
/**
* Called on change.
*
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All props and proposed value.
*/
onChange: _react.PropTypes.func,
/** An Input can vary in size */
size: _react.PropTypes.oneOf(_meta.props.size),
/** An Input can receive focus. */
tabIndex: _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.number]),
/** Transparent Input has no background */
transparent: _react.PropTypes.bool,
/** The HTML input type */
type: _react.PropTypes.string
};
Input.defaultProps = {
type: 'text'
};
Input._meta = _meta;
exports.default = Input;
/***/ },
/* 917 */
/*!*************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/collections/Form/FormRadio.js ***!
\*************************************************************************/
/***/ 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__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _Radio = __webpack_require__(/*! ../../addons/Radio */ 875);
var _Radio2 = _interopRequireDefault(_Radio);
var _FormField = __webpack_require__(/*! ./FormField */ 910);
var _FormField2 = _interopRequireDefault(_FormField);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Sugar for <Form.Field control={Radio} />
* @see Form
* @see Radio
*/
function FormRadio(props) {
var control = props.control;
var rest = (0, _lib.getUnhandledProps)(FormRadio, props);
var ElementType = (0, _lib.getElementType)(FormRadio, props);
return _react2.default.createElement(ElementType, _extends({}, rest, { control: control }));
}
FormRadio._meta = {
name: 'FormRadio',
parent: 'Form',
type: _lib.META.TYPES.COLLECTION
};
FormRadio.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** A FormField control prop */
control: _FormField2.default.propTypes.control
};
FormRadio.defaultProps = {
as: _FormField2.default,
control: _Radio2.default
};
exports.default = FormRadio;
/***/ },
/* 918 */
/*!**************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/collections/Form/FormSelect.js ***!
\**************************************************************************/
/***/ 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__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _Select = __webpack_require__(/*! ../../addons/Select */ 879);
var _Select2 = _interopRequireDefault(_Select);
var _FormField = __webpack_require__(/*! ./FormField */ 910);
var _FormField2 = _interopRequireDefault(_FormField);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Sugar for <Form.Field control={Select} />
* @see Form
* @see Select
*/
function FormSelect(props) {
var control = props.control;
var rest = (0, _lib.getUnhandledProps)(FormSelect, props);
var ElementType = (0, _lib.getElementType)(FormSelect, props);
return _react2.default.createElement(ElementType, _extends({}, rest, { control: control }));
}
FormSelect._meta = {
name: 'FormSelect',
parent: 'Form',
type: _lib.META.TYPES.COLLECTION
};
FormSelect.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** A FormField control prop */
control: _FormField2.default.propTypes.control
};
FormSelect.defaultProps = {
as: _FormField2.default,
control: _Select2.default
};
exports.default = FormSelect;
/***/ },
/* 919 */
/*!****************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/collections/Form/FormTextArea.js ***!
\****************************************************************************/
/***/ 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__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _TextArea = __webpack_require__(/*! ../../addons/TextArea */ 901);
var _TextArea2 = _interopRequireDefault(_TextArea);
var _FormField = __webpack_require__(/*! ./FormField */ 910);
var _FormField2 = _interopRequireDefault(_FormField);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Sugar for <Form.Field control={TextArea} />
* @see Form
* @see TextArea
*/
function FormTextArea(props) {
var control = props.control;
var rest = (0, _lib.getUnhandledProps)(FormTextArea, props);
var ElementType = (0, _lib.getElementType)(FormTextArea, props);
return _react2.default.createElement(ElementType, _extends({}, rest, { control: control }));
}
FormTextArea._meta = {
name: 'FormTextArea',
parent: 'Form',
type: _lib.META.TYPES.COLLECTION
};
FormTextArea.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** A FormField control prop */
control: _FormField2.default.propTypes.control
};
FormTextArea.defaultProps = {
as: _FormField2.default,
control: _TextArea2.default
};
exports.default = FormTextArea;
/***/ },
/* 920 */
/*!*********************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/collections/Grid/index.js ***!
\*********************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _Grid = __webpack_require__(/*! ./Grid */ 921);
var _Grid2 = _interopRequireDefault(_Grid);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = _Grid2.default;
/***/ },
/* 921 */
/*!********************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/collections/Grid/Grid.js ***!
\********************************************************************/
/***/ 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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _GridColumn = __webpack_require__(/*! ./GridColumn */ 922);
var _GridColumn2 = _interopRequireDefault(_GridColumn);
var _GridRow = __webpack_require__(/*! ./GridRow */ 923);
var _GridRow2 = _interopRequireDefault(_GridRow);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
/**
* A grid is used to harmonize negative space in a layout.
*/
function Grid(props) {
var celled = props.celled,
centered = props.centered,
container = props.container,
children = props.children,
className = props.className,
columns = props.columns,
divided = props.divided,
doubling = props.doubling,
padded = props.padded,
relaxed = props.relaxed,
reversed = props.reversed,
stackable = props.stackable,
stretched = props.stretched,
textAlign = props.textAlign,
verticalAlign = props.verticalAlign;
var classes = (0, _classnames2.default)('ui', (0, _lib.useKeyOnly)(centered, 'centered'), (0, _lib.useKeyOnly)(container, 'container'), (0, _lib.useKeyOnly)(doubling, 'doubling'), (0, _lib.useKeyOnly)(stackable, 'stackable'), (0, _lib.useKeyOnly)(stretched, 'stretched'), (0, _lib.useKeyOrValueAndKey)(celled, 'celled'), (0, _lib.useKeyOrValueAndKey)(divided, 'divided'), (0, _lib.useKeyOrValueAndKey)(padded, 'padded'), (0, _lib.useKeyOrValueAndKey)(relaxed, 'relaxed'), (0, _lib.useTextAlignProp)(textAlign), (0, _lib.useValueAndKey)(reversed, 'reversed'), (0, _lib.useVerticalAlignProp)(verticalAlign), (0, _lib.useWidthProp)(columns, 'column', true), 'grid', className);
var rest = (0, _lib.getUnhandledProps)(Grid, props);
var ElementType = (0, _lib.getElementType)(Grid, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
Grid.Column = _GridColumn2.default;
Grid.Row = _GridRow2.default;
Grid._meta = {
name: 'Grid',
type: _lib.META.TYPES.COLLECTION,
props: {
celled: ['internally'],
columns: [].concat(_toConsumableArray(_lib.SUI.WIDTHS), ['equal']),
divided: ['vertically'],
padded: ['horizontally', 'vertically'],
relaxed: ['very'],
reversed: ['computer', 'computer vertically', 'mobile', 'mobile vertically', 'tablet', 'tablet vertically'],
textAlign: _lib.SUI.TEXT_ALIGNMENTS,
verticalAlign: _lib.SUI.VERTICAL_ALIGNMENTS
}
};
Grid.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** A grid can have rows divided into cells. */
celled: _react.PropTypes.oneOfType([_react.PropTypes.bool, _react.PropTypes.oneOf(Grid._meta.props.celled)]),
/** A grid can have its columns centered. */
centered: _react.PropTypes.bool,
/** A grid can be combined with a container to use avaiable layout and alignment */
container: _react.PropTypes.bool,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** Represents column count per row in Grid. */
columns: _react.PropTypes.oneOf(Grid._meta.props.columns),
/** A grid can have dividers between its columns. */
divided: _react.PropTypes.oneOfType([_react.PropTypes.bool, _react.PropTypes.oneOf(Grid._meta.props.divided)]),
/** A grid can double its column width on tablet and mobile sizes. */
doubling: _react.PropTypes.bool,
/** A grid can preserve its vertical and horizontal gutters on first and last columns. */
padded: _react.PropTypes.oneOfType([_react.PropTypes.bool, _react.PropTypes.oneOf(Grid._meta.props.padded)]),
/** A grid can increase its gutters to allow for more negative space. */
relaxed: _react.PropTypes.oneOfType([_react.PropTypes.bool, _react.PropTypes.oneOf(Grid._meta.props.relaxed)]),
/** A grid can specify that its columns should reverse order at different device sizes. */
reversed: _react.PropTypes.oneOf(Grid._meta.props.reversed),
/** A grid can have its columns stack on-top of each other after reaching mobile breakpoints. */
stackable: _react.PropTypes.bool,
/** An can stretch its contents to take up the entire grid height. */
stretched: _react.PropTypes.bool,
/** A grid can specify its text alignment. */
textAlign: _react.PropTypes.oneOf(Grid._meta.props.textAlign),
/** A grid can specify its vertical alignment to have all its columns vertically centered. */
verticalAlign: _react.PropTypes.oneOf(_GridColumn2.default._meta.props.verticalAlign)
};
exports.default = Grid;
/***/ },
/* 922 */
/*!**************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/collections/Grid/GridColumn.js ***!
\**************************************************************************/
/***/ 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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* A column sub-component for Grid.
*/
function GridColumn(props) {
var children = props.children,
className = props.className,
computer = props.computer,
color = props.color,
floated = props.floated,
largeScreen = props.largeScreen,
mobile = props.mobile,
only = props.only,
stretched = props.stretched,
tablet = props.tablet,
textAlign = props.textAlign,
verticalAlign = props.verticalAlign,
widescreen = props.widescreen,
width = props.width;
var classes = (0, _classnames2.default)(color, (0, _lib.useKeyOnly)(stretched, 'stretched'), (0, _lib.useTextAlignProp)(textAlign), (0, _lib.useValueAndKey)(floated, 'floated'), (0, _lib.useValueAndKey)(only, 'only'), (0, _lib.useVerticalAlignProp)(verticalAlign), (0, _lib.useWidthProp)(computer, 'wide computer'), (0, _lib.useWidthProp)(largeScreen, 'wide large screen'), (0, _lib.useWidthProp)(mobile, 'wide mobile'), (0, _lib.useWidthProp)(tablet, 'wide tablet'), (0, _lib.useWidthProp)(widescreen, 'wide widescreen'), (0, _lib.useWidthProp)(width, 'wide'), 'column', className);
var rest = (0, _lib.getUnhandledProps)(GridColumn, props);
var ElementType = (0, _lib.getElementType)(GridColumn, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
GridColumn._meta = {
name: 'GridColumn',
parent: 'Grid',
type: _lib.META.TYPES.COLLECTION,
props: {
color: _lib.SUI.COLORS,
computer: _lib.SUI.WIDTHS,
floated: _lib.SUI.FLOATS,
largeScreen: _lib.SUI.WIDTHS,
mobile: _lib.SUI.WIDTHS,
only: ['computer', 'large screen', 'mobile', 'tablet mobile', 'tablet', 'widescreen'],
tablet: _lib.SUI.WIDTHS,
textAlign: _lib.SUI.TEXT_ALIGNMENTS,
verticalAlign: _lib.SUI.VERTICAL_ALIGNMENTS,
widescreen: _lib.SUI.WIDTHS,
width: _lib.SUI.WIDTHS
}
};
GridColumn.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** A column can specify a width for a computer. */
computer: _react.PropTypes.oneOf(GridColumn._meta.props.width),
/** A grid column can be colored. */
color: _react.PropTypes.oneOf(GridColumn._meta.props.color),
/** A column can sit flush against the left or right edge of a row. */
floated: _react.PropTypes.oneOf(GridColumn._meta.props.floated),
/** A column can specify a width for a large screen device. */
largeScreen: _react.PropTypes.oneOf(GridColumn._meta.props.width),
/** A column can specify a width for a mobile device. */
mobile: _react.PropTypes.oneOf(GridColumn._meta.props.width),
/** A column can appear only for a specific device, or screen sizes. */
only: _react.PropTypes.oneOf(GridColumn._meta.props.only),
/** An can stretch its contents to take up the entire grid or row height. */
stretched: _react.PropTypes.bool,
/** A column can specify a width for a tablet device. */
tablet: _react.PropTypes.oneOf(GridColumn._meta.props.width),
/** A row can specify its text alignment. */
textAlign: _react.PropTypes.oneOf(GridColumn._meta.props.textAlign),
/** A column can specify its vertical alignment to have all its columns vertically centered. */
verticalAlign: _react.PropTypes.oneOf(GridColumn._meta.props.verticalAlign),
/** A column can specify a width for a wide screen device. */
widescreen: _react.PropTypes.oneOf(GridColumn._meta.props.width),
/** Represents width of column. */
width: _react.PropTypes.oneOf(GridColumn._meta.props.width)
};
exports.default = GridColumn;
/***/ },
/* 923 */
/*!***********************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/collections/Grid/GridRow.js ***!
\***********************************************************************/
/***/ 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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
/**
* A row sub-component for Grid.
*/
function GridRow(props) {
var centered = props.centered,
children = props.children,
className = props.className,
color = props.color,
columns = props.columns,
divided = props.divided,
only = props.only,
reversed = props.reversed,
stretched = props.stretched,
textAlign = props.textAlign,
verticalAlign = props.verticalAlign;
var classes = (0, _classnames2.default)(color, (0, _lib.useKeyOnly)(centered, 'centered'), (0, _lib.useKeyOnly)(divided, 'divided'), (0, _lib.useKeyOnly)(stretched, 'stretched'), (0, _lib.useTextAlignProp)(textAlign), (0, _lib.useValueAndKey)(only, 'only'), (0, _lib.useValueAndKey)(reversed, 'reversed'), (0, _lib.useVerticalAlignProp)(verticalAlign), (0, _lib.useWidthProp)(columns, 'column', true), 'row', className);
var rest = (0, _lib.getUnhandledProps)(GridRow, props);
var ElementType = (0, _lib.getElementType)(GridRow, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
GridRow._meta = {
name: 'GridRow',
parent: 'Grid',
type: _lib.META.TYPES.COLLECTION,
props: {
color: _lib.SUI.COLORS,
columns: [].concat(_toConsumableArray(_lib.SUI.WIDTHS), ['equal']),
only: ['computer', 'large screen', 'mobile', 'tablet mobile', 'tablet', 'widescreen'],
reversed: ['computer', 'computer vertically', 'mobile', 'mobile vertically', 'tablet', 'tablet vertically'],
textAlign: _lib.SUI.TEXT_ALIGNMENTS,
verticalAlign: _lib.SUI.VERTICAL_ALIGNMENTS
}
};
GridRow.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** A row can have its columns centered. */
centered: _react.PropTypes.bool,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** A grid row can be colored. */
color: _react.PropTypes.oneOf(GridRow._meta.props.color),
/** Represents column count per line in Row. */
columns: _react.PropTypes.oneOf(GridRow._meta.props.columns),
/** A row can have dividers between its columns. */
divided: _react.PropTypes.bool,
/** A row can appear only for a specific device, or screen sizes. */
only: _react.PropTypes.oneOf(GridRow._meta.props.only),
/** A row can specify that its columns should reverse order at different device sizes. */
reversed: _react.PropTypes.oneOf(GridRow._meta.props.reversed),
/** An can stretch its contents to take up the entire column height. */
stretched: _react.PropTypes.bool,
/** A row can specify its text alignment. */
textAlign: _react.PropTypes.oneOf(GridRow._meta.props.textAlign),
/** A row can specify its vertical alignment to have all its columns vertically centered. */
verticalAlign: _react.PropTypes.oneOf(GridRow._meta.props.verticalAlign)
};
exports.default = GridRow;
/***/ },
/* 924 */
/*!*********************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/collections/Menu/index.js ***!
\*********************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _Menu = __webpack_require__(/*! ./Menu */ 925);
var _Menu2 = _interopRequireDefault(_Menu);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = _Menu2.default;
/***/ },
/* 925 */
/*!********************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/collections/Menu/Menu.js ***!
\********************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
var _map2 = __webpack_require__(/*! lodash/map */ 825);
var _map3 = _interopRequireDefault(_map2);
var _get2 = __webpack_require__(/*! lodash/get */ 678);
var _get3 = _interopRequireDefault(_get2);
var _without2 = __webpack_require__(/*! lodash/without */ 846);
var _without3 = _interopRequireDefault(_without2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _MenuHeader = __webpack_require__(/*! ./MenuHeader */ 926);
var _MenuHeader2 = _interopRequireDefault(_MenuHeader);
var _MenuItem = __webpack_require__(/*! ./MenuItem */ 927);
var _MenuItem2 = _interopRequireDefault(_MenuItem);
var _MenuMenu = __webpack_require__(/*! ./MenuMenu */ 944);
var _MenuMenu2 = _interopRequireDefault(_MenuMenu);
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 _meta = {
name: 'Menu',
type: _lib.META.TYPES.COLLECTION,
props: {
attached: ['top', 'bottom'],
color: _lib.SUI.COLORS,
floated: ['right'],
icon: ['labeled'],
fixed: ['left', 'right', 'bottom', 'top'],
size: (0, _without3.default)(_lib.SUI.SIZES, 'medium', 'big'),
tabular: ['right'],
widths: _lib.SUI.WIDTHS
}
};
/**
* A menu displays grouped navigation actions.
**/
var Menu = function (_Component) {
_inherits(Menu, _Component);
function Menu() {
var _ref;
var _temp, _this, _ret;
_classCallCheck(this, Menu);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Menu.__proto__ || Object.getPrototypeOf(Menu)).call.apply(_ref, [this].concat(args))), _this), _this.handleItemClick = function (e, itemProps) {
var index = itemProps.index;
_this.trySetState({ activeIndex: index });
var _this$props = _this.props,
items = _this$props.items,
onItemClick = _this$props.onItemClick;
if ((0, _get3.default)(items[index], 'onClick')) items[index].onClick(e, itemProps);
if (onItemClick) onItemClick(e, itemProps);
}, _temp), _possibleConstructorReturn(_this, _ret);
}
_createClass(Menu, [{
key: 'renderItems',
value: function renderItems() {
var _this2 = this;
var items = this.props.items;
var activeIndex = this.state.activeIndex;
return (0, _map3.default)(items, function (item, index) {
return _MenuItem2.default.create(item, {
active: activeIndex === index,
index: index,
onClick: _this2.handleItemClick
});
});
}
}, {
key: 'render',
value: function render() {
var _props = this.props,
attached = _props.attached,
borderless = _props.borderless,
children = _props.children,
className = _props.className,
color = _props.color,
compact = _props.compact,
fixed = _props.fixed,
floated = _props.floated,
fluid = _props.fluid,
icon = _props.icon,
inverted = _props.inverted,
pagination = _props.pagination,
pointing = _props.pointing,
secondary = _props.secondary,
stackable = _props.stackable,
tabular = _props.tabular,
text = _props.text,
vertical = _props.vertical,
size = _props.size,
widths = _props.widths;
var classes = (0, _classnames2.default)('ui', color, size, (0, _lib.useWidthProp)(widths, 'item'), (0, _lib.useKeyOrValueAndKey)(attached, 'attached'), (0, _lib.useKeyOnly)(borderless, 'borderless'), (0, _lib.useKeyOnly)(compact, 'compact'), (0, _lib.useValueAndKey)(fixed, 'fixed'), (0, _lib.useKeyOrValueAndKey)(floated, 'floated'), (0, _lib.useKeyOnly)(fluid, 'fluid'), (0, _lib.useKeyOrValueAndKey)(icon, 'icon'), (0, _lib.useKeyOnly)(inverted, 'inverted'), (0, _lib.useKeyOnly)(pagination, 'pagination'), (0, _lib.useKeyOnly)(pointing, 'pointing'), (0, _lib.useKeyOnly)(secondary, 'secondary'), (0, _lib.useKeyOnly)(stackable, 'stackable'), (0, _lib.useKeyOrValueAndKey)(tabular, 'tabular'), (0, _lib.useKeyOnly)(text, 'text'), (0, _lib.useKeyOnly)(vertical, 'vertical'), className, 'menu');
var rest = (0, _lib.getUnhandledProps)(Menu, this.props);
var ElementType = (0, _lib.getElementType)(Menu, this.props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
(0, _isNil3.default)(children) ? this.renderItems() : children
);
}
}]);
return Menu;
}(_lib.AutoControlledComponent);
Menu.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Index of the currently active item. */
activeIndex: _react.PropTypes.number,
/** A menu may be attached to other content segments. */
attached: _react.PropTypes.oneOfType([_react.PropTypes.bool, _react.PropTypes.oneOf(_meta.props.attached)]),
/** A menu item or menu can have no borders. */
borderless: _react.PropTypes.bool,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** Additional colors can be specified. */
color: _react.PropTypes.oneOf(_meta.props.color),
/** A menu can take up only the space necessary to fit its content. */
compact: _react.PropTypes.bool,
/** Initial activeIndex value. */
defaultActiveIndex: _react.PropTypes.number,
/** A menu can be fixed to a side of its context. */
fixed: _react.PropTypes.oneOf(_meta.props.fixed),
/** A menu can be floated. */
floated: _react.PropTypes.oneOfType([_react.PropTypes.bool, _react.PropTypes.oneOf(_meta.props.floated)]),
/** A vertical menu may take the size of its container. */
fluid: _react.PropTypes.bool,
/** A menu may have labeled icons. */
icon: _react.PropTypes.oneOfType([_react.PropTypes.bool, _react.PropTypes.oneOf(_meta.props.icon)]),
/** A menu may have its colors inverted to show greater contrast. */
inverted: _react.PropTypes.bool,
/** Shorthand array of props for Menu. */
items: _lib.customPropTypes.collectionShorthand,
/**
* onClick handler for MenuItem. Mutually exclusive with children.
*
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All item props.
*/
onItemClick: _lib.customPropTypes.every([_lib.customPropTypes.disallow(['children']), _react.PropTypes.func]),
/** A pagination menu is specially formatted to present links to pages of content. */
pagination: _react.PropTypes.bool,
/** A menu can point to show its relationship to nearby content. */
pointing: _react.PropTypes.bool,
/** A menu can adjust its appearance to de-emphasize its contents. */
secondary: _react.PropTypes.bool,
/** A menu can stack at mobile resolutions. */
stackable: _react.PropTypes.bool,
/** A menu can be formatted to show tabs of information. */
tabular: _react.PropTypes.oneOfType([_react.PropTypes.bool, _react.PropTypes.oneOf(_meta.props.tabular)]),
/** A menu can be formatted for text content. */
text: _react.PropTypes.bool,
/** A vertical menu displays elements vertically. */
vertical: _react.PropTypes.bool,
/** A menu can vary in size. */
size: _react.PropTypes.oneOf(_meta.props.size),
/** A menu can have its items divided evenly. */
widths: _react.PropTypes.oneOf(_meta.props.widths)
};
Menu._meta = _meta;
Menu.autoControlledProps = ['activeIndex'];
Menu.Header = _MenuHeader2.default;
Menu.Item = _MenuItem2.default;
Menu.Menu = _MenuMenu2.default;
exports.default = Menu;
/***/ },
/* 926 */
/*!**************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/collections/Menu/MenuHeader.js ***!
\**************************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function MenuHeader(props) {
var children = props.children,
className = props.className,
content = props.content;
var classes = (0, _classnames2.default)(className, 'header');
var rest = (0, _lib.getUnhandledProps)(MenuHeader, props);
var ElementType = (0, _lib.getElementType)(MenuHeader, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
(0, _isNil3.default)(children) ? content : children
);
}
MenuHeader._meta = {
name: 'MenuHeader',
type: _lib.META.TYPES.COLLECTION,
parent: 'Menu'
};
MenuHeader.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** Shorthand for primary content. */
content: _lib.customPropTypes.contentShorthand
};
exports.default = MenuHeader;
/***/ },
/* 927 */
/*!************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/collections/Menu/MenuItem.js ***!
\************************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _startCase2 = __webpack_require__(/*! lodash/startCase */ 928);
var _startCase3 = _interopRequireDefault(_startCase2);
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _Icon = __webpack_require__(/*! ../../elements/Icon */ 874);
var _Icon2 = _interopRequireDefault(_Icon);
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 _meta = {
name: 'MenuItem',
type: _lib.META.TYPES.COLLECTION,
parent: 'Menu',
props: {
color: _lib.SUI.COLORS,
fitted: ['horizontally', 'vertically'],
position: ['right']
}
};
var MenuItem = function (_Component) {
_inherits(MenuItem, _Component);
function MenuItem() {
var _ref;
var _temp, _this, _ret;
_classCallCheck(this, MenuItem);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = MenuItem.__proto__ || Object.getPrototypeOf(MenuItem)).call.apply(_ref, [this].concat(args))), _this), _this.handleClick = function (e) {
var onClick = _this.props.onClick;
if (onClick) onClick(e, _this.props);
}, _temp), _possibleConstructorReturn(_this, _ret);
}
_createClass(MenuItem, [{
key: 'render',
value: function render() {
var _props = this.props,
active = _props.active,
children = _props.children,
className = _props.className,
color = _props.color,
content = _props.content,
fitted = _props.fitted,
header = _props.header,
icon = _props.icon,
link = _props.link,
name = _props.name,
onClick = _props.onClick,
position = _props.position;
var classes = (0, _classnames2.default)(color, position, (0, _lib.useKeyOnly)(active, 'active'), (0, _lib.useKeyOnly)(icon === true || icon && !(name || content), 'icon'), (0, _lib.useKeyOnly)(header, 'header'), (0, _lib.useKeyOnly)(link, 'link'), (0, _lib.useKeyOrValueAndKey)(fitted, 'fitted'), 'item', className);
var ElementType = (0, _lib.getElementType)(MenuItem, this.props, function () {
if (onClick) return 'a';
});
var rest = (0, _lib.getUnhandledProps)(MenuItem, this.props);
if (!(0, _isNil3.default)(children)) {
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes, onClick: this.handleClick }),
children
);
}
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes, onClick: this.handleClick }),
_Icon2.default.create(icon),
content || (0, _startCase3.default)(name)
);
}
}]);
return MenuItem;
}(_react.Component);
MenuItem.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** A menu item can be active. */
active: _react.PropTypes.bool,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** Additional colors can be specified. */
color: _react.PropTypes.oneOf(_meta.props.color),
/** Shorthand for primary content. */
content: _lib.customPropTypes.contentShorthand,
/** A menu item or menu can remove element padding, vertically or horizontally. */
fitted: _react.PropTypes.oneOfType([_react.PropTypes.bool, _react.PropTypes.oneOf(_meta.props.fitted)]),
/** A menu item may include a header or may itself be a header. */
header: _react.PropTypes.bool,
/** MenuItem can be only icon. */
icon: _react.PropTypes.oneOfType([_react.PropTypes.bool, _lib.customPropTypes.itemShorthand]),
/** MenuItem index inside Menu. */
index: _react.PropTypes.number,
/** A menu item can be link. */
link: _react.PropTypes.bool,
/** Internal name of the MenuItem. */
name: _react.PropTypes.string,
/**
* Called on click. When passed, the component will render as an `a`
* tag by default instead of a `div`.
*
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All props.
*/
onClick: _react.PropTypes.func,
/** A menu item can take right position. */
position: _react.PropTypes.oneOf(_meta.props.position)
};
MenuItem._meta = _meta;
exports.default = MenuItem;
MenuItem.create = (0, _lib.createShorthandFactory)(MenuItem, function (val) {
return { content: val, name: val };
}, true);
/***/ },
/* 928 */
/*!***************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/startCase.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
var createCompounder = __webpack_require__(/*! ./_createCompounder */ 929),
upperFirst = __webpack_require__(/*! ./upperFirst */ 937);
/**
* Converts `string` to
* [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
*
* @static
* @memberOf _
* @since 3.1.0
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the start cased string.
* @example
*
* _.startCase('--foo-bar--');
* // => 'Foo Bar'
*
* _.startCase('fooBar');
* // => 'Foo Bar'
*
* _.startCase('__FOO_BAR__');
* // => 'FOO BAR'
*/
var startCase = createCompounder(function(result, word, index) {
return result + (index ? ' ' : '') + upperFirst(word);
});
module.exports = startCase;
/***/ },
/* 929 */
/*!***********************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_createCompounder.js ***!
\***********************************************************/
/***/ function(module, exports, __webpack_require__) {
var arrayReduce = __webpack_require__(/*! ./_arrayReduce */ 783),
deburr = __webpack_require__(/*! ./deburr */ 930),
words = __webpack_require__(/*! ./words */ 933);
/** Used to compose unicode capture groups. */
var rsApos = "['\u2019]";
/** Used to match apostrophes. */
var reApos = RegExp(rsApos, 'g');
/**
* Creates a function like `_.camelCase`.
*
* @private
* @param {Function} callback The function to combine each word.
* @returns {Function} Returns the new compounder function.
*/
function createCompounder(callback) {
return function(string) {
return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
};
}
module.exports = createCompounder;
/***/ },
/* 930 */
/*!************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/deburr.js ***!
\************************************************/
/***/ function(module, exports, __webpack_require__) {
var deburrLetter = __webpack_require__(/*! ./_deburrLetter */ 931),
toString = __webpack_require__(/*! ./toString */ 584);
/** Used to match Latin Unicode letters (excluding mathematical operators). */
var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
/** Used to compose unicode character classes. */
var rsComboMarksRange = '\\u0300-\\u036f',
reComboHalfMarksRange = '\\ufe20-\\ufe2f',
rsComboSymbolsRange = '\\u20d0-\\u20ff',
rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange;
/** Used to compose unicode capture groups. */
var rsCombo = '[' + rsComboRange + ']';
/**
* Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
* [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
*/
var reComboMark = RegExp(rsCombo, 'g');
/**
* Deburrs `string` by converting
* [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
* and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
* letters to basic Latin letters and removing
* [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to deburr.
* @returns {string} Returns the deburred string.
* @example
*
* _.deburr('déjà vu');
* // => 'deja vu'
*/
function deburr(string) {
string = toString(string);
return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
}
module.exports = deburr;
/***/ },
/* 931 */
/*!*******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_deburrLetter.js ***!
\*******************************************************/
/***/ function(module, exports, __webpack_require__) {
var basePropertyOf = __webpack_require__(/*! ./_basePropertyOf */ 932);
/** Used to map Latin Unicode letters to basic Latin letters. */
var deburredLetters = {
// Latin-1 Supplement block.
'\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
'\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
'\xc7': 'C', '\xe7': 'c',
'\xd0': 'D', '\xf0': 'd',
'\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
'\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
'\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
'\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
'\xd1': 'N', '\xf1': 'n',
'\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
'\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
'\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
'\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
'\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
'\xc6': 'Ae', '\xe6': 'ae',
'\xde': 'Th', '\xfe': 'th',
'\xdf': 'ss',
// Latin Extended-A block.
'\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
'\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
'\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
'\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
'\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
'\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
'\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
'\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
'\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
'\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
'\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
'\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
'\u0134': 'J', '\u0135': 'j',
'\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
'\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
'\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
'\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
'\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
'\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
'\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
'\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
'\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
'\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
'\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
'\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
'\u0163': 't', '\u0165': 't', '\u0167': 't',
'\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
'\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
'\u0174': 'W', '\u0175': 'w',
'\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
'\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
'\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
'\u0132': 'IJ', '\u0133': 'ij',
'\u0152': 'Oe', '\u0153': 'oe',
'\u0149': "'n", '\u017f': 's'
};
/**
* Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
* letters to basic Latin letters.
*
* @private
* @param {string} letter The matched letter to deburr.
* @returns {string} Returns the deburred letter.
*/
var deburrLetter = basePropertyOf(deburredLetters);
module.exports = deburrLetter;
/***/ },
/* 932 */
/*!*********************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_basePropertyOf.js ***!
\*********************************************************/
/***/ function(module, exports) {
/**
* The base implementation of `_.propertyOf` without support for deep paths.
*
* @private
* @param {Object} object The object to query.
* @returns {Function} Returns the new accessor function.
*/
function basePropertyOf(object) {
return function(key) {
return object == null ? undefined : object[key];
};
}
module.exports = basePropertyOf;
/***/ },
/* 933 */
/*!***********************************************!*\
!*** ./~/semantic-ui-react/~/lodash/words.js ***!
\***********************************************/
/***/ function(module, exports, __webpack_require__) {
var asciiWords = __webpack_require__(/*! ./_asciiWords */ 934),
hasUnicodeWord = __webpack_require__(/*! ./_hasUnicodeWord */ 935),
toString = __webpack_require__(/*! ./toString */ 584),
unicodeWords = __webpack_require__(/*! ./_unicodeWords */ 936);
/**
* Splits `string` into an array of its words.
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to inspect.
* @param {RegExp|string} [pattern] The pattern to match words.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Array} Returns the words of `string`.
* @example
*
* _.words('fred, barney, & pebbles');
* // => ['fred', 'barney', 'pebbles']
*
* _.words('fred, barney, & pebbles', /[^, ]+/g);
* // => ['fred', 'barney', '&', 'pebbles']
*/
function words(string, pattern, guard) {
string = toString(string);
pattern = guard ? undefined : pattern;
if (pattern === undefined) {
return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
}
return string.match(pattern) || [];
}
module.exports = words;
/***/ },
/* 934 */
/*!*****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_asciiWords.js ***!
\*****************************************************/
/***/ function(module, exports) {
/** Used to match words composed of alphanumeric characters. */
var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
/**
* Splits an ASCII `string` into an array of its words.
*
* @private
* @param {string} The string to inspect.
* @returns {Array} Returns the words of `string`.
*/
function asciiWords(string) {
return string.match(reAsciiWord) || [];
}
module.exports = asciiWords;
/***/ },
/* 935 */
/*!*********************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_hasUnicodeWord.js ***!
\*********************************************************/
/***/ function(module, exports) {
/** Used to detect strings that need a more robust regexp to match words. */
var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
/**
* Checks if `string` contains a word composed of Unicode symbols.
*
* @private
* @param {string} string The string to inspect.
* @returns {boolean} Returns `true` if a word is found, else `false`.
*/
function hasUnicodeWord(string) {
return reHasUnicodeWord.test(string);
}
module.exports = hasUnicodeWord;
/***/ },
/* 936 */
/*!*******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_unicodeWords.js ***!
\*******************************************************/
/***/ function(module, exports) {
/** Used to compose unicode character classes. */
var rsAstralRange = '\\ud800-\\udfff',
rsComboMarksRange = '\\u0300-\\u036f',
reComboHalfMarksRange = '\\ufe20-\\ufe2f',
rsComboSymbolsRange = '\\u20d0-\\u20ff',
rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
rsDingbatRange = '\\u2700-\\u27bf',
rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
rsPunctuationRange = '\\u2000-\\u206f',
rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000',
rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
rsVarRange = '\\ufe0e\\ufe0f',
rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
/** Used to compose unicode capture groups. */
var rsApos = "['\u2019]",
rsBreak = '[' + rsBreakRange + ']',
rsCombo = '[' + rsComboRange + ']',
rsDigits = '\\d+',
rsDingbat = '[' + rsDingbatRange + ']',
rsLower = '[' + rsLowerRange + ']',
rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
rsFitz = '\\ud83c[\\udffb-\\udfff]',
rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
rsNonAstral = '[^' + rsAstralRange + ']',
rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
rsUpper = '[' + rsUpperRange + ']',
rsZWJ = '\\u200d';
/** Used to compose unicode regexes. */
var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
reOptMod = rsModifier + '?',
rsOptVar = '[' + rsVarRange + ']?',
rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
rsOrdLower = '\\d*(?:(?:1st|2nd|3rd|(?![123])\\dth)\\b)',
rsOrdUpper = '\\d*(?:(?:1ST|2ND|3RD|(?![123])\\dTH)\\b)',
rsSeq = rsOptVar + reOptMod + rsOptJoin,
rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq;
/** Used to match complex or compound words. */
var reUnicodeWord = RegExp([
rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
rsUpper + '+' + rsOptContrUpper,
rsOrdUpper,
rsOrdLower,
rsDigits,
rsEmoji
].join('|'), 'g');
/**
* Splits a Unicode `string` into an array of its words.
*
* @private
* @param {string} The string to inspect.
* @returns {Array} Returns the words of `string`.
*/
function unicodeWords(string) {
return string.match(reUnicodeWord) || [];
}
module.exports = unicodeWords;
/***/ },
/* 937 */
/*!****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/upperFirst.js ***!
\****************************************************/
/***/ function(module, exports, __webpack_require__) {
var createCaseFirst = __webpack_require__(/*! ./_createCaseFirst */ 938);
/**
* Converts the first character of `string` to upper case.
*
* @static
* @memberOf _
* @since 4.0.0
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the converted string.
* @example
*
* _.upperFirst('fred');
* // => 'Fred'
*
* _.upperFirst('FRED');
* // => 'FRED'
*/
var upperFirst = createCaseFirst('toUpperCase');
module.exports = upperFirst;
/***/ },
/* 938 */
/*!**********************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_createCaseFirst.js ***!
\**********************************************************/
/***/ function(module, exports, __webpack_require__) {
var castSlice = __webpack_require__(/*! ./_castSlice */ 939),
hasUnicode = __webpack_require__(/*! ./_hasUnicode */ 940),
stringToArray = __webpack_require__(/*! ./_stringToArray */ 941),
toString = __webpack_require__(/*! ./toString */ 584);
/**
* Creates a function like `_.lowerFirst`.
*
* @private
* @param {string} methodName The name of the `String` case method to use.
* @returns {Function} Returns the new case function.
*/
function createCaseFirst(methodName) {
return function(string) {
string = toString(string);
var strSymbols = hasUnicode(string)
? stringToArray(string)
: undefined;
var chr = strSymbols
? strSymbols[0]
: string.charAt(0);
var trailing = strSymbols
? castSlice(strSymbols, 1).join('')
: string.slice(1);
return chr[methodName]() + trailing;
};
}
module.exports = createCaseFirst;
/***/ },
/* 939 */
/*!****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_castSlice.js ***!
\****************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseSlice = __webpack_require__(/*! ./_baseSlice */ 809);
/**
* Casts `array` to a slice if it's needed.
*
* @private
* @param {Array} array The array to inspect.
* @param {number} start The start position.
* @param {number} [end=array.length] The end position.
* @returns {Array} Returns the cast slice.
*/
function castSlice(array, start, end) {
var length = array.length;
end = end === undefined ? length : end;
return (!start && end >= length) ? array : baseSlice(array, start, end);
}
module.exports = castSlice;
/***/ },
/* 940 */
/*!*****************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_hasUnicode.js ***!
\*****************************************************/
/***/ function(module, exports) {
/** Used to compose unicode character classes. */
var rsAstralRange = '\\ud800-\\udfff',
rsComboMarksRange = '\\u0300-\\u036f',
reComboHalfMarksRange = '\\ufe20-\\ufe2f',
rsComboSymbolsRange = '\\u20d0-\\u20ff',
rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
rsVarRange = '\\ufe0e\\ufe0f';
/** Used to compose unicode capture groups. */
var rsZWJ = '\\u200d';
/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */
var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
/**
* Checks if `string` contains Unicode symbols.
*
* @private
* @param {string} string The string to inspect.
* @returns {boolean} Returns `true` if a symbol is found, else `false`.
*/
function hasUnicode(string) {
return reHasUnicode.test(string);
}
module.exports = hasUnicode;
/***/ },
/* 941 */
/*!********************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_stringToArray.js ***!
\********************************************************/
/***/ function(module, exports, __webpack_require__) {
var asciiToArray = __webpack_require__(/*! ./_asciiToArray */ 942),
hasUnicode = __webpack_require__(/*! ./_hasUnicode */ 940),
unicodeToArray = __webpack_require__(/*! ./_unicodeToArray */ 943);
/**
* Converts `string` to an array.
*
* @private
* @param {string} string The string to convert.
* @returns {Array} Returns the converted array.
*/
function stringToArray(string) {
return hasUnicode(string)
? unicodeToArray(string)
: asciiToArray(string);
}
module.exports = stringToArray;
/***/ },
/* 942 */
/*!*******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_asciiToArray.js ***!
\*******************************************************/
/***/ function(module, exports) {
/**
* Converts an ASCII `string` to an array.
*
* @private
* @param {string} string The string to convert.
* @returns {Array} Returns the converted array.
*/
function asciiToArray(string) {
return string.split('');
}
module.exports = asciiToArray;
/***/ },
/* 943 */
/*!*********************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_unicodeToArray.js ***!
\*********************************************************/
/***/ function(module, exports) {
/** Used to compose unicode character classes. */
var rsAstralRange = '\\ud800-\\udfff',
rsComboMarksRange = '\\u0300-\\u036f',
reComboHalfMarksRange = '\\ufe20-\\ufe2f',
rsComboSymbolsRange = '\\u20d0-\\u20ff',
rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
rsVarRange = '\\ufe0e\\ufe0f';
/** Used to compose unicode capture groups. */
var rsAstral = '[' + rsAstralRange + ']',
rsCombo = '[' + rsComboRange + ']',
rsFitz = '\\ud83c[\\udffb-\\udfff]',
rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
rsNonAstral = '[^' + rsAstralRange + ']',
rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
rsZWJ = '\\u200d';
/** Used to compose unicode regexes. */
var reOptMod = rsModifier + '?',
rsOptVar = '[' + rsVarRange + ']?',
rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
rsSeq = rsOptVar + reOptMod + rsOptJoin,
rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
/**
* Converts a Unicode `string` to an array.
*
* @private
* @param {string} string The string to convert.
* @returns {Array} Returns the converted array.
*/
function unicodeToArray(string) {
return string.match(reUnicode) || [];
}
module.exports = unicodeToArray;
/***/ },
/* 944 */
/*!************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/collections/Menu/MenuMenu.js ***!
\************************************************************************/
/***/ 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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function MenuMenu(props) {
var children = props.children,
className = props.className,
position = props.position;
var classes = (0, _classnames2.default)(className, position, 'menu');
var rest = (0, _lib.getUnhandledProps)(MenuMenu, props);
var ElementType = (0, _lib.getElementType)(MenuMenu, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
MenuMenu._meta = {
name: 'MenuMenu',
type: _lib.META.TYPES.COLLECTION,
parent: 'Menu',
props: {
position: ['right']
}
};
MenuMenu.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** A sub menu can take right position. */
position: _react.PropTypes.oneOf(MenuMenu._meta.props.position)
};
exports.default = MenuMenu;
/***/ },
/* 945 */
/*!************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/collections/Message/index.js ***!
\************************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _Message = __webpack_require__(/*! ./Message */ 946);
var _Message2 = _interopRequireDefault(_Message);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = _Message2.default;
/***/ },
/* 946 */
/*!**************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/collections/Message/Message.js ***!
\**************************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _without2 = __webpack_require__(/*! lodash/without */ 846);
var _without3 = _interopRequireDefault(_without2);
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
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__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _Icon = __webpack_require__(/*! ../../elements/Icon */ 874);
var _Icon2 = _interopRequireDefault(_Icon);
var _MessageContent = __webpack_require__(/*! ./MessageContent */ 947);
var _MessageContent2 = _interopRequireDefault(_MessageContent);
var _MessageHeader = __webpack_require__(/*! ./MessageHeader */ 948);
var _MessageHeader2 = _interopRequireDefault(_MessageHeader);
var _MessageList = __webpack_require__(/*! ./MessageList */ 949);
var _MessageList2 = _interopRequireDefault(_MessageList);
var _MessageItem = __webpack_require__(/*! ./MessageItem */ 950);
var _MessageItem2 = _interopRequireDefault(_MessageItem);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* A message displays information that explains nearby content
* @see Form
*/
function Message(props) {
var children = props.children,
className = props.className,
content = props.content,
header = props.header,
icon = props.icon,
list = props.list,
onDismiss = props.onDismiss,
hidden = props.hidden,
visible = props.visible,
floating = props.floating,
compact = props.compact,
attached = props.attached,
warning = props.warning,
info = props.info,
positive = props.positive,
success = props.success,
negative = props.negative,
error = props.error,
color = props.color,
size = props.size;
var classes = (0, _classnames2.default)('ui', size, color, (0, _lib.useKeyOnly)(icon, 'icon'), (0, _lib.useKeyOnly)(hidden, 'hidden'), (0, _lib.useKeyOnly)(visible, 'visible'), (0, _lib.useKeyOnly)(floating, 'floating'), (0, _lib.useKeyOnly)(compact, 'compact'), (0, _lib.useKeyOrValueAndKey)(attached, 'attached'), (0, _lib.useKeyOnly)(warning, 'warning'), (0, _lib.useKeyOnly)(info, 'info'), (0, _lib.useKeyOnly)(positive, 'positive'), (0, _lib.useKeyOnly)(success, 'success'), (0, _lib.useKeyOnly)(negative, 'negative'), (0, _lib.useKeyOnly)(error, 'error'), 'message', className);
var dismissIcon = onDismiss && _react2.default.createElement(_Icon2.default, { name: 'close', onClick: onDismiss });
var rest = (0, _lib.getUnhandledProps)(Message, props);
var ElementType = (0, _lib.getElementType)(Message, props);
if (!(0, _isNil3.default)(children)) {
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
dismissIcon,
children
);
}
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
dismissIcon,
_Icon2.default.create(icon),
(!(0, _isNil3.default)(header) || !(0, _isNil3.default)(content) || !(0, _isNil3.default)(list)) && _react2.default.createElement(
_MessageContent2.default,
null,
_MessageHeader2.default.create(header),
_MessageList2.default.create(list),
(0, _lib.createShorthand)('p', function (val) {
return { children: val };
}, content)
)
);
}
Message._meta = {
name: 'Message',
type: _lib.META.TYPES.COLLECTION,
props: {
attached: ['bottom'],
color: _lib.SUI.COLORS,
size: (0, _without3.default)(_lib.SUI.SIZES, 'medium')
}
};
Message.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** Shorthand for primary content. */
content: _lib.customPropTypes.contentShorthand,
/** Shorthand for MessageHeader. */
header: _lib.customPropTypes.itemShorthand,
/** A message can contain an icon. */
icon: _react.PropTypes.oneOfType([_react.PropTypes.bool, _lib.customPropTypes.itemShorthand]),
/** Array shorthand items for the MessageList. Mutually exclusive with children. */
list: _lib.customPropTypes.collectionShorthand,
/**
* A message that the user can choose to hide.
* Called when the user clicks the "x" icon. This also adds the "x" icon.
*/
onDismiss: _react.PropTypes.func,
/** A message can be hidden. */
hidden: _react.PropTypes.bool,
/** A message can be set to visible to force itself to be shown. */
visible: _react.PropTypes.bool,
/** A message can float above content that it is related to. */
floating: _react.PropTypes.bool,
/** A message can only take up the width of its content. */
compact: _react.PropTypes.bool,
/** A message can be formatted to attach itself to other content. */
attached: _react.PropTypes.oneOfType([_react.PropTypes.bool, _react.PropTypes.oneOf(Message._meta.props.attached)]),
/** A message may be formatted to display warning messages. */
warning: _react.PropTypes.bool,
/** A message may be formatted to display information. */
info: _react.PropTypes.bool,
/** A message may be formatted to display a positive message. Same as `success`. */
positive: _react.PropTypes.bool,
/** A message may be formatted to display a positive message. Same as `positive`. */
success: _react.PropTypes.bool,
/** A message may be formatted to display a negative message. Same as `error`. */
negative: _react.PropTypes.bool,
/** A message may be formatted to display a negative message. Same as `negative`. */
error: _react.PropTypes.bool,
/** A message can be formatted to be different colors. */
color: _react.PropTypes.oneOf(Message._meta.props.color),
/** A message can have different sizes. */
size: _react.PropTypes.oneOf(Message._meta.props.size)
};
Message.Content = _MessageContent2.default;
Message.Header = _MessageHeader2.default;
Message.List = _MessageList2.default;
Message.Item = _MessageItem2.default;
exports.default = Message;
/***/ },
/* 947 */
/*!*********************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/collections/Message/MessageContent.js ***!
\*********************************************************************************/
/***/ 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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function MessageContent(props) {
var children = props.children,
className = props.className;
var classes = (0, _classnames2.default)('content', className);
var rest = (0, _lib.getUnhandledProps)(MessageContent, props);
var ElementType = (0, _lib.getElementType)(MessageContent, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
MessageContent._meta = {
name: 'MessageContent',
parent: 'Message',
type: _lib.META.TYPES.COLLECTION
};
MessageContent.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string
};
exports.default = MessageContent;
/***/ },
/* 948 */
/*!********************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/collections/Message/MessageHeader.js ***!
\********************************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function MessageHeader(props) {
var children = props.children,
className = props.className,
content = props.content;
var classes = (0, _classnames2.default)('header', className);
var rest = (0, _lib.getUnhandledProps)(MessageHeader, props);
var ElementType = (0, _lib.getElementType)(MessageHeader, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
(0, _isNil3.default)(children) ? content : children
);
}
MessageHeader._meta = {
name: 'MessageHeader',
parent: 'Message',
type: _lib.META.TYPES.COLLECTION
};
MessageHeader.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Shorthand for primary content. */
content: _lib.customPropTypes.itemShorthand,
/** Additional classes. */
className: _react.PropTypes.string
};
MessageHeader.create = (0, _lib.createShorthandFactory)(MessageHeader, function (val) {
return { content: val };
});
exports.default = MessageHeader;
/***/ },
/* 949 */
/*!******************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/collections/Message/MessageList.js ***!
\******************************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _map2 = __webpack_require__(/*! lodash/fp/map */ 824);
var _map3 = _interopRequireDefault(_map2);
var _isNil2 = __webpack_require__(/*! lodash/fp/isNil */ 833);
var _isNil3 = _interopRequireDefault(_isNil2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _MessageItem = __webpack_require__(/*! ./MessageItem */ 950);
var _MessageItem2 = _interopRequireDefault(_MessageItem);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function MessageList(props) {
var children = props.children,
className = props.className,
items = props.items;
var classes = (0, _classnames2.default)('list', className);
var rest = (0, _lib.getUnhandledProps)(MessageList, props);
var ElementType = (0, _lib.getElementType)(MessageList, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
(0, _isNil3.default)(children) ? (0, _map3.default)(_MessageItem2.default.create, items) : children
);
}
MessageList._meta = {
name: 'MessageList',
parent: 'Message',
type: _lib.META.TYPES.COLLECTION
};
MessageList.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** Shorthand Message.Items. */
items: _lib.customPropTypes.collectionShorthand
};
MessageList.defaultProps = {
as: 'ul'
};
MessageList.create = (0, _lib.createShorthandFactory)(MessageList, function (val) {
return { items: val };
});
exports.default = MessageList;
/***/ },
/* 950 */
/*!******************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/collections/Message/MessageItem.js ***!
\******************************************************************************/
/***/ 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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function MessageItem(props) {
var children = props.children,
className = props.className,
content = props.content;
var classes = (0, _classnames2.default)('content', className);
var rest = (0, _lib.getUnhandledProps)(MessageItem, props);
var ElementType = (0, _lib.getElementType)(MessageItem, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
content || children
);
}
MessageItem._meta = {
name: 'MessageItem',
parent: 'Message',
type: _lib.META.TYPES.COLLECTION
};
MessageItem.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Shorthand for primary content. */
content: _lib.customPropTypes.itemShorthand,
/** Additional classes. */
className: _react.PropTypes.string
};
MessageItem.defaultProps = {
as: 'li'
};
MessageItem.create = (0, _lib.createShorthandFactory)(MessageItem, function (content) {
return { content: content };
}, true);
exports.default = MessageItem;
/***/ },
/* 951 */
/*!**********************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/collections/Table/index.js ***!
\**********************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _Table = __webpack_require__(/*! ./Table */ 952);
var _Table2 = _interopRequireDefault(_Table);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = _Table2.default;
/***/ },
/* 952 */
/*!**********************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/collections/Table/Table.js ***!
\**********************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _without2 = __webpack_require__(/*! lodash/without */ 846);
var _without3 = _interopRequireDefault(_without2);
var _map2 = __webpack_require__(/*! lodash/map */ 825);
var _map3 = _interopRequireDefault(_map2);
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _TableBody = __webpack_require__(/*! ./TableBody */ 953);
var _TableBody2 = _interopRequireDefault(_TableBody);
var _TableCell = __webpack_require__(/*! ./TableCell */ 954);
var _TableCell2 = _interopRequireDefault(_TableCell);
var _TableFooter = __webpack_require__(/*! ./TableFooter */ 955);
var _TableFooter2 = _interopRequireDefault(_TableFooter);
var _TableHeader = __webpack_require__(/*! ./TableHeader */ 956);
var _TableHeader2 = _interopRequireDefault(_TableHeader);
var _TableHeaderCell = __webpack_require__(/*! ./TableHeaderCell */ 957);
var _TableHeaderCell2 = _interopRequireDefault(_TableHeaderCell);
var _TableRow = __webpack_require__(/*! ./TableRow */ 958);
var _TableRow2 = _interopRequireDefault(_TableRow);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* A table displays a collections of data grouped into rows
*/
function Table(props) {
var basic = props.basic,
attached = props.attached,
renderBodyRow = props.renderBodyRow,
celled = props.celled,
children = props.children,
className = props.className,
collapsing = props.collapsing,
color = props.color,
columns = props.columns,
compact = props.compact,
definition = props.definition,
fixed = props.fixed,
footerRow = props.footerRow,
headerRow = props.headerRow,
inverted = props.inverted,
padded = props.padded,
selectable = props.selectable,
singleLine = props.singleLine,
size = props.size,
stackable = props.stackable,
striped = props.striped,
structured = props.structured,
tableData = props.tableData,
unstackable = props.unstackable;
var classes = (0, _classnames2.default)('ui', color, size, (0, _lib.useKeyOrValueAndKey)(attached, 'attached'), (0, _lib.useKeyOrValueAndKey)(basic, 'basic'), (0, _lib.useKeyOnly)(celled, 'celled'), (0, _lib.useKeyOnly)(collapsing, 'collapsing'), (0, _lib.useKeyOrValueAndKey)(compact, 'compact'), (0, _lib.useKeyOnly)(definition, 'definition'), (0, _lib.useKeyOnly)(fixed, 'fixed'), (0, _lib.useKeyOnly)(inverted, 'inverted'), (0, _lib.useKeyOrValueAndKey)(padded, 'padded'), (0, _lib.useKeyOnly)(selectable, 'selectable'), (0, _lib.useKeyOnly)(singleLine, 'single line'), (0, _lib.useKeyOnly)(stackable, 'stackable'), (0, _lib.useKeyOnly)(striped, 'striped'), (0, _lib.useKeyOnly)(structured, 'structured'), (0, _lib.useKeyOnly)(unstackable, 'unstackable'), (0, _lib.useWidthProp)(columns, 'column'), className, 'table');
var rest = (0, _lib.getUnhandledProps)(Table, props);
var ElementType = (0, _lib.getElementType)(Table, props);
if (!(0, _isNil3.default)(children)) {
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
headerRow && _react2.default.createElement(
_TableHeader2.default,
null,
_TableRow2.default.create(headerRow, { cellAs: 'th' })
),
_react2.default.createElement(
_TableBody2.default,
null,
renderBodyRow && (0, _map3.default)(tableData, function (data, index) {
return _TableRow2.default.create(renderBodyRow(data, index));
})
),
footerRow && _react2.default.createElement(
_TableFooter2.default,
null,
_TableRow2.default.create(footerRow)
)
);
}
Table._meta = {
name: 'Table',
type: _lib.META.TYPES.COLLECTION,
props: {
attached: ['top', 'bottom'],
basic: ['very'],
color: _lib.SUI.COLORS,
columns: _lib.SUI.WIDTHS,
compact: ['very'],
padded: ['very'],
size: (0, _without3.default)(_lib.SUI.SIZES, 'mini', 'tiny', 'medium', 'big', 'huge', 'massive')
}
};
Table.defaultProps = {
as: 'table'
};
Table.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Attach table to other content */
attached: _react.PropTypes.oneOfType([_react.PropTypes.oneOf(Table._meta.props.attached), _react.PropTypes.bool]),
/** A table can reduce its complexity to increase readability. */
basic: _react.PropTypes.oneOfType([_react.PropTypes.bool, _react.PropTypes.oneOf(Table._meta.props.basic)]),
/** A table may be divided each row into separate cells. */
celled: _react.PropTypes.bool,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** A table can be collapsing, taking up only as much space as its rows. */
collapsing: _react.PropTypes.bool,
/** A table can be given a color to distinguish it from other tables. */
color: _react.PropTypes.oneOf(Table._meta.props.color),
/** A table can specify its column count to divide its content evenly. */
columns: _react.PropTypes.oneOf(Table._meta.props.columns),
/** A table may sometimes need to be more compact to make more rows visible at a time. */
compact: _react.PropTypes.oneOfType([_react.PropTypes.bool, _react.PropTypes.oneOf(Table._meta.props.compact)]),
/** A table may be formatted to emphasize a first column that defines a rows content. */
definition: _react.PropTypes.bool,
/**
* A table can use fixed a special faster form of table rendering that does not resize table cells based on content
*/
fixed: _react.PropTypes.bool,
/** Shorthand for a TableRow to be placed within Table.Footer. */
footerRow: _lib.customPropTypes.itemShorthand,
/** Shorthand for a TableRow to be placed within Table.Header. */
headerRow: _lib.customPropTypes.itemShorthand,
/** A table's colors can be inverted. */
inverted: _react.PropTypes.bool,
/** A table may sometimes need to be more padded for legibility. */
padded: _react.PropTypes.oneOfType([_react.PropTypes.bool, _react.PropTypes.oneOf(Table._meta.props.padded)]),
/**
* A function that takes (data, index) and returns shorthand for a TableRow
* to be placed within Table.Body.
*/
renderBodyRow: _lib.customPropTypes.every([_lib.customPropTypes.disallow(['children']), _lib.customPropTypes.demand(['tableData']), _react.PropTypes.func]),
/** A table can have its rows appear selectable. */
selectable: _react.PropTypes.bool,
/** A table can specify that its cell contents should remain on a single line and not wrap. */
singleLine: _react.PropTypes.bool,
/** A table can also be small or large. */
size: _react.PropTypes.oneOf(Table._meta.props.size),
/** A table can specify how it stacks table content responsively. */
stackable: _react.PropTypes.bool,
/** A table can stripe alternate rows of content with a darker color to increase contrast. */
striped: _react.PropTypes.bool,
/** A table can be formatted to display complex structured data. */
structured: _react.PropTypes.bool,
/** Data to be passed to the renderBodyRow function. */
tableData: _lib.customPropTypes.every([_lib.customPropTypes.disallow(['children']), _lib.customPropTypes.demand(['renderBodyRow']), _react.PropTypes.array]),
/** A table can specify how it stacks table content responsively. */
unstackable: _react.PropTypes.bool
};
Table.Body = _TableBody2.default;
Table.Cell = _TableCell2.default;
Table.Footer = _TableFooter2.default;
Table.Header = _TableHeader2.default;
Table.HeaderCell = _TableHeaderCell2.default;
Table.Row = _TableRow2.default;
exports.default = Table;
/***/ },
/* 953 */
/*!**************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/collections/Table/TableBody.js ***!
\**************************************************************************/
/***/ 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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function TableBody(props) {
var children = props.children,
className = props.className;
var classes = (0, _classnames2.default)(className);
var rest = (0, _lib.getUnhandledProps)(TableBody, props);
var ElementType = (0, _lib.getElementType)(TableBody, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
TableBody._meta = {
name: 'TableBody',
type: _lib.META.TYPES.COLLECTION,
parent: 'Table'
};
TableBody.defaultProps = {
as: 'tbody'
};
TableBody.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string
};
exports.default = TableBody;
/***/ },
/* 954 */
/*!**************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/collections/Table/TableCell.js ***!
\**************************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _Icon = __webpack_require__(/*! ../../elements/Icon */ 874);
var _Icon2 = _interopRequireDefault(_Icon);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function TableCell(props) {
var active = props.active,
children = props.children,
className = props.className,
collapsing = props.collapsing,
content = props.content,
disabled = props.disabled,
error = props.error,
icon = props.icon,
negative = props.negative,
positive = props.positive,
selectable = props.selectable,
singleLine = props.singleLine,
textAlign = props.textAlign,
verticalAlign = props.verticalAlign,
warning = props.warning,
width = props.width;
var classes = (0, _classnames2.default)((0, _lib.useKeyOnly)(active, 'active'), (0, _lib.useKeyOnly)(collapsing, 'collapsing'), (0, _lib.useKeyOnly)(disabled, 'disabled'), (0, _lib.useKeyOnly)(error, 'error'), (0, _lib.useKeyOnly)(negative, 'negative'), (0, _lib.useKeyOnly)(positive, 'positive'), (0, _lib.useKeyOnly)(selectable, 'selectable'), (0, _lib.useKeyOnly)(singleLine, 'single line'), (0, _lib.useKeyOnly)(warning, 'warning'), (0, _lib.useTextAlignProp)(textAlign), (0, _lib.useVerticalAlignProp)(verticalAlign), (0, _lib.useWidthProp)(width, 'wide'), className);
var rest = (0, _lib.getUnhandledProps)(TableCell, props);
var ElementType = (0, _lib.getElementType)(TableCell, props);
if (!(0, _isNil3.default)(children)) {
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
_Icon2.default.create(icon),
content
);
}
TableCell._meta = {
name: 'TableCell',
type: _lib.META.TYPES.COLLECTION,
parent: 'Table',
props: {
textAlign: _lib.SUI.TEXT_ALIGNMENTS,
verticalAlign: _lib.SUI.VERTICAL_ALIGNMENTS,
width: _lib.SUI.WIDTHS
}
};
TableCell.defaultProps = {
as: 'td'
};
TableCell.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** A cell can be active or selected by a user. */
active: _react.PropTypes.bool,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** A cell can be collapsing so that it only uses as much space as required. */
collapsing: _react.PropTypes.bool,
/** Shorthand for primary content. */
content: _lib.customPropTypes.contentShorthand,
/** A cell can be disabled. */
disabled: _react.PropTypes.bool,
/** A cell may call attention to an error or a negative value. */
error: _react.PropTypes.bool,
/** Add an Icon by name, props object, or pass an <Icon /> */
icon: _lib.customPropTypes.itemShorthand,
/** A cell may let a user know whether a value is bad. */
negative: _react.PropTypes.bool,
/** A cell may let a user know whether a value is good. */
positive: _react.PropTypes.bool,
/** A cell can be selectable. */
selectable: _react.PropTypes.bool,
/** A cell can specify that its contents should remain on a single line and not wrap. */
singleLine: _react.PropTypes.bool,
/** A table cell can adjust its text alignment. */
textAlign: _react.PropTypes.oneOf(TableCell._meta.props.textAlign),
/** A table cell can adjust its text alignment. */
verticalAlign: _react.PropTypes.oneOf(TableCell._meta.props.verticalAlign),
/** A cell may warn a user. */
warning: _react.PropTypes.bool,
/** A table can specify the width of individual columns independently. */
width: _react.PropTypes.oneOf(TableCell._meta.props.width)
};
TableCell.create = (0, _lib.createShorthandFactory)(TableCell, function (content) {
return { content: content };
}, true);
exports.default = TableCell;
/***/ },
/* 955 */
/*!****************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/collections/Table/TableFooter.js ***!
\****************************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _TableHeader = __webpack_require__(/*! ./TableHeader */ 956);
var _TableHeader2 = _interopRequireDefault(_TableHeader);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function TableFooter(props) {
return _react2.default.createElement(_TableHeader2.default, props);
}
TableFooter._meta = {
name: 'TableFooter',
type: _lib.META.TYPES.COLLECTION,
parent: 'Table'
};
TableFooter.defaultProps = {
as: 'tfoot'
};
exports.default = TableFooter;
/***/ },
/* 956 */
/*!****************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/collections/Table/TableHeader.js ***!
\****************************************************************************/
/***/ 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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function TableHeader(props) {
var children = props.children,
className = props.className,
fullWidth = props.fullWidth;
var classes = (0, _classnames2.default)((0, _lib.useKeyOnly)(fullWidth, 'full-width'), className);
var rest = (0, _lib.getUnhandledProps)(TableHeader, props);
var ElementType = (0, _lib.getElementType)(TableHeader, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
TableHeader._meta = {
name: 'TableHeader',
type: _lib.META.TYPES.COLLECTION,
parent: 'Table'
};
TableHeader.defaultProps = {
as: 'thead'
};
TableHeader.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** A definition table can have a full width header or footer, filling in the gap left by the first column. */
fullWidth: _react.PropTypes.bool
};
exports.default = TableHeader;
/***/ },
/* 957 */
/*!********************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/collections/Table/TableHeaderCell.js ***!
\********************************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _TableCell = __webpack_require__(/*! ./TableCell */ 954);
var _TableCell2 = _interopRequireDefault(_TableCell);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function TableHeaderCell(props) {
return _react2.default.createElement(_TableCell2.default, props);
}
TableHeaderCell._meta = {
name: 'TableHeaderCell',
type: _lib.META.TYPES.COLLECTION,
parent: 'Table'
};
TableHeaderCell.defaultProps = {
as: 'th'
};
exports.default = TableHeaderCell;
/***/ },
/* 958 */
/*!*************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/collections/Table/TableRow.js ***!
\*************************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _map2 = __webpack_require__(/*! lodash/map */ 825);
var _map3 = _interopRequireDefault(_map2);
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _TableCell = __webpack_require__(/*! ./TableCell */ 954);
var _TableCell2 = _interopRequireDefault(_TableCell);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function TableRow(props) {
var active = props.active,
cellAs = props.cellAs,
cells = props.cells,
children = props.children,
className = props.className,
disabled = props.disabled,
error = props.error,
negative = props.negative,
positive = props.positive,
textAlign = props.textAlign,
verticalAlign = props.verticalAlign,
warning = props.warning;
var classes = (0, _classnames2.default)((0, _lib.useKeyOnly)(active, 'active'), (0, _lib.useKeyOnly)(disabled, 'disabled'), (0, _lib.useKeyOnly)(error, 'error'), (0, _lib.useKeyOnly)(negative, 'negative'), (0, _lib.useKeyOnly)(positive, 'positive'), (0, _lib.useKeyOnly)(warning, 'warning'), (0, _lib.useTextAlignProp)(textAlign), (0, _lib.useVerticalAlignProp)(verticalAlign), className);
var rest = (0, _lib.getUnhandledProps)(TableRow, props);
var ElementType = (0, _lib.getElementType)(TableRow, props);
if (!(0, _isNil3.default)(children)) {
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
(0, _map3.default)(cells, function (cell) {
return _TableCell2.default.create(cell, { as: cellAs });
})
);
}
TableRow._meta = {
name: 'TableRow',
type: _lib.META.TYPES.COLLECTION,
parent: 'Table',
props: {
textAlign: _lib.SUI.TEXT_ALIGNMENTS,
verticalAlign: _lib.SUI.VERTICAL_ALIGNMENTS
}
};
TableRow.defaultProps = {
as: 'tr',
cellAs: 'td'
};
TableRow.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** A row can be active or selected by a user. */
active: _react.PropTypes.bool,
/** An element type to render as (string or function). */
cellAs: _lib.customPropTypes.as,
/** Shorthand array of props for TableCell. */
cells: _lib.customPropTypes.collectionShorthand,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** A row can be disabled. */
disabled: _react.PropTypes.bool,
/** A row may call attention to an error or a negative value. */
error: _react.PropTypes.bool,
/** A row may let a user know whether a value is bad. */
negative: _react.PropTypes.bool,
/** A row may let a user know whether a value is good. */
positive: _react.PropTypes.bool,
/** A table row can adjust its text alignment. */
textAlign: _react.PropTypes.oneOf(TableRow._meta.props.textAlign),
/** A table row can adjust its vertical alignment. */
verticalAlign: _react.PropTypes.oneOf(TableRow._meta.props.verticalAlign),
/** A row may warn a user. */
warning: _react.PropTypes.bool
};
TableRow.create = (0, _lib.createShorthandFactory)(TableRow, function (cells) {
return { cells: cells };
}, true);
exports.default = TableRow;
/***/ },
/* 959 */
/*!***********************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/elements/Container/index.js ***!
\***********************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _Container = __webpack_require__(/*! ./Container */ 960);
var _Container2 = _interopRequireDefault(_Container);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = _Container2.default;
/***/ },
/* 960 */
/*!***************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/elements/Container/Container.js ***!
\***************************************************************************/
/***/ 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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* A container limits content to a maximum width
*/
function Container(props) {
var text = props.text,
textAlign = props.textAlign,
fluid = props.fluid,
children = props.children,
className = props.className;
var classes = (0, _classnames2.default)('ui', (0, _lib.useKeyOnly)(text, 'text'), (0, _lib.useKeyOnly)(fluid, 'fluid'), (0, _lib.useTextAlignProp)(textAlign), 'container', className);
var rest = (0, _lib.getUnhandledProps)(Container, props);
var ElementType = (0, _lib.getElementType)(Container, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
Container._meta = {
name: 'Container',
type: _lib.META.TYPES.ELEMENT,
props: {
textAlign: _lib.SUI.TEXT_ALIGNMENTS
}
};
Container.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** Reduce maximum width to more naturally accommodate text */
text: _react.PropTypes.bool,
/** Container has no maximum with */
fluid: _react.PropTypes.bool,
/** Align container text */
textAlign: _react.PropTypes.oneOf(Container._meta.props.textAlign)
};
exports.default = Container;
/***/ },
/* 961 */
/*!*********************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/elements/Divider/index.js ***!
\*********************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _Divider = __webpack_require__(/*! ./Divider */ 962);
var _Divider2 = _interopRequireDefault(_Divider);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = _Divider2.default;
/***/ },
/* 962 */
/*!***********************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/elements/Divider/Divider.js ***!
\***********************************************************************/
/***/ 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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* A divider visually segments content into groups
*/
function Divider(props) {
var horizontal = props.horizontal,
vertical = props.vertical,
inverted = props.inverted,
fitted = props.fitted,
hidden = props.hidden,
section = props.section,
clearing = props.clearing,
children = props.children,
className = props.className;
var classes = (0, _classnames2.default)('ui', (0, _lib.useKeyOnly)(horizontal, 'horizontal'), (0, _lib.useKeyOnly)(vertical, 'vertical'), (0, _lib.useKeyOnly)(inverted, 'inverted'), (0, _lib.useKeyOnly)(fitted, 'fitted'), (0, _lib.useKeyOnly)(hidden, 'hidden'), (0, _lib.useKeyOnly)(section, 'section'), (0, _lib.useKeyOnly)(clearing, 'clearing'), 'divider', className);
var rest = (0, _lib.getUnhandledProps)(Divider, props);
var ElementType = (0, _lib.getElementType)(Divider, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
Divider._meta = {
name: 'Divider',
type: _lib.META.TYPES.ELEMENT
};
Divider.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** Divider can segment content horizontally */
horizontal: _react.PropTypes.bool,
/** Divider can segment content vertically */
vertical: _react.PropTypes.bool,
/** Divider can have it's colours inverted */
inverted: _react.PropTypes.bool,
/** Divider can be fitted without any space above or below it */
fitted: _react.PropTypes.bool,
/** Divider can divide content without creating a dividing line */
hidden: _react.PropTypes.bool,
/** Divider can provide greater margins to divide sections of content */
section: _react.PropTypes.bool,
/** Divider can clear the content above it */
clearing: _react.PropTypes.bool
};
exports.default = Divider;
/***/ },
/* 963 */
/*!********************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/elements/Header/index.js ***!
\********************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _Header = __webpack_require__(/*! ./Header */ 964);
var _Header2 = _interopRequireDefault(_Header);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = _Header2.default;
/***/ },
/* 964 */
/*!*********************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/elements/Header/Header.js ***!
\*********************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _without2 = __webpack_require__(/*! lodash/without */ 846);
var _without3 = _interopRequireDefault(_without2);
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _Icon = __webpack_require__(/*! ../../elements/Icon */ 874);
var _Icon2 = _interopRequireDefault(_Icon);
var _Image = __webpack_require__(/*! ../../elements/Image */ 898);
var _Image2 = _interopRequireDefault(_Image);
var _HeaderSubheader = __webpack_require__(/*! ./HeaderSubheader */ 965);
var _HeaderSubheader2 = _interopRequireDefault(_HeaderSubheader);
var _HeaderContent = __webpack_require__(/*! ./HeaderContent */ 966);
var _HeaderContent2 = _interopRequireDefault(_HeaderContent);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* A header provides a short summary of content
*/
function Header(props) {
var color = props.color,
content = props.content,
dividing = props.dividing,
block = props.block,
attached = props.attached,
floated = props.floated,
inverted = props.inverted,
disabled = props.disabled,
sub = props.sub,
size = props.size,
textAlign = props.textAlign,
icon = props.icon,
image = props.image,
children = props.children,
className = props.className,
subheader = props.subheader;
var classes = (0, _classnames2.default)('ui', size, color, (0, _lib.useKeyOrValueAndKey)(attached, 'attached'), (0, _lib.useKeyOnly)(block, 'block'), (0, _lib.useKeyOnly)(disabled, 'disabled'), (0, _lib.useKeyOnly)(dividing, 'dividing'), (0, _lib.useValueAndKey)(floated, 'floated'), (0, _lib.useKeyOnly)(icon === true, 'icon'), (0, _lib.useKeyOnly)(image === true, 'image'), (0, _lib.useKeyOnly)(inverted, 'inverted'), (0, _lib.useKeyOnly)(sub, 'sub'), (0, _lib.useTextAlignProp)(textAlign), className, 'header');
var rest = (0, _lib.getUnhandledProps)(Header, props);
var ElementType = (0, _lib.getElementType)(Header, props);
if (!(0, _isNil3.default)(children)) {
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
var iconElement = _Icon2.default.create(icon);
var imageElement = _Image2.default.create(image);
var subheaderElement = _HeaderSubheader2.default.create(subheader);
if (iconElement || imageElement) {
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
iconElement || imageElement,
(content || subheaderElement) && _react2.default.createElement(
_HeaderContent2.default,
null,
content,
subheaderElement
)
);
}
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
content,
subheaderElement
);
}
Header._meta = {
name: 'Header',
type: _lib.META.TYPES.ELEMENT,
props: {
attached: ['top', 'bottom'],
color: _lib.SUI.COLORS,
size: (0, _without3.default)(_lib.SUI.SIZES, 'big', 'massive'),
floated: _lib.SUI.FLOATS,
textAlign: _lib.SUI.TEXT_ALIGNMENTS
}
};
Header.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Additional classes. */
className: _react.PropTypes.string,
/** Primary content. */
children: _react.PropTypes.node,
/** Shorthand for primary content. */
content: _lib.customPropTypes.contentShorthand,
/** Add an icon by icon name or pass an <Icon /.> */
icon: _lib.customPropTypes.every([_lib.customPropTypes.disallow(['image']), _react.PropTypes.oneOfType([_react.PropTypes.bool, _lib.customPropTypes.itemShorthand])]),
/** Add an image by img src or pass an <Image />. */
image: _lib.customPropTypes.every([_lib.customPropTypes.disallow(['icon']), _react.PropTypes.oneOfType([_react.PropTypes.bool, _lib.customPropTypes.itemShorthand])]),
/** Color of the header. */
color: _react.PropTypes.oneOf(Header._meta.props.color),
/** Divide header from the content below it */
dividing: _react.PropTypes.bool,
/** Format header to appear inside a content block */
block: _react.PropTypes.bool,
/** Attach header to other content, like a segment */
attached: _react.PropTypes.oneOfType([_react.PropTypes.oneOf(Header._meta.props.attached), _react.PropTypes.bool]),
/** Header can sit to the left or right of other content */
floated: _react.PropTypes.oneOf(Header._meta.props.floated),
/** Inverts the color of the header for dark backgrounds */
inverted: _react.PropTypes.bool,
/** Show that the header is inactive */
disabled: _react.PropTypes.bool,
/** Headers may be formatted to label smaller or de-emphasized content */
sub: _react.PropTypes.bool,
/** Content headings are sized with em and are based on the font-size of their container. */
size: _react.PropTypes.oneOf(Header._meta.props.size),
/** Shorthand for Header.Subheader. */
subheader: _lib.customPropTypes.itemShorthand,
/** Align header content */
textAlign: _react.PropTypes.oneOf(Header._meta.props.textAlign)
};
Header.Content = _HeaderContent2.default;
Header.Subheader = _HeaderSubheader2.default;
exports.default = Header;
/***/ },
/* 965 */
/*!******************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/elements/Header/HeaderSubheader.js ***!
\******************************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function HeaderSubheader(props) {
var children = props.children,
className = props.className,
content = props.content;
var classes = (0, _classnames2.default)('sub header', className);
var rest = (0, _lib.getUnhandledProps)(HeaderSubheader, props);
var ElementType = (0, _lib.getElementType)(HeaderSubheader, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
(0, _isNil3.default)(children) ? content : children
);
}
HeaderSubheader._meta = {
name: 'HeaderSubheader',
parent: 'Header',
type: _lib.META.TYPES.ELEMENT
};
HeaderSubheader.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** Shorthand for primary content. */
content: _lib.customPropTypes.contentShorthand
};
HeaderSubheader.create = (0, _lib.createShorthandFactory)(HeaderSubheader, function (content) {
return { content: content };
});
exports.default = HeaderSubheader;
/***/ },
/* 966 */
/*!****************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/elements/Header/HeaderContent.js ***!
\****************************************************************************/
/***/ 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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Header content wraps the main content when there is an adjacent Icon or Image.
*/
function HeaderContent(props) {
var children = props.children,
className = props.className;
var classes = (0, _classnames2.default)(className, 'content');
var rest = (0, _lib.getUnhandledProps)(HeaderContent, props);
var ElementType = (0, _lib.getElementType)(HeaderContent, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
HeaderContent._meta = {
name: 'HeaderContent',
parent: 'Header',
type: _lib.META.TYPES.VIEW
};
HeaderContent.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string
};
exports.default = HeaderContent;
/***/ },
/* 967 */
/*!******************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/elements/List/index.js ***!
\******************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _List = __webpack_require__(/*! ./List */ 968);
var _List2 = _interopRequireDefault(_List);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = _List2.default;
/***/ },
/* 968 */
/*!*****************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/elements/List/List.js ***!
\*****************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _map2 = __webpack_require__(/*! lodash/map */ 825);
var _map3 = _interopRequireDefault(_map2);
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _ListContent = __webpack_require__(/*! ./ListContent */ 969);
var _ListContent2 = _interopRequireDefault(_ListContent);
var _ListDescription = __webpack_require__(/*! ./ListDescription */ 970);
var _ListDescription2 = _interopRequireDefault(_ListDescription);
var _ListHeader = __webpack_require__(/*! ./ListHeader */ 971);
var _ListHeader2 = _interopRequireDefault(_ListHeader);
var _ListIcon = __webpack_require__(/*! ./ListIcon */ 972);
var _ListIcon2 = _interopRequireDefault(_ListIcon);
var _ListItem = __webpack_require__(/*! ./ListItem */ 973);
var _ListItem2 = _interopRequireDefault(_ListItem);
var _ListList = __webpack_require__(/*! ./ListList */ 974);
var _ListList2 = _interopRequireDefault(_ListList);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* A list groups related content
**/
function List(props) {
var animated = props.animated,
bulleted = props.bulleted,
celled = props.celled,
children = props.children,
className = props.className,
divided = props.divided,
floated = props.floated,
horizontal = props.horizontal,
inverted = props.inverted,
items = props.items,
link = props.link,
ordered = props.ordered,
relaxed = props.relaxed,
size = props.size,
selection = props.selection,
verticalAlign = props.verticalAlign;
var classes = (0, _classnames2.default)('ui', size, (0, _lib.useKeyOnly)(animated, 'animated'), (0, _lib.useKeyOnly)(bulleted, 'bulleted'), (0, _lib.useKeyOnly)(celled, 'celled'), (0, _lib.useKeyOnly)(divided, 'divided'), (0, _lib.useKeyOnly)(horizontal, 'horizontal'), (0, _lib.useKeyOnly)(inverted, 'inverted'), (0, _lib.useKeyOnly)(link, 'link'), (0, _lib.useKeyOnly)(ordered, 'ordered'), (0, _lib.useKeyOnly)(selection, 'selection'), (0, _lib.useKeyOrValueAndKey)(relaxed, 'relaxed'), (0, _lib.useValueAndKey)(floated, 'floated'), (0, _lib.useVerticalAlignProp)(verticalAlign), 'list', className);
var rest = (0, _lib.getUnhandledProps)(List, props);
var ElementType = (0, _lib.getElementType)(List, props);
if (!(0, _isNil3.default)(children)) {
return _react2.default.createElement(
ElementType,
_extends({}, rest, { role: 'list', className: classes }),
children
);
}
return _react2.default.createElement(
ElementType,
_extends({}, rest, { role: 'list', className: classes }),
(0, _map3.default)(items, function (item) {
return _ListItem2.default.create(item);
})
);
}
List._meta = {
name: 'List',
type: _lib.META.TYPES.ELEMENT,
props: {
floated: _lib.SUI.FLOATS,
relaxed: ['very'],
size: _lib.SUI.SIZES,
verticalAlign: _lib.SUI.VERTICAL_ALIGNMENTS
}
};
List.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** A list can animate to set the current item apart from the list. */
animated: _react.PropTypes.bool,
/** A list can mark items with a bullet. */
bulleted: _react.PropTypes.bool,
/** A list can divide its items into cells. */
celled: _react.PropTypes.bool,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** A list can show divisions between content. */
divided: _react.PropTypes.bool,
/** An list can be floated left or right. */
floated: _react.PropTypes.oneOf(List._meta.props.floated),
/** A list can be formatted to have items appear horizontally. */
horizontal: _react.PropTypes.bool,
/** A list can be inverted to appear on a dark background. */
inverted: _react.PropTypes.bool,
/** Shorthand array of props for ListItem. */
items: _lib.customPropTypes.collectionShorthand,
/** A list can be specially formatted for navigation links. */
link: _react.PropTypes.bool,
/** A list can be ordered numerically. */
ordered: _react.PropTypes.bool,
/** A list can relax its padding to provide more negative space. */
relaxed: _react.PropTypes.oneOfType([_react.PropTypes.bool, _react.PropTypes.oneOf(List._meta.props.relaxed)]),
/** A selection list formats list items as possible choices. */
selection: _react.PropTypes.bool,
/** A list can vary in size. */
size: _react.PropTypes.oneOf(List._meta.props.size),
/** An element inside a list can be vertically aligned. */
verticalAlign: _react.PropTypes.oneOf(List._meta.props.verticalAlign)
};
List.Content = _ListContent2.default;
List.Description = _ListDescription2.default;
List.Header = _ListHeader2.default;
List.Icon = _ListIcon2.default;
List.Item = _ListItem2.default;
List.List = _ListList2.default;
exports.default = List;
/***/ },
/* 969 */
/*!************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/elements/List/ListContent.js ***!
\************************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _ListDescription = __webpack_require__(/*! ./ListDescription */ 970);
var _ListDescription2 = _interopRequireDefault(_ListDescription);
var _ListHeader = __webpack_require__(/*! ./ListHeader */ 971);
var _ListHeader2 = _interopRequireDefault(_ListHeader);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function ListContent(props) {
var children = props.children,
className = props.className,
content = props.content,
description = props.description,
floated = props.floated,
header = props.header,
verticalAlign = props.verticalAlign;
var classes = (0, _classnames2.default)((0, _lib.useValueAndKey)(floated, 'floated'), (0, _lib.useVerticalAlignProp)(verticalAlign), 'content', className);
var rest = (0, _lib.getUnhandledProps)(ListContent, props);
var ElementType = (0, _lib.getElementType)(ListContent, props);
if (!(0, _isNil3.default)(children)) {
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
_ListHeader2.default.create(header),
_ListDescription2.default.create(description),
content
);
}
ListContent._meta = {
name: 'ListContent',
parent: 'List',
type: _lib.META.TYPES.ELEMENT,
props: {
floated: _lib.SUI.FLOATS,
verticalAlign: _lib.SUI.VERTICAL_ALIGNMENTS
}
};
ListContent.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** Shorthand for primary content. */
content: _lib.customPropTypes.contentShorthand,
/** Shorthand for ListDescription. */
description: _lib.customPropTypes.itemShorthand,
/** An list content can be floated left or right. */
floated: _react.PropTypes.oneOf(ListContent._meta.props.floated),
/** Shorthand for ListHeader. */
header: _lib.customPropTypes.itemShorthand,
/** An element inside a list can be vertically aligned. */
verticalAlign: _react.PropTypes.oneOf(ListContent._meta.props.verticalAlign)
};
ListContent.create = (0, _lib.createShorthandFactory)(ListContent, function (content) {
return { content: content };
});
exports.default = ListContent;
/***/ },
/* 970 */
/*!****************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/elements/List/ListDescription.js ***!
\****************************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function ListDescription(props) {
var children = props.children,
className = props.className,
content = props.content;
var classes = (0, _classnames2.default)(className, 'description');
var rest = (0, _lib.getUnhandledProps)(ListDescription, props);
var ElementType = (0, _lib.getElementType)(ListDescription, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
(0, _isNil3.default)(children) ? content : children
);
}
ListDescription._meta = {
name: 'ListDescription',
parent: 'List',
type: _lib.META.TYPES.ELEMENT
};
ListDescription.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** Shorthand for primary content. */
content: _lib.customPropTypes.contentShorthand
};
ListDescription.create = (0, _lib.createShorthandFactory)(ListDescription, function (content) {
return { content: content };
});
exports.default = ListDescription;
/***/ },
/* 971 */
/*!***********************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/elements/List/ListHeader.js ***!
\***********************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function ListHeader(props) {
var children = props.children,
className = props.className,
content = props.content;
var classes = (0, _classnames2.default)(className, 'header');
var rest = (0, _lib.getUnhandledProps)(ListHeader, props);
var ElementType = (0, _lib.getElementType)(ListHeader, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
(0, _isNil3.default)(children) ? content : children
);
}
ListHeader._meta = {
name: 'ListHeader',
parent: 'List',
type: _lib.META.TYPES.ELEMENT
};
ListHeader.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** Shorthand for primary content. */
content: _lib.customPropTypes.contentShorthand
};
ListHeader.create = (0, _lib.createShorthandFactory)(ListHeader, function (content) {
return { content: content };
});
exports.default = ListHeader;
/***/ },
/* 972 */
/*!*********************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/elements/List/ListIcon.js ***!
\*********************************************************************/
/***/ 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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _Icon = __webpack_require__(/*! ../Icon/Icon */ 845);
var _Icon2 = _interopRequireDefault(_Icon);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function ListIcon(props) {
var className = props.className,
verticalAlign = props.verticalAlign;
var classes = (0, _classnames2.default)((0, _lib.useVerticalAlignProp)(verticalAlign), className);
var rest = (0, _lib.getUnhandledProps)(ListIcon, props);
return _react2.default.createElement(_Icon2.default, _extends({}, rest, { className: classes }));
}
ListIcon._meta = {
name: 'ListIcon',
parent: 'List',
type: _lib.META.TYPES.ELEMENT,
props: {
verticalAlign: _lib.SUI.VERTICAL_ALIGNMENTS
}
};
ListIcon.propTypes = {
/** Additional classes. */
className: _react.PropTypes.string,
/** An element inside a list can be vertically aligned. */
verticalAlign: _react.PropTypes.oneOf(ListIcon._meta.props.verticalAlign)
};
ListIcon.create = (0, _lib.createShorthandFactory)(ListIcon, function (name) {
return { name: name };
});
exports.default = ListIcon;
/***/ },
/* 973 */
/*!*********************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/elements/List/ListItem.js ***!
\*********************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _isPlainObject2 = __webpack_require__(/*! lodash/isPlainObject */ 703);
var _isPlainObject3 = _interopRequireDefault(_isPlainObject2);
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _Image = __webpack_require__(/*! ../../elements/Image */ 898);
var _Image2 = _interopRequireDefault(_Image);
var _ListContent = __webpack_require__(/*! ./ListContent */ 969);
var _ListContent2 = _interopRequireDefault(_ListContent);
var _ListDescription = __webpack_require__(/*! ./ListDescription */ 970);
var _ListDescription2 = _interopRequireDefault(_ListDescription);
var _ListHeader = __webpack_require__(/*! ./ListHeader */ 971);
var _ListHeader2 = _interopRequireDefault(_ListHeader);
var _ListIcon = __webpack_require__(/*! ./ListIcon */ 972);
var _ListIcon2 = _interopRequireDefault(_ListIcon);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function ListItem(props) {
var active = props.active,
children = props.children,
className = props.className,
content = props.content,
description = props.description,
disabled = props.disabled,
header = props.header,
icon = props.icon,
image = props.image,
value = props.value;
var ElementType = (0, _lib.getElementType)(ListItem, props);
var classes = (0, _classnames2.default)((0, _lib.useKeyOnly)(active, 'active'), (0, _lib.useKeyOnly)(disabled, 'disabled'), (0, _lib.useKeyOnly)(ElementType !== 'li', 'item'), className);
var rest = (0, _lib.getUnhandledProps)(ListItem, props);
var valueProp = ElementType === 'li' ? { value: value } : { 'data-value': value };
if (!(0, _isNil3.default)(children)) {
return _react2.default.createElement(
ElementType,
_extends({}, rest, { role: 'listitem', className: classes }, valueProp),
children
);
}
var iconElement = _ListIcon2.default.create(icon);
var imageElement = _Image2.default.create(image);
// See description of `content` prop for explanation about why this is necessary.
if (!(0, _react.isValidElement)(content) && (0, _isPlainObject3.default)(content)) {
return _react2.default.createElement(
ElementType,
_extends({}, rest, { role: 'listitem', className: classes }, valueProp),
iconElement || imageElement,
_ListContent2.default.create(content, { header: header, description: description })
);
}
var headerElement = _ListHeader2.default.create(header);
var descriptionElement = _ListDescription2.default.create(description);
if (iconElement || imageElement) {
return _react2.default.createElement(
ElementType,
_extends({}, rest, { role: 'listitem', className: classes }, valueProp),
iconElement || imageElement,
(content || headerElement || descriptionElement) && _react2.default.createElement(
_ListContent2.default,
null,
headerElement,
descriptionElement,
content
)
);
}
return _react2.default.createElement(
ElementType,
_extends({}, rest, { role: 'listitem', className: classes }, valueProp),
headerElement,
descriptionElement,
content
);
}
ListItem._meta = {
name: 'ListItem',
parent: 'List',
type: _lib.META.TYPES.ELEMENT
};
ListItem.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** A list item can active. */
active: _react.PropTypes.bool,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/**
* Shorthand for primary content.
*
* Heads up!
*
* This is handled slightly differently than the typical `content` prop since
* the wrapping ListContent is not used when there's no icon or image.
*
* If you pass content as:
* - an element/literal, it's treated as the sibling node to
* header/description (whether wrapped in Item.Content or not).
* - a props object, it forces the presence of Item.Content and passes those
* props to it. If you pass a content prop within that props object, it
* will be treated as the sibling node to header/description.
*/
content: _lib.customPropTypes.itemShorthand,
/** Shorthand for ListDescription. */
description: _lib.customPropTypes.itemShorthand,
/** A list item can disabled. */
disabled: _react.PropTypes.bool,
/** Shorthand for ListHeader. */
header: _lib.customPropTypes.itemShorthand,
/** Shorthand for ListIcon. */
icon: _lib.customPropTypes.every([_lib.customPropTypes.disallow(['image']), _lib.customPropTypes.itemShorthand]),
/** Shorthand for Image. */
image: _lib.customPropTypes.every([_lib.customPropTypes.disallow(['icon']), _lib.customPropTypes.itemShorthand]),
/** A value for an ordered list. */
value: _react.PropTypes.string
};
ListItem.create = (0, _lib.createShorthandFactory)(ListItem, function (content) {
return { content: content };
}, true);
exports.default = ListItem;
/***/ },
/* 974 */
/*!*********************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/elements/List/ListList.js ***!
\*********************************************************************/
/***/ 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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function ListList(props) {
var children = props.children,
className = props.className;
var rest = (0, _lib.getUnhandledProps)(ListList, props);
var ElementType = (0, _lib.getElementType)(ListList, props);
var classes = (0, _classnames2.default)((0, _lib.useKeyOnly)(ElementType !== 'ul' && ElementType !== 'ol', 'list'), className);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
ListList._meta = {
name: 'ListList',
parent: 'List',
type: _lib.META.TYPES.ELEMENT
};
ListList.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string
};
exports.default = ListList;
/***/ },
/* 975 */
/*!********************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/elements/Loader/index.js ***!
\********************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _Loader = __webpack_require__(/*! ./Loader */ 976);
var _Loader2 = _interopRequireDefault(_Loader);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = _Loader2.default;
/***/ },
/* 976 */
/*!*********************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/elements/Loader/Loader.js ***!
\*********************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* A loader alerts a user to wait for an activity to complete.
* @see Dimmer
*/
function Loader(props) {
var active = props.active,
children = props.children,
className = props.className,
content = props.content,
disabled = props.disabled,
indeterminate = props.indeterminate,
inline = props.inline,
inverted = props.inverted,
size = props.size;
var classes = (0, _classnames2.default)('ui', size, (0, _lib.useKeyOnly)(active, 'active'), (0, _lib.useKeyOnly)(disabled, 'disabled'), (0, _lib.useKeyOnly)(indeterminate, 'indeterminate'), (0, _lib.useKeyOnly)(inverted, 'inverted'), (0, _lib.useKeyOnly)(children || content, 'text'), (0, _lib.useKeyOrValueAndKey)(inline, 'inline'), 'loader', className);
var rest = (0, _lib.getUnhandledProps)(Loader, props);
var ElementType = (0, _lib.getElementType)(Loader, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
(0, _isNil3.default)(children) ? content : children
);
}
Loader._meta = {
name: 'Loader',
type: _lib.META.TYPES.ELEMENT,
props: {
inline: ['centered'],
size: _lib.SUI.SIZES
}
};
Loader.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** A loader can be active or visible. */
active: _react.PropTypes.bool,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** Shorthand for primary content. */
content: _lib.customPropTypes.contentShorthand,
/** A loader can be disabled or hidden. */
disabled: _react.PropTypes.bool,
/** A loader can show it's unsure of how long a task will take. */
indeterminate: _react.PropTypes.bool,
/** Loaders can appear inline with content. */
inline: _react.PropTypes.oneOfType([_react.PropTypes.bool, _react.PropTypes.oneOf(Loader._meta.props.inline)]),
/** Loaders can have their colors inverted. */
inverted: _react.PropTypes.bool,
/** Loaders can have different sizes. */
size: _react.PropTypes.oneOf(Loader._meta.props.size)
};
exports.default = Loader;
/***/ },
/* 977 */
/*!******************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/elements/Rail/index.js ***!
\******************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _Rail = __webpack_require__(/*! ./Rail */ 978);
var _Rail2 = _interopRequireDefault(_Rail);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = _Rail2.default;
/***/ },
/* 978 */
/*!*****************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/elements/Rail/Rail.js ***!
\*****************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _without2 = __webpack_require__(/*! lodash/without */ 846);
var _without3 = _interopRequireDefault(_without2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* A rail is used to show accompanying content outside the boundaries of the main view of a site.
*/
function Rail(props) {
var attached = props.attached,
children = props.children,
className = props.className,
close = props.close,
dividing = props.dividing,
internal = props.internal,
position = props.position,
size = props.size;
var classes = (0, _classnames2.default)('ui', position, size, (0, _lib.useKeyOnly)(attached, 'attached'), (0, _lib.useKeyOnly)(dividing, 'dividing'), (0, _lib.useKeyOnly)(internal, 'internal'), (0, _lib.useKeyOrValueAndKey)(close, 'close'), 'rail', className);
var rest = (0, _lib.getUnhandledProps)(Rail, props);
var ElementType = (0, _lib.getElementType)(Rail, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
Rail._meta = {
name: 'Rail',
type: _lib.META.TYPES.ELEMENT,
props: {
close: ['very'],
position: _lib.SUI.FLOATS,
size: (0, _without3.default)(_lib.SUI.SIZES, 'medium')
}
};
Rail.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** A rail can appear attached to the main viewport. */
attached: _react.PropTypes.bool,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** A rail can appear closer to the main viewport. */
close: _react.PropTypes.oneOfType([_react.PropTypes.bool, _react.PropTypes.oneOf(Rail._meta.props.close)]),
/** A rail can create a division between itself and a container. */
dividing: _react.PropTypes.bool,
/** A rail can attach itself to the inside of a container. */
internal: _react.PropTypes.bool,
/** A rail can be presented on the left or right side of a container. */
position: _react.PropTypes.oneOf(Rail._meta.props.position).isRequired,
/** A rail can have different sizes. */
size: _react.PropTypes.oneOf(Rail._meta.props.size)
};
exports.default = Rail;
/***/ },
/* 979 */
/*!********************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/elements/Reveal/index.js ***!
\********************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _Reveal = __webpack_require__(/*! ./Reveal */ 980);
var _Reveal2 = _interopRequireDefault(_Reveal);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = _Reveal2.default;
/***/ },
/* 980 */
/*!*********************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/elements/Reveal/Reveal.js ***!
\*********************************************************************/
/***/ 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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _RevealContent = __webpack_require__(/*! ./RevealContent */ 981);
var _RevealContent2 = _interopRequireDefault(_RevealContent);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* A reveal displays additional content in place of previous content when activated.
*/
function Reveal(props) {
var active = props.active,
animated = props.animated,
children = props.children,
className = props.className,
disabled = props.disabled,
instant = props.instant;
var classes = (0, _classnames2.default)('ui', animated, (0, _lib.useKeyOnly)(active, 'active'), (0, _lib.useKeyOnly)(disabled, 'disabled'), (0, _lib.useKeyOnly)(instant, 'instant'), 'reveal', className);
var rest = (0, _lib.getUnhandledProps)(Reveal, props);
var ElementType = (0, _lib.getElementType)(Reveal, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
Reveal._meta = {
name: 'Reveal',
type: _lib.META.TYPES.ELEMENT,
props: {
animated: ['fade', 'small fade', 'move', 'move right', 'move up', 'move down', 'rotate', 'rotate left']
}
};
Reveal.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** An active reveal displays its hidden content. */
active: _react.PropTypes.bool,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** A disabled reveal will not animate when hovered. */
disabled: _react.PropTypes.bool,
/** An animation name that will be applied to Reveal. */
animated: _react.PropTypes.oneOf(Reveal._meta.props.animated),
/** An element can show its content without delay. */
instant: _react.PropTypes.bool
};
Reveal.Content = _RevealContent2.default;
exports.default = Reveal;
/***/ },
/* 981 */
/*!****************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/elements/Reveal/RevealContent.js ***!
\****************************************************************************/
/***/ 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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* A content sub-component for the Reveal.
*/
function RevealContent(props) {
var children = props.children,
className = props.className,
hidden = props.hidden,
visible = props.visible;
var classes = (0, _classnames2.default)('ui', (0, _lib.useKeyOnly)(hidden, 'hidden'), (0, _lib.useKeyOnly)(visible, 'visible'), 'content', className);
var rest = (0, _lib.getUnhandledProps)(RevealContent, props);
var ElementType = (0, _lib.getElementType)(RevealContent, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
RevealContent._meta = {
name: 'RevealContent',
parent: 'Reveal',
type: _lib.META.TYPES.ELEMENT
};
RevealContent.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** A reveal may contain content that is visible before interaction. */
hidden: _react.PropTypes.bool,
/** A reveal may contain content that is hidden before user interaction. */
visible: _react.PropTypes.bool
};
exports.default = RevealContent;
/***/ },
/* 982 */
/*!*********************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/elements/Segment/index.js ***!
\*********************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _Segment = __webpack_require__(/*! ./Segment */ 983);
var _Segment2 = _interopRequireDefault(_Segment);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = _Segment2.default;
/***/ },
/* 983 */
/*!***********************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/elements/Segment/Segment.js ***!
\***********************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _without2 = __webpack_require__(/*! lodash/without */ 846);
var _without3 = _interopRequireDefault(_without2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _SegmentGroup = __webpack_require__(/*! ./SegmentGroup */ 984);
var _SegmentGroup2 = _interopRequireDefault(_SegmentGroup);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* A segment is used to create a grouping of related content.
*/
function Segment(props) {
var attached = props.attached,
basic = props.basic,
children = props.children,
circular = props.circular,
className = props.className,
clearing = props.clearing,
color = props.color,
compact = props.compact,
disabled = props.disabled,
floated = props.floated,
inverted = props.inverted,
loading = props.loading,
padded = props.padded,
piled = props.piled,
raised = props.raised,
secondary = props.secondary,
size = props.size,
stacked = props.stacked,
tertiary = props.tertiary,
textAlign = props.textAlign,
vertical = props.vertical;
var classes = (0, _classnames2.default)('ui', color, size, (0, _lib.useKeyOrValueAndKey)(attached, 'attached'), (0, _lib.useKeyOnly)(basic, 'basic'), (0, _lib.useKeyOnly)(circular, 'circular'), (0, _lib.useKeyOnly)(clearing, 'clearing'), (0, _lib.useKeyOnly)(compact, 'compact'), (0, _lib.useKeyOnly)(disabled, 'disabled'), (0, _lib.useValueAndKey)(floated, 'floated'), (0, _lib.useKeyOnly)(inverted, 'inverted'), (0, _lib.useKeyOnly)(loading, 'loading'), (0, _lib.useKeyOrValueAndKey)(padded, 'padded'), (0, _lib.useKeyOnly)(piled, 'piled'), (0, _lib.useKeyOnly)(raised, 'raised'), (0, _lib.useKeyOnly)(secondary, 'secondary'), (0, _lib.useKeyOnly)(stacked, 'stacked'), (0, _lib.useKeyOnly)(tertiary, 'tertiary'), (0, _lib.useTextAlignProp)(textAlign), (0, _lib.useKeyOnly)(vertical, 'vertical'), className, 'segment');
var rest = (0, _lib.getUnhandledProps)(Segment, props);
var ElementType = (0, _lib.getElementType)(Segment, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
Segment.Group = _SegmentGroup2.default;
Segment._meta = {
name: 'Segment',
type: _lib.META.TYPES.ELEMENT,
props: {
attached: ['top', 'bottom'],
color: _lib.SUI.COLORS,
floated: _lib.SUI.FLOATS,
padded: ['very'],
size: (0, _without3.default)(_lib.SUI.SIZES, 'medium'),
textAlign: _lib.SUI.TEXT_ALIGNMENTS
}
};
Segment.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Attach segment to other content, like a header */
attached: _react.PropTypes.oneOfType([_react.PropTypes.oneOf(Segment._meta.props.attached), _react.PropTypes.bool]),
/** A basic segment has no special formatting */
basic: _react.PropTypes.bool,
/** Primary content. */
children: _react.PropTypes.node,
/** A segment can be circular */
circular: _react.PropTypes.bool,
/** Additional classes. */
className: _react.PropTypes.string,
/** A segment can clear floated content */
clearing: _react.PropTypes.bool,
/** Segment can be colored */
color: _react.PropTypes.oneOf(Segment._meta.props.color),
/** A segment may take up only as much space as is necessary */
compact: _react.PropTypes.bool,
/** A segment may show its content is disabled */
disabled: _react.PropTypes.bool,
/** Segment content can be floated to the left or right */
floated: _react.PropTypes.oneOf(Segment._meta.props.floated),
/** A segment can have its colors inverted for contrast */
inverted: _react.PropTypes.bool,
/** A segment may show its content is being loaded */
loading: _react.PropTypes.bool,
/** A segment can increase its padding */
padded: _react.PropTypes.oneOfType([_react.PropTypes.bool, _react.PropTypes.oneOf(Segment._meta.props.padded)]),
/** Formatted to look like a pile of pages. */
piled: _react.PropTypes.bool,
/** A segment may be formatted to raise above the page. */
raised: _react.PropTypes.bool,
/** A segment can be formatted to appear less noticeable */
secondary: _react.PropTypes.bool,
/** A segment can have different sizes. */
size: _react.PropTypes.oneOf(Segment._meta.props.size),
/** Formatted to show it contains multiple pages. */
stacked: _react.PropTypes.bool,
/** A segment can be formatted to appear even less noticeable */
tertiary: _react.PropTypes.bool,
/** Formats content to be aligned as part of a vertical group. */
textAlign: _react.PropTypes.oneOf(Segment._meta.props.textAlign),
/** Formats content to be aligned vertically */
vertical: _react.PropTypes.bool
};
exports.default = Segment;
/***/ },
/* 984 */
/*!****************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/elements/Segment/SegmentGroup.js ***!
\****************************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _without2 = __webpack_require__(/*! lodash/without */ 846);
var _without3 = _interopRequireDefault(_without2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* A group of segments can be formatted to appear together.
*/
function SegmentGroup(props) {
var children = props.children,
className = props.className,
compact = props.compact,
horizontal = props.horizontal,
piled = props.piled,
raised = props.raised,
size = props.size,
stacked = props.stacked;
var classes = (0, _classnames2.default)('ui', size, (0, _lib.useKeyOnly)(horizontal, 'horizontal'), (0, _lib.useKeyOnly)(compact, 'compact'), (0, _lib.useKeyOnly)(piled, 'piled'), (0, _lib.useKeyOnly)(raised, 'raised'), (0, _lib.useKeyOnly)(stacked, 'stacked'), className, 'segments');
var rest = (0, _lib.getUnhandledProps)(SegmentGroup, props);
var ElementType = (0, _lib.getElementType)(SegmentGroup, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
SegmentGroup._meta = {
name: 'SegmentGroup',
parent: 'Segment',
type: _lib.META.TYPES.ELEMENT,
props: {
size: (0, _without3.default)(_lib.SUI.SIZES, 'medium')
}
};
SegmentGroup.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Additional classes. */
className: _react.PropTypes.string,
/** Primary content. */
children: _react.PropTypes.node,
/** A segment may take up only as much space as is necessary */
compact: _react.PropTypes.bool,
/** Formats content to be aligned horizontally */
horizontal: _react.PropTypes.bool,
/** Formatted to look like a pile of pages. */
piled: _react.PropTypes.bool,
/** A segment group may be formatted to raise above the page. */
raised: _react.PropTypes.bool,
/** A segment group can have different sizes. */
size: _react.PropTypes.oneOf(SegmentGroup._meta.props.size),
/** Formatted to show it contains multiple pages. */
stacked: _react.PropTypes.bool
};
exports.default = SegmentGroup;
/***/ },
/* 985 */
/*!******************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/elements/Step/index.js ***!
\******************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _Step = __webpack_require__(/*! ./Step */ 986);
var _Step2 = _interopRequireDefault(_Step);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = _Step2.default;
/***/ },
/* 986 */
/*!*****************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/elements/Step/Step.js ***!
\*****************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _Icon = __webpack_require__(/*! ../../elements/Icon */ 874);
var _Icon2 = _interopRequireDefault(_Icon);
var _StepContent = __webpack_require__(/*! ./StepContent */ 987);
var _StepContent2 = _interopRequireDefault(_StepContent);
var _StepDescription = __webpack_require__(/*! ./StepDescription */ 988);
var _StepDescription2 = _interopRequireDefault(_StepDescription);
var _StepGroup = __webpack_require__(/*! ./StepGroup */ 990);
var _StepGroup2 = _interopRequireDefault(_StepGroup);
var _StepTitle = __webpack_require__(/*! ./StepTitle */ 989);
var _StepTitle2 = _interopRequireDefault(_StepTitle);
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; }
/**
* A step shows the completion status of an activity in a series of activities
*/
var Step = function (_Component) {
_inherits(Step, _Component);
function Step() {
var _ref;
var _temp, _this, _ret;
_classCallCheck(this, Step);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Step.__proto__ || Object.getPrototypeOf(Step)).call.apply(_ref, [this].concat(args))), _this), _this.handleClick = function (e) {
var onClick = _this.props.onClick;
if (onClick) onClick(e, _this.props);
}, _temp), _possibleConstructorReturn(_this, _ret);
}
_createClass(Step, [{
key: 'render',
value: function render() {
var _props = this.props,
active = _props.active,
children = _props.children,
className = _props.className,
completed = _props.completed,
description = _props.description,
disabled = _props.disabled,
href = _props.href,
icon = _props.icon,
link = _props.link,
onClick = _props.onClick,
title = _props.title;
var classes = (0, _classnames2.default)((0, _lib.useKeyOnly)(active, 'active'), (0, _lib.useKeyOnly)(completed, 'completed'), (0, _lib.useKeyOnly)(disabled, 'disabled'), (0, _lib.useKeyOnly)(link, 'link'), 'step', className);
var rest = (0, _lib.getUnhandledProps)(Step, this.props);
var ElementType = (0, _lib.getElementType)(Step, this.props, function () {
if (onClick) return 'a';
});
if (!(0, _isNil3.default)(children)) {
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes, href: href, onClick: this.handleClick }),
children
);
}
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes, href: href, onClick: this.handleClick }),
_Icon2.default.create(icon),
_react2.default.createElement(_StepContent2.default, { description: description, title: title })
);
}
}]);
return Step;
}(_react.Component);
Step.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** A step can be highlighted as active. */
active: _react.PropTypes.bool,
/** Additional classes. */
className: _react.PropTypes.string,
/** Primary content. */
children: _react.PropTypes.node,
/** A step can show that a user has completed it. */
completed: _react.PropTypes.bool,
/** Shorthand for StepDescription. */
description: _lib.customPropTypes.itemShorthand,
/** Show that the Loader is inactive. */
disabled: _react.PropTypes.bool,
/** Shorthand for Icon. */
icon: _lib.customPropTypes.itemShorthand,
/** A step can be link. */
link: _react.PropTypes.bool,
/** Render as an `a` tag instead of a `div` and adds the href attribute. */
href: _react.PropTypes.string,
/**
* Called on click. When passed, the component will render as an `a`
* tag by default instead of a `div`.
*
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All props.
*/
onClick: _react.PropTypes.func,
/** A step can show a ordered sequence of steps. Passed from StepGroup. */
ordered: _react.PropTypes.bool,
/** Shorthand for StepTitle. */
title: _lib.customPropTypes.itemShorthand
};
Step._meta = {
name: 'Step',
type: _lib.META.TYPES.ELEMENT
};
Step.Content = _StepContent2.default;
Step.Description = _StepDescription2.default;
Step.Group = _StepGroup2.default;
Step.Title = _StepTitle2.default;
exports.default = Step;
/***/ },
/* 987 */
/*!************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/elements/Step/StepContent.js ***!
\************************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
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__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _StepDescription = __webpack_require__(/*! ./StepDescription */ 988);
var _StepDescription2 = _interopRequireDefault(_StepDescription);
var _StepTitle = __webpack_require__(/*! ./StepTitle */ 989);
var _StepTitle2 = _interopRequireDefault(_StepTitle);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function StepContent(props) {
var children = props.children,
className = props.className,
description = props.description,
title = props.title;
var classes = (0, _classnames2.default)(className, 'content');
var rest = (0, _lib.getUnhandledProps)(StepContent, props);
var ElementType = (0, _lib.getElementType)(StepContent, props);
if (!(0, _isNil3.default)(children)) {
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
(0, _lib.createShorthand)(_StepTitle2.default, function (val) {
return { title: val };
}, title),
(0, _lib.createShorthand)(_StepDescription2.default, function (val) {
return { description: val };
}, description)
);
}
StepContent._meta = {
name: 'StepContent',
parent: 'Step',
type: _lib.META.TYPES.ELEMENT
};
StepContent.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Additional classes. */
className: _react.PropTypes.string,
/** Primary content. */
children: _react.PropTypes.node,
/** Shorthand for StepDescription. */
description: _lib.customPropTypes.itemShorthand,
/** Shorthand for StepTitle. */
title: _lib.customPropTypes.itemShorthand
};
exports.default = StepContent;
/***/ },
/* 988 */
/*!****************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/elements/Step/StepDescription.js ***!
\****************************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function StepDescription(props) {
var children = props.children,
className = props.className,
description = props.description;
var classes = (0, _classnames2.default)(className, 'description');
var rest = (0, _lib.getUnhandledProps)(StepDescription, props);
var ElementType = (0, _lib.getElementType)(StepDescription, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
(0, _isNil3.default)(children) ? description : children
);
}
StepDescription._meta = {
name: 'StepDescription',
parent: 'Step',
type: _lib.META.TYPES.ELEMENT
};
StepDescription.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Additional classes. */
className: _react.PropTypes.string,
/** Primary content. */
children: _react.PropTypes.node,
/** Shorthand for primary content. */
description: _lib.customPropTypes.contentShorthand
};
exports.default = StepDescription;
/***/ },
/* 989 */
/*!**********************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/elements/Step/StepTitle.js ***!
\**********************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function StepTitle(props) {
var children = props.children,
className = props.className,
title = props.title;
var classes = (0, _classnames2.default)(className, 'title');
var rest = (0, _lib.getUnhandledProps)(StepTitle, props);
var ElementType = (0, _lib.getElementType)(StepTitle, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
(0, _isNil3.default)(children) ? title : children
);
}
StepTitle._meta = {
name: 'StepTitle',
parent: 'Step',
type: _lib.META.TYPES.ELEMENT
};
StepTitle.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Additional classes. */
className: _react.PropTypes.string,
/** Primary content. */
children: _react.PropTypes.node,
/** Shorthand for primary content. */
title: _lib.customPropTypes.contentShorthand
};
exports.default = StepTitle;
/***/ },
/* 990 */
/*!**********************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/elements/Step/StepGroup.js ***!
\**********************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _without2 = __webpack_require__(/*! lodash/without */ 846);
var _without3 = _interopRequireDefault(_without2);
var _map2 = __webpack_require__(/*! lodash/map */ 825);
var _map3 = _interopRequireDefault(_map2);
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _Step = __webpack_require__(/*! ./Step */ 986);
var _Step2 = _interopRequireDefault(_Step);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function StepGroup(props) {
var children = props.children,
className = props.className,
fluid = props.fluid,
items = props.items,
ordered = props.ordered,
size = props.size,
stackable = props.stackable,
vertical = props.vertical;
var classes = (0, _classnames2.default)('ui', (0, _lib.useKeyOnly)(fluid, 'fluid'), (0, _lib.useKeyOnly)(ordered, 'ordered'), (0, _lib.useValueAndKey)(stackable, 'stackable'), (0, _lib.useKeyOnly)(vertical, 'vertical'), size, className, 'steps');
var rest = (0, _lib.getUnhandledProps)(StepGroup, props);
var ElementType = (0, _lib.getElementType)(StepGroup, props);
if (!(0, _isNil3.default)(children)) {
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
var content = (0, _map3.default)(items, function (item) {
var key = item.key || [item.title, item.description].join('-');
return _react2.default.createElement(_Step2.default, _extends({ key: key }, item));
});
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
content
);
}
StepGroup._meta = {
name: 'StepGroup',
parent: 'Step',
props: {
sizes: (0, _without3.default)(_lib.SUI.SIZES, 'medium'),
stackable: ['tablet']
},
type: _lib.META.TYPES.ELEMENT
};
StepGroup.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Additional classes. */
className: _react.PropTypes.string,
/** Primary content. */
children: _react.PropTypes.node,
/** A fluid step takes up the width of its container. */
fluid: _react.PropTypes.bool,
/** Shorthand array of props for Step. */
items: _lib.customPropTypes.collectionShorthand,
/** A step can show a ordered sequence of steps. */
ordered: _react.PropTypes.bool,
/** Steps can have different sizes. */
size: _react.PropTypes.oneOf(StepGroup._meta.props.sizes),
/** A step can stack vertically only on smaller screens. */
stackable: _react.PropTypes.oneOf(StepGroup._meta.props.stackable),
/** A step can be displayed stacked vertically. */
vertical: _react.PropTypes.bool
};
exports.default = StepGroup;
/***/ },
/* 991 */
/*!**************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/modules/Accordion/Accordion.js ***!
\**************************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _keys2 = __webpack_require__(/*! lodash/keys */ 634);
var _keys3 = _interopRequireDefault(_keys2);
var _omit2 = __webpack_require__(/*! lodash/omit */ 867);
var _omit3 = _interopRequireDefault(_omit2);
var _each2 = __webpack_require__(/*! lodash/each */ 689);
var _each3 = _interopRequireDefault(_each2);
var _has2 = __webpack_require__(/*! lodash/has */ 535);
var _has3 = _interopRequireDefault(_has2);
var _without2 = __webpack_require__(/*! lodash/without */ 846);
var _without3 = _interopRequireDefault(_without2);
var _includes2 = __webpack_require__(/*! lodash/includes */ 830);
var _includes3 = _interopRequireDefault(_includes2);
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 _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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _Icon = __webpack_require__(/*! ../../elements/Icon */ 874);
var _Icon2 = _interopRequireDefault(_Icon);
var _AccordionContent = __webpack_require__(/*! ./AccordionContent */ 992);
var _AccordionContent2 = _interopRequireDefault(_AccordionContent);
var _AccordionTitle = __webpack_require__(/*! ./AccordionTitle */ 993);
var _AccordionTitle2 = _interopRequireDefault(_AccordionTitle);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
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; }
/**
* An accordion allows users to toggle the display of sections of content
*/
var Accordion = function (_Component) {
_inherits(Accordion, _Component);
function Accordion() {
var _ref;
_classCallCheck(this, Accordion);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
var _this = _possibleConstructorReturn(this, (_ref = Accordion.__proto__ || Object.getPrototypeOf(Accordion)).call.apply(_ref, [this].concat(args)));
_this.state = {};
_this.handleTitleClick = function (e, index) {
var _this$props = _this.props,
onTitleClick = _this$props.onTitleClick,
exclusive = _this$props.exclusive;
var activeIndex = _this.state.activeIndex;
var newIndex = void 0;
if (exclusive) {
newIndex = index === activeIndex ? -1 : index;
} else {
// check to see if index is in array, and remove it, if not then add it
newIndex = (0, _includes3.default)(activeIndex, index) ? (0, _without3.default)(activeIndex, index) : [].concat(_toConsumableArray(activeIndex), [index]);
}
_this.trySetState({ activeIndex: newIndex });
if (onTitleClick) onTitleClick(e, index);
};
_this.isIndexActive = function (index) {
var exclusive = _this.props.exclusive;
var activeIndex = _this.state.activeIndex;
return exclusive ? activeIndex === index : (0, _includes3.default)(activeIndex, index);
};
_this.renderChildren = function () {
var children = _this.props.children;
var titleIndex = 0;
var contentIndex = 0;
return _react.Children.map(children, function (child) {
var isTitle = child.type === _AccordionTitle2.default;
var isContent = child.type === _AccordionContent2.default;
if (isTitle) {
var _ret = function () {
var currentIndex = titleIndex;
var isActive = (0, _has3.default)(child, 'props.active') ? child.props.active : _this.isIndexActive(titleIndex);
var onClick = function onClick(e) {
_this.handleTitleClick(e, currentIndex);
if (child.props.onClick) child.props.onClick(e, currentIndex);
};
titleIndex++;
return {
v: (0, _react.cloneElement)(child, _extends({}, child.props, { active: isActive, onClick: onClick }))
};
}();
if ((typeof _ret === 'undefined' ? 'undefined' : _typeof(_ret)) === "object") return _ret.v;
}
if (isContent) {
var _isActive = (0, _has3.default)(child, 'props.active') ? child.props.active : _this.isIndexActive(contentIndex);
contentIndex++;
return (0, _react.cloneElement)(child, _extends({}, child.props, { active: _isActive }));
}
return child;
});
};
_this.renderPanels = function () {
var panels = _this.props.panels;
var children = [];
(0, _each3.default)(panels, function (panel, i) {
var isActive = (0, _has3.default)(panel, 'active') ? panel.active : _this.isIndexActive(i);
var onClick = function onClick(e) {
_this.handleTitleClick(e, i);
if (panel.onClick) panel.onClick(e, i);
};
children.push(_react2.default.createElement(
_AccordionTitle2.default,
{ key: panel.title + '-title', active: isActive, onClick: onClick },
_react2.default.createElement(_Icon2.default, { name: 'dropdown' }),
panel.title
));
children.push(_react2.default.createElement(
_AccordionContent2.default,
{ key: panel.title + '-content', active: isActive },
panel.content
));
});
return children;
};
_this.state = {
activeIndex: _this.props.exclusive ? -1 : [-1]
};
return _this;
}
_createClass(Accordion, [{
key: 'render',
value: function render() {
var _props = this.props,
className = _props.className,
fluid = _props.fluid,
inverted = _props.inverted,
panels = _props.panels,
styled = _props.styled;
var classes = (0, _classnames2.default)('ui', (0, _lib.useKeyOnly)(fluid, 'fluid'), (0, _lib.useKeyOnly)(inverted, 'inverted'), (0, _lib.useKeyOnly)(styled, 'styled'), 'accordion', className);
var rest = (0, _omit3.default)(this.props, (0, _keys3.default)(Accordion.propTypes));
var ElementType = (0, _lib.getElementType)(Accordion, this.props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
panels ? this.renderPanels() : this.renderChildren()
);
}
}]);
return Accordion;
}(_lib.AutoControlledComponent);
Accordion.defaultProps = {
exclusive: true
};
Accordion.autoControlledProps = ['activeIndex'];
Accordion.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Index of the currently active panel. */
activeIndex: _react.PropTypes.oneOfType([_react.PropTypes.number, _react.PropTypes.arrayOf(_react.PropTypes.number)]),
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** Initial activeIndex value. */
defaultActiveIndex: _react.PropTypes.oneOfType([_react.PropTypes.number, _react.PropTypes.arrayOf(_react.PropTypes.number)]),
/** Only allow one panel open at a time */
exclusive: _react.PropTypes.bool,
/** Format to take up the width of it's container. */
fluid: _react.PropTypes.bool,
/** Format for dark backgrounds. */
inverted: _react.PropTypes.bool,
/** Called with (event, index) when a panel title is clicked. */
onTitleClick: _react.PropTypes.func,
/**
* Create simple accordion panels from an array of { text: <string>, content: <custom> } objects.
* Object can optionally define an `active` key to open/close the panel.
* Mutually exclusive with children.
* TODO: AccordionPanel should be a sub-component
*/
panels: _lib.customPropTypes.every([_lib.customPropTypes.disallow(['children']), _react.PropTypes.arrayOf(_react.PropTypes.shape({
active: _react.PropTypes.bool,
title: _react.PropTypes.string,
content: _lib.customPropTypes.contentShorthand,
onClick: _react.PropTypes.func
}))]),
/** Adds some basic styling to accordion panels. */
styled: _react.PropTypes.bool
};
Accordion._meta = {
name: 'Accordion',
type: _lib.META.TYPES.MODULE
};
Accordion.Content = _AccordionContent2.default;
Accordion.Title = _AccordionTitle2.default;
exports.default = Accordion;
/***/ },
/* 992 */
/*!*********************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/modules/Accordion/AccordionContent.js ***!
\*********************************************************************************/
/***/ 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__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function AccordionContent(props) {
var active = props.active,
children = props.children,
className = props.className;
var classes = (0, _classnames2.default)('content', (0, _lib.useKeyOnly)(active, 'active'), className);
var rest = (0, _lib.getUnhandledProps)(AccordionContent, props);
var ElementType = (0, _lib.getElementType)(AccordionContent, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
AccordionContent.displayName = 'AccordionContent';
AccordionContent.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Whether or not the content is visible. */
active: _react.PropTypes.bool,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string
};
AccordionContent._meta = {
name: 'AccordionContent',
type: _lib.META.TYPES.MODULE,
parent: 'Accordion'
};
exports.default = AccordionContent;
/***/ },
/* 993 */
/*!*******************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/modules/Accordion/AccordionTitle.js ***!
\*******************************************************************************/
/***/ 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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
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; }
/**
* A title sub-component for Accordion component
*/
var AccordionTitle = function (_Component) {
_inherits(AccordionTitle, _Component);
function AccordionTitle() {
var _ref;
var _temp, _this, _ret;
_classCallCheck(this, AccordionTitle);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = AccordionTitle.__proto__ || Object.getPrototypeOf(AccordionTitle)).call.apply(_ref, [this].concat(args))), _this), _this.handleClick = function (e) {
var onClick = _this.props.onClick;
if (onClick) onClick(e, _this.props);
}, _temp), _possibleConstructorReturn(_this, _ret);
}
_createClass(AccordionTitle, [{
key: 'render',
value: function render() {
var _props = this.props,
active = _props.active,
children = _props.children,
className = _props.className;
var classes = (0, _classnames2.default)((0, _lib.useKeyOnly)(active, 'active'), 'title', className);
var rest = (0, _lib.getUnhandledProps)(AccordionTitle, this.props);
var ElementType = (0, _lib.getElementType)(AccordionTitle, this.props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes, onClick: this.handleClick }),
children
);
}
}]);
return AccordionTitle;
}(_react.Component);
AccordionTitle.displayName = 'AccordionTitle';
AccordionTitle.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Whether or not the title is in the open state. */
active: _react.PropTypes.bool,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/**
* Called on blur.
*
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All props.
*/
onClick: _react.PropTypes.func
};
AccordionTitle._meta = {
name: 'AccordionTitle',
type: _lib.META.TYPES.MODULE,
parent: 'Accordion'
};
exports.default = AccordionTitle;
/***/ },
/* 994 */
/*!******************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/modules/Embed/index.js ***!
\******************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _Embed = __webpack_require__(/*! ./Embed */ 995);
var _Embed2 = _interopRequireDefault(_Embed);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = _Embed2.default;
/***/ },
/* 995 */
/*!******************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/modules/Embed/Embed.js ***!
\******************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _Icon = __webpack_require__(/*! ../../elements/Icon */ 874);
var _Icon2 = _interopRequireDefault(_Icon);
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 _meta = {
name: 'Embed',
type: _lib.META.TYPES.MODULE,
props: {
aspectRatio: ['4:3', '16:9', '21:9'],
source: ['youtube', 'vimeo']
}
};
/**
* An embed displays content from other websites like YouTube videos or Google Maps.
*/
var Embed = function (_Component) {
_inherits(Embed, _Component);
function Embed() {
var _ref;
var _temp, _this, _ret;
_classCallCheck(this, Embed);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Embed.__proto__ || Object.getPrototypeOf(Embed)).call.apply(_ref, [this].concat(args))), _this), _this.state = {}, _this.handleClick = function (e) {
var onClick = _this.props.onClick;
var active = _this.state.active;
if (onClick) onClick(e, _extends({}, _this.props, { active: true }));
if (!active) _this.trySetState({ active: true });
}, _temp), _possibleConstructorReturn(_this, _ret);
}
_createClass(Embed, [{
key: 'getSrc',
value: function getSrc() {
var _props = this.props,
_props$autoplay = _props.autoplay,
autoplay = _props$autoplay === undefined ? true : _props$autoplay,
_props$brandedUI = _props.brandedUI,
brandedUI = _props$brandedUI === undefined ? false : _props$brandedUI,
_props$color = _props.color,
color = _props$color === undefined ? '#444444' : _props$color,
_props$hd = _props.hd,
hd = _props$hd === undefined ? true : _props$hd,
id = _props.id,
source = _props.source,
url = _props.url;
if (source === 'youtube') {
return ['//www.youtube.com/embed/' + id, '?autohide=true', '&autoplay=' + autoplay, '&color=' + encodeURIComponent(color), '&hq=' + hd, '&jsapi=false', '&modestbranding=' + brandedUI].join('');
}
if (source === 'vimeo') {
return ['//player.vimeo.com/video/' + id, '?api=false', '&autoplay=' + autoplay, '&byline=false', '&color=' + encodeURIComponent(color), '&portrait=false', '&title=false'].join('');
}
return url;
}
}, {
key: 'render',
value: function render() {
var _props2 = this.props,
aspectRatio = _props2.aspectRatio,
className = _props2.className,
icon = _props2.icon,
placeholder = _props2.placeholder;
var active = this.state.active;
var classes = (0, _classnames2.default)('ui', aspectRatio, (0, _lib.useKeyOnly)(active, 'active'), 'embed', className);
var rest = (0, _lib.getUnhandledProps)(Embed, this.props);
var ElementType = (0, _lib.getElementType)(Embed, this.props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes, onClick: this.handleClick }),
_Icon2.default.create(icon),
placeholder && _react2.default.createElement('img', { className: 'placeholder', src: placeholder }),
this.renderEmbed()
);
}
}, {
key: 'renderEmbed',
value: function renderEmbed() {
var children = this.props.children;
var active = this.state.active;
if (!active) return null;
if (!(0, _isNil3.default)(children)) return _react2.default.createElement(
'div',
{ className: 'embed' },
children
);
return _react2.default.createElement(
'div',
{ className: 'embed' },
_react2.default.createElement('iframe', {
allowFullScreen: '',
frameBorder: '0',
height: '100%',
scrolling: 'no',
src: this.getSrc(),
width: '100%'
})
);
}
}]);
return Embed;
}(_lib.AutoControlledComponent);
Embed.autoControlledProps = ['active'];
Embed.defaultProps = {
icon: 'video play'
};
Embed._meta = _meta;
Embed.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** An embed can be active. */
active: _react.PropTypes.bool,
/** Setting to true or false will force autoplay. */
autoplay: _lib.customPropTypes.every([_lib.customPropTypes.demand(['source']), _react.PropTypes.bool]),
/** An embed can specify an alternative aspect ratio. */
aspectRatio: _react.PropTypes.oneOf(_meta.props.aspectRatio),
/** Whether to show networks branded UI like title cards, or after video calls to action. */
brandedUI: _lib.customPropTypes.every([_lib.customPropTypes.demand(['source']), _react.PropTypes.bool]),
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** Specifies a default chrome color with Vimeo or YouTube. */
color: _lib.customPropTypes.every([_lib.customPropTypes.demand(['source']), _react.PropTypes.string]),
/** Initial value of active. */
defaultActive: _react.PropTypes.bool,
/** Whether to show networks branded UI like title cards, or after video calls to action. */
hd: _lib.customPropTypes.every([_lib.customPropTypes.demand(['source']), _react.PropTypes.bool]),
/** Specifies an id for source. */
id: _lib.customPropTypes.every([_lib.customPropTypes.demand(['source']), _react.PropTypes.string]),
/** Specifies an icon to use with placeholder content. */
icon: _lib.customPropTypes.itemShorthand,
/**
* Сalled on click.
*
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All props and proposed value.
*/
onClick: _react.PropTypes.func,
/** A placeholder image for embed. */
placeholder: _react.PropTypes.string,
/** Specifies a source to use. */
source: _lib.customPropTypes.every([_lib.customPropTypes.disallow(['sourceUrl']), _react.PropTypes.oneOf(_meta.props.source)]),
/** Specifies a url to use for embed. */
url: _lib.customPropTypes.every([_lib.customPropTypes.disallow(['source']), _react.PropTypes.string])
};
exports.default = Embed;
/***/ },
/* 996 */
/*!******************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/modules/Popup/index.js ***!
\******************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _Popup = __webpack_require__(/*! ./Popup */ 997);
var _Popup2 = _interopRequireDefault(_Popup);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = _Popup2.default;
/***/ },
/* 997 */
/*!******************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/modules/Popup/Popup.js ***!
\******************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _pick2 = __webpack_require__(/*! lodash/pick */ 798);
var _pick3 = _interopRequireDefault(_pick2);
var _omit2 = __webpack_require__(/*! lodash/omit */ 867);
var _omit3 = _interopRequireDefault(_omit2);
var _keys2 = __webpack_require__(/*! lodash/keys */ 634);
var _keys3 = _interopRequireDefault(_keys2);
var _assign2 = __webpack_require__(/*! lodash/assign */ 998);
var _assign3 = _interopRequireDefault(_assign2);
var _mapValues2 = __webpack_require__(/*! lodash/mapValues */ 1000);
var _mapValues3 = _interopRequireDefault(_mapValues2);
var _isNumber2 = __webpack_require__(/*! lodash/isNumber */ 701);
var _isNumber3 = _interopRequireDefault(_isNumber2);
var _includes2 = __webpack_require__(/*! lodash/includes */ 830);
var _includes3 = _interopRequireDefault(_includes2);
var _without2 = __webpack_require__(/*! lodash/without */ 846);
var _without3 = _interopRequireDefault(_without2);
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__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _Portal = __webpack_require__(/*! ../../addons/Portal */ 852);
var _Portal2 = _interopRequireDefault(_Portal);
var _PopupContent = __webpack_require__(/*! ./PopupContent */ 1001);
var _PopupContent2 = _interopRequireDefault(_PopupContent);
var _PopupHeader = __webpack_require__(/*! ./PopupHeader */ 1002);
var _PopupHeader2 = _interopRequireDefault(_PopupHeader);
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 debug = (0, _lib.makeDebugger)('popup');
var _meta = {
name: 'Popup',
type: _lib.META.TYPES.MODULE,
props: {
on: ['hover', 'click', 'focus'],
positioning: ['top left', 'top right', 'bottom right', 'bottom left', 'right center', 'left center', 'top center', 'bottom center'],
size: (0, _without3.default)(_lib.SUI.SIZES, 'medium', 'big', 'massive'),
wide: [true, false, 'very']
}
};
/**
* A Popup displays additional information on top of a page.
*/
var Popup = function (_Component) {
_inherits(Popup, _Component);
function Popup() {
var _ref;
var _temp, _this, _ret;
_classCallCheck(this, Popup);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Popup.__proto__ || Object.getPrototypeOf(Popup)).call.apply(_ref, [this].concat(args))), _this), _this.state = {}, _this.hideOnScroll = function (e) {
_this.setState({ closed: true });
window.removeEventListener('scroll', _this.hideOnScroll);
setTimeout(function () {
return _this.setState({ closed: false });
}, 50);
}, _this.handleClose = function (e) {
debug('handleClose()');
var onClose = _this.props.onClose;
if (onClose) onClose(e, _this.props);
}, _this.handleOpen = function (e) {
debug('handleOpen()');
_this.coords = e.currentTarget.getBoundingClientRect();
var onOpen = _this.props.onOpen;
if (onOpen) onOpen(e, _this.props);
}, _this.handlePortalMount = function (e) {
debug('handlePortalMount()');
if (_this.props.hideOnScroll) {
window.addEventListener('scroll', _this.hideOnScroll);
}
var onMount = _this.props.onMount;
if (onMount) onMount(e, _this.props);
}, _this.handlePortalUnmount = function (e) {
debug('handlePortalUnmount()');
var onUnmount = _this.props.onUnmount;
if (onUnmount) onUnmount(e, _this.props);
}, _this.popupMounted = function (ref) {
debug('popupMounted()');
_this.popupCoords = ref ? ref.getBoundingClientRect() : null;
_this.setPopupStyle();
}, _temp), _possibleConstructorReturn(_this, _ret);
}
_createClass(Popup, [{
key: 'computePopupStyle',
value: function computePopupStyle(positions) {
var style = { position: 'absolute' };
// Do not access window/document when server side rendering
if (!_lib.isBrowser) return style;
var offset = this.props.offset;
var _window = window,
pageYOffset = _window.pageYOffset,
pageXOffset = _window.pageXOffset;
var _document$documentEle = document.documentElement,
clientWidth = _document$documentEle.clientWidth,
clientHeight = _document$documentEle.clientHeight;
if ((0, _includes3.default)(positions, 'right')) {
style.right = Math.round(clientWidth - (this.coords.right + pageXOffset));
style.left = 'auto';
} else if ((0, _includes3.default)(positions, 'left')) {
style.left = Math.round(this.coords.left + pageXOffset);
style.right = 'auto';
} else {
// if not left nor right, we are horizontally centering the element
var xOffset = (this.coords.width - this.popupCoords.width) / 2;
style.left = Math.round(this.coords.left + xOffset + pageXOffset);
style.right = 'auto';
}
if ((0, _includes3.default)(positions, 'top')) {
style.bottom = Math.round(clientHeight - (this.coords.top + pageYOffset));
style.top = 'auto';
} else if ((0, _includes3.default)(positions, 'bottom')) {
style.top = Math.round(this.coords.bottom + pageYOffset);
style.bottom = 'auto';
} else {
// if not top nor bottom, we are vertically centering the element
var yOffset = (this.coords.height + this.popupCoords.height) / 2;
style.top = Math.round(this.coords.bottom + pageYOffset - yOffset);
style.bottom = 'auto';
var _xOffset = this.popupCoords.width + 8;
if ((0, _includes3.default)(positions, 'right')) {
style.right -= _xOffset;
} else {
style.left -= _xOffset;
}
}
if (offset) {
if ((0, _isNumber3.default)(style.right)) {
style.right -= offset;
} else {
style.left -= offset;
}
}
return style;
}
// check if the style would display
// the popup outside of the view port
}, {
key: 'isStyleInViewport',
value: function isStyleInViewport(style) {
var _window2 = window,
pageYOffset = _window2.pageYOffset,
pageXOffset = _window2.pageXOffset;
var _document$documentEle2 = document.documentElement,
clientWidth = _document$documentEle2.clientWidth,
clientHeight = _document$documentEle2.clientHeight;
var element = {
top: style.top,
left: style.left,
width: this.popupCoords.width,
height: this.popupCoords.height
};
if ((0, _isNumber3.default)(style.right)) {
element.left = clientWidth - style.right - element.width;
}
if ((0, _isNumber3.default)(style.bottom)) {
element.top = clientHeight - style.bottom - element.height;
}
// hidden on top
if (element.top < pageYOffset) return false;
// hidden on the bottom
if (element.top + element.height > pageYOffset + clientHeight) return false;
// hidden the left
if (element.left < pageXOffset) return false;
// hidden on the right
if (element.left + element.width > pageXOffset + clientWidth) return false;
return true;
}
}, {
key: 'setPopupStyle',
value: function setPopupStyle() {
if (!this.coords || !this.popupCoords) return;
var positioning = this.props.positioning;
var style = this.computePopupStyle(positioning);
// Lets detect if the popup is out of the viewport and adjust
// the position accordingly
var positions = (0, _without3.default)(_meta.props.positioning, positioning);
for (var i = 0; !this.isStyleInViewport(style) && i < positions.length; i++) {
style = this.computePopupStyle(positions[i]);
positioning = positions[i];
}
// Append 'px' to every numerical values in the style
style = (0, _mapValues3.default)(style, function (value) {
return (0, _isNumber3.default)(value) ? value + 'px' : value;
});
this.setState({ style: style, positioning: positioning });
}
}, {
key: 'getPortalProps',
value: function getPortalProps() {
var portalProps = {};
var _props = this.props,
on = _props.on,
hoverable = _props.hoverable;
if (hoverable) {
portalProps.closeOnPortalMouseLeave = true;
portalProps.mouseLeaveDelay = 300;
}
if (on === 'click') {
portalProps.openOnTriggerClick = true;
portalProps.closeOnTriggerClick = true;
portalProps.closeOnDocumentClick = true;
} else if (on === 'focus') {
portalProps.openOnTriggerFocus = true;
portalProps.closeOnTriggerBlur = true;
} else if (on === 'hover') {
portalProps.openOnTriggerMouseEnter = true;
portalProps.closeOnTriggerMouseLeave = true;
// Taken from SUI: https://git.io/vPmCm
portalProps.mouseLeaveDelay = 70;
portalProps.mouseEnterDelay = 50;
}
return portalProps;
}
}, {
key: 'render',
value: function render() {
var _props2 = this.props,
basic = _props2.basic,
children = _props2.children,
className = _props2.className,
content = _props2.content,
flowing = _props2.flowing,
header = _props2.header,
inverted = _props2.inverted,
size = _props2.size,
trigger = _props2.trigger,
wide = _props2.wide;
var _state = this.state,
positioning = _state.positioning,
closed = _state.closed;
var style = (0, _assign3.default)({}, this.state.style, this.props.style);
var classes = (0, _classnames2.default)('ui', positioning, size, (0, _lib.useKeyOrValueAndKey)(wide, 'wide'), (0, _lib.useKeyOnly)(basic, 'basic'), (0, _lib.useKeyOnly)(flowing, 'flowing'), (0, _lib.useKeyOnly)(inverted, 'inverted'), 'popup transition visible', className);
if (closed) return trigger;
var unhandled = (0, _lib.getUnhandledProps)(Popup, this.props);
var portalPropNames = (0, _keys3.default)(_Portal2.default.propTypes);
var rest = (0, _omit3.default)(unhandled, portalPropNames);
var portalProps = (0, _pick3.default)(unhandled, portalPropNames);
var ElementType = (0, _lib.getElementType)(Popup, this.props);
var popupJSX = _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes, style: style, ref: this.popupMounted }),
children,
!children && _PopupHeader2.default.create(header),
!children && _PopupContent2.default.create(content)
);
var mergedPortalProps = _extends({}, this.getPortalProps(), portalProps);
debug('portal props:', mergedPortalProps);
return _react2.default.createElement(
_Portal2.default,
_extends({}, mergedPortalProps, {
trigger: trigger,
onClose: this.handleClose,
onMount: this.handlePortalMount,
onOpen: this.handleOpen,
onUnmount: this.handlePortalUnmount
}),
popupJSX
);
}
}]);
return Popup;
}(_react.Component);
Popup.propTypes = {
/** Display the popup without the pointing arrow */
basic: _react.PropTypes.bool,
/** You may pass a content as children of the Popup */
children: _react.PropTypes.node,
/** Classes to add to the Popup className. */
className: _react.PropTypes.string,
/** Simple text content for the popover */
content: _react.PropTypes.node,
/** A Flowing popup have no maximum width and continue to flow to fit its content */
flowing: _react.PropTypes.bool,
/** Takes up the entire width of its offset container */
// TODO: implement the Popup fluid layout
// fluid: PropTypes.bool,
/** Header displayed above the content in bold */
header: _react.PropTypes.string,
/** Whether the popup should not close on hover */
hoverable: _react.PropTypes.bool,
/** Invert the colors of the popup */
inverted: _react.PropTypes.bool,
/** The node where the popup should mount.. */
hideOnScroll: _react.PropTypes.bool,
/** Horizontal offset in pixels to be applied to the popup */
offset: _react.PropTypes.number,
/** Event triggering the popup */
on: _react.PropTypes.oneOf(_meta.props.on),
/**
* Called when a close event happens
*
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All props.
*/
onClose: _react.PropTypes.func,
/**
* Called when the portal is mounted on the DOM
*
* @param {null}
* @param {object} data - All props.
*/
onMount: _react.PropTypes.func,
/**
* Called when an open event happens
*
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All props.
*/
onOpen: _react.PropTypes.func,
/**
* Called when the portal is unmounted from the DOM
*
* @param {null}
* @param {object} data - All props.
*/
onUnmount: _react.PropTypes.func,
/** Positioning for the popover */
positioning: _react.PropTypes.oneOf(_meta.props.positioning),
/** Popup size */
size: _react.PropTypes.oneOf(_meta.props.size),
/** custom popup style */
style: _react.PropTypes.object,
/** Element to be rendered in-place where the popup is defined. */
trigger: _react.PropTypes.node,
/** Popup width */
wide: _react.PropTypes.oneOf(_meta.props.wide)
};
Popup.defaultProps = {
positioning: 'top left',
on: 'hover'
};
Popup._meta = _meta;
Popup.Content = _PopupContent2.default;
Popup.Header = _PopupHeader2.default;
exports.default = Popup;
/***/ },
/* 998 */
/*!************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/assign.js ***!
\************************************************/
/***/ function(module, exports, __webpack_require__) {
var assignValue = __webpack_require__(/*! ./_assignValue */ 764),
copyObject = __webpack_require__(/*! ./_copyObject */ 763),
createAssigner = __webpack_require__(/*! ./_createAssigner */ 999),
isArrayLike = __webpack_require__(/*! ./isArrayLike */ 620),
isPrototype = __webpack_require__(/*! ./_isPrototype */ 643),
keys = __webpack_require__(/*! ./keys */ 634);
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Assigns own enumerable string keyed properties of source objects to the
* destination object. Source objects are applied from left to right.
* Subsequent sources overwrite property assignments of previous sources.
*
* **Note:** This method mutates `object` and is loosely based on
* [`Object.assign`](https://mdn.io/Object/assign).
*
* @static
* @memberOf _
* @since 0.10.0
* @category Object
* @param {Object} object The destination object.
* @param {...Object} [sources] The source objects.
* @returns {Object} Returns `object`.
* @see _.assignIn
* @example
*
* function Foo() {
* this.a = 1;
* }
*
* function Bar() {
* this.c = 3;
* }
*
* Foo.prototype.b = 2;
* Bar.prototype.d = 4;
*
* _.assign({ 'a': 0 }, new Foo, new Bar);
* // => { 'a': 1, 'c': 3 }
*/
var assign = createAssigner(function(object, source) {
if (isPrototype(source) || isArrayLike(source)) {
copyObject(source, keys(source), object);
return;
}
for (var key in source) {
if (hasOwnProperty.call(source, key)) {
assignValue(object, key, source[key]);
}
}
});
module.exports = assign;
/***/ },
/* 999 */
/*!*********************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_createAssigner.js ***!
\*********************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseRest = __webpack_require__(/*! ./_baseRest */ 610),
isIterateeCall = __webpack_require__(/*! ./_isIterateeCall */ 721);
/**
* Creates a function like `_.assign`.
*
* @private
* @param {Function} assigner The function to assign values.
* @returns {Function} Returns the new assigner function.
*/
function createAssigner(assigner) {
return baseRest(function(object, sources) {
var index = -1,
length = sources.length,
customizer = length > 1 ? sources[length - 1] : undefined,
guard = length > 2 ? sources[2] : undefined;
customizer = (assigner.length > 3 && typeof customizer == 'function')
? (length--, customizer)
: undefined;
if (guard && isIterateeCall(sources[0], sources[1], guard)) {
customizer = length < 3 ? undefined : customizer;
length = 1;
}
object = Object(object);
while (++index < length) {
var source = sources[index];
if (source) {
assigner(object, source, index, customizer);
}
}
return object;
});
}
module.exports = createAssigner;
/***/ },
/* 1000 */
/*!***************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/mapValues.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseAssignValue = __webpack_require__(/*! ./_baseAssignValue */ 765),
baseForOwn = __webpack_require__(/*! ./_baseForOwn */ 631),
baseIteratee = __webpack_require__(/*! ./_baseIteratee */ 647);
/**
* Creates an object with the same keys as `object` and values generated
* by running each own enumerable string keyed property of `object` thru
* `iteratee`. The iteratee is invoked with three arguments:
* (value, key, object).
*
* @static
* @memberOf _
* @since 2.4.0
* @category Object
* @param {Object} object The object to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @returns {Object} Returns the new mapped object.
* @see _.mapKeys
* @example
*
* var users = {
* 'fred': { 'user': 'fred', 'age': 40 },
* 'pebbles': { 'user': 'pebbles', 'age': 1 }
* };
*
* _.mapValues(users, function(o) { return o.age; });
* // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
*
* // The `_.property` iteratee shorthand.
* _.mapValues(users, 'age');
* // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
*/
function mapValues(object, iteratee) {
var result = {};
iteratee = baseIteratee(iteratee, 3);
baseForOwn(object, function(value, key, object) {
baseAssignValue(result, key, iteratee(value, key, object));
});
return result;
}
module.exports = mapValues;
/***/ },
/* 1001 */
/*!*************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/modules/Popup/PopupContent.js ***!
\*************************************************************************/
/***/ 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; };
exports.default = PopupContent;
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* A PopupContent displays the content body of a Popover.
*/
function PopupContent(props) {
var children = props.children,
className = props.className;
var classes = (0, _classnames2.default)('content', className);
var rest = (0, _lib.getUnhandledProps)(PopupContent, props);
var ElementType = (0, _lib.getElementType)(PopupContent, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
PopupContent.create = (0, _lib.createShorthandFactory)(PopupContent, function (value) {
return { children: value };
});
PopupContent.propTypes = {
/** The content of the Popup */
children: _react.PropTypes.node,
/** Classes to add to the Popup content className. */
className: _react.PropTypes.string
};
PopupContent._meta = {
name: 'PopupContent',
type: _lib.META.TYPES.MODULE,
parent: 'Popup'
};
/***/ },
/* 1002 */
/*!************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/modules/Popup/PopupHeader.js ***!
\************************************************************************/
/***/ 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; };
exports.default = PopupHeader;
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* A PopupHeader displays a header in a Popover.
*/
function PopupHeader(props) {
var children = props.children,
className = props.className;
var classes = (0, _classnames2.default)('header', className);
var rest = (0, _lib.getUnhandledProps)(PopupHeader, props);
var ElementType = (0, _lib.getElementType)(PopupHeader, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
PopupHeader.create = (0, _lib.createShorthandFactory)(PopupHeader, function (value) {
return { children: value };
});
PopupHeader.propTypes = {
/** The header of the Popup */
children: _react.PropTypes.node,
/** Classes to add to the Popup header className. */
className: _react.PropTypes.string
};
PopupHeader._meta = {
name: 'PopupHeader',
type: _lib.META.TYPES.MODULE,
parent: 'Popup'
};
/***/ },
/* 1003 */
/*!*********************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/modules/Progress/index.js ***!
\*********************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _Progress = __webpack_require__(/*! ./Progress */ 1004);
var _Progress2 = _interopRequireDefault(_Progress);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = _Progress2.default;
/***/ },
/* 1004 */
/*!************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/modules/Progress/Progress.js ***!
\************************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _without2 = __webpack_require__(/*! lodash/without */ 846);
var _without3 = _interopRequireDefault(_without2);
var _round2 = __webpack_require__(/*! lodash/round */ 1005);
var _round3 = _interopRequireDefault(_round2);
var _clamp2 = __webpack_require__(/*! lodash/clamp */ 1007);
var _clamp3 = _interopRequireDefault(_clamp2);
var _every2 = __webpack_require__(/*! lodash/every */ 883);
var _every3 = _interopRequireDefault(_every2);
var _isUndefined2 = __webpack_require__(/*! lodash/isUndefined */ 621);
var _isUndefined3 = _interopRequireDefault(_isUndefined2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function Progress(props) {
var active = props.active,
attached = props.attached,
autoSuccess = props.autoSuccess,
color = props.color,
children = props.children,
className = props.className,
disabled = props.disabled,
error = props.error,
indicating = props.indicating,
inverted = props.inverted,
label = props.label,
percent = props.percent,
precision = props.precision,
progress = props.progress,
size = props.size,
success = props.success,
total = props.total,
value = props.value,
warning = props.warning;
var isAutoSuccess = autoSuccess && (percent >= 100 || value >= total);
var showProgress = progress || label || !(0, _isUndefined3.default)(precision) || !(0, _every3.default)([total, value], _isUndefined3.default);
var _percent = void 0;
if (!(0, _isUndefined3.default)(percent)) {
_percent = percent;
} else if (!(0, _isUndefined3.default)(total) && !(0, _isUndefined3.default)(value)) {
_percent = value / total * 100;
}
_percent = (0, _clamp3.default)(_percent, 0, 100);
if (!(0, _isUndefined3.default)(precision)) {
_percent = (0, _round3.default)(_percent, precision);
}
var progressText = void 0;
if (label === 'percent' || label === true || (0, _isUndefined3.default)(label)) {
progressText = _percent + '%';
} else if (label === 'ratio') {
progressText = value + '/' + total;
}
var classes = (0, _classnames2.default)('ui', size, color, (0, _lib.useKeyOnly)(active || indicating, 'active'), (0, _lib.useKeyOnly)(isAutoSuccess || success, 'success'), (0, _lib.useKeyOnly)(warning, 'warning'), (0, _lib.useKeyOnly)(error, 'error'), (0, _lib.useKeyOnly)(disabled, 'disabled'), (0, _lib.useKeyOnly)(indicating, 'indicating'), (0, _lib.useKeyOnly)(inverted, 'inverted'), (0, _lib.useValueAndKey)(attached, 'attached'), className, 'progress');
var rest = (0, _lib.getUnhandledProps)(Progress, props);
var ElementType = (0, _lib.getElementType)(Progress, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
_react2.default.createElement(
'div',
{ className: 'bar', style: { width: _percent + '%' } },
showProgress && _react2.default.createElement(
'div',
{ className: 'progress' },
progressText
)
),
children && _react2.default.createElement(
'div',
{ className: 'label' },
children
)
);
}
Progress._meta = {
name: 'Progress',
type: _lib.META.TYPES.MODULE,
props: {
attached: ['top', 'bottom'],
color: _lib.SUI.COLORS,
label: ['ratio', 'percent'],
size: (0, _without3.default)(_lib.SUI.SIZES, 'mini', 'huge', 'massive')
}
};
Progress.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** A progress bar can show activity. */
active: _react.PropTypes.bool,
/** A progress bar can attach to and show the progress of an element (i.e. Card or Segment). */
attached: _react.PropTypes.oneOf(Progress._meta.props.attached),
/** Whether success state should automatically trigger when progress completes. */
autoSuccess: _react.PropTypes.bool,
/** A progress bar can have different colors. */
color: _react.PropTypes.oneOf(Progress._meta.props.color),
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** A progress bar be disabled. */
disabled: _react.PropTypes.bool,
/** A progress bar can show a error state. */
error: _react.PropTypes.bool,
/** An indicating progress bar visually indicates the current level of progress of a task. */
indicating: _react.PropTypes.bool,
/** A progress bar can have its colors inverted. */
inverted: _react.PropTypes.bool,
/** Can be set to either to display progress as percent or ratio. */
label: _lib.customPropTypes.every([_lib.customPropTypes.some([_lib.customPropTypes.demand(['percent']), _lib.customPropTypes.demand(['total', 'value'])]), _react.PropTypes.oneOfType([_react.PropTypes.bool, _react.PropTypes.oneOf(Progress._meta.props.label)])]),
/** Current percent complete. */
percent: _lib.customPropTypes.every([_lib.customPropTypes.disallow(['total', 'value']), _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.number])]),
/** A progress bar can contain a text value indicating current progress. */
progress: _react.PropTypes.bool,
/** Decimal point precision for calculated progress. */
precision: _react.PropTypes.number,
/** A progress bar can vary in size. */
size: _react.PropTypes.oneOf(Progress._meta.props.size),
/** A progress bar can show a success state. */
success: _react.PropTypes.bool,
/**
* For use with value.
* Together, these will calculate the percent.
* Mutually excludes percent.
*/
total: _lib.customPropTypes.every([_lib.customPropTypes.demand(['value']), _lib.customPropTypes.disallow(['percent']), _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.number])]),
/**
* For use with total. Together, these will calculate the percent. Mutually excludes percent.
*/
value: _lib.customPropTypes.every([_lib.customPropTypes.demand(['total']), _lib.customPropTypes.disallow(['percent']), _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.number])]),
/** A progress bar can show a warning state. */
warning: _react.PropTypes.bool
};
exports.default = Progress;
/***/ },
/* 1005 */
/*!***********************************************!*\
!*** ./~/semantic-ui-react/~/lodash/round.js ***!
\***********************************************/
/***/ function(module, exports, __webpack_require__) {
var createRound = __webpack_require__(/*! ./_createRound */ 1006);
/**
* Computes `number` rounded to `precision`.
*
* @static
* @memberOf _
* @since 3.10.0
* @category Math
* @param {number} number The number to round.
* @param {number} [precision=0] The precision to round to.
* @returns {number} Returns the rounded number.
* @example
*
* _.round(4.006);
* // => 4
*
* _.round(4.006, 2);
* // => 4.01
*
* _.round(4060, -2);
* // => 4100
*/
var round = createRound('round');
module.exports = round;
/***/ },
/* 1006 */
/*!******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_createRound.js ***!
\******************************************************/
/***/ function(module, exports, __webpack_require__) {
var toInteger = __webpack_require__(/*! ./toInteger */ 624),
toNumber = __webpack_require__(/*! ./toNumber */ 626),
toString = __webpack_require__(/*! ./toString */ 584);
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMin = Math.min;
/**
* Creates a function like `_.round`.
*
* @private
* @param {string} methodName The name of the `Math` method to use when rounding.
* @returns {Function} Returns the new round function.
*/
function createRound(methodName) {
var func = Math[methodName];
return function(number, precision) {
number = toNumber(number);
precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
if (precision) {
// Shift with exponential notation to avoid floating-point issues.
// See [MDN](https://mdn.io/round#Examples) for more details.
var pair = (toString(number) + 'e').split('e'),
value = func(pair[0] + 'e' + (+pair[1] + precision));
pair = (toString(value) + 'e').split('e');
return +(pair[0] + 'e' + (+pair[1] - precision));
}
return func(number);
};
}
module.exports = createRound;
/***/ },
/* 1007 */
/*!***********************************************!*\
!*** ./~/semantic-ui-react/~/lodash/clamp.js ***!
\***********************************************/
/***/ function(module, exports, __webpack_require__) {
var baseClamp = __webpack_require__(/*! ./_baseClamp */ 623),
toNumber = __webpack_require__(/*! ./toNumber */ 626);
/**
* Clamps `number` within the inclusive `lower` and `upper` bounds.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Number
* @param {number} number The number to clamp.
* @param {number} [lower] The lower bound.
* @param {number} upper The upper bound.
* @returns {number} Returns the clamped number.
* @example
*
* _.clamp(-10, -5, 5);
* // => -5
*
* _.clamp(10, -5, 5);
* // => 5
*/
function clamp(number, lower, upper) {
if (upper === undefined) {
upper = lower;
lower = undefined;
}
if (upper !== undefined) {
upper = toNumber(upper);
upper = upper === upper ? upper : 0;
}
if (lower !== undefined) {
lower = toNumber(lower);
lower = lower === lower ? lower : 0;
}
return baseClamp(toNumber(number), lower, upper);
}
module.exports = clamp;
/***/ },
/* 1008 */
/*!*******************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/modules/Rating/index.js ***!
\*******************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _Rating = __webpack_require__(/*! ./Rating */ 1009);
var _Rating2 = _interopRequireDefault(_Rating);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = _Rating2.default;
/***/ },
/* 1009 */
/*!********************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/modules/Rating/Rating.js ***!
\********************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _times2 = __webpack_require__(/*! lodash/times */ 710);
var _times3 = _interopRequireDefault(_times2);
var _invoke2 = __webpack_require__(/*! lodash/invoke */ 854);
var _invoke3 = _interopRequireDefault(_invoke2);
var _without2 = __webpack_require__(/*! lodash/without */ 846);
var _without3 = _interopRequireDefault(_without2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _RatingIcon = __webpack_require__(/*! ./RatingIcon */ 1010);
var _RatingIcon2 = _interopRequireDefault(_RatingIcon);
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 _meta = {
name: 'Rating',
type: _lib.META.TYPES.MODULE,
props: {
clearable: ['auto'],
icon: ['star', 'heart'],
size: (0, _without3.default)(_lib.SUI.SIZES, 'medium', 'big')
}
};
/**
* A rating indicates user interest in content
*/
var Rating = function (_Component) {
_inherits(Rating, _Component);
function Rating() {
var _ref;
var _temp, _this, _ret;
_classCallCheck(this, Rating);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Rating.__proto__ || Object.getPrototypeOf(Rating)).call.apply(_ref, [this].concat(args))), _this), _initialiseProps.call(_this), _temp), _possibleConstructorReturn(_this, _ret);
}
_createClass(Rating, [{
key: 'render',
value: function render() {
var _this2 = this;
var _props = this.props,
className = _props.className,
disabled = _props.disabled,
icon = _props.icon,
maxRating = _props.maxRating,
size = _props.size;
var _state = this.state,
rating = _state.rating,
selectedIndex = _state.selectedIndex,
isSelecting = _state.isSelecting;
var classes = (0, _classnames2.default)('ui', icon, size, (0, _lib.useKeyOnly)(disabled, 'disabled'), (0, _lib.useKeyOnly)(isSelecting && !disabled && selectedIndex >= 0, 'selected'), 'rating', className);
var rest = (0, _lib.getUnhandledProps)(Rating, this.props);
var ElementType = (0, _lib.getElementType)(Rating, this.props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes, role: 'radiogroup', onMouseLeave: this.handleMouseLeave }),
(0, _times3.default)(maxRating, function (i) {
return _react2.default.createElement(_RatingIcon2.default, {
active: rating >= i + 1,
index: i,
key: i,
'aria-checked': rating === i + 1,
'aria-posinset': i + 1,
'aria-setsize': maxRating,
onClick: _this2.handleIconClick,
onMouseEnter: _this2.handleIconMouseEnter,
selected: selectedIndex >= i && isSelecting
});
})
);
}
}]);
return Rating;
}(_lib.AutoControlledComponent);
Rating.autoControlledProps = ['rating'];
Rating.defaultProps = {
clearable: 'auto',
maxRating: 1
};
Rating.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Additional classes. */
className: _react.PropTypes.string,
/**
* You can clear the rating by clicking on the current start rating.
* By default a rating will be only clearable if there is 1 icon.
* Setting to `true`/`false` will allow or disallow a user to clear their rating.
*/
clearable: _react.PropTypes.oneOfType([_react.PropTypes.oneOf(_meta.props.clearable), _react.PropTypes.bool]),
/** The initial rating value. */
defaultRating: _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.number]),
/** You can disable or enable interactive rating. Makes a read-only rating. */
disabled: _react.PropTypes.bool,
/** A rating can use a set of star or heart icons. */
icon: _react.PropTypes.oneOf(_meta.props.icon),
/** The total number of icons. */
maxRating: _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.number]),
/**
* Called after user selects a new rating.
*
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All props and proposed rating.
*/
onRate: _react.PropTypes.func,
/** The current number of active icons. */
rating: _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.number]),
/** A progress bar can vary in size. */
size: _react.PropTypes.oneOf(_meta.props.size)
};
Rating._meta = _meta;
Rating.Icon = _RatingIcon2.default;
var _initialiseProps = function _initialiseProps() {
var _this3 = this;
this.handleIconClick = function (e, _ref2) {
var index = _ref2.index;
var _props2 = _this3.props,
clearable = _props2.clearable,
disabled = _props2.disabled,
maxRating = _props2.maxRating,
onRate = _props2.onRate;
var rating = _this3.state.rating;
if (disabled) return;
// default newRating is the clicked icon
// allow toggling a binary rating
// allow clearing ratings
var newRating = index + 1;
if (clearable === 'auto' && maxRating === 1) {
newRating = +!rating;
} else if (clearable === true && newRating === rating) {
newRating = 0;
}
// set rating
_this3.trySetState({ rating: newRating }, { isSelecting: false });
if (onRate) onRate(e, _extends({}, _this3.props, { rating: newRating }));
};
this.handleIconMouseEnter = function (e, _ref3) {
var index = _ref3.index;
if (_this3.props.disabled) return;
_this3.setState({ selectedIndex: index, isSelecting: true });
};
this.handleMouseLeave = function () {
for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
}
_invoke3.default.apply(undefined, [_this3.props, 'onMouseLeave'].concat(args));
if (_this3.props.disabled) return;
_this3.setState({ selectedIndex: -1, isSelecting: false });
};
};
exports.default = Rating;
/***/ },
/* 1010 */
/*!************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/modules/Rating/RatingIcon.js ***!
\************************************************************************/
/***/ 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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
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; }
/**
* An internal icon sub-component for Rating component
*/
var RatingIcon = function (_Component) {
_inherits(RatingIcon, _Component);
function RatingIcon() {
var _ref;
var _temp, _this, _ret;
_classCallCheck(this, RatingIcon);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = RatingIcon.__proto__ || Object.getPrototypeOf(RatingIcon)).call.apply(_ref, [this].concat(args))), _this), _this.defaultProps = {
as: 'i'
}, _this.handleClick = function (e) {
var onClick = _this.props.onClick;
if (onClick) onClick(e, _this.props);
}, _this.handleKeyUp = function (e) {
var _this$props = _this.props,
onClick = _this$props.onClick,
onKeyUp = _this$props.onKeyUp;
if (onKeyUp) onKeyUp(e, _this.props);
if (onClick) {
switch (_lib.keyboardKey.getCode(e)) {
case _lib.keyboardKey.Enter:
case _lib.keyboardKey.Spacebar:
e.preventDefault();
onClick(e, _this.props);
break;
default:
return;
}
}
}, _this.handleMouseEnter = function (e) {
var onMouseEnter = _this.props.onMouseEnter;
if (onMouseEnter) onMouseEnter(e, _this.props);
}, _temp), _possibleConstructorReturn(_this, _ret);
}
_createClass(RatingIcon, [{
key: 'render',
value: function render() {
var _props = this.props,
active = _props.active,
className = _props.className,
selected = _props.selected;
var classes = (0, _classnames2.default)((0, _lib.useKeyOnly)(active, 'active'), (0, _lib.useKeyOnly)(selected, 'selected'), 'icon', className);
var rest = (0, _lib.getUnhandledProps)(RatingIcon, this.props);
var ElementType = (0, _lib.getElementType)(RatingIcon, this.props);
return _react2.default.createElement(ElementType, _extends({
role: 'radio',
tabIndex: 0
}, rest, {
className: classes,
onKeyUp: this.handleKeyUp,
onClick: this.handleClick,
onMouseEnter: this.handleMouseEnter
}));
}
}]);
return RatingIcon;
}(_react.Component);
RatingIcon.propTypes = {
/** Indicates activity of an icon. */
active: _react.PropTypes.bool,
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Additional classes. */
className: _react.PropTypes.string,
/** An index of icon inside Rating. */
index: _react.PropTypes.number,
/**
* Called on click.
*
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All props.
*/
onClick: _react.PropTypes.func,
/**
* Called on keyup.
*
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All props.
*/
onKeyUp: _react.PropTypes.func,
/**
* Called on mouseenter.
*
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All props.
*/
onMouseEnter: _react.PropTypes.func,
/** Indicates selection of an icon. */
selected: _react.PropTypes.bool
};
RatingIcon._meta = {
name: 'RatingIcon',
parent: 'Rating',
type: _lib.META.TYPES.MODULE
};
exports.default = RatingIcon;
/***/ },
/* 1011 */
/*!*******************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/modules/Search/index.js ***!
\*******************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _Search = __webpack_require__(/*! ./Search */ 1012);
var _Search2 = _interopRequireDefault(_Search);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = _Search2.default;
/***/ },
/* 1012 */
/*!********************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/modules/Search/Search.js ***!
\********************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _isEmpty2 = __webpack_require__(/*! lodash/isEmpty */ 685);
var _isEmpty3 = _interopRequireDefault(_isEmpty2);
var _partialRight2 = __webpack_require__(/*! lodash/partialRight */ 1013);
var _partialRight3 = _interopRequireDefault(_partialRight2);
var _inRange2 = __webpack_require__(/*! lodash/inRange */ 1014);
var _inRange3 = _interopRequireDefault(_inRange2);
var _map2 = __webpack_require__(/*! lodash/map */ 825);
var _map3 = _interopRequireDefault(_map2);
var _get3 = __webpack_require__(/*! lodash/get */ 678);
var _get4 = _interopRequireDefault(_get3);
var _reduce2 = __webpack_require__(/*! lodash/reduce */ 886);
var _reduce3 = _interopRequireDefault(_reduce2);
var _isEqual2 = __webpack_require__(/*! lodash/isEqual */ 712);
var _isEqual3 = _interopRequireDefault(_isEqual2);
var _without2 = __webpack_require__(/*! lodash/without */ 846);
var _without3 = _interopRequireDefault(_without2);
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 _get2 = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
var _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _Input = __webpack_require__(/*! ../../elements/Input */ 915);
var _Input2 = _interopRequireDefault(_Input);
var _SearchCategory = __webpack_require__(/*! ./SearchCategory */ 1016);
var _SearchCategory2 = _interopRequireDefault(_SearchCategory);
var _SearchResult = __webpack_require__(/*! ./SearchResult */ 1017);
var _SearchResult2 = _interopRequireDefault(_SearchResult);
var _SearchResults = __webpack_require__(/*! ./SearchResults */ 1018);
var _SearchResults2 = _interopRequireDefault(_SearchResults);
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 debug = (0, _lib.makeDebugger)('search');
var _meta = {
name: 'Search',
type: _lib.META.TYPES.MODULE,
props: {
size: (0, _without3.default)(_lib.SUI.SIZES, 'medium')
}
};
/**
* A search module allows a user to query for results from a selection of data
*/
var Search = function (_Component) {
_inherits(Search, _Component);
function Search() {
var _ref;
var _temp, _this, _ret;
_classCallCheck(this, Search);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Search.__proto__ || Object.getPrototypeOf(Search)).call.apply(_ref, [this].concat(args))), _this), _this.handleResultSelect = function (e, result) {
debug('handleResultSelect()');
debug(result);
var onResultSelect = _this.props.onResultSelect;
if (onResultSelect) onResultSelect(e, result);
}, _this.closeOnEscape = function (e) {
if (_lib.keyboardKey.getCode(e) !== _lib.keyboardKey.Escape) return;
e.preventDefault();
_this.close();
}, _this.moveSelectionOnKeyDown = function (e) {
debug('moveSelectionOnKeyDown()');
debug(_lib.keyboardKey.getName(e));
switch (_lib.keyboardKey.getCode(e)) {
case _lib.keyboardKey.ArrowDown:
e.preventDefault();
_this.moveSelectionBy(1);
break;
case _lib.keyboardKey.ArrowUp:
e.preventDefault();
_this.moveSelectionBy(-1);
break;
default:
break;
}
}, _this.selectItemOnEnter = function (e) {
debug('selectItemOnEnter()');
debug(_lib.keyboardKey.getName(e));
if (_lib.keyboardKey.getCode(e) !== _lib.keyboardKey.Enter) return;
e.preventDefault();
var result = _this.getSelectedResult();
// prevent selecting null if there was no selected item value
if (!result) return;
// notify the onResultSelect prop that the user is trying to change value
_this.setValue(result.title);
_this.handleResultSelect(e, result);
_this.close();
}, _this.closeOnDocumentClick = function (e) {
debug('closeOnDocumentClick()');
debug(e);
_this.close();
}, _this.handleMouseDown = function (e) {
debug('handleMouseDown()');
var onMouseDown = _this.props.onMouseDown;
if (onMouseDown) onMouseDown(e, _this.props);
_this.isMouseDown = true;
// Do not access document when server side rendering
if (!_lib.isBrowser) return;
document.addEventListener('mouseup', _this.handleDocumentMouseUp);
}, _this.handleDocumentMouseUp = function () {
debug('handleDocumentMouseUp()');
_this.isMouseDown = false;
// Do not access document when server side rendering
if (!_lib.isBrowser) return;
document.removeEventListener('mouseup', _this.handleDocumentMouseUp);
}, _this.handleInputClick = function (e) {
debug('handleInputClick()', e);
// prevent closeOnDocumentClick()
e.nativeEvent.stopImmediatePropagation();
_this.tryOpen();
}, _this.handleItemClick = function (e, _ref2) {
var id = _ref2.id;
debug('handleItemClick()');
debug(id);
var result = _this.getSelectedResult(id);
// prevent closeOnDocumentClick()
e.nativeEvent.stopImmediatePropagation();
// notify the onResultSelect prop that the user is trying to change value
_this.setValue(result.title);
_this.handleResultSelect(e, result);
_this.close();
}, _this.handleFocus = function (e) {
debug('handleFocus()');
var onFocus = _this.props.onFocus;
if (onFocus) onFocus(e, _this.props);
_this.setState({ focus: true });
}, _this.handleBlur = function (e) {
debug('handleBlur()');
var onBlur = _this.props.onBlur;
if (onBlur) onBlur(e, _this.props);
_this.setState({ focus: false });
}, _this.handleSearchChange = function (e) {
debug('handleSearchChange()');
debug(e.target.value);
// prevent propagating to this.props.onChange()
e.stopPropagation();
var _this$props = _this.props,
onSearchChange = _this$props.onSearchChange,
minCharacters = _this$props.minCharacters;
var open = _this.state.open;
var newQuery = e.target.value;
if (onSearchChange) onSearchChange(e, newQuery);
// open search dropdown on search query
if (newQuery.length < minCharacters) {
_this.close();
} else if (!open) {
_this.tryOpen(newQuery);
}
_this.setValue(newQuery);
}, _this.getFlattenedResults = function () {
var _this$props2 = _this.props,
category = _this$props2.category,
results = _this$props2.results;
return !category ? results : (0, _reduce3.default)(results, function (memo, categoryData) {
return memo.concat(categoryData.results);
}, []);
}, _this.getSelectedResult = function () {
var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _this.state.selectedIndex;
var results = _this.getFlattenedResults();
return (0, _get4.default)(results, index);
}, _this.setValue = function (value) {
debug('setValue()');
debug('value', value);
var selectFirstResult = _this.props.selectFirstResult;
_this.trySetState({ value: value }, { selectedIndex: selectFirstResult ? 0 : -1 });
}, _this.moveSelectionBy = function (offset) {
debug('moveSelectionBy()');
debug('offset: ' + offset);
var selectedIndex = _this.state.selectedIndex;
var results = _this.getFlattenedResults();
var lastIndex = results.length - 1;
// next is after last, wrap to beginning
// next is before first, wrap to end
var nextIndex = selectedIndex + offset;
if (nextIndex > lastIndex) nextIndex = 0;else if (nextIndex < 0) nextIndex = lastIndex;
_this.setState({ selectedIndex: nextIndex });
_this.scrollSelectedItemIntoView();
}, _this.scrollSelectedItemIntoView = function () {
debug('scrollSelectedItemIntoView()');
// Do not access document when server side rendering
if (!_lib.isBrowser) return;
var menu = document.querySelector('.ui.search.active.visible .results.visible');
var item = menu.querySelector('.result.active');
debug('menu (results): ' + menu);
debug('item (result): ' + item);
var isOutOfUpperView = item.offsetTop < menu.scrollTop;
var isOutOfLowerView = item.offsetTop + item.clientHeight > menu.scrollTop + menu.clientHeight;
if (isOutOfUpperView) {
menu.scrollTop = item.offsetTop;
} else if (isOutOfLowerView) {
menu.scrollTop = item.offsetTop + item.clientHeight - menu.clientHeight;
}
}, _this.tryOpen = function () {
var currentValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _this.state.value;
debug('open()');
var minCharacters = _this.props.minCharacters;
if (currentValue.length < minCharacters) return;
_this.open();
}, _this.open = function () {
debug('open()');
_this.trySetState({ open: true });
}, _this.close = function () {
debug('close()');
_this.trySetState({ open: false });
}, _this.renderSearchInput = function () {
var _this$props3 = _this.props,
icon = _this$props3.icon,
placeholder = _this$props3.placeholder;
var value = _this.state.value;
return _react2.default.createElement(_Input2.default, {
value: value,
placeholder: placeholder,
onBlur: _this.handleBlur,
onChange: _this.handleSearchChange,
onFocus: _this.handleFocus,
onClick: _this.handleInputClick,
input: { className: 'prompt', tabIndex: '0', autoComplete: 'off' },
icon: icon
});
}, _this.renderNoResults = function () {
var _this$props4 = _this.props,
noResultsMessage = _this$props4.noResultsMessage,
noResultsDescription = _this$props4.noResultsDescription;
return _react2.default.createElement(
'div',
{ className: 'message empty' },
_react2.default.createElement(
'div',
{ className: 'header' },
noResultsMessage
),
noResultsDescription && _react2.default.createElement(
'div',
{ className: 'description' },
noResultsDescription
)
);
}, _this.renderResult = function (_ref3, index, _array) {
var offset = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
var childKey = _ref3.childKey,
result = _objectWithoutProperties(_ref3, ['childKey']);
var resultRenderer = _this.props.resultRenderer;
var selectedIndex = _this.state.selectedIndex;
var offsetIndex = index + offset;
return _react2.default.createElement(_SearchResult2.default, _extends({
key: childKey || result.title,
active: selectedIndex === offsetIndex,
onClick: _this.handleItemClick,
renderer: resultRenderer
}, result, {
id: offsetIndex // Used to lookup the result on item click
}));
}, _this.renderResults = function () {
var results = _this.props.results;
return (0, _map3.default)(results, _this.renderResult);
}, _this.renderCategories = function () {
var _this$props5 = _this.props,
categoryRenderer = _this$props5.categoryRenderer,
categories = _this$props5.results;
var selectedIndex = _this.state.selectedIndex;
var count = 0;
return (0, _map3.default)(categories, function (_ref4, name, index) {
var childKey = _ref4.childKey,
category = _objectWithoutProperties(_ref4, ['childKey']);
var categoryProps = _extends({
key: childKey || category.name,
active: (0, _inRange3.default)(selectedIndex, count, count + category.results.length),
renderer: categoryRenderer
}, category);
var renderFn = (0, _partialRight3.default)(_this.renderResult, count);
count = count + category.results.length;
return _react2.default.createElement(
_SearchCategory2.default,
categoryProps,
category.results.map(renderFn)
);
});
}, _this.renderMenuContent = function () {
var _this$props6 = _this.props,
category = _this$props6.category,
showNoResults = _this$props6.showNoResults,
results = _this$props6.results;
if ((0, _isEmpty3.default)(results)) {
return showNoResults ? _this.renderNoResults() : null;
}
return category ? _this.renderCategories() : _this.renderResults();
}, _this.renderResultsMenu = function () {
var open = _this.state.open;
var resultsClasses = open ? 'visible' : '';
var menuContent = _this.renderMenuContent();
if (!menuContent) return;
return _react2.default.createElement(
_SearchResults2.default,
{ className: resultsClasses },
menuContent
);
}, _temp), _possibleConstructorReturn(_this, _ret);
}
_createClass(Search, [{
key: 'componentWillMount',
value: function componentWillMount() {
if (_get2(Search.prototype.__proto__ || Object.getPrototypeOf(Search.prototype), 'componentWillMount', this)) _get2(Search.prototype.__proto__ || Object.getPrototypeOf(Search.prototype), 'componentWillMount', this).call(this);
debug('componentWillMount()');
var _state = this.state,
open = _state.open,
value = _state.value;
this.setValue(value);
if (open) this.open();
}
}, {
key: 'shouldComponentUpdate',
value: function shouldComponentUpdate(nextProps, nextState) {
return !(0, _isEqual3.default)(nextProps, this.props) || !(0, _isEqual3.default)(nextState, this.state);
}
}, {
key: 'componentWillReceiveProps',
value: function componentWillReceiveProps(nextProps) {
_get2(Search.prototype.__proto__ || Object.getPrototypeOf(Search.prototype), 'componentWillReceiveProps', this).call(this, nextProps);
debug('componentWillReceiveProps()');
// TODO objectDiff still runs in prod, stop it
debug('changed props:', (0, _lib.objectDiff)(nextProps, this.props));
if (!(0, _isEqual3.default)(nextProps.value, this.props.value)) {
debug('value changed, setting', nextProps.value);
this.setValue(nextProps.value);
}
}
}, {
key: 'componentDidUpdate',
value: function componentDidUpdate(prevProps, prevState) {
// eslint-disable-line complexity
debug('componentDidUpdate()');
// TODO objectDiff still runs in prod, stop it
debug('to state:', (0, _lib.objectDiff)(prevState, this.state));
// Do not access document when server side rendering
if (!_lib.isBrowser) return;
// focused / blurred
if (!prevState.focus && this.state.focus) {
debug('search focused');
if (!this.isMouseDown) {
debug('mouse is not down, opening');
this.tryOpen();
}
if (this.state.open) {
document.addEventListener('keydown', this.moveSelectionOnKeyDown);
document.addEventListener('keydown', this.selectItemOnEnter);
}
} else if (prevState.focus && !this.state.focus) {
debug('search blurred');
if (!this.isMouseDown) {
debug('mouse is not down, closing');
this.close();
}
document.removeEventListener('keydown', this.moveSelectionOnKeyDown);
document.removeEventListener('keydown', this.selectItemOnEnter);
}
// opened / closed
if (!prevState.open && this.state.open) {
debug('search opened');
this.open();
document.addEventListener('keydown', this.closeOnEscape);
document.addEventListener('keydown', this.moveSelectionOnKeyDown);
document.addEventListener('keydown', this.selectItemOnEnter);
document.addEventListener('click', this.closeOnDocumentClick);
} else if (prevState.open && !this.state.open) {
debug('search closed');
this.close();
document.removeEventListener('keydown', this.closeOnEscape);
document.removeEventListener('keydown', this.moveSelectionOnKeyDown);
document.removeEventListener('keydown', this.selectItemOnEnter);
document.removeEventListener('click', this.closeOnDocumentClick);
}
}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {
debug('componentWillUnmount()');
// Do not access document when server side rendering
if (!_lib.isBrowser) return;
document.removeEventListener('keydown', this.moveSelectionOnKeyDown);
document.removeEventListener('keydown', this.selectItemOnEnter);
document.removeEventListener('keydown', this.closeOnEscape);
document.removeEventListener('click', this.closeOnDocumentClick);
}
// ----------------------------------------
// Document Event Handlers
// ----------------------------------------
// ----------------------------------------
// Component Event Handlers
// ----------------------------------------
// ----------------------------------------
// Getters
// ----------------------------------------
// ----------------------------------------
// Setters
// ----------------------------------------
// ----------------------------------------
// Behavior
// ----------------------------------------
// Open if the current value is greater than the minCharacters prop
// ----------------------------------------
// Render
// ----------------------------------------
/**
* Offset is needed for determining the active item for results within a
* category. Since the index is reset to 0 for each new category, an offset
* must be passed in.
*/
}, {
key: 'render',
value: function render() {
debug('render()');
debug('props', this.props);
debug('state', this.state);
var _state2 = this.state,
searchClasses = _state2.searchClasses,
focus = _state2.focus,
open = _state2.open;
var _props = this.props,
aligned = _props.aligned,
category = _props.category,
className = _props.className,
fluid = _props.fluid,
loading = _props.loading,
size = _props.size;
// Classes
var classes = (0, _classnames2.default)('ui', open && 'active visible', size, searchClasses, (0, _lib.useKeyOnly)(loading, 'loading'), (0, _lib.useValueAndKey)(aligned, 'aligned'), (0, _lib.useKeyOnly)(category, 'category'), (0, _lib.useKeyOnly)(focus, 'focus'), (0, _lib.useKeyOnly)(fluid, 'fluid'), className, 'search');
var rest = (0, _lib.getUnhandledProps)(Search, this.props);
var ElementType = (0, _lib.getElementType)(Search, this.props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, {
className: classes,
onBlur: this.handleBlur,
onFocus: this.handleFocus,
onMouseDown: this.handleMouseDown
}),
this.renderSearchInput(),
this.renderResultsMenu()
);
}
}]);
return Search;
}(_lib.AutoControlledComponent);
Search.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
// ------------------------------------
// Behavior
// ------------------------------------
/** Shorthand for Icon. */
icon: _react.PropTypes.oneOfType([_react.PropTypes.node, _react.PropTypes.object]),
/**
* One of:
* - array of Search.Result props e.g. `{ title: '', description: '' }` or
* - object of categories e.g. `{ name: '', results: [{ title: '', description: '' }]`
*/
results: _react.PropTypes.oneOfType([_react.PropTypes.arrayOf(_react.PropTypes.shape(_SearchResult2.default.propTypes)), _react.PropTypes.object]),
/** Controls whether or not the results menu is displayed. */
open: _react.PropTypes.bool,
/** Initial value of open. */
defaultOpen: _react.PropTypes.bool,
/** Current value of the search input. Creates a controlled component. */
value: _react.PropTypes.string,
/** Initial value. */
defaultValue: _react.PropTypes.string,
/** Placeholder of the search input. */
placeholder: _react.PropTypes.string,
/** Minimum characters to query for results */
minCharacters: _react.PropTypes.number,
/** Message to display when there are no results. */
noResultsMessage: _react.PropTypes.string,
/** Additional text for "No Results" message with less emphasis. */
noResultsDescription: _react.PropTypes.string,
/** Whether the search should automatically select the first result after searching */
selectFirstResult: _react.PropTypes.bool,
/** Whether a "no results" message should be shown if no results are found. */
showNoResults: _react.PropTypes.bool,
// ------------------------------------
// Rendering
// ------------------------------------
/**
* A function that returns the category contents.
* Receives all SearchCategory props.
*/
categoryRenderer: _react.PropTypes.func,
/**
* A function that returns the result contents.
* Receives all SearchResult props.
*/
resultRenderer: _react.PropTypes.func,
// ------------------------------------
// Callbacks
// ------------------------------------
/**
* Called on blur.
*
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All props.
*/
onBlur: _react.PropTypes.func,
/**
* Called when a result is selected.
*
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All props.
*/
onResultSelect: _react.PropTypes.func,
/**
* Called on search input change.
*
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {string} value - Current value of search input.
*/
onSearchChange: _react.PropTypes.func,
/**
* Called on focus.
*
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All props.
*/
onFocus: _react.PropTypes.func,
/**
* Called on mousedown.
*
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All props.
*/
onMouseDown: _react.PropTypes.func,
// ------------------------------------
// Style
// ------------------------------------
/** A search can have its results aligned to its left or right container edge. */
aligned: _react.PropTypes.string,
/** A search can display results from remote content ordered by categories. */
category: _react.PropTypes.bool,
/** Additional classes. */
className: _react.PropTypes.string,
/** A search can have its results take up the width of its container. */
fluid: _react.PropTypes.bool,
size: _react.PropTypes.oneOf(_meta.props.size),
loading: _react.PropTypes.bool
};
Search.defaultProps = {
icon: 'search',
minCharacters: 1,
noResultsMessage: 'No results found.',
showNoResults: true
};
Search.autoControlledProps = ['open', 'value'];
Search._meta = _meta;
Search.Result = _SearchResult2.default;
Search.Results = _SearchResults2.default;
Search.Category = _SearchCategory2.default;
exports.default = Search;
/***/ },
/* 1013 */
/*!******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/partialRight.js ***!
\******************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseRest = __webpack_require__(/*! ./_baseRest */ 610),
createWrap = __webpack_require__(/*! ./_createWrap */ 730),
getHolder = __webpack_require__(/*! ./_getHolder */ 757),
replaceHolders = __webpack_require__(/*! ./_replaceHolders */ 759);
/** Used to compose bitmasks for function metadata. */
var WRAP_PARTIAL_RIGHT_FLAG = 64;
/**
* This method is like `_.partial` except that partially applied arguments
* are appended to the arguments it receives.
*
* The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
* builds, may be used as a placeholder for partially applied arguments.
*
* **Note:** This method doesn't set the "length" property of partially
* applied functions.
*
* @static
* @memberOf _
* @since 1.0.0
* @category Function
* @param {Function} func The function to partially apply arguments to.
* @param {...*} [partials] The arguments to be partially applied.
* @returns {Function} Returns the new partially applied function.
* @example
*
* function greet(greeting, name) {
* return greeting + ' ' + name;
* }
*
* var greetFred = _.partialRight(greet, 'fred');
* greetFred('hi');
* // => 'hi fred'
*
* // Partially applied with placeholders.
* var sayHelloTo = _.partialRight(greet, 'hello', _);
* sayHelloTo('fred');
* // => 'hello fred'
*/
var partialRight = baseRest(function(func, partials) {
var holders = replaceHolders(partials, getHolder(partialRight));
return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
});
// Assign default placeholders.
partialRight.placeholder = {};
module.exports = partialRight;
/***/ },
/* 1014 */
/*!*************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/inRange.js ***!
\*************************************************/
/***/ function(module, exports, __webpack_require__) {
var baseInRange = __webpack_require__(/*! ./_baseInRange */ 1015),
toFinite = __webpack_require__(/*! ./toFinite */ 625),
toNumber = __webpack_require__(/*! ./toNumber */ 626);
/**
* Checks if `n` is between `start` and up to, but not including, `end`. If
* `end` is not specified, it's set to `start` with `start` then set to `0`.
* If `start` is greater than `end` the params are swapped to support
* negative ranges.
*
* @static
* @memberOf _
* @since 3.3.0
* @category Number
* @param {number} number The number to check.
* @param {number} [start=0] The start of the range.
* @param {number} end The end of the range.
* @returns {boolean} Returns `true` if `number` is in the range, else `false`.
* @see _.range, _.rangeRight
* @example
*
* _.inRange(3, 2, 4);
* // => true
*
* _.inRange(4, 8);
* // => true
*
* _.inRange(4, 2);
* // => false
*
* _.inRange(2, 2);
* // => false
*
* _.inRange(1.2, 2);
* // => true
*
* _.inRange(5.2, 4);
* // => false
*
* _.inRange(-3, -2, -6);
* // => true
*/
function inRange(number, start, end) {
start = toFinite(start);
if (end === undefined) {
end = start;
start = 0;
} else {
end = toFinite(end);
}
number = toNumber(number);
return baseInRange(number, start, end);
}
module.exports = inRange;
/***/ },
/* 1015 */
/*!******************************************************!*\
!*** ./~/semantic-ui-react/~/lodash/_baseInRange.js ***!
\******************************************************/
/***/ function(module, exports) {
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max,
nativeMin = Math.min;
/**
* The base implementation of `_.inRange` which doesn't coerce arguments.
*
* @private
* @param {number} number The number to check.
* @param {number} start The start of the range.
* @param {number} end The end of the range.
* @returns {boolean} Returns `true` if `number` is in the range, else `false`.
*/
function baseInRange(number, start, end) {
return number >= nativeMin(start, end) && number < nativeMax(start, end);
}
module.exports = baseInRange;
/***/ },
/* 1016 */
/*!****************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/modules/Search/SearchCategory.js ***!
\****************************************************************************/
/***/ 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__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var defaultRenderer = function defaultRenderer(_ref) {
var name = _ref.name;
return name;
};
function SearchCategory(props) {
var active = props.active,
children = props.children,
className = props.className,
renderer = props.renderer;
var classes = (0, _classnames2.default)((0, _lib.useKeyOnly)(active, 'active'), 'category', className);
var rest = (0, _lib.getUnhandledProps)(SearchCategory, props);
var ElementType = (0, _lib.getElementType)(SearchCategory, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
_react2.default.createElement(
'div',
{ className: 'name' },
renderer ? renderer(props) : defaultRenderer(props)
),
children
);
}
SearchCategory._meta = {
name: 'SearchCategory',
parent: 'Search',
type: _lib.META.TYPES.MODULE
};
SearchCategory.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** The item currently selected by keyboard shortcut. */
active: _react.PropTypes.bool,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** Display name. */
name: _react.PropTypes.string,
/**
* A function that returns the category contents.
* Receives all SearchCategory props.
*/
renderer: _react.PropTypes.func,
/** Array of Search.Result props */
results: _react.PropTypes.array
};
exports.default = SearchCategory;
/***/ },
/* 1017 */
/*!**************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/modules/Search/SearchResult.js ***!
\**************************************************************************/
/***/ 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__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _lib = __webpack_require__(/*! ../../lib */ 592);
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; }
// Note: You technically only need the 'content' wrapper when there's an
// image. However, optionally wrapping it makes this function a lot more
// complicated and harder to read. Since always wrapping it doesn't affect
// the style in any way let's just do that.
//
// Note: To avoid requiring a wrapping div, we return an array here so to
// prevent rendering issues each node needs a unique key.
var defaultRenderer = function defaultRenderer(_ref) {
var image = _ref.image,
price = _ref.price,
title = _ref.title,
description = _ref.description;
return [image && _react2.default.createElement(
'div',
{ key: 'image', className: 'image' },
(0, _lib.createHTMLImage)(image)
), _react2.default.createElement(
'div',
{ key: 'content', className: 'content' },
price && _react2.default.createElement(
'div',
{ className: 'price' },
price
),
title && _react2.default.createElement(
'div',
{ className: 'title' },
title
),
description && _react2.default.createElement(
'div',
{ className: 'description' },
description
)
)];
};
var SearchResult = function (_Component) {
_inherits(SearchResult, _Component);
function SearchResult() {
var _ref2;
var _temp, _this, _ret;
_classCallCheck(this, SearchResult);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref2 = SearchResult.__proto__ || Object.getPrototypeOf(SearchResult)).call.apply(_ref2, [this].concat(args))), _this), _this.handleClick = function (e) {
var onClick = _this.props.onClick;
if (onClick) onClick(e, _this.props);
}, _temp), _possibleConstructorReturn(_this, _ret);
}
_createClass(SearchResult, [{
key: 'render',
value: function render() {
var _props = this.props,
active = _props.active,
className = _props.className,
renderer = _props.renderer;
var classes = (0, _classnames2.default)((0, _lib.useKeyOnly)(active, 'active'), 'result', className);
var rest = (0, _lib.getUnhandledProps)(SearchResult, this.props);
var ElementType = (0, _lib.getElementType)(SearchResult, this.props);
// Note: You technically only need the 'content' wrapper when there's an
// image. However, optionally wrapping it makes this function a lot more
// complicated and harder to read. Since always wrapping it doesn't affect
// the style in any way let's just do that.
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes, onClick: this.handleClick }),
renderer ? renderer(this.props) : defaultRenderer(this.props)
);
}
}]);
return SearchResult;
}(_react.Component);
SearchResult.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** The item currently selected by keyboard shortcut. */
active: _react.PropTypes.bool,
/** Additional classes. */
className: _react.PropTypes.string,
/** Additional text with less emphasis. */
description: _react.PropTypes.string,
/** A unique identifier. */
id: _react.PropTypes.number,
/** Add an image to the item. */
image: _react.PropTypes.string,
/**
* Called on click.
*
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All props.
*/
onClick: _react.PropTypes.func,
/** Customized text for price. */
price: _react.PropTypes.string,
/**
* A function that returns the result contents.
* Receives all SearchResult props.
*/
renderer: _react.PropTypes.func,
/** Display title. */
title: _react.PropTypes.string
};
SearchResult._meta = {
name: 'SearchResult',
parent: 'Search',
type: _lib.META.TYPES.MODULE
};
exports.default = SearchResult;
/***/ },
/* 1018 */
/*!***************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/modules/Search/SearchResults.js ***!
\***************************************************************************/
/***/ 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__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function SearchResults(props) {
var children = props.children,
className = props.className;
var classes = (0, _classnames2.default)('results transition', className);
var rest = (0, _lib.getUnhandledProps)(SearchResults, props);
var ElementType = (0, _lib.getElementType)(SearchResults, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
SearchResults._meta = {
name: 'SearchResults',
parent: 'Search',
type: _lib.META.TYPES.MODULE
};
SearchResults.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string
};
exports.default = SearchResults;
/***/ },
/* 1019 */
/*!********************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/modules/Sidebar/index.js ***!
\********************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _Sidebar = __webpack_require__(/*! ./Sidebar */ 1020);
var _Sidebar2 = _interopRequireDefault(_Sidebar);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = _Sidebar2.default;
/***/ },
/* 1020 */
/*!**********************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/modules/Sidebar/Sidebar.js ***!
\**********************************************************************/
/***/ 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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _SidebarPushable = __webpack_require__(/*! ./SidebarPushable */ 1021);
var _SidebarPushable2 = _interopRequireDefault(_SidebarPushable);
var _SidebarPusher = __webpack_require__(/*! ./SidebarPusher */ 1022);
var _SidebarPusher2 = _interopRequireDefault(_SidebarPusher);
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 _meta = {
name: 'Sidebar',
type: _lib.META.TYPES.MODULE,
props: {
animation: ['overlay', 'push', 'scale down', 'uncover', 'slide out', 'slide along'],
direction: ['top', 'right', 'bottom', 'left'],
width: ['very thin', 'thin', 'wide', 'very wide']
}
};
/**
* A sidebar hides additional content beside a page.
*/
var Sidebar = function (_Component) {
_inherits(Sidebar, _Component);
function Sidebar() {
var _ref;
var _temp, _this, _ret;
_classCallCheck(this, Sidebar);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Sidebar.__proto__ || Object.getPrototypeOf(Sidebar)).call.apply(_ref, [this].concat(args))), _this), _this.state = {}, _this.startAnimating = function () {
var duration = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 500;
clearTimeout(_this.stopAnimatingTimer);
_this.setState({ animating: true });
_this.stopAnimatingTimer = setTimeout(function () {
return _this.setState({ animating: false });
}, duration);
}, _temp), _possibleConstructorReturn(_this, _ret);
}
_createClass(Sidebar, [{
key: 'componentWillReceiveProps',
value: function componentWillReceiveProps(nextProps) {
if (nextProps.visible !== this.props.visible) {
this.startAnimating();
}
}
}, {
key: 'render',
value: function render() {
var animating = this.state.animating;
var _props = this.props,
animation = _props.animation,
className = _props.className,
children = _props.children,
direction = _props.direction,
visible = _props.visible,
width = _props.width;
var classes = (0, _classnames2.default)('ui', 'sidebar', (0, _lib.useKeyOnly)(animating, 'animating'), direction, width, animation, (0, _lib.useKeyOnly)(visible, 'visible'), className);
var rest = (0, _lib.getUnhandledProps)(Sidebar, this.props);
var ElementType = (0, _lib.getElementType)(Sidebar, this.props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
}]);
return Sidebar;
}(_lib.AutoControlledComponent);
Sidebar._meta = _meta;
Sidebar.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Animation style. */
animation: _react.PropTypes.oneOf(Sidebar._meta.props.animation),
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** Initial value of visible. */
defaultVisible: _react.PropTypes.bool,
/** Direction the sidebar should appear on */
direction: _react.PropTypes.oneOf(Sidebar._meta.props.direction),
/** Controls whether or not the sidebar is visible on the page. */
visible: _react.PropTypes.bool,
/** Sidebar width */
width: _react.PropTypes.oneOf(Sidebar._meta.props.width)
};
Sidebar.Pushable = _SidebarPushable2.default;
Sidebar.Pusher = _SidebarPusher2.default;
Sidebar.defaultProps = {
direction: 'left'
};
Sidebar.autoControlledProps = ['visible'];
exports.default = Sidebar;
/***/ },
/* 1021 */
/*!******************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/modules/Sidebar/SidebarPushable.js ***!
\******************************************************************************/
/***/ 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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* A pushable sub-component for Sidebar.
*/
function SidebarPushable(props) {
var className = props.className,
children = props.children;
var classes = (0, _classnames2.default)('pushable', className);
var rest = (0, _lib.getUnhandledProps)(SidebarPushable, props);
var ElementType = (0, _lib.getElementType)(SidebarPushable, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
SidebarPushable._meta = {
name: 'SidebarPushable',
type: _lib.META.TYPES.MODULE,
parent: 'Sidebar'
};
SidebarPushable.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string
};
exports.default = SidebarPushable;
/***/ },
/* 1022 */
/*!****************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/modules/Sidebar/SidebarPusher.js ***!
\****************************************************************************/
/***/ 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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* A pushable sub-component for Sidebar.
*/
function SidebarPusher(props) {
var className = props.className,
dimmed = props.dimmed,
children = props.children;
var classes = (0, _classnames2.default)('pusher', (0, _lib.useKeyOnly)(dimmed, 'dimmed'), className);
var rest = (0, _lib.getUnhandledProps)(SidebarPusher, props);
var ElementType = (0, _lib.getElementType)(SidebarPusher, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
SidebarPusher._meta = {
name: 'SidebarPusher',
type: _lib.META.TYPES.MODULE,
parent: 'Sidebar'
};
SidebarPusher.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** Controls whether or not the dim is displayed. */
dimmed: _react.PropTypes.bool
};
exports.default = SidebarPusher;
/***/ },
/* 1023 */
/*!**************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/views/Card/Card.js ***!
\**************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _Image = __webpack_require__(/*! ../../elements/Image */ 898);
var _Image2 = _interopRequireDefault(_Image);
var _CardContent = __webpack_require__(/*! ./CardContent */ 1024);
var _CardContent2 = _interopRequireDefault(_CardContent);
var _CardDescription = __webpack_require__(/*! ./CardDescription */ 1025);
var _CardDescription2 = _interopRequireDefault(_CardDescription);
var _CardGroup = __webpack_require__(/*! ./CardGroup */ 1028);
var _CardGroup2 = _interopRequireDefault(_CardGroup);
var _CardHeader = __webpack_require__(/*! ./CardHeader */ 1026);
var _CardHeader2 = _interopRequireDefault(_CardHeader);
var _CardMeta = __webpack_require__(/*! ./CardMeta */ 1027);
var _CardMeta2 = _interopRequireDefault(_CardMeta);
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 _meta = {
name: 'Card',
type: _lib.META.TYPES.VIEW,
props: {
color: _lib.SUI.COLORS
}
};
/**
* A card displays site content in a manner similar to a playing card
*/
var Card = function (_Component) {
_inherits(Card, _Component);
function Card() {
var _ref;
var _temp, _this, _ret;
_classCallCheck(this, Card);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Card.__proto__ || Object.getPrototypeOf(Card)).call.apply(_ref, [this].concat(args))), _this), _this.handleClick = function (e) {
var onClick = _this.props.onClick;
if (onClick) onClick(e, _this.props);
}, _temp), _possibleConstructorReturn(_this, _ret);
}
_createClass(Card, [{
key: 'render',
value: function render() {
var _props = this.props,
centered = _props.centered,
children = _props.children,
className = _props.className,
color = _props.color,
description = _props.description,
extra = _props.extra,
fluid = _props.fluid,
header = _props.header,
href = _props.href,
image = _props.image,
meta = _props.meta,
onClick = _props.onClick,
raised = _props.raised;
var classes = (0, _classnames2.default)('ui', color, (0, _lib.useKeyOnly)(centered, 'centered'), (0, _lib.useKeyOnly)(fluid, 'fluid'), (0, _lib.useKeyOnly)(raised, 'raised'), 'card', className);
var rest = (0, _lib.getUnhandledProps)(Card, this.props);
var ElementType = (0, _lib.getElementType)(Card, this.props, function () {
if (onClick) return 'a';
});
if (!(0, _isNil3.default)(children)) {
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes, href: href, onClick: this.handleClick }),
children
);
}
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes, href: href, onClick: this.handleClick }),
_Image2.default.create(image),
(description || header || meta) && _react2.default.createElement(_CardContent2.default, { description: description, header: header, meta: meta }),
extra && _react2.default.createElement(
_CardContent2.default,
{ extra: true },
extra
)
);
}
}]);
return Card;
}(_react.Component);
Card.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** A Card can center itself inside its container. */
centered: _react.PropTypes.bool,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** A Card can be formatted to display different colors. */
color: _react.PropTypes.oneOf(_meta.props.color),
/** Shorthand for CardDescription. */
description: _lib.customPropTypes.itemShorthand,
/** Shorthand for primary content of CardContent. */
extra: _lib.customPropTypes.contentShorthand,
/** A Card can be formatted to take up the width of its container. */
fluid: _react.PropTypes.bool,
/** Shorthand for CardHeader. */
header: _lib.customPropTypes.itemShorthand,
/** Render as an `a` tag instead of a `div` and adds the href attribute. */
href: _react.PropTypes.string,
/** A card can contain an Image component. */
image: _lib.customPropTypes.itemShorthand,
/** Shorthand for CardMeta. */
meta: _lib.customPropTypes.itemShorthand,
/**
* Called on click. When passed, the component renders as an `a`
* tag by default instead of a `div`.
*
* @param {SyntheticEvent} event - React's original SyntheticEvent.
* @param {object} data - All props.
*/
onClick: _react.PropTypes.func,
/** A Card can be formatted to raise above the page. */
raised: _react.PropTypes.bool
};
Card._meta = _meta;
Card.Content = _CardContent2.default;
Card.Description = _CardDescription2.default;
Card.Group = _CardGroup2.default;
Card.Header = _CardHeader2.default;
Card.Meta = _CardMeta2.default;
exports.default = Card;
/***/ },
/* 1024 */
/*!*********************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/views/Card/CardContent.js ***!
\*********************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _CardDescription = __webpack_require__(/*! ./CardDescription */ 1025);
var _CardDescription2 = _interopRequireDefault(_CardDescription);
var _CardHeader = __webpack_require__(/*! ./CardHeader */ 1026);
var _CardHeader2 = _interopRequireDefault(_CardHeader);
var _CardMeta = __webpack_require__(/*! ./CardMeta */ 1027);
var _CardMeta2 = _interopRequireDefault(_CardMeta);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* A card can contain blocks of content or extra content meant to be formatted separately from the main content
*/
function CardContent(props) {
var children = props.children,
className = props.className,
description = props.description,
extra = props.extra,
header = props.header,
meta = props.meta;
var classes = (0, _classnames2.default)(className, (0, _lib.useKeyOnly)(extra, 'extra'), 'content');
var rest = (0, _lib.getUnhandledProps)(CardContent, props);
var ElementType = (0, _lib.getElementType)(CardContent, props);
if (!(0, _isNil3.default)(children)) {
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
(0, _lib.createShorthand)(_CardHeader2.default, function (val) {
return { content: val };
}, header),
(0, _lib.createShorthand)(_CardMeta2.default, function (val) {
return { content: val };
}, meta),
(0, _lib.createShorthand)(_CardDescription2.default, function (val) {
return { content: val };
}, description)
);
}
CardContent._meta = {
name: 'CardContent',
parent: 'Card',
type: _lib.META.TYPES.VIEW
};
CardContent.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** Shorthand for CardDescription. */
description: _lib.customPropTypes.itemShorthand,
/** A card can contain extra content meant to be formatted separately from the main content */
extra: _react.PropTypes.bool,
/** Shorthand for CardHeader. */
header: _lib.customPropTypes.itemShorthand,
/** Shorthand for CardMeta. */
meta: _lib.customPropTypes.itemShorthand
};
exports.default = CardContent;
/***/ },
/* 1025 */
/*!*************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/views/Card/CardDescription.js ***!
\*************************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* A card can contain a description with one or more paragraphs
*/
function CardDescription(props) {
var children = props.children,
className = props.className,
content = props.content;
var classes = (0, _classnames2.default)(className, 'description');
var rest = (0, _lib.getUnhandledProps)(CardDescription, props);
var ElementType = (0, _lib.getElementType)(CardDescription, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
(0, _isNil3.default)(children) ? content : children
);
}
CardDescription._meta = {
name: 'CardDescription',
parent: 'Card',
type: _lib.META.TYPES.VIEW
};
CardDescription.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** Shorthand for primary content. */
content: _lib.customPropTypes.contentShorthand
};
exports.default = CardDescription;
/***/ },
/* 1026 */
/*!********************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/views/Card/CardHeader.js ***!
\********************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* A card can contain a header
*/
function CardHeader(props) {
var children = props.children,
className = props.className,
content = props.content;
var classes = (0, _classnames2.default)(className, 'header');
var rest = (0, _lib.getUnhandledProps)(CardHeader, props);
var ElementType = (0, _lib.getElementType)(CardHeader, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
(0, _isNil3.default)(children) ? content : children
);
}
CardHeader._meta = {
name: 'CardHeader',
parent: 'Card',
type: _lib.META.TYPES.VIEW
};
CardHeader.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** Shorthand for primary content. */
content: _lib.customPropTypes.contentShorthand
};
exports.default = CardHeader;
/***/ },
/* 1027 */
/*!******************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/views/Card/CardMeta.js ***!
\******************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* A card can contain content metadata
*/
function CardMeta(props) {
var children = props.children,
className = props.className,
content = props.content;
var classes = (0, _classnames2.default)(className, 'meta');
var rest = (0, _lib.getUnhandledProps)(CardMeta, props);
var ElementType = (0, _lib.getElementType)(CardMeta, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
(0, _isNil3.default)(children) ? content : children
);
}
CardMeta._meta = {
name: 'CardMeta',
parent: 'Card',
type: _lib.META.TYPES.VIEW
};
CardMeta.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** Shorthand for primary content. */
content: _lib.customPropTypes.contentShorthand
};
exports.default = CardMeta;
/***/ },
/* 1028 */
/*!*******************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/views/Card/CardGroup.js ***!
\*******************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _map2 = __webpack_require__(/*! lodash/map */ 825);
var _map3 = _interopRequireDefault(_map2);
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _Card = __webpack_require__(/*! ./Card */ 1023);
var _Card2 = _interopRequireDefault(_Card);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* A group of cards.
*/
function CardGroup(props) {
var children = props.children,
className = props.className,
doubling = props.doubling,
items = props.items,
itemsPerRow = props.itemsPerRow,
stackable = props.stackable;
var classes = (0, _classnames2.default)('ui', (0, _lib.useWidthProp)(itemsPerRow), (0, _lib.useKeyOnly)(doubling, 'doubling'), (0, _lib.useKeyOnly)(stackable, 'stackable'), className, 'cards');
var rest = (0, _lib.getUnhandledProps)(CardGroup, props);
var ElementType = (0, _lib.getElementType)(CardGroup, props);
if (!(0, _isNil3.default)(children)) {
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
var content = (0, _map3.default)(items, function (item) {
var key = item.key || [item.header, item.description].join('-');
return _react2.default.createElement(_Card2.default, _extends({ key: key }, item));
});
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
content
);
}
CardGroup._meta = {
name: 'CardGroup',
parent: 'Card',
props: {
itemsPerRow: _lib.SUI.WIDTHS
},
type: _lib.META.TYPES.VIEW
};
CardGroup.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** A group of cards can double its column width for mobile */
doubling: _react.PropTypes.bool,
/** Shorthand array of props for Card. */
items: _lib.customPropTypes.collectionShorthand,
/** A group of cards can set how many cards should exist in a row */
itemsPerRow: _react.PropTypes.oneOf(CardGroup._meta.props.itemsPerRow),
/** A group of cards can automatically stack rows to a single columns on mobile devices */
stackable: _react.PropTypes.bool
};
exports.default = CardGroup;
/***/ },
/* 1029 */
/*!******************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/views/Comment/index.js ***!
\******************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _Comment = __webpack_require__(/*! ./Comment */ 1030);
var _Comment2 = _interopRequireDefault(_Comment);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = _Comment2.default;
/***/ },
/* 1030 */
/*!********************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/views/Comment/Comment.js ***!
\********************************************************************/
/***/ 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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _CommentAction = __webpack_require__(/*! ./CommentAction */ 1031);
var _CommentAction2 = _interopRequireDefault(_CommentAction);
var _CommentActions = __webpack_require__(/*! ./CommentActions */ 1032);
var _CommentActions2 = _interopRequireDefault(_CommentActions);
var _CommentAuthor = __webpack_require__(/*! ./CommentAuthor */ 1033);
var _CommentAuthor2 = _interopRequireDefault(_CommentAuthor);
var _CommentAvatar = __webpack_require__(/*! ./CommentAvatar */ 1034);
var _CommentAvatar2 = _interopRequireDefault(_CommentAvatar);
var _CommentContent = __webpack_require__(/*! ./CommentContent */ 1035);
var _CommentContent2 = _interopRequireDefault(_CommentContent);
var _CommentGroup = __webpack_require__(/*! ./CommentGroup */ 1036);
var _CommentGroup2 = _interopRequireDefault(_CommentGroup);
var _CommentMetadata = __webpack_require__(/*! ./CommentMetadata */ 1037);
var _CommentMetadata2 = _interopRequireDefault(_CommentMetadata);
var _CommentText = __webpack_require__(/*! ./CommentText */ 1038);
var _CommentText2 = _interopRequireDefault(_CommentText);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* A comment displays user feedback to site content
* */
function Comment(props) {
var className = props.className,
children = props.children,
collapsed = props.collapsed;
var classes = (0, _classnames2.default)((0, _lib.useKeyOnly)(collapsed, 'collapsed'), 'comment', className);
var rest = (0, _lib.getUnhandledProps)(Comment, props);
var ElementType = (0, _lib.getElementType)(Comment, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
Comment._meta = {
name: 'Comment',
type: _lib.META.TYPES.VIEW
};
Comment.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** Comment can be collapsed, or hidden from view. */
collapsed: _react.PropTypes.bool
};
Comment.Author = _CommentAuthor2.default;
Comment.Action = _CommentAction2.default;
Comment.Actions = _CommentActions2.default;
Comment.Avatar = _CommentAvatar2.default;
Comment.Content = _CommentContent2.default;
Comment.Group = _CommentGroup2.default;
Comment.Metadata = _CommentMetadata2.default;
Comment.Text = _CommentText2.default;
exports.default = Comment;
/***/ },
/* 1031 */
/*!**************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/views/Comment/CommentAction.js ***!
\**************************************************************************/
/***/ 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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function CommentAction(props) {
var active = props.active,
className = props.className,
children = props.children;
var classes = (0, _classnames2.default)((0, _lib.useKeyOnly)(active, 'active'), className);
var rest = (0, _lib.getUnhandledProps)(CommentAction, props);
var ElementType = (0, _lib.getElementType)(CommentAction, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
CommentAction._meta = {
name: 'CommentAction',
parent: 'Comment',
type: _lib.META.TYPES.VIEW
};
CommentAction.defaultProps = {
as: 'a'
};
CommentAction.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Style as the currently active action. */
active: _react.PropTypes.bool,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string
};
exports.default = CommentAction;
/***/ },
/* 1032 */
/*!***************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/views/Comment/CommentActions.js ***!
\***************************************************************************/
/***/ 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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function CommentActions(props) {
var className = props.className,
children = props.children;
var classes = (0, _classnames2.default)('actions', className);
var rest = (0, _lib.getUnhandledProps)(CommentActions, props);
var ElementType = (0, _lib.getElementType)(CommentActions, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
CommentActions._meta = {
name: 'CommentActions',
parent: 'Comment',
type: _lib.META.TYPES.VIEW
};
CommentActions.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string
};
exports.default = CommentActions;
/***/ },
/* 1033 */
/*!**************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/views/Comment/CommentAuthor.js ***!
\**************************************************************************/
/***/ 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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function CommentAuthor(props) {
var className = props.className,
children = props.children;
var classes = (0, _classnames2.default)('author', className);
var rest = (0, _lib.getUnhandledProps)(CommentAuthor, props);
var ElementType = (0, _lib.getElementType)(CommentAuthor, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
CommentAuthor._meta = {
name: 'CommentAuthor',
parent: 'Comment',
type: _lib.META.TYPES.VIEW
};
CommentAuthor.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string
};
exports.default = CommentAuthor;
/***/ },
/* 1034 */
/*!**************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/views/Comment/CommentAvatar.js ***!
\**************************************************************************/
/***/ 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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function CommentAvatar(props) {
var className = props.className,
src = props.src;
var classes = (0, _classnames2.default)('avatar', className);
var rest = (0, _lib.getUnhandledProps)(CommentAvatar, props);
var ElementType = (0, _lib.getElementType)(CommentAvatar, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
(0, _lib.createHTMLImage)(src)
);
}
CommentAvatar._meta = {
name: 'CommentAvatar',
parent: 'Comment',
type: _lib.META.TYPES.VIEW
};
CommentAvatar.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Additional classes. */
className: _react.PropTypes.string,
/** Specifies the URL of the image. */
src: _react.PropTypes.string
};
exports.default = CommentAvatar;
/***/ },
/* 1035 */
/*!***************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/views/Comment/CommentContent.js ***!
\***************************************************************************/
/***/ 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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function CommentContent(props) {
var className = props.className,
children = props.children;
var classes = (0, _classnames2.default)('content', className);
var rest = (0, _lib.getUnhandledProps)(CommentContent, props);
var ElementType = (0, _lib.getElementType)(CommentContent, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
CommentContent._meta = {
name: 'CommentContent',
parent: 'Comment',
type: _lib.META.TYPES.VIEW
};
CommentContent.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string
};
exports.default = CommentContent;
/***/ },
/* 1036 */
/*!*************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/views/Comment/CommentGroup.js ***!
\*************************************************************************/
/***/ 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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function CommentGroup(props) {
var className = props.className,
children = props.children,
collapsed = props.collapsed,
minimal = props.minimal,
threaded = props.threaded;
var classes = (0, _classnames2.default)('ui', (0, _lib.useKeyOnly)(collapsed, 'collapsed'), (0, _lib.useKeyOnly)(minimal, 'minimal'), (0, _lib.useKeyOnly)(threaded, 'threaded'), 'comments', className);
var rest = (0, _lib.getUnhandledProps)(CommentGroup, props);
var ElementType = (0, _lib.getElementType)(CommentGroup, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
CommentGroup._meta = {
name: 'CommentGroup',
parent: 'Comment',
type: _lib.META.TYPES.VIEW
};
CommentGroup.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** Comments can be collapsed, or hidden from view. */
collapsed: _react.PropTypes.bool,
/** Comments can hide extra information unless a user shows intent to interact with a comment */
minimal: _react.PropTypes.bool,
/** A comment list can be threaded to showing the relationship between conversations */
threaded: _react.PropTypes.bool
};
exports.default = CommentGroup;
/***/ },
/* 1037 */
/*!****************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/views/Comment/CommentMetadata.js ***!
\****************************************************************************/
/***/ 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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function CommentMetadata(props) {
var className = props.className,
children = props.children;
var classes = (0, _classnames2.default)('metadata', className);
var rest = (0, _lib.getUnhandledProps)(CommentMetadata, props);
var ElementType = (0, _lib.getElementType)(CommentMetadata, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
CommentMetadata._meta = {
name: 'CommentMetadata',
parent: 'Comment',
type: _lib.META.TYPES.VIEW
};
CommentMetadata.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string
};
exports.default = CommentMetadata;
/***/ },
/* 1038 */
/*!************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/views/Comment/CommentText.js ***!
\************************************************************************/
/***/ 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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function CommentText(props) {
var className = props.className,
children = props.children;
var classes = (0, _classnames2.default)('text', className);
var rest = (0, _lib.getUnhandledProps)(CommentText, props);
var ElementType = (0, _lib.getElementType)(CommentText, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
CommentText._meta = {
name: 'CommentText',
parent: 'Comment',
type: _lib.META.TYPES.VIEW
};
CommentText.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string
};
exports.default = CommentText;
/***/ },
/* 1039 */
/*!***************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/views/Feed/index.js ***!
\***************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _Feed = __webpack_require__(/*! ./Feed */ 1040);
var _Feed2 = _interopRequireDefault(_Feed);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = _Feed2.default;
/***/ },
/* 1040 */
/*!**************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/views/Feed/Feed.js ***!
\**************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _without2 = __webpack_require__(/*! lodash/without */ 846);
var _without3 = _interopRequireDefault(_without2);
var _map2 = __webpack_require__(/*! lodash/map */ 825);
var _map3 = _interopRequireDefault(_map2);
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _FeedContent = __webpack_require__(/*! ./FeedContent */ 1041);
var _FeedContent2 = _interopRequireDefault(_FeedContent);
var _FeedDate = __webpack_require__(/*! ./FeedDate */ 1042);
var _FeedDate2 = _interopRequireDefault(_FeedDate);
var _FeedEvent = __webpack_require__(/*! ./FeedEvent */ 1048);
var _FeedEvent2 = _interopRequireDefault(_FeedEvent);
var _FeedExtra = __webpack_require__(/*! ./FeedExtra */ 1043);
var _FeedExtra2 = _interopRequireDefault(_FeedExtra);
var _FeedLabel = __webpack_require__(/*! ./FeedLabel */ 1049);
var _FeedLabel2 = _interopRequireDefault(_FeedLabel);
var _FeedLike = __webpack_require__(/*! ./FeedLike */ 1045);
var _FeedLike2 = _interopRequireDefault(_FeedLike);
var _FeedMeta = __webpack_require__(/*! ./FeedMeta */ 1044);
var _FeedMeta2 = _interopRequireDefault(_FeedMeta);
var _FeedSummary = __webpack_require__(/*! ./FeedSummary */ 1046);
var _FeedSummary2 = _interopRequireDefault(_FeedSummary);
var _FeedUser = __webpack_require__(/*! ./FeedUser */ 1047);
var _FeedUser2 = _interopRequireDefault(_FeedUser);
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 Feed(props) {
var children = props.children,
className = props.className,
events = props.events,
size = props.size;
var classes = (0, _classnames2.default)('ui', className, size, 'feed');
var rest = (0, _lib.getUnhandledProps)(Feed, props);
var ElementType = (0, _lib.getElementType)(Feed, props);
if (!(0, _isNil3.default)(children)) {
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
var eventElements = (0, _map3.default)(events, function (eventProps) {
var childKey = eventProps.childKey,
date = eventProps.date,
meta = eventProps.meta,
summary = eventProps.summary,
eventData = _objectWithoutProperties(eventProps, ['childKey', 'date', 'meta', 'summary']);
var finalKey = childKey || [date, meta, summary].join('-');
return _react2.default.createElement(_FeedEvent2.default, _extends({
date: date,
key: finalKey,
meta: meta,
summary: summary
}, eventData));
});
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
eventElements
);
}
Feed._meta = {
name: 'Feed',
type: _lib.META.TYPES.VIEW,
props: {
size: (0, _without3.default)(_lib.SUI.SIZES, 'mini', 'tiny', 'medium', 'big', 'huge', 'massive')
}
};
Feed.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** Shorthand array of props for FeedEvent. */
events: _lib.customPropTypes.collectionShorthand,
/** A feed can have different sizes. */
size: _react.PropTypes.oneOf(Feed._meta.props.size)
};
Feed.Content = _FeedContent2.default;
Feed.Date = _FeedDate2.default;
Feed.Event = _FeedEvent2.default;
Feed.Extra = _FeedExtra2.default;
Feed.Label = _FeedLabel2.default;
Feed.Like = _FeedLike2.default;
Feed.Meta = _FeedMeta2.default;
Feed.Summary = _FeedSummary2.default;
Feed.User = _FeedUser2.default;
exports.default = Feed;
/***/ },
/* 1041 */
/*!*********************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/views/Feed/FeedContent.js ***!
\*********************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _FeedDate = __webpack_require__(/*! ./FeedDate */ 1042);
var _FeedDate2 = _interopRequireDefault(_FeedDate);
var _FeedExtra = __webpack_require__(/*! ./FeedExtra */ 1043);
var _FeedExtra2 = _interopRequireDefault(_FeedExtra);
var _FeedMeta = __webpack_require__(/*! ./FeedMeta */ 1044);
var _FeedMeta2 = _interopRequireDefault(_FeedMeta);
var _FeedSummary = __webpack_require__(/*! ./FeedSummary */ 1046);
var _FeedSummary2 = _interopRequireDefault(_FeedSummary);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function FeedContent(props) {
var children = props.children,
className = props.className,
content = props.content,
extraImages = props.extraImages,
extraText = props.extraText,
date = props.date,
meta = props.meta,
summary = props.summary;
var classes = (0, _classnames2.default)(className, 'content');
var rest = (0, _lib.getUnhandledProps)(FeedContent, props);
var ElementType = (0, _lib.getElementType)(FeedContent, props);
if (!(0, _isNil3.default)(children)) {
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
(0, _lib.createShorthand)(_FeedDate2.default, function (val) {
return { content: val };
}, date),
(0, _lib.createShorthand)(_FeedSummary2.default, function (val) {
return { content: val };
}, summary),
content,
(0, _lib.createShorthand)(_FeedExtra2.default, function (val) {
return { text: true, content: val };
}, extraText),
(0, _lib.createShorthand)(_FeedExtra2.default, function (val) {
return { images: val };
}, extraImages),
(0, _lib.createShorthand)(_FeedMeta2.default, function (val) {
return { content: val };
}, meta)
);
}
FeedContent._meta = {
name: 'FeedContent',
parent: 'Feed',
type: _lib.META.TYPES.VIEW
};
FeedContent.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** Shorthand for primary content. */
content: _lib.customPropTypes.contentShorthand,
/** An event can contain a date. */
date: _lib.customPropTypes.itemShorthand,
/** Shorthand for FeedExtra with images. */
extraImages: _FeedExtra2.default.propTypes.images,
/** Shorthand for FeedExtra with text. */
extraText: _lib.customPropTypes.itemShorthand,
/** Shorthand for FeedMeta. */
meta: _lib.customPropTypes.itemShorthand,
/** Shorthand for FeedSummary. */
summary: _lib.customPropTypes.itemShorthand
};
exports.default = FeedContent;
/***/ },
/* 1042 */
/*!******************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/views/Feed/FeedDate.js ***!
\******************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Show a feed date
*/
function FeedDate(props) {
var children = props.children,
className = props.className,
content = props.content;
var classes = (0, _classnames2.default)(className, 'date');
var rest = (0, _lib.getUnhandledProps)(FeedDate, props);
var ElementType = (0, _lib.getElementType)(FeedDate, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
(0, _isNil3.default)(children) ? content : children
);
}
FeedDate._meta = {
name: 'FeedDate',
parent: 'Feed',
type: _lib.META.TYPES.VIEW
};
FeedDate.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** Shorthand for primary content. */
content: _lib.customPropTypes.contentShorthand
};
exports.default = FeedDate;
/***/ },
/* 1043 */
/*!*******************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/views/Feed/FeedExtra.js ***!
\*******************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _map2 = __webpack_require__(/*! lodash/map */ 825);
var _map3 = _interopRequireDefault(_map2);
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function FeedExtra(props) {
var children = props.children,
className = props.className,
content = props.content,
images = props.images,
text = props.text;
var classes = (0, _classnames2.default)(className, (0, _lib.useKeyOnly)(images, 'images'), (0, _lib.useKeyOnly)(content || text, 'text'), 'extra');
var rest = (0, _lib.getUnhandledProps)(FeedExtra, props);
var ElementType = (0, _lib.getElementType)(FeedExtra, props);
if (!(0, _isNil3.default)(children)) {
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
// TODO need a "collection factory" to handle creating multiple image elements and their keys
var imageElements = (0, _map3.default)(images, function (image, index) {
var key = [index, image].join('-');
return (0, _lib.createHTMLImage)(image, { key: key });
});
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
content,
imageElements
);
}
FeedExtra._meta = {
name: 'FeedExtra',
parent: 'Feed',
type: _lib.META.TYPES.VIEW
};
FeedExtra.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** Shorthand for primary content. */
content: _lib.customPropTypes.contentShorthand,
/** An event can contain additional information like a set of images. */
images: _lib.customPropTypes.every([_lib.customPropTypes.disallow(['text']), _react.PropTypes.oneOfType([_react.PropTypes.bool, _lib.customPropTypes.collectionShorthand])]),
/** An event can contain additional text information. */
text: _react.PropTypes.bool
};
exports.default = FeedExtra;
/***/ },
/* 1044 */
/*!******************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/views/Feed/FeedMeta.js ***!
\******************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _FeedLike = __webpack_require__(/*! ./FeedLike */ 1045);
var _FeedLike2 = _interopRequireDefault(_FeedLike);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function FeedMeta(props) {
var children = props.children,
className = props.className,
content = props.content,
like = props.like;
var classes = (0, _classnames2.default)(className, 'meta');
var rest = (0, _lib.getUnhandledProps)(FeedMeta, props);
var ElementType = (0, _lib.getElementType)(FeedMeta, props);
if (!(0, _isNil3.default)(children)) {
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
(0, _lib.createShorthand)(_FeedLike2.default, function (val) {
return { content: val };
}, like),
content
);
}
FeedMeta._meta = {
name: 'FeedMeta',
parent: 'Feed',
type: _lib.META.TYPES.VIEW
};
FeedMeta.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** Shorthand for primary content. */
content: _lib.customPropTypes.contentShorthand,
/** Shorthand for FeedLike. */
like: _lib.customPropTypes.itemShorthand
};
exports.default = FeedMeta;
/***/ },
/* 1045 */
/*!******************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/views/Feed/FeedLike.js ***!
\******************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _Icon = __webpack_require__(/*! ../../elements/Icon */ 874);
var _Icon2 = _interopRequireDefault(_Icon);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function FeedLike(props) {
var children = props.children,
className = props.className,
content = props.content,
icon = props.icon;
var classes = (0, _classnames2.default)(className, 'like');
var rest = (0, _lib.getUnhandledProps)(FeedLike, props);
var ElementType = (0, _lib.getElementType)(FeedLike, props);
if (!(0, _isNil3.default)(children)) {
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
_Icon2.default.create(icon),
content
);
}
FeedLike._meta = {
name: 'FeedLike',
parent: 'Feed',
type: _lib.META.TYPES.VIEW
};
FeedLike.defaultProps = {
as: 'a'
};
FeedLike.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** Shorthand for primary content. */
content: _lib.customPropTypes.contentShorthand,
/** Shorthand for icon. Mutually exclusive with children. */
icon: _lib.customPropTypes.itemShorthand
};
exports.default = FeedLike;
/***/ },
/* 1046 */
/*!*********************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/views/Feed/FeedSummary.js ***!
\*********************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _FeedDate = __webpack_require__(/*! ./FeedDate */ 1042);
var _FeedDate2 = _interopRequireDefault(_FeedDate);
var _FeedUser = __webpack_require__(/*! ./FeedUser */ 1047);
var _FeedUser2 = _interopRequireDefault(_FeedUser);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function FeedSummary(props) {
var children = props.children,
className = props.className,
content = props.content,
date = props.date,
user = props.user;
var classes = (0, _classnames2.default)(className, 'summary');
var rest = (0, _lib.getUnhandledProps)(FeedSummary, props);
var ElementType = (0, _lib.getElementType)(FeedSummary, props);
if (!(0, _isNil3.default)(children)) {
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
(0, _lib.createShorthand)(_FeedUser2.default, function (val) {
return { content: val };
}, user),
content,
(0, _lib.createShorthand)(_FeedDate2.default, function (val) {
return { content: val };
}, date)
);
}
FeedSummary._meta = {
name: 'FeedSummary',
parent: 'Feed',
type: _lib.META.TYPES.VIEW
};
FeedSummary.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** Shorthand for primary content. */
content: _lib.customPropTypes.contentShorthand,
/** Shorthand for FeedDate. */
date: _lib.customPropTypes.itemShorthand,
/** Shorthand for FeedUser. */
user: _lib.customPropTypes.itemShorthand
};
exports.default = FeedSummary;
/***/ },
/* 1047 */
/*!******************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/views/Feed/FeedUser.js ***!
\******************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function FeedUser(props) {
var children = props.children,
className = props.className,
content = props.content;
var classes = (0, _classnames2.default)(className, 'user');
var rest = (0, _lib.getUnhandledProps)(FeedUser, props);
var ElementType = (0, _lib.getElementType)(FeedUser, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
(0, _isNil3.default)(children) ? content : children
);
}
FeedUser._meta = {
name: 'FeedUser',
parent: 'Feed',
type: _lib.META.TYPES.VIEW
};
FeedUser.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** Shorthand for primary content. */
content: _lib.customPropTypes.contentShorthand
};
FeedUser.defaultProps = {
as: 'a'
};
exports.default = FeedUser;
/***/ },
/* 1048 */
/*!*******************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/views/Feed/FeedEvent.js ***!
\*******************************************************************/
/***/ 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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _FeedContent = __webpack_require__(/*! ./FeedContent */ 1041);
var _FeedContent2 = _interopRequireDefault(_FeedContent);
var _FeedLabel = __webpack_require__(/*! ./FeedLabel */ 1049);
var _FeedLabel2 = _interopRequireDefault(_FeedLabel);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function FeedEvent(props) {
var content = props.content,
children = props.children,
className = props.className,
date = props.date,
extraImages = props.extraImages,
extraText = props.extraText,
image = props.image,
icon = props.icon,
meta = props.meta,
summary = props.summary;
var classes = (0, _classnames2.default)(className, 'event');
var rest = (0, _lib.getUnhandledProps)(FeedEvent, props);
var ElementType = (0, _lib.getElementType)(FeedEvent, props);
var hasContentProp = content || date || extraImages || extraText || meta || summary;
var contentProps = { content: content, date: date, extraImages: extraImages, extraText: extraText, meta: meta, summary: summary };
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
(0, _lib.createShorthand)(_FeedLabel2.default, function (val) {
return { icon: val };
}, icon),
(0, _lib.createShorthand)(_FeedLabel2.default, function (val) {
return { image: val };
}, image),
hasContentProp && _react2.default.createElement(_FeedContent2.default, contentProps),
children
);
}
FeedEvent._meta = {
name: 'FeedEvent',
parent: 'Feed',
type: _lib.META.TYPES.VIEW
};
FeedEvent.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** Shorthand for FeedContent. */
content: _FeedContent2.default.propTypes.content,
/** Shorthand for FeedDate. */
date: _FeedContent2.default.propTypes.date,
/** Shorthand for FeedExtra with images. */
extraImages: _FeedContent2.default.propTypes.extraImages,
/** Shorthand for FeedExtra with content. */
extraText: _FeedContent2.default.propTypes.extraText,
/** An event can contain icon label. */
icon: _lib.customPropTypes.itemShorthand,
/** An event can contain image label. */
image: _lib.customPropTypes.itemShorthand,
/** Shorthand for FeedMeta. */
meta: _FeedContent2.default.propTypes.meta,
/** Shorthand for FeedSummary. */
summary: _FeedContent2.default.propTypes.summary
};
exports.default = FeedEvent;
/***/ },
/* 1049 */
/*!*******************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/views/Feed/FeedLabel.js ***!
\*******************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _Icon = __webpack_require__(/*! ../../elements/Icon */ 874);
var _Icon2 = _interopRequireDefault(_Icon);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function FeedLabel(props) {
var children = props.children,
className = props.className,
content = props.content,
icon = props.icon,
image = props.image;
var classes = (0, _classnames2.default)(className, 'label');
var rest = (0, _lib.getUnhandledProps)(FeedLabel, props);
var ElementType = (0, _lib.getElementType)(FeedLabel, props);
if (!(0, _isNil3.default)(children)) {
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
content,
_Icon2.default.create(icon),
(0, _lib.createHTMLImage)(image)
);
}
FeedLabel._meta = {
name: 'FeedLabel',
parent: 'Feed',
type: _lib.META.TYPES.VIEW
};
FeedLabel.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** Shorthand for primary content. */
content: _lib.customPropTypes.contentShorthand,
/** An event can contain icon label. */
icon: _lib.customPropTypes.itemShorthand,
/** An event can contain image label. */
image: _lib.customPropTypes.itemShorthand
};
exports.default = FeedLabel;
/***/ },
/* 1050 */
/*!***************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/views/Item/index.js ***!
\***************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _Item = __webpack_require__(/*! ./Item */ 1051);
var _Item2 = _interopRequireDefault(_Item);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = _Item2.default;
/***/ },
/* 1051 */
/*!**************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/views/Item/Item.js ***!
\**************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _ItemContent = __webpack_require__(/*! ./ItemContent */ 1052);
var _ItemContent2 = _interopRequireDefault(_ItemContent);
var _ItemDescription = __webpack_require__(/*! ./ItemDescription */ 1054);
var _ItemDescription2 = _interopRequireDefault(_ItemDescription);
var _ItemExtra = __webpack_require__(/*! ./ItemExtra */ 1055);
var _ItemExtra2 = _interopRequireDefault(_ItemExtra);
var _ItemGroup = __webpack_require__(/*! ./ItemGroup */ 1057);
var _ItemGroup2 = _interopRequireDefault(_ItemGroup);
var _ItemHeader = __webpack_require__(/*! ./ItemHeader */ 1053);
var _ItemHeader2 = _interopRequireDefault(_ItemHeader);
var _ItemImage = __webpack_require__(/*! ./ItemImage */ 1058);
var _ItemImage2 = _interopRequireDefault(_ItemImage);
var _ItemMeta = __webpack_require__(/*! ./ItemMeta */ 1056);
var _ItemMeta2 = _interopRequireDefault(_ItemMeta);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* An item view presents large collections of site content for display
**/
function Item(props) {
var children = props.children,
className = props.className,
content = props.content,
description = props.description,
extra = props.extra,
header = props.header,
image = props.image,
meta = props.meta;
var classes = (0, _classnames2.default)(className, 'item');
var rest = (0, _lib.getUnhandledProps)(Item, props);
var ElementType = (0, _lib.getElementType)(Item, props);
if (!(0, _isNil3.default)(children)) {
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
(0, _lib.createShorthand)(_ItemImage2.default, function (val) {
return { src: val };
}, image),
_react2.default.createElement(_ItemContent2.default, {
content: content,
description: description,
extra: extra,
header: header,
meta: meta
})
);
}
Item._meta = {
name: 'Item',
type: _lib.META.TYPES.VIEW
};
Item.Content = _ItemContent2.default;
Item.Description = _ItemDescription2.default;
Item.Extra = _ItemExtra2.default;
Item.Group = _ItemGroup2.default;
Item.Header = _ItemHeader2.default;
Item.Image = _ItemImage2.default;
Item.Meta = _ItemMeta2.default;
Item.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** Shorthand for ItemContent component. */
content: _lib.customPropTypes.contentShorthand,
/** Shorthand for ItemDescription component. */
description: _lib.customPropTypes.itemShorthand,
/** Shorthand for ItemExtra component. */
extra: _lib.customPropTypes.itemShorthand,
/** Shorthand for ItemImage component. */
image: _lib.customPropTypes.itemShorthand,
/** Shorthand for ItemHeader component. */
header: _lib.customPropTypes.itemShorthand,
/** Shorthand for ItemMeta component. */
meta: _lib.customPropTypes.itemShorthand
};
exports.default = Item;
/***/ },
/* 1052 */
/*!*********************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/views/Item/ItemContent.js ***!
\*********************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _ItemHeader = __webpack_require__(/*! ./ItemHeader */ 1053);
var _ItemHeader2 = _interopRequireDefault(_ItemHeader);
var _ItemDescription = __webpack_require__(/*! ./ItemDescription */ 1054);
var _ItemDescription2 = _interopRequireDefault(_ItemDescription);
var _ItemExtra = __webpack_require__(/*! ./ItemExtra */ 1055);
var _ItemExtra2 = _interopRequireDefault(_ItemExtra);
var _ItemMeta = __webpack_require__(/*! ./ItemMeta */ 1056);
var _ItemMeta2 = _interopRequireDefault(_ItemMeta);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* An item can contain content
**/
function ItemContent(props) {
var children = props.children,
className = props.className,
content = props.content,
description = props.description,
extra = props.extra,
header = props.header,
meta = props.meta,
verticalAlign = props.verticalAlign;
var classes = (0, _classnames2.default)(className, (0, _lib.useVerticalAlignProp)(verticalAlign), 'content');
var rest = (0, _lib.getUnhandledProps)(ItemContent, props);
var ElementType = (0, _lib.getElementType)(ItemContent, props);
if (!(0, _isNil3.default)(children)) {
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
(0, _lib.createShorthand)(_ItemHeader2.default, function (val) {
return { content: val };
}, header),
(0, _lib.createShorthand)(_ItemMeta2.default, function (val) {
return { content: val };
}, meta),
(0, _lib.createShorthand)(_ItemDescription2.default, function (val) {
return { content: val };
}, description),
(0, _lib.createShorthand)(_ItemExtra2.default, function (val) {
return { content: val };
}, extra),
content
);
}
ItemContent._meta = {
name: 'ItemContent',
parent: 'Item',
type: _lib.META.TYPES.VIEW,
props: {
verticalAlign: _lib.SUI.VERTICAL_ALIGNMENTS
}
};
ItemContent.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** Shorthand for primary content. */
content: _lib.customPropTypes.contentShorthand,
/** Shorthand for ItemDescription component. */
description: _lib.customPropTypes.itemShorthand,
/** Shorthand for ItemExtra component. */
extra: _lib.customPropTypes.itemShorthand,
/** Shorthand for ItemHeader component. */
header: _lib.customPropTypes.itemShorthand,
/** Shorthand for ItemMeta component. */
meta: _lib.customPropTypes.itemShorthand,
/** Content can specify its vertical alignment */
verticalAlign: _react.PropTypes.oneOf(ItemContent._meta.props.verticalAlign)
};
exports.default = ItemContent;
/***/ },
/* 1053 */
/*!********************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/views/Item/ItemHeader.js ***!
\********************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* An item can contain a header
**/
function ItemHeader(props) {
var children = props.children,
className = props.className,
content = props.content;
var classes = (0, _classnames2.default)(className, 'header');
var rest = (0, _lib.getUnhandledProps)(ItemHeader, props);
var ElementType = (0, _lib.getElementType)(ItemHeader, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
(0, _isNil3.default)(children) ? content : children
);
}
ItemHeader._meta = {
name: 'ItemHeader',
parent: 'Item',
type: _lib.META.TYPES.VIEW
};
ItemHeader.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** Shorthand for primary content. */
content: _lib.customPropTypes.contentShorthand
};
exports.default = ItemHeader;
/***/ },
/* 1054 */
/*!*************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/views/Item/ItemDescription.js ***!
\*************************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* An item can contain a description with a single or multiple paragraphs
**/
function ItemDescription(props) {
var children = props.children,
className = props.className,
content = props.content;
var classes = (0, _classnames2.default)(className, 'description');
var rest = (0, _lib.getUnhandledProps)(ItemDescription, props);
var ElementType = (0, _lib.getElementType)(ItemDescription, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
(0, _isNil3.default)(children) ? content : children
);
}
ItemDescription._meta = {
name: 'ItemDescription',
parent: 'Item',
type: _lib.META.TYPES.VIEW
};
ItemDescription.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** Shorthand for primary content. */
content: _lib.customPropTypes.contentShorthand
};
exports.default = ItemDescription;
/***/ },
/* 1055 */
/*!*******************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/views/Item/ItemExtra.js ***!
\*******************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* An item can contain extra content meant to be formatted separately from the main content
**/
function ItemExtra(props) {
var children = props.children,
className = props.className,
content = props.content;
var classes = (0, _classnames2.default)(className, 'extra');
var rest = (0, _lib.getUnhandledProps)(ItemExtra, props);
var ElementType = (0, _lib.getElementType)(ItemExtra, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
(0, _isNil3.default)(children) ? content : children
);
}
ItemExtra._meta = {
name: 'ItemExtra',
parent: 'Item',
type: _lib.META.TYPES.VIEW
};
ItemExtra.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** Shorthand for primary content. */
content: _lib.customPropTypes.contentShorthand
};
exports.default = ItemExtra;
/***/ },
/* 1056 */
/*!******************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/views/Item/ItemMeta.js ***!
\******************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* An item can contain content metadata.
**/
function ItemMeta(props) {
var children = props.children,
className = props.className,
content = props.content;
var classes = (0, _classnames2.default)(className, 'meta');
var rest = (0, _lib.getUnhandledProps)(ItemMeta, props);
var ElementType = (0, _lib.getElementType)(ItemMeta, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
(0, _isNil3.default)(children) ? content : children
);
}
ItemMeta._meta = {
name: 'ItemMeta',
parent: 'Item',
type: _lib.META.TYPES.VIEW
};
ItemMeta.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** Shorthand for primary content. */
content: _lib.customPropTypes.contentShorthand
};
exports.default = ItemMeta;
/***/ },
/* 1057 */
/*!*******************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/views/Item/ItemGroup.js ***!
\*******************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _map2 = __webpack_require__(/*! lodash/map */ 825);
var _map3 = _interopRequireDefault(_map2);
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _Item = __webpack_require__(/*! ./Item */ 1051);
var _Item2 = _interopRequireDefault(_Item);
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; }
/**
* A group of items
**/
function ItemGroup(props) {
var children = props.children,
className = props.className,
divided = props.divided,
items = props.items,
link = props.link,
relaxed = props.relaxed;
var classes = (0, _classnames2.default)('ui', className, (0, _lib.useKeyOnly)(divided, 'divided'), (0, _lib.useKeyOnly)(link, 'link'), (0, _lib.useKeyOrValueAndKey)(relaxed, 'relaxed'), 'items');
var rest = (0, _lib.getUnhandledProps)(ItemGroup, props);
var ElementType = (0, _lib.getElementType)(ItemGroup, props);
if (!(0, _isNil3.default)(children)) {
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
var itemsJSX = (0, _map3.default)(items, function (item) {
var childKey = item.childKey,
itemProps = _objectWithoutProperties(item, ['childKey']);
var finalKey = childKey || [itemProps.content, itemProps.description, itemProps.header, itemProps.meta].join('-');
return _react2.default.createElement(_Item2.default, _extends({}, itemProps, { key: finalKey }));
});
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
itemsJSX
);
}
ItemGroup._meta = {
name: 'ItemGroup',
type: _lib.META.TYPES.VIEW,
parent: 'Item',
props: {
relaxed: ['very']
}
};
ItemGroup.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** Items can be divided to better distinguish between grouped content. */
divided: _react.PropTypes.bool,
/** Shorthand array of props for Item. */
items: _lib.customPropTypes.collectionShorthand,
/** An item can be formatted so that the entire contents link to another page. */
link: _react.PropTypes.bool,
/** A group of items can relax its padding to provide more negative space. */
relaxed: _react.PropTypes.oneOfType([_react.PropTypes.bool, _react.PropTypes.oneOf(ItemGroup._meta.props.relaxed)])
};
exports.default = ItemGroup;
/***/ },
/* 1058 */
/*!*******************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/views/Item/ItemImage.js ***!
\*******************************************************************/
/***/ 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__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _Image = __webpack_require__(/*! ../../elements/Image */ 898);
var _Image2 = _interopRequireDefault(_Image);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* An item can contain an image
**/
function ItemImage(props) {
var size = props.size;
var rest = (0, _lib.getUnhandledProps)(ItemImage, props);
return _react2.default.createElement(_Image2.default, _extends({}, rest, { size: size, ui: !!size, wrapped: true }));
}
ItemImage._meta = {
name: 'ItemImage',
parent: 'Item',
type: _lib.META.TYPES.VIEW
};
ItemImage.propTypes = {
/** An image may appear at different sizes */
size: _react.PropTypes.oneOf(_Image2.default._meta.props.size)
};
exports.default = ItemImage;
/***/ },
/* 1059 */
/*!********************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/views/Statistic/index.js ***!
\********************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _Statistic = __webpack_require__(/*! ./Statistic */ 1060);
var _Statistic2 = _interopRequireDefault(_Statistic);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = _Statistic2.default;
/***/ },
/* 1060 */
/*!************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/views/Statistic/Statistic.js ***!
\************************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _without2 = __webpack_require__(/*! lodash/without */ 846);
var _without3 = _interopRequireDefault(_without2);
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _StatisticGroup = __webpack_require__(/*! ./StatisticGroup */ 1061);
var _StatisticGroup2 = _interopRequireDefault(_StatisticGroup);
var _StatisticLabel = __webpack_require__(/*! ./StatisticLabel */ 1062);
var _StatisticLabel2 = _interopRequireDefault(_StatisticLabel);
var _StatisticValue = __webpack_require__(/*! ./StatisticValue */ 1063);
var _StatisticValue2 = _interopRequireDefault(_StatisticValue);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* A statistic emphasizes the current value of an attribute
*/
function Statistic(props) {
var children = props.children,
className = props.className,
color = props.color,
floated = props.floated,
horizontal = props.horizontal,
inverted = props.inverted,
label = props.label,
size = props.size,
text = props.text,
value = props.value;
var classes = (0, _classnames2.default)('ui', color, (0, _lib.useValueAndKey)(floated, 'floated'), (0, _lib.useKeyOnly)(horizontal, 'horizontal'), (0, _lib.useKeyOnly)(inverted, 'inverted'), size, className, 'statistic');
var rest = (0, _lib.getUnhandledProps)(Statistic, props);
var ElementType = (0, _lib.getElementType)(Statistic, props);
if (!(0, _isNil3.default)(children)) {
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
_react2.default.createElement(_StatisticValue2.default, { text: text, value: value }),
_react2.default.createElement(_StatisticLabel2.default, { label: label })
);
}
Statistic._meta = {
name: 'Statistic',
type: _lib.META.TYPES.VIEW,
props: {
color: _lib.SUI.COLORS,
floated: _lib.SUI.FLOATS,
size: (0, _without3.default)(_lib.SUI.SIZES, 'big', 'massive', 'medium')
}
};
Statistic.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** A statistic can be formatted to be different colors. */
color: _react.PropTypes.oneOf(Statistic._meta.props.color),
/** A statistic can sit to the left or right of other content. */
floated: _react.PropTypes.oneOf(Statistic._meta.props.floated),
/** A statistic can present its measurement horizontally. */
horizontal: _react.PropTypes.bool,
/** A statistic can be formatted to fit on a dark background. */
inverted: _react.PropTypes.bool,
/** Label content of the Statistic. */
label: _lib.customPropTypes.contentShorthand,
/** A statistic can vary in size. */
size: _react.PropTypes.oneOf(Statistic._meta.props.size),
/** Format the StatisticValue with smaller font size to fit nicely beside number values. */
text: _react.PropTypes.bool,
/** Value content of the Statistic. */
value: _lib.customPropTypes.contentShorthand
};
Statistic.Group = _StatisticGroup2.default;
Statistic.Label = _StatisticLabel2.default;
Statistic.Value = _StatisticValue2.default;
exports.default = Statistic;
/***/ },
/* 1061 */
/*!*****************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/views/Statistic/StatisticGroup.js ***!
\*****************************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _without2 = __webpack_require__(/*! lodash/without */ 846);
var _without3 = _interopRequireDefault(_without2);
var _map2 = __webpack_require__(/*! lodash/map */ 825);
var _map3 = _interopRequireDefault(_map2);
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
var _Statistic = __webpack_require__(/*! ./Statistic */ 1060);
var _Statistic2 = _interopRequireDefault(_Statistic);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function StatisticGroup(props) {
var children = props.children,
className = props.className,
color = props.color,
horizontal = props.horizontal,
inverted = props.inverted,
items = props.items,
size = props.size,
widths = props.widths;
var classes = (0, _classnames2.default)('ui', color, (0, _lib.useKeyOnly)(horizontal, 'horizontal'), (0, _lib.useKeyOnly)(inverted, 'inverted'), (0, _lib.useWidthProp)(widths), size, 'statistics', className);
var rest = (0, _lib.getUnhandledProps)(StatisticGroup, props);
var ElementType = (0, _lib.getElementType)(StatisticGroup, props);
if (!(0, _isNil3.default)(children)) {
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
children
);
}
var itemsJSX = (0, _map3.default)(items, function (item) {
return _react2.default.createElement(_Statistic2.default, _extends({ key: item.childKey || [item.label, item.title].join('-') }, item));
});
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
itemsJSX
);
}
StatisticGroup._meta = {
name: 'StatisticGroup',
type: _lib.META.TYPES.VIEW,
parent: 'Statistic',
props: {
color: _lib.SUI.COLORS,
size: (0, _without3.default)(_lib.SUI.SIZES, 'big', 'massive', 'medium'),
widths: _lib.SUI.WIDTHS
}
};
StatisticGroup.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** A statistic group can be formatted to be different colors. */
color: _react.PropTypes.oneOf(StatisticGroup._meta.props.color),
/** A statistic group can present its measurement horizontally. */
horizontal: _react.PropTypes.bool,
/** A statistic group can be formatted to fit on a dark background. */
inverted: _react.PropTypes.bool,
/** Array of props for Statistic. */
items: _lib.customPropTypes.collectionShorthand,
/** A statistic group can vary in size. */
size: _react.PropTypes.oneOf(StatisticGroup._meta.props.size),
/** A statistic group can have its items divided evenly. */
widths: _react.PropTypes.oneOf(StatisticGroup._meta.props.widths)
};
exports.default = StatisticGroup;
/***/ },
/* 1062 */
/*!*****************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/views/Statistic/StatisticLabel.js ***!
\*****************************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function StatisticLabel(props) {
var children = props.children,
className = props.className,
label = props.label;
var classes = (0, _classnames2.default)(className, 'label');
var rest = (0, _lib.getUnhandledProps)(StatisticLabel, props);
var ElementType = (0, _lib.getElementType)(StatisticLabel, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
(0, _isNil3.default)(children) ? label : children
);
}
StatisticLabel._meta = {
name: 'StatisticLabel',
parent: 'Statistic',
type: _lib.META.TYPES.VIEW
};
StatisticLabel.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** Shorthand for primary content. */
label: _lib.customPropTypes.contentShorthand
};
exports.default = StatisticLabel;
/***/ },
/* 1063 */
/*!*****************************************************************************!*\
!*** ./~/semantic-ui-react/dist/commonjs/views/Statistic/StatisticValue.js ***!
\*****************************************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _isNil2 = __webpack_require__(/*! lodash/isNil */ 834);
var _isNil3 = _interopRequireDefault(_isNil2);
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 _classnames = __webpack_require__(/*! classnames */ 705);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _lib = __webpack_require__(/*! ../../lib */ 592);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function StatisticValue(props) {
var children = props.children,
className = props.className,
text = props.text,
value = props.value;
var classes = (0, _classnames2.default)((0, _lib.useKeyOnly)(text, 'text'), className, 'value');
var rest = (0, _lib.getUnhandledProps)(StatisticValue, props);
var ElementType = (0, _lib.getElementType)(StatisticValue, props);
return _react2.default.createElement(
ElementType,
_extends({}, rest, { className: classes }),
(0, _isNil3.default)(children) ? value : children
);
}
StatisticValue._meta = {
name: 'StatisticValue',
parent: 'Statistic',
type: _lib.META.TYPES.VIEW
};
StatisticValue.propTypes = {
/** An element type to render as (string or function). */
as: _lib.customPropTypes.as,
/** Primary content. */
children: _react.PropTypes.node,
/** Additional classes. */
className: _react.PropTypes.string,
/** Format the value with smaller font size to fit nicely beside number values. */
text: _react.PropTypes.bool,
/** Primary content of the StatisticValue. Mutually exclusive with the children prop. */
value: _lib.customPropTypes.contentShorthand
};
exports.default = StatisticValue;
/***/ },
/* 1064 */
/*!*************************************************!*\
!*** ./app/containers/DetailsStepContainer.jsx ***!
\*************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _reactRedux = __webpack_require__(/*! react-redux */ 200);
var _Actions = __webpack_require__(/*! Actions */ 229);
var _DetailsStep = __webpack_require__(/*! DetailsStep */ 1065);
var _DetailsStep2 = _interopRequireDefault(_DetailsStep);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var mapStateToProps = function mapStateToProps(state) {
return { fieldState: state.validationFilter };
};
var mapDispatchToProps = function mapDispatchToProps(dispatch) {
return {
onValidInput: function onValidInput(data) {
dispatch((0, _Actions.validateInput)(data));
},
updateReferenceIds: function updateReferenceIds(data) {
dispatch((0, _Actions.addReference)(data));
},
addReference: function addReference(data) {
dispatch((0, _Actions.addReference)(data));
},
removeReferenceId: function removeReferenceId(index) {
dispatch((0, _Actions.removeReference)(index));
}
};
};
var DetailsStepContainer = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_DetailsStep2.default);
exports.default = DetailsStepContainer;
/***/ },
/* 1065 */
/*!****************************************!*\
!*** ./app/components/DetailsStep.jsx ***!
\****************************************/
/***/ 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__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _TitleSummary = __webpack_require__(/*! TitleSummary */ 1066);
var _TitleSummary2 = _interopRequireDefault(_TitleSummary);
var _CategoryComponent = __webpack_require__(/*! CategoryComponent */ 1068);
var _CategoryComponent2 = _interopRequireDefault(_CategoryComponent);
var _ReferenceInput = __webpack_require__(/*! ReferenceInput */ 1071);
var _ReferenceInput2 = _interopRequireDefault(_ReferenceInput);
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 DetailsStep = function (_Component) {
_inherits(DetailsStep, _Component);
function DetailsStep() {
_classCallCheck(this, DetailsStep);
return _possibleConstructorReturn(this, (DetailsStep.__proto__ || Object.getPrototypeOf(DetailsStep)).apply(this, arguments));
}
_createClass(DetailsStep, [{
key: 'render',
value: function render() {
return _react2.default.createElement(
'div',
null,
_react2.default.createElement(_TitleSummary2.default, this.props),
_react2.default.createElement(_CategoryComponent2.default, this.props),
_react2.default.createElement(_ReferenceInput2.default, this.props)
);
}
}]);
return DetailsStep;
}(_react.Component);
exports.default = DetailsStep;
/***/ },
/* 1066 */
/*!******************************************************!*\
!*** ./app/components/details_step/TitleSummary.jsx ***!
\******************************************************/
/***/ 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__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _semanticUiReact = __webpack_require__(/*! semantic-ui-react */ 532);
var _FieldLabel = __webpack_require__(/*! FieldLabel */ 1067);
var _FieldLabel2 = _interopRequireDefault(_FieldLabel);
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 TitleSummary = function (_Component) {
_inherits(TitleSummary, _Component);
function TitleSummary() {
_classCallCheck(this, TitleSummary);
return _possibleConstructorReturn(this, (TitleSummary.__proto__ || Object.getPrototypeOf(TitleSummary)).apply(this, arguments));
}
_createClass(TitleSummary, [{
key: 'render',
value: function render() {
var _props = this.props,
onValidInput = _props.onValidInput,
fieldState = _props.fieldState;
var name = 'title';
return _react2.default.createElement(
_semanticUiReact.Form.Field,
null,
_react2.default.createElement(_FieldLabel2.default, {
active: fieldState[name].isValidated,
helpText: 'An overview of the issue that will act as the title',
text: 'Summary'
}),
_react2.default.createElement(_semanticUiReact.Input, {
fluid: true,
name: name,
onChange: function onChange(e, data) {
return onValidInput(data);
},
placeholder: 'Summarize the issue, it will be the title'
})
);
}
}]);
return TitleSummary;
}(_react.Component);
exports.default = TitleSummary;
TitleSummary.propTypes = {
onValidInput: _react.PropTypes.func.isRequired,
fieldState: _react.PropTypes.object.isRequired
};
/***/ },
/* 1067 */
/*!***********************************************!*\
!*** ./app/components/general/FieldLabel.jsx ***!
\***********************************************/
/***/ 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__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _semanticUiReact = __webpack_require__(/*! semantic-ui-react */ 532);
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 FieldLabel = function (_Component) {
_inherits(FieldLabel, _Component);
function FieldLabel() {
_classCallCheck(this, FieldLabel);
return _possibleConstructorReturn(this, (FieldLabel.__proto__ || Object.getPrototypeOf(FieldLabel)).apply(this, arguments));
}
_createClass(FieldLabel, [{
key: 'render',
value: function render() {
var _props = this.props,
active = _props.active,
clickContext = _props.clickContext,
helpText = _props.helpText,
_onClick = _props.onClick,
text = _props.text;
if (helpText === 'undefined') {
helpText = active ? 'Looks good!' : 'Please fill in this rquired field';
}
return _react2.default.createElement(
'div',
null,
_react2.default.createElement(
'label',
{
style: {
color: '#45494E'
}
},
text
),
_react2.default.createElement(
_semanticUiReact.Popup,
{
trigger: _react2.default.createElement(_semanticUiReact.Icon, {
color: active ? 'green' : 'red',
name: active ? 'check circle' : 'warning circle',
onClick: function onClick() {
if (_onClick !== 'undefined') {
_onClick(clickContext);
}
},
size: 'small'
})
},
_react2.default.createElement(
_semanticUiReact.Popup.Header,
null,
_react2.default.createElement(_semanticUiReact.Icon, { name: 'info circle', color: 'blue' }),
active ? 'Validated' : 'This field is required'
),
_react2.default.createElement(
_semanticUiReact.Popup.Content,
null,
helpText
)
)
);
}
}]);
return FieldLabel;
}(_react.Component);
exports.default = FieldLabel;
FieldLabel.propTypes = {
active: _react.PropTypes.bool.isRequired,
clickContext: _react.PropTypes.object,
helpText: _react.PropTypes.string,
onClick: _react.PropTypes.func,
text: _react.PropTypes.oneOfType([_react.PropTypes.element, _react.PropTypes.string]).isRequired
};
/***/ },
/* 1068 */
/*!***********************************************************!*\
!*** ./app/components/details_step/CategoryComponent.jsx ***!
\***********************************************************/
/***/ 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__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _semanticUiReact = __webpack_require__(/*! semantic-ui-react */ 532);
var _componentOptions = __webpack_require__(/*! componentOptions */ 1069);
var _CategoryDropdown = __webpack_require__(/*! CategoryDropdown */ 1070);
var _CategoryDropdown2 = _interopRequireDefault(_CategoryDropdown);
var _FieldLabel = __webpack_require__(/*! FieldLabel */ 1067);
var _FieldLabel2 = _interopRequireDefault(_FieldLabel);
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 CategoryComponent = function (_Component) {
_inherits(CategoryComponent, _Component);
function CategoryComponent() {
_classCallCheck(this, CategoryComponent);
return _possibleConstructorReturn(this, (CategoryComponent.__proto__ || Object.getPrototypeOf(CategoryComponent)).apply(this, arguments));
}
_createClass(CategoryComponent, [{
key: 'render',
value: function render() {
var _props = this.props,
fieldState = _props.fieldState,
onValidInput = _props.onValidInput;
var categoryName = 'category';
var componentName = 'component';
return _react2.default.createElement(
_semanticUiReact.Form.Group,
{
widths: 'equal'
},
_react2.default.createElement(
_semanticUiReact.Form.Field,
{
required: true,
width: '8'
},
_react2.default.createElement(_FieldLabel2.default, {
active: fieldState[categoryName].isValidated,
helpText: 'Define the impact to the business',
text: 'Category'
}),
_react2.default.createElement(_CategoryDropdown2.default, {
name: categoryName,
onValidInput: onValidInput
})
),
_react2.default.createElement(
_semanticUiReact.Form.Field,
{
width: '8'
},
_react2.default.createElement(_FieldLabel2.default, {
active: fieldState[componentName].isValidated,
helpText: 'What part of the product is affected?',
text: 'Component'
}),
_react2.default.createElement(_semanticUiReact.Dropdown, {
placeholder: 'Product Component e.g. Sales Summary Report',
name: componentName,
onChange: function onChange(e, data) {
return onValidInput(data);
},
style: { whiteSpace: 'nowrap' },
id: 'no-wrap',
search: true,
selection: true,
header: _react2.default.createElement(_semanticUiReact.Dropdown.Header, { content: 'Search for a product component', icon: 'tags' }),
options: _componentOptions.componentOptions
})
)
);
}
}]);
return CategoryComponent;
}(_react.Component);
exports.default = CategoryComponent;
CategoryComponent.propTypes = {
onValidInput: _react.PropTypes.func.isRequired,
fieldState: _react.PropTypes.object.isRequired
};
/***/ },
/* 1069 */
/*!*****************************************!*\
!*** ./app/helpers/componentOptions.js ***!
\*****************************************/
/***/ function(module, exports) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var componentOptions = exports.componentOptions = [{ value: 'API', key: 'API', text: 'API' }, { value: 'Account Login Admin Tool', key: 'Account Login Admin Tool', text: 'Account Login Admin Tool' }, { value: 'Account Settings (/account)', key: 'Account Settings (/account)', text: 'Account Settings (/account)' }, { value: 'Account Settings - Charges & Credits', key: 'Account Settings - Charges & Credits', text: 'Account Settings - Charges & Credits' }, { value: 'Account Settings - Credit/Debit Cards', key: 'Account Settings - Credit/Debit Cards', text: 'Account Settings - Credit/Debit Cards' }, { value: 'Account Settings - Extensions', key: 'Account Settings - Extensions', text: 'Account Settings - Extensions' }, { value: 'Account Settings - Invoices', key: 'Account Settings - Invoices', text: 'Account Settings - Invoices' }, { value: 'Account Settings - Password (/password)', key: 'Account Settings - Password (/password)', text: 'Account Settings - Password (/password)' }, { value: 'Account Settings - Payout Methods', key: 'Account Settings - Payout Methods', text: 'Account Settings - Payout Methods' }, { value: 'Account Settings - Payouts Summary', key: 'Account Settings - Payouts Summary', text: 'Account Settings - Payouts Summary' }, { value: 'Account Settings - Social Settings (/social-settings)', key: 'Account Settings - Social Settings (/social-settings)', text: 'Account Settings - Social Settings (/social-settings)' }, { value: 'Add Attendees', key: 'Add Attendees', text: 'Add Attendees' }, { value: 'Admin Billing Explorer Tool (/admin/billing)', key: 'Admin Billing Explorer Tool (/admin/billing)', text: 'Admin Billing Explorer Tool (/admin/billing)' }, { value: 'Admin Billing Settings Tool (/admin/billing/settings)', key: 'Admin Billing Settings Tool (/admin/billing/settings)', text: 'Admin Billing Settings Tool (/admin/billing/settings)' }, { value: 'Admin Edit User Tool (/adminedituser)', key: 'Admin Edit User Tool (/adminedituser)', text: 'Admin Edit User Tool (/adminedituser)' }, { value: 'Admin Fee Calculator Tool (/admin/fee_calculator)', key: 'Admin Fee Calculator Tool (/admin/fee_calculator)', text: 'Admin Fee Calculator Tool (/admin/fee_calculator)' }, { value: 'Admin Fee Tools', key: 'Admin Fee Tools', text: 'Admin Fee Tools' }, { value: 'Admin Payment Tools (/orderinfo)', key: 'Admin Payment Tools (/orderinfo)', text: 'Admin Payment Tools (/orderinfo)' }, { value: 'Admin Search Tool', key: 'Admin Search Tool', text: 'Admin Search Tool' }, { value: 'Affiliate Programs (/affiliates)', key: 'Affiliate Programs (/affiliates)', text: 'Affiliate Programs (/affiliates)' }, { value: 'Attendee App - Android', key: 'Attendee App - Android', text: 'Attendee App - Android' }, { value: 'Attendee App - iOS', key: 'Attendee App - iOS', text: 'Attendee App - iOS' }, { value: 'Attendee Newsletters', key: 'Attendee Newsletters', text: 'Attendee Newsletters' }, { value: 'Attendee Social Sharing', key: 'Attendee Social Sharing', text: 'Attendee Social Sharing' }, { value: 'Attendee Tax Invoice', key: 'Attendee Tax Invoice', text: 'Attendee Tax Invoice' }, { value: 'Auto Assign Numbers', key: 'Auto Assign Numbers', text: 'Auto Assign Numbers' }, { value: 'Backup Funding', key: 'Backup Funding', text: 'Backup Funding' }, { value: 'Blog (/blog)', key: 'Blog (/blog)', text: 'Blog (/blog)' }, { value: 'Browser Support', key: 'Browser Support', text: 'Browser Support' }, { value: 'Canned & Custom Questions (/questions)', key: 'Canned & Custom Questions (/questions)', text: 'Canned & Custom Questions (/questions)' }, { value: 'Careers Page (/careers)', key: 'Careers Page (/careers)', text: 'Careers Page (/careers)' }, { value: 'Charts (/charts)', key: 'Charts (/charts)', text: 'Charts (/charts)' }, { value: 'Check-In Page', key: 'Check-In Page', text: 'Check-In Page' }, { value: 'Close Account', key: 'Close Account', text: 'Close Account' }, { value: 'Consumer Emails - Other', key: 'Consumer Emails - Other', text: 'Consumer Emails - Other' }, { value: 'Consumer User Profile (/u)', key: 'Consumer User Profile (/u)', text: 'Consumer User Profile (/u)' }, { value: 'Contact Eventbrite Support (/contact-us)', key: 'Contact Eventbrite Support (/contact-us)', text: 'Contact Eventbrite Support (/contact-us)' }, { value: 'Contact Page (/contact)', key: 'Contact Page (/contact)', text: 'Contact Page (/contact)' }, { value: 'Contact the Organizer', key: 'Contact the Organizer', text: 'Contact the Organizer' }, { value: 'Contacts (/contacts)', key: 'Contacts (/contacts)', text: 'Contacts (/contacts)' }, { value: 'Copy Feature (/copy)', key: 'Copy Feature (/copy)', text: 'Copy Feature (/copy)' }, { value: 'Create Flow (/create', key: 'Create Flow (/create, /edit, /preview, design page)', text: 'Create Flow (/create, /edit, /preview, design page)' }, { value: 'Discount & Access Codes', key: 'Discount & Access Codes', text: 'Discount & Access Codes' }, { value: 'Edit Attendee / Ticket Buyer Information', key: 'Edit Attendee / Ticket Buyer Information', text: 'Edit Attendee / Ticket Buyer Information' }, { value: 'Email Invitations', key: 'Email Invitations', text: 'Email Invitations' }, { value: 'Email Preferences (/email-preferences)', key: 'Email Preferences (/email-preferences)', text: 'Email Preferences (/email-preferences)' }, { value: 'Emails to Attendees (reminders)', key: 'Emails to Attendees (reminders)', text: 'Emails to Attendees (reminders)' }, { value: 'Event & Ticket Groups', key: 'Event & Ticket Groups', text: 'Event & Ticket Groups' }, { value: 'Event Academy (/academy)', key: 'Event Academy (/academy)', text: 'Event Academy (/academy)' }, { value: 'Event Cards', key: 'Event Cards', text: 'Event Cards' }, { value: 'Event Dashboard Reporting', key: 'Event Dashboard Reporting', text: 'Event Dashboard Reporting' }, { value: 'Event Page Views Tracking', key: 'Event Page Views Tracking', text: 'Event Page Views Tracking' }, { value: 'Event Reports', key: 'Event Reports', text: 'Event Reports' }, { value: 'Event Type & Language', key: 'Event Type & Language', text: 'Event Type & Language' }, { value: 'Eventbistro', key: 'Eventbistro', text: 'Eventbistro' }, { value: 'Features Page (/features)', key: 'Features Page (/features)', text: 'Features Page (/features)' }, { value: 'Fees Page (/fees)', key: 'Fees Page (/fees)', text: 'Fees Page (/fees)' }, { value: 'Guest List', key: 'Guest List', text: 'Guest List' }, { value: 'Help Center', key: 'Help Center', text: 'Help Center' }, { value: 'How It Works Page (/how-it-works)', key: 'How It Works Page (/how-it-works)', text: 'How It Works Page (/how-it-works)' }, { value: 'Invoice Payments', key: 'Invoice Payments', text: 'Invoice Payments' }, { value: 'Listing Page (/e)', key: 'Listing Page (/e)', text: 'Listing Page (/e)' }, { value: 'Login and Signup Flows', key: 'Login and Signup Flows', text: 'Login and Signup Flows' }, { value: 'Manage Events (/myevents)', key: 'Manage Events (/myevents)', text: 'Manage Events (/myevents)' }, { value: 'Manage Order (/mytickets)', key: 'Manage Order (/mytickets)', text: 'Manage Order (/mytickets)' }, { value: 'Name Badges', key: 'Name Badges', text: 'Name Badges' }, { value: 'Order Confirmation Email', key: 'Order Confirmation Email', text: 'Order Confirmation Email' }, { value: 'Order Confirmation Page', key: 'Order Confirmation Page', text: 'Order Confirmation Page' }, { value: 'Order Refund Email', key: 'Order Refund Email', text: 'Order Refund Email' }, { value: 'Organizer App - Android', key: 'Organizer App - Android', text: 'Organizer App - Android' }, { value: 'Organizer App - iOS', key: 'Organizer App - iOS', text: 'Organizer App - iOS' }, { value: 'Organizer Emails - Other', key: 'Organizer Emails - Other', text: 'Organizer Emails - Other' }, { value: 'Organizer Emails - Ticket Sales Ended', key: 'Organizer Emails - Ticket Sales Ended', text: 'Organizer Emails - Ticket Sales Ended' }, { value: 'Organizer Profile (/o)', key: 'Organizer Profile (/o)', text: 'Organizer Profile (/o)' }, { value: 'PDF Tickets', key: 'PDF Tickets', text: 'PDF Tickets' }, { value: 'Payment Options', key: 'Payment Options', text: 'Payment Options' }, { value: 'Payment Processing', key: 'Payment Processing', text: 'Payment Processing' }, { value: 'Publish to Facebook', key: 'Publish to Facebook', text: 'Publish to Facebook' }, { value: 'Refunds', key: 'Refunds', text: 'Refunds' }, { value: 'Registration Transfers', key: 'Registration Transfers', text: 'Registration Transfers' }, { value: 'Related Events', key: 'Related Events', text: 'Related Events' }, { value: 'Repeating Events', key: 'Repeating Events', text: 'Repeating Events' }, { value: 'Report This Event', key: 'Report This Event', text: 'Report This Event' }, { value: 'Reserved Seating', key: 'Reserved Seating', text: 'Reserved Seating' }, { value: 'SEO', key: 'SEO', text: 'SEO' }, { value: 'Salesforce Integration (EventbriteSync)', key: 'Salesforce Integration (EventbriteSync)', text: 'Salesforce Integration (EventbriteSync)' }, { value: 'Saved Events', key: 'Saved Events', text: 'Saved Events' }, { value: 'Search', key: 'Search', text: 'Search' }, { value: 'Seat Designer', key: 'Seat Designer', text: 'Seat Designer' }, { value: 'See Who\'s Going', key: 'See Who\'s Going', text: 'See Who\'s Going' }, { value: 'Social Stream', key: 'Social Stream', text: 'Social Stream' }, { value: 'Spectrum', key: 'Spectrum', text: 'Spectrum' }, { value: 'Tax Options (on /create)', key: 'Tax Options (on /create)', text: 'Tax Options (on /create)' }, { value: 'Taxpayer Information (/tax_information)', key: 'Taxpayer Information (/tax_information)', text: 'Taxpayer Information (/tax_information)' }, { value: 'Ticket/Order Confirmation Customization', key: 'Ticket/Order Confirmation Customization', text: 'Ticket/Order Confirmation Customization' }, { value: 'Tracking Links', key: 'Tracking Links', text: 'Tracking Links' }, { value: 'Tracking Pixels', key: 'Tracking Pixels', text: 'Tracking Pixels' }, { value: 'Unsubscribe', key: 'Unsubscribe', text: 'Unsubscribe' }, { value: 'Vanity URLs', key: 'Vanity URLs', text: 'Vanity URLs' }, { value: 'Venue Pages', key: 'Venue Pages', text: 'Venue Pages' }, { value: 'Waiting Room', key: 'Waiting Room', text: 'Waiting Room' }, { value: 'Waitlist', key: 'Waitlist', text: 'Waitlist' }, { value: 'Widgets', key: 'Widgets', text: 'Widgets' }, { value: 'Wristband Features', key: 'Wristband Features', text: 'Wristband Features' }];
/***/ },
/* 1070 */
/*!**********************************************************!*\
!*** ./app/components/details_step/CategoryDropdown.jsx ***!
\**********************************************************/
/***/ 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__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _semanticUiReact = __webpack_require__(/*! semantic-ui-react */ 532);
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 CategoryDropdown = function (_Component) {
_inherits(CategoryDropdown, _Component);
function CategoryDropdown() {
var _ref;
var _temp, _this, _ret;
_classCallCheck(this, CategoryDropdown);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = CategoryDropdown.__proto__ || Object.getPrototypeOf(CategoryDropdown)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
activeItem: 0,
selectedText: ''
}, _temp), _possibleConstructorReturn(_this, _ret);
}
_createClass(CategoryDropdown, [{
key: 'clickItem',
value: function clickItem(e, d, num) {
var _props = this.props,
name = _props.name,
onValidInput = _props.onValidInput;
var data = _extends({}, d, { name: name });
this.setState({
activeItem: num,
selectedText: data.text
});
onValidInput(data);
}
}, {
key: 'render',
value: function render() {
var _this2 = this;
var _state = this.state,
activeItem = _state.activeItem,
selectedText = _state.selectedText;
return _react2.default.createElement(
_semanticUiReact.Dropdown,
{
placeholder: 'What\'s the impact?',
text: selectedText,
name: 'category',
className: activeItem ? 'selection force-black' : 'selection',
id: 'no-wrap',
style: {
zIndex: '9000',
whiteSpace: 'nowrap'
}
},
_react2.default.createElement(
_semanticUiReact.Dropdown.Menu,
null,
_react2.default.createElement(_semanticUiReact.Dropdown.Item, {
text: 'A wide-spread, business critical issue - tickets cannot be sold',
value: 'Critical',
icon: { name: 'arrow circle up', color: 'red' },
onClick: function onClick(e, data) {
return _this2.clickItem(e, data, 1);
},
active: activeItem === 1
}),
_react2.default.createElement(_semanticUiReact.Dropdown.Item, {
text: 'Pricing, fees, or payouts are wrong, or appear to be wrong',
value: 'Critical payments-triage',
icon: { name: 'arrow up', color: 'red' },
onClick: function onClick(e, data) {
return _this2.clickItem(e, data, 2);
},
active: activeItem === 2
}),
_react2.default.createElement(_semanticUiReact.Dropdown.Item, {
text: 'Core functionality of a widely used feature is broken',
value: 'Major',
icon: { name: 'angle double up', color: 'orange' },
onClick: function onClick(e, data) {
return _this2.clickItem(e, data, 3);
},
active: activeItem === 3
}),
_react2.default.createElement(_semanticUiReact.Dropdown.Item, {
text: 'Something doesn\'t look right, or isn\'t rendering correctly',
value: 'Minor',
icon: { name: 'angle down', color: 'green' },
onClick: function onClick(e, data) {
return _this2.clickItem(e, data, 4);
},
active: activeItem === 4
})
)
);
}
}]);
return CategoryDropdown;
}(_react.Component);
exports.default = CategoryDropdown;
CategoryDropdown.propTypes = {
name: _react.PropTypes.string.isRequired,
onValidInput: _react.PropTypes.func.isRequired
};
/***/ },
/* 1071 */
/*!********************************************************!*\
!*** ./app/components/details_step/ReferenceInput.jsx ***!
\********************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
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__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _semanticUiReact = __webpack_require__(/*! semantic-ui-react */ 532);
var _ReferenceLabel = __webpack_require__(/*! ReferenceLabel */ 1072);
var _ReferenceLabel2 = _interopRequireDefault(_ReferenceLabel);
var _FieldLabel = __webpack_require__(/*! FieldLabel */ 1067);
var _FieldLabel2 = _interopRequireDefault(_FieldLabel);
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 eventID = /\b(?:oid|OID)?:?[0-9]{11}\b/;
var orderID = /\b(?:oid|OID)?:?[0-9]{9}\b/;
var organizerID = /\b(?:oid|OID)?:?[0-9]{10}\b/;
var email = /\b\S+@\S+\b/;
var ReferenceInput = function (_Component) {
_inherits(ReferenceInput, _Component);
function ReferenceInput() {
var _ref;
var _temp, _this, _ret;
_classCallCheck(this, ReferenceInput);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = ReferenceInput.__proto__ || Object.getPrototypeOf(ReferenceInput)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
active: false
}, _temp), _possibleConstructorReturn(_this, _ret);
}
_createClass(ReferenceInput, [{
key: 'handleChange',
value: function handleChange(e) {
var text = e.target.value;
if (text.search(eventID) !== -1 || text.search(orderID) !== -1 || text.search(organizerID) !== -1 || text.search(email) !== -1) {
this.setState({ active: true });
} else {
this.setState({ active: false });
}
}
}, {
key: 'handleKeyPress',
value: function handleKeyPress(e) {
if (e.key === 'Enter') {
e.preventDefault();
this.addLabel();
}
}
}, {
key: 'addLabel',
value: function addLabel() {
var _this2 = this;
var updateReferenceIds = this.props.updateReferenceIds;
var ADMIN_URL = 'https://admin.eventbrite.com/admin/';
var ebReferenceIds = this.props.fieldState.references.fieldValue.map(function (e) {
return e.text;
});
var input = this.inputRef.value.split(' ');
// remove duplicates from input
input = input.filter(function (word, index, array) {
return array.indexOf(word) === index;
});
// don't add labels from input that already exist
input = input.filter(function (value) {
return ebReferenceIds.indexOf(value) === -1;
});
// for each word in input, check to see if it's a known type, if it is: update state
input.forEach(function (word) {
var id = void 0;
var type = void 0;
var lookupURL = void 0;
if (word.search(eventID) !== -1) {
var _word$match = word.match(eventID);
var _word$match2 = _slicedToArray(_word$match, 1);
id = _word$match2[0];
type = 'EID';
lookupURL = ADMIN_URL.concat('search/?search_query=').concat(encodeURIComponent(id));
} else if (word.search(orderID) !== -1) {
var _word$match3 = word.match(orderID);
var _word$match4 = _slicedToArray(_word$match3, 1);
id = _word$match4[0];
type = 'OID';
lookupURL = ADMIN_URL.concat('orderinfo/?order_id='.concat(encodeURIComponent(id)));
} else if (word.search(organizerID) !== -1) {
var _word$match5 = word.match(organizerID);
var _word$match6 = _slicedToArray(_word$match5, 1);
id = _word$match6[0];
type = 'Organizer';
lookupURL = ADMIN_URL.concat('search/?search_query=organizer%3A+'.concat(encodeURIComponent(id)));
} else if (word.search(email) !== -1) {
var _word$match7 = word.match(email);
var _word$match8 = _slicedToArray(_word$match7, 1);
id = _word$match8[0];
type = 'Email';
lookupURL = ADMIN_URL.concat('search/?search_query='.concat(encodeURIComponent(id)));
}
if (id) {
updateReferenceIds({
text: id,
type: type,
lookupURL: lookupURL
});
// clear input field
_this2.inputRef.value = '';
_this2.setState({
active: false
});
}
});
}
}, {
key: 'render',
value: function render() {
var _this3 = this;
var active = this.state.active;
var _props = this.props,
fieldState = _props.fieldState,
removeReferenceId = _props.removeReferenceId;
var ebReferenceIds = fieldState.references.fieldValue;
var renderLabels = function renderLabels() {
var labels = void 0;
if (ebReferenceIds.length > 0) {
labels = ebReferenceIds.map(function (idObject, index) {
return _react2.default.createElement(_ReferenceLabel2.default, {
removeLabel: removeReferenceId,
key: index,
index: index,
text: idObject.text,
url: idObject.lookupURL,
type: idObject.type
});
});
}
return labels;
};
return _react2.default.createElement(
_semanticUiReact.Form.Field,
{ required: true },
_react2.default.createElement(_FieldLabel2.default, {
active: fieldState.references.isValidated,
helpText: 'What events, orders, accounts, organizers, etc are affected?',
text: 'References'
}),
_react2.default.createElement(
'div',
null,
_react2.default.createElement(
_semanticUiReact.Input,
{
icon: true,
iconPosition: 'left',
placeholder: 'Paste text that contains EIDs, OIDs, Account Emails, or Organizer IDs',
onKeyPress: this.handleKeyPress.bind(this),
onChange: this.handleChange.bind(this),
name: 'reference input',
fluid: true
},
_react2.default.createElement(_semanticUiReact.Icon, {
color: active ? 'green' : 'grey',
fitted: true,
link: active ? true : false,
name: 'plus square',
onClick: this.addLabel.bind(this)
}),
_react2.default.createElement('input', {
ref: function ref(input) {
return _this3.inputRef = input;
},
type: 'search'
})
),
_react2.default.createElement(
'div',
null,
renderLabels()
)
)
);
}
}]);
return ReferenceInput;
}(_react.Component);
exports.default = ReferenceInput;
ReferenceInput.propTypes = {
fieldState: _react.PropTypes.object.isRequired,
removeReferenceId: _react.PropTypes.func.isRequired,
updateReferenceIds: _react.PropTypes.func.isRequired
};
/***/ },
/* 1072 */
/*!********************************************************!*\
!*** ./app/components/details_step/ReferenceLabel.jsx ***!
\********************************************************/
/***/ 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__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _semanticUiReact = __webpack_require__(/*! semantic-ui-react */ 532);
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 ReferenceLabel = function (_Component) {
_inherits(ReferenceLabel, _Component);
function ReferenceLabel() {
_classCallCheck(this, ReferenceLabel);
return _possibleConstructorReturn(this, (ReferenceLabel.__proto__ || Object.getPrototypeOf(ReferenceLabel)).apply(this, arguments));
}
_createClass(ReferenceLabel, [{
key: 'render',
value: function render() {
var _props = this.props,
index = _props.index,
text = _props.text,
type = _props.type,
url = _props.url,
removeLabel = _props.removeLabel;
return _react2.default.createElement(
_semanticUiReact.Label,
{ basic: true, pointing: 'above' },
type.concat(': '),
_react2.default.createElement(
'a',
{
target: '_blank',
rel: 'noopener noreferrer',
href: url,
style: { color: '#4183C4' }
},
text
),
_react2.default.createElement(_semanticUiReact.Icon, {
onClick: function onClick() {
return removeLabel(index);
},
name: 'delete'
})
);
}
}]);
return ReferenceLabel;
}(_react.Component);
exports.default = ReferenceLabel;
ReferenceLabel.propTypes = {
index: _react.PropTypes.number.isRequired,
text: _react.PropTypes.string.isRequired,
type: _react.PropTypes.string.isRequired,
url: _react.PropTypes.string.isRequired,
removeLabel: _react.PropTypes.func.isRequired
};
/***/ },
/* 1073 */
/*!************************************************!*\
!*** ./app/containers/FileUploadContainer.jsx ***!
\************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _reactRedux = __webpack_require__(/*! react-redux */ 200);
var _Actions = __webpack_require__(/*! Actions */ 229);
var _UploaderStep = __webpack_require__(/*! UploaderStep */ 1074);
var _UploaderStep2 = _interopRequireDefault(_UploaderStep);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var mapStateToProps = function mapStateToProps(state) {
return { files: state.uploadFilter.files };
};
var mapDispatchToProps = function mapDispatchToProps(dispatch) {
return {
addFile: function addFile(file) {
dispatch((0, _Actions.addFile)(file));
},
modifyFile: function modifyFile(file) {
dispatch((0, _Actions.modifyFile)(file));
},
removeFile: function removeFile(file) {
dispatch((0, _Actions.removeFile)(file));
}
};
};
var FileUploadContainer = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_UploaderStep2.default);
exports.default = FileUploadContainer;
/***/ },
/* 1074 */
/*!*****************************************!*\
!*** ./app/components/UploaderStep.jsx ***!
\*****************************************/
/***/ 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__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _reactDropzone = __webpack_require__(/*! react-dropzone */ 1075);
var _reactDropzone2 = _interopRequireDefault(_reactDropzone);
var _semanticUiReact = __webpack_require__(/*! semantic-ui-react */ 532);
var _FilePreview = __webpack_require__(/*! FilePreview */ 1076);
var _FilePreview2 = _interopRequireDefault(_FilePreview);
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 UploaderStep = function (_Component) {
_inherits(UploaderStep, _Component);
function UploaderStep() {
_classCallCheck(this, UploaderStep);
return _possibleConstructorReturn(this, (UploaderStep.__proto__ || Object.getPrototypeOf(UploaderStep)).apply(this, arguments));
}
_createClass(UploaderStep, [{
key: 'onDrop',
value: function onDrop(acceptedFiles) {
// also get called with rejected files as the second arg
this.props.addFile(acceptedFiles);
}
}, {
key: 'render',
value: function render() {
var _props = this.props,
files = _props.files,
fileUpdates = _props.fileUpdates,
removeFile = _props.removeFile,
modifyFile = _props.modifyFile;
var renderIconHeader = function renderIconHeader() {
var header = void 0;
if (files.length > 0) {
header = _react2.default.createElement(
_semanticUiReact.Header,
{ as: 'h2', icon: true },
_react2.default.createElement(_semanticUiReact.Icon, { name: 'image' }),
'Drag & Drop',
_react2.default.createElement(
_semanticUiReact.Header.Subheader,
null,
'Images, or relevant files'
)
);
} else {
header = _react2.default.createElement(
_semanticUiReact.Header,
{ as: 'h2', icon: true },
_react2.default.createElement(
_semanticUiReact.Popup,
{
trigger: _react2.default.createElement(_semanticUiReact.Icon, { name: 'warning sign', color: 'yellow' })
},
_react2.default.createElement(
_semanticUiReact.Popup.Header,
null,
_react2.default.createElement(_semanticUiReact.Icon, { name: 'info circle', color: 'blue' }),
'Tip'
),
_react2.default.createElement(
_semanticUiReact.Popup.Content,
null,
'You can drag files over this uploader, or click to browse files on your computer'
)
),
'Screenshots are incredibly helpful',
_react2.default.createElement(
_semanticUiReact.Header.Subheader,
null,
'Please take the time to add screenshots illustrating the issue'
)
);
}
return header;
};
var renderImages = function renderImages() {
return _react2.default.createElement(
_semanticUiReact.Image.Group,
{ size: 'small' },
files.map(function (file, index) {
return _react2.default.createElement(_FilePreview2.default, {
fileUpdates: fileUpdates || {},
imageURL: file.type === 'image/png' ? file.preview : 'images/file-preview.png',
index: index,
key: index,
removeFile: removeFile,
title: file.name,
type: file.type,
changeFileParameter: modifyFile
});
})
);
};
return _react2.default.createElement(
_semanticUiReact.Form.Field,
{ style: { textAlign: 'center' } },
renderImages(),
_react2.default.createElement(
_reactDropzone2.default,
{
multiple: true,
onDrop: this.onDrop.bind(this),
style: {
width: '100%',
height: '150px',
borderWidth: 2,
borderColor: '#666',
borderStyle: 'dashed',
borderRadius: 5,
marginBottom: '5px'
},
className: 'noselect'
},
_react2.default.createElement(
'div',
{
style: {
height: '100%',
paddingTop: '10px',
textAlign: 'center'
}
},
renderIconHeader()
)
)
);
}
}]);
return UploaderStep;
}(_react.Component);
exports.default = UploaderStep;
UploaderStep.propTypes = {
addFile: _react.PropTypes.func.isRequired,
files: _react.PropTypes.oneOfType([_react.PropTypes.array, _react.PropTypes.node]).isRequired,
fileUpdates: _react.PropTypes.object,
modifyFile: _react.PropTypes.func.isRequired,
removeFile: _react.PropTypes.func.isRequired
};
/***/ },
/* 1075 */
/*!****************************************!*\
!*** ./~/react-dropzone/dist/index.js ***!
\****************************************/
/***/ function(module, exports, __webpack_require__) {
(function webpackUniversalModuleDefinition(root, factory) {
if(true)
module.exports = factory(__webpack_require__(/*! react */ 2));
else if(typeof define === 'function' && define.amd)
define(["react"], factory);
else if(typeof exports === 'object')
exports["Dropzone"] = factory(require("react"));
else
root["Dropzone"] = factory(root["react"]);
})(this, function(__WEBPACK_EXTERNAL_MODULE_1__) {
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] = {
/******/ exports: {},
/******/ id: moduleId,
/******/ loaded: false
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.loaded = 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;
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ 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__(1);
var _react2 = _interopRequireDefault(_react);
var _attrAccept = __webpack_require__(2);
var _attrAccept2 = _interopRequireDefault(_attrAccept);
var _getDataTransferItems = __webpack_require__(3);
var _getDataTransferItems2 = _interopRequireDefault(_getDataTransferItems);
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; } /* eslint prefer-template: 0 */
var supportMultiple = typeof document !== 'undefined' && document && document.createElement ? 'multiple' in document.createElement('input') : true;
var Dropzone = function (_React$Component) {
_inherits(Dropzone, _React$Component);
function Dropzone(props, context) {
_classCallCheck(this, Dropzone);
var _this = _possibleConstructorReturn(this, (Dropzone.__proto__ || Object.getPrototypeOf(Dropzone)).call(this, props, context));
_this.onClick = _this.onClick.bind(_this);
_this.onDragStart = _this.onDragStart.bind(_this);
_this.onDragEnter = _this.onDragEnter.bind(_this);
_this.onDragLeave = _this.onDragLeave.bind(_this);
_this.onDragOver = _this.onDragOver.bind(_this);
_this.onDrop = _this.onDrop.bind(_this);
_this.onFileDialogCancel = _this.onFileDialogCancel.bind(_this);
_this.fileAccepted = _this.fileAccepted.bind(_this);
_this.isFileDialogActive = false;
_this.state = {
isDragActive: false
};
return _this;
}
_createClass(Dropzone, [{
key: 'componentDidMount',
value: function componentDidMount() {
this.enterCounter = 0;
// Tried implementing addEventListener, but didn't work out
document.body.onfocus = this.onFileDialogCancel;
}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {
// Can be replaced with removeEventListener, if addEventListener works
document.body.onfocus = null;
}
}, {
key: 'onDragStart',
value: function onDragStart(e) {
if (this.props.onDragStart) {
this.props.onDragStart.call(this, e);
}
}
}, {
key: 'onDragEnter',
value: function onDragEnter(e) {
e.preventDefault();
// Count the dropzone and any children that are entered.
++this.enterCounter;
var allFilesAccepted = this.allFilesAccepted((0, _getDataTransferItems2.default)(e, this.props.multiple));
this.setState({
isDragActive: allFilesAccepted,
isDragReject: !allFilesAccepted
});
if (this.props.onDragEnter) {
this.props.onDragEnter.call(this, e);
}
}
}, {
key: 'onDragOver',
value: function onDragOver(e) {
// eslint-disable-line class-methods-use-this
e.preventDefault();
e.stopPropagation();
try {
e.dataTransfer.dropEffect = 'copy'; // eslint-disable-line no-param-reassign
} catch (err) {
// continue regardless of error
}
if (this.props.onDragOver) {
this.props.onDragOver.call(this, e);
}
return false;
}
}, {
key: 'onDragLeave',
value: function onDragLeave(e) {
e.preventDefault();
// Only deactivate once the dropzone and all children was left.
if (--this.enterCounter > 0) {
return;
}
this.setState({
isDragActive: false,
isDragReject: false
});
if (this.props.onDragLeave) {
this.props.onDragLeave.call(this, e);
}
}
}, {
key: 'onDrop',
value: function onDrop(e) {
var _this2 = this;
var _props = this.props,
onDrop = _props.onDrop,
onDropAccepted = _props.onDropAccepted,
onDropRejected = _props.onDropRejected,
multiple = _props.multiple,
disablePreview = _props.disablePreview;
var fileList = (0, _getDataTransferItems2.default)(e, multiple);
var acceptedFiles = [];
var rejectedFiles = [];
// Stop default browser behavior
e.preventDefault();
// Reset the counter along with the drag on a drop.
this.enterCounter = 0;
this.isFileDialogActive = false;
fileList.forEach(function (file) {
if (!disablePreview) {
file.preview = window.URL.createObjectURL(file); // eslint-disable-line no-param-reassign
}
if (_this2.fileAccepted(file) && _this2.fileMatchSize(file)) {
acceptedFiles.push(file);
} else {
rejectedFiles.push(file);
}
});
if (onDrop) {
onDrop.call(this, acceptedFiles, rejectedFiles, e);
}
if (rejectedFiles.length > 0 && onDropRejected) {
onDropRejected.call(this, rejectedFiles, e);
}
if (acceptedFiles.length > 0 && onDropAccepted) {
onDropAccepted.call(this, acceptedFiles, e);
}
// Reset drag state
this.setState({
isDragActive: false,
isDragReject: false
});
}
}, {
key: 'onClick',
value: function onClick(e) {
var _props2 = this.props,
onClick = _props2.onClick,
disableClick = _props2.disableClick;
if (!disableClick) {
e.stopPropagation();
this.open();
if (onClick) {
onClick.call(this, e);
}
}
}
}, {
key: 'onFileDialogCancel',
value: function onFileDialogCancel() {
// timeout will not recognize context of this method
var onFileDialogCancel = this.props.onFileDialogCancel;
var fileInputEl = this.fileInputEl;
var isFileDialogActive = this.isFileDialogActive;
// execute the timeout only if the onFileDialogCancel is defined and FileDialog
// is opened in the browser
if (onFileDialogCancel && isFileDialogActive) {
setTimeout(function () {
// Returns an object as FileList
var FileList = fileInputEl.files;
if (!FileList.length) {
isFileDialogActive = false;
onFileDialogCancel();
}
}, 300);
}
}
}, {
key: 'fileAccepted',
value: function fileAccepted(file) {
return (0, _attrAccept2.default)(file, this.props.accept);
}
}, {
key: 'fileMatchSize',
value: function fileMatchSize(file) {
return file.size <= this.props.maxSize && file.size >= this.props.minSize;
}
}, {
key: 'allFilesAccepted',
value: function allFilesAccepted(files) {
return files.every(this.fileAccepted);
}
}, {
key: 'open',
value: function open() {
this.isFileDialogActive = true;
this.fileInputEl.value = null;
this.fileInputEl.click();
}
}, {
key: 'render',
value: function render() {
var _this3 = this;
var _props3 = this.props,
accept = _props3.accept,
activeClassName = _props3.activeClassName,
inputProps = _props3.inputProps,
multiple = _props3.multiple,
name = _props3.name,
rejectClassName = _props3.rejectClassName,
rest = _objectWithoutProperties(_props3, ['accept', 'activeClassName', 'inputProps', 'multiple', 'name', 'rejectClassName']);
var activeStyle = rest.activeStyle,
className = rest.className,
rejectStyle = rest.rejectStyle,
style = rest.style,
props = _objectWithoutProperties(rest, ['activeStyle', 'className', 'rejectStyle', 'style']);
var _state = this.state,
isDragActive = _state.isDragActive,
isDragReject = _state.isDragReject;
className = className || '';
if (isDragActive && activeClassName) {
className += ' ' + activeClassName;
}
if (isDragReject && rejectClassName) {
className += ' ' + rejectClassName;
}
if (!className && !style && !activeStyle && !rejectStyle) {
style = {
width: 200,
height: 200,
borderWidth: 2,
borderColor: '#666',
borderStyle: 'dashed',
borderRadius: 5
};
activeStyle = {
borderStyle: 'solid',
backgroundColor: '#eee'
};
rejectStyle = {
borderStyle: 'solid',
backgroundColor: '#ffdddd'
};
}
var appliedStyle = void 0;
if (activeStyle && isDragActive) {
appliedStyle = _extends({}, style, activeStyle);
} else if (rejectStyle && isDragReject) {
appliedStyle = _extends({}, style, rejectStyle);
} else {
appliedStyle = _extends({}, style);
}
var inputAttributes = {
accept: accept,
type: 'file',
style: { display: 'none' },
multiple: supportMultiple && multiple,
ref: function ref(el) {
return _this3.fileInputEl = el;
}, // eslint-disable-line
onChange: this.onDrop
};
if (name && name.length) {
inputAttributes.name = name;
}
// Remove custom properties before passing them to the wrapper div element
var customProps = ['acceptedFiles', 'disablePreview', 'disableClick', 'onDropAccepted', 'onDropRejected', 'onFileDialogCancel', 'maxSize', 'minSize'];
var divProps = _extends({}, props);
customProps.forEach(function (prop) {
return delete divProps[prop];
});
return _react2.default.createElement(
'div',
_extends({
className: className,
style: appliedStyle
}, divProps /* expand user provided props first so event handlers are never overridden */, {
onClick: this.onClick,
onDragStart: this.onDragStart,
onDragEnter: this.onDragEnter,
onDragOver: this.onDragOver,
onDragLeave: this.onDragLeave,
onDrop: this.onDrop
}),
this.props.children,
_react2.default.createElement('input', _extends({}, inputProps /* expand user provided inputProps first so inputAttributes override them */, inputAttributes))
);
}
}]);
return Dropzone;
}(_react2.default.Component);
Dropzone.defaultProps = {
disablePreview: false,
disableClick: false,
multiple: true,
maxSize: Infinity,
minSize: 0
};
Dropzone.propTypes = {
onClick: _react2.default.PropTypes.func,
onDrop: _react2.default.PropTypes.func,
onDropAccepted: _react2.default.PropTypes.func,
onDropRejected: _react2.default.PropTypes.func,
onDragStart: _react2.default.PropTypes.func,
onDragEnter: _react2.default.PropTypes.func,
onDragOver: _react2.default.PropTypes.func,
onDragLeave: _react2.default.PropTypes.func,
children: _react2.default.PropTypes.node, // Contents of the dropzone
style: _react2.default.PropTypes.object, // CSS styles to apply
activeStyle: _react2.default.PropTypes.object, // CSS styles to apply when drop will be accepted
rejectStyle: _react2.default.PropTypes.object, // CSS styles to apply when drop will be rejected
className: _react2.default.PropTypes.string, // Optional className
activeClassName: _react2.default.PropTypes.string, // className for accepted state
rejectClassName: _react2.default.PropTypes.string, // className for rejected state
disablePreview: _react2.default.PropTypes.bool, // Enable/disable preview generation
disableClick: _react2.default.PropTypes.bool, // Disallow clicking on the dropzone container to open file dialog
onFileDialogCancel: _react2.default.PropTypes.func, // Provide a callback on clicking the cancel button of the file dialog
inputProps: _react2.default.PropTypes.object, // Pass additional attributes to the <input type="file"/> tag
multiple: _react2.default.PropTypes.bool, // Allow dropping multiple files
accept: _react2.default.PropTypes.string, // Allow specific types of files. See https://github.com/okonet/attr-accept for more information
name: _react2.default.PropTypes.string, // name attribute for the input tag
maxSize: _react2.default.PropTypes.number,
minSize: _react2.default.PropTypes.number
};
exports.default = Dropzone;
module.exports = exports['default'];
/***/ },
/* 1 */
/***/ function(module, exports) {
module.exports = __WEBPACK_EXTERNAL_MODULE_1__;
/***/ },
/* 2 */
/***/ function(module, exports) {
module.exports=function(t){function n(e){if(r[e])return r[e].exports;var o=r[e]={exports:{},id:e,loaded:!1};return t[e].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}var r={};return n.m=t,n.c=r,n.p="",n(0)}([function(t,n,r){"use strict";n.__esModule=!0,r(8),r(9),n["default"]=function(t,n){if(t&&n){var r=function(){var r=Array.isArray(n)?n:n.split(","),e=t.name||"",o=t.type||"",i=o.replace(/\/.*$/,"");return{v:r.some(function(t){var n=t.trim();return"."===n.charAt(0)?e.toLowerCase().endsWith(n.toLowerCase()):/\/\*$/.test(n)?i===n.replace(/\/.*$/,""):o===n})}}();if("object"==typeof r)return r.v}return!0},t.exports=n["default"]},function(t,n){var r=t.exports={version:"1.2.2"};"number"==typeof __e&&(__e=r)},function(t,n){var r=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(t,n,r){var e=r(2),o=r(1),i=r(4),u=r(19),c="prototype",f=function(t,n){return function(){return t.apply(n,arguments)}},s=function(t,n,r){var a,p,l,y,d=t&s.G,h=t&s.P,v=d?e:t&s.S?e[n]||(e[n]={}):(e[n]||{})[c],x=d?o:o[n]||(o[n]={});d&&(r=n);for(a in r)p=!(t&s.F)&&v&&a in v,l=(p?v:r)[a],y=t&s.B&&p?f(l,e):h&&"function"==typeof l?f(Function.call,l):l,v&&!p&&u(v,a,l),x[a]!=l&&i(x,a,y),h&&((x[c]||(x[c]={}))[a]=l)};e.core=o,s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,t.exports=s},function(t,n,r){var e=r(5),o=r(18);t.exports=r(22)?function(t,n,r){return e.setDesc(t,n,o(1,r))}:function(t,n,r){return t[n]=r,t}},function(t,n){var r=Object;t.exports={create:r.create,getProto:r.getPrototypeOf,isEnum:{}.propertyIsEnumerable,getDesc:r.getOwnPropertyDescriptor,setDesc:r.defineProperty,setDescs:r.defineProperties,getKeys:r.keys,getNames:r.getOwnPropertyNames,getSymbols:r.getOwnPropertySymbols,each:[].forEach}},function(t,n){var r=0,e=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++r+e).toString(36))}},function(t,n,r){var e=r(20)("wks"),o=r(2).Symbol;t.exports=function(t){return e[t]||(e[t]=o&&o[t]||(o||r(6))("Symbol."+t))}},function(t,n,r){r(26),t.exports=r(1).Array.some},function(t,n,r){r(25),t.exports=r(1).String.endsWith},function(t,n){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,n){var r={}.toString;t.exports=function(t){return r.call(t).slice(8,-1)}},function(t,n,r){var e=r(10);t.exports=function(t,n,r){if(e(t),void 0===n)return t;switch(r){case 1:return function(r){return t.call(n,r)};case 2:return function(r,e){return t.call(n,r,e)};case 3:return function(r,e,o){return t.call(n,r,e,o)}}return function(){return t.apply(n,arguments)}}},function(t,n){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,n,r){t.exports=function(t){var n=/./;try{"/./"[t](n)}catch(e){try{return n[r(7)("match")]=!1,!"/./"[t](n)}catch(o){}}return!0}},function(t,n){t.exports=function(t){try{return!!t()}catch(n){return!0}}},function(t,n){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,n,r){var e=r(16),o=r(11),i=r(7)("match");t.exports=function(t){var n;return e(t)&&(void 0!==(n=t[i])?!!n:"RegExp"==o(t))}},function(t,n){t.exports=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}}},function(t,n,r){var e=r(2),o=r(4),i=r(6)("src"),u="toString",c=Function[u],f=(""+c).split(u);r(1).inspectSource=function(t){return c.call(t)},(t.exports=function(t,n,r,u){"function"==typeof r&&(o(r,i,t[n]?""+t[n]:f.join(String(n))),"name"in r||(r.name=n)),t===e?t[n]=r:(u||delete t[n],o(t,n,r))})(Function.prototype,u,function(){return"function"==typeof this&&this[i]||c.call(this)})},function(t,n,r){var e=r(2),o="__core-js_shared__",i=e[o]||(e[o]={});t.exports=function(t){return i[t]||(i[t]={})}},function(t,n,r){var e=r(17),o=r(13);t.exports=function(t,n,r){if(e(n))throw TypeError("String#"+r+" doesn't accept regex!");return String(o(t))}},function(t,n,r){t.exports=!r(15)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,n){var r=Math.ceil,e=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?e:r)(t)}},function(t,n,r){var e=r(23),o=Math.min;t.exports=function(t){return t>0?o(e(t),9007199254740991):0}},function(t,n,r){"use strict";var e=r(3),o=r(24),i=r(21),u="endsWith",c=""[u];e(e.P+e.F*r(14)(u),"String",{endsWith:function(t){var n=i(this,t,u),r=arguments,e=r.length>1?r[1]:void 0,f=o(n.length),s=void 0===e?f:Math.min(o(e),f),a=String(t);return c?c.call(n,a,s):n.slice(s-a.length,s)===a}})},function(t,n,r){var e=r(5),o=r(3),i=r(1).Array||Array,u={},c=function(t,n){e.each.call(t.split(","),function(t){void 0==n&&t in i?u[t]=i[t]:t in[]&&(u[t]=r(12)(Function.call,[][t],n))})};c("pop,reverse,shift,keys,values,entries",1),c("indexOf,every,some,forEach,map,filter,find,findIndex,includes",3),c("join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill"),o(o.S,"Array",u)}]);
/***/ },
/* 3 */
/***/ function(module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = getDataTransferFiles;
function getDataTransferFiles(event) {
var isMultipleAllowed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
var dataTransferItemsList = [];
if (event.dataTransfer) {
var dt = event.dataTransfer;
if (dt.files && dt.files.length) {
dataTransferItemsList = dt.files;
} else if (dt.items && dt.items.length) {
// During the drag even the dataTransfer.files is null
// but Chrome implements some drag store, which is accesible via dataTransfer.items
dataTransferItemsList = dt.items;
}
} else if (event.target && event.target.files) {
dataTransferItemsList = event.target.files;
}
if (dataTransferItemsList.length > 0) {
dataTransferItemsList = isMultipleAllowed ? dataTransferItemsList : [dataTransferItemsList[0]];
}
// Convert from DataTransferItemsList to the native Array
return Array.prototype.slice.call(dataTransferItemsList);
}
module.exports = exports["default"];
/***/ }
/******/ ])
});
;
//# sourceMappingURL=index.js.map
/***/ },
/* 1076 */
/*!*********************************************************!*\
!*** ./app/components/file_upload_step/FilePreview.jsx ***!
\*********************************************************/
/***/ 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__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _semanticUiReact = __webpack_require__(/*! semantic-ui-react */ 532);
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 FilePreview = function (_Component) {
_inherits(FilePreview, _Component);
function FilePreview() {
var _ref;
var _temp, _this, _ret;
_classCallCheck(this, FilePreview);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = FilePreview.__proto__ || Object.getPrototypeOf(FilePreview)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
active: false,
pageDimmer: false
}, _temp), _possibleConstructorReturn(_this, _ret);
}
_createClass(FilePreview, [{
key: 'render',
value: function render() {
var _this2 = this;
var _state = this.state,
active = _state.active,
pageDimmer = _state.pageDimmer;
var _props = this.props,
fileUpdates = _props.fileUpdates,
imageURL = _props.imageURL,
index = _props.index,
removeFile = _props.removeFile,
title = _props.title,
type = _props.type;
var changes = imageURL in fileUpdates ? fileUpdates[imageURL] : {};
var name = 'name' in changes ? changes.name : title;
var content = _react2.default.createElement(
'div',
null,
_react2.default.createElement(
_semanticUiReact.Header,
{ as: 'h6', inverted: true },
name
),
_react2.default.createElement(_semanticUiReact.Button, {
circular: true,
icon: 'expand',
onClick: function onClick() {
return _this2.setState({ pageDimmer: !pageDimmer });
},
size: 'mini',
type: 'button'
}),
_react2.default.createElement(_semanticUiReact.Button, {
circular: true,
icon: 'close',
onClick: function onClick() {
return removeFile(index);
},
size: 'mini',
type: 'button'
})
);
return _react2.default.createElement(
'div',
{
key: index,
style: {
display: 'inline-block',
padding: '5px',
textAlign: 'center',
width: '150px'
}
},
_react2.default.createElement(_semanticUiReact.Dimmer.Dimmable, {
as: _semanticUiReact.Image,
blurring: true,
dimmed: active,
dimmer: { active: active, content: content },
onMouseEnter: function onMouseEnter() {
return _this2.setState({ active: true });
},
onMouseLeave: function onMouseLeave() {
return _this2.setState({ active: false });
},
size: 'small',
src: imageURL
}),
_react2.default.createElement(
_semanticUiReact.Dimmer,
{
active: pageDimmer,
onClickOutside: function onClickOutside() {
return _this2.setState({ pageDimmer: !pageDimmer });
},
page: true
},
_react2.default.createElement(_semanticUiReact.Image, { centered: true, size: 'large', src: imageURL }),
_react2.default.createElement(
_semanticUiReact.Header,
{ as: 'h2', icon: true, inverted: true },
_react2.default.createElement(_semanticUiReact.Icon, {
name: type === 'image/png' ? 'image' : 'file'
}),
name
)
)
);
}
}]);
return FilePreview;
}(_react.Component);
exports.default = FilePreview;
FilePreview.propTypes = {
fileUpdates: _react.PropTypes.object.isRequired,
imageURL: _react.PropTypes.string.isRequired,
index: _react.PropTypes.number.isRequired,
removeFile: _react.PropTypes.func.isRequired,
title: _react.PropTypes.string.isRequired,
type: _react.PropTypes.string.isRequired,
changeFileParameter: _react.PropTypes.func.isRequired
};
/***/ },
/* 1077 */
/*!**************************************************!*\
!*** ./app/containers/PrimaryModalContainer.jsx ***!
\**************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _reactRedux = __webpack_require__(/*! react-redux */ 200);
var _Actions = __webpack_require__(/*! Actions */ 229);
var _PrimaryModal = __webpack_require__(/*! PrimaryModal */ 1078);
var _PrimaryModal2 = _interopRequireDefault(_PrimaryModal);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var mapStateToProps = function mapStateToProps(state) {
return {
open: state.primaryModalStatus.open,
subModalContext: state.primaryModalStatus.subModalContext
};
};
var mapDispatchToProps = function mapDispatchToProps(dispatch) {
return {
toggleOpen: function toggleOpen() {
return dispatch((0, _Actions.togglePrimaryModal)());
},
toggleSubModal: function toggleSubModal(subModalContext) {
return dispatch((0, _Actions.toggleSubModal)(subModalContext));
}
};
};
var PrimaryModalContainer = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_PrimaryModal2.default);
exports.default = PrimaryModalContainer;
/***/ },
/* 1078 */
/*!*****************************************!*\
!*** ./app/components/PrimaryModal.jsx ***!
\*****************************************/
/***/ 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__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _semanticUiReact = __webpack_require__(/*! semantic-ui-react */ 532);
var _submodalContexts = __webpack_require__(/*! submodalContexts */ 531);
var _ModalHeader = __webpack_require__(/*! ModalHeader */ 1079);
var _ModalHeader2 = _interopRequireDefault(_ModalHeader);
var _SubModal = __webpack_require__(/*! SubModal */ 1081);
var _SubModal2 = _interopRequireDefault(_SubModal);
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 PrimaryModal = function (_Component) {
_inherits(PrimaryModal, _Component);
function PrimaryModal() {
_classCallCheck(this, PrimaryModal);
return _possibleConstructorReturn(this, (PrimaryModal.__proto__ || Object.getPrototypeOf(PrimaryModal)).apply(this, arguments));
}
_createClass(PrimaryModal, [{
key: 'render',
value: function render() {
var _props = this.props,
children = _props.children,
open = _props.open,
subModalContext = _props.subModalContext,
toggleOpen = _props.toggleOpen,
toggleSubModal = _props.toggleSubModal;
return _react2.default.createElement(
'div',
null,
_react2.default.createElement(
_semanticUiReact.Button,
{
onClick: toggleOpen
},
'Fast File'
),
_react2.default.createElement(
_semanticUiReact.Modal,
{
closeIcon: 'close',
closeOnEscape: false,
closeOnRootNodeClick: false,
open: open,
onClose: toggleOpen,
size: 'large'
},
_react2.default.createElement(_SubModal2.default, {
context: subModalContext,
onClose: toggleSubModal
}),
_react2.default.createElement(_ModalHeader2.default, {
onHelpClick: toggleSubModal,
context: _submodalContexts.fastFileHelp
}),
children
)
);
}
}]);
return PrimaryModal;
}(_react.Component);
exports.default = PrimaryModal;
PrimaryModal.propTypes = {
children: _react.PropTypes.element,
open: _react.PropTypes.bool.isRequired,
subModalContext: _react.PropTypes.object,
toggleOpen: _react.PropTypes.func.isRequired,
toggleSubModal: _react.PropTypes.func.isRequired
};
/***/ },
/* 1079 */
/*!******************************************************!*\
!*** ./app/components/primary_modal/ModalHeader.jsx ***!
\******************************************************/
/***/ 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__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _semanticUiReact = __webpack_require__(/*! semantic-ui-react */ 532);
var _InfoIcon = __webpack_require__(/*! InfoIcon */ 1080);
var _InfoIcon2 = _interopRequireDefault(_InfoIcon);
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 ModalHeader = function (_Component) {
_inherits(ModalHeader, _Component);
function ModalHeader() {
_classCallCheck(this, ModalHeader);
return _possibleConstructorReturn(this, (ModalHeader.__proto__ || Object.getPrototypeOf(ModalHeader)).apply(this, arguments));
}
_createClass(ModalHeader, [{
key: 'render',
value: function render() {
var _props = this.props,
context = _props.context,
onHelpClick = _props.onHelpClick;
var color = '#363A43';
return _react2.default.createElement(
_semanticUiReact.Modal.Header,
{ style: { textAlign: 'center' } },
_react2.default.createElement(
_semanticUiReact.Header,
{
style: {
color: color,
display: 'inline-block'
}
},
_react2.default.createElement(_semanticUiReact.Icon, {
name: 'bug',
style: {
color: color,
marginTop: '5px'
}
}),
'Fast File'
),
_react2.default.createElement(_InfoIcon2.default, {
name: 'help circle outline',
onClick: function onClick() {
return onHelpClick(context);
}
})
);
}
}]);
return ModalHeader;
}(_react.Component);
exports.default = ModalHeader;
ModalHeader.propTypes = {
context: _react.PropTypes.object.isRequired,
onHelpClick: _react.PropTypes.func.isRequired
};
/***/ },
/* 1080 */
/*!*********************************************!*\
!*** ./app/components/general/InfoIcon.jsx ***!
\*********************************************/
/***/ 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__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _semanticUiReact = __webpack_require__(/*! semantic-ui-react */ 532);
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 InfoIcon = function (_Component) {
_inherits(InfoIcon, _Component);
function InfoIcon() {
_classCallCheck(this, InfoIcon);
return _possibleConstructorReturn(this, (InfoIcon.__proto__ || Object.getPrototypeOf(InfoIcon)).apply(this, arguments));
}
_createClass(InfoIcon, [{
key: 'render',
value: function render() {
var _props = this.props,
float = _props.float,
_onClick = _props.onClick,
name = _props.name;
var floatPosition = float ? float : 'inherit';
name = name ? name : 'info circle';
return _react2.default.createElement(_semanticUiReact.Icon, {
onClick: function onClick() {
return _onClick();
},
name: name,
size: 'small',
style: {
color: 'rgb(65, 131, 196)',
float: floatPosition,
verticalAlign: 'top'
},
fitted: true,
link: true
});
}
}]);
return InfoIcon;
}(_react.Component);
exports.default = InfoIcon;
InfoIcon.propTypes = {
float: _react.PropTypes.string,
onClick: _react.PropTypes.func.isRequired,
name: _react.PropTypes.string
};
/***/ },
/* 1081 */
/*!*********************************************!*\
!*** ./app/components/general/SubModal.jsx ***!
\*********************************************/
/***/ 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__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _semanticUiReact = __webpack_require__(/*! semantic-ui-react */ 532);
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 SubModal = function (_Component) {
_inherits(SubModal, _Component);
function SubModal() {
var _ref;
var _temp, _this, _ret;
_classCallCheck(this, SubModal);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = SubModal.__proto__ || Object.getPrototypeOf(SubModal)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
textActive: true
}, _temp), _possibleConstructorReturn(_this, _ret);
}
_createClass(SubModal, [{
key: 'toggleTextActive',
value: function toggleTextActive() {
this.setState({ textActive: !this.state.textActive });
}
}, {
key: 'render',
value: function render() {
var _props = this.props,
_onClose = _props.onClose,
context = _props.context;
var embedId = context.embedId,
openStatus = context.openStatus,
readContent = context.readContent,
title = context.title;
var textActive = this.state.textActive;
var ACTIVE_INDEX = textActive ? 0 : 1;
return _react2.default.createElement(
_semanticUiReact.Modal,
{
closeIcon: 'close',
onClose: function onClose() {
return _onClose(context);
},
open: openStatus,
size: 'small'
},
_react2.default.createElement(
_semanticUiReact.Modal.Header,
null,
title
),
_react2.default.createElement(
_semanticUiReact.Modal.Content,
null,
_react2.default.createElement(
_semanticUiReact.Button.Group,
{ fluid: true },
_react2.default.createElement(_semanticUiReact.Button, {
active: textActive,
content: 'Read',
icon: 'book',
onClick: this.toggleTextActive.bind(this)
}),
_react2.default.createElement(_semanticUiReact.Button.Or, null),
_react2.default.createElement(_semanticUiReact.Button, {
active: !textActive,
content: 'Watch',
icon: 'video camera',
onClick: this.toggleTextActive.bind(this)
})
),
_react2.default.createElement(
_semanticUiReact.Accordion,
{
activeIndex: ACTIVE_INDEX,
exclusive: true,
fluid: true
},
_react2.default.createElement(_semanticUiReact.Accordion.Title, { style: { display: 'none' } }),
_react2.default.createElement(
_semanticUiReact.Accordion.Content,
null,
readContent()
),
_react2.default.createElement(_semanticUiReact.Accordion.Title, { style: { display: 'none' } }),
_react2.default.createElement(
_semanticUiReact.Accordion.Content,
null,
_react2.default.createElement(_semanticUiReact.Embed, {
active: true,
autoplay: false,
brandedUI: false,
color: 'white',
id: embedId,
source: 'youtube'
})
)
)
),
_react2.default.createElement(
_semanticUiReact.Modal.Actions,
{ style: { textAlign: 'center' } },
_react2.default.createElement(_semanticUiReact.Button, {
content: 'Got it',
icon: 'checkmark',
onClick: function onClick() {
return _onClose(context);
},
positive: true
})
)
);
}
}]);
return SubModal;
}(_react.Component);
exports.default = SubModal;
SubModal.propTypes = {
onClose: _react.PropTypes.func.isRequired,
context: _react.PropTypes.object.isRequired
};
/***/ },
/* 1082 */
/*!***************************************************!*\
!*** ./app/containers/ProgressStepsContainer.jsx ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _reactRedux = __webpack_require__(/*! react-redux */ 200);
var _Actions = __webpack_require__(/*! Actions */ 229);
var _helpers = __webpack_require__(/*! helpers */ 528);
var _ProgressSteps = __webpack_require__(/*! ProgressSteps */ 1083);
var _ProgressSteps2 = _interopRequireDefault(_ProgressSteps);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var mapStateToProps = function mapStateToProps(state) {
return {
activeStep: state.stepFilter.activeStep,
allStepFieldsValid: (0, _helpers.allAreValid)(state.validationFilter),
form: state.validationFilter
};
};
var mapDispatchToProps = function mapDispatchToProps(dispatch) {
return {
onStepClick: function onStepClick(index) {
return dispatch((0, _Actions.setActiveStep)(index));
},
onLastStep: function onLastStep(form) {
return dispatch((0, _Actions.fileJiraTicket)(form));
}
};
};
var ProgressStepsContainer = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_ProgressSteps2.default);
exports.default = ProgressStepsContainer;
/***/ },
/* 1083 */
/*!******************************************!*\
!*** ./app/components/ProgressSteps.jsx ***!
\******************************************/
/***/ 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__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _semanticUiReact = __webpack_require__(/*! semantic-ui-react */ 532);
var _ProgressStepsGroup = __webpack_require__(/*! ProgressStepsGroup */ 1084);
var _ProgressStepsGroup2 = _interopRequireDefault(_ProgressStepsGroup);
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 ProgressSteps = function (_React$Component) {
_inherits(ProgressSteps, _React$Component);
function ProgressSteps() {
_classCallCheck(this, ProgressSteps);
return _possibleConstructorReturn(this, (ProgressSteps.__proto__ || Object.getPrototypeOf(ProgressSteps)).apply(this, arguments));
}
_createClass(ProgressSteps, [{
key: 'componentWillUpdate',
value: function componentWillUpdate(nextProps) {
var activeStep = nextProps.activeStep,
children = nextProps.children,
onLastStep = nextProps.onLastStep,
form = nextProps.form;
if (activeStep >= children.length - 1) {
onLastStep(form);
}
}
}, {
key: 'render',
value: function render() {
var _props = this.props,
activeStep = _props.activeStep,
allStepFieldsValid = _props.allStepFieldsValid,
children = _props.children,
onStepClick = _props.onStepClick;
var FIRST_STEP = activeStep === 0;
var LAST_STEP = activeStep >= children.length - 1;
return _react2.default.createElement(
'div',
{
style: {
padding: '15px'
}
},
_react2.default.createElement(_ProgressStepsGroup2.default, {
activeStep: activeStep,
onStepClick: onStepClick
}),
_react2.default.createElement(
_semanticUiReact.Form,
null,
_react2.default.createElement(
_semanticUiReact.Accordion,
{
exclusive: true,
fluid: true
},
children.map(function (element, index) {
return _react2.default.createElement(
'div',
{ key: index },
_react2.default.createElement(_semanticUiReact.Accordion.Title, {
style: { display: 'none' }
}),
_react2.default.createElement(
_semanticUiReact.Accordion.Content,
{
active: activeStep === index
},
element
)
);
})
)
),
_react2.default.createElement(_semanticUiReact.Divider, null),
_react2.default.createElement(
'div',
{ style: { textAlign: 'center' } },
_react2.default.createElement(_semanticUiReact.Button, {
basic: true,
circular: true,
disabled: FIRST_STEP,
icon: {
name: 'chevron left',
color: FIRST_STEP ? 'grey' : 'blue'
},
onClick: function onClick() {
return onStepClick(activeStep - 1);
},
style: {
display: LAST_STEP ? 'grey' : 'blue'
}
}),
_react2.default.createElement(_semanticUiReact.Button, {
basic: !allStepFieldsValid,
circular: !LAST_STEP,
content: LAST_STEP ? 'Submit' : '',
icon: {
name: LAST_STEP ? 'checkmark' : 'chevron right',
color: allStepFieldsValid ? 'blue' : 'grey'
},
primary: LAST_STEP,
onClick: function onClick() {
return onStepClick(activeStep + 1);
}
})
)
);
}
}]);
return ProgressSteps;
}(_react2.default.Component);
ProgressSteps.propTypes = {
activeStep: _react2.default.PropTypes.number.isRequired,
allStepFieldsValid: _react2.default.PropTypes.bool.isRequired,
children: _react2.default.PropTypes.arrayOf(_react2.default.PropTypes.element).isRequired,
onStepClick: _react2.default.PropTypes.func.isRequired
};
exports.default = ProgressSteps;
/***/ },
/* 1084 */
/*!***********************************************!*\
!*** ./app/components/ProgressStepsGroup.jsx ***!
\***********************************************/
/***/ 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__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _semanticUiReact = __webpack_require__(/*! semantic-ui-react */ 532);
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 ProgressStepsGroup = function (_Component) {
_inherits(ProgressStepsGroup, _Component);
function ProgressStepsGroup() {
_classCallCheck(this, ProgressStepsGroup);
return _possibleConstructorReturn(this, (ProgressStepsGroup.__proto__ || Object.getPrototypeOf(ProgressStepsGroup)).apply(this, arguments));
}
_createClass(ProgressStepsGroup, [{
key: 'render',
value: function render() {
var _props = this.props,
activeStep = _props.activeStep,
onStepClick = _props.onStepClick;
return _react2.default.createElement(
_semanticUiReact.Step.Group,
{
fluid: true,
stackable: 'tablet',
style: {
textAlign: 'center'
}
},
_react2.default.createElement(
_semanticUiReact.Step,
{
active: activeStep === 0,
link: true,
onClick: function onClick() {
return onStepClick(0);
}
},
_react2.default.createElement(_semanticUiReact.Icon, {
name: 'tasks',
color: activeStep === 0 ? 'blue' : 'black'
}),
_react2.default.createElement(
_semanticUiReact.Step.Title,
null,
_react2.default.createElement(
_semanticUiReact.Step.Description,
null,
'Details and References'
)
)
),
_react2.default.createElement(
_semanticUiReact.Step,
{
active: activeStep === 1,
link: true,
onClick: function onClick() {
return onStepClick(1);
}
},
_react2.default.createElement(_semanticUiReact.Icon, {
name: 'ordered list',
color: activeStep === 1 ? 'blue' : 'black'
}),
_react2.default.createElement(
_semanticUiReact.Step.Title,
null,
_react2.default.createElement(
_semanticUiReact.Step.Description,
null,
'Steps'
)
)
),
_react2.default.createElement(
_semanticUiReact.Step,
{
active: activeStep === 2,
link: true,
onClick: function onClick() {
return onStepClick(2);
}
},
_react2.default.createElement(_semanticUiReact.Icon, {
name: 'image',
color: activeStep === 2 ? 'blue' : 'black'
}),
_react2.default.createElement(
_semanticUiReact.Step.Title,
null,
_react2.default.createElement(
_semanticUiReact.Step.Description,
null,
'Screenshots and Files'
)
)
),
_react2.default.createElement(
_semanticUiReact.Step,
{
disabled: activeStep !== 3,
link: true,
onClick: function onClick() {
return onStepClick(3);
}
},
_react2.default.createElement(_semanticUiReact.Icon, {
name: 'check',
color: activeStep === 3 ? 'green' : 'grey'
}),
_react2.default.createElement(
_semanticUiReact.Step.Title,
null,
'Submit'
)
)
);
}
}]);
return ProgressStepsGroup;
}(_react.Component);
exports.default = ProgressStepsGroup;
ProgressStepsGroup.propTypes = {
activeStep: _react.PropTypes.number.isRequired,
onStepClick: _react.PropTypes.func.isRequired
};
/***/ },
/* 1085 */
/*!*********************************************!*\
!*** ./app/containers/StoStepContainer.jsx ***!
\*********************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _reactRedux = __webpack_require__(/*! react-redux */ 200);
var _Actions = __webpack_require__(/*! Actions */ 229);
var _StoStep = __webpack_require__(/*! StoStep */ 1086);
var _StoStep2 = _interopRequireDefault(_StoStep);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var mapStateToProps = function mapStateToProps(state) {
return {
activeStep: state.stepFilter.activeStep,
isValid: state.validationFilter.steps,
template: state.editorTemplate
};
};
var mapDispatchToProps = function mapDispatchToProps(dispatch) {
return {
onHelpClick: function onHelpClick(context) {
return dispatch((0, _Actions.toggleSubModal)(context));
},
onValidInput: function onValidInput(data) {
return dispatch((0, _Actions.validateSteps)(data));
},
onTemplateChange: function onTemplateChange() {
return dispatch((0, _Actions.toggleTemplate)());
}
};
};
var StoStepContainer = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_StoStep2.default);
exports.default = StoStepContainer;
/***/ },
/* 1086 */
/*!************************************!*\
!*** ./app/components/StoStep.jsx ***!
\************************************/
/***/ 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__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _semanticUiReact = __webpack_require__(/*! semantic-ui-react */ 532);
var _submodalContexts = __webpack_require__(/*! submodalContexts */ 531);
var _FieldLabel = __webpack_require__(/*! FieldLabel */ 1067);
var _FieldLabel2 = _interopRequireDefault(_FieldLabel);
var _TextEditor = __webpack_require__(/*! TextEditor */ 1087);
var _TextEditor2 = _interopRequireDefault(_TextEditor);
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 StoStep = function (_Component) {
_inherits(StoStep, _Component);
function StoStep() {
_classCallCheck(this, StoStep);
return _possibleConstructorReturn(this, (StoStep.__proto__ || Object.getPrototypeOf(StoStep)).apply(this, arguments));
}
_createClass(StoStep, [{
key: 'render',
value: function render() {
var _props = this.props,
activeStep = _props.activeStep,
onHelpClick = _props.onHelpClick,
onValidInput = _props.onValidInput,
onTemplateChange = _props.onTemplateChange,
template = _props.template;
return _react2.default.createElement(
_semanticUiReact.Form.Field,
null,
_react2.default.createElement(_FieldLabel2.default, {
active: activeStep === 1,
helpText: 'Click to learn the difference between STO and STR',
onClick: function onClick() {
return onHelpClick(_submodalContexts.stoStrHelp);
},
text: _react2.default.createElement(
'div',
{
style: { display: 'inline-block' }
},
'Steps to ',
' ',
_react2.default.createElement(_semanticUiReact.Dropdown, {
defaultValue: 'sto',
inline: true,
onChange: function onChange() {
return onTemplateChange();
},
options: [{ text: 'observe', value: 'sto' }, { text: 'reproduce', value: 'str' }],
style: {
color: '#6D717A',
display: 'inline-block'
}
}),
'the issue'
)
}),
_react2.default.createElement(_TextEditor2.default, {
template: template.template,
onChange: function onChange(value) {
return onValidInput(value);
},
placeholderText: 'Tell us how to observe your issue here'
})
);
}
}]);
return StoStep;
}(_react.Component);
exports.default = StoStep;
StoStep.propTypes = {
activeStep: _react.PropTypes.number.isRequired,
onHelpClick: _react.PropTypes.func.isRequired,
onTemplateChange: _react.PropTypes.func.isRequired,
onValidInput: _react.PropTypes.func.isRequired,
template: _react.PropTypes.object.isRequired
};
/***/ },
/* 1087 */
/*!************************************************!*\
!*** ./app/components/sto_step/TextEditor.jsx ***!
\************************************************/
/***/ 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__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _draftJs = __webpack_require__(/*! draft-js */ 1088);
var _reactRte = __webpack_require__(/*! react-rte */ 1216);
var _reactRte2 = _interopRequireDefault(_reactRte);
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 TextEditor = function (_Component) {
_inherits(TextEditor, _Component);
function TextEditor() {
var _ref;
var _temp, _this, _ret;
_classCallCheck(this, TextEditor);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = TextEditor.__proto__ || Object.getPrototypeOf(TextEditor)).call.apply(_ref, [this].concat(args))), _this), _this.onChange = function (value) {
_this.setState({ value: value });
_this.props.onChange(value);
}, _temp), _possibleConstructorReturn(_this, _ret);
}
_createClass(TextEditor, [{
key: 'componentWillMount',
value: function componentWillMount() {
this.setState({
value: _reactRte2.default.createValueFromString(this.props.template, 'markdown')
});
}
}, {
key: 'componentWillReceiveProps',
value: function componentWillReceiveProps(newProps) {
if (this.props.template !== newProps.template) {
this.setState({
value: _reactRte2.default.createValueFromString(newProps.template, 'markdown')
});
}
}
}, {
key: 'render',
value: function render() {
var toolbarConfig = {
// Optionally specify the groups to display (displayed in the order listed).
display: ['INLINE_STYLE_BUTTONS', 'BLOCK_TYPE_BUTTONS', 'LINK_BUTTONS', 'HISTORY_BUTTONS'],
INLINE_STYLE_BUTTONS: [{ label: 'Bold', style: 'BOLD' }, { label: 'Italic', style: 'ITALIC' }],
BLOCK_TYPE_BUTTONS: [{ label: 'UL', style: 'unordered-list-item' }, { label: 'OL', style: 'ordered-list-item' }]
};
var placeholderText = this.props.placeholderText;
return _react2.default.createElement(_reactRte2.default, {
placeholder: placeholderText,
toolbarConfig: toolbarConfig,
value: this.state.value,
onChange: this.onChange.bind(this),
className: 'text-editor'
});
}
}]);
return TextEditor;
}(_react.Component);
TextEditor.propTypes = {
onChange: _react.PropTypes.func.isRequired,
placeholderText: _react.PropTypes.string.isRequired,
template: _react.PropTypes.string.isRequired
};
exports.default = TextEditor;
/***/ },
/* 1088 */
/*!*********************************!*\
!*** ./~/draft-js/lib/Draft.js ***!
\*********************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule Draft
*/
'use strict';
var AtomicBlockUtils = __webpack_require__(/*! ./AtomicBlockUtils */ 1089);
var BlockMapBuilder = __webpack_require__(/*! ./BlockMapBuilder */ 1090);
var CharacterMetadata = __webpack_require__(/*! ./CharacterMetadata */ 1092);
var CompositeDraftDecorator = __webpack_require__(/*! ./CompositeDraftDecorator */ 1123);
var ContentBlock = __webpack_require__(/*! ./ContentBlock */ 1093);
var ContentState = __webpack_require__(/*! ./ContentState */ 1115);
var DefaultDraftBlockRenderMap = __webpack_require__(/*! ./DefaultDraftBlockRenderMap */ 1124);
var DefaultDraftInlineStyle = __webpack_require__(/*! ./DefaultDraftInlineStyle */ 1126);
var DraftEditor = __webpack_require__(/*! ./DraftEditor.react */ 1127);
var DraftEditorBlock = __webpack_require__(/*! ./DraftEditorBlock.react */ 1133);
var DraftModifier = __webpack_require__(/*! ./DraftModifier */ 1095);
var DraftEntity = __webpack_require__(/*! ./DraftEntity */ 1100);
var DraftEntityInstance = __webpack_require__(/*! ./DraftEntityInstance */ 1101);
var EditorState = __webpack_require__(/*! ./EditorState */ 1113);
var KeyBindingUtil = __webpack_require__(/*! ./KeyBindingUtil */ 1173);
var RichTextEditorUtil = __webpack_require__(/*! ./RichTextEditorUtil */ 1204);
var SelectionState = __webpack_require__(/*! ./SelectionState */ 1116);
var convertFromDraftStateToRaw = __webpack_require__(/*! ./convertFromDraftStateToRaw */ 1206);
var convertFromHTMLToContentBlocks = __webpack_require__(/*! ./convertFromHTMLToContentBlocks */ 1196);
var convertFromRawToDraftState = __webpack_require__(/*! ./convertFromRawToDraftState */ 1210);
var generateRandomKey = __webpack_require__(/*! ./generateRandomKey */ 1105);
var getDefaultKeyBinding = __webpack_require__(/*! ./getDefaultKeyBinding */ 1203);
var getVisibleSelectionRect = __webpack_require__(/*! ./getVisibleSelectionRect */ 1214);
var DraftPublic = {
Editor: DraftEditor,
EditorBlock: DraftEditorBlock,
EditorState: EditorState,
CompositeDecorator: CompositeDraftDecorator,
Entity: DraftEntity,
EntityInstance: DraftEntityInstance,
BlockMapBuilder: BlockMapBuilder,
CharacterMetadata: CharacterMetadata,
ContentBlock: ContentBlock,
ContentState: ContentState,
SelectionState: SelectionState,
AtomicBlockUtils: AtomicBlockUtils,
KeyBindingUtil: KeyBindingUtil,
Modifier: DraftModifier,
RichUtils: RichTextEditorUtil,
DefaultDraftBlockRenderMap: DefaultDraftBlockRenderMap,
DefaultDraftInlineStyle: DefaultDraftInlineStyle,
convertFromHTML: convertFromHTMLToContentBlocks,
convertFromRaw: convertFromRawToDraftState,
convertToRaw: convertFromDraftStateToRaw,
genKey: generateRandomKey,
getDefaultKeyBinding: getDefaultKeyBinding,
getVisibleSelectionRect: getVisibleSelectionRect
};
module.exports = DraftPublic;
/***/ },
/* 1089 */
/*!********************************************!*\
!*** ./~/draft-js/lib/AtomicBlockUtils.js ***!
\********************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule AtomicBlockUtils
* @typechecks
*
*/
'use strict';
var BlockMapBuilder = __webpack_require__(/*! ./BlockMapBuilder */ 1090);
var CharacterMetadata = __webpack_require__(/*! ./CharacterMetadata */ 1092);
var ContentBlock = __webpack_require__(/*! ./ContentBlock */ 1093);
var DraftModifier = __webpack_require__(/*! ./DraftModifier */ 1095);
var EditorState = __webpack_require__(/*! ./EditorState */ 1113);
var Immutable = __webpack_require__(/*! immutable */ 1091);
var generateRandomKey = __webpack_require__(/*! ./generateRandomKey */ 1105);
var List = Immutable.List;
var Repeat = Immutable.Repeat;
var AtomicBlockUtils = {
insertAtomicBlock: function insertAtomicBlock(editorState, entityKey, character) {
var contentState = editorState.getCurrentContent();
var selectionState = editorState.getSelection();
var afterRemoval = DraftModifier.removeRange(contentState, selectionState, 'backward');
var targetSelection = afterRemoval.getSelectionAfter();
var afterSplit = DraftModifier.splitBlock(afterRemoval, targetSelection);
var insertionTarget = afterSplit.getSelectionAfter();
var asAtomicBlock = DraftModifier.setBlockType(afterSplit, insertionTarget, 'atomic');
var charData = CharacterMetadata.create({ entity: entityKey });
var fragmentArray = [new ContentBlock({
key: generateRandomKey(),
type: 'atomic',
text: character,
characterList: List(Repeat(charData, character.length))
}), new ContentBlock({
key: generateRandomKey(),
type: 'unstyled',
text: '',
characterList: List()
})];
var fragment = BlockMapBuilder.createFromArray(fragmentArray);
var withAtomicBlock = DraftModifier.replaceWithFragment(asAtomicBlock, insertionTarget, fragment);
var newContent = withAtomicBlock.merge({
selectionBefore: selectionState,
selectionAfter: withAtomicBlock.getSelectionAfter().set('hasFocus', true)
});
return EditorState.push(editorState, newContent, 'insert-fragment');
}
};
module.exports = AtomicBlockUtils;
/***/ },
/* 1090 */
/*!*******************************************!*\
!*** ./~/draft-js/lib/BlockMapBuilder.js ***!
\*******************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule BlockMapBuilder
*
*/
'use strict';
var Immutable = __webpack_require__(/*! immutable */ 1091);
var OrderedMap = Immutable.OrderedMap;
var BlockMapBuilder = {
createFromArray: function createFromArray(blocks) {
return OrderedMap(blocks.map(function (block) {
return [block.getKey(), block];
}));
}
};
module.exports = BlockMapBuilder;
/***/ },
/* 1091 */
/*!**************************************************!*\
!*** ./~/draft-js/~/immutable/dist/immutable.js ***!
\**************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 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.
*/
(function (global, factory) {
true ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
global.Immutable = factory();
}(this, function () { 'use strict';var SLICE$0 = Array.prototype.slice;
function createClass(ctor, superClass) {
if (superClass) {
ctor.prototype = Object.create(superClass.prototype);
}
ctor.prototype.constructor = ctor;
}
function Iterable(value) {
return isIterable(value) ? value : Seq(value);
}
createClass(KeyedIterable, Iterable);
function KeyedIterable(value) {
return isKeyed(value) ? value : KeyedSeq(value);
}
createClass(IndexedIterable, Iterable);
function IndexedIterable(value) {
return isIndexed(value) ? value : IndexedSeq(value);
}
createClass(SetIterable, Iterable);
function SetIterable(value) {
return isIterable(value) && !isAssociative(value) ? value : SetSeq(value);
}
function isIterable(maybeIterable) {
return !!(maybeIterable && maybeIterable[IS_ITERABLE_SENTINEL]);
}
function isKeyed(maybeKeyed) {
return !!(maybeKeyed && maybeKeyed[IS_KEYED_SENTINEL]);
}
function isIndexed(maybeIndexed) {
return !!(maybeIndexed && maybeIndexed[IS_INDEXED_SENTINEL]);
}
function isAssociative(maybeAssociative) {
return isKeyed(maybeAssociative) || isIndexed(maybeAssociative);
}
function isOrdered(maybeOrdered) {
return !!(maybeOrdered && maybeOrdered[IS_ORDERED_SENTINEL]);
}
Iterable.isIterable = isIterable;
Iterable.isKeyed = isKeyed;
Iterable.isIndexed = isIndexed;
Iterable.isAssociative = isAssociative;
Iterable.isOrdered = isOrdered;
Iterable.Keyed = KeyedIterable;
Iterable.Indexed = IndexedIterable;
Iterable.Set = SetIterable;
var IS_ITERABLE_SENTINEL = '@@__IMMUTABLE_ITERABLE__@@';
var IS_KEYED_SENTINEL = '@@__IMMUTABLE_KEYED__@@';
var IS_INDEXED_SENTINEL = '@@__IMMUTABLE_INDEXED__@@';
var IS_ORDERED_SENTINEL = '@@__IMMUTABLE_ORDERED__@@';
// Used for setting prototype methods that IE8 chokes on.
var DELETE = 'delete';
// Constants describing the size of trie nodes.
var SHIFT = 5; // Resulted in best performance after ______?
var SIZE = 1 << SHIFT;
var MASK = SIZE - 1;
// A consistent shared value representing "not set" which equals nothing other
// than itself, and nothing that could be provided externally.
var NOT_SET = {};
// Boolean references, Rough equivalent of `bool &`.
var CHANGE_LENGTH = { value: false };
var DID_ALTER = { value: false };
function MakeRef(ref) {
ref.value = false;
return ref;
}
function SetRef(ref) {
ref && (ref.value = true);
}
// A function which returns a value representing an "owner" for transient writes
// to tries. The return value will only ever equal itself, and will not equal
// the return of any subsequent call of this function.
function OwnerID() {}
// http://jsperf.com/copy-array-inline
function arrCopy(arr, offset) {
offset = offset || 0;
var len = Math.max(0, arr.length - offset);
var newArr = new Array(len);
for (var ii = 0; ii < len; ii++) {
newArr[ii] = arr[ii + offset];
}
return newArr;
}
function ensureSize(iter) {
if (iter.size === undefined) {
iter.size = iter.__iterate(returnTrue);
}
return iter.size;
}
function wrapIndex(iter, index) {
// This implements "is array index" which the ECMAString spec defines as:
//
// A String property name P is an array index if and only if
// ToString(ToUint32(P)) is equal to P and ToUint32(P) is not equal
// to 2^32−1.
//
// http://www.ecma-international.org/ecma-262/6.0/#sec-array-exotic-objects
if (typeof index !== 'number') {
var uint32Index = index >>> 0; // N >>> 0 is shorthand for ToUint32
if ('' + uint32Index !== index || uint32Index === 4294967295) {
return NaN;
}
index = uint32Index;
}
return index < 0 ? ensureSize(iter) + index : index;
}
function returnTrue() {
return true;
}
function wholeSlice(begin, end, size) {
return (begin === 0 || (size !== undefined && begin <= -size)) &&
(end === undefined || (size !== undefined && end >= size));
}
function resolveBegin(begin, size) {
return resolveIndex(begin, size, 0);
}
function resolveEnd(end, size) {
return resolveIndex(end, size, size);
}
function resolveIndex(index, size, defaultIndex) {
return index === undefined ?
defaultIndex :
index < 0 ?
Math.max(0, size + index) :
size === undefined ?
index :
Math.min(size, index);
}
/* global Symbol */
var ITERATE_KEYS = 0;
var ITERATE_VALUES = 1;
var ITERATE_ENTRIES = 2;
var REAL_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
var FAUX_ITERATOR_SYMBOL = '@@iterator';
var ITERATOR_SYMBOL = REAL_ITERATOR_SYMBOL || FAUX_ITERATOR_SYMBOL;
function Iterator(next) {
this.next = next;
}
Iterator.prototype.toString = function() {
return '[Iterator]';
};
Iterator.KEYS = ITERATE_KEYS;
Iterator.VALUES = ITERATE_VALUES;
Iterator.ENTRIES = ITERATE_ENTRIES;
Iterator.prototype.inspect =
Iterator.prototype.toSource = function () { return this.toString(); }
Iterator.prototype[ITERATOR_SYMBOL] = function () {
return this;
};
function iteratorValue(type, k, v, iteratorResult) {
var value = type === 0 ? k : type === 1 ? v : [k, v];
iteratorResult ? (iteratorResult.value = value) : (iteratorResult = {
value: value, done: false
});
return iteratorResult;
}
function iteratorDone() {
return { value: undefined, done: true };
}
function hasIterator(maybeIterable) {
return !!getIteratorFn(maybeIterable);
}
function isIterator(maybeIterator) {
return maybeIterator && typeof maybeIterator.next === 'function';
}
function getIterator(iterable) {
var iteratorFn = getIteratorFn(iterable);
return iteratorFn && iteratorFn.call(iterable);
}
function getIteratorFn(iterable) {
var iteratorFn = iterable && (
(REAL_ITERATOR_SYMBOL && iterable[REAL_ITERATOR_SYMBOL]) ||
iterable[FAUX_ITERATOR_SYMBOL]
);
if (typeof iteratorFn === 'function') {
return iteratorFn;
}
}
function isArrayLike(value) {
return value && typeof value.length === 'number';
}
createClass(Seq, Iterable);
function Seq(value) {
return value === null || value === undefined ? emptySequence() :
isIterable(value) ? value.toSeq() : seqFromValue(value);
}
Seq.of = function(/*...values*/) {
return Seq(arguments);
};
Seq.prototype.toSeq = function() {
return this;
};
Seq.prototype.toString = function() {
return this.__toString('Seq {', '}');
};
Seq.prototype.cacheResult = function() {
if (!this._cache && this.__iterateUncached) {
this._cache = this.entrySeq().toArray();
this.size = this._cache.length;
}
return this;
};
// abstract __iterateUncached(fn, reverse)
Seq.prototype.__iterate = function(fn, reverse) {
return seqIterate(this, fn, reverse, true);
};
// abstract __iteratorUncached(type, reverse)
Seq.prototype.__iterator = function(type, reverse) {
return seqIterator(this, type, reverse, true);
};
createClass(KeyedSeq, Seq);
function KeyedSeq(value) {
return value === null || value === undefined ?
emptySequence().toKeyedSeq() :
isIterable(value) ?
(isKeyed(value) ? value.toSeq() : value.fromEntrySeq()) :
keyedSeqFromValue(value);
}
KeyedSeq.prototype.toKeyedSeq = function() {
return this;
};
createClass(IndexedSeq, Seq);
function IndexedSeq(value) {
return value === null || value === undefined ? emptySequence() :
!isIterable(value) ? indexedSeqFromValue(value) :
isKeyed(value) ? value.entrySeq() : value.toIndexedSeq();
}
IndexedSeq.of = function(/*...values*/) {
return IndexedSeq(arguments);
};
IndexedSeq.prototype.toIndexedSeq = function() {
return this;
};
IndexedSeq.prototype.toString = function() {
return this.__toString('Seq [', ']');
};
IndexedSeq.prototype.__iterate = function(fn, reverse) {
return seqIterate(this, fn, reverse, false);
};
IndexedSeq.prototype.__iterator = function(type, reverse) {
return seqIterator(this, type, reverse, false);
};
createClass(SetSeq, Seq);
function SetSeq(value) {
return (
value === null || value === undefined ? emptySequence() :
!isIterable(value) ? indexedSeqFromValue(value) :
isKeyed(value) ? value.entrySeq() : value
).toSetSeq();
}
SetSeq.of = function(/*...values*/) {
return SetSeq(arguments);
};
SetSeq.prototype.toSetSeq = function() {
return this;
};
Seq.isSeq = isSeq;
Seq.Keyed = KeyedSeq;
Seq.Set = SetSeq;
Seq.Indexed = IndexedSeq;
var IS_SEQ_SENTINEL = '@@__IMMUTABLE_SEQ__@@';
Seq.prototype[IS_SEQ_SENTINEL] = true;
createClass(ArraySeq, IndexedSeq);
function ArraySeq(array) {
this._array = array;
this.size = array.length;
}
ArraySeq.prototype.get = function(index, notSetValue) {
return this.has(index) ? this._array[wrapIndex(this, index)] : notSetValue;
};
ArraySeq.prototype.__iterate = function(fn, reverse) {
var array = this._array;
var maxIndex = array.length - 1;
for (var ii = 0; ii <= maxIndex; ii++) {
if (fn(array[reverse ? maxIndex - ii : ii], ii, this) === false) {
return ii + 1;
}
}
return ii;
};
ArraySeq.prototype.__iterator = function(type, reverse) {
var array = this._array;
var maxIndex = array.length - 1;
var ii = 0;
return new Iterator(function()
{return ii > maxIndex ?
iteratorDone() :
iteratorValue(type, ii, array[reverse ? maxIndex - ii++ : ii++])}
);
};
createClass(ObjectSeq, KeyedSeq);
function ObjectSeq(object) {
var keys = Object.keys(object);
this._object = object;
this._keys = keys;
this.size = keys.length;
}
ObjectSeq.prototype.get = function(key, notSetValue) {
if (notSetValue !== undefined && !this.has(key)) {
return notSetValue;
}
return this._object[key];
};
ObjectSeq.prototype.has = function(key) {
return this._object.hasOwnProperty(key);
};
ObjectSeq.prototype.__iterate = function(fn, reverse) {
var object = this._object;
var keys = this._keys;
var maxIndex = keys.length - 1;
for (var ii = 0; ii <= maxIndex; ii++) {
var key = keys[reverse ? maxIndex - ii : ii];
if (fn(object[key], key, this) === false) {
return ii + 1;
}
}
return ii;
};
ObjectSeq.prototype.__iterator = function(type, reverse) {
var object = this._object;
var keys = this._keys;
var maxIndex = keys.length - 1;
var ii = 0;
return new Iterator(function() {
var key = keys[reverse ? maxIndex - ii : ii];
return ii++ > maxIndex ?
iteratorDone() :
iteratorValue(type, key, object[key]);
});
};
ObjectSeq.prototype[IS_ORDERED_SENTINEL] = true;
createClass(IterableSeq, IndexedSeq);
function IterableSeq(iterable) {
this._iterable = iterable;
this.size = iterable.length || iterable.size;
}
IterableSeq.prototype.__iterateUncached = function(fn, reverse) {
if (reverse) {
return this.cacheResult().__iterate(fn, reverse);
}
var iterable = this._iterable;
var iterator = getIterator(iterable);
var iterations = 0;
if (isIterator(iterator)) {
var step;
while (!(step = iterator.next()).done) {
if (fn(step.value, iterations++, this) === false) {
break;
}
}
}
return iterations;
};
IterableSeq.prototype.__iteratorUncached = function(type, reverse) {
if (reverse) {
return this.cacheResult().__iterator(type, reverse);
}
var iterable = this._iterable;
var iterator = getIterator(iterable);
if (!isIterator(iterator)) {
return new Iterator(iteratorDone);
}
var iterations = 0;
return new Iterator(function() {
var step = iterator.next();
return step.done ? step : iteratorValue(type, iterations++, step.value);
});
};
createClass(IteratorSeq, IndexedSeq);
function IteratorSeq(iterator) {
this._iterator = iterator;
this._iteratorCache = [];
}
IteratorSeq.prototype.__iterateUncached = function(fn, reverse) {
if (reverse) {
return this.cacheResult().__iterate(fn, reverse);
}
var iterator = this._iterator;
var cache = this._iteratorCache;
var iterations = 0;
while (iterations < cache.length) {
if (fn(cache[iterations], iterations++, this) === false) {
return iterations;
}
}
var step;
while (!(step = iterator.next()).done) {
var val = step.value;
cache[iterations] = val;
if (fn(val, iterations++, this) === false) {
break;
}
}
return iterations;
};
IteratorSeq.prototype.__iteratorUncached = function(type, reverse) {
if (reverse) {
return this.cacheResult().__iterator(type, reverse);
}
var iterator = this._iterator;
var cache = this._iteratorCache;
var iterations = 0;
return new Iterator(function() {
if (iterations >= cache.length) {
var step = iterator.next();
if (step.done) {
return step;
}
cache[iterations] = step.value;
}
return iteratorValue(type, iterations, cache[iterations++]);
});
};
// # pragma Helper functions
function isSeq(maybeSeq) {
return !!(maybeSeq && maybeSeq[IS_SEQ_SENTINEL]);
}
var EMPTY_SEQ;
function emptySequence() {
return EMPTY_SEQ || (EMPTY_SEQ = new ArraySeq([]));
}
function keyedSeqFromValue(value) {
var seq =
Array.isArray(value) ? new ArraySeq(value).fromEntrySeq() :
isIterator(value) ? new IteratorSeq(value).fromEntrySeq() :
hasIterator(value) ? new IterableSeq(value).fromEntrySeq() :
typeof value === 'object' ? new ObjectSeq(value) :
undefined;
if (!seq) {
throw new TypeError(
'Expected Array or iterable object of [k, v] entries, '+
'or keyed object: ' + value
);
}
return seq;
}
function indexedSeqFromValue(value) {
var seq = maybeIndexedSeqFromValue(value);
if (!seq) {
throw new TypeError(
'Expected Array or iterable object of values: ' + value
);
}
return seq;
}
function seqFromValue(value) {
var seq = maybeIndexedSeqFromValue(value) ||
(typeof value === 'object' && new ObjectSeq(value));
if (!seq) {
throw new TypeError(
'Expected Array or iterable object of values, or keyed object: ' + value
);
}
return seq;
}
function maybeIndexedSeqFromValue(value) {
return (
isArrayLike(value) ? new ArraySeq(value) :
isIterator(value) ? new IteratorSeq(value) :
hasIterator(value) ? new IterableSeq(value) :
undefined
);
}
function seqIterate(seq, fn, reverse, useKeys) {
var cache = seq._cache;
if (cache) {
var maxIndex = cache.length - 1;
for (var ii = 0; ii <= maxIndex; ii++) {
var entry = cache[reverse ? maxIndex - ii : ii];
if (fn(entry[1], useKeys ? entry[0] : ii, seq) === false) {
return ii + 1;
}
}
return ii;
}
return seq.__iterateUncached(fn, reverse);
}
function seqIterator(seq, type, reverse, useKeys) {
var cache = seq._cache;
if (cache) {
var maxIndex = cache.length - 1;
var ii = 0;
return new Iterator(function() {
var entry = cache[reverse ? maxIndex - ii : ii];
return ii++ > maxIndex ?
iteratorDone() :
iteratorValue(type, useKeys ? entry[0] : ii - 1, entry[1]);
});
}
return seq.__iteratorUncached(type, reverse);
}
function fromJS(json, converter) {
return converter ?
fromJSWith(converter, json, '', {'': json}) :
fromJSDefault(json);
}
function fromJSWith(converter, json, key, parentJSON) {
if (Array.isArray(json)) {
return converter.call(parentJSON, key, IndexedSeq(json).map(function(v, k) {return fromJSWith(converter, v, k, json)}));
}
if (isPlainObj(json)) {
return converter.call(parentJSON, key, KeyedSeq(json).map(function(v, k) {return fromJSWith(converter, v, k, json)}));
}
return json;
}
function fromJSDefault(json) {
if (Array.isArray(json)) {
return IndexedSeq(json).map(fromJSDefault).toList();
}
if (isPlainObj(json)) {
return KeyedSeq(json).map(fromJSDefault).toMap();
}
return json;
}
function isPlainObj(value) {
return value && (value.constructor === Object || value.constructor === undefined);
}
/**
* An extension of the "same-value" algorithm as [described for use by ES6 Map
* and Set](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map#Key_equality)
*
* NaN is considered the same as NaN, however -0 and 0 are considered the same
* value, which is different from the algorithm described by
* [`Object.is`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is).
*
* This is extended further to allow Objects to describe the values they
* represent, by way of `valueOf` or `equals` (and `hashCode`).
*
* Note: because of this extension, the key equality of Immutable.Map and the
* value equality of Immutable.Set will differ from ES6 Map and Set.
*
* ### Defining custom values
*
* The easiest way to describe the value an object represents is by implementing
* `valueOf`. For example, `Date` represents a value by returning a unix
* timestamp for `valueOf`:
*
* var date1 = new Date(1234567890000); // Fri Feb 13 2009 ...
* var date2 = new Date(1234567890000);
* date1.valueOf(); // 1234567890000
* assert( date1 !== date2 );
* assert( Immutable.is( date1, date2 ) );
*
* Note: overriding `valueOf` may have other implications if you use this object
* where JavaScript expects a primitive, such as implicit string coercion.
*
* For more complex types, especially collections, implementing `valueOf` may
* not be performant. An alternative is to implement `equals` and `hashCode`.
*
* `equals` takes another object, presumably of similar type, and returns true
* if the it is equal. Equality is symmetrical, so the same result should be
* returned if this and the argument are flipped.
*
* assert( a.equals(b) === b.equals(a) );
*
* `hashCode` returns a 32bit integer number representing the object which will
* be used to determine how to store the value object in a Map or Set. You must
* provide both or neither methods, one must not exist without the other.
*
* Also, an important relationship between these methods must be upheld: if two
* values are equal, they *must* return the same hashCode. If the values are not
* equal, they might have the same hashCode; this is called a hash collision,
* and while undesirable for performance reasons, it is acceptable.
*
* if (a.equals(b)) {
* assert( a.hashCode() === b.hashCode() );
* }
*
* All Immutable collections implement `equals` and `hashCode`.
*
*/
function is(valueA, valueB) {
if (valueA === valueB || (valueA !== valueA && valueB !== valueB)) {
return true;
}
if (!valueA || !valueB) {
return false;
}
if (typeof valueA.valueOf === 'function' &&
typeof valueB.valueOf === 'function') {
valueA = valueA.valueOf();
valueB = valueB.valueOf();
if (valueA === valueB || (valueA !== valueA && valueB !== valueB)) {
return true;
}
if (!valueA || !valueB) {
return false;
}
}
if (typeof valueA.equals === 'function' &&
typeof valueB.equals === 'function' &&
valueA.equals(valueB)) {
return true;
}
return false;
}
function deepEqual(a, b) {
if (a === b) {
return true;
}
if (
!isIterable(b) ||
a.size !== undefined && b.size !== undefined && a.size !== b.size ||
a.__hash !== undefined && b.__hash !== undefined && a.__hash !== b.__hash ||
isKeyed(a) !== isKeyed(b) ||
isIndexed(a) !== isIndexed(b) ||
isOrdered(a) !== isOrdered(b)
) {
return false;
}
if (a.size === 0 && b.size === 0) {
return true;
}
var notAssociative = !isAssociative(a);
if (isOrdered(a)) {
var entries = a.entries();
return b.every(function(v, k) {
var entry = entries.next().value;
return entry && is(entry[1], v) && (notAssociative || is(entry[0], k));
}) && entries.next().done;
}
var flipped = false;
if (a.size === undefined) {
if (b.size === undefined) {
if (typeof a.cacheResult === 'function') {
a.cacheResult();
}
} else {
flipped = true;
var _ = a;
a = b;
b = _;
}
}
var allEqual = true;
var bSize = b.__iterate(function(v, k) {
if (notAssociative ? !a.has(v) :
flipped ? !is(v, a.get(k, NOT_SET)) : !is(a.get(k, NOT_SET), v)) {
allEqual = false;
return false;
}
});
return allEqual && a.size === bSize;
}
createClass(Repeat, IndexedSeq);
function Repeat(value, times) {
if (!(this instanceof Repeat)) {
return new Repeat(value, times);
}
this._value = value;
this.size = times === undefined ? Infinity : Math.max(0, times);
if (this.size === 0) {
if (EMPTY_REPEAT) {
return EMPTY_REPEAT;
}
EMPTY_REPEAT = this;
}
}
Repeat.prototype.toString = function() {
if (this.size === 0) {
return 'Repeat []';
}
return 'Repeat [ ' + this._value + ' ' + this.size + ' times ]';
};
Repeat.prototype.get = function(index, notSetValue) {
return this.has(index) ? this._value : notSetValue;
};
Repeat.prototype.includes = function(searchValue) {
return is(this._value, searchValue);
};
Repeat.prototype.slice = function(begin, end) {
var size = this.size;
return wholeSlice(begin, end, size) ? this :
new Repeat(this._value, resolveEnd(end, size) - resolveBegin(begin, size));
};
Repeat.prototype.reverse = function() {
return this;
};
Repeat.prototype.indexOf = function(searchValue) {
if (is(this._value, searchValue)) {
return 0;
}
return -1;
};
Repeat.prototype.lastIndexOf = function(searchValue) {
if (is(this._value, searchValue)) {
return this.size;
}
return -1;
};
Repeat.prototype.__iterate = function(fn, reverse) {
for (var ii = 0; ii < this.size; ii++) {
if (fn(this._value, ii, this) === false) {
return ii + 1;
}
}
return ii;
};
Repeat.prototype.__iterator = function(type, reverse) {var this$0 = this;
var ii = 0;
return new Iterator(function()
{return ii < this$0.size ? iteratorValue(type, ii++, this$0._value) : iteratorDone()}
);
};
Repeat.prototype.equals = function(other) {
return other instanceof Repeat ?
is(this._value, other._value) :
deepEqual(other);
};
var EMPTY_REPEAT;
function invariant(condition, error) {
if (!condition) throw new Error(error);
}
createClass(Range, IndexedSeq);
function Range(start, end, step) {
if (!(this instanceof Range)) {
return new Range(start, end, step);
}
invariant(step !== 0, 'Cannot step a Range by 0');
start = start || 0;
if (end === undefined) {
end = Infinity;
}
step = step === undefined ? 1 : Math.abs(step);
if (end < start) {
step = -step;
}
this._start = start;
this._end = end;
this._step = step;
this.size = Math.max(0, Math.ceil((end - start) / step - 1) + 1);
if (this.size === 0) {
if (EMPTY_RANGE) {
return EMPTY_RANGE;
}
EMPTY_RANGE = this;
}
}
Range.prototype.toString = function() {
if (this.size === 0) {
return 'Range []';
}
return 'Range [ ' +
this._start + '...' + this._end +
(this._step > 1 ? ' by ' + this._step : '') +
' ]';
};
Range.prototype.get = function(index, notSetValue) {
return this.has(index) ?
this._start + wrapIndex(this, index) * this._step :
notSetValue;
};
Range.prototype.includes = function(searchValue) {
var possibleIndex = (searchValue - this._start) / this._step;
return possibleIndex >= 0 &&
possibleIndex < this.size &&
possibleIndex === Math.floor(possibleIndex);
};
Range.prototype.slice = function(begin, end) {
if (wholeSlice(begin, end, this.size)) {
return this;
}
begin = resolveBegin(begin, this.size);
end = resolveEnd(end, this.size);
if (end <= begin) {
return new Range(0, 0);
}
return new Range(this.get(begin, this._end), this.get(end, this._end), this._step);
};
Range.prototype.indexOf = function(searchValue) {
var offsetValue = searchValue - this._start;
if (offsetValue % this._step === 0) {
var index = offsetValue / this._step;
if (index >= 0 && index < this.size) {
return index
}
}
return -1;
};
Range.prototype.lastIndexOf = function(searchValue) {
return this.indexOf(searchValue);
};
Range.prototype.__iterate = function(fn, reverse) {
var maxIndex = this.size - 1;
var step = this._step;
var value = reverse ? this._start + maxIndex * step : this._start;
for (var ii = 0; ii <= maxIndex; ii++) {
if (fn(value, ii, this) === false) {
return ii + 1;
}
value += reverse ? -step : step;
}
return ii;
};
Range.prototype.__iterator = function(type, reverse) {
var maxIndex = this.size - 1;
var step = this._step;
var value = reverse ? this._start + maxIndex * step : this._start;
var ii = 0;
return new Iterator(function() {
var v = value;
value += reverse ? -step : step;
return ii > maxIndex ? iteratorDone() : iteratorValue(type, ii++, v);
});
};
Range.prototype.equals = function(other) {
return other instanceof Range ?
this._start === other._start &&
this._end === other._end &&
this._step === other._step :
deepEqual(this, other);
};
var EMPTY_RANGE;
createClass(Collection, Iterable);
function Collection() {
throw TypeError('Abstract');
}
createClass(KeyedCollection, Collection);function KeyedCollection() {}
createClass(IndexedCollection, Collection);function IndexedCollection() {}
createClass(SetCollection, Collection);function SetCollection() {}
Collection.Keyed = KeyedCollection;
Collection.Indexed = IndexedCollection;
Collection.Set = SetCollection;
var imul =
typeof Math.imul === 'function' && Math.imul(0xffffffff, 2) === -2 ?
Math.imul :
function imul(a, b) {
a = a | 0; // int
b = b | 0; // int
var c = a & 0xffff;
var d = b & 0xffff;
// Shift by 0 fixes the sign on the high part.
return (c * d) + ((((a >>> 16) * d + c * (b >>> 16)) << 16) >>> 0) | 0; // int
};
// v8 has an optimization for storing 31-bit signed numbers.
// Values which have either 00 or 11 as the high order bits qualify.
// This function drops the highest order bit in a signed number, maintaining
// the sign bit.
function smi(i32) {
return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF);
}
function hash(o) {
if (o === false || o === null || o === undefined) {
return 0;
}
if (typeof o.valueOf === 'function') {
o = o.valueOf();
if (o === false || o === null || o === undefined) {
return 0;
}
}
if (o === true) {
return 1;
}
var type = typeof o;
if (type === 'number') {
var h = o | 0;
if (h !== o) {
h ^= o * 0xFFFFFFFF;
}
while (o > 0xFFFFFFFF) {
o /= 0xFFFFFFFF;
h ^= o;
}
return smi(h);
}
if (type === 'string') {
return o.length > STRING_HASH_CACHE_MIN_STRLEN ? cachedHashString(o) : hashString(o);
}
if (typeof o.hashCode === 'function') {
return o.hashCode();
}
if (type === 'object') {
return hashJSObj(o);
}
if (typeof o.toString === 'function') {
return hashString(o.toString());
}
throw new Error('Value type ' + type + ' cannot be hashed.');
}
function cachedHashString(string) {
var hash = stringHashCache[string];
if (hash === undefined) {
hash = hashString(string);
if (STRING_HASH_CACHE_SIZE === STRING_HASH_CACHE_MAX_SIZE) {
STRING_HASH_CACHE_SIZE = 0;
stringHashCache = {};
}
STRING_HASH_CACHE_SIZE++;
stringHashCache[string] = hash;
}
return hash;
}
// http://jsperf.com/hashing-strings
function hashString(string) {
// This is the hash from JVM
// The hash code for a string is computed as
// s[0] * 31 ^ (n - 1) + s[1] * 31 ^ (n - 2) + ... + s[n - 1],
// where s[i] is the ith character of the string and n is the length of
// the string. We "mod" the result to make it between 0 (inclusive) and 2^31
// (exclusive) by dropping high bits.
var hash = 0;
for (var ii = 0; ii < string.length; ii++) {
hash = 31 * hash + string.charCodeAt(ii) | 0;
}
return smi(hash);
}
function hashJSObj(obj) {
var hash;
if (usingWeakMap) {
hash = weakMap.get(obj);
if (hash !== undefined) {
return hash;
}
}
hash = obj[UID_HASH_KEY];
if (hash !== undefined) {
return hash;
}
if (!canDefineProperty) {
hash = obj.propertyIsEnumerable && obj.propertyIsEnumerable[UID_HASH_KEY];
if (hash !== undefined) {
return hash;
}
hash = getIENodeHash(obj);
if (hash !== undefined) {
return hash;
}
}
hash = ++objHashUID;
if (objHashUID & 0x40000000) {
objHashUID = 0;
}
if (usingWeakMap) {
weakMap.set(obj, hash);
} else if (isExtensible !== undefined && isExtensible(obj) === false) {
throw new Error('Non-extensible objects are not allowed as keys.');
} else if (canDefineProperty) {
Object.defineProperty(obj, UID_HASH_KEY, {
'enumerable': false,
'configurable': false,
'writable': false,
'value': hash
});
} else if (obj.propertyIsEnumerable !== undefined &&
obj.propertyIsEnumerable === obj.constructor.prototype.propertyIsEnumerable) {
// Since we can't define a non-enumerable property on the object
// we'll hijack one of the less-used non-enumerable properties to
// save our hash on it. Since this is a function it will not show up in
// `JSON.stringify` which is what we want.
obj.propertyIsEnumerable = function() {
return this.constructor.prototype.propertyIsEnumerable.apply(this, arguments);
};
obj.propertyIsEnumerable[UID_HASH_KEY] = hash;
} else if (obj.nodeType !== undefined) {
// At this point we couldn't get the IE `uniqueID` to use as a hash
// and we couldn't use a non-enumerable property to exploit the
// dontEnum bug so we simply add the `UID_HASH_KEY` on the node
// itself.
obj[UID_HASH_KEY] = hash;
} else {
throw new Error('Unable to set a non-enumerable property on object.');
}
return hash;
}
// Get references to ES5 object methods.
var isExtensible = Object.isExtensible;
// True if Object.defineProperty works as expected. IE8 fails this test.
var canDefineProperty = (function() {
try {
Object.defineProperty({}, '@', {});
return true;
} catch (e) {
return false;
}
}());
// IE has a `uniqueID` property on DOM nodes. We can construct the hash from it
// and avoid memory leaks from the IE cloneNode bug.
function getIENodeHash(node) {
if (node && node.nodeType > 0) {
switch (node.nodeType) {
case 1: // Element
return node.uniqueID;
case 9: // Document
return node.documentElement && node.documentElement.uniqueID;
}
}
}
// If possible, use a WeakMap.
var usingWeakMap = typeof WeakMap === 'function';
var weakMap;
if (usingWeakMap) {
weakMap = new WeakMap();
}
var objHashUID = 0;
var UID_HASH_KEY = '__immutablehash__';
if (typeof Symbol === 'function') {
UID_HASH_KEY = Symbol(UID_HASH_KEY);
}
var STRING_HASH_CACHE_MIN_STRLEN = 16;
var STRING_HASH_CACHE_MAX_SIZE = 255;
var STRING_HASH_CACHE_SIZE = 0;
var stringHashCache = {};
function assertNotInfinite(size) {
invariant(
size !== Infinity,
'Cannot perform this action with an infinite size.'
);
}
createClass(Map, KeyedCollection);
// @pragma Construction
function Map(value) {
return value === null || value === undefined ? emptyMap() :
isMap(value) && !isOrdered(value) ? value :
emptyMap().withMutations(function(map ) {
var iter = KeyedIterable(value);
assertNotInfinite(iter.size);
iter.forEach(function(v, k) {return map.set(k, v)});
});
}
Map.prototype.toString = function() {
return this.__toString('Map {', '}');
};
// @pragma Access
Map.prototype.get = function(k, notSetValue) {
return this._root ?
this._root.get(0, undefined, k, notSetValue) :
notSetValue;
};
// @pragma Modification
Map.prototype.set = function(k, v) {
return updateMap(this, k, v);
};
Map.prototype.setIn = function(keyPath, v) {
return this.updateIn(keyPath, NOT_SET, function() {return v});
};
Map.prototype.remove = function(k) {
return updateMap(this, k, NOT_SET);
};
Map.prototype.deleteIn = function(keyPath) {
return this.updateIn(keyPath, function() {return NOT_SET});
};
Map.prototype.update = function(k, notSetValue, updater) {
return arguments.length === 1 ?
k(this) :
this.updateIn([k], notSetValue, updater);
};
Map.prototype.updateIn = function(keyPath, notSetValue, updater) {
if (!updater) {
updater = notSetValue;
notSetValue = undefined;
}
var updatedValue = updateInDeepMap(
this,
forceIterator(keyPath),
notSetValue,
updater
);
return updatedValue === NOT_SET ? undefined : updatedValue;
};
Map.prototype.clear = function() {
if (this.size === 0) {
return this;
}
if (this.__ownerID) {
this.size = 0;
this._root = null;
this.__hash = undefined;
this.__altered = true;
return this;
}
return emptyMap();
};
// @pragma Composition
Map.prototype.merge = function(/*...iters*/) {
return mergeIntoMapWith(this, undefined, arguments);
};
Map.prototype.mergeWith = function(merger) {var iters = SLICE$0.call(arguments, 1);
return mergeIntoMapWith(this, merger, iters);
};
Map.prototype.mergeIn = function(keyPath) {var iters = SLICE$0.call(arguments, 1);
return this.updateIn(
keyPath,
emptyMap(),
function(m ) {return typeof m.merge === 'function' ?
m.merge.apply(m, iters) :
iters[iters.length - 1]}
);
};
Map.prototype.mergeDeep = function(/*...iters*/) {
return mergeIntoMapWith(this, deepMerger, arguments);
};
Map.prototype.mergeDeepWith = function(merger) {var iters = SLICE$0.call(arguments, 1);
return mergeIntoMapWith(this, deepMergerWith(merger), iters);
};
Map.prototype.mergeDeepIn = function(keyPath) {var iters = SLICE$0.call(arguments, 1);
return this.updateIn(
keyPath,
emptyMap(),
function(m ) {return typeof m.mergeDeep === 'function' ?
m.mergeDeep.apply(m, iters) :
iters[iters.length - 1]}
);
};
Map.prototype.sort = function(comparator) {
// Late binding
return OrderedMap(sortFactory(this, comparator));
};
Map.prototype.sortBy = function(mapper, comparator) {
// Late binding
return OrderedMap(sortFactory(this, comparator, mapper));
};
// @pragma Mutability
Map.prototype.withMutations = function(fn) {
var mutable = this.asMutable();
fn(mutable);
return mutable.wasAltered() ? mutable.__ensureOwner(this.__ownerID) : this;
};
Map.prototype.asMutable = function() {
return this.__ownerID ? this : this.__ensureOwner(new OwnerID());
};
Map.prototype.asImmutable = function() {
return this.__ensureOwner();
};
Map.prototype.wasAltered = function() {
return this.__altered;
};
Map.prototype.__iterator = function(type, reverse) {
return new MapIterator(this, type, reverse);
};
Map.prototype.__iterate = function(fn, reverse) {var this$0 = this;
var iterations = 0;
this._root && this._root.iterate(function(entry ) {
iterations++;
return fn(entry[1], entry[0], this$0);
}, reverse);
return iterations;
};
Map.prototype.__ensureOwner = function(ownerID) {
if (ownerID === this.__ownerID) {
return this;
}
if (!ownerID) {
this.__ownerID = ownerID;
this.__altered = false;
return this;
}
return makeMap(this.size, this._root, ownerID, this.__hash);
};
function isMap(maybeMap) {
return !!(maybeMap && maybeMap[IS_MAP_SENTINEL]);
}
Map.isMap = isMap;
var IS_MAP_SENTINEL = '@@__IMMUTABLE_MAP__@@';
var MapPrototype = Map.prototype;
MapPrototype[IS_MAP_SENTINEL] = true;
MapPrototype[DELETE] = MapPrototype.remove;
MapPrototype.removeIn = MapPrototype.deleteIn;
// #pragma Trie Nodes
function ArrayMapNode(ownerID, entries) {
this.ownerID = ownerID;
this.entries = entries;
}
ArrayMapNode.prototype.get = function(shift, keyHash, key, notSetValue) {
var entries = this.entries;
for (var ii = 0, len = entries.length; ii < len; ii++) {
if (is(key, entries[ii][0])) {
return entries[ii][1];
}
}
return notSetValue;
};
ArrayMapNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {
var removed = value === NOT_SET;
var entries = this.entries;
var idx = 0;
for (var len = entries.length; idx < len; idx++) {
if (is(key, entries[idx][0])) {
break;
}
}
var exists = idx < len;
if (exists ? entries[idx][1] === value : removed) {
return this;
}
SetRef(didAlter);
(removed || !exists) && SetRef(didChangeSize);
if (removed && entries.length === 1) {
return; // undefined
}
if (!exists && !removed && entries.length >= MAX_ARRAY_MAP_SIZE) {
return createNodes(ownerID, entries, key, value);
}
var isEditable = ownerID && ownerID === this.ownerID;
var newEntries = isEditable ? entries : arrCopy(entries);
if (exists) {
if (removed) {
idx === len - 1 ? newEntries.pop() : (newEntries[idx] = newEntries.pop());
} else {
newEntries[idx] = [key, value];
}
} else {
newEntries.push([key, value]);
}
if (isEditable) {
this.entries = newEntries;
return this;
}
return new ArrayMapNode(ownerID, newEntries);
};
function BitmapIndexedNode(ownerID, bitmap, nodes) {
this.ownerID = ownerID;
this.bitmap = bitmap;
this.nodes = nodes;
}
BitmapIndexedNode.prototype.get = function(shift, keyHash, key, notSetValue) {
if (keyHash === undefined) {
keyHash = hash(key);
}
var bit = (1 << ((shift === 0 ? keyHash : keyHash >>> shift) & MASK));
var bitmap = this.bitmap;
return (bitmap & bit) === 0 ? notSetValue :
this.nodes[popCount(bitmap & (bit - 1))].get(shift + SHIFT, keyHash, key, notSetValue);
};
BitmapIndexedNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {
if (keyHash === undefined) {
keyHash = hash(key);
}
var keyHashFrag = (shift === 0 ? keyHash : keyHash >>> shift) & MASK;
var bit = 1 << keyHashFrag;
var bitmap = this.bitmap;
var exists = (bitmap & bit) !== 0;
if (!exists && value === NOT_SET) {
return this;
}
var idx = popCount(bitmap & (bit - 1));
var nodes = this.nodes;
var node = exists ? nodes[idx] : undefined;
var newNode = updateNode(node, ownerID, shift + SHIFT, keyHash, key, value, didChangeSize, didAlter);
if (newNode === node) {
return this;
}
if (!exists && newNode && nodes.length >= MAX_BITMAP_INDEXED_SIZE) {
return expandNodes(ownerID, nodes, bitmap, keyHashFrag, newNode);
}
if (exists && !newNode && nodes.length === 2 && isLeafNode(nodes[idx ^ 1])) {
return nodes[idx ^ 1];
}
if (exists && newNode && nodes.length === 1 && isLeafNode(newNode)) {
return newNode;
}
var isEditable = ownerID && ownerID === this.ownerID;
var newBitmap = exists ? newNode ? bitmap : bitmap ^ bit : bitmap | bit;
var newNodes = exists ? newNode ?
setIn(nodes, idx, newNode, isEditable) :
spliceOut(nodes, idx, isEditable) :
spliceIn(nodes, idx, newNode, isEditable);
if (isEditable) {
this.bitmap = newBitmap;
this.nodes = newNodes;
return this;
}
return new BitmapIndexedNode(ownerID, newBitmap, newNodes);
};
function HashArrayMapNode(ownerID, count, nodes) {
this.ownerID = ownerID;
this.count = count;
this.nodes = nodes;
}
HashArrayMapNode.prototype.get = function(shift, keyHash, key, notSetValue) {
if (keyHash === undefined) {
keyHash = hash(key);
}
var idx = (shift === 0 ? keyHash : keyHash >>> shift) & MASK;
var node = this.nodes[idx];
return node ? node.get(shift + SHIFT, keyHash, key, notSetValue) : notSetValue;
};
HashArrayMapNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {
if (keyHash === undefined) {
keyHash = hash(key);
}
var idx = (shift === 0 ? keyHash : keyHash >>> shift) & MASK;
var removed = value === NOT_SET;
var nodes = this.nodes;
var node = nodes[idx];
if (removed && !node) {
return this;
}
var newNode = updateNode(node, ownerID, shift + SHIFT, keyHash, key, value, didChangeSize, didAlter);
if (newNode === node) {
return this;
}
var newCount = this.count;
if (!node) {
newCount++;
} else if (!newNode) {
newCount--;
if (newCount < MIN_HASH_ARRAY_MAP_SIZE) {
return packNodes(ownerID, nodes, newCount, idx);
}
}
var isEditable = ownerID && ownerID === this.ownerID;
var newNodes = setIn(nodes, idx, newNode, isEditable);
if (isEditable) {
this.count = newCount;
this.nodes = newNodes;
return this;
}
return new HashArrayMapNode(ownerID, newCount, newNodes);
};
function HashCollisionNode(ownerID, keyHash, entries) {
this.ownerID = ownerID;
this.keyHash = keyHash;
this.entries = entries;
}
HashCollisionNode.prototype.get = function(shift, keyHash, key, notSetValue) {
var entries = this.entries;
for (var ii = 0, len = entries.length; ii < len; ii++) {
if (is(key, entries[ii][0])) {
return entries[ii][1];
}
}
return notSetValue;
};
HashCollisionNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {
if (keyHash === undefined) {
keyHash = hash(key);
}
var removed = value === NOT_SET;
if (keyHash !== this.keyHash) {
if (removed) {
return this;
}
SetRef(didAlter);
SetRef(didChangeSize);
return mergeIntoNode(this, ownerID, shift, keyHash, [key, value]);
}
var entries = this.entries;
var idx = 0;
for (var len = entries.length; idx < len; idx++) {
if (is(key, entries[idx][0])) {
break;
}
}
var exists = idx < len;
if (exists ? entries[idx][1] === value : removed) {
return this;
}
SetRef(didAlter);
(removed || !exists) && SetRef(didChangeSize);
if (removed && len === 2) {
return new ValueNode(ownerID, this.keyHash, entries[idx ^ 1]);
}
var isEditable = ownerID && ownerID === this.ownerID;
var newEntries = isEditable ? entries : arrCopy(entries);
if (exists) {
if (removed) {
idx === len - 1 ? newEntries.pop() : (newEntries[idx] = newEntries.pop());
} else {
newEntries[idx] = [key, value];
}
} else {
newEntries.push([key, value]);
}
if (isEditable) {
this.entries = newEntries;
return this;
}
return new HashCollisionNode(ownerID, this.keyHash, newEntries);
};
function ValueNode(ownerID, keyHash, entry) {
this.ownerID = ownerID;
this.keyHash = keyHash;
this.entry = entry;
}
ValueNode.prototype.get = function(shift, keyHash, key, notSetValue) {
return is(key, this.entry[0]) ? this.entry[1] : notSetValue;
};
ValueNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {
var removed = value === NOT_SET;
var keyMatch = is(key, this.entry[0]);
if (keyMatch ? value === this.entry[1] : removed) {
return this;
}
SetRef(didAlter);
if (removed) {
SetRef(didChangeSize);
return; // undefined
}
if (keyMatch) {
if (ownerID && ownerID === this.ownerID) {
this.entry[1] = value;
return this;
}
return new ValueNode(ownerID, this.keyHash, [key, value]);
}
SetRef(didChangeSize);
return mergeIntoNode(this, ownerID, shift, hash(key), [key, value]);
};
// #pragma Iterators
ArrayMapNode.prototype.iterate =
HashCollisionNode.prototype.iterate = function (fn, reverse) {
var entries = this.entries;
for (var ii = 0, maxIndex = entries.length - 1; ii <= maxIndex; ii++) {
if (fn(entries[reverse ? maxIndex - ii : ii]) === false) {
return false;
}
}
}
BitmapIndexedNode.prototype.iterate =
HashArrayMapNode.prototype.iterate = function (fn, reverse) {
var nodes = this.nodes;
for (var ii = 0, maxIndex = nodes.length - 1; ii <= maxIndex; ii++) {
var node = nodes[reverse ? maxIndex - ii : ii];
if (node && node.iterate(fn, reverse) === false) {
return false;
}
}
}
ValueNode.prototype.iterate = function (fn, reverse) {
return fn(this.entry);
}
createClass(MapIterator, Iterator);
function MapIterator(map, type, reverse) {
this._type = type;
this._reverse = reverse;
this._stack = map._root && mapIteratorFrame(map._root);
}
MapIterator.prototype.next = function() {
var type = this._type;
var stack = this._stack;
while (stack) {
var node = stack.node;
var index = stack.index++;
var maxIndex;
if (node.entry) {
if (index === 0) {
return mapIteratorValue(type, node.entry);
}
} else if (node.entries) {
maxIndex = node.entries.length - 1;
if (index <= maxIndex) {
return mapIteratorValue(type, node.entries[this._reverse ? maxIndex - index : index]);
}
} else {
maxIndex = node.nodes.length - 1;
if (index <= maxIndex) {
var subNode = node.nodes[this._reverse ? maxIndex - index : index];
if (subNode) {
if (subNode.entry) {
return mapIteratorValue(type, subNode.entry);
}
stack = this._stack = mapIteratorFrame(subNode, stack);
}
continue;
}
}
stack = this._stack = this._stack.__prev;
}
return iteratorDone();
};
function mapIteratorValue(type, entry) {
return iteratorValue(type, entry[0], entry[1]);
}
function mapIteratorFrame(node, prev) {
return {
node: node,
index: 0,
__prev: prev
};
}
function makeMap(size, root, ownerID, hash) {
var map = Object.create(MapPrototype);
map.size = size;
map._root = root;
map.__ownerID = ownerID;
map.__hash = hash;
map.__altered = false;
return map;
}
var EMPTY_MAP;
function emptyMap() {
return EMPTY_MAP || (EMPTY_MAP = makeMap(0));
}
function updateMap(map, k, v) {
var newRoot;
var newSize;
if (!map._root) {
if (v === NOT_SET) {
return map;
}
newSize = 1;
newRoot = new ArrayMapNode(map.__ownerID, [[k, v]]);
} else {
var didChangeSize = MakeRef(CHANGE_LENGTH);
var didAlter = MakeRef(DID_ALTER);
newRoot = updateNode(map._root, map.__ownerID, 0, undefined, k, v, didChangeSize, didAlter);
if (!didAlter.value) {
return map;
}
newSize = map.size + (didChangeSize.value ? v === NOT_SET ? -1 : 1 : 0);
}
if (map.__ownerID) {
map.size = newSize;
map._root = newRoot;
map.__hash = undefined;
map.__altered = true;
return map;
}
return newRoot ? makeMap(newSize, newRoot) : emptyMap();
}
function updateNode(node, ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {
if (!node) {
if (value === NOT_SET) {
return node;
}
SetRef(didAlter);
SetRef(didChangeSize);
return new ValueNode(ownerID, keyHash, [key, value]);
}
return node.update(ownerID, shift, keyHash, key, value, didChangeSize, didAlter);
}
function isLeafNode(node) {
return node.constructor === ValueNode || node.constructor === HashCollisionNode;
}
function mergeIntoNode(node, ownerID, shift, keyHash, entry) {
if (node.keyHash === keyHash) {
return new HashCollisionNode(ownerID, keyHash, [node.entry, entry]);
}
var idx1 = (shift === 0 ? node.keyHash : node.keyHash >>> shift) & MASK;
var idx2 = (shift === 0 ? keyHash : keyHash >>> shift) & MASK;
var newNode;
var nodes = idx1 === idx2 ?
[mergeIntoNode(node, ownerID, shift + SHIFT, keyHash, entry)] :
((newNode = new ValueNode(ownerID, keyHash, entry)), idx1 < idx2 ? [node, newNode] : [newNode, node]);
return new BitmapIndexedNode(ownerID, (1 << idx1) | (1 << idx2), nodes);
}
function createNodes(ownerID, entries, key, value) {
if (!ownerID) {
ownerID = new OwnerID();
}
var node = new ValueNode(ownerID, hash(key), [key, value]);
for (var ii = 0; ii < entries.length; ii++) {
var entry = entries[ii];
node = node.update(ownerID, 0, undefined, entry[0], entry[1]);
}
return node;
}
function packNodes(ownerID, nodes, count, excluding) {
var bitmap = 0;
var packedII = 0;
var packedNodes = new Array(count);
for (var ii = 0, bit = 1, len = nodes.length; ii < len; ii++, bit <<= 1) {
var node = nodes[ii];
if (node !== undefined && ii !== excluding) {
bitmap |= bit;
packedNodes[packedII++] = node;
}
}
return new BitmapIndexedNode(ownerID, bitmap, packedNodes);
}
function expandNodes(ownerID, nodes, bitmap, including, node) {
var count = 0;
var expandedNodes = new Array(SIZE);
for (var ii = 0; bitmap !== 0; ii++, bitmap >>>= 1) {
expandedNodes[ii] = bitmap & 1 ? nodes[count++] : undefined;
}
expandedNodes[including] = node;
return new HashArrayMapNode(ownerID, count + 1, expandedNodes);
}
function mergeIntoMapWith(map, merger, iterables) {
var iters = [];
for (var ii = 0; ii < iterables.length; ii++) {
var value = iterables[ii];
var iter = KeyedIterable(value);
if (!isIterable(value)) {
iter = iter.map(function(v ) {return fromJS(v)});
}
iters.push(iter);
}
return mergeIntoCollectionWith(map, merger, iters);
}
function deepMerger(existing, value, key) {
return existing && existing.mergeDeep && isIterable(value) ?
existing.mergeDeep(value) :
is(existing, value) ? existing : value;
}
function deepMergerWith(merger) {
return function(existing, value, key) {
if (existing && existing.mergeDeepWith && isIterable(value)) {
return existing.mergeDeepWith(merger, value);
}
var nextValue = merger(existing, value, key);
return is(existing, nextValue) ? existing : nextValue;
};
}
function mergeIntoCollectionWith(collection, merger, iters) {
iters = iters.filter(function(x ) {return x.size !== 0});
if (iters.length === 0) {
return collection;
}
if (collection.size === 0 && !collection.__ownerID && iters.length === 1) {
return collection.constructor(iters[0]);
}
return collection.withMutations(function(collection ) {
var mergeIntoMap = merger ?
function(value, key) {
collection.update(key, NOT_SET, function(existing )
{return existing === NOT_SET ? value : merger(existing, value, key)}
);
} :
function(value, key) {
collection.set(key, value);
}
for (var ii = 0; ii < iters.length; ii++) {
iters[ii].forEach(mergeIntoMap);
}
});
}
function updateInDeepMap(existing, keyPathIter, notSetValue, updater) {
var isNotSet = existing === NOT_SET;
var step = keyPathIter.next();
if (step.done) {
var existingValue = isNotSet ? notSetValue : existing;
var newValue = updater(existingValue);
return newValue === existingValue ? existing : newValue;
}
invariant(
isNotSet || (existing && existing.set),
'invalid keyPath'
);
var key = step.value;
var nextExisting = isNotSet ? NOT_SET : existing.get(key, NOT_SET);
var nextUpdated = updateInDeepMap(
nextExisting,
keyPathIter,
notSetValue,
updater
);
return nextUpdated === nextExisting ? existing :
nextUpdated === NOT_SET ? existing.remove(key) :
(isNotSet ? emptyMap() : existing).set(key, nextUpdated);
}
function popCount(x) {
x = x - ((x >> 1) & 0x55555555);
x = (x & 0x33333333) + ((x >> 2) & 0x33333333);
x = (x + (x >> 4)) & 0x0f0f0f0f;
x = x + (x >> 8);
x = x + (x >> 16);
return x & 0x7f;
}
function setIn(array, idx, val, canEdit) {
var newArray = canEdit ? array : arrCopy(array);
newArray[idx] = val;
return newArray;
}
function spliceIn(array, idx, val, canEdit) {
var newLen = array.length + 1;
if (canEdit && idx + 1 === newLen) {
array[idx] = val;
return array;
}
var newArray = new Array(newLen);
var after = 0;
for (var ii = 0; ii < newLen; ii++) {
if (ii === idx) {
newArray[ii] = val;
after = -1;
} else {
newArray[ii] = array[ii + after];
}
}
return newArray;
}
function spliceOut(array, idx, canEdit) {
var newLen = array.length - 1;
if (canEdit && idx === newLen) {
array.pop();
return array;
}
var newArray = new Array(newLen);
var after = 0;
for (var ii = 0; ii < newLen; ii++) {
if (ii === idx) {
after = 1;
}
newArray[ii] = array[ii + after];
}
return newArray;
}
var MAX_ARRAY_MAP_SIZE = SIZE / 4;
var MAX_BITMAP_INDEXED_SIZE = SIZE / 2;
var MIN_HASH_ARRAY_MAP_SIZE = SIZE / 4;
createClass(List, IndexedCollection);
// @pragma Construction
function List(value) {
var empty = emptyList();
if (value === null || value === undefined) {
return empty;
}
if (isList(value)) {
return value;
}
var iter = IndexedIterable(value);
var size = iter.size;
if (size === 0) {
return empty;
}
assertNotInfinite(size);
if (size > 0 && size < SIZE) {
return makeList(0, size, SHIFT, null, new VNode(iter.toArray()));
}
return empty.withMutations(function(list ) {
list.setSize(size);
iter.forEach(function(v, i) {return list.set(i, v)});
});
}
List.of = function(/*...values*/) {
return this(arguments);
};
List.prototype.toString = function() {
return this.__toString('List [', ']');
};
// @pragma Access
List.prototype.get = function(index, notSetValue) {
index = wrapIndex(this, index);
if (index >= 0 && index < this.size) {
index += this._origin;
var node = listNodeFor(this, index);
return node && node.array[index & MASK];
}
return notSetValue;
};
// @pragma Modification
List.prototype.set = function(index, value) {
return updateList(this, index, value);
};
List.prototype.remove = function(index) {
return !this.has(index) ? this :
index === 0 ? this.shift() :
index === this.size - 1 ? this.pop() :
this.splice(index, 1);
};
List.prototype.insert = function(index, value) {
return this.splice(index, 0, value);
};
List.prototype.clear = function() {
if (this.size === 0) {
return this;
}
if (this.__ownerID) {
this.size = this._origin = this._capacity = 0;
this._level = SHIFT;
this._root = this._tail = null;
this.__hash = undefined;
this.__altered = true;
return this;
}
return emptyList();
};
List.prototype.push = function(/*...values*/) {
var values = arguments;
var oldSize = this.size;
return this.withMutations(function(list ) {
setListBounds(list, 0, oldSize + values.length);
for (var ii = 0; ii < values.length; ii++) {
list.set(oldSize + ii, values[ii]);
}
});
};
List.prototype.pop = function() {
return setListBounds(this, 0, -1);
};
List.prototype.unshift = function(/*...values*/) {
var values = arguments;
return this.withMutations(function(list ) {
setListBounds(list, -values.length);
for (var ii = 0; ii < values.length; ii++) {
list.set(ii, values[ii]);
}
});
};
List.prototype.shift = function() {
return setListBounds(this, 1);
};
// @pragma Composition
List.prototype.merge = function(/*...iters*/) {
return mergeIntoListWith(this, undefined, arguments);
};
List.prototype.mergeWith = function(merger) {var iters = SLICE$0.call(arguments, 1);
return mergeIntoListWith(this, merger, iters);
};
List.prototype.mergeDeep = function(/*...iters*/) {
return mergeIntoListWith(this, deepMerger, arguments);
};
List.prototype.mergeDeepWith = function(merger) {var iters = SLICE$0.call(arguments, 1);
return mergeIntoListWith(this, deepMergerWith(merger), iters);
};
List.prototype.setSize = function(size) {
return setListBounds(this, 0, size);
};
// @pragma Iteration
List.prototype.slice = function(begin, end) {
var size = this.size;
if (wholeSlice(begin, end, size)) {
return this;
}
return setListBounds(
this,
resolveBegin(begin, size),
resolveEnd(end, size)
);
};
List.prototype.__iterator = function(type, reverse) {
var index = 0;
var values = iterateList(this, reverse);
return new Iterator(function() {
var value = values();
return value === DONE ?
iteratorDone() :
iteratorValue(type, index++, value);
});
};
List.prototype.__iterate = function(fn, reverse) {
var index = 0;
var values = iterateList(this, reverse);
var value;
while ((value = values()) !== DONE) {
if (fn(value, index++, this) === false) {
break;
}
}
return index;
};
List.prototype.__ensureOwner = function(ownerID) {
if (ownerID === this.__ownerID) {
return this;
}
if (!ownerID) {
this.__ownerID = ownerID;
return this;
}
return makeList(this._origin, this._capacity, this._level, this._root, this._tail, ownerID, this.__hash);
};
function isList(maybeList) {
return !!(maybeList && maybeList[IS_LIST_SENTINEL]);
}
List.isList = isList;
var IS_LIST_SENTINEL = '@@__IMMUTABLE_LIST__@@';
var ListPrototype = List.prototype;
ListPrototype[IS_LIST_SENTINEL] = true;
ListPrototype[DELETE] = ListPrototype.remove;
ListPrototype.setIn = MapPrototype.setIn;
ListPrototype.deleteIn =
ListPrototype.removeIn = MapPrototype.removeIn;
ListPrototype.update = MapPrototype.update;
ListPrototype.updateIn = MapPrototype.updateIn;
ListPrototype.mergeIn = MapPrototype.mergeIn;
ListPrototype.mergeDeepIn = MapPrototype.mergeDeepIn;
ListPrototype.withMutations = MapPrototype.withMutations;
ListPrototype.asMutable = MapPrototype.asMutable;
ListPrototype.asImmutable = MapPrototype.asImmutable;
ListPrototype.wasAltered = MapPrototype.wasAltered;
function VNode(array, ownerID) {
this.array = array;
this.ownerID = ownerID;
}
// TODO: seems like these methods are very similar
VNode.prototype.removeBefore = function(ownerID, level, index) {
if (index === level ? 1 << level : 0 || this.array.length === 0) {
return this;
}
var originIndex = (index >>> level) & MASK;
if (originIndex >= this.array.length) {
return new VNode([], ownerID);
}
var removingFirst = originIndex === 0;
var newChild;
if (level > 0) {
var oldChild = this.array[originIndex];
newChild = oldChild && oldChild.removeBefore(ownerID, level - SHIFT, index);
if (newChild === oldChild && removingFirst) {
return this;
}
}
if (removingFirst && !newChild) {
return this;
}
var editable = editableVNode(this, ownerID);
if (!removingFirst) {
for (var ii = 0; ii < originIndex; ii++) {
editable.array[ii] = undefined;
}
}
if (newChild) {
editable.array[originIndex] = newChild;
}
return editable;
};
VNode.prototype.removeAfter = function(ownerID, level, index) {
if (index === (level ? 1 << level : 0) || this.array.length === 0) {
return this;
}
var sizeIndex = ((index - 1) >>> level) & MASK;
if (sizeIndex >= this.array.length) {
return this;
}
var newChild;
if (level > 0) {
var oldChild = this.array[sizeIndex];
newChild = oldChild && oldChild.removeAfter(ownerID, level - SHIFT, index);
if (newChild === oldChild && sizeIndex === this.array.length - 1) {
return this;
}
}
var editable = editableVNode(this, ownerID);
editable.array.splice(sizeIndex + 1);
if (newChild) {
editable.array[sizeIndex] = newChild;
}
return editable;
};
var DONE = {};
function iterateList(list, reverse) {
var left = list._origin;
var right = list._capacity;
var tailPos = getTailOffset(right);
var tail = list._tail;
return iterateNodeOrLeaf(list._root, list._level, 0);
function iterateNodeOrLeaf(node, level, offset) {
return level === 0 ?
iterateLeaf(node, offset) :
iterateNode(node, level, offset);
}
function iterateLeaf(node, offset) {
var array = offset === tailPos ? tail && tail.array : node && node.array;
var from = offset > left ? 0 : left - offset;
var to = right - offset;
if (to > SIZE) {
to = SIZE;
}
return function() {
if (from === to) {
return DONE;
}
var idx = reverse ? --to : from++;
return array && array[idx];
};
}
function iterateNode(node, level, offset) {
var values;
var array = node && node.array;
var from = offset > left ? 0 : (left - offset) >> level;
var to = ((right - offset) >> level) + 1;
if (to > SIZE) {
to = SIZE;
}
return function() {
do {
if (values) {
var value = values();
if (value !== DONE) {
return value;
}
values = null;
}
if (from === to) {
return DONE;
}
var idx = reverse ? --to : from++;
values = iterateNodeOrLeaf(
array && array[idx], level - SHIFT, offset + (idx << level)
);
} while (true);
};
}
}
function makeList(origin, capacity, level, root, tail, ownerID, hash) {
var list = Object.create(ListPrototype);
list.size = capacity - origin;
list._origin = origin;
list._capacity = capacity;
list._level = level;
list._root = root;
list._tail = tail;
list.__ownerID = ownerID;
list.__hash = hash;
list.__altered = false;
return list;
}
var EMPTY_LIST;
function emptyList() {
return EMPTY_LIST || (EMPTY_LIST = makeList(0, 0, SHIFT));
}
function updateList(list, index, value) {
index = wrapIndex(list, index);
if (index !== index) {
return list;
}
if (index >= list.size || index < 0) {
return list.withMutations(function(list ) {
index < 0 ?
setListBounds(list, index).set(0, value) :
setListBounds(list, 0, index + 1).set(index, value)
});
}
index += list._origin;
var newTail = list._tail;
var newRoot = list._root;
var didAlter = MakeRef(DID_ALTER);
if (index >= getTailOffset(list._capacity)) {
newTail = updateVNode(newTail, list.__ownerID, 0, index, value, didAlter);
} else {
newRoot = updateVNode(newRoot, list.__ownerID, list._level, index, value, didAlter);
}
if (!didAlter.value) {
return list;
}
if (list.__ownerID) {
list._root = newRoot;
list._tail = newTail;
list.__hash = undefined;
list.__altered = true;
return list;
}
return makeList(list._origin, list._capacity, list._level, newRoot, newTail);
}
function updateVNode(node, ownerID, level, index, value, didAlter) {
var idx = (index >>> level) & MASK;
var nodeHas = node && idx < node.array.length;
if (!nodeHas && value === undefined) {
return node;
}
var newNode;
if (level > 0) {
var lowerNode = node && node.array[idx];
var newLowerNode = updateVNode(lowerNode, ownerID, level - SHIFT, index, value, didAlter);
if (newLowerNode === lowerNode) {
return node;
}
newNode = editableVNode(node, ownerID);
newNode.array[idx] = newLowerNode;
return newNode;
}
if (nodeHas && node.array[idx] === value) {
return node;
}
SetRef(didAlter);
newNode = editableVNode(node, ownerID);
if (value === undefined && idx === newNode.array.length - 1) {
newNode.array.pop();
} else {
newNode.array[idx] = value;
}
return newNode;
}
function editableVNode(node, ownerID) {
if (ownerID && node && ownerID === node.ownerID) {
return node;
}
return new VNode(node ? node.array.slice() : [], ownerID);
}
function listNodeFor(list, rawIndex) {
if (rawIndex >= getTailOffset(list._capacity)) {
return list._tail;
}
if (rawIndex < 1 << (list._level + SHIFT)) {
var node = list._root;
var level = list._level;
while (node && level > 0) {
node = node.array[(rawIndex >>> level) & MASK];
level -= SHIFT;
}
return node;
}
}
function setListBounds(list, begin, end) {
// Sanitize begin & end using this shorthand for ToInt32(argument)
// http://www.ecma-international.org/ecma-262/6.0/#sec-toint32
if (begin !== undefined) {
begin = begin | 0;
}
if (end !== undefined) {
end = end | 0;
}
var owner = list.__ownerID || new OwnerID();
var oldOrigin = list._origin;
var oldCapacity = list._capacity;
var newOrigin = oldOrigin + begin;
var newCapacity = end === undefined ? oldCapacity : end < 0 ? oldCapacity + end : oldOrigin + end;
if (newOrigin === oldOrigin && newCapacity === oldCapacity) {
return list;
}
// If it's going to end after it starts, it's empty.
if (newOrigin >= newCapacity) {
return list.clear();
}
var newLevel = list._level;
var newRoot = list._root;
// New origin might need creating a higher root.
var offsetShift = 0;
while (newOrigin + offsetShift < 0) {
newRoot = new VNode(newRoot && newRoot.array.length ? [undefined, newRoot] : [], owner);
newLevel += SHIFT;
offsetShift += 1 << newLevel;
}
if (offsetShift) {
newOrigin += offsetShift;
oldOrigin += offsetShift;
newCapacity += offsetShift;
oldCapacity += offsetShift;
}
var oldTailOffset = getTailOffset(oldCapacity);
var newTailOffset = getTailOffset(newCapacity);
// New size might need creating a higher root.
while (newTailOffset >= 1 << (newLevel + SHIFT)) {
newRoot = new VNode(newRoot && newRoot.array.length ? [newRoot] : [], owner);
newLevel += SHIFT;
}
// Locate or create the new tail.
var oldTail = list._tail;
var newTail = newTailOffset < oldTailOffset ?
listNodeFor(list, newCapacity - 1) :
newTailOffset > oldTailOffset ? new VNode([], owner) : oldTail;
// Merge Tail into tree.
if (oldTail && newTailOffset > oldTailOffset && newOrigin < oldCapacity && oldTail.array.length) {
newRoot = editableVNode(newRoot, owner);
var node = newRoot;
for (var level = newLevel; level > SHIFT; level -= SHIFT) {
var idx = (oldTailOffset >>> level) & MASK;
node = node.array[idx] = editableVNode(node.array[idx], owner);
}
node.array[(oldTailOffset >>> SHIFT) & MASK] = oldTail;
}
// If the size has been reduced, there's a chance the tail needs to be trimmed.
if (newCapacity < oldCapacity) {
newTail = newTail && newTail.removeAfter(owner, 0, newCapacity);
}
// If the new origin is within the tail, then we do not need a root.
if (newOrigin >= newTailOffset) {
newOrigin -= newTailOffset;
newCapacity -= newTailOffset;
newLevel = SHIFT;
newRoot = null;
newTail = newTail && newTail.removeBefore(owner, 0, newOrigin);
// Otherwise, if the root has been trimmed, garbage collect.
} else if (newOrigin > oldOrigin || newTailOffset < oldTailOffset) {
offsetShift = 0;
// Identify the new top root node of the subtree of the old root.
while (newRoot) {
var beginIndex = (newOrigin >>> newLevel) & MASK;
if (beginIndex !== (newTailOffset >>> newLevel) & MASK) {
break;
}
if (beginIndex) {
offsetShift += (1 << newLevel) * beginIndex;
}
newLevel -= SHIFT;
newRoot = newRoot.array[beginIndex];
}
// Trim the new sides of the new root.
if (newRoot && newOrigin > oldOrigin) {
newRoot = newRoot.removeBefore(owner, newLevel, newOrigin - offsetShift);
}
if (newRoot && newTailOffset < oldTailOffset) {
newRoot = newRoot.removeAfter(owner, newLevel, newTailOffset - offsetShift);
}
if (offsetShift) {
newOrigin -= offsetShift;
newCapacity -= offsetShift;
}
}
if (list.__ownerID) {
list.size = newCapacity - newOrigin;
list._origin = newOrigin;
list._capacity = newCapacity;
list._level = newLevel;
list._root = newRoot;
list._tail = newTail;
list.__hash = undefined;
list.__altered = true;
return list;
}
return makeList(newOrigin, newCapacity, newLevel, newRoot, newTail);
}
function mergeIntoListWith(list, merger, iterables) {
var iters = [];
var maxSize = 0;
for (var ii = 0; ii < iterables.length; ii++) {
var value = iterables[ii];
var iter = IndexedIterable(value);
if (iter.size > maxSize) {
maxSize = iter.size;
}
if (!isIterable(value)) {
iter = iter.map(function(v ) {return fromJS(v)});
}
iters.push(iter);
}
if (maxSize > list.size) {
list = list.setSize(maxSize);
}
return mergeIntoCollectionWith(list, merger, iters);
}
function getTailOffset(size) {
return size < SIZE ? 0 : (((size - 1) >>> SHIFT) << SHIFT);
}
createClass(OrderedMap, Map);
// @pragma Construction
function OrderedMap(value) {
return value === null || value === undefined ? emptyOrderedMap() :
isOrderedMap(value) ? value :
emptyOrderedMap().withMutations(function(map ) {
var iter = KeyedIterable(value);
assertNotInfinite(iter.size);
iter.forEach(function(v, k) {return map.set(k, v)});
});
}
OrderedMap.of = function(/*...values*/) {
return this(arguments);
};
OrderedMap.prototype.toString = function() {
return this.__toString('OrderedMap {', '}');
};
// @pragma Access
OrderedMap.prototype.get = function(k, notSetValue) {
var index = this._map.get(k);
return index !== undefined ? this._list.get(index)[1] : notSetValue;
};
// @pragma Modification
OrderedMap.prototype.clear = function() {
if (this.size === 0) {
return this;
}
if (this.__ownerID) {
this.size = 0;
this._map.clear();
this._list.clear();
return this;
}
return emptyOrderedMap();
};
OrderedMap.prototype.set = function(k, v) {
return updateOrderedMap(this, k, v);
};
OrderedMap.prototype.remove = function(k) {
return updateOrderedMap(this, k, NOT_SET);
};
OrderedMap.prototype.wasAltered = function() {
return this._map.wasAltered() || this._list.wasAltered();
};
OrderedMap.prototype.__iterate = function(fn, reverse) {var this$0 = this;
return this._list.__iterate(
function(entry ) {return entry && fn(entry[1], entry[0], this$0)},
reverse
);
};
OrderedMap.prototype.__iterator = function(type, reverse) {
return this._list.fromEntrySeq().__iterator(type, reverse);
};
OrderedMap.prototype.__ensureOwner = function(ownerID) {
if (ownerID === this.__ownerID) {
return this;
}
var newMap = this._map.__ensureOwner(ownerID);
var newList = this._list.__ensureOwner(ownerID);
if (!ownerID) {
this.__ownerID = ownerID;
this._map = newMap;
this._list = newList;
return this;
}
return makeOrderedMap(newMap, newList, ownerID, this.__hash);
};
function isOrderedMap(maybeOrderedMap) {
return isMap(maybeOrderedMap) && isOrdered(maybeOrderedMap);
}
OrderedMap.isOrderedMap = isOrderedMap;
OrderedMap.prototype[IS_ORDERED_SENTINEL] = true;
OrderedMap.prototype[DELETE] = OrderedMap.prototype.remove;
function makeOrderedMap(map, list, ownerID, hash) {
var omap = Object.create(OrderedMap.prototype);
omap.size = map ? map.size : 0;
omap._map = map;
omap._list = list;
omap.__ownerID = ownerID;
omap.__hash = hash;
return omap;
}
var EMPTY_ORDERED_MAP;
function emptyOrderedMap() {
return EMPTY_ORDERED_MAP || (EMPTY_ORDERED_MAP = makeOrderedMap(emptyMap(), emptyList()));
}
function updateOrderedMap(omap, k, v) {
var map = omap._map;
var list = omap._list;
var i = map.get(k);
var has = i !== undefined;
var newMap;
var newList;
if (v === NOT_SET) { // removed
if (!has) {
return omap;
}
if (list.size >= SIZE && list.size >= map.size * 2) {
newList = list.filter(function(entry, idx) {return entry !== undefined && i !== idx});
newMap = newList.toKeyedSeq().map(function(entry ) {return entry[0]}).flip().toMap();
if (omap.__ownerID) {
newMap.__ownerID = newList.__ownerID = omap.__ownerID;
}
} else {
newMap = map.remove(k);
newList = i === list.size - 1 ? list.pop() : list.set(i, undefined);
}
} else {
if (has) {
if (v === list.get(i)[1]) {
return omap;
}
newMap = map;
newList = list.set(i, [k, v]);
} else {
newMap = map.set(k, list.size);
newList = list.set(list.size, [k, v]);
}
}
if (omap.__ownerID) {
omap.size = newMap.size;
omap._map = newMap;
omap._list = newList;
omap.__hash = undefined;
return omap;
}
return makeOrderedMap(newMap, newList);
}
createClass(ToKeyedSequence, KeyedSeq);
function ToKeyedSequence(indexed, useKeys) {
this._iter = indexed;
this._useKeys = useKeys;
this.size = indexed.size;
}
ToKeyedSequence.prototype.get = function(key, notSetValue) {
return this._iter.get(key, notSetValue);
};
ToKeyedSequence.prototype.has = function(key) {
return this._iter.has(key);
};
ToKeyedSequence.prototype.valueSeq = function() {
return this._iter.valueSeq();
};
ToKeyedSequence.prototype.reverse = function() {var this$0 = this;
var reversedSequence = reverseFactory(this, true);
if (!this._useKeys) {
reversedSequence.valueSeq = function() {return this$0._iter.toSeq().reverse()};
}
return reversedSequence;
};
ToKeyedSequence.prototype.map = function(mapper, context) {var this$0 = this;
var mappedSequence = mapFactory(this, mapper, context);
if (!this._useKeys) {
mappedSequence.valueSeq = function() {return this$0._iter.toSeq().map(mapper, context)};
}
return mappedSequence;
};
ToKeyedSequence.prototype.__iterate = function(fn, reverse) {var this$0 = this;
var ii;
return this._iter.__iterate(
this._useKeys ?
function(v, k) {return fn(v, k, this$0)} :
((ii = reverse ? resolveSize(this) : 0),
function(v ) {return fn(v, reverse ? --ii : ii++, this$0)}),
reverse
);
};
ToKeyedSequence.prototype.__iterator = function(type, reverse) {
if (this._useKeys) {
return this._iter.__iterator(type, reverse);
}
var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);
var ii = reverse ? resolveSize(this) : 0;
return new Iterator(function() {
var step = iterator.next();
return step.done ? step :
iteratorValue(type, reverse ? --ii : ii++, step.value, step);
});
};
ToKeyedSequence.prototype[IS_ORDERED_SENTINEL] = true;
createClass(ToIndexedSequence, IndexedSeq);
function ToIndexedSequence(iter) {
this._iter = iter;
this.size = iter.size;
}
ToIndexedSequence.prototype.includes = function(value) {
return this._iter.includes(value);
};
ToIndexedSequence.prototype.__iterate = function(fn, reverse) {var this$0 = this;
var iterations = 0;
return this._iter.__iterate(function(v ) {return fn(v, iterations++, this$0)}, reverse);
};
ToIndexedSequence.prototype.__iterator = function(type, reverse) {
var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);
var iterations = 0;
return new Iterator(function() {
var step = iterator.next();
return step.done ? step :
iteratorValue(type, iterations++, step.value, step)
});
};
createClass(ToSetSequence, SetSeq);
function ToSetSequence(iter) {
this._iter = iter;
this.size = iter.size;
}
ToSetSequence.prototype.has = function(key) {
return this._iter.includes(key);
};
ToSetSequence.prototype.__iterate = function(fn, reverse) {var this$0 = this;
return this._iter.__iterate(function(v ) {return fn(v, v, this$0)}, reverse);
};
ToSetSequence.prototype.__iterator = function(type, reverse) {
var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);
return new Iterator(function() {
var step = iterator.next();
return step.done ? step :
iteratorValue(type, step.value, step.value, step);
});
};
createClass(FromEntriesSequence, KeyedSeq);
function FromEntriesSequence(entries) {
this._iter = entries;
this.size = entries.size;
}
FromEntriesSequence.prototype.entrySeq = function() {
return this._iter.toSeq();
};
FromEntriesSequence.prototype.__iterate = function(fn, reverse) {var this$0 = this;
return this._iter.__iterate(function(entry ) {
// Check if entry exists first so array access doesn't throw for holes
// in the parent iteration.
if (entry) {
validateEntry(entry);
var indexedIterable = isIterable(entry);
return fn(
indexedIterable ? entry.get(1) : entry[1],
indexedIterable ? entry.get(0) : entry[0],
this$0
);
}
}, reverse);
};
FromEntriesSequence.prototype.__iterator = function(type, reverse) {
var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);
return new Iterator(function() {
while (true) {
var step = iterator.next();
if (step.done) {
return step;
}
var entry = step.value;
// Check if entry exists first so array access doesn't throw for holes
// in the parent iteration.
if (entry) {
validateEntry(entry);
var indexedIterable = isIterable(entry);
return iteratorValue(
type,
indexedIterable ? entry.get(0) : entry[0],
indexedIterable ? entry.get(1) : entry[1],
step
);
}
}
});
};
ToIndexedSequence.prototype.cacheResult =
ToKeyedSequence.prototype.cacheResult =
ToSetSequence.prototype.cacheResult =
FromEntriesSequence.prototype.cacheResult =
cacheResultThrough;
function flipFactory(iterable) {
var flipSequence = makeSequence(iterable);
flipSequence._iter = iterable;
flipSequence.size = iterable.size;
flipSequence.flip = function() {return iterable};
flipSequence.reverse = function () {
var reversedSequence = iterable.reverse.apply(this); // super.reverse()
reversedSequence.flip = function() {return iterable.reverse()};
return reversedSequence;
};
flipSequence.has = function(key ) {return iterable.includes(key)};
flipSequence.includes = function(key ) {return iterable.has(key)};
flipSequence.cacheResult = cacheResultThrough;
flipSequence.__iterateUncached = function (fn, reverse) {var this$0 = this;
return iterable.__iterate(function(v, k) {return fn(k, v, this$0) !== false}, reverse);
}
flipSequence.__iteratorUncached = function(type, reverse) {
if (type === ITERATE_ENTRIES) {
var iterator = iterable.__iterator(type, reverse);
return new Iterator(function() {
var step = iterator.next();
if (!step.done) {
var k = step.value[0];
step.value[0] = step.value[1];
step.value[1] = k;
}
return step;
});
}
return iterable.__iterator(
type === ITERATE_VALUES ? ITERATE_KEYS : ITERATE_VALUES,
reverse
);
}
return flipSequence;
}
function mapFactory(iterable, mapper, context) {
var mappedSequence = makeSequence(iterable);
mappedSequence.size = iterable.size;
mappedSequence.has = function(key ) {return iterable.has(key)};
mappedSequence.get = function(key, notSetValue) {
var v = iterable.get(key, NOT_SET);
return v === NOT_SET ?
notSetValue :
mapper.call(context, v, key, iterable);
};
mappedSequence.__iterateUncached = function (fn, reverse) {var this$0 = this;
return iterable.__iterate(
function(v, k, c) {return fn(mapper.call(context, v, k, c), k, this$0) !== false},
reverse
);
}
mappedSequence.__iteratorUncached = function (type, reverse) {
var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);
return new Iterator(function() {
var step = iterator.next();
if (step.done) {
return step;
}
var entry = step.value;
var key = entry[0];
return iteratorValue(
type,
key,
mapper.call(context, entry[1], key, iterable),
step
);
});
}
return mappedSequence;
}
function reverseFactory(iterable, useKeys) {
var reversedSequence = makeSequence(iterable);
reversedSequence._iter = iterable;
reversedSequence.size = iterable.size;
reversedSequence.reverse = function() {return iterable};
if (iterable.flip) {
reversedSequence.flip = function () {
var flipSequence = flipFactory(iterable);
flipSequence.reverse = function() {return iterable.flip()};
return flipSequence;
};
}
reversedSequence.get = function(key, notSetValue)
{return iterable.get(useKeys ? key : -1 - key, notSetValue)};
reversedSequence.has = function(key )
{return iterable.has(useKeys ? key : -1 - key)};
reversedSequence.includes = function(value ) {return iterable.includes(value)};
reversedSequence.cacheResult = cacheResultThrough;
reversedSequence.__iterate = function (fn, reverse) {var this$0 = this;
return iterable.__iterate(function(v, k) {return fn(v, k, this$0)}, !reverse);
};
reversedSequence.__iterator =
function(type, reverse) {return iterable.__iterator(type, !reverse)};
return reversedSequence;
}
function filterFactory(iterable, predicate, context, useKeys) {
var filterSequence = makeSequence(iterable);
if (useKeys) {
filterSequence.has = function(key ) {
var v = iterable.get(key, NOT_SET);
return v !== NOT_SET && !!predicate.call(context, v, key, iterable);
};
filterSequence.get = function(key, notSetValue) {
var v = iterable.get(key, NOT_SET);
return v !== NOT_SET && predicate.call(context, v, key, iterable) ?
v : notSetValue;
};
}
filterSequence.__iterateUncached = function (fn, reverse) {var this$0 = this;
var iterations = 0;
iterable.__iterate(function(v, k, c) {
if (predicate.call(context, v, k, c)) {
iterations++;
return fn(v, useKeys ? k : iterations - 1, this$0);
}
}, reverse);
return iterations;
};
filterSequence.__iteratorUncached = function (type, reverse) {
var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);
var iterations = 0;
return new Iterator(function() {
while (true) {
var step = iterator.next();
if (step.done) {
return step;
}
var entry = step.value;
var key = entry[0];
var value = entry[1];
if (predicate.call(context, value, key, iterable)) {
return iteratorValue(type, useKeys ? key : iterations++, value, step);
}
}
});
}
return filterSequence;
}
function countByFactory(iterable, grouper, context) {
var groups = Map().asMutable();
iterable.__iterate(function(v, k) {
groups.update(
grouper.call(context, v, k, iterable),
0,
function(a ) {return a + 1}
);
});
return groups.asImmutable();
}
function groupByFactory(iterable, grouper, context) {
var isKeyedIter = isKeyed(iterable);
var groups = (isOrdered(iterable) ? OrderedMap() : Map()).asMutable();
iterable.__iterate(function(v, k) {
groups.update(
grouper.call(context, v, k, iterable),
function(a ) {return (a = a || [], a.push(isKeyedIter ? [k, v] : v), a)}
);
});
var coerce = iterableClass(iterable);
return groups.map(function(arr ) {return reify(iterable, coerce(arr))});
}
function sliceFactory(iterable, begin, end, useKeys) {
var originalSize = iterable.size;
// Sanitize begin & end using this shorthand for ToInt32(argument)
// http://www.ecma-international.org/ecma-262/6.0/#sec-toint32
if (begin !== undefined) {
begin = begin | 0;
}
if (end !== undefined) {
end = end | 0;
}
if (wholeSlice(begin, end, originalSize)) {
return iterable;
}
var resolvedBegin = resolveBegin(begin, originalSize);
var resolvedEnd = resolveEnd(end, originalSize);
// begin or end will be NaN if they were provided as negative numbers and
// this iterable's size is unknown. In that case, cache first so there is
// a known size and these do not resolve to NaN.
if (resolvedBegin !== resolvedBegin || resolvedEnd !== resolvedEnd) {
return sliceFactory(iterable.toSeq().cacheResult(), begin, end, useKeys);
}
// Note: resolvedEnd is undefined when the original sequence's length is
// unknown and this slice did not supply an end and should contain all
// elements after resolvedBegin.
// In that case, resolvedSize will be NaN and sliceSize will remain undefined.
var resolvedSize = resolvedEnd - resolvedBegin;
var sliceSize;
if (resolvedSize === resolvedSize) {
sliceSize = resolvedSize < 0 ? 0 : resolvedSize;
}
var sliceSeq = makeSequence(iterable);
// If iterable.size is undefined, the size of the realized sliceSeq is
// unknown at this point unless the number of items to slice is 0
sliceSeq.size = sliceSize === 0 ? sliceSize : iterable.size && sliceSize || undefined;
if (!useKeys && isSeq(iterable) && sliceSize >= 0) {
sliceSeq.get = function (index, notSetValue) {
index = wrapIndex(this, index);
return index >= 0 && index < sliceSize ?
iterable.get(index + resolvedBegin, notSetValue) :
notSetValue;
}
}
sliceSeq.__iterateUncached = function(fn, reverse) {var this$0 = this;
if (sliceSize === 0) {
return 0;
}
if (reverse) {
return this.cacheResult().__iterate(fn, reverse);
}
var skipped = 0;
var isSkipping = true;
var iterations = 0;
iterable.__iterate(function(v, k) {
if (!(isSkipping && (isSkipping = skipped++ < resolvedBegin))) {
iterations++;
return fn(v, useKeys ? k : iterations - 1, this$0) !== false &&
iterations !== sliceSize;
}
});
return iterations;
};
sliceSeq.__iteratorUncached = function(type, reverse) {
if (sliceSize !== 0 && reverse) {
return this.cacheResult().__iterator(type, reverse);
}
// Don't bother instantiating parent iterator if taking 0.
var iterator = sliceSize !== 0 && iterable.__iterator(type, reverse);
var skipped = 0;
var iterations = 0;
return new Iterator(function() {
while (skipped++ < resolvedBegin) {
iterator.next();
}
if (++iterations > sliceSize) {
return iteratorDone();
}
var step = iterator.next();
if (useKeys || type === ITERATE_VALUES) {
return step;
} else if (type === ITERATE_KEYS) {
return iteratorValue(type, iterations - 1, undefined, step);
} else {
return iteratorValue(type, iterations - 1, step.value[1], step);
}
});
}
return sliceSeq;
}
function takeWhileFactory(iterable, predicate, context) {
var takeSequence = makeSequence(iterable);
takeSequence.__iterateUncached = function(fn, reverse) {var this$0 = this;
if (reverse) {
return this.cacheResult().__iterate(fn, reverse);
}
var iterations = 0;
iterable.__iterate(function(v, k, c)
{return predicate.call(context, v, k, c) && ++iterations && fn(v, k, this$0)}
);
return iterations;
};
takeSequence.__iteratorUncached = function(type, reverse) {var this$0 = this;
if (reverse) {
return this.cacheResult().__iterator(type, reverse);
}
var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);
var iterating = true;
return new Iterator(function() {
if (!iterating) {
return iteratorDone();
}
var step = iterator.next();
if (step.done) {
return step;
}
var entry = step.value;
var k = entry[0];
var v = entry[1];
if (!predicate.call(context, v, k, this$0)) {
iterating = false;
return iteratorDone();
}
return type === ITERATE_ENTRIES ? step :
iteratorValue(type, k, v, step);
});
};
return takeSequence;
}
function skipWhileFactory(iterable, predicate, context, useKeys) {
var skipSequence = makeSequence(iterable);
skipSequence.__iterateUncached = function (fn, reverse) {var this$0 = this;
if (reverse) {
return this.cacheResult().__iterate(fn, reverse);
}
var isSkipping = true;
var iterations = 0;
iterable.__iterate(function(v, k, c) {
if (!(isSkipping && (isSkipping = predicate.call(context, v, k, c)))) {
iterations++;
return fn(v, useKeys ? k : iterations - 1, this$0);
}
});
return iterations;
};
skipSequence.__iteratorUncached = function(type, reverse) {var this$0 = this;
if (reverse) {
return this.cacheResult().__iterator(type, reverse);
}
var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);
var skipping = true;
var iterations = 0;
return new Iterator(function() {
var step, k, v;
do {
step = iterator.next();
if (step.done) {
if (useKeys || type === ITERATE_VALUES) {
return step;
} else if (type === ITERATE_KEYS) {
return iteratorValue(type, iterations++, undefined, step);
} else {
return iteratorValue(type, iterations++, step.value[1], step);
}
}
var entry = step.value;
k = entry[0];
v = entry[1];
skipping && (skipping = predicate.call(context, v, k, this$0));
} while (skipping);
return type === ITERATE_ENTRIES ? step :
iteratorValue(type, k, v, step);
});
};
return skipSequence;
}
function concatFactory(iterable, values) {
var isKeyedIterable = isKeyed(iterable);
var iters = [iterable].concat(values).map(function(v ) {
if (!isIterable(v)) {
v = isKeyedIterable ?
keyedSeqFromValue(v) :
indexedSeqFromValue(Array.isArray(v) ? v : [v]);
} else if (isKeyedIterable) {
v = KeyedIterable(v);
}
return v;
}).filter(function(v ) {return v.size !== 0});
if (iters.length === 0) {
return iterable;
}
if (iters.length === 1) {
var singleton = iters[0];
if (singleton === iterable ||
isKeyedIterable && isKeyed(singleton) ||
isIndexed(iterable) && isIndexed(singleton)) {
return singleton;
}
}
var concatSeq = new ArraySeq(iters);
if (isKeyedIterable) {
concatSeq = concatSeq.toKeyedSeq();
} else if (!isIndexed(iterable)) {
concatSeq = concatSeq.toSetSeq();
}
concatSeq = concatSeq.flatten(true);
concatSeq.size = iters.reduce(
function(sum, seq) {
if (sum !== undefined) {
var size = seq.size;
if (size !== undefined) {
return sum + size;
}
}
},
0
);
return concatSeq;
}
function flattenFactory(iterable, depth, useKeys) {
var flatSequence = makeSequence(iterable);
flatSequence.__iterateUncached = function(fn, reverse) {
var iterations = 0;
var stopped = false;
function flatDeep(iter, currentDepth) {var this$0 = this;
iter.__iterate(function(v, k) {
if ((!depth || currentDepth < depth) && isIterable(v)) {
flatDeep(v, currentDepth + 1);
} else if (fn(v, useKeys ? k : iterations++, this$0) === false) {
stopped = true;
}
return !stopped;
}, reverse);
}
flatDeep(iterable, 0);
return iterations;
}
flatSequence.__iteratorUncached = function(type, reverse) {
var iterator = iterable.__iterator(type, reverse);
var stack = [];
var iterations = 0;
return new Iterator(function() {
while (iterator) {
var step = iterator.next();
if (step.done !== false) {
iterator = stack.pop();
continue;
}
var v = step.value;
if (type === ITERATE_ENTRIES) {
v = v[1];
}
if ((!depth || stack.length < depth) && isIterable(v)) {
stack.push(iterator);
iterator = v.__iterator(type, reverse);
} else {
return useKeys ? step : iteratorValue(type, iterations++, v, step);
}
}
return iteratorDone();
});
}
return flatSequence;
}
function flatMapFactory(iterable, mapper, context) {
var coerce = iterableClass(iterable);
return iterable.toSeq().map(
function(v, k) {return coerce(mapper.call(context, v, k, iterable))}
).flatten(true);
}
function interposeFactory(iterable, separator) {
var interposedSequence = makeSequence(iterable);
interposedSequence.size = iterable.size && iterable.size * 2 -1;
interposedSequence.__iterateUncached = function(fn, reverse) {var this$0 = this;
var iterations = 0;
iterable.__iterate(function(v, k)
{return (!iterations || fn(separator, iterations++, this$0) !== false) &&
fn(v, iterations++, this$0) !== false},
reverse
);
return iterations;
};
interposedSequence.__iteratorUncached = function(type, reverse) {
var iterator = iterable.__iterator(ITERATE_VALUES, reverse);
var iterations = 0;
var step;
return new Iterator(function() {
if (!step || iterations % 2) {
step = iterator.next();
if (step.done) {
return step;
}
}
return iterations % 2 ?
iteratorValue(type, iterations++, separator) :
iteratorValue(type, iterations++, step.value, step);
});
};
return interposedSequence;
}
function sortFactory(iterable, comparator, mapper) {
if (!comparator) {
comparator = defaultComparator;
}
var isKeyedIterable = isKeyed(iterable);
var index = 0;
var entries = iterable.toSeq().map(
function(v, k) {return [k, v, index++, mapper ? mapper(v, k, iterable) : v]}
).toArray();
entries.sort(function(a, b) {return comparator(a[3], b[3]) || a[2] - b[2]}).forEach(
isKeyedIterable ?
function(v, i) { entries[i].length = 2; } :
function(v, i) { entries[i] = v[1]; }
);
return isKeyedIterable ? KeyedSeq(entries) :
isIndexed(iterable) ? IndexedSeq(entries) :
SetSeq(entries);
}
function maxFactory(iterable, comparator, mapper) {
if (!comparator) {
comparator = defaultComparator;
}
if (mapper) {
var entry = iterable.toSeq()
.map(function(v, k) {return [v, mapper(v, k, iterable)]})
.reduce(function(a, b) {return maxCompare(comparator, a[1], b[1]) ? b : a});
return entry && entry[0];
} else {
return iterable.reduce(function(a, b) {return maxCompare(comparator, a, b) ? b : a});
}
}
function maxCompare(comparator, a, b) {
var comp = comparator(b, a);
// b is considered the new max if the comparator declares them equal, but
// they are not equal and b is in fact a nullish value.
return (comp === 0 && b !== a && (b === undefined || b === null || b !== b)) || comp > 0;
}
function zipWithFactory(keyIter, zipper, iters) {
var zipSequence = makeSequence(keyIter);
zipSequence.size = new ArraySeq(iters).map(function(i ) {return i.size}).min();
// Note: this a generic base implementation of __iterate in terms of
// __iterator which may be more generically useful in the future.
zipSequence.__iterate = function(fn, reverse) {
/* generic:
var iterator = this.__iterator(ITERATE_ENTRIES, reverse);
var step;
var iterations = 0;
while (!(step = iterator.next()).done) {
iterations++;
if (fn(step.value[1], step.value[0], this) === false) {
break;
}
}
return iterations;
*/
// indexed:
var iterator = this.__iterator(ITERATE_VALUES, reverse);
var step;
var iterations = 0;
while (!(step = iterator.next()).done) {
if (fn(step.value, iterations++, this) === false) {
break;
}
}
return iterations;
};
zipSequence.__iteratorUncached = function(type, reverse) {
var iterators = iters.map(function(i )
{return (i = Iterable(i), getIterator(reverse ? i.reverse() : i))}
);
var iterations = 0;
var isDone = false;
return new Iterator(function() {
var steps;
if (!isDone) {
steps = iterators.map(function(i ) {return i.next()});
isDone = steps.some(function(s ) {return s.done});
}
if (isDone) {
return iteratorDone();
}
return iteratorValue(
type,
iterations++,
zipper.apply(null, steps.map(function(s ) {return s.value}))
);
});
};
return zipSequence
}
// #pragma Helper Functions
function reify(iter, seq) {
return isSeq(iter) ? seq : iter.constructor(seq);
}
function validateEntry(entry) {
if (entry !== Object(entry)) {
throw new TypeError('Expected [K, V] tuple: ' + entry);
}
}
function resolveSize(iter) {
assertNotInfinite(iter.size);
return ensureSize(iter);
}
function iterableClass(iterable) {
return isKeyed(iterable) ? KeyedIterable :
isIndexed(iterable) ? IndexedIterable :
SetIterable;
}
function makeSequence(iterable) {
return Object.create(
(
isKeyed(iterable) ? KeyedSeq :
isIndexed(iterable) ? IndexedSeq :
SetSeq
).prototype
);
}
function cacheResultThrough() {
if (this._iter.cacheResult) {
this._iter.cacheResult();
this.size = this._iter.size;
return this;
} else {
return Seq.prototype.cacheResult.call(this);
}
}
function defaultComparator(a, b) {
return a > b ? 1 : a < b ? -1 : 0;
}
function forceIterator(keyPath) {
var iter = getIterator(keyPath);
if (!iter) {
// Array might not be iterable in this environment, so we need a fallback
// to our wrapped type.
if (!isArrayLike(keyPath)) {
throw new TypeError('Expected iterable or array-like: ' + keyPath);
}
iter = getIterator(Iterable(keyPath));
}
return iter;
}
createClass(Record, KeyedCollection);
function Record(defaultValues, name) {
var hasInitialized;
var RecordType = function Record(values) {
if (values instanceof RecordType) {
return values;
}
if (!(this instanceof RecordType)) {
return new RecordType(values);
}
if (!hasInitialized) {
hasInitialized = true;
var keys = Object.keys(defaultValues);
setProps(RecordTypePrototype, keys);
RecordTypePrototype.size = keys.length;
RecordTypePrototype._name = name;
RecordTypePrototype._keys = keys;
RecordTypePrototype._defaultValues = defaultValues;
}
this._map = Map(values);
};
var RecordTypePrototype = RecordType.prototype = Object.create(RecordPrototype);
RecordTypePrototype.constructor = RecordType;
return RecordType;
}
Record.prototype.toString = function() {
return this.__toString(recordName(this) + ' {', '}');
};
// @pragma Access
Record.prototype.has = function(k) {
return this._defaultValues.hasOwnProperty(k);
};
Record.prototype.get = function(k, notSetValue) {
if (!this.has(k)) {
return notSetValue;
}
var defaultVal = this._defaultValues[k];
return this._map ? this._map.get(k, defaultVal) : defaultVal;
};
// @pragma Modification
Record.prototype.clear = function() {
if (this.__ownerID) {
this._map && this._map.clear();
return this;
}
var RecordType = this.constructor;
return RecordType._empty || (RecordType._empty = makeRecord(this, emptyMap()));
};
Record.prototype.set = function(k, v) {
if (!this.has(k)) {
throw new Error('Cannot set unknown key "' + k + '" on ' + recordName(this));
}
var newMap = this._map && this._map.set(k, v);
if (this.__ownerID || newMap === this._map) {
return this;
}
return makeRecord(this, newMap);
};
Record.prototype.remove = function(k) {
if (!this.has(k)) {
return this;
}
var newMap = this._map && this._map.remove(k);
if (this.__ownerID || newMap === this._map) {
return this;
}
return makeRecord(this, newMap);
};
Record.prototype.wasAltered = function() {
return this._map.wasAltered();
};
Record.prototype.__iterator = function(type, reverse) {var this$0 = this;
return KeyedIterable(this._defaultValues).map(function(_, k) {return this$0.get(k)}).__iterator(type, reverse);
};
Record.prototype.__iterate = function(fn, reverse) {var this$0 = this;
return KeyedIterable(this._defaultValues).map(function(_, k) {return this$0.get(k)}).__iterate(fn, reverse);
};
Record.prototype.__ensureOwner = function(ownerID) {
if (ownerID === this.__ownerID) {
return this;
}
var newMap = this._map && this._map.__ensureOwner(ownerID);
if (!ownerID) {
this.__ownerID = ownerID;
this._map = newMap;
return this;
}
return makeRecord(this, newMap, ownerID);
};
var RecordPrototype = Record.prototype;
RecordPrototype[DELETE] = RecordPrototype.remove;
RecordPrototype.deleteIn =
RecordPrototype.removeIn = MapPrototype.removeIn;
RecordPrototype.merge = MapPrototype.merge;
RecordPrototype.mergeWith = MapPrototype.mergeWith;
RecordPrototype.mergeIn = MapPrototype.mergeIn;
RecordPrototype.mergeDeep = MapPrototype.mergeDeep;
RecordPrototype.mergeDeepWith = MapPrototype.mergeDeepWith;
RecordPrototype.mergeDeepIn = MapPrototype.mergeDeepIn;
RecordPrototype.setIn = MapPrototype.setIn;
RecordPrototype.update = MapPrototype.update;
RecordPrototype.updateIn = MapPrototype.updateIn;
RecordPrototype.withMutations = MapPrototype.withMutations;
RecordPrototype.asMutable = MapPrototype.asMutable;
RecordPrototype.asImmutable = MapPrototype.asImmutable;
function makeRecord(likeRecord, map, ownerID) {
var record = Object.create(Object.getPrototypeOf(likeRecord));
record._map = map;
record.__ownerID = ownerID;
return record;
}
function recordName(record) {
return record._name || record.constructor.name || 'Record';
}
function setProps(prototype, names) {
try {
names.forEach(setProp.bind(undefined, prototype));
} catch (error) {
// Object.defineProperty failed. Probably IE8.
}
}
function setProp(prototype, name) {
Object.defineProperty(prototype, name, {
get: function() {
return this.get(name);
},
set: function(value) {
invariant(this.__ownerID, 'Cannot set on an immutable record.');
this.set(name, value);
}
});
}
createClass(Set, SetCollection);
// @pragma Construction
function Set(value) {
return value === null || value === undefined ? emptySet() :
isSet(value) && !isOrdered(value) ? value :
emptySet().withMutations(function(set ) {
var iter = SetIterable(value);
assertNotInfinite(iter.size);
iter.forEach(function(v ) {return set.add(v)});
});
}
Set.of = function(/*...values*/) {
return this(arguments);
};
Set.fromKeys = function(value) {
return this(KeyedIterable(value).keySeq());
};
Set.prototype.toString = function() {
return this.__toString('Set {', '}');
};
// @pragma Access
Set.prototype.has = function(value) {
return this._map.has(value);
};
// @pragma Modification
Set.prototype.add = function(value) {
return updateSet(this, this._map.set(value, true));
};
Set.prototype.remove = function(value) {
return updateSet(this, this._map.remove(value));
};
Set.prototype.clear = function() {
return updateSet(this, this._map.clear());
};
// @pragma Composition
Set.prototype.union = function() {var iters = SLICE$0.call(arguments, 0);
iters = iters.filter(function(x ) {return x.size !== 0});
if (iters.length === 0) {
return this;
}
if (this.size === 0 && !this.__ownerID && iters.length === 1) {
return this.constructor(iters[0]);
}
return this.withMutations(function(set ) {
for (var ii = 0; ii < iters.length; ii++) {
SetIterable(iters[ii]).forEach(function(value ) {return set.add(value)});
}
});
};
Set.prototype.intersect = function() {var iters = SLICE$0.call(arguments, 0);
if (iters.length === 0) {
return this;
}
iters = iters.map(function(iter ) {return SetIterable(iter)});
var originalSet = this;
return this.withMutations(function(set ) {
originalSet.forEach(function(value ) {
if (!iters.every(function(iter ) {return iter.includes(value)})) {
set.remove(value);
}
});
});
};
Set.prototype.subtract = function() {var iters = SLICE$0.call(arguments, 0);
if (iters.length === 0) {
return this;
}
iters = iters.map(function(iter ) {return SetIterable(iter)});
var originalSet = this;
return this.withMutations(function(set ) {
originalSet.forEach(function(value ) {
if (iters.some(function(iter ) {return iter.includes(value)})) {
set.remove(value);
}
});
});
};
Set.prototype.merge = function() {
return this.union.apply(this, arguments);
};
Set.prototype.mergeWith = function(merger) {var iters = SLICE$0.call(arguments, 1);
return this.union.apply(this, iters);
};
Set.prototype.sort = function(comparator) {
// Late binding
return OrderedSet(sortFactory(this, comparator));
};
Set.prototype.sortBy = function(mapper, comparator) {
// Late binding
return OrderedSet(sortFactory(this, comparator, mapper));
};
Set.prototype.wasAltered = function() {
return this._map.wasAltered();
};
Set.prototype.__iterate = function(fn, reverse) {var this$0 = this;
return this._map.__iterate(function(_, k) {return fn(k, k, this$0)}, reverse);
};
Set.prototype.__iterator = function(type, reverse) {
return this._map.map(function(_, k) {return k}).__iterator(type, reverse);
};
Set.prototype.__ensureOwner = function(ownerID) {
if (ownerID === this.__ownerID) {
return this;
}
var newMap = this._map.__ensureOwner(ownerID);
if (!ownerID) {
this.__ownerID = ownerID;
this._map = newMap;
return this;
}
return this.__make(newMap, ownerID);
};
function isSet(maybeSet) {
return !!(maybeSet && maybeSet[IS_SET_SENTINEL]);
}
Set.isSet = isSet;
var IS_SET_SENTINEL = '@@__IMMUTABLE_SET__@@';
var SetPrototype = Set.prototype;
SetPrototype[IS_SET_SENTINEL] = true;
SetPrototype[DELETE] = SetPrototype.remove;
SetPrototype.mergeDeep = SetPrototype.merge;
SetPrototype.mergeDeepWith = SetPrototype.mergeWith;
SetPrototype.withMutations = MapPrototype.withMutations;
SetPrototype.asMutable = MapPrototype.asMutable;
SetPrototype.asImmutable = MapPrototype.asImmutable;
SetPrototype.__empty = emptySet;
SetPrototype.__make = makeSet;
function updateSet(set, newMap) {
if (set.__ownerID) {
set.size = newMap.size;
set._map = newMap;
return set;
}
return newMap === set._map ? set :
newMap.size === 0 ? set.__empty() :
set.__make(newMap);
}
function makeSet(map, ownerID) {
var set = Object.create(SetPrototype);
set.size = map ? map.size : 0;
set._map = map;
set.__ownerID = ownerID;
return set;
}
var EMPTY_SET;
function emptySet() {
return EMPTY_SET || (EMPTY_SET = makeSet(emptyMap()));
}
createClass(OrderedSet, Set);
// @pragma Construction
function OrderedSet(value) {
return value === null || value === undefined ? emptyOrderedSet() :
isOrderedSet(value) ? value :
emptyOrderedSet().withMutations(function(set ) {
var iter = SetIterable(value);
assertNotInfinite(iter.size);
iter.forEach(function(v ) {return set.add(v)});
});
}
OrderedSet.of = function(/*...values*/) {
return this(arguments);
};
OrderedSet.fromKeys = function(value) {
return this(KeyedIterable(value).keySeq());
};
OrderedSet.prototype.toString = function() {
return this.__toString('OrderedSet {', '}');
};
function isOrderedSet(maybeOrderedSet) {
return isSet(maybeOrderedSet) && isOrdered(maybeOrderedSet);
}
OrderedSet.isOrderedSet = isOrderedSet;
var OrderedSetPrototype = OrderedSet.prototype;
OrderedSetPrototype[IS_ORDERED_SENTINEL] = true;
OrderedSetPrototype.__empty = emptyOrderedSet;
OrderedSetPrototype.__make = makeOrderedSet;
function makeOrderedSet(map, ownerID) {
var set = Object.create(OrderedSetPrototype);
set.size = map ? map.size : 0;
set._map = map;
set.__ownerID = ownerID;
return set;
}
var EMPTY_ORDERED_SET;
function emptyOrderedSet() {
return EMPTY_ORDERED_SET || (EMPTY_ORDERED_SET = makeOrderedSet(emptyOrderedMap()));
}
createClass(Stack, IndexedCollection);
// @pragma Construction
function Stack(value) {
return value === null || value === undefined ? emptyStack() :
isStack(value) ? value :
emptyStack().unshiftAll(value);
}
Stack.of = function(/*...values*/) {
return this(arguments);
};
Stack.prototype.toString = function() {
return this.__toString('Stack [', ']');
};
// @pragma Access
Stack.prototype.get = function(index, notSetValue) {
var head = this._head;
index = wrapIndex(this, index);
while (head && index--) {
head = head.next;
}
return head ? head.value : notSetValue;
};
Stack.prototype.peek = function() {
return this._head && this._head.value;
};
// @pragma Modification
Stack.prototype.push = function(/*...values*/) {
if (arguments.length === 0) {
return this;
}
var newSize = this.size + arguments.length;
var head = this._head;
for (var ii = arguments.length - 1; ii >= 0; ii--) {
head = {
value: arguments[ii],
next: head
};
}
if (this.__ownerID) {
this.size = newSize;
this._head = head;
this.__hash = undefined;
this.__altered = true;
return this;
}
return makeStack(newSize, head);
};
Stack.prototype.pushAll = function(iter) {
iter = IndexedIterable(iter);
if (iter.size === 0) {
return this;
}
assertNotInfinite(iter.size);
var newSize = this.size;
var head = this._head;
iter.reverse().forEach(function(value ) {
newSize++;
head = {
value: value,
next: head
};
});
if (this.__ownerID) {
this.size = newSize;
this._head = head;
this.__hash = undefined;
this.__altered = true;
return this;
}
return makeStack(newSize, head);
};
Stack.prototype.pop = function() {
return this.slice(1);
};
Stack.prototype.unshift = function(/*...values*/) {
return this.push.apply(this, arguments);
};
Stack.prototype.unshiftAll = function(iter) {
return this.pushAll(iter);
};
Stack.prototype.shift = function() {
return this.pop.apply(this, arguments);
};
Stack.prototype.clear = function() {
if (this.size === 0) {
return this;
}
if (this.__ownerID) {
this.size = 0;
this._head = undefined;
this.__hash = undefined;
this.__altered = true;
return this;
}
return emptyStack();
};
Stack.prototype.slice = function(begin, end) {
if (wholeSlice(begin, end, this.size)) {
return this;
}
var resolvedBegin = resolveBegin(begin, this.size);
var resolvedEnd = resolveEnd(end, this.size);
if (resolvedEnd !== this.size) {
// super.slice(begin, end);
return IndexedCollection.prototype.slice.call(this, begin, end);
}
var newSize = this.size - resolvedBegin;
var head = this._head;
while (resolvedBegin--) {
head = head.next;
}
if (this.__ownerID) {
this.size = newSize;
this._head = head;
this.__hash = undefined;
this.__altered = true;
return this;
}
return makeStack(newSize, head);
};
// @pragma Mutability
Stack.prototype.__ensureOwner = function(ownerID) {
if (ownerID === this.__ownerID) {
return this;
}
if (!ownerID) {
this.__ownerID = ownerID;
this.__altered = false;
return this;
}
return makeStack(this.size, this._head, ownerID, this.__hash);
};
// @pragma Iteration
Stack.prototype.__iterate = function(fn, reverse) {
if (reverse) {
return this.reverse().__iterate(fn);
}
var iterations = 0;
var node = this._head;
while (node) {
if (fn(node.value, iterations++, this) === false) {
break;
}
node = node.next;
}
return iterations;
};
Stack.prototype.__iterator = function(type, reverse) {
if (reverse) {
return this.reverse().__iterator(type);
}
var iterations = 0;
var node = this._head;
return new Iterator(function() {
if (node) {
var value = node.value;
node = node.next;
return iteratorValue(type, iterations++, value);
}
return iteratorDone();
});
};
function isStack(maybeStack) {
return !!(maybeStack && maybeStack[IS_STACK_SENTINEL]);
}
Stack.isStack = isStack;
var IS_STACK_SENTINEL = '@@__IMMUTABLE_STACK__@@';
var StackPrototype = Stack.prototype;
StackPrototype[IS_STACK_SENTINEL] = true;
StackPrototype.withMutations = MapPrototype.withMutations;
StackPrototype.asMutable = MapPrototype.asMutable;
StackPrototype.asImmutable = MapPrototype.asImmutable;
StackPrototype.wasAltered = MapPrototype.wasAltered;
function makeStack(size, head, ownerID, hash) {
var map = Object.create(StackPrototype);
map.size = size;
map._head = head;
map.__ownerID = ownerID;
map.__hash = hash;
map.__altered = false;
return map;
}
var EMPTY_STACK;
function emptyStack() {
return EMPTY_STACK || (EMPTY_STACK = makeStack(0));
}
/**
* Contributes additional methods to a constructor
*/
function mixin(ctor, methods) {
var keyCopier = function(key ) { ctor.prototype[key] = methods[key]; };
Object.keys(methods).forEach(keyCopier);
Object.getOwnPropertySymbols &&
Object.getOwnPropertySymbols(methods).forEach(keyCopier);
return ctor;
}
Iterable.Iterator = Iterator;
mixin(Iterable, {
// ### Conversion to other types
toArray: function() {
assertNotInfinite(this.size);
var array = new Array(this.size || 0);
this.valueSeq().__iterate(function(v, i) { array[i] = v; });
return array;
},
toIndexedSeq: function() {
return new ToIndexedSequence(this);
},
toJS: function() {
return this.toSeq().map(
function(value ) {return value && typeof value.toJS === 'function' ? value.toJS() : value}
).__toJS();
},
toJSON: function() {
return this.toSeq().map(
function(value ) {return value && typeof value.toJSON === 'function' ? value.toJSON() : value}
).__toJS();
},
toKeyedSeq: function() {
return new ToKeyedSequence(this, true);
},
toMap: function() {
// Use Late Binding here to solve the circular dependency.
return Map(this.toKeyedSeq());
},
toObject: function() {
assertNotInfinite(this.size);
var object = {};
this.__iterate(function(v, k) { object[k] = v; });
return object;
},
toOrderedMap: function() {
// Use Late Binding here to solve the circular dependency.
return OrderedMap(this.toKeyedSeq());
},
toOrderedSet: function() {
// Use Late Binding here to solve the circular dependency.
return OrderedSet(isKeyed(this) ? this.valueSeq() : this);
},
toSet: function() {
// Use Late Binding here to solve the circular dependency.
return Set(isKeyed(this) ? this.valueSeq() : this);
},
toSetSeq: function() {
return new ToSetSequence(this);
},
toSeq: function() {
return isIndexed(this) ? this.toIndexedSeq() :
isKeyed(this) ? this.toKeyedSeq() :
this.toSetSeq();
},
toStack: function() {
// Use Late Binding here to solve the circular dependency.
return Stack(isKeyed(this) ? this.valueSeq() : this);
},
toList: function() {
// Use Late Binding here to solve the circular dependency.
return List(isKeyed(this) ? this.valueSeq() : this);
},
// ### Common JavaScript methods and properties
toString: function() {
return '[Iterable]';
},
__toString: function(head, tail) {
if (this.size === 0) {
return head + tail;
}
return head + ' ' + this.toSeq().map(this.__toStringMapper).join(', ') + ' ' + tail;
},
// ### ES6 Collection methods (ES6 Array and Map)
concat: function() {var values = SLICE$0.call(arguments, 0);
return reify(this, concatFactory(this, values));
},
includes: function(searchValue) {
return this.some(function(value ) {return is(value, searchValue)});
},
entries: function() {
return this.__iterator(ITERATE_ENTRIES);
},
every: function(predicate, context) {
assertNotInfinite(this.size);
var returnValue = true;
this.__iterate(function(v, k, c) {
if (!predicate.call(context, v, k, c)) {
returnValue = false;
return false;
}
});
return returnValue;
},
filter: function(predicate, context) {
return reify(this, filterFactory(this, predicate, context, true));
},
find: function(predicate, context, notSetValue) {
var entry = this.findEntry(predicate, context);
return entry ? entry[1] : notSetValue;
},
findEntry: function(predicate, context) {
var found;
this.__iterate(function(v, k, c) {
if (predicate.call(context, v, k, c)) {
found = [k, v];
return false;
}
});
return found;
},
findLastEntry: function(predicate, context) {
return this.toSeq().reverse().findEntry(predicate, context);
},
forEach: function(sideEffect, context) {
assertNotInfinite(this.size);
return this.__iterate(context ? sideEffect.bind(context) : sideEffect);
},
join: function(separator) {
assertNotInfinite(this.size);
separator = separator !== undefined ? '' + separator : ',';
var joined = '';
var isFirst = true;
this.__iterate(function(v ) {
isFirst ? (isFirst = false) : (joined += separator);
joined += v !== null && v !== undefined ? v.toString() : '';
});
return joined;
},
keys: function() {
return this.__iterator(ITERATE_KEYS);
},
map: function(mapper, context) {
return reify(this, mapFactory(this, mapper, context));
},
reduce: function(reducer, initialReduction, context) {
assertNotInfinite(this.size);
var reduction;
var useFirst;
if (arguments.length < 2) {
useFirst = true;
} else {
reduction = initialReduction;
}
this.__iterate(function(v, k, c) {
if (useFirst) {
useFirst = false;
reduction = v;
} else {
reduction = reducer.call(context, reduction, v, k, c);
}
});
return reduction;
},
reduceRight: function(reducer, initialReduction, context) {
var reversed = this.toKeyedSeq().reverse();
return reversed.reduce.apply(reversed, arguments);
},
reverse: function() {
return reify(this, reverseFactory(this, true));
},
slice: function(begin, end) {
return reify(this, sliceFactory(this, begin, end, true));
},
some: function(predicate, context) {
return !this.every(not(predicate), context);
},
sort: function(comparator) {
return reify(this, sortFactory(this, comparator));
},
values: function() {
return this.__iterator(ITERATE_VALUES);
},
// ### More sequential methods
butLast: function() {
return this.slice(0, -1);
},
isEmpty: function() {
return this.size !== undefined ? this.size === 0 : !this.some(function() {return true});
},
count: function(predicate, context) {
return ensureSize(
predicate ? this.toSeq().filter(predicate, context) : this
);
},
countBy: function(grouper, context) {
return countByFactory(this, grouper, context);
},
equals: function(other) {
return deepEqual(this, other);
},
entrySeq: function() {
var iterable = this;
if (iterable._cache) {
// We cache as an entries array, so we can just return the cache!
return new ArraySeq(iterable._cache);
}
var entriesSequence = iterable.toSeq().map(entryMapper).toIndexedSeq();
entriesSequence.fromEntrySeq = function() {return iterable.toSeq()};
return entriesSequence;
},
filterNot: function(predicate, context) {
return this.filter(not(predicate), context);
},
findLast: function(predicate, context, notSetValue) {
return this.toKeyedSeq().reverse().find(predicate, context, notSetValue);
},
first: function() {
return this.find(returnTrue);
},
flatMap: function(mapper, context) {
return reify(this, flatMapFactory(this, mapper, context));
},
flatten: function(depth) {
return reify(this, flattenFactory(this, depth, true));
},
fromEntrySeq: function() {
return new FromEntriesSequence(this);
},
get: function(searchKey, notSetValue) {
return this.find(function(_, key) {return is(key, searchKey)}, undefined, notSetValue);
},
getIn: function(searchKeyPath, notSetValue) {
var nested = this;
// Note: in an ES6 environment, we would prefer:
// for (var key of searchKeyPath) {
var iter = forceIterator(searchKeyPath);
var step;
while (!(step = iter.next()).done) {
var key = step.value;
nested = nested && nested.get ? nested.get(key, NOT_SET) : NOT_SET;
if (nested === NOT_SET) {
return notSetValue;
}
}
return nested;
},
groupBy: function(grouper, context) {
return groupByFactory(this, grouper, context);
},
has: function(searchKey) {
return this.get(searchKey, NOT_SET) !== NOT_SET;
},
hasIn: function(searchKeyPath) {
return this.getIn(searchKeyPath, NOT_SET) !== NOT_SET;
},
isSubset: function(iter) {
iter = typeof iter.includes === 'function' ? iter : Iterable(iter);
return this.every(function(value ) {return iter.includes(value)});
},
isSuperset: function(iter) {
iter = typeof iter.isSubset === 'function' ? iter : Iterable(iter);
return iter.isSubset(this);
},
keySeq: function() {
return this.toSeq().map(keyMapper).toIndexedSeq();
},
last: function() {
return this.toSeq().reverse().first();
},
max: function(comparator) {
return maxFactory(this, comparator);
},
maxBy: function(mapper, comparator) {
return maxFactory(this, comparator, mapper);
},
min: function(comparator) {
return maxFactory(this, comparator ? neg(comparator) : defaultNegComparator);
},
minBy: function(mapper, comparator) {
return maxFactory(this, comparator ? neg(comparator) : defaultNegComparator, mapper);
},
rest: function() {
return this.slice(1);
},
skip: function(amount) {
return this.slice(Math.max(0, amount));
},
skipLast: function(amount) {
return reify(this, this.toSeq().reverse().skip(amount).reverse());
},
skipWhile: function(predicate, context) {
return reify(this, skipWhileFactory(this, predicate, context, true));
},
skipUntil: function(predicate, context) {
return this.skipWhile(not(predicate), context);
},
sortBy: function(mapper, comparator) {
return reify(this, sortFactory(this, comparator, mapper));
},
take: function(amount) {
return this.slice(0, Math.max(0, amount));
},
takeLast: function(amount) {
return reify(this, this.toSeq().reverse().take(amount).reverse());
},
takeWhile: function(predicate, context) {
return reify(this, takeWhileFactory(this, predicate, context));
},
takeUntil: function(predicate, context) {
return this.takeWhile(not(predicate), context);
},
valueSeq: function() {
return this.toIndexedSeq();
},
// ### Hashable Object
hashCode: function() {
return this.__hash || (this.__hash = hashIterable(this));
}
// ### Internal
// abstract __iterate(fn, reverse)
// abstract __iterator(type, reverse)
});
// var IS_ITERABLE_SENTINEL = '@@__IMMUTABLE_ITERABLE__@@';
// var IS_KEYED_SENTINEL = '@@__IMMUTABLE_KEYED__@@';
// var IS_INDEXED_SENTINEL = '@@__IMMUTABLE_INDEXED__@@';
// var IS_ORDERED_SENTINEL = '@@__IMMUTABLE_ORDERED__@@';
var IterablePrototype = Iterable.prototype;
IterablePrototype[IS_ITERABLE_SENTINEL] = true;
IterablePrototype[ITERATOR_SYMBOL] = IterablePrototype.values;
IterablePrototype.__toJS = IterablePrototype.toArray;
IterablePrototype.__toStringMapper = quoteString;
IterablePrototype.inspect =
IterablePrototype.toSource = function() { return this.toString(); };
IterablePrototype.chain = IterablePrototype.flatMap;
IterablePrototype.contains = IterablePrototype.includes;
// Temporary warning about using length
(function () {
try {
Object.defineProperty(IterablePrototype, 'length', {
get: function () {
if (!Iterable.noLengthWarning) {
var stack;
try {
throw new Error();
} catch (error) {
stack = error.stack;
}
if (stack.indexOf('_wrapObject') === -1) {
console && console.warn && console.warn(
'iterable.length has been deprecated, '+
'use iterable.size or iterable.count(). '+
'This warning will become a silent error in a future version. ' +
stack
);
return this.size;
}
}
}
});
} catch (e) {}
})();
mixin(KeyedIterable, {
// ### More sequential methods
flip: function() {
return reify(this, flipFactory(this));
},
findKey: function(predicate, context) {
var entry = this.findEntry(predicate, context);
return entry && entry[0];
},
findLastKey: function(predicate, context) {
return this.toSeq().reverse().findKey(predicate, context);
},
keyOf: function(searchValue) {
return this.findKey(function(value ) {return is(value, searchValue)});
},
lastKeyOf: function(searchValue) {
return this.findLastKey(function(value ) {return is(value, searchValue)});
},
mapEntries: function(mapper, context) {var this$0 = this;
var iterations = 0;
return reify(this,
this.toSeq().map(
function(v, k) {return mapper.call(context, [k, v], iterations++, this$0)}
).fromEntrySeq()
);
},
mapKeys: function(mapper, context) {var this$0 = this;
return reify(this,
this.toSeq().flip().map(
function(k, v) {return mapper.call(context, k, v, this$0)}
).flip()
);
}
});
var KeyedIterablePrototype = KeyedIterable.prototype;
KeyedIterablePrototype[IS_KEYED_SENTINEL] = true;
KeyedIterablePrototype[ITERATOR_SYMBOL] = IterablePrototype.entries;
KeyedIterablePrototype.__toJS = IterablePrototype.toObject;
KeyedIterablePrototype.__toStringMapper = function(v, k) {return JSON.stringify(k) + ': ' + quoteString(v)};
mixin(IndexedIterable, {
// ### Conversion to other types
toKeyedSeq: function() {
return new ToKeyedSequence(this, false);
},
// ### ES6 Collection methods (ES6 Array and Map)
filter: function(predicate, context) {
return reify(this, filterFactory(this, predicate, context, false));
},
findIndex: function(predicate, context) {
var entry = this.findEntry(predicate, context);
return entry ? entry[0] : -1;
},
indexOf: function(searchValue) {
var key = this.toKeyedSeq().keyOf(searchValue);
return key === undefined ? -1 : key;
},
lastIndexOf: function(searchValue) {
var key = this.toKeyedSeq().reverse().keyOf(searchValue);
return key === undefined ? -1 : key;
// var index =
// return this.toSeq().reverse().indexOf(searchValue);
},
reverse: function() {
return reify(this, reverseFactory(this, false));
},
slice: function(begin, end) {
return reify(this, sliceFactory(this, begin, end, false));
},
splice: function(index, removeNum /*, ...values*/) {
var numArgs = arguments.length;
removeNum = Math.max(removeNum | 0, 0);
if (numArgs === 0 || (numArgs === 2 && !removeNum)) {
return this;
}
// If index is negative, it should resolve relative to the size of the
// collection. However size may be expensive to compute if not cached, so
// only call count() if the number is in fact negative.
index = resolveBegin(index, index < 0 ? this.count() : this.size);
var spliced = this.slice(0, index);
return reify(
this,
numArgs === 1 ?
spliced :
spliced.concat(arrCopy(arguments, 2), this.slice(index + removeNum))
);
},
// ### More collection methods
findLastIndex: function(predicate, context) {
var key = this.toKeyedSeq().findLastKey(predicate, context);
return key === undefined ? -1 : key;
},
first: function() {
return this.get(0);
},
flatten: function(depth) {
return reify(this, flattenFactory(this, depth, false));
},
get: function(index, notSetValue) {
index = wrapIndex(this, index);
return (index < 0 || (this.size === Infinity ||
(this.size !== undefined && index > this.size))) ?
notSetValue :
this.find(function(_, key) {return key === index}, undefined, notSetValue);
},
has: function(index) {
index = wrapIndex(this, index);
return index >= 0 && (this.size !== undefined ?
this.size === Infinity || index < this.size :
this.indexOf(index) !== -1
);
},
interpose: function(separator) {
return reify(this, interposeFactory(this, separator));
},
interleave: function(/*...iterables*/) {
var iterables = [this].concat(arrCopy(arguments));
var zipped = zipWithFactory(this.toSeq(), IndexedSeq.of, iterables);
var interleaved = zipped.flatten(true);
if (zipped.size) {
interleaved.size = zipped.size * iterables.length;
}
return reify(this, interleaved);
},
last: function() {
return this.get(-1);
},
skipWhile: function(predicate, context) {
return reify(this, skipWhileFactory(this, predicate, context, false));
},
zip: function(/*, ...iterables */) {
var iterables = [this].concat(arrCopy(arguments));
return reify(this, zipWithFactory(this, defaultZipper, iterables));
},
zipWith: function(zipper/*, ...iterables */) {
var iterables = arrCopy(arguments);
iterables[0] = this;
return reify(this, zipWithFactory(this, zipper, iterables));
}
});
IndexedIterable.prototype[IS_INDEXED_SENTINEL] = true;
IndexedIterable.prototype[IS_ORDERED_SENTINEL] = true;
mixin(SetIterable, {
// ### ES6 Collection methods (ES6 Array and Map)
get: function(value, notSetValue) {
return this.has(value) ? value : notSetValue;
},
includes: function(value) {
return this.has(value);
},
// ### More sequential methods
keySeq: function() {
return this.valueSeq();
}
});
SetIterable.prototype.has = IterablePrototype.includes;
// Mixin subclasses
mixin(KeyedSeq, KeyedIterable.prototype);
mixin(IndexedSeq, IndexedIterable.prototype);
mixin(SetSeq, SetIterable.prototype);
mixin(KeyedCollection, KeyedIterable.prototype);
mixin(IndexedCollection, IndexedIterable.prototype);
mixin(SetCollection, SetIterable.prototype);
// #pragma Helper functions
function keyMapper(v, k) {
return k;
}
function entryMapper(v, k) {
return [k, v];
}
function not(predicate) {
return function() {
return !predicate.apply(this, arguments);
}
}
function neg(predicate) {
return function() {
return -predicate.apply(this, arguments);
}
}
function quoteString(value) {
return typeof value === 'string' ? JSON.stringify(value) : value;
}
function defaultZipper() {
return arrCopy(arguments);
}
function defaultNegComparator(a, b) {
return a < b ? 1 : a > b ? -1 : 0;
}
function hashIterable(iterable) {
if (iterable.size === Infinity) {
return 0;
}
var ordered = isOrdered(iterable);
var keyed = isKeyed(iterable);
var h = ordered ? 1 : 0;
var size = iterable.__iterate(
keyed ?
ordered ?
function(v, k) { h = 31 * h + hashMerge(hash(v), hash(k)) | 0; } :
function(v, k) { h = h + hashMerge(hash(v), hash(k)) | 0; } :
ordered ?
function(v ) { h = 31 * h + hash(v) | 0; } :
function(v ) { h = h + hash(v) | 0; }
);
return murmurHashOfSize(size, h);
}
function murmurHashOfSize(size, h) {
h = imul(h, 0xCC9E2D51);
h = imul(h << 15 | h >>> -15, 0x1B873593);
h = imul(h << 13 | h >>> -13, 5);
h = (h + 0xE6546B64 | 0) ^ size;
h = imul(h ^ h >>> 16, 0x85EBCA6B);
h = imul(h ^ h >>> 13, 0xC2B2AE35);
h = smi(h ^ h >>> 16);
return h;
}
function hashMerge(a, b) {
return a ^ b + 0x9E3779B9 + (a << 6) + (a >> 2) | 0; // int
}
var Immutable = {
Iterable: Iterable,
Seq: Seq,
Collection: Collection,
Map: Map,
OrderedMap: OrderedMap,
List: List,
Stack: Stack,
Set: Set,
OrderedSet: OrderedSet,
Record: Record,
Range: Range,
Repeat: Repeat,
is: is,
fromJS: fromJS
};
return Immutable;
}));
/***/ },
/* 1092 */
/*!*********************************************!*\
!*** ./~/draft-js/lib/CharacterMetadata.js ***!
\*********************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule CharacterMetadata
* @typechecks
*
*/
'use strict';
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 _require = __webpack_require__(/*! immutable */ 1091);
var Map = _require.Map;
var OrderedSet = _require.OrderedSet;
var Record = _require.Record;
var EMPTY_SET = OrderedSet();
var defaultRecord = {
style: EMPTY_SET,
entity: null
};
var CharacterMetadataRecord = Record(defaultRecord);
var CharacterMetadata = function (_CharacterMetadataRec) {
_inherits(CharacterMetadata, _CharacterMetadataRec);
function CharacterMetadata() {
_classCallCheck(this, CharacterMetadata);
return _possibleConstructorReturn(this, _CharacterMetadataRec.apply(this, arguments));
}
CharacterMetadata.prototype.getStyle = function getStyle() {
return this.get('style');
};
CharacterMetadata.prototype.getEntity = function getEntity() {
return this.get('entity');
};
CharacterMetadata.prototype.hasStyle = function hasStyle(style) {
return this.getStyle().has(style);
};
CharacterMetadata.applyStyle = function applyStyle(record, style) {
var withStyle = record.set('style', record.getStyle().add(style));
return CharacterMetadata.create(withStyle);
};
CharacterMetadata.removeStyle = function removeStyle(record, style) {
var withoutStyle = record.set('style', record.getStyle().remove(style));
return CharacterMetadata.create(withoutStyle);
};
CharacterMetadata.applyEntity = function applyEntity(record, entityKey) {
var withEntity = record.getEntity() === entityKey ? record : record.set('entity', entityKey);
return CharacterMetadata.create(withEntity);
};
/**
* Use this function instead of the `CharacterMetadata` constructor.
* Since most content generally uses only a very small number of
* style/entity permutations, we can reuse these objects as often as
* possible.
*/
CharacterMetadata.create = function create(config) {
if (!config) {
return EMPTY;
}
// Fill in unspecified properties, if necessary.
var configMap = Map({ style: EMPTY_SET, entity: null }).merge(config);
var existing = pool.get(configMap);
if (existing) {
return existing;
}
var newCharacter = new CharacterMetadata(configMap);
pool = pool.set(configMap, newCharacter);
return newCharacter;
};
return CharacterMetadata;
}(CharacterMetadataRecord);
var EMPTY = new CharacterMetadata();
var pool = Map([[Map(defaultRecord), EMPTY]]);
CharacterMetadata.EMPTY = EMPTY;
module.exports = CharacterMetadata;
/***/ },
/* 1093 */
/*!****************************************!*\
!*** ./~/draft-js/lib/ContentBlock.js ***!
\****************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule ContentBlock
*
*/
'use strict';
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 Immutable = __webpack_require__(/*! immutable */ 1091);
var findRangesImmutable = __webpack_require__(/*! ./findRangesImmutable */ 1094);
var List = Immutable.List;
var Map = Immutable.Map;
var OrderedSet = Immutable.OrderedSet;
var Record = Immutable.Record;
var EMPTY_SET = OrderedSet();
var defaultRecord = {
key: '',
type: 'unstyled',
text: '',
characterList: List(),
depth: 0,
data: Map()
};
var ContentBlockRecord = Record(defaultRecord);
var ContentBlock = function (_ContentBlockRecord) {
_inherits(ContentBlock, _ContentBlockRecord);
function ContentBlock() {
_classCallCheck(this, ContentBlock);
return _possibleConstructorReturn(this, _ContentBlockRecord.apply(this, arguments));
}
ContentBlock.prototype.getKey = function getKey() {
return this.get('key');
};
ContentBlock.prototype.getType = function getType() {
return this.get('type');
};
ContentBlock.prototype.getText = function getText() {
return this.get('text');
};
ContentBlock.prototype.getCharacterList = function getCharacterList() {
return this.get('characterList');
};
ContentBlock.prototype.getLength = function getLength() {
return this.getText().length;
};
ContentBlock.prototype.getDepth = function getDepth() {
return this.get('depth');
};
ContentBlock.prototype.getData = function getData() {
return this.get('data');
};
ContentBlock.prototype.getInlineStyleAt = function getInlineStyleAt(offset) {
var character = this.getCharacterList().get(offset);
return character ? character.getStyle() : EMPTY_SET;
};
ContentBlock.prototype.getEntityAt = function getEntityAt(offset) {
var character = this.getCharacterList().get(offset);
return character ? character.getEntity() : null;
};
/**
* Execute a callback for every contiguous range of styles within the block.
*/
ContentBlock.prototype.findStyleRanges = function findStyleRanges(filterFn, callback) {
findRangesImmutable(this.getCharacterList(), haveEqualStyle, filterFn, callback);
};
/**
* Execute a callback for every contiguous range of entities within the block.
*/
ContentBlock.prototype.findEntityRanges = function findEntityRanges(filterFn, callback) {
findRangesImmutable(this.getCharacterList(), haveEqualEntity, filterFn, callback);
};
return ContentBlock;
}(ContentBlockRecord);
function haveEqualStyle(charA, charB) {
return charA.getStyle() === charB.getStyle();
}
function haveEqualEntity(charA, charB) {
return charA.getEntity() === charB.getEntity();
}
module.exports = ContentBlock;
/***/ },
/* 1094 */
/*!***********************************************!*\
!*** ./~/draft-js/lib/findRangesImmutable.js ***!
\***********************************************/
/***/ function(module, exports) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule findRangesImmutable
*
*/
'use strict';
/**
* Search through an array to find contiguous stretches of elements that
* match a specified filter function.
*
* When ranges are found, execute a specified `found` function to supply
* the values to the caller.
*/
function findRangesImmutable(haystack, areEqualFn, filterFn, foundFn) {
if (!haystack.size) {
return;
}
var cursor = 0;
haystack.reduce(function (value, nextValue, nextIndex) {
/* $FlowFixMe(>=0.28.0): `value` could be undefined! */
if (!areEqualFn(value, nextValue)) {
/* $FlowFixMe(>=0.28.0): `value` could be undefined! */
if (filterFn(value)) {
foundFn(cursor, nextIndex);
}
cursor = nextIndex;
}
return nextValue;
});
filterFn(haystack.last()) && foundFn(cursor, haystack.count());
}
module.exports = findRangesImmutable;
/***/ },
/* 1095 */
/*!*****************************************!*\
!*** ./~/draft-js/lib/DraftModifier.js ***!
\*****************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule DraftModifier
* @typechecks
*
*/
'use strict';
var CharacterMetadata = __webpack_require__(/*! ./CharacterMetadata */ 1092);
var ContentStateInlineStyle = __webpack_require__(/*! ./ContentStateInlineStyle */ 1096);
var Immutable = __webpack_require__(/*! immutable */ 1091);
var applyEntityToContentState = __webpack_require__(/*! ./applyEntityToContentState */ 1097);
var getCharacterRemovalRange = __webpack_require__(/*! ./getCharacterRemovalRange */ 1099);
var getContentStateFragment = __webpack_require__(/*! ./getContentStateFragment */ 1104);
var insertFragmentIntoContentState = __webpack_require__(/*! ./insertFragmentIntoContentState */ 1107);
var insertTextIntoContentState = __webpack_require__(/*! ./insertTextIntoContentState */ 1109);
var invariant = __webpack_require__(/*! fbjs/lib/invariant */ 9);
var modifyBlockForContentState = __webpack_require__(/*! ./modifyBlockForContentState */ 1110);
var removeEntitiesAtEdges = __webpack_require__(/*! ./removeEntitiesAtEdges */ 1106);
var removeRangeFromContentState = __webpack_require__(/*! ./removeRangeFromContentState */ 1111);
var splitBlockInContentState = __webpack_require__(/*! ./splitBlockInContentState */ 1112);
var OrderedSet = Immutable.OrderedSet;
/**
* `DraftModifier` provides a set of convenience methods that apply
* modifications to a `ContentState` object based on a target `SelectionState`.
*
* Any change to a `ContentState` should be decomposable into a series of
* transaction functions that apply the required changes and return output
* `ContentState` objects.
*
* These functions encapsulate some of the most common transaction sequences.
*/
var DraftModifier = {
replaceText: function replaceText(contentState, rangeToReplace, text, inlineStyle, entityKey) {
var withoutEntities = removeEntitiesAtEdges(contentState, rangeToReplace);
var withoutText = removeRangeFromContentState(withoutEntities, rangeToReplace);
var character = CharacterMetadata.create({
style: inlineStyle || OrderedSet(),
entity: entityKey || null
});
return insertTextIntoContentState(withoutText, withoutText.getSelectionAfter(), text, character);
},
insertText: function insertText(contentState, targetRange, text, inlineStyle, entityKey) {
!targetRange.isCollapsed() ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Target range must be collapsed for `insertText`.') : invariant(false) : void 0;
return DraftModifier.replaceText(contentState, targetRange, text, inlineStyle, entityKey);
},
moveText: function moveText(contentState, removalRange, targetRange) {
var movedFragment = getContentStateFragment(contentState, removalRange);
var afterRemoval = DraftModifier.removeRange(contentState, removalRange, 'backward');
return DraftModifier.replaceWithFragment(afterRemoval, targetRange, movedFragment);
},
replaceWithFragment: function replaceWithFragment(contentState, targetRange, fragment) {
var withoutEntities = removeEntitiesAtEdges(contentState, targetRange);
var withoutText = removeRangeFromContentState(withoutEntities, targetRange);
return insertFragmentIntoContentState(withoutText, withoutText.getSelectionAfter(), fragment);
},
removeRange: function removeRange(contentState, rangeToRemove, removalDirection) {
// Check whether the selection state overlaps with a single entity.
// If so, try to remove the appropriate substring of the entity text.
if (rangeToRemove.getAnchorKey() === rangeToRemove.getFocusKey()) {
var key = rangeToRemove.getAnchorKey();
var startOffset = rangeToRemove.getStartOffset();
var endOffset = rangeToRemove.getEndOffset();
var block = contentState.getBlockForKey(key);
var startEntity = block.getEntityAt(startOffset);
var endEntity = block.getEntityAt(endOffset - 1);
if (startEntity && startEntity === endEntity) {
var adjustedRemovalRange = getCharacterRemovalRange(block, rangeToRemove, removalDirection);
return removeRangeFromContentState(contentState, adjustedRemovalRange);
}
}
var withoutEntities = removeEntitiesAtEdges(contentState, rangeToRemove);
return removeRangeFromContentState(withoutEntities, rangeToRemove);
},
splitBlock: function splitBlock(contentState, selectionState) {
var withoutEntities = removeEntitiesAtEdges(contentState, selectionState);
var withoutText = removeRangeFromContentState(withoutEntities, selectionState);
return splitBlockInContentState(withoutText, withoutText.getSelectionAfter());
},
applyInlineStyle: function applyInlineStyle(contentState, selectionState, inlineStyle) {
return ContentStateInlineStyle.add(contentState, selectionState, inlineStyle);
},
removeInlineStyle: function removeInlineStyle(contentState, selectionState, inlineStyle) {
return ContentStateInlineStyle.remove(contentState, selectionState, inlineStyle);
},
setBlockType: function setBlockType(contentState, selectionState, blockType) {
return modifyBlockForContentState(contentState, selectionState, function (block) {
return block.merge({ type: blockType, depth: 0 });
});
},
setBlockData: function setBlockData(contentState, selectionState, blockData) {
return modifyBlockForContentState(contentState, selectionState, function (block) {
return block.merge({ data: blockData });
});
},
mergeBlockData: function mergeBlockData(contentState, selectionState, blockData) {
return modifyBlockForContentState(contentState, selectionState, function (block) {
return block.merge({ data: block.getData().merge(blockData) });
});
},
applyEntity: function applyEntity(contentState, selectionState, entityKey) {
var withoutEntities = removeEntitiesAtEdges(contentState, selectionState);
return applyEntityToContentState(withoutEntities, selectionState, entityKey);
}
};
module.exports = DraftModifier;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 1096 */
/*!***************************************************!*\
!*** ./~/draft-js/lib/ContentStateInlineStyle.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule ContentStateInlineStyle
* @typechecks
*
*/
'use strict';
var CharacterMetadata = __webpack_require__(/*! ./CharacterMetadata */ 1092);
var _require = __webpack_require__(/*! immutable */ 1091);
var Map = _require.Map;
var ContentStateInlineStyle = {
add: function add(contentState, selectionState, inlineStyle) {
return modifyInlineStyle(contentState, selectionState, inlineStyle, true);
},
remove: function remove(contentState, selectionState, inlineStyle) {
return modifyInlineStyle(contentState, selectionState, inlineStyle, false);
}
};
function modifyInlineStyle(contentState, selectionState, inlineStyle, addOrRemove) {
var blockMap = contentState.getBlockMap();
var startKey = selectionState.getStartKey();
var startOffset = selectionState.getStartOffset();
var endKey = selectionState.getEndKey();
var endOffset = selectionState.getEndOffset();
var newBlocks = blockMap.skipUntil(function (_, k) {
return k === startKey;
}).takeUntil(function (_, k) {
return k === endKey;
}).concat(Map([[endKey, blockMap.get(endKey)]])).map(function (block, blockKey) {
var sliceStart;
var sliceEnd;
if (startKey === endKey) {
sliceStart = startOffset;
sliceEnd = endOffset;
} else {
sliceStart = blockKey === startKey ? startOffset : 0;
sliceEnd = blockKey === endKey ? endOffset : block.getLength();
}
var chars = block.getCharacterList();
var current;
while (sliceStart < sliceEnd) {
current = chars.get(sliceStart);
chars = chars.set(sliceStart, addOrRemove ? CharacterMetadata.applyStyle(current, inlineStyle) : CharacterMetadata.removeStyle(current, inlineStyle));
sliceStart++;
}
return block.set('characterList', chars);
});
return contentState.merge({
blockMap: blockMap.merge(newBlocks),
selectionBefore: selectionState,
selectionAfter: selectionState
});
}
module.exports = ContentStateInlineStyle;
/***/ },
/* 1097 */
/*!*****************************************************!*\
!*** ./~/draft-js/lib/applyEntityToContentState.js ***!
\*****************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule applyEntityToContentState
* @typechecks
*
*/
'use strict';
var Immutable = __webpack_require__(/*! immutable */ 1091);
var applyEntityToContentBlock = __webpack_require__(/*! ./applyEntityToContentBlock */ 1098);
function applyEntityToContentState(contentState, selectionState, entityKey) {
var blockMap = contentState.getBlockMap();
var startKey = selectionState.getStartKey();
var startOffset = selectionState.getStartOffset();
var endKey = selectionState.getEndKey();
var endOffset = selectionState.getEndOffset();
var newBlocks = blockMap.skipUntil(function (_, k) {
return k === startKey;
}).takeUntil(function (_, k) {
return k === endKey;
}).toOrderedMap().merge(Immutable.OrderedMap([[endKey, blockMap.get(endKey)]])).map(function (block, blockKey) {
var sliceStart = blockKey === startKey ? startOffset : 0;
var sliceEnd = blockKey === endKey ? endOffset : block.getLength();
return applyEntityToContentBlock(block, sliceStart, sliceEnd, entityKey);
});
return contentState.merge({
blockMap: blockMap.merge(newBlocks),
selectionBefore: selectionState,
selectionAfter: selectionState
});
}
module.exports = applyEntityToContentState;
/***/ },
/* 1098 */
/*!*****************************************************!*\
!*** ./~/draft-js/lib/applyEntityToContentBlock.js ***!
\*****************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule applyEntityToContentBlock
* @typechecks
*
*/
'use strict';
var CharacterMetadata = __webpack_require__(/*! ./CharacterMetadata */ 1092);
function applyEntityToContentBlock(contentBlock, start, end, entityKey) {
var characterList = contentBlock.getCharacterList();
while (start < end) {
characterList = characterList.set(start, CharacterMetadata.applyEntity(characterList.get(start), entityKey));
start++;
}
return contentBlock.set('characterList', characterList);
}
module.exports = applyEntityToContentBlock;
/***/ },
/* 1099 */
/*!****************************************************!*\
!*** ./~/draft-js/lib/getCharacterRemovalRange.js ***!
\****************************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule getCharacterRemovalRange
* @typechecks
*
*/
'use strict';
var DraftEntity = __webpack_require__(/*! ./DraftEntity */ 1100);
var DraftEntitySegments = __webpack_require__(/*! ./DraftEntitySegments */ 1102);
var getRangesForDraftEntity = __webpack_require__(/*! ./getRangesForDraftEntity */ 1103);
var invariant = __webpack_require__(/*! fbjs/lib/invariant */ 9);
/**
* Given a SelectionState and a removal direction, determine the entire range
* that should be removed from a ContentState. This is based on any entities
* within the target, with their `mutability` values taken into account.
*
* For instance, if we are attempting to remove part of an "immutable" entity
* range, the entire entity must be removed. The returned `SelectionState`
* will be adjusted accordingly.
*/
function getCharacterRemovalRange(block, selectionState, direction) {
var start = selectionState.getStartOffset();
var end = selectionState.getEndOffset();
var entityKey = block.getEntityAt(start);
if (!entityKey) {
return selectionState;
}
var entity = DraftEntity.get(entityKey);
var mutability = entity.getMutability();
// `MUTABLE` entities can just have the specified range of text removed
// directly. No adjustments are needed.
if (mutability === 'MUTABLE') {
return selectionState;
}
// Find the entity range that overlaps with our removal range.
var entityRanges = getRangesForDraftEntity(block, entityKey).filter(function (range) {
return start < range.end && end > range.start;
});
!(entityRanges.length == 1) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'There should only be one entity range within this removal range.') : invariant(false) : void 0;
var entityRange = entityRanges[0];
// For `IMMUTABLE` entity types, we will remove the entire entity range.
if (mutability === 'IMMUTABLE') {
return selectionState.merge({
anchorOffset: entityRange.start,
focusOffset: entityRange.end,
isBackward: false
});
}
// For `SEGMENTED` entity types, determine the appropriate segment to
// remove.
var removalRange = DraftEntitySegments.getRemovalRange(start, end, block.getText().slice(entityRange.start, entityRange.end), entityRange.start, direction);
return selectionState.merge({
anchorOffset: removalRange.start,
focusOffset: removalRange.end,
isBackward: false
});
}
module.exports = getCharacterRemovalRange;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 1100 */
/*!***************************************!*\
!*** ./~/draft-js/lib/DraftEntity.js ***!
\***************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {'use strict';
var _assign = __webpack_require__(/*! object-assign */ 5);
var _extends = _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; };
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule DraftEntity
* @typechecks
*
*/
var DraftEntityInstance = __webpack_require__(/*! ./DraftEntityInstance */ 1101);
var Immutable = __webpack_require__(/*! immutable */ 1091);
var invariant = __webpack_require__(/*! fbjs/lib/invariant */ 9);
var Map = Immutable.Map;
var instances = Map();
var instanceKey = 0;
/**
* A "document entity" is an object containing metadata associated with a
* piece of text in a ContentBlock.
*
* For example, a `link` entity might include a `uri` property. When a
* ContentBlock is rendered in the browser, text that refers to that link
* entity may be rendered as an anchor, with the `uri` as the href value.
*
* In a ContentBlock, every position in the text may correspond to zero
* or one entities. This correspondence is tracked using a key string,
* generated via DraftEntity.create() and used to obtain entity metadata
* via DraftEntity.get().
*/
var DraftEntity = {
/**
* Create a DraftEntityInstance and store it for later retrieval.
*
* A random key string will be generated and returned. This key may
* be used to track the entity's usage in a ContentBlock, and for
* retrieving data about the entity at render time.
*/
create: function create(type, mutability, data) {
return DraftEntity.add(new DraftEntityInstance({ type: type, mutability: mutability, data: data || {} }));
},
/**
* Add an existing DraftEntityInstance to the DraftEntity map. This is
* useful when restoring instances from the server.
*/
add: function add(instance) {
var key = '' + ++instanceKey;
instances = instances.set(key, instance);
return key;
},
/**
* Retrieve the entity corresponding to the supplied key string.
*/
get: function get(key) {
var instance = instances.get(key);
!!!instance ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unknown DraftEntity key.') : invariant(false) : void 0;
return instance;
},
/**
* Entity instances are immutable. If you need to update the data for an
* instance, this method will merge your data updates and return a new
* instance.
*/
mergeData: function mergeData(key, toMerge) {
var instance = DraftEntity.get(key);
var newData = _extends({}, instance.getData(), toMerge);
var newInstance = instance.set('data', newData);
instances = instances.set(key, newInstance);
return newInstance;
},
/**
* Completely replace the data for a given instance.
*/
replaceData: function replaceData(key, newData) {
var instance = DraftEntity.get(key);
var newInstance = instance.set('data', newData);
instances = instances.set(key, newInstance);
return newInstance;
}
};
module.exports = DraftEntity;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 1101 */
/*!***********************************************!*\
!*** ./~/draft-js/lib/DraftEntityInstance.js ***!
\***********************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule DraftEntityInstance
*
*/
'use strict';
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 Immutable = __webpack_require__(/*! immutable */ 1091);
var Record = Immutable.Record;
var DraftEntityInstanceRecord = Record({
type: 'TOKEN',
mutability: 'IMMUTABLE',
data: Object
});
/**
* An instance of a document entity, consisting of a `type` and relevant
* `data`, metadata about the entity.
*
* For instance, a "link" entity might provide a URI, and a "mention"
* entity might provide the mentioned user's ID. These pieces of data
* may be used when rendering the entity as part of a ContentBlock DOM
* representation. For a link, the data would be used as an href for
* the rendered anchor. For a mention, the ID could be used to retrieve
* a hovercard.
*/
var DraftEntityInstance = function (_DraftEntityInstanceR) {
_inherits(DraftEntityInstance, _DraftEntityInstanceR);
function DraftEntityInstance() {
_classCallCheck(this, DraftEntityInstance);
return _possibleConstructorReturn(this, _DraftEntityInstanceR.apply(this, arguments));
}
DraftEntityInstance.prototype.getType = function getType() {
return this.get('type');
};
DraftEntityInstance.prototype.getMutability = function getMutability() {
return this.get('mutability');
};
DraftEntityInstance.prototype.getData = function getData() {
return this.get('data');
};
return DraftEntityInstance;
}(DraftEntityInstanceRecord);
module.exports = DraftEntityInstance;
/***/ },
/* 1102 */
/*!***********************************************!*\
!*** ./~/draft-js/lib/DraftEntitySegments.js ***!
\***********************************************/
/***/ function(module, exports) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule DraftEntitySegments
* @typechecks
*
*/
'use strict';
/**
* Identify the range to delete from a segmented entity.
*
* Rules:
*
* Example: 'John F. Kennedy'
*
* - Deletion from within any non-whitespace (i.e. ['John', 'F.', 'Kennedy'])
* will return the range of that text.
*
* 'John F. Kennedy' -> 'John F.'
* ^
*
* - Forward deletion of whitespace will remove the following section:
*
* 'John F. Kennedy' -> 'John Kennedy'
* ^
*
* - Backward deletion of whitespace will remove the previous section:
*
* 'John F. Kennedy' -> 'F. Kennedy'
* ^
*/
var DraftEntitySegments = {
getRemovalRange: function getRemovalRange(selectionStart, selectionEnd, text, entityStart, direction) {
var segments = text.split(' ');
segments = segments.map(function ( /*string*/segment, /*number*/ii) {
if (direction === 'forward') {
if (ii > 0) {
return ' ' + segment;
}
} else if (ii < segments.length - 1) {
return segment + ' ';
}
return segment;
});
var segmentStart = entityStart;
var segmentEnd;
var segment;
var removalStart = null;
var removalEnd = null;
for (var jj = 0; jj < segments.length; jj++) {
segment = segments[jj];
segmentEnd = segmentStart + segment.length;
// Our selection overlaps this segment.
if (selectionStart < segmentEnd && segmentStart < selectionEnd) {
if (removalStart !== null) {
removalEnd = segmentEnd;
} else {
removalStart = segmentStart;
removalEnd = segmentEnd;
}
} else if (removalStart !== null) {
break;
}
segmentStart = segmentEnd;
}
var entityEnd = entityStart + text.length;
var atStart = removalStart === entityStart;
var atEnd = removalEnd === entityEnd;
if (!atStart && atEnd || atStart && !atEnd) {
if (direction === 'forward') {
if (removalEnd !== entityEnd) {
removalEnd++;
}
} else if (removalStart !== entityStart) {
removalStart--;
}
}
return {
start: removalStart,
end: removalEnd
};
}
};
module.exports = DraftEntitySegments;
/***/ },
/* 1103 */
/*!***************************************************!*\
!*** ./~/draft-js/lib/getRangesForDraftEntity.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule getRangesForDraftEntity
* @typechecks
*
*/
'use strict';
var invariant = __webpack_require__(/*! fbjs/lib/invariant */ 9);
/**
* Obtain the start and end positions of the range that has the
* specified entity applied to it.
*
* Entity keys are applied only to contiguous stretches of text, so this
* method searches for the first instance of the entity key and returns
* the subsequent range.
*/
function getRangesForDraftEntity(block, key) {
var ranges = [];
block.findEntityRanges(function (c) {
return c.getEntity() === key;
}, function (start, end) {
ranges.push({ start: start, end: end });
});
!!!ranges.length ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Entity key not found in this range.') : invariant(false) : void 0;
return ranges;
}
module.exports = getRangesForDraftEntity;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 1104 */
/*!***************************************************!*\
!*** ./~/draft-js/lib/getContentStateFragment.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule getContentStateFragment
* @typechecks
*
*/
'use strict';
var generateRandomKey = __webpack_require__(/*! ./generateRandomKey */ 1105);
var removeEntitiesAtEdges = __webpack_require__(/*! ./removeEntitiesAtEdges */ 1106);
function getContentStateFragment(contentState, selectionState) {
var startKey = selectionState.getStartKey();
var startOffset = selectionState.getStartOffset();
var endKey = selectionState.getEndKey();
var endOffset = selectionState.getEndOffset();
// Edge entities should be stripped to ensure that we don't preserve
// invalid partial entities when the fragment is reused. We do, however,
// preserve entities that are entirely within the selection range.
var contentWithoutEdgeEntities = removeEntitiesAtEdges(contentState, selectionState);
var blockMap = contentWithoutEdgeEntities.getBlockMap();
var blockKeys = blockMap.keySeq();
var startIndex = blockKeys.indexOf(startKey);
var endIndex = blockKeys.indexOf(endKey) + 1;
var slice = blockMap.slice(startIndex, endIndex).map(function (block, blockKey) {
var newKey = generateRandomKey();
var text = block.getText();
var chars = block.getCharacterList();
if (startKey === endKey) {
return block.merge({
key: newKey,
text: text.slice(startOffset, endOffset),
characterList: chars.slice(startOffset, endOffset)
});
}
if (blockKey === startKey) {
return block.merge({
key: newKey,
text: text.slice(startOffset),
characterList: chars.slice(startOffset)
});
}
if (blockKey === endKey) {
return block.merge({
key: newKey,
text: text.slice(0, endOffset),
characterList: chars.slice(0, endOffset)
});
}
return block.set('key', newKey);
});
return slice.toOrderedMap();
}
module.exports = getContentStateFragment;
/***/ },
/* 1105 */
/*!*********************************************!*\
!*** ./~/draft-js/lib/generateRandomKey.js ***!
\*********************************************/
/***/ function(module, exports) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule generateRandomKey
* @typechecks
*
*/
'use strict';
var seenKeys = {};
var MULTIPLIER = Math.pow(2, 24);
function generateRandomKey() {
var key = void 0;
while (key === undefined || seenKeys.hasOwnProperty(key) || !isNaN(+key)) {
key = Math.floor(Math.random() * MULTIPLIER).toString(32);
}
seenKeys[key] = true;
return key;
}
module.exports = generateRandomKey;
/***/ },
/* 1106 */
/*!*************************************************!*\
!*** ./~/draft-js/lib/removeEntitiesAtEdges.js ***!
\*************************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule removeEntitiesAtEdges
*
*/
'use strict';
var CharacterMetadata = __webpack_require__(/*! ./CharacterMetadata */ 1092);
var DraftEntity = __webpack_require__(/*! ./DraftEntity */ 1100);
var findRangesImmutable = __webpack_require__(/*! ./findRangesImmutable */ 1094);
var invariant = __webpack_require__(/*! fbjs/lib/invariant */ 9);
function removeEntitiesAtEdges(contentState, selectionState) {
var blockMap = contentState.getBlockMap();
var updatedBlocks = {};
var startKey = selectionState.getStartKey();
var startOffset = selectionState.getStartOffset();
var startBlock = blockMap.get(startKey);
var updatedStart = removeForBlock(startBlock, startOffset);
if (updatedStart !== startBlock) {
updatedBlocks[startKey] = updatedStart;
}
var endKey = selectionState.getEndKey();
var endOffset = selectionState.getEndOffset();
var endBlock = blockMap.get(endKey);
if (startKey === endKey) {
endBlock = updatedStart;
}
var updatedEnd = removeForBlock(endBlock, endOffset);
if (updatedEnd !== endBlock) {
updatedBlocks[endKey] = updatedEnd;
}
if (!Object.keys(updatedBlocks).length) {
return contentState.set('selectionAfter', selectionState);
}
return contentState.merge({
blockMap: blockMap.merge(updatedBlocks),
selectionAfter: selectionState
});
}
function getRemovalRange(characters, key, offset) {
var removalRange;
findRangesImmutable(characters, function (a, b) {
return a.getEntity() === b.getEntity();
}, function (element) {
return element.getEntity() === key;
}, function (start, end) {
if (start <= offset && end >= offset) {
removalRange = { start: start, end: end };
}
});
!(typeof removalRange === 'object') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Removal range must exist within character list.') : invariant(false) : void 0;
return removalRange;
}
function removeForBlock(block, offset) {
var chars = block.getCharacterList();
var charBefore = offset > 0 ? chars.get(offset - 1) : undefined;
var charAfter = offset < chars.count() ? chars.get(offset) : undefined;
var entityBeforeCursor = charBefore ? charBefore.getEntity() : undefined;
var entityAfterCursor = charAfter ? charAfter.getEntity() : undefined;
if (entityAfterCursor && entityAfterCursor === entityBeforeCursor) {
var entity = DraftEntity.get(entityAfterCursor);
if (entity.getMutability() !== 'MUTABLE') {
var _getRemovalRange = getRemovalRange(chars, entityAfterCursor, offset);
var start = _getRemovalRange.start;
var end = _getRemovalRange.end;
var current;
while (start < end) {
current = chars.get(start);
chars = chars.set(start, CharacterMetadata.applyEntity(current, null));
start++;
}
return block.set('characterList', chars);
}
}
return block;
}
module.exports = removeEntitiesAtEdges;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 1107 */
/*!**********************************************************!*\
!*** ./~/draft-js/lib/insertFragmentIntoContentState.js ***!
\**********************************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule insertFragmentIntoContentState
* @typechecks
*
*/
'use strict';
var BlockMapBuilder = __webpack_require__(/*! ./BlockMapBuilder */ 1090);
var generateRandomKey = __webpack_require__(/*! ./generateRandomKey */ 1105);
var insertIntoList = __webpack_require__(/*! ./insertIntoList */ 1108);
var invariant = __webpack_require__(/*! fbjs/lib/invariant */ 9);
function insertFragmentIntoContentState(contentState, selectionState, fragment) {
!selectionState.isCollapsed() ? process.env.NODE_ENV !== 'production' ? invariant(false, '`insertFragment` should only be called with a collapsed selection state.') : invariant(false) : void 0;
var targetKey = selectionState.getStartKey();
var targetOffset = selectionState.getStartOffset();
var blockMap = contentState.getBlockMap();
var fragmentSize = fragment.size;
var finalKey;
var finalOffset;
if (fragmentSize === 1) {
var targetBlock = blockMap.get(targetKey);
var pastedBlock = fragment.first();
var text = targetBlock.getText();
var chars = targetBlock.getCharacterList();
var newBlock = targetBlock.merge({
text: text.slice(0, targetOffset) + pastedBlock.getText() + text.slice(targetOffset),
characterList: insertIntoList(chars, pastedBlock.getCharacterList(), targetOffset),
data: pastedBlock.getData()
});
blockMap = blockMap.set(targetKey, newBlock);
finalKey = targetKey;
finalOffset = targetOffset + pastedBlock.getText().length;
return contentState.merge({
blockMap: blockMap.set(targetKey, newBlock),
selectionBefore: selectionState,
selectionAfter: selectionState.merge({
anchorKey: finalKey,
anchorOffset: finalOffset,
focusKey: finalKey,
focusOffset: finalOffset,
isBackward: false
})
});
}
var newBlockArr = [];
contentState.getBlockMap().forEach(function (block, blockKey) {
if (blockKey !== targetKey) {
newBlockArr.push(block);
return;
}
var text = block.getText();
var chars = block.getCharacterList();
// Modify head portion of block.
var blockSize = text.length;
var headText = text.slice(0, targetOffset);
var headCharacters = chars.slice(0, targetOffset);
var appendToHead = fragment.first();
var modifiedHead = block.merge({
text: headText + appendToHead.getText(),
characterList: headCharacters.concat(appendToHead.getCharacterList()),
type: headText ? block.getType() : appendToHead.getType(),
data: appendToHead.getData()
});
newBlockArr.push(modifiedHead);
// Insert fragment blocks after the head and before the tail.
fragment.slice(1, fragmentSize - 1).forEach(function (fragmentBlock) {
newBlockArr.push(fragmentBlock.set('key', generateRandomKey()));
});
// Modify tail portion of block.
var tailText = text.slice(targetOffset, blockSize);
var tailCharacters = chars.slice(targetOffset, blockSize);
var prependToTail = fragment.last();
finalKey = generateRandomKey();
var modifiedTail = prependToTail.merge({
key: finalKey,
text: prependToTail.getText() + tailText,
characterList: prependToTail.getCharacterList().concat(tailCharacters),
data: prependToTail.getData()
});
newBlockArr.push(modifiedTail);
});
finalOffset = fragment.last().getLength();
return contentState.merge({
blockMap: BlockMapBuilder.createFromArray(newBlockArr),
selectionBefore: selectionState,
selectionAfter: selectionState.merge({
anchorKey: finalKey,
anchorOffset: finalOffset,
focusKey: finalKey,
focusOffset: finalOffset,
isBackward: false
})
});
}
module.exports = insertFragmentIntoContentState;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 1108 */
/*!******************************************!*\
!*** ./~/draft-js/lib/insertIntoList.js ***!
\******************************************/
/***/ function(module, exports) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule insertIntoList
*
*/
'use strict';
/**
* Maintain persistence for target list when appending and prepending.
*/
function insertIntoList(targetList, toInsert, offset) {
if (offset === targetList.count()) {
toInsert.forEach(function (c) {
targetList = targetList.push(c);
});
} else if (offset === 0) {
toInsert.reverse().forEach(function (c) {
targetList = targetList.unshift(c);
});
} else {
var head = targetList.slice(0, offset);
var tail = targetList.slice(offset);
targetList = head.concat(toInsert, tail).toList();
}
return targetList;
}
module.exports = insertIntoList;
/***/ },
/* 1109 */
/*!******************************************************!*\
!*** ./~/draft-js/lib/insertTextIntoContentState.js ***!
\******************************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule insertTextIntoContentState
* @typechecks
*
*/
'use strict';
var Immutable = __webpack_require__(/*! immutable */ 1091);
var insertIntoList = __webpack_require__(/*! ./insertIntoList */ 1108);
var invariant = __webpack_require__(/*! fbjs/lib/invariant */ 9);
var Repeat = Immutable.Repeat;
function insertTextIntoContentState(contentState, selectionState, text, characterMetadata) {
!selectionState.isCollapsed() ? process.env.NODE_ENV !== 'production' ? invariant(false, '`insertText` should only be called with a collapsed range.') : invariant(false) : void 0;
var len = text.length;
if (!len) {
return contentState;
}
var blockMap = contentState.getBlockMap();
var key = selectionState.getStartKey();
var offset = selectionState.getStartOffset();
var block = blockMap.get(key);
var blockText = block.getText();
var newBlock = block.merge({
text: blockText.slice(0, offset) + text + blockText.slice(offset, block.getLength()),
characterList: insertIntoList(block.getCharacterList(), Repeat(characterMetadata, len).toList(), offset)
});
var newOffset = offset + len;
return contentState.merge({
blockMap: blockMap.set(key, newBlock),
selectionAfter: selectionState.merge({
anchorOffset: newOffset,
focusOffset: newOffset
})
});
}
module.exports = insertTextIntoContentState;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 1110 */
/*!******************************************************!*\
!*** ./~/draft-js/lib/modifyBlockForContentState.js ***!
\******************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule modifyBlockForContentState
* @typechecks
*
*/
'use strict';
var Immutable = __webpack_require__(/*! immutable */ 1091);
var Map = Immutable.Map;
function modifyBlockForContentState(contentState, selectionState, operation) {
var startKey = selectionState.getStartKey();
var endKey = selectionState.getEndKey();
var blockMap = contentState.getBlockMap();
var newBlocks = blockMap.toSeq().skipUntil(function (_, k) {
return k === startKey;
}).takeUntil(function (_, k) {
return k === endKey;
}).concat(Map([[endKey, blockMap.get(endKey)]])).map(operation);
return contentState.merge({
blockMap: blockMap.merge(newBlocks),
selectionBefore: selectionState,
selectionAfter: selectionState
});
}
module.exports = modifyBlockForContentState;
/***/ },
/* 1111 */
/*!*******************************************************!*\
!*** ./~/draft-js/lib/removeRangeFromContentState.js ***!
\*******************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule removeRangeFromContentState
*
*/
'use strict';
var Immutable = __webpack_require__(/*! immutable */ 1091);
function removeRangeFromContentState(contentState, selectionState) {
if (selectionState.isCollapsed()) {
return contentState;
}
var blockMap = contentState.getBlockMap();
var startKey = selectionState.getStartKey();
var startOffset = selectionState.getStartOffset();
var endKey = selectionState.getEndKey();
var endOffset = selectionState.getEndOffset();
var startBlock = blockMap.get(startKey);
var endBlock = blockMap.get(endKey);
var characterList;
if (startBlock === endBlock) {
characterList = removeFromList(startBlock.getCharacterList(), startOffset, endOffset);
} else {
characterList = startBlock.getCharacterList().slice(0, startOffset).concat(endBlock.getCharacterList().slice(endOffset));
}
var modifiedStart = startBlock.merge({
text: startBlock.getText().slice(0, startOffset) + endBlock.getText().slice(endOffset),
characterList: characterList
});
var newBlocks = blockMap.toSeq().skipUntil(function (_, k) {
return k === startKey;
}).takeUntil(function (_, k) {
return k === endKey;
}).concat(Immutable.Map([[endKey, null]])).map(function (_, k) {
return k === startKey ? modifiedStart : null;
});
blockMap = blockMap.merge(newBlocks).filter(function (block) {
return !!block;
});
return contentState.merge({
blockMap: blockMap,
selectionBefore: selectionState,
selectionAfter: selectionState.merge({
anchorKey: startKey,
anchorOffset: startOffset,
focusKey: startKey,
focusOffset: startOffset,
isBackward: false
})
});
}
/**
* Maintain persistence for target list when removing characters on the
* head and tail of the character list.
*/
function removeFromList(targetList, startOffset, endOffset) {
if (startOffset === 0) {
while (startOffset < endOffset) {
targetList = targetList.shift();
startOffset++;
}
} else if (endOffset === targetList.count()) {
while (endOffset > startOffset) {
targetList = targetList.pop();
endOffset--;
}
} else {
var head = targetList.slice(0, startOffset);
var tail = targetList.slice(endOffset);
targetList = head.concat(tail).toList();
}
return targetList;
}
module.exports = removeRangeFromContentState;
/***/ },
/* 1112 */
/*!****************************************************!*\
!*** ./~/draft-js/lib/splitBlockInContentState.js ***!
\****************************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule splitBlockInContentState
* @typechecks
*
*/
'use strict';
var Immutable = __webpack_require__(/*! immutable */ 1091);
var generateRandomKey = __webpack_require__(/*! ./generateRandomKey */ 1105);
var invariant = __webpack_require__(/*! fbjs/lib/invariant */ 9);
var Map = Immutable.Map;
function splitBlockInContentState(contentState, selectionState) {
!selectionState.isCollapsed() ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Selection range must be collapsed.') : invariant(false) : void 0;
var key = selectionState.getAnchorKey();
var offset = selectionState.getAnchorOffset();
var blockMap = contentState.getBlockMap();
var blockToSplit = blockMap.get(key);
var text = blockToSplit.getText();
var chars = blockToSplit.getCharacterList();
var blockAbove = blockToSplit.merge({
text: text.slice(0, offset),
characterList: chars.slice(0, offset)
});
var keyBelow = generateRandomKey();
var blockBelow = blockAbove.merge({
key: keyBelow,
text: text.slice(offset),
characterList: chars.slice(offset),
data: Map()
});
var blocksBefore = blockMap.toSeq().takeUntil(function (v) {
return v === blockToSplit;
});
var blocksAfter = blockMap.toSeq().skipUntil(function (v) {
return v === blockToSplit;
}).rest();
var newBlocks = blocksBefore.concat([[blockAbove.getKey(), blockAbove], [blockBelow.getKey(), blockBelow]], blocksAfter).toOrderedMap();
return contentState.merge({
blockMap: newBlocks,
selectionBefore: selectionState,
selectionAfter: selectionState.merge({
anchorKey: keyBelow,
anchorOffset: 0,
focusKey: keyBelow,
focusOffset: 0,
isBackward: false
})
});
}
module.exports = splitBlockInContentState;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 1113 */
/*!***************************************!*\
!*** ./~/draft-js/lib/EditorState.js ***!
\***************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule EditorState
*
*/
'use strict';
var _assign = __webpack_require__(/*! object-assign */ 5);
var _extends = _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"); } }
var BlockTree = __webpack_require__(/*! ./BlockTree */ 1114);
var ContentState = __webpack_require__(/*! ./ContentState */ 1115);
var EditorBidiService = __webpack_require__(/*! ./EditorBidiService */ 1118);
var Immutable = __webpack_require__(/*! immutable */ 1091);
var SelectionState = __webpack_require__(/*! ./SelectionState */ 1116);
var OrderedSet = Immutable.OrderedSet;
var Record = Immutable.Record;
var Stack = Immutable.Stack;
var defaultRecord = {
allowUndo: true,
currentContent: null,
decorator: null,
directionMap: null,
forceSelection: false,
inCompositionMode: false,
inlineStyleOverride: null,
lastChangeType: null,
nativelyRenderedContent: null,
redoStack: Stack(),
selection: null,
treeMap: null,
undoStack: Stack()
};
var EditorStateRecord = Record(defaultRecord);
var EditorState = function () {
EditorState.createEmpty = function createEmpty(decorator) {
return EditorState.createWithContent(ContentState.createFromText(''), decorator);
};
EditorState.createWithContent = function createWithContent(contentState, decorator) {
var firstKey = contentState.getBlockMap().first().getKey();
return EditorState.create({
currentContent: contentState,
undoStack: Stack(),
redoStack: Stack(),
decorator: decorator || null,
selection: SelectionState.createEmpty(firstKey)
});
};
EditorState.create = function create(config) {
var currentContent = config.currentContent;
var decorator = config.decorator;
var recordConfig = _extends({}, config, {
treeMap: generateNewTreeMap(currentContent, decorator),
directionMap: EditorBidiService.getDirectionMap(currentContent)
});
return new EditorState(new EditorStateRecord(recordConfig));
};
EditorState.set = function set(editorState, put) {
var map = editorState.getImmutable().withMutations(function (state) {
var existingDecorator = state.get('decorator');
var decorator = existingDecorator;
if (put.decorator === null) {
decorator = null;
} else if (put.decorator) {
decorator = put.decorator;
}
var newContent = put.currentContent || editorState.getCurrentContent();
if (decorator !== existingDecorator) {
var treeMap = state.get('treeMap');
var newTreeMap;
if (decorator && existingDecorator) {
newTreeMap = regenerateTreeForNewDecorator(newContent.getBlockMap(), treeMap, decorator, existingDecorator);
} else {
newTreeMap = generateNewTreeMap(newContent, decorator);
}
state.merge({
decorator: decorator,
treeMap: newTreeMap,
nativelyRenderedContent: null
});
return;
}
var existingContent = editorState.getCurrentContent();
if (newContent !== existingContent) {
state.set('treeMap', regenerateTreeForNewBlocks(editorState, newContent.getBlockMap(), decorator));
}
state.merge(put);
});
return new EditorState(map);
};
EditorState.prototype.toJS = function toJS() {
return this.getImmutable().toJS();
};
EditorState.prototype.getAllowUndo = function getAllowUndo() {
return this.getImmutable().get('allowUndo');
};
EditorState.prototype.getCurrentContent = function getCurrentContent() {
return this.getImmutable().get('currentContent');
};
EditorState.prototype.getUndoStack = function getUndoStack() {
return this.getImmutable().get('undoStack');
};
EditorState.prototype.getRedoStack = function getRedoStack() {
return this.getImmutable().get('redoStack');
};
EditorState.prototype.getSelection = function getSelection() {
return this.getImmutable().get('selection');
};
EditorState.prototype.getDecorator = function getDecorator() {
return this.getImmutable().get('decorator');
};
EditorState.prototype.isInCompositionMode = function isInCompositionMode() {
return this.getImmutable().get('inCompositionMode');
};
EditorState.prototype.mustForceSelection = function mustForceSelection() {
return this.getImmutable().get('forceSelection');
};
EditorState.prototype.getNativelyRenderedContent = function getNativelyRenderedContent() {
return this.getImmutable().get('nativelyRenderedContent');
};
EditorState.prototype.getLastChangeType = function getLastChangeType() {
return this.getImmutable().get('lastChangeType');
};
/**
* While editing, the user may apply inline style commands with a collapsed
* cursor, intending to type text that adopts the specified style. In this
* case, we track the specified style as an "override" that takes precedence
* over the inline style of the text adjacent to the cursor.
*
* If null, there is no override in place.
*/
EditorState.prototype.getInlineStyleOverride = function getInlineStyleOverride() {
return this.getImmutable().get('inlineStyleOverride');
};
EditorState.setInlineStyleOverride = function setInlineStyleOverride(editorState, inlineStyleOverride) {
return EditorState.set(editorState, { inlineStyleOverride: inlineStyleOverride });
};
/**
* Get the appropriate inline style for the editor state. If an
* override is in place, use it. Otherwise, the current style is
* based on the location of the selection state.
*/
EditorState.prototype.getCurrentInlineStyle = function getCurrentInlineStyle() {
var override = this.getInlineStyleOverride();
if (override != null) {
return override;
}
var content = this.getCurrentContent();
var selection = this.getSelection();
if (selection.isCollapsed()) {
return getInlineStyleForCollapsedSelection(content, selection);
}
return getInlineStyleForNonCollapsedSelection(content, selection);
};
EditorState.prototype.getBlockTree = function getBlockTree(blockKey) {
return this.getImmutable().getIn(['treeMap', blockKey]);
};
EditorState.prototype.isSelectionAtStartOfContent = function isSelectionAtStartOfContent() {
var firstKey = this.getCurrentContent().getBlockMap().first().getKey();
return this.getSelection().hasEdgeWithin(firstKey, 0, 0);
};
EditorState.prototype.isSelectionAtEndOfContent = function isSelectionAtEndOfContent() {
var content = this.getCurrentContent();
var blockMap = content.getBlockMap();
var last = blockMap.last();
var end = last.getLength();
return this.getSelection().hasEdgeWithin(last.getKey(), end, end);
};
EditorState.prototype.getDirectionMap = function getDirectionMap() {
return this.getImmutable().get('directionMap');
};
/**
* Incorporate native DOM selection changes into the EditorState. This
* method can be used when we simply want to accept whatever the DOM
* has given us to represent selection, and we do not need to re-render
* the editor.
*
* To forcibly move the DOM selection, see `EditorState.forceSelection`.
*/
EditorState.acceptSelection = function acceptSelection(editorState, selection) {
return updateSelection(editorState, selection, false);
};
/**
* At times, we need to force the DOM selection to be where we
* need it to be. This can occur when the anchor or focus nodes
* are non-text nodes, for instance. In this case, we want to trigger
* a re-render of the editor, which in turn forces selection into
* the correct place in the DOM. The `forceSelection` method
* accomplishes this.
*
* This method should be used in cases where you need to explicitly
* move the DOM selection from one place to another without a change
* in ContentState.
*/
EditorState.forceSelection = function forceSelection(editorState, selection) {
if (!selection.getHasFocus()) {
selection = selection.set('hasFocus', true);
}
return updateSelection(editorState, selection, true);
};
/**
* Move selection to the end of the editor without forcing focus.
*/
EditorState.moveSelectionToEnd = function moveSelectionToEnd(editorState) {
var content = editorState.getCurrentContent();
var lastBlock = content.getLastBlock();
var lastKey = lastBlock.getKey();
var length = lastBlock.getLength();
return EditorState.acceptSelection(editorState, new SelectionState({
anchorKey: lastKey,
anchorOffset: length,
focusKey: lastKey,
focusOffset: length,
isBackward: false
}));
};
/**
* Force focus to the end of the editor. This is useful in scenarios
* where we want to programmatically focus the input and it makes sense
* to allow the user to continue working seamlessly.
*/
EditorState.moveFocusToEnd = function moveFocusToEnd(editorState) {
var afterSelectionMove = EditorState.moveSelectionToEnd(editorState);
return EditorState.forceSelection(afterSelectionMove, afterSelectionMove.getSelection());
};
/**
* Push the current ContentState onto the undo stack if it should be
* considered a boundary state, and set the provided ContentState as the
* new current content.
*/
EditorState.push = function push(editorState, contentState, changeType) {
if (editorState.getCurrentContent() === contentState) {
return editorState;
}
var forceSelection = changeType !== 'insert-characters';
var directionMap = EditorBidiService.getDirectionMap(contentState, editorState.getDirectionMap());
if (!editorState.getAllowUndo()) {
return EditorState.set(editorState, {
currentContent: contentState,
directionMap: directionMap,
lastChangeType: changeType,
selection: contentState.getSelectionAfter(),
forceSelection: forceSelection,
inlineStyleOverride: null
});
}
var selection = editorState.getSelection();
var currentContent = editorState.getCurrentContent();
var undoStack = editorState.getUndoStack();
var newContent = contentState;
if (selection !== currentContent.getSelectionAfter() || mustBecomeBoundary(editorState, changeType)) {
undoStack = undoStack.push(currentContent);
newContent = newContent.set('selectionBefore', selection);
} else if (changeType === 'insert-characters' || changeType === 'backspace-character' || changeType === 'delete-character') {
// Preserve the previous selection.
newContent = newContent.set('selectionBefore', currentContent.getSelectionBefore());
}
var inlineStyleOverride = editorState.getInlineStyleOverride();
// Don't discard inline style overrides on block type or depth changes.
if (changeType !== 'adjust-depth' && changeType !== 'change-block-type') {
inlineStyleOverride = null;
}
var editorStateChanges = {
currentContent: newContent,
directionMap: directionMap,
undoStack: undoStack,
redoStack: Stack(),
lastChangeType: changeType,
selection: contentState.getSelectionAfter(),
forceSelection: forceSelection,
inlineStyleOverride: inlineStyleOverride
};
return EditorState.set(editorState, editorStateChanges);
};
/**
* Make the top ContentState in the undo stack the new current content and
* push the current content onto the redo stack.
*/
EditorState.undo = function undo(editorState) {
if (!editorState.getAllowUndo()) {
return editorState;
}
var undoStack = editorState.getUndoStack();
var newCurrentContent = undoStack.peek();
if (!newCurrentContent) {
return editorState;
}
var currentContent = editorState.getCurrentContent();
var directionMap = EditorBidiService.getDirectionMap(newCurrentContent, editorState.getDirectionMap());
return EditorState.set(editorState, {
currentContent: newCurrentContent,
directionMap: directionMap,
undoStack: undoStack.shift(),
redoStack: editorState.getRedoStack().push(currentContent),
forceSelection: true,
inlineStyleOverride: null,
lastChangeType: 'undo',
nativelyRenderedContent: null,
selection: currentContent.getSelectionBefore()
});
};
/**
* Make the top ContentState in the redo stack the new current content and
* push the current content onto the undo stack.
*/
EditorState.redo = function redo(editorState) {
if (!editorState.getAllowUndo()) {
return editorState;
}
var redoStack = editorState.getRedoStack();
var newCurrentContent = redoStack.peek();
if (!newCurrentContent) {
return editorState;
}
var currentContent = editorState.getCurrentContent();
var directionMap = EditorBidiService.getDirectionMap(newCurrentContent, editorState.getDirectionMap());
return EditorState.set(editorState, {
currentContent: newCurrentContent,
directionMap: directionMap,
undoStack: editorState.getUndoStack().push(currentContent),
redoStack: redoStack.shift(),
forceSelection: true,
inlineStyleOverride: null,
lastChangeType: 'redo',
nativelyRenderedContent: null,
selection: newCurrentContent.getSelectionAfter()
});
};
/**
* Not for public consumption.
*/
function EditorState(immutable) {
_classCallCheck(this, EditorState);
this._immutable = immutable;
}
/**
* Not for public consumption.
*/
EditorState.prototype.getImmutable = function getImmutable() {
return this._immutable;
};
return EditorState;
}();
/**
* Set the supplied SelectionState as the new current selection, and set
* the `force` flag to trigger manual selection placement by the view.
*/
function updateSelection(editorState, selection, forceSelection) {
return EditorState.set(editorState, {
selection: selection,
forceSelection: forceSelection,
nativelyRenderedContent: null,
inlineStyleOverride: null
});
}
/**
* Regenerate the entire tree map for a given ContentState and decorator.
* Returns an OrderedMap that maps all available ContentBlock objects.
*/
function generateNewTreeMap(contentState, decorator) {
return contentState.getBlockMap().map(function (block) {
return BlockTree.generate(block, decorator);
}).toOrderedMap();
}
/**
* Regenerate tree map objects for all ContentBlocks that have changed
* between the current editorState and newContent. Returns an OrderedMap
* with only changed regenerated tree map objects.
*/
function regenerateTreeForNewBlocks(editorState, newBlockMap, decorator) {
var prevBlockMap = editorState.getCurrentContent().getBlockMap();
var prevTreeMap = editorState.getImmutable().get('treeMap');
return prevTreeMap.merge(newBlockMap.toSeq().filter(function (block, key) {
return block !== prevBlockMap.get(key);
}).map(function (block) {
return BlockTree.generate(block, decorator);
}));
}
/**
* Generate tree map objects for a new decorator object, preserving any
* decorations that are unchanged from the previous decorator.
*
* Note that in order for this to perform optimally, decoration Lists for
* decorators should be preserved when possible to allow for direct immutable
* List comparison.
*/
function regenerateTreeForNewDecorator(blockMap, previousTreeMap, decorator, existingDecorator) {
return previousTreeMap.merge(blockMap.toSeq().filter(function (block) {
return decorator.getDecorations(block) !== existingDecorator.getDecorations(block);
}).map(function (block) {
return BlockTree.generate(block, decorator);
}));
}
/**
* Return whether a change should be considered a boundary state, given
* the previous change type. Allows us to discard potential boundary states
* during standard typing or deletion behavior.
*/
function mustBecomeBoundary(editorState, changeType) {
var lastChangeType = editorState.getLastChangeType();
return changeType !== lastChangeType || changeType !== 'insert-characters' && changeType !== 'backspace-character' && changeType !== 'delete-character';
}
function getInlineStyleForCollapsedSelection(content, selection) {
var startKey = selection.getStartKey();
var startOffset = selection.getStartOffset();
var startBlock = content.getBlockForKey(startKey);
// If the cursor is not at the start of the block, look backward to
// preserve the style of the preceding character.
if (startOffset > 0) {
return startBlock.getInlineStyleAt(startOffset - 1);
}
// The caret is at position zero in this block. If the block has any
// text at all, use the style of the first character.
if (startBlock.getLength()) {
return startBlock.getInlineStyleAt(0);
}
// Otherwise, look upward in the document to find the closest character.
return lookUpwardForInlineStyle(content, startKey);
}
function getInlineStyleForNonCollapsedSelection(content, selection) {
var startKey = selection.getStartKey();
var startOffset = selection.getStartOffset();
var startBlock = content.getBlockForKey(startKey);
// If there is a character just inside the selection, use its style.
if (startOffset < startBlock.getLength()) {
return startBlock.getInlineStyleAt(startOffset);
}
// Check if the selection at the end of a non-empty block. Use the last
// style in the block.
if (startOffset > 0) {
return startBlock.getInlineStyleAt(startOffset - 1);
}
// Otherwise, look upward in the document to find the closest character.
return lookUpwardForInlineStyle(content, startKey);
}
function lookUpwardForInlineStyle(content, fromKey) {
var previousBlock = content.getBlockBefore(fromKey);
var previousLength;
while (previousBlock) {
previousLength = previousBlock.getLength();
if (previousLength) {
return previousBlock.getInlineStyleAt(previousLength - 1);
}
previousBlock = content.getBlockBefore(previousBlock.getKey());
}
return OrderedSet();
}
module.exports = EditorState;
/***/ },
/* 1114 */
/*!*************************************!*\
!*** ./~/draft-js/lib/BlockTree.js ***!
\*************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule BlockTree
*
*/
'use strict';
var Immutable = __webpack_require__(/*! immutable */ 1091);
var emptyFunction = __webpack_require__(/*! fbjs/lib/emptyFunction */ 13);
var findRangesImmutable = __webpack_require__(/*! ./findRangesImmutable */ 1094);
var List = Immutable.List;
var Repeat = Immutable.Repeat;
var Record = Immutable.Record;
var returnTrue = emptyFunction.thatReturnsTrue;
var FINGERPRINT_DELIMITER = '-';
var defaultLeafRange = {
start: null,
end: null
};
var LeafRange = Record(defaultLeafRange);
var defaultDecoratorRange = {
start: null,
end: null,
decoratorKey: null,
leaves: null
};
var DecoratorRange = Record(defaultDecoratorRange);
var BlockTree = {
/**
* Generate a block tree for a given ContentBlock/decorator pair.
*/
generate: function generate(block, decorator) {
var textLength = block.getLength();
if (!textLength) {
return List.of(new DecoratorRange({
start: 0,
end: 0,
decoratorKey: null,
leaves: List.of(new LeafRange({ start: 0, end: 0 }))
}));
}
var leafSets = [];
var decorations = decorator ? decorator.getDecorations(block) : List(Repeat(null, textLength));
var chars = block.getCharacterList();
findRangesImmutable(decorations, areEqual, returnTrue, function (start, end) {
leafSets.push(new DecoratorRange({
start: start,
end: end,
decoratorKey: decorations.get(start),
leaves: generateLeaves(chars.slice(start, end).toList(), start)
}));
});
return List(leafSets);
},
/**
* Create a string representation of the given tree map. This allows us
* to rapidly determine whether a tree has undergone a significant
* structural change.
*/
getFingerprint: function getFingerprint(tree) {
return tree.map(function (leafSet) {
var decoratorKey = leafSet.get('decoratorKey');
var fingerprintString = decoratorKey !== null ? decoratorKey + '.' + (leafSet.get('end') - leafSet.get('start')) : '';
return '' + fingerprintString + '.' + leafSet.get('leaves').size;
}).join(FINGERPRINT_DELIMITER);
}
};
/**
* Generate LeafRange records for a given character list.
*/
function generateLeaves(characters, offset) {
var leaves = [];
var inlineStyles = characters.map(function (c) {
return c.getStyle();
}).toList();
findRangesImmutable(inlineStyles, areEqual, returnTrue, function (start, end) {
leaves.push(new LeafRange({
start: start + offset,
end: end + offset
}));
});
return List(leaves);
}
function areEqual(a, b) {
return a === b;
}
module.exports = BlockTree;
/***/ },
/* 1115 */
/*!****************************************!*\
!*** ./~/draft-js/lib/ContentState.js ***!
\****************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule ContentState
* @typechecks
*
*/
'use strict';
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 BlockMapBuilder = __webpack_require__(/*! ./BlockMapBuilder */ 1090);
var CharacterMetadata = __webpack_require__(/*! ./CharacterMetadata */ 1092);
var ContentBlock = __webpack_require__(/*! ./ContentBlock */ 1093);
var Immutable = __webpack_require__(/*! immutable */ 1091);
var SelectionState = __webpack_require__(/*! ./SelectionState */ 1116);
var generateRandomKey = __webpack_require__(/*! ./generateRandomKey */ 1105);
var sanitizeDraftText = __webpack_require__(/*! ./sanitizeDraftText */ 1117);
var List = Immutable.List;
var Record = Immutable.Record;
var Repeat = Immutable.Repeat;
var defaultRecord = {
blockMap: null,
selectionBefore: null,
selectionAfter: null
};
var ContentStateRecord = Record(defaultRecord);
var ContentState = function (_ContentStateRecord) {
_inherits(ContentState, _ContentStateRecord);
function ContentState() {
_classCallCheck(this, ContentState);
return _possibleConstructorReturn(this, _ContentStateRecord.apply(this, arguments));
}
ContentState.prototype.getBlockMap = function getBlockMap() {
return this.get('blockMap');
};
ContentState.prototype.getSelectionBefore = function getSelectionBefore() {
return this.get('selectionBefore');
};
ContentState.prototype.getSelectionAfter = function getSelectionAfter() {
return this.get('selectionAfter');
};
ContentState.prototype.getBlockForKey = function getBlockForKey(key) {
var block = this.getBlockMap().get(key);
return block;
};
ContentState.prototype.getKeyBefore = function getKeyBefore(key) {
return this.getBlockMap().reverse().keySeq().skipUntil(function (v) {
return v === key;
}).skip(1).first();
};
ContentState.prototype.getKeyAfter = function getKeyAfter(key) {
return this.getBlockMap().keySeq().skipUntil(function (v) {
return v === key;
}).skip(1).first();
};
ContentState.prototype.getBlockAfter = function getBlockAfter(key) {
return this.getBlockMap().skipUntil(function (_, k) {
return k === key;
}).skip(1).first();
};
ContentState.prototype.getBlockBefore = function getBlockBefore(key) {
return this.getBlockMap().reverse().skipUntil(function (_, k) {
return k === key;
}).skip(1).first();
};
ContentState.prototype.getBlocksAsArray = function getBlocksAsArray() {
return this.getBlockMap().toArray();
};
ContentState.prototype.getFirstBlock = function getFirstBlock() {
return this.getBlockMap().first();
};
ContentState.prototype.getLastBlock = function getLastBlock() {
return this.getBlockMap().last();
};
ContentState.prototype.getPlainText = function getPlainText(delimiter) {
return this.getBlockMap().map(function (block) {
return block ? block.getText() : '';
}).join(delimiter || '\n');
};
ContentState.prototype.hasText = function hasText() {
var blockMap = this.getBlockMap();
return blockMap.size > 1 || blockMap.first().getLength() > 0;
};
ContentState.createFromBlockArray = function createFromBlockArray(blocks) {
var blockMap = BlockMapBuilder.createFromArray(blocks);
var selectionState = SelectionState.createEmpty(blockMap.first().getKey());
return new ContentState({
blockMap: blockMap,
selectionBefore: selectionState,
selectionAfter: selectionState
});
};
ContentState.createFromText = function createFromText(text) {
var delimiter = arguments.length <= 1 || arguments[1] === undefined ? /\r\n?|\n/g : arguments[1];
var strings = text.split(delimiter);
var blocks = strings.map(function (block) {
block = sanitizeDraftText(block);
return new ContentBlock({
key: generateRandomKey(),
text: block,
type: 'unstyled',
characterList: List(Repeat(CharacterMetadata.EMPTY, block.length))
});
});
return ContentState.createFromBlockArray(blocks);
};
return ContentState;
}(ContentStateRecord);
module.exports = ContentState;
/***/ },
/* 1116 */
/*!******************************************!*\
!*** ./~/draft-js/lib/SelectionState.js ***!
\******************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule SelectionState
* @typechecks
*
*/
'use strict';
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 Immutable = __webpack_require__(/*! immutable */ 1091);
var Record = Immutable.Record;
var defaultRecord = {
anchorKey: '',
anchorOffset: 0,
focusKey: '',
focusOffset: 0,
isBackward: false,
hasFocus: false
};
var SelectionStateRecord = Record(defaultRecord);
var SelectionState = function (_SelectionStateRecord) {
_inherits(SelectionState, _SelectionStateRecord);
function SelectionState() {
_classCallCheck(this, SelectionState);
return _possibleConstructorReturn(this, _SelectionStateRecord.apply(this, arguments));
}
SelectionState.prototype.serialize = function serialize() {
return 'Anchor: ' + this.getAnchorKey() + ':' + this.getAnchorOffset() + ', ' + 'Focus: ' + this.getFocusKey() + ':' + this.getFocusOffset() + ', ' + 'Is Backward: ' + String(this.getIsBackward()) + ', ' + 'Has Focus: ' + String(this.getHasFocus());
};
SelectionState.prototype.getAnchorKey = function getAnchorKey() {
return this.get('anchorKey');
};
SelectionState.prototype.getAnchorOffset = function getAnchorOffset() {
return this.get('anchorOffset');
};
SelectionState.prototype.getFocusKey = function getFocusKey() {
return this.get('focusKey');
};
SelectionState.prototype.getFocusOffset = function getFocusOffset() {
return this.get('focusOffset');
};
SelectionState.prototype.getIsBackward = function getIsBackward() {
return this.get('isBackward');
};
SelectionState.prototype.getHasFocus = function getHasFocus() {
return this.get('hasFocus');
};
/**
* Return whether the specified range overlaps with an edge of the
* SelectionState.
*/
SelectionState.prototype.hasEdgeWithin = function hasEdgeWithin(blockKey, start, end) {
var anchorKey = this.getAnchorKey();
var focusKey = this.getFocusKey();
if (anchorKey === focusKey && anchorKey === blockKey) {
var selectionStart = this.getStartOffset();
var selectionEnd = this.getEndOffset();
return start <= selectionEnd && selectionStart <= end;
}
if (blockKey !== anchorKey && blockKey !== focusKey) {
return false;
}
var offsetToCheck = blockKey === anchorKey ? this.getAnchorOffset() : this.getFocusOffset();
return start <= offsetToCheck && end >= offsetToCheck;
};
SelectionState.prototype.isCollapsed = function isCollapsed() {
return this.getAnchorKey() === this.getFocusKey() && this.getAnchorOffset() === this.getFocusOffset();
};
SelectionState.prototype.getStartKey = function getStartKey() {
return this.getIsBackward() ? this.getFocusKey() : this.getAnchorKey();
};
SelectionState.prototype.getStartOffset = function getStartOffset() {
return this.getIsBackward() ? this.getFocusOffset() : this.getAnchorOffset();
};
SelectionState.prototype.getEndKey = function getEndKey() {
return this.getIsBackward() ? this.getAnchorKey() : this.getFocusKey();
};
SelectionState.prototype.getEndOffset = function getEndOffset() {
return this.getIsBackward() ? this.getAnchorOffset() : this.getFocusOffset();
};
SelectionState.createEmpty = function createEmpty(key) {
return new SelectionState({
anchorKey: key,
anchorOffset: 0,
focusKey: key,
focusOffset: 0,
isBackward: false,
hasFocus: false
});
};
return SelectionState;
}(SelectionStateRecord);
module.exports = SelectionState;
/***/ },
/* 1117 */
/*!*********************************************!*\
!*** ./~/draft-js/lib/sanitizeDraftText.js ***!
\*********************************************/
/***/ function(module, exports) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule sanitizeDraftText
*
*/
'use strict';
var REGEX_BLOCK_DELIMITER = new RegExp('\r', 'g');
function sanitizeDraftText(input) {
return input.replace(REGEX_BLOCK_DELIMITER, '');
}
module.exports = sanitizeDraftText;
/***/ },
/* 1118 */
/*!*********************************************!*\
!*** ./~/draft-js/lib/EditorBidiService.js ***!
\*********************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule EditorBidiService
* @typechecks
*
*/
'use strict';
var Immutable = __webpack_require__(/*! immutable */ 1091);
var UnicodeBidiService = __webpack_require__(/*! fbjs/lib/UnicodeBidiService */ 1119);
var nullthrows = __webpack_require__(/*! fbjs/lib/nullthrows */ 1122);
var OrderedMap = Immutable.OrderedMap;
var bidiService;
var EditorBidiService = {
getDirectionMap: function getDirectionMap(content, prevBidiMap) {
if (!bidiService) {
bidiService = new UnicodeBidiService();
} else {
bidiService.reset();
}
var blockMap = content.getBlockMap();
var nextBidi = blockMap.valueSeq().map(function (block) {
return nullthrows(bidiService).getDirection(block.getText());
});
var bidiMap = OrderedMap(blockMap.keySeq().zip(nextBidi));
if (prevBidiMap != null && Immutable.is(prevBidiMap, bidiMap)) {
return prevBidiMap;
}
return bidiMap;
}
};
module.exports = EditorBidiService;
/***/ },
/* 1119 */
/*!******************************************!*\
!*** ./~/fbjs/lib/UnicodeBidiService.js ***!
\******************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @typechecks
*
*/
/**
* Stateful API for text direction detection
*
* This class can be used in applications where you need to detect the
* direction of a sequence of text blocks, where each direction shall be used
* as the fallback direction for the next one.
*
* NOTE: A default direction, if not provided, is set based on the global
* direction, as defined by `UnicodeBidiDirection`.
*
* == Example ==
* ```
* var UnicodeBidiService = require('UnicodeBidiService');
*
* var bidiService = new UnicodeBidiService();
*
* ...
*
* bidiService.reset();
* for (var para in paragraphs) {
* var dir = bidiService.getDirection(para);
* ...
* }
* ```
*
* Part of our implementation of Unicode Bidirectional Algorithm (UBA)
* Unicode Standard Annex #9 (UAX9)
* http://www.unicode.org/reports/tr9/
*/
'use strict';
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var UnicodeBidi = __webpack_require__(/*! ./UnicodeBidi */ 1120);
var UnicodeBidiDirection = __webpack_require__(/*! ./UnicodeBidiDirection */ 1121);
var invariant = __webpack_require__(/*! ./invariant */ 9);
var UnicodeBidiService = function () {
/**
* Stateful class for paragraph direction detection
*
* @param defaultDir Default direction of the service
*/
function UnicodeBidiService(defaultDir) {
_classCallCheck(this, UnicodeBidiService);
if (!defaultDir) {
defaultDir = UnicodeBidiDirection.getGlobalDir();
} else {
!UnicodeBidiDirection.isStrong(defaultDir) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Default direction must be a strong direction (LTR or RTL)') : invariant(false) : void 0;
}
this._defaultDir = defaultDir;
this.reset();
}
/**
* Reset the internal state
*
* Instead of creating a new instance, you can just reset() your instance
* everytime you start a new loop.
*/
UnicodeBidiService.prototype.reset = function reset() {
this._lastDir = this._defaultDir;
};
/**
* Returns the direction of a block of text, and remembers it as the
* fall-back direction for the next paragraph.
*
* @param str A text block, e.g. paragraph, table cell, tag
* @return The resolved direction
*/
UnicodeBidiService.prototype.getDirection = function getDirection(str) {
this._lastDir = UnicodeBidi.getDirection(str, this._lastDir);
return this._lastDir;
};
return UnicodeBidiService;
}();
module.exports = UnicodeBidiService;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 1120 */
/*!***********************************!*\
!*** ./~/fbjs/lib/UnicodeBidi.js ***!
\***********************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @typechecks
*
*/
/**
* Basic (stateless) API for text direction detection
*
* Part of our implementation of Unicode Bidirectional Algorithm (UBA)
* Unicode Standard Annex #9 (UAX9)
* http://www.unicode.org/reports/tr9/
*/
'use strict';
var UnicodeBidiDirection = __webpack_require__(/*! ./UnicodeBidiDirection */ 1121);
var invariant = __webpack_require__(/*! ./invariant */ 9);
/**
* RegExp ranges of characters with a *Strong* Bidi_Class value.
*
* Data is based on DerivedBidiClass.txt in UCD version 7.0.0.
*
* NOTE: For performance reasons, we only support Unicode's
* Basic Multilingual Plane (BMP) for now.
*/
var RANGE_BY_BIDI_TYPE = {
L: 'A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u01BA\u01BB' + '\u01BC-\u01BF\u01C0-\u01C3\u01C4-\u0293\u0294\u0295-\u02AF\u02B0-\u02B8' + '\u02BB-\u02C1\u02D0-\u02D1\u02E0-\u02E4\u02EE\u0370-\u0373\u0376-\u0377' + '\u037A\u037B-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1' + '\u03A3-\u03F5\u03F7-\u0481\u0482\u048A-\u052F\u0531-\u0556\u0559' + '\u055A-\u055F\u0561-\u0587\u0589\u0903\u0904-\u0939\u093B\u093D' + '\u093E-\u0940\u0949-\u094C\u094E-\u094F\u0950\u0958-\u0961\u0964-\u0965' + '\u0966-\u096F\u0970\u0971\u0972-\u0980\u0982-\u0983\u0985-\u098C' + '\u098F-\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD' + '\u09BE-\u09C0\u09C7-\u09C8\u09CB-\u09CC\u09CE\u09D7\u09DC-\u09DD' + '\u09DF-\u09E1\u09E6-\u09EF\u09F0-\u09F1\u09F4-\u09F9\u09FA\u0A03' + '\u0A05-\u0A0A\u0A0F-\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32-\u0A33' + '\u0A35-\u0A36\u0A38-\u0A39\u0A3E-\u0A40\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F' + '\u0A72-\u0A74\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0' + '\u0AB2-\u0AB3\u0AB5-\u0AB9\u0ABD\u0ABE-\u0AC0\u0AC9\u0ACB-\u0ACC\u0AD0' + '\u0AE0-\u0AE1\u0AE6-\u0AEF\u0AF0\u0B02-\u0B03\u0B05-\u0B0C\u0B0F-\u0B10' + '\u0B13-\u0B28\u0B2A-\u0B30\u0B32-\u0B33\u0B35-\u0B39\u0B3D\u0B3E\u0B40' + '\u0B47-\u0B48\u0B4B-\u0B4C\u0B57\u0B5C-\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F' + '\u0B70\u0B71\u0B72-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95' + '\u0B99-\u0B9A\u0B9C\u0B9E-\u0B9F\u0BA3-\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9' + '\u0BBE-\u0BBF\u0BC1-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD0\u0BD7' + '\u0BE6-\u0BEF\u0BF0-\u0BF2\u0C01-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10' + '\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C41-\u0C44\u0C58-\u0C59\u0C60-\u0C61' + '\u0C66-\u0C6F\u0C7F\u0C82-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8' + '\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CBE\u0CBF\u0CC0-\u0CC4\u0CC6' + '\u0CC7-\u0CC8\u0CCA-\u0CCB\u0CD5-\u0CD6\u0CDE\u0CE0-\u0CE1\u0CE6-\u0CEF' + '\u0CF1-\u0CF2\u0D02-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D' + '\u0D3E-\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D4E\u0D57\u0D60-\u0D61' + '\u0D66-\u0D6F\u0D70-\u0D75\u0D79\u0D7A-\u0D7F\u0D82-\u0D83\u0D85-\u0D96' + '\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCF-\u0DD1\u0DD8-\u0DDF' + '\u0DE6-\u0DEF\u0DF2-\u0DF3\u0DF4\u0E01-\u0E30\u0E32-\u0E33\u0E40-\u0E45' + '\u0E46\u0E4F\u0E50-\u0E59\u0E5A-\u0E5B\u0E81-\u0E82\u0E84\u0E87-\u0E88' + '\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7' + '\u0EAA-\u0EAB\u0EAD-\u0EB0\u0EB2-\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6' + '\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F01-\u0F03\u0F04-\u0F12\u0F13\u0F14' + '\u0F15-\u0F17\u0F1A-\u0F1F\u0F20-\u0F29\u0F2A-\u0F33\u0F34\u0F36\u0F38' + '\u0F3E-\u0F3F\u0F40-\u0F47\u0F49-\u0F6C\u0F7F\u0F85\u0F88-\u0F8C' + '\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FCF\u0FD0-\u0FD4\u0FD5-\u0FD8' + '\u0FD9-\u0FDA\u1000-\u102A\u102B-\u102C\u1031\u1038\u103B-\u103C\u103F' + '\u1040-\u1049\u104A-\u104F\u1050-\u1055\u1056-\u1057\u105A-\u105D\u1061' + '\u1062-\u1064\u1065-\u1066\u1067-\u106D\u106E-\u1070\u1075-\u1081' + '\u1083-\u1084\u1087-\u108C\u108E\u108F\u1090-\u1099\u109A-\u109C' + '\u109E-\u109F\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FB\u10FC' + '\u10FD-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288' + '\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5' + '\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1360-\u1368' + '\u1369-\u137C\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166D-\u166E' + '\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EB-\u16ED\u16EE-\u16F0' + '\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1735-\u1736' + '\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17B6\u17BE-\u17C5' + '\u17C7-\u17C8\u17D4-\u17D6\u17D7\u17D8-\u17DA\u17DC\u17E0-\u17E9' + '\u1810-\u1819\u1820-\u1842\u1843\u1844-\u1877\u1880-\u18A8\u18AA' + '\u18B0-\u18F5\u1900-\u191E\u1923-\u1926\u1929-\u192B\u1930-\u1931' + '\u1933-\u1938\u1946-\u194F\u1950-\u196D\u1970-\u1974\u1980-\u19AB' + '\u19B0-\u19C0\u19C1-\u19C7\u19C8-\u19C9\u19D0-\u19D9\u19DA\u1A00-\u1A16' + '\u1A19-\u1A1A\u1A1E-\u1A1F\u1A20-\u1A54\u1A55\u1A57\u1A61\u1A63-\u1A64' + '\u1A6D-\u1A72\u1A80-\u1A89\u1A90-\u1A99\u1AA0-\u1AA6\u1AA7\u1AA8-\u1AAD' + '\u1B04\u1B05-\u1B33\u1B35\u1B3B\u1B3D-\u1B41\u1B43-\u1B44\u1B45-\u1B4B' + '\u1B50-\u1B59\u1B5A-\u1B60\u1B61-\u1B6A\u1B74-\u1B7C\u1B82\u1B83-\u1BA0' + '\u1BA1\u1BA6-\u1BA7\u1BAA\u1BAE-\u1BAF\u1BB0-\u1BB9\u1BBA-\u1BE5\u1BE7' + '\u1BEA-\u1BEC\u1BEE\u1BF2-\u1BF3\u1BFC-\u1BFF\u1C00-\u1C23\u1C24-\u1C2B' + '\u1C34-\u1C35\u1C3B-\u1C3F\u1C40-\u1C49\u1C4D-\u1C4F\u1C50-\u1C59' + '\u1C5A-\u1C77\u1C78-\u1C7D\u1C7E-\u1C7F\u1CC0-\u1CC7\u1CD3\u1CE1' + '\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF2-\u1CF3\u1CF5-\u1CF6\u1D00-\u1D2B' + '\u1D2C-\u1D6A\u1D6B-\u1D77\u1D78\u1D79-\u1D9A\u1D9B-\u1DBF\u1E00-\u1F15' + '\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D' + '\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC' + '\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200E' + '\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D' + '\u2124\u2126\u2128\u212A-\u212D\u212F-\u2134\u2135-\u2138\u2139' + '\u213C-\u213F\u2145-\u2149\u214E\u214F\u2160-\u2182\u2183-\u2184' + '\u2185-\u2188\u2336-\u237A\u2395\u249C-\u24E9\u26AC\u2800-\u28FF' + '\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2C7B\u2C7C-\u2C7D\u2C7E-\u2CE4' + '\u2CEB-\u2CEE\u2CF2-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F' + '\u2D70\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE' + '\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005\u3006\u3007' + '\u3021-\u3029\u302E-\u302F\u3031-\u3035\u3038-\u303A\u303B\u303C' + '\u3041-\u3096\u309D-\u309E\u309F\u30A1-\u30FA\u30FC-\u30FE\u30FF' + '\u3105-\u312D\u3131-\u318E\u3190-\u3191\u3192-\u3195\u3196-\u319F' + '\u31A0-\u31BA\u31F0-\u31FF\u3200-\u321C\u3220-\u3229\u322A-\u3247' + '\u3248-\u324F\u3260-\u327B\u327F\u3280-\u3289\u328A-\u32B0\u32C0-\u32CB' + '\u32D0-\u32FE\u3300-\u3376\u337B-\u33DD\u33E0-\u33FE\u3400-\u4DB5' + '\u4E00-\u9FCC\uA000-\uA014\uA015\uA016-\uA48C\uA4D0-\uA4F7\uA4F8-\uA4FD' + '\uA4FE-\uA4FF\uA500-\uA60B\uA60C\uA610-\uA61F\uA620-\uA629\uA62A-\uA62B' + '\uA640-\uA66D\uA66E\uA680-\uA69B\uA69C-\uA69D\uA6A0-\uA6E5\uA6E6-\uA6EF' + '\uA6F2-\uA6F7\uA722-\uA76F\uA770\uA771-\uA787\uA789-\uA78A\uA78B-\uA78E' + '\uA790-\uA7AD\uA7B0-\uA7B1\uA7F7\uA7F8-\uA7F9\uA7FA\uA7FB-\uA801' + '\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA823-\uA824\uA827\uA830-\uA835' + '\uA836-\uA837\uA840-\uA873\uA880-\uA881\uA882-\uA8B3\uA8B4-\uA8C3' + '\uA8CE-\uA8CF\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8F8-\uA8FA\uA8FB\uA900-\uA909' + '\uA90A-\uA925\uA92E-\uA92F\uA930-\uA946\uA952-\uA953\uA95F\uA960-\uA97C' + '\uA983\uA984-\uA9B2\uA9B4-\uA9B5\uA9BA-\uA9BB\uA9BD-\uA9C0\uA9C1-\uA9CD' + '\uA9CF\uA9D0-\uA9D9\uA9DE-\uA9DF\uA9E0-\uA9E4\uA9E6\uA9E7-\uA9EF' + '\uA9F0-\uA9F9\uA9FA-\uA9FE\uAA00-\uAA28\uAA2F-\uAA30\uAA33-\uAA34' + '\uAA40-\uAA42\uAA44-\uAA4B\uAA4D\uAA50-\uAA59\uAA5C-\uAA5F\uAA60-\uAA6F' + '\uAA70\uAA71-\uAA76\uAA77-\uAA79\uAA7A\uAA7B\uAA7D\uAA7E-\uAAAF\uAAB1' + '\uAAB5-\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADC\uAADD\uAADE-\uAADF' + '\uAAE0-\uAAEA\uAAEB\uAAEE-\uAAEF\uAAF0-\uAAF1\uAAF2\uAAF3-\uAAF4\uAAF5' + '\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E' + '\uAB30-\uAB5A\uAB5B\uAB5C-\uAB5F\uAB64-\uAB65\uABC0-\uABE2\uABE3-\uABE4' + '\uABE6-\uABE7\uABE9-\uABEA\uABEB\uABEC\uABF0-\uABF9\uAC00-\uD7A3' + '\uD7B0-\uD7C6\uD7CB-\uD7FB\uE000-\uF8FF\uF900-\uFA6D\uFA70-\uFAD9' + '\uFB00-\uFB06\uFB13-\uFB17\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFF6F\uFF70' + '\uFF71-\uFF9D\uFF9E-\uFF9F\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF' + '\uFFD2-\uFFD7\uFFDA-\uFFDC',
R: '\u0590\u05BE\u05C0\u05C3\u05C6\u05C8-\u05CF\u05D0-\u05EA\u05EB-\u05EF' + '\u05F0-\u05F2\u05F3-\u05F4\u05F5-\u05FF\u07C0-\u07C9\u07CA-\u07EA' + '\u07F4-\u07F5\u07FA\u07FB-\u07FF\u0800-\u0815\u081A\u0824\u0828' + '\u082E-\u082F\u0830-\u083E\u083F\u0840-\u0858\u085C-\u085D\u085E' + '\u085F-\u089F\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB37\uFB38-\uFB3C' + '\uFB3D\uFB3E\uFB3F\uFB40-\uFB41\uFB42\uFB43-\uFB44\uFB45\uFB46-\uFB4F',
AL: '\u0608\u060B\u060D\u061B\u061C\u061D\u061E-\u061F\u0620-\u063F\u0640' + '\u0641-\u064A\u066D\u066E-\u066F\u0671-\u06D3\u06D4\u06D5\u06E5-\u06E6' + '\u06EE-\u06EF\u06FA-\u06FC\u06FD-\u06FE\u06FF\u0700-\u070D\u070E\u070F' + '\u0710\u0712-\u072F\u074B-\u074C\u074D-\u07A5\u07B1\u07B2-\u07BF' + '\u08A0-\u08B2\u08B3-\u08E3\uFB50-\uFBB1\uFBB2-\uFBC1\uFBC2-\uFBD2' + '\uFBD3-\uFD3D\uFD40-\uFD4F\uFD50-\uFD8F\uFD90-\uFD91\uFD92-\uFDC7' + '\uFDC8-\uFDCF\uFDF0-\uFDFB\uFDFC\uFDFE-\uFDFF\uFE70-\uFE74\uFE75' + '\uFE76-\uFEFC\uFEFD-\uFEFE'
};
var REGEX_STRONG = new RegExp('[' + RANGE_BY_BIDI_TYPE.L + RANGE_BY_BIDI_TYPE.R + RANGE_BY_BIDI_TYPE.AL + ']');
var REGEX_RTL = new RegExp('[' + RANGE_BY_BIDI_TYPE.R + RANGE_BY_BIDI_TYPE.AL + ']');
/**
* Returns the first strong character (has Bidi_Class value of L, R, or AL).
*
* @param str A text block; e.g. paragraph, table cell, tag
* @return A character with strong bidi direction, or null if not found
*/
function firstStrongChar(str) {
var match = REGEX_STRONG.exec(str);
return match == null ? null : match[0];
}
/**
* Returns the direction of a block of text, based on the direction of its
* first strong character (has Bidi_Class value of L, R, or AL).
*
* @param str A text block; e.g. paragraph, table cell, tag
* @return The resolved direction
*/
function firstStrongCharDir(str) {
var strongChar = firstStrongChar(str);
if (strongChar == null) {
return UnicodeBidiDirection.NEUTRAL;
}
return REGEX_RTL.exec(strongChar) ? UnicodeBidiDirection.RTL : UnicodeBidiDirection.LTR;
}
/**
* Returns the direction of a block of text, based on the direction of its
* first strong character (has Bidi_Class value of L, R, or AL), or a fallback
* direction, if no strong character is found.
*
* This function is supposed to be used in respect to Higher-Level Protocol
* rule HL1. (http://www.unicode.org/reports/tr9/#HL1)
*
* @param str A text block; e.g. paragraph, table cell, tag
* @param fallback Fallback direction, used if no strong direction detected
* for the block (default = NEUTRAL)
* @return The resolved direction
*/
function resolveBlockDir(str, fallback) {
fallback = fallback || UnicodeBidiDirection.NEUTRAL;
if (!str.length) {
return fallback;
}
var blockDir = firstStrongCharDir(str);
return blockDir === UnicodeBidiDirection.NEUTRAL ? fallback : blockDir;
}
/**
* Returns the direction of a block of text, based on the direction of its
* first strong character (has Bidi_Class value of L, R, or AL), or a fallback
* direction, if no strong character is found.
*
* NOTE: This function is similar to resolveBlockDir(), but uses the global
* direction as the fallback, so it *always* returns a Strong direction,
* making it useful for integration in places that you need to make the final
* decision, like setting some CSS class.
*
* This function is supposed to be used in respect to Higher-Level Protocol
* rule HL1. (http://www.unicode.org/reports/tr9/#HL1)
*
* @param str A text block; e.g. paragraph, table cell
* @param strongFallback Fallback direction, used if no strong direction
* detected for the block (default = global direction)
* @return The resolved Strong direction
*/
function getDirection(str, strongFallback) {
if (!strongFallback) {
strongFallback = UnicodeBidiDirection.getGlobalDir();
}
!UnicodeBidiDirection.isStrong(strongFallback) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Fallback direction must be a strong direction') : invariant(false) : void 0;
return resolveBlockDir(str, strongFallback);
}
/**
* Returns true if getDirection(arguments...) returns LTR.
*
* @param str A text block; e.g. paragraph, table cell
* @param strongFallback Fallback direction, used if no strong direction
* detected for the block (default = global direction)
* @return True if the resolved direction is LTR
*/
function isDirectionLTR(str, strongFallback) {
return getDirection(str, strongFallback) === UnicodeBidiDirection.LTR;
}
/**
* Returns true if getDirection(arguments...) returns RTL.
*
* @param str A text block; e.g. paragraph, table cell
* @param strongFallback Fallback direction, used if no strong direction
* detected for the block (default = global direction)
* @return True if the resolved direction is RTL
*/
function isDirectionRTL(str, strongFallback) {
return getDirection(str, strongFallback) === UnicodeBidiDirection.RTL;
}
var UnicodeBidi = {
firstStrongChar: firstStrongChar,
firstStrongCharDir: firstStrongCharDir,
resolveBlockDir: resolveBlockDir,
getDirection: getDirection,
isDirectionLTR: isDirectionLTR,
isDirectionRTL: isDirectionRTL
};
module.exports = UnicodeBidi;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 1121 */
/*!********************************************!*\
!*** ./~/fbjs/lib/UnicodeBidiDirection.js ***!
\********************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @typechecks
*
*/
/**
* Constants to represent text directionality
*
* Also defines a *global* direciton, to be used in bidi algorithms as a
* default fallback direciton, when no better direction is found or provided.
*
* NOTE: Use `setGlobalDir()`, or update `initGlobalDir()`, to set the initial
* global direction value based on the application.
*
* Part of the implementation of Unicode Bidirectional Algorithm (UBA)
* Unicode Standard Annex #9 (UAX9)
* http://www.unicode.org/reports/tr9/
*/
'use strict';
var invariant = __webpack_require__(/*! ./invariant */ 9);
var NEUTRAL = 'NEUTRAL'; // No strong direction
var LTR = 'LTR'; // Left-to-Right direction
var RTL = 'RTL'; // Right-to-Left direction
var globalDir = null;
// == Helpers ==
/**
* Check if a directionality value is a Strong one
*/
function isStrong(dir) {
return dir === LTR || dir === RTL;
}
/**
* Get string value to be used for `dir` HTML attribute or `direction` CSS
* property.
*/
function getHTMLDir(dir) {
!isStrong(dir) ? process.env.NODE_ENV !== 'production' ? invariant(false, '`dir` must be a strong direction to be converted to HTML Direction') : invariant(false) : void 0;
return dir === LTR ? 'ltr' : 'rtl';
}
/**
* Get string value to be used for `dir` HTML attribute or `direction` CSS
* property, but returns null if `dir` has same value as `otherDir`.
* `null`.
*/
function getHTMLDirIfDifferent(dir, otherDir) {
!isStrong(dir) ? process.env.NODE_ENV !== 'production' ? invariant(false, '`dir` must be a strong direction to be converted to HTML Direction') : invariant(false) : void 0;
!isStrong(otherDir) ? process.env.NODE_ENV !== 'production' ? invariant(false, '`otherDir` must be a strong direction to be converted to HTML Direction') : invariant(false) : void 0;
return dir === otherDir ? null : getHTMLDir(dir);
}
// == Global Direction ==
/**
* Set the global direction.
*/
function setGlobalDir(dir) {
globalDir = dir;
}
/**
* Initialize the global direction
*/
function initGlobalDir() {
setGlobalDir(LTR);
}
/**
* Get the global direction
*/
function getGlobalDir() {
if (!globalDir) {
this.initGlobalDir();
}
!globalDir ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Global direction not set.') : invariant(false) : void 0;
return globalDir;
}
var UnicodeBidiDirection = {
// Values
NEUTRAL: NEUTRAL,
LTR: LTR,
RTL: RTL,
// Helpers
isStrong: isStrong,
getHTMLDir: getHTMLDir,
getHTMLDirIfDifferent: getHTMLDirIfDifferent,
// Global Direction
setGlobalDir: setGlobalDir,
initGlobalDir: initGlobalDir,
getGlobalDir: getGlobalDir
};
module.exports = UnicodeBidiDirection;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 1122 */
/*!**********************************!*\
!*** ./~/fbjs/lib/nullthrows.js ***!
\**********************************/
/***/ function(module, exports) {
"use strict";
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
var nullthrows = function nullthrows(x) {
if (x != null) {
return x;
}
throw new Error("Got unexpected null or undefined");
};
module.exports = nullthrows;
/***/ },
/* 1123 */
/*!***************************************************!*\
!*** ./~/draft-js/lib/CompositeDraftDecorator.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule CompositeDraftDecorator
* @typechecks
*
*/
'use strict';
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var Immutable = __webpack_require__(/*! immutable */ 1091);
var List = Immutable.List;
var DELIMITER = '.';
/**
* A CompositeDraftDecorator traverses through a list of DraftDecorator
* instances to identify sections of a ContentBlock that should be rendered
* in a "decorated" manner. For example, hashtags, mentions, and links may
* be intended to stand out visually, be rendered as anchors, etc.
*
* The list of decorators supplied to the constructor will be used in the
* order they are provided. This allows the caller to specify a priority for
* string matching, in case of match collisions among decorators.
*
* For instance, I may have a link with a `#` in its text. Though this section
* of text may match our hashtag decorator, it should not be treated as a
* hashtag. I should therefore list my link DraftDecorator
* before my hashtag DraftDecorator when constructing this composite
* decorator instance.
*
* Thus, when a collision like this is encountered, the earlier match is
* preserved and the new match is discarded.
*/
var CompositeDraftDecorator = function () {
function CompositeDraftDecorator(decorators) {
_classCallCheck(this, CompositeDraftDecorator);
// Copy the decorator array, since we use this array order to determine
// precedence of decoration matching. If the array is mutated externally,
// we don't want to be affected here.
this._decorators = decorators.slice();
}
CompositeDraftDecorator.prototype.getDecorations = function getDecorations(block) {
var decorations = Array(block.getText().length).fill(null);
this._decorators.forEach(function ( /*object*/decorator, /*number*/ii) {
var counter = 0;
var strategy = decorator.strategy;
strategy(block, function ( /*number*/start, /*number*/end) {
// Find out if any of our matching range is already occupied
// by another decorator. If so, discard the match. Otherwise, store
// the component key for rendering.
if (canOccupySlice(decorations, start, end)) {
occupySlice(decorations, start, end, ii + DELIMITER + counter);
counter++;
}
});
});
return List(decorations);
};
CompositeDraftDecorator.prototype.getComponentForKey = function getComponentForKey(key) {
var componentKey = parseInt(key.split(DELIMITER)[0], 10);
return this._decorators[componentKey].component;
};
CompositeDraftDecorator.prototype.getPropsForKey = function getPropsForKey(key) {
var componentKey = parseInt(key.split(DELIMITER)[0], 10);
return this._decorators[componentKey].props;
};
return CompositeDraftDecorator;
}();
/**
* Determine whether we can occupy the specified slice of the decorations
* array.
*/
function canOccupySlice(decorations, start, end) {
for (var ii = start; ii < end; ii++) {
if (decorations[ii] != null) {
return false;
}
}
return true;
}
/**
* Splice the specified component into our decoration array at the desired
* range.
*/
function occupySlice(targetArr, start, end, componentKey) {
for (var ii = start; ii < end; ii++) {
targetArr[ii] = componentKey;
}
}
module.exports = CompositeDraftDecorator;
/***/ },
/* 1124 */
/*!******************************************************!*\
!*** ./~/draft-js/lib/DefaultDraftBlockRenderMap.js ***!
\******************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule DefaultDraftBlockRenderMap
*
*/
'use strict';
var _require = __webpack_require__(/*! immutable */ 1091);
var Map = _require.Map;
var React = __webpack_require__(/*! react */ 2);
var cx = __webpack_require__(/*! fbjs/lib/cx */ 1125);
var UL_WRAP = React.createElement('ul', { className: cx('public/DraftStyleDefault/ul') });
var OL_WRAP = React.createElement('ol', { className: cx('public/DraftStyleDefault/ol') });
var PRE_WRAP = React.createElement('pre', { className: cx('public/DraftStyleDefault/pre') });
module.exports = Map({
'header-one': {
element: 'h1'
},
'header-two': {
element: 'h2'
},
'header-three': {
element: 'h3'
},
'header-four': {
element: 'h4'
},
'header-five': {
element: 'h5'
},
'header-six': {
element: 'h6'
},
'unordered-list-item': {
element: 'li',
wrapper: UL_WRAP
},
'ordered-list-item': {
element: 'li',
wrapper: OL_WRAP
},
'blockquote': {
element: 'blockquote'
},
'atomic': {
element: 'figure'
},
'code-block': {
element: 'pre',
wrapper: PRE_WRAP
},
'unstyled': {
element: 'div'
}
});
/***/ },
/* 1125 */
/*!**************************!*\
!*** ./~/fbjs/lib/cx.js ***!
\**************************/
/***/ function(module, exports) {
'use strict';
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
/**
* This function is used to mark string literals representing CSS class names
* so that they can be transformed statically. This allows for modularization
* and minification of CSS class names.
*
* In static_upstream, this function is actually implemented, but it should
* eventually be replaced with something more descriptive, and the transform
* that is used in the main stack should be ported for use elsewhere.
*
* @param string|object className to modularize, or an object of key/values.
* In the object case, the values are conditions that
* determine if the className keys should be included.
* @param [string ...] Variable list of classNames in the string case.
* @return string Renderable space-separated CSS className.
*/
function cx(classNames) {
if (typeof classNames == 'object') {
return Object.keys(classNames).filter(function (className) {
return classNames[className];
}).map(replace).join(' ');
}
return Array.prototype.map.call(arguments, replace).join(' ');
}
function replace(str) {
return str.replace(/\//g, '-');
}
module.exports = cx;
/***/ },
/* 1126 */
/*!***************************************************!*\
!*** ./~/draft-js/lib/DefaultDraftInlineStyle.js ***!
\***************************************************/
/***/ function(module, exports) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule DefaultDraftInlineStyle
*
*/
'use strict';
module.exports = {
BOLD: {
fontWeight: 'bold'
},
CODE: {
fontFamily: 'monospace',
wordWrap: 'break-word'
},
ITALIC: {
fontStyle: 'italic'
},
STRIKETHROUGH: {
textDecoration: 'line-through'
},
UNDERLINE: {
textDecoration: 'underline'
}
};
/***/ },
/* 1127 */
/*!*********************************************!*\
!*** ./~/draft-js/lib/DraftEditor.react.js ***!
\*********************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule DraftEditor.react
* @typechecks
*
*/
'use strict';
var _assign = __webpack_require__(/*! object-assign */ 5);
var _extends = _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 DefaultDraftBlockRenderMap = __webpack_require__(/*! ./DefaultDraftBlockRenderMap */ 1124);
var DefaultDraftInlineStyle = __webpack_require__(/*! ./DefaultDraftInlineStyle */ 1126);
var DraftEditorCompositionHandler = __webpack_require__(/*! ./DraftEditorCompositionHandler */ 1128);
var DraftEditorContents = __webpack_require__(/*! ./DraftEditorContents.react */ 1132);
var DraftEditorDragHandler = __webpack_require__(/*! ./DraftEditorDragHandler */ 1153);
var DraftEditorEditHandler = __webpack_require__(/*! ./DraftEditorEditHandler */ 1161);
var DraftEditorPlaceholder = __webpack_require__(/*! ./DraftEditorPlaceholder.react */ 1202);
var EditorState = __webpack_require__(/*! ./EditorState */ 1113);
var React = __webpack_require__(/*! react */ 2);
var ReactDOM = __webpack_require__(/*! react-dom */ 33);
var Scroll = __webpack_require__(/*! fbjs/lib/Scroll */ 1144);
var Style = __webpack_require__(/*! fbjs/lib/Style */ 1145);
var UserAgent = __webpack_require__(/*! fbjs/lib/UserAgent */ 1136);
var cx = __webpack_require__(/*! fbjs/lib/cx */ 1125);
var emptyFunction = __webpack_require__(/*! fbjs/lib/emptyFunction */ 13);
var generateRandomKey = __webpack_require__(/*! ./generateRandomKey */ 1105);
var getDefaultKeyBinding = __webpack_require__(/*! ./getDefaultKeyBinding */ 1203);
var nullthrows = __webpack_require__(/*! fbjs/lib/nullthrows */ 1122);
var getScrollPosition = __webpack_require__(/*! fbjs/lib/getScrollPosition */ 1149);
var isIE = UserAgent.isBrowser('IE');
// IE does not support the `input` event on contentEditable, so we can't
// observe spellcheck behavior.
var allowSpellCheck = !isIE;
// Define a set of handler objects to correspond to each possible `mode`
// of editor behavior.
var handlerMap = {
'edit': DraftEditorEditHandler,
'composite': DraftEditorCompositionHandler,
'drag': DraftEditorDragHandler,
'cut': null,
'render': null
};
/**
* `DraftEditor` is the root editor component. It composes a `contentEditable`
* div, and provides a wide variety of useful function props for managing the
* state of the editor. See `DraftEditorProps` for details.
*/
var DraftEditor = function (_React$Component) {
_inherits(DraftEditor, _React$Component);
function DraftEditor(props) {
_classCallCheck(this, DraftEditor);
var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));
_this._blockSelectEvents = false;
_this._clipboard = null;
_this._guardAgainstRender = false;
_this._handler = null;
_this._dragCount = 0;
_this._editorKey = generateRandomKey();
_this._placeholderAccessibilityID = 'placeholder-' + _this._editorKey;
_this._onBeforeInput = _this._buildHandler('onBeforeInput');
_this._onBlur = _this._buildHandler('onBlur');
_this._onCharacterData = _this._buildHandler('onCharacterData');
_this._onCompositionEnd = _this._buildHandler('onCompositionEnd');
_this._onCompositionStart = _this._buildHandler('onCompositionStart');
_this._onCopy = _this._buildHandler('onCopy');
_this._onCut = _this._buildHandler('onCut');
_this._onDragEnd = _this._buildHandler('onDragEnd');
_this._onDragOver = _this._buildHandler('onDragOver');
_this._onDragStart = _this._buildHandler('onDragStart');
_this._onDrop = _this._buildHandler('onDrop');
_this._onInput = _this._buildHandler('onInput');
_this._onFocus = _this._buildHandler('onFocus');
_this._onKeyDown = _this._buildHandler('onKeyDown');
_this._onKeyPress = _this._buildHandler('onKeyPress');
_this._onKeyUp = _this._buildHandler('onKeyUp');
_this._onMouseDown = _this._buildHandler('onMouseDown');
_this._onMouseUp = _this._buildHandler('onMouseUp');
_this._onPaste = _this._buildHandler('onPaste');
_this._onSelect = _this._buildHandler('onSelect');
// Manual binding for public and internal methods.
_this.focus = _this._focus.bind(_this);
_this.blur = _this._blur.bind(_this);
_this.setMode = _this._setMode.bind(_this);
_this.exitCurrentMode = _this._exitCurrentMode.bind(_this);
_this.restoreEditorDOM = _this._restoreEditorDOM.bind(_this);
_this.setRenderGuard = _this._setRenderGuard.bind(_this);
_this.removeRenderGuard = _this._removeRenderGuard.bind(_this);
_this.setClipboard = _this._setClipboard.bind(_this);
_this.getClipboard = _this._getClipboard.bind(_this);
_this.getEditorKey = function () {
return _this._editorKey;
};
_this.update = _this._update.bind(_this);
_this.onDragEnter = _this._onDragEnter.bind(_this);
_this.onDragLeave = _this._onDragLeave.bind(_this);
// See `_restoreEditorDOM()`.
_this.state = { containerKey: 0 };
return _this;
}
/**
* Build a method that will pass the event to the specified handler method.
* This allows us to look up the correct handler function for the current
* editor mode, if any has been specified.
*/
/**
* Define proxies that can route events to the current handler.
*/
DraftEditor.prototype._buildHandler = function _buildHandler(eventName) {
var _this2 = this;
return function (e) {
if (!_this2.props.readOnly) {
var method = _this2._handler && _this2._handler[eventName];
method && method.call(_this2, e);
}
};
};
DraftEditor.prototype._showPlaceholder = function _showPlaceholder() {
return !!this.props.placeholder && !this.props.editorState.isInCompositionMode() && !this.props.editorState.getCurrentContent().hasText();
};
DraftEditor.prototype._renderPlaceholder = function _renderPlaceholder() {
if (this._showPlaceholder()) {
return React.createElement(DraftEditorPlaceholder, {
text: nullthrows(this.props.placeholder),
editorState: this.props.editorState,
textAlignment: this.props.textAlignment,
accessibilityID: this._placeholderAccessibilityID
});
}
return null;
};
DraftEditor.prototype.render = function render() {
var _props = this.props;
var readOnly = _props.readOnly;
var textAlignment = _props.textAlignment;
var rootClass = cx({
'DraftEditor/root': true,
'DraftEditor/alignLeft': textAlignment === 'left',
'DraftEditor/alignRight': textAlignment === 'right',
'DraftEditor/alignCenter': textAlignment === 'center'
});
var contentStyle = {
outline: 'none',
whiteSpace: 'pre-wrap',
wordWrap: 'break-word'
};
return React.createElement(
'div',
{ className: rootClass },
this._renderPlaceholder(),
React.createElement(
'div',
{
className: cx('DraftEditor/editorContainer'),
key: 'editor' + this.state.containerKey,
ref: 'editorContainer' },
React.createElement(
'div',
{
'aria-activedescendant': readOnly ? null : this.props.ariaActiveDescendantID,
'aria-autocomplete': readOnly ? null : this.props.ariaAutoComplete,
'aria-describedby': this._showPlaceholder() ? this._placeholderAccessibilityID : null,
'aria-expanded': readOnly ? null : this.props.ariaExpanded,
'aria-haspopup': readOnly ? null : this.props.ariaHasPopup,
'aria-label': this.props.ariaLabel,
'aria-owns': readOnly ? null : this.props.ariaOwneeID,
className: cx('public/DraftEditor/content'),
contentEditable: !readOnly,
'data-testid': this.props.webDriverTestID,
onBeforeInput: this._onBeforeInput,
onBlur: this._onBlur,
onCompositionEnd: this._onCompositionEnd,
onCompositionStart: this._onCompositionStart,
onCopy: this._onCopy,
onCut: this._onCut,
onDragEnd: this._onDragEnd,
onDragEnter: this.onDragEnter,
onDragLeave: this.onDragLeave,
onDragOver: this._onDragOver,
onDragStart: this._onDragStart,
onDrop: this._onDrop,
onFocus: this._onFocus,
onInput: this._onInput,
onKeyDown: this._onKeyDown,
onKeyPress: this._onKeyPress,
onKeyUp: this._onKeyUp,
onMouseUp: this._onMouseUp,
onPaste: this._onPaste,
onSelect: this._onSelect,
ref: 'editor',
role: readOnly ? null : this.props.role || 'textbox',
spellCheck: allowSpellCheck && this.props.spellCheck,
style: contentStyle,
suppressContentEditableWarning: true,
tabIndex: this.props.tabIndex },
React.createElement(DraftEditorContents, {
blockRenderMap: this.props.blockRenderMap,
blockRendererFn: this.props.blockRendererFn,
blockStyleFn: this.props.blockStyleFn,
customStyleMap: _extends({}, DefaultDraftInlineStyle, this.props.customStyleMap),
customStyleFn: this.props.customStyleFn,
editorKey: this._editorKey,
editorState: this.props.editorState
})
)
)
);
};
DraftEditor.prototype.componentDidMount = function componentDidMount() {
this.setMode('edit');
/**
* IE has a hardcoded "feature" that attempts to convert link text into
* anchors in contentEditable DOM. This breaks the editor's expectations of
* the DOM, and control is lost. Disable it to make IE behave.
* See: http://blogs.msdn.com/b/ieinternals/archive/2010/09/15/
* ie9-beta-minor-change-list.aspx
*/
if (isIE) {
document.execCommand('AutoUrlDetect', false, false);
}
};
/**
* Prevent selection events from affecting the current editor state. This
* is mostly intended to defend against IE, which fires off `selectionchange`
* events regardless of whether the selection is set via the browser or
* programmatically. We only care about selection events that occur because
* of browser interaction, not re-renders and forced selections.
*/
DraftEditor.prototype.componentWillUpdate = function componentWillUpdate() {
this._blockSelectEvents = true;
};
DraftEditor.prototype.componentDidUpdate = function componentDidUpdate() {
this._blockSelectEvents = false;
};
/**
* Used via `this.focus()`.
*
* Force focus back onto the editor node.
*
* Forcing focus causes the browser to scroll to the top of the editor, which
* may be undesirable when the editor is taller than the viewport. To solve
* this, either use a specified scroll position (in cases like `cut` behavior
* where it should be restored to a known position) or store the current
* scroll state and put it back in place after focus has been forced.
*/
DraftEditor.prototype._focus = function _focus(scrollPosition) {
var editorState = this.props.editorState;
var alreadyHasFocus = editorState.getSelection().getHasFocus();
var editorNode = ReactDOM.findDOMNode(this.refs.editor);
var scrollParent = Style.getScrollParent(editorNode);
var _ref = scrollPosition || getScrollPosition(scrollParent);
var x = _ref.x;
var y = _ref.y;
editorNode.focus();
if (scrollParent === window) {
window.scrollTo(x, y);
} else {
Scroll.setTop(scrollParent, y);
}
// On Chrome and Safari, calling focus on contenteditable focuses the
// cursor at the first character. This is something you don't expect when
// you're clicking on an input element but not directly on a character.
// Put the cursor back where it was before the blur.
if (!alreadyHasFocus) {
this.update(EditorState.forceSelection(editorState, editorState.getSelection()));
}
};
DraftEditor.prototype._blur = function _blur() {
ReactDOM.findDOMNode(this.refs.editor).blur();
};
/**
* Used via `this.setMode(...)`.
*
* Set the behavior mode for the editor component. This switches the current
* handler module to ensure that DOM events are managed appropriately for
* the active mode.
*/
DraftEditor.prototype._setMode = function _setMode(mode) {
this._handler = handlerMap[mode];
};
DraftEditor.prototype._exitCurrentMode = function _exitCurrentMode() {
this.setMode('edit');
};
/**
* Used via `this.restoreEditorDOM()`.
*
* Force a complete re-render of the editor based on the current EditorState.
* This is useful when we know we are going to lose control of the DOM
* state (cut command, IME) and we want to make sure that reconciliation
* occurs on a version of the DOM that is synchronized with our EditorState.
*/
DraftEditor.prototype._restoreEditorDOM = function _restoreEditorDOM(scrollPosition) {
var _this3 = this;
this.setState({ containerKey: this.state.containerKey + 1 }, function () {
_this3._focus(scrollPosition);
});
};
/**
* Guard against rendering. Intended for use when we need to manually
* reset editor contents, to ensure that no outside influences lead to
* React reconciliation when we are in an uncertain state.
*/
DraftEditor.prototype._setRenderGuard = function _setRenderGuard() {
this._guardAgainstRender = true;
};
DraftEditor.prototype._removeRenderGuard = function _removeRenderGuard() {
this._guardAgainstRender = false;
};
/**
* Used via `this.setClipboard(...)`.
*
* Set the clipboard state for a cut/copy event.
*/
DraftEditor.prototype._setClipboard = function _setClipboard(clipboard) {
this._clipboard = clipboard;
};
/**
* Used via `this.getClipboard()`.
*
* Retrieve the clipboard state for a cut/copy event.
*/
DraftEditor.prototype._getClipboard = function _getClipboard() {
return this._clipboard;
};
/**
* Used via `this.update(...)`.
*
* Propagate a new `EditorState` object to higher-level components. This is
* the method by which event handlers inform the `DraftEditor` component of
* state changes. A component that composes a `DraftEditor` **must** provide
* an `onChange` prop to receive state updates passed along from this
* function.
*/
DraftEditor.prototype._update = function _update(editorState) {
this.props.onChange(editorState);
};
/**
* Used in conjunction with `_onDragLeave()`, by counting the number of times
* a dragged element enters and leaves the editor (or any of its children),
* to determine when the dragged element absolutely leaves the editor.
*/
DraftEditor.prototype._onDragEnter = function _onDragEnter() {
this._dragCount++;
};
/**
* See `_onDragEnter()`.
*/
DraftEditor.prototype._onDragLeave = function _onDragLeave() {
this._dragCount--;
if (this._dragCount === 0) {
this.exitCurrentMode();
}
};
return DraftEditor;
}(React.Component);
DraftEditor.defaultProps = {
blockRenderMap: DefaultDraftBlockRenderMap,
blockRendererFn: emptyFunction.thatReturnsNull,
blockStyleFn: emptyFunction.thatReturns(''),
keyBindingFn: getDefaultKeyBinding,
readOnly: false,
spellCheck: false,
stripPastedStyles: false
};
module.exports = DraftEditor;
/***/ },
/* 1128 */
/*!*********************************************************!*\
!*** ./~/draft-js/lib/DraftEditorCompositionHandler.js ***!
\*********************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule DraftEditorCompositionHandler
*
*/
'use strict';
var DraftModifier = __webpack_require__(/*! ./DraftModifier */ 1095);
var EditorState = __webpack_require__(/*! ./EditorState */ 1113);
var Keys = __webpack_require__(/*! fbjs/lib/Keys */ 1129);
var getEntityKeyForSelection = __webpack_require__(/*! ./getEntityKeyForSelection */ 1130);
var isSelectionAtLeafStart = __webpack_require__(/*! ./isSelectionAtLeafStart */ 1131);
/**
* Millisecond delay to allow `compositionstart` to fire again upon
* `compositionend`.
*
* This is used for Korean input to ensure that typing can continue without
* the editor trying to render too quickly. More specifically, Safari 7.1+
* triggers `compositionstart` a little slower than Chrome/FF, which
* leads to composed characters being resolved and re-render occurring
* sooner than we want.
*/
var RESOLVE_DELAY = 20;
/**
* A handful of variables used to track the current composition and its
* resolution status. These exist at the module level because it is not
* possible to have compositions occurring in multiple editors simultaneously,
* and it simplifies state management with respect to the DraftEditor component.
*/
var resolved = false;
var stillComposing = false;
var textInputData = '';
var DraftEditorCompositionHandler = {
onBeforeInput: function onBeforeInput(e) {
textInputData = (textInputData || '') + e.data;
},
/**
* A `compositionstart` event has fired while we're still in composition
* mode. Continue the current composition session to prevent a re-render.
*/
onCompositionStart: function onCompositionStart() {
stillComposing = true;
},
/**
* Attempt to end the current composition session.
*
* Defer handling because browser will still insert the chars into active
* element after `compositionend`. If a `compositionstart` event fires
* before `resolveComposition` executes, our composition session will
* continue.
*
* The `resolved` flag is useful because certain IME interfaces fire the
* `compositionend` event multiple times, thus queueing up multiple attempts
* at handling the composition. Since handling the same composition event
* twice could break the DOM, we only use the first event. Example: Arabic
* Google Input Tools on Windows 8.1 fires `compositionend` three times.
*/
onCompositionEnd: function onCompositionEnd() {
var _this = this;
resolved = false;
stillComposing = false;
setTimeout(function () {
if (!resolved) {
DraftEditorCompositionHandler.resolveComposition.call(_this);
}
}, RESOLVE_DELAY);
},
/**
* In Safari, keydown events may fire when committing compositions. If
* the arrow keys are used to commit, prevent default so that the cursor
* doesn't move, otherwise it will jump back noticeably on re-render.
*/
onKeyDown: function onKeyDown(e) {
if (e.which === Keys.RIGHT || e.which === Keys.LEFT) {
e.preventDefault();
}
},
/**
* Keypress events may fire when committing compositions. In Firefox,
* pressing RETURN commits the composition and inserts extra newline
* characters that we do not want. `preventDefault` allows the composition
* to be committed while preventing the extra characters.
*/
onKeyPress: function onKeyPress(e) {
if (e.which === Keys.RETURN) {
e.preventDefault();
}
},
/**
* Attempt to insert composed characters into the document.
*
* If we are still in a composition session, do nothing. Otherwise, insert
* the characters into the document and terminate the composition session.
*
* If no characters were composed -- for instance, the user
* deleted all composed characters and committed nothing new --
* force a re-render. We also re-render when the composition occurs
* at the beginning of a leaf, to ensure that if the browser has
* created a new text node for the composition, we will discard it.
*
* Resetting innerHTML will move focus to the beginning of the editor,
* so we update to force it back to the correct place.
*/
resolveComposition: function resolveComposition() {
if (stillComposing) {
return;
}
resolved = true;
var composedChars = textInputData;
textInputData = '';
var editorState = EditorState.set(this.props.editorState, {
inCompositionMode: false
});
var currentStyle = editorState.getCurrentInlineStyle();
var entityKey = getEntityKeyForSelection(editorState.getCurrentContent(), editorState.getSelection());
var mustReset = !composedChars || isSelectionAtLeafStart(editorState) || currentStyle.size > 0 || entityKey !== null;
if (mustReset) {
this.restoreEditorDOM();
}
this.exitCurrentMode();
this.removeRenderGuard();
if (composedChars) {
// If characters have been composed, re-rendering with the update
// is sufficient to reset the editor.
var contentState = DraftModifier.replaceText(editorState.getCurrentContent(), editorState.getSelection(), composedChars, currentStyle, entityKey);
this.update(EditorState.push(editorState, contentState, 'insert-characters'));
return;
}
if (mustReset) {
this.update(EditorState.set(editorState, {
nativelyRenderedContent: null,
forceSelection: true
}));
}
}
};
module.exports = DraftEditorCompositionHandler;
/***/ },
/* 1129 */
/*!****************************!*\
!*** ./~/fbjs/lib/Keys.js ***!
\****************************/
/***/ function(module, exports) {
"use strict";
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
module.exports = {
BACKSPACE: 8,
TAB: 9,
RETURN: 13,
ALT: 18,
ESC: 27,
SPACE: 32,
PAGE_UP: 33,
PAGE_DOWN: 34,
END: 35,
HOME: 36,
LEFT: 37,
UP: 38,
RIGHT: 39,
DOWN: 40,
DELETE: 46,
COMMA: 188,
PERIOD: 190,
A: 65,
Z: 90,
ZERO: 48,
NUMPAD_0: 96,
NUMPAD_9: 105
};
/***/ },
/* 1130 */
/*!****************************************************!*\
!*** ./~/draft-js/lib/getEntityKeyForSelection.js ***!
\****************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule getEntityKeyForSelection
* @typechecks
*
*/
'use strict';
var DraftEntity = __webpack_require__(/*! ./DraftEntity */ 1100);
/**
* Return the entity key that should be used when inserting text for the
* specified target selection, only if the entity is `MUTABLE`. `IMMUTABLE`
* and `SEGMENTED` entities should not be used for insertion behavior.
*/
function getEntityKeyForSelection(contentState, targetSelection) {
var entityKey;
if (targetSelection.isCollapsed()) {
var key = targetSelection.getAnchorKey();
var offset = targetSelection.getAnchorOffset();
if (offset > 0) {
entityKey = contentState.getBlockForKey(key).getEntityAt(offset - 1);
return filterKey(entityKey);
}
return null;
}
var startKey = targetSelection.getStartKey();
var startOffset = targetSelection.getStartOffset();
var startBlock = contentState.getBlockForKey(startKey);
entityKey = startOffset === startBlock.getLength() ? null : startBlock.getEntityAt(startOffset);
return filterKey(entityKey);
}
/**
* Determine whether an entity key corresponds to a `MUTABLE` entity. If so,
* return it. If not, return null.
*/
function filterKey(entityKey) {
if (entityKey) {
var entity = DraftEntity.get(entityKey);
return entity.getMutability() === 'MUTABLE' ? entityKey : null;
}
return null;
}
module.exports = getEntityKeyForSelection;
/***/ },
/* 1131 */
/*!**************************************************!*\
!*** ./~/draft-js/lib/isSelectionAtLeafStart.js ***!
\**************************************************/
/***/ function(module, exports) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule isSelectionAtLeafStart
* @typechecks
*
*/
'use strict';
function isSelectionAtLeafStart(editorState) {
var selection = editorState.getSelection();
var anchorKey = selection.getAnchorKey();
var blockTree = editorState.getBlockTree(anchorKey);
var offset = selection.getStartOffset();
var isAtStart = false;
blockTree.some(function (leafSet) {
if (offset === leafSet.get('start')) {
isAtStart = true;
return true;
}
if (offset < leafSet.get('end')) {
return leafSet.get('leaves').some(function (leaf) {
var leafStart = leaf.get('start');
if (offset === leafStart) {
isAtStart = true;
return true;
}
return false;
});
}
return false;
});
return isAtStart;
}
module.exports = isSelectionAtLeafStart;
/***/ },
/* 1132 */
/*!*****************************************************!*\
!*** ./~/draft-js/lib/DraftEditorContents.react.js ***!
\*****************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule DraftEditorContents.react
* @typechecks
*
*/
'use strict';
var _assign = __webpack_require__(/*! object-assign */ 5);
var _extends = _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 DraftEditorBlock = __webpack_require__(/*! ./DraftEditorBlock.react */ 1133);
var DraftOffsetKey = __webpack_require__(/*! ./DraftOffsetKey */ 1143);
var EditorState = __webpack_require__(/*! ./EditorState */ 1113);
var React = __webpack_require__(/*! react */ 2);
var cx = __webpack_require__(/*! fbjs/lib/cx */ 1125);
var joinClasses = __webpack_require__(/*! fbjs/lib/joinClasses */ 1152);
var nullthrows = __webpack_require__(/*! fbjs/lib/nullthrows */ 1122);
/**
* `DraftEditorContents` is the container component for all block components
* rendered for a `DraftEditor`. It is optimized to aggressively avoid
* re-rendering blocks whenever possible.
*
* This component is separate from `DraftEditor` because certain props
* (for instance, ARIA props) must be allowed to update without affecting
* the contents of the editor.
*/
var DraftEditorContents = function (_React$Component) {
_inherits(DraftEditorContents, _React$Component);
function DraftEditorContents() {
_classCallCheck(this, DraftEditorContents);
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
}
DraftEditorContents.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps) {
var prevEditorState = this.props.editorState;
var nextEditorState = nextProps.editorState;
var prevDirectionMap = prevEditorState.getDirectionMap();
var nextDirectionMap = nextEditorState.getDirectionMap();
// Text direction has changed for one or more blocks. We must re-render.
if (prevDirectionMap !== nextDirectionMap) {
return true;
}
var didHaveFocus = prevEditorState.getSelection().getHasFocus();
var nowHasFocus = nextEditorState.getSelection().getHasFocus();
if (didHaveFocus !== nowHasFocus) {
return true;
}
var nextNativeContent = nextEditorState.getNativelyRenderedContent();
var wasComposing = prevEditorState.isInCompositionMode();
var nowComposing = nextEditorState.isInCompositionMode();
// If the state is unchanged or we're currently rendering a natively
// rendered state, there's nothing new to be done.
if (prevEditorState === nextEditorState || nextNativeContent !== null && nextEditorState.getCurrentContent() === nextNativeContent || wasComposing && nowComposing) {
return false;
}
var prevContent = prevEditorState.getCurrentContent();
var nextContent = nextEditorState.getCurrentContent();
var prevDecorator = prevEditorState.getDecorator();
var nextDecorator = nextEditorState.getDecorator();
return wasComposing !== nowComposing || prevContent !== nextContent || prevDecorator !== nextDecorator || nextEditorState.mustForceSelection();
};
DraftEditorContents.prototype.render = function render() {
var _props = this.props;
var blockRenderMap = _props.blockRenderMap;
var blockRendererFn = _props.blockRendererFn;
var customStyleMap = _props.customStyleMap;
var customStyleFn = _props.customStyleFn;
var editorState = _props.editorState;
var content = editorState.getCurrentContent();
var selection = editorState.getSelection();
var forceSelection = editorState.mustForceSelection();
var decorator = editorState.getDecorator();
var directionMap = nullthrows(editorState.getDirectionMap());
var blocksAsArray = content.getBlocksAsArray();
var processedBlocks = [];
var currentDepth = null;
var lastWrapperTemplate = null;
for (var ii = 0; ii < blocksAsArray.length; ii++) {
var _block = blocksAsArray[ii];
var key = _block.getKey();
var blockType = _block.getType();
var customRenderer = blockRendererFn(_block);
var CustomComponent = void 0,
customProps = void 0,
customEditable = void 0;
if (customRenderer) {
CustomComponent = customRenderer.component;
customProps = customRenderer.props;
customEditable = customRenderer.editable;
}
var direction = directionMap.get(key);
var offsetKey = DraftOffsetKey.encode(key, 0, 0);
var componentProps = {
block: _block,
blockProps: customProps,
customStyleMap: customStyleMap,
customStyleFn: customStyleFn,
decorator: decorator,
direction: direction,
forceSelection: forceSelection,
key: key,
offsetKey: offsetKey,
selection: selection,
tree: editorState.getBlockTree(key)
};
var configForType = blockRenderMap.get(blockType);
var wrapperTemplate = configForType.wrapper;
var _Element = configForType.element || blockRenderMap.get('unstyled').element;
var depth = _block.getDepth();
var className = this.props.blockStyleFn(_block);
// List items are special snowflakes, since we handle nesting and
// counters manually.
if (_Element === 'li') {
var shouldResetCount = lastWrapperTemplate !== wrapperTemplate || currentDepth === null || depth > currentDepth;
className = joinClasses(className, getListItemClasses(blockType, depth, shouldResetCount, direction));
}
var Component = CustomComponent || DraftEditorBlock;
var childProps = {
className: className,
'data-block': true,
'data-editor': this.props.editorKey,
'data-offset-key': offsetKey,
key: key
};
if (customEditable !== undefined) {
childProps = _extends({}, childProps, {
contentEditable: customEditable,
suppressContentEditableWarning: true
});
}
var child = React.createElement(_Element, childProps, React.createElement(Component, componentProps));
processedBlocks.push({
block: child,
wrapperTemplate: wrapperTemplate,
key: key,
offsetKey: offsetKey
});
if (wrapperTemplate) {
currentDepth = _block.getDepth();
} else {
currentDepth = null;
}
lastWrapperTemplate = wrapperTemplate;
}
// Group contiguous runs of blocks that have the same wrapperTemplate
var outputBlocks = [];
for (var _ii = 0; _ii < processedBlocks.length;) {
var info = processedBlocks[_ii];
if (info.wrapperTemplate) {
var blocks = [];
do {
blocks.push(processedBlocks[_ii].block);
_ii++;
} while (_ii < processedBlocks.length && processedBlocks[_ii].wrapperTemplate === info.wrapperTemplate);
var wrapperElement = React.cloneElement(info.wrapperTemplate, {
key: info.key + '-wrap',
'data-offset-key': info.offsetKey
}, blocks);
outputBlocks.push(wrapperElement);
} else {
outputBlocks.push(info.block);
_ii++;
}
}
return React.createElement(
'div',
{ 'data-contents': 'true' },
outputBlocks
);
};
return DraftEditorContents;
}(React.Component);
/**
* Provide default styling for list items. This way, lists will be styled with
* proper counters and indentation even if the caller does not specify
* their own styling at all. If more than five levels of nesting are needed,
* the necessary CSS classes can be provided via `blockStyleFn` configuration.
*/
function getListItemClasses(type, depth, shouldResetCount, direction) {
return cx({
'public/DraftStyleDefault/unorderedListItem': type === 'unordered-list-item',
'public/DraftStyleDefault/orderedListItem': type === 'ordered-list-item',
'public/DraftStyleDefault/reset': shouldResetCount,
'public/DraftStyleDefault/depth0': depth === 0,
'public/DraftStyleDefault/depth1': depth === 1,
'public/DraftStyleDefault/depth2': depth === 2,
'public/DraftStyleDefault/depth3': depth === 3,
'public/DraftStyleDefault/depth4': depth === 4,
'public/DraftStyleDefault/listLTR': direction === 'LTR',
'public/DraftStyleDefault/listRTL': direction === 'RTL'
});
}
module.exports = DraftEditorContents;
/***/ },
/* 1133 */
/*!**************************************************!*\
!*** ./~/draft-js/lib/DraftEditorBlock.react.js ***!
\**************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule DraftEditorBlock.react
* @typechecks
*
*/
'use strict';
var _assign = __webpack_require__(/*! object-assign */ 5);
var _extends = _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 ContentBlock = __webpack_require__(/*! ./ContentBlock */ 1093);
var DraftEditorLeaf = __webpack_require__(/*! ./DraftEditorLeaf.react */ 1134);
var DraftOffsetKey = __webpack_require__(/*! ./DraftOffsetKey */ 1143);
var React = __webpack_require__(/*! react */ 2);
var ReactDOM = __webpack_require__(/*! react-dom */ 33);
var Scroll = __webpack_require__(/*! fbjs/lib/Scroll */ 1144);
var SelectionState = __webpack_require__(/*! ./SelectionState */ 1116);
var Style = __webpack_require__(/*! fbjs/lib/Style */ 1145);
var UnicodeBidi = __webpack_require__(/*! fbjs/lib/UnicodeBidi */ 1120);
var UnicodeBidiDirection = __webpack_require__(/*! fbjs/lib/UnicodeBidiDirection */ 1121);
var cx = __webpack_require__(/*! fbjs/lib/cx */ 1125);
var getElementPosition = __webpack_require__(/*! fbjs/lib/getElementPosition */ 1147);
var getScrollPosition = __webpack_require__(/*! fbjs/lib/getScrollPosition */ 1149);
var getViewportDimensions = __webpack_require__(/*! fbjs/lib/getViewportDimensions */ 1151);
var nullthrows = __webpack_require__(/*! fbjs/lib/nullthrows */ 1122);
var SCROLL_BUFFER = 10;
/**
* The default block renderer for a `DraftEditor` component.
*
* A `DraftEditorBlock` is able to render a given `ContentBlock` to its
* appropriate decorator and inline style components.
*/
var DraftEditorBlock = function (_React$Component) {
_inherits(DraftEditorBlock, _React$Component);
function DraftEditorBlock() {
_classCallCheck(this, DraftEditorBlock);
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
}
DraftEditorBlock.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps) {
return this.props.block !== nextProps.block || this.props.tree !== nextProps.tree || this.props.direction !== nextProps.direction || isBlockOnSelectionEdge(nextProps.selection, nextProps.block.getKey()) && nextProps.forceSelection;
};
/**
* When a block is mounted and overlaps the selection state, we need to make
* sure that the cursor is visible to match native behavior. This may not
* be the case if the user has pressed `RETURN` or pasted some content, since
* programatically creating these new blocks and setting the DOM selection
* will miss out on the browser natively scrolling to that position.
*
* To replicate native behavior, if the block overlaps the selection state
* on mount, force the scroll position. Check the scroll state of the scroll
* parent, and adjust it to align the entire block to the bottom of the
* scroll parent.
*/
DraftEditorBlock.prototype.componentDidMount = function componentDidMount() {
var selection = this.props.selection;
var endKey = selection.getEndKey();
if (!selection.getHasFocus() || endKey !== this.props.block.getKey()) {
return;
}
var blockNode = ReactDOM.findDOMNode(this);
var scrollParent = Style.getScrollParent(blockNode);
var scrollPosition = getScrollPosition(scrollParent);
var scrollDelta;
if (scrollParent === window) {
var nodePosition = getElementPosition(blockNode);
var nodeBottom = nodePosition.y + nodePosition.height;
var viewportHeight = getViewportDimensions().height;
scrollDelta = nodeBottom - viewportHeight;
if (scrollDelta > 0) {
window.scrollTo(scrollPosition.x, scrollPosition.y + scrollDelta + SCROLL_BUFFER);
}
} else {
var blockBottom = blockNode.offsetHeight + blockNode.offsetTop;
var scrollBottom = scrollParent.offsetHeight + scrollPosition.y;
scrollDelta = blockBottom - scrollBottom;
if (scrollDelta > 0) {
Scroll.setTop(scrollParent, Scroll.getTop(scrollParent) + scrollDelta + SCROLL_BUFFER);
}
}
};
DraftEditorBlock.prototype._renderChildren = function _renderChildren() {
var _this2 = this;
var block = this.props.block;
var blockKey = block.getKey();
var text = block.getText();
var lastLeafSet = this.props.tree.size - 1;
var hasSelection = isBlockOnSelectionEdge(this.props.selection, blockKey);
return this.props.tree.map(function (leafSet, ii) {
var leavesForLeafSet = leafSet.get('leaves');
var lastLeaf = leavesForLeafSet.size - 1;
var leaves = leavesForLeafSet.map(function (leaf, jj) {
var offsetKey = DraftOffsetKey.encode(blockKey, ii, jj);
var start = leaf.get('start');
var end = leaf.get('end');
return React.createElement(DraftEditorLeaf, {
key: offsetKey,
offsetKey: offsetKey,
blockKey: blockKey,
start: start,
selection: hasSelection ? _this2.props.selection : undefined,
forceSelection: _this2.props.forceSelection,
text: text.slice(start, end),
styleSet: block.getInlineStyleAt(start),
customStyleMap: _this2.props.customStyleMap,
customStyleFn: _this2.props.customStyleFn,
isLast: ii === lastLeafSet && jj === lastLeaf
});
}).toArray();
var decoratorKey = leafSet.get('decoratorKey');
if (decoratorKey == null) {
return leaves;
}
if (!_this2.props.decorator) {
return leaves;
}
var decorator = nullthrows(_this2.props.decorator);
var DecoratorComponent = decorator.getComponentForKey(decoratorKey);
if (!DecoratorComponent) {
return leaves;
}
var decoratorProps = decorator.getPropsForKey(decoratorKey);
var decoratorOffsetKey = DraftOffsetKey.encode(blockKey, ii, 0);
var decoratedText = text.slice(leavesForLeafSet.first().get('start'), leavesForLeafSet.last().get('end'));
// Resetting dir to the same value on a child node makes Chrome/Firefox
// confused on cursor movement. See http://jsfiddle.net/d157kLck/3/
var dir = UnicodeBidiDirection.getHTMLDirIfDifferent(UnicodeBidi.getDirection(decoratedText), _this2.props.direction);
return React.createElement(
DecoratorComponent,
_extends({}, decoratorProps, {
decoratedText: decoratedText,
dir: dir,
key: decoratorOffsetKey,
entityKey: block.getEntityAt(leafSet.get('start')),
offsetKey: decoratorOffsetKey }),
leaves
);
}).toArray();
};
DraftEditorBlock.prototype.render = function render() {
var _props = this.props;
var direction = _props.direction;
var offsetKey = _props.offsetKey;
var className = cx({
'public/DraftStyleDefault/block': true,
'public/DraftStyleDefault/ltr': direction === 'LTR',
'public/DraftStyleDefault/rtl': direction === 'RTL'
});
return React.createElement(
'div',
{ 'data-offset-key': offsetKey, className: className },
this._renderChildren()
);
};
return DraftEditorBlock;
}(React.Component);
/**
* Return whether a block overlaps with either edge of the `SelectionState`.
*/
function isBlockOnSelectionEdge(selection, key) {
return selection.getAnchorKey() === key || selection.getFocusKey() === key;
}
module.exports = DraftEditorBlock;
/***/ },
/* 1134 */
/*!*************************************************!*\
!*** ./~/draft-js/lib/DraftEditorLeaf.react.js ***!
\*************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule DraftEditorLeaf.react
* @typechecks
*
*/
'use strict';
var _assign = __webpack_require__(/*! object-assign */ 5);
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 DraftEditorTextNode = __webpack_require__(/*! ./DraftEditorTextNode.react */ 1135);
var React = __webpack_require__(/*! react */ 2);
var ReactDOM = __webpack_require__(/*! react-dom */ 33);
var SelectionState = __webpack_require__(/*! ./SelectionState */ 1116);
var setDraftEditorSelection = __webpack_require__(/*! ./setDraftEditorSelection */ 1142);
/**
* All leaf nodes in the editor are spans with single text nodes. Leaf
* elements are styled based on the merging of an optional custom style map
* and a default style map.
*
* `DraftEditorLeaf` also provides a wrapper for calling into the imperative
* DOM Selection API. In this way, top-level components can declaratively
* maintain the selection state.
*/
var DraftEditorLeaf = function (_React$Component) {
_inherits(DraftEditorLeaf, _React$Component);
function DraftEditorLeaf() {
_classCallCheck(this, DraftEditorLeaf);
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
}
/**
* By making individual leaf instances aware of their context within
* the text of the editor, we can set our selection range more
* easily than we could in the non-React world.
*
* Note that this depends on our maintaining tight control over the
* DOM structure of the TextEditor component. If leaves had multiple
* text nodes, this would be harder.
*/
DraftEditorLeaf.prototype._setSelection = function _setSelection() {
var selection = this.props.selection;
// If selection state is irrelevant to the parent block, no-op.
if (selection == null || !selection.getHasFocus()) {
return;
}
var _props = this.props;
var blockKey = _props.blockKey;
var start = _props.start;
var text = _props.text;
var end = start + text.length;
if (!selection.hasEdgeWithin(blockKey, start, end)) {
return;
}
// Determine the appropriate target node for selection. If the child
// is not a text node, it is a <br /> spacer. In this case, use the
// <span> itself as the selection target.
var node = ReactDOM.findDOMNode(this);
var child = node.firstChild;
var targetNode = void 0;
if (child.nodeType === Node.TEXT_NODE) {
targetNode = child;
} else if (child.tagName === 'BR') {
targetNode = node;
} else {
targetNode = child.firstChild;
}
setDraftEditorSelection(selection, targetNode, blockKey, start, end);
};
DraftEditorLeaf.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps) {
return ReactDOM.findDOMNode(this.refs.leaf).textContent !== nextProps.text || nextProps.styleSet !== this.props.styleSet || nextProps.forceSelection;
};
DraftEditorLeaf.prototype.componentDidUpdate = function componentDidUpdate() {
this._setSelection();
};
DraftEditorLeaf.prototype.componentDidMount = function componentDidMount() {
this._setSelection();
};
DraftEditorLeaf.prototype.render = function render() {
var text = this.props.text;
// If the leaf is at the end of its block and ends in a soft newline, append
// an extra line feed character. Browsers collapse trailing newline
// characters, which leaves the cursor in the wrong place after a
// shift+enter. The extra character repairs this.
if (text.endsWith('\n') && this.props.isLast) {
text += '\n';
}
var _props2 = this.props;
var customStyleMap = _props2.customStyleMap;
var customStyleFn = _props2.customStyleFn;
var offsetKey = _props2.offsetKey;
var styleSet = _props2.styleSet;
var styleObj = styleSet.reduce(function (map, styleName) {
var mergedStyles = {};
var style = customStyleMap[styleName];
if (style !== undefined && map.textDecoration !== style.textDecoration) {
// .trim() is necessary for IE9/10/11 and Edge
mergedStyles.textDecoration = [map.textDecoration, style.textDecoration].join(' ').trim();
}
return _assign(map, style, mergedStyles);
}, {});
if (customStyleFn) {
var newStyles = customStyleFn(styleSet);
styleObj = _assign(styleObj, newStyles);
}
return React.createElement(
'span',
{
'data-offset-key': offsetKey,
ref: 'leaf',
style: styleObj },
React.createElement(
DraftEditorTextNode,
null,
text
)
);
};
return DraftEditorLeaf;
}(React.Component);
module.exports = DraftEditorLeaf;
/***/ },
/* 1135 */
/*!*****************************************************!*\
!*** ./~/draft-js/lib/DraftEditorTextNode.react.js ***!
\*****************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule DraftEditorTextNode.react
* @typechecks
*
*/
'use strict';
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 React = __webpack_require__(/*! react */ 2);
var ReactDOM = __webpack_require__(/*! react-dom */ 33);
var UserAgent = __webpack_require__(/*! fbjs/lib/UserAgent */ 1136);
// In IE, spans with <br> tags render as two newlines. By rendering a span
// with only a newline character, we can be sure to render a single line.
var useNewlineChar = UserAgent.isBrowser('IE <= 11');
/**
* Check whether the node should be considered a newline.
*/
function isNewline(node) {
return useNewlineChar ? node.textContent === '\n' : node.tagName === 'BR';
}
/**
* Placeholder elements for empty text content.
*
* What is this `data-text` attribute, anyway? It turns out that we need to
* put an attribute on the lowest-level text node in order to preserve correct
* spellcheck handling. If the <span> is naked, Chrome and Safari may do
* bizarre things to do the DOM -- split text nodes, create extra spans, etc.
* If the <span> has an attribute, this appears not to happen.
* See http://jsfiddle.net/9khdavod/ for the failure case, and
* http://jsfiddle.net/7pg143f7/ for the fixed case.
*/
var NEWLINE_A = useNewlineChar ? React.createElement(
'span',
{ key: 'A', 'data-text': 'true' },
'\n'
) : React.createElement('br', { key: 'A', 'data-text': 'true' });
var NEWLINE_B = useNewlineChar ? React.createElement(
'span',
{ key: 'B', 'data-text': 'true' },
'\n'
) : React.createElement('br', { key: 'B', 'data-text': 'true' });
/**
* The lowest-level component in a `DraftEditor`, the text node component
* replaces the default React text node implementation. This allows us to
* perform custom handling of newline behavior and avoid re-rendering text
* nodes with DOM state that already matches the expectations of our immutable
* editor state.
*/
var DraftEditorTextNode = function (_React$Component) {
_inherits(DraftEditorTextNode, _React$Component);
function DraftEditorTextNode(props) {
_classCallCheck(this, DraftEditorTextNode);
var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));
_this._forceFlag = false;
return _this;
}
DraftEditorTextNode.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps) {
var node = ReactDOM.findDOMNode(this);
var shouldBeNewline = nextProps.children === '';
if (shouldBeNewline) {
return !isNewline(node);
}
return node.textContent !== nextProps.children;
};
DraftEditorTextNode.prototype.componentWillUpdate = function componentWillUpdate() {
// By flipping this flag, we also keep flipping keys which forces
// React to remount this node every time it rerenders.
this._forceFlag = !this._forceFlag;
};
DraftEditorTextNode.prototype.render = function render() {
if (this.props.children === '') {
return this._forceFlag ? NEWLINE_A : NEWLINE_B;
}
return React.createElement(
'span',
{ key: this._forceFlag ? 'A' : 'B', 'data-text': 'true' },
this.props.children
);
};
return DraftEditorTextNode;
}(React.Component);
module.exports = DraftEditorTextNode;
/***/ },
/* 1136 */
/*!*********************************!*\
!*** ./~/fbjs/lib/UserAgent.js ***!
\*********************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var UserAgentData = __webpack_require__(/*! ./UserAgentData */ 1137);
var VersionRange = __webpack_require__(/*! ./VersionRange */ 1140);
var mapObject = __webpack_require__(/*! ./mapObject */ 1141);
var memoizeStringOnly = __webpack_require__(/*! ./memoizeStringOnly */ 103);
/**
* Checks to see whether `name` and `version` satisfy `query`.
*
* @param {string} name Name of the browser, device, engine or platform
* @param {?string} version Version of the browser, engine or platform
* @param {string} query Query of form "Name [range expression]"
* @param {?function} normalizer Optional pre-processor for range expression
* @return {boolean}
*/
function compare(name, version, query, normalizer) {
// check for exact match with no version
if (name === query) {
return true;
}
// check for non-matching names
if (!query.startsWith(name)) {
return false;
}
// full comparison with version
var range = query.slice(name.length);
if (version) {
range = normalizer ? normalizer(range) : range;
return VersionRange.contains(range, version);
}
return false;
}
/**
* Normalizes `version` by stripping any "NT" prefix, but only on the Windows
* platform.
*
* Mimics the stripping performed by the `UserAgentWindowsPlatform` PHP class.
*
* @param {string} version
* @return {string}
*/
function normalizePlatformVersion(version) {
if (UserAgentData.platformName === 'Windows') {
return version.replace(/^\s*NT/, '');
}
return version;
}
/**
* Provides client-side access to the authoritative PHP-generated User Agent
* information supplied by the server.
*/
var UserAgent = {
/**
* Check if the User Agent browser matches `query`.
*
* `query` should be a string like "Chrome" or "Chrome > 33".
*
* Valid browser names include:
*
* - ACCESS NetFront
* - AOL
* - Amazon Silk
* - Android
* - BlackBerry
* - BlackBerry PlayBook
* - Chrome
* - Chrome for iOS
* - Chrome frame
* - Facebook PHP SDK
* - Facebook for iOS
* - Firefox
* - IE
* - IE Mobile
* - Mobile Safari
* - Motorola Internet Browser
* - Nokia
* - Openwave Mobile Browser
* - Opera
* - Opera Mini
* - Opera Mobile
* - Safari
* - UIWebView
* - Unknown
* - webOS
* - etc...
*
* An authoritative list can be found in the PHP `BrowserDetector` class and
* related classes in the same file (see calls to `new UserAgentBrowser` here:
* https://fburl.com/50728104).
*
* @note Function results are memoized
*
* @param {string} query Query of the form "Name [range expression]"
* @return {boolean}
*/
isBrowser: function isBrowser(query) {
return compare(UserAgentData.browserName, UserAgentData.browserFullVersion, query);
},
/**
* Check if the User Agent browser uses a 32 or 64 bit architecture.
*
* @note Function results are memoized
*
* @param {string} query Query of the form "32" or "64".
* @return {boolean}
*/
isBrowserArchitecture: function isBrowserArchitecture(query) {
return compare(UserAgentData.browserArchitecture, null, query);
},
/**
* Check if the User Agent device matches `query`.
*
* `query` should be a string like "iPhone" or "iPad".
*
* Valid device names include:
*
* - Kindle
* - Kindle Fire
* - Unknown
* - iPad
* - iPhone
* - iPod
* - etc...
*
* An authoritative list can be found in the PHP `DeviceDetector` class and
* related classes in the same file (see calls to `new UserAgentDevice` here:
* https://fburl.com/50728332).
*
* @note Function results are memoized
*
* @param {string} query Query of the form "Name"
* @return {boolean}
*/
isDevice: function isDevice(query) {
return compare(UserAgentData.deviceName, null, query);
},
/**
* Check if the User Agent rendering engine matches `query`.
*
* `query` should be a string like "WebKit" or "WebKit >= 537".
*
* Valid engine names include:
*
* - Gecko
* - Presto
* - Trident
* - WebKit
* - etc...
*
* An authoritative list can be found in the PHP `RenderingEngineDetector`
* class related classes in the same file (see calls to `new
* UserAgentRenderingEngine` here: https://fburl.com/50728617).
*
* @note Function results are memoized
*
* @param {string} query Query of the form "Name [range expression]"
* @return {boolean}
*/
isEngine: function isEngine(query) {
return compare(UserAgentData.engineName, UserAgentData.engineVersion, query);
},
/**
* Check if the User Agent platform matches `query`.
*
* `query` should be a string like "Windows" or "iOS 5 - 6".
*
* Valid platform names include:
*
* - Android
* - BlackBerry OS
* - Java ME
* - Linux
* - Mac OS X
* - Mac OS X Calendar
* - Mac OS X Internet Account
* - Symbian
* - SymbianOS
* - Windows
* - Windows Mobile
* - Windows Phone
* - iOS
* - iOS Facebook Integration Account
* - iOS Facebook Social Sharing UI
* - webOS
* - Chrome OS
* - etc...
*
* An authoritative list can be found in the PHP `PlatformDetector` class and
* related classes in the same file (see calls to `new UserAgentPlatform`
* here: https://fburl.com/50729226).
*
* @note Function results are memoized
*
* @param {string} query Query of the form "Name [range expression]"
* @return {boolean}
*/
isPlatform: function isPlatform(query) {
return compare(UserAgentData.platformName, UserAgentData.platformFullVersion, query, normalizePlatformVersion);
},
/**
* Check if the User Agent platform is a 32 or 64 bit architecture.
*
* @note Function results are memoized
*
* @param {string} query Query of the form "32" or "64".
* @return {boolean}
*/
isPlatformArchitecture: function isPlatformArchitecture(query) {
return compare(UserAgentData.platformArchitecture, null, query);
}
};
module.exports = mapObject(UserAgent, memoizeStringOnly);
/***/ },
/* 1137 */
/*!*************************************!*\
!*** ./~/fbjs/lib/UserAgentData.js ***!
\*************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
/**
* Usage note:
* This module makes a best effort to export the same data we would internally.
* At Facebook we use a server-generated module that does the parsing and
* exports the data for the client to use. We can't rely on a server-side
* implementation in open source so instead we make use of an open source
* library to do the heavy lifting and then make some adjustments as necessary.
* It's likely there will be some differences. Some we can smooth over.
* Others are going to be harder.
*/
'use strict';
var UAParser = __webpack_require__(/*! ua-parser-js */ 1138);
var UNKNOWN = 'Unknown';
var PLATFORM_MAP = {
'Mac OS': 'Mac OS X'
};
/**
* Convert from UAParser platform name to what we expect.
*/
function convertPlatformName(name) {
return PLATFORM_MAP[name] || name;
}
/**
* Get the version number in parts. This is very naive. We actually get major
* version as a part of UAParser already, which is generally good enough, but
* let's get the minor just in case.
*/
function getBrowserVersion(version) {
if (!version) {
return {
major: '',
minor: ''
};
}
var parts = version.split('.');
return {
major: parts[0],
minor: parts[1]
};
}
/**
* Get the UA data fom UAParser and then convert it to the format we're
* expecting for our APIS.
*/
var parser = new UAParser();
var results = parser.getResult();
// Do some conversion first.
var browserVersionData = getBrowserVersion(results.browser.version);
var uaData = {
browserArchitecture: results.cpu.architecture || UNKNOWN,
browserFullVersion: results.browser.version || UNKNOWN,
browserMinorVersion: browserVersionData.minor || UNKNOWN,
browserName: results.browser.name || UNKNOWN,
browserVersion: results.browser.major || UNKNOWN,
deviceName: results.device.model || UNKNOWN,
engineName: results.engine.name || UNKNOWN,
engineVersion: results.engine.version || UNKNOWN,
platformArchitecture: results.cpu.architecture || UNKNOWN,
platformName: convertPlatformName(results.os.name) || UNKNOWN,
platformVersion: results.os.version || UNKNOWN,
platformFullVersion: results.os.version || UNKNOWN
};
module.exports = uaData;
/***/ },
/* 1138 */
/*!*****************************************!*\
!*** ./~/ua-parser-js/src/ua-parser.js ***!
\*****************************************/
/***/ function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_RESULT__;/**
* UAParser.js v0.7.12
* Lightweight JavaScript-based User-Agent string parser
* https://github.com/faisalman/ua-parser-js
*
* Copyright © 2012-2016 Faisal Salman <fyzlman@gmail.com>
* Dual licensed under GPLv2 & MIT
*/
(function (window, undefined) {
'use strict';
//////////////
// Constants
/////////////
var LIBVERSION = '0.7.12',
EMPTY = '',
UNKNOWN = '?',
FUNC_TYPE = 'function',
UNDEF_TYPE = 'undefined',
OBJ_TYPE = 'object',
STR_TYPE = 'string',
MAJOR = 'major', // deprecated
MODEL = 'model',
NAME = 'name',
TYPE = 'type',
VENDOR = 'vendor',
VERSION = 'version',
ARCHITECTURE= 'architecture',
CONSOLE = 'console',
MOBILE = 'mobile',
TABLET = 'tablet',
SMARTTV = 'smarttv',
WEARABLE = 'wearable',
EMBEDDED = 'embedded';
///////////
// Helper
//////////
var util = {
extend : function (regexes, extensions) {
var margedRegexes = {};
for (var i in regexes) {
if (extensions[i] && extensions[i].length % 2 === 0) {
margedRegexes[i] = extensions[i].concat(regexes[i]);
} else {
margedRegexes[i] = regexes[i];
}
}
return margedRegexes;
},
has : function (str1, str2) {
if (typeof str1 === "string") {
return str2.toLowerCase().indexOf(str1.toLowerCase()) !== -1;
} else {
return false;
}
},
lowerize : function (str) {
return str.toLowerCase();
},
major : function (version) {
return typeof(version) === STR_TYPE ? version.replace(/[^\d\.]/g,'').split(".")[0] : undefined;
},
trim : function (str) {
return str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
}
};
///////////////
// Map helper
//////////////
var mapper = {
rgx : function () {
var result, i = 0, j, k, p, q, matches, match, args = arguments;
// loop through all regexes maps
while (i < args.length && !matches) {
var regex = args[i], // even sequence (0,2,4,..)
props = args[i + 1]; // odd sequence (1,3,5,..)
// construct object barebones
if (typeof result === UNDEF_TYPE) {
result = {};
for (p in props) {
if (props.hasOwnProperty(p)){
q = props[p];
if (typeof q === OBJ_TYPE) {
result[q[0]] = undefined;
} else {
result[q] = undefined;
}
}
}
}
// try matching uastring with regexes
j = k = 0;
while (j < regex.length && !matches) {
matches = regex[j++].exec(this.getUA());
if (!!matches) {
for (p = 0; p < props.length; p++) {
match = matches[++k];
q = props[p];
// check if given property is actually array
if (typeof q === OBJ_TYPE && q.length > 0) {
if (q.length == 2) {
if (typeof q[1] == FUNC_TYPE) {
// assign modified match
result[q[0]] = q[1].call(this, match);
} else {
// assign given value, ignore regex match
result[q[0]] = q[1];
}
} else if (q.length == 3) {
// check whether function or regex
if (typeof q[1] === FUNC_TYPE && !(q[1].exec && q[1].test)) {
// call function (usually string mapper)
result[q[0]] = match ? q[1].call(this, match, q[2]) : undefined;
} else {
// sanitize match using given regex
result[q[0]] = match ? match.replace(q[1], q[2]) : undefined;
}
} else if (q.length == 4) {
result[q[0]] = match ? q[3].call(this, match.replace(q[1], q[2])) : undefined;
}
} else {
result[q] = match ? match : undefined;
}
}
}
}
i += 2;
}
return result;
},
str : function (str, map) {
for (var i in map) {
// check if array
if (typeof map[i] === OBJ_TYPE && map[i].length > 0) {
for (var j = 0; j < map[i].length; j++) {
if (util.has(map[i][j], str)) {
return (i === UNKNOWN) ? undefined : i;
}
}
} else if (util.has(map[i], str)) {
return (i === UNKNOWN) ? undefined : i;
}
}
return str;
}
};
///////////////
// String map
//////////////
var maps = {
browser : {
oldsafari : {
version : {
'1.0' : '/8',
'1.2' : '/1',
'1.3' : '/3',
'2.0' : '/412',
'2.0.2' : '/416',
'2.0.3' : '/417',
'2.0.4' : '/419',
'?' : '/'
}
}
},
device : {
amazon : {
model : {
'Fire Phone' : ['SD', 'KF']
}
},
sprint : {
model : {
'Evo Shift 4G' : '7373KT'
},
vendor : {
'HTC' : 'APA',
'Sprint' : 'Sprint'
}
}
},
os : {
windows : {
version : {
'ME' : '4.90',
'NT 3.11' : 'NT3.51',
'NT 4.0' : 'NT4.0',
'2000' : 'NT 5.0',
'XP' : ['NT 5.1', 'NT 5.2'],
'Vista' : 'NT 6.0',
'7' : 'NT 6.1',
'8' : 'NT 6.2',
'8.1' : 'NT 6.3',
'10' : ['NT 6.4', 'NT 10.0'],
'RT' : 'ARM'
}
}
}
};
//////////////
// Regex map
/////////////
var regexes = {
browser : [[
// Presto based
/(opera\smini)\/([\w\.-]+)/i, // Opera Mini
/(opera\s[mobiletab]+).+version\/([\w\.-]+)/i, // Opera Mobi/Tablet
/(opera).+version\/([\w\.]+)/i, // Opera > 9.80
/(opera)[\/\s]+([\w\.]+)/i // Opera < 9.80
], [NAME, VERSION], [
/(opios)[\/\s]+([\w\.]+)/i // Opera mini on iphone >= 8.0
], [[NAME, 'Opera Mini'], VERSION], [
/\s(opr)\/([\w\.]+)/i // Opera Webkit
], [[NAME, 'Opera'], VERSION], [
// Mixed
/(kindle)\/([\w\.]+)/i, // Kindle
/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]+)*/i,
// Lunascape/Maxthon/Netfront/Jasmine/Blazer
// Trident based
/(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?([\w\.]*)/i,
// Avant/IEMobile/SlimBrowser/Baidu
/(?:ms|\()(ie)\s([\w\.]+)/i, // Internet Explorer
// Webkit/KHTML based
/(rekonq)\/([\w\.]+)*/i, // Rekonq
/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs)\/([\w\.-]+)/i
// Chromium/Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron/Iridium/PhantomJS
], [NAME, VERSION], [
/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i // IE11
], [[NAME, 'IE'], VERSION], [
/(edge)\/((\d+)?[\w\.]+)/i // Microsoft Edge
], [NAME, VERSION], [
/(yabrowser)\/([\w\.]+)/i // Yandex
], [[NAME, 'Yandex'], VERSION], [
/(comodo_dragon)\/([\w\.]+)/i // Comodo Dragon
], [[NAME, /_/g, ' '], VERSION], [
/(micromessenger)\/([\w\.]+)/i // WeChat
], [[NAME, 'WeChat'], VERSION], [
/xiaomi\/miuibrowser\/([\w\.]+)/i // MIUI Browser
], [VERSION, [NAME, 'MIUI Browser']], [
/\swv\).+(chrome)\/([\w\.]+)/i // Chrome WebView
], [[NAME, /(.+)/, '$1 WebView'], VERSION], [
/android.+samsungbrowser\/([\w\.]+)/i,
/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)*/i // Android Browser
], [VERSION, [NAME, 'Android Browser']], [
/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i,
// Chrome/OmniWeb/Arora/Tizen/Nokia
/(qqbrowser)[\/\s]?([\w\.]+)/i
// QQBrowser
], [NAME, VERSION], [
/(uc\s?browser)[\/\s]?([\w\.]+)/i,
/ucweb.+(ucbrowser)[\/\s]?([\w\.]+)/i,
/juc.+(ucweb)[\/\s]?([\w\.]+)/i
// UCBrowser
], [[NAME, 'UCBrowser'], VERSION], [
/(dolfin)\/([\w\.]+)/i // Dolphin
], [[NAME, 'Dolphin'], VERSION], [
/((?:android.+)crmo|crios)\/([\w\.]+)/i // Chrome for Android/iOS
], [[NAME, 'Chrome'], VERSION], [
/;fbav\/([\w\.]+);/i // Facebook App for iOS
], [VERSION, [NAME, 'Facebook']], [
/fxios\/([\w\.-]+)/i // Firefox for iOS
], [VERSION, [NAME, 'Firefox']], [
/version\/([\w\.]+).+?mobile\/\w+\s(safari)/i // Mobile Safari
], [VERSION, [NAME, 'Mobile Safari']], [
/version\/([\w\.]+).+?(mobile\s?safari|safari)/i // Safari & Safari Mobile
], [VERSION, NAME], [
/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i // Safari < 3.0
], [NAME, [VERSION, mapper.str, maps.browser.oldsafari.version]], [
/(konqueror)\/([\w\.]+)/i, // Konqueror
/(webkit|khtml)\/([\w\.]+)/i
], [NAME, VERSION], [
// Gecko based
/(navigator|netscape)\/([\w\.-]+)/i // Netscape
], [[NAME, 'Netscape'], VERSION], [
/(swiftfox)/i, // Swiftfox
/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,
// IceDragon/Iceweasel/Camino/Chimera/Fennec/Maemo/Minimo/Conkeror
/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/([\w\.-]+)/i,
// Firefox/SeaMonkey/K-Meleon/IceCat/IceApe/Firebird/Phoenix
/(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i, // Mozilla
// Other
/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i,
// Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf/Sleipnir
/(links)\s\(([\w\.]+)/i, // Links
/(gobrowser)\/?([\w\.]+)*/i, // GoBrowser
/(ice\s?browser)\/v?([\w\._]+)/i, // ICE Browser
/(mosaic)[\/\s]([\w\.]+)/i // Mosaic
], [NAME, VERSION]
/* /////////////////////
// Media players BEGIN
////////////////////////
, [
/(apple(?:coremedia|))\/((\d+)[\w\._]+)/i, // Generic Apple CoreMedia
/(coremedia) v((\d+)[\w\._]+)/i
], [NAME, VERSION], [
/(aqualung|lyssna|bsplayer)\/((\d+)?[\w\.-]+)/i // Aqualung/Lyssna/BSPlayer
], [NAME, VERSION], [
/(ares|ossproxy)\s((\d+)[\w\.-]+)/i // Ares/OSSProxy
], [NAME, VERSION], [
/(audacious|audimusicstream|amarok|bass|core|dalvik|gnomemplayer|music on console|nsplayer|psp-internetradioplayer|videos)\/((\d+)[\w\.-]+)/i,
// Audacious/AudiMusicStream/Amarok/BASS/OpenCORE/Dalvik/GnomeMplayer/MoC
// NSPlayer/PSP-InternetRadioPlayer/Videos
/(clementine|music player daemon)\s((\d+)[\w\.-]+)/i, // Clementine/MPD
/(lg player|nexplayer)\s((\d+)[\d\.]+)/i,
/player\/(nexplayer|lg player)\s((\d+)[\w\.-]+)/i // NexPlayer/LG Player
], [NAME, VERSION], [
/(nexplayer)\s((\d+)[\w\.-]+)/i // Nexplayer
], [NAME, VERSION], [
/(flrp)\/((\d+)[\w\.-]+)/i // Flip Player
], [[NAME, 'Flip Player'], VERSION], [
/(fstream|nativehost|queryseekspider|ia-archiver|facebookexternalhit)/i
// FStream/NativeHost/QuerySeekSpider/IA Archiver/facebookexternalhit
], [NAME], [
/(gstreamer) souphttpsrc (?:\([^\)]+\)){0,1} libsoup\/((\d+)[\w\.-]+)/i
// Gstreamer
], [NAME, VERSION], [
/(htc streaming player)\s[\w_]+\s\/\s((\d+)[\d\.]+)/i, // HTC Streaming Player
/(java|python-urllib|python-requests|wget|libcurl)\/((\d+)[\w\.-_]+)/i,
// Java/urllib/requests/wget/cURL
/(lavf)((\d+)[\d\.]+)/i // Lavf (FFMPEG)
], [NAME, VERSION], [
/(htc_one_s)\/((\d+)[\d\.]+)/i // HTC One S
], [[NAME, /_/g, ' '], VERSION], [
/(mplayer)(?:\s|\/)(?:(?:sherpya-){0,1}svn)(?:-|\s)(r\d+(?:-\d+[\w\.-]+){0,1})/i
// MPlayer SVN
], [NAME, VERSION], [
/(mplayer)(?:\s|\/|[unkow-]+)((\d+)[\w\.-]+)/i // MPlayer
], [NAME, VERSION], [
/(mplayer)/i, // MPlayer (no other info)
/(yourmuze)/i, // YourMuze
/(media player classic|nero showtime)/i // Media Player Classic/Nero ShowTime
], [NAME], [
/(nero (?:home|scout))\/((\d+)[\w\.-]+)/i // Nero Home/Nero Scout
], [NAME, VERSION], [
/(nokia\d+)\/((\d+)[\w\.-]+)/i // Nokia
], [NAME, VERSION], [
/\s(songbird)\/((\d+)[\w\.-]+)/i // Songbird/Philips-Songbird
], [NAME, VERSION], [
/(winamp)3 version ((\d+)[\w\.-]+)/i, // Winamp
/(winamp)\s((\d+)[\w\.-]+)/i,
/(winamp)mpeg\/((\d+)[\w\.-]+)/i
], [NAME, VERSION], [
/(ocms-bot|tapinradio|tunein radio|unknown|winamp|inlight radio)/i // OCMS-bot/tap in radio/tunein/unknown/winamp (no other info)
// inlight radio
], [NAME], [
/(quicktime|rma|radioapp|radioclientapplication|soundtap|totem|stagefright|streamium)\/((\d+)[\w\.-]+)/i
// QuickTime/RealMedia/RadioApp/RadioClientApplication/
// SoundTap/Totem/Stagefright/Streamium
], [NAME, VERSION], [
/(smp)((\d+)[\d\.]+)/i // SMP
], [NAME, VERSION], [
/(vlc) media player - version ((\d+)[\w\.]+)/i, // VLC Videolan
/(vlc)\/((\d+)[\w\.-]+)/i,
/(xbmc|gvfs|xine|xmms|irapp)\/((\d+)[\w\.-]+)/i, // XBMC/gvfs/Xine/XMMS/irapp
/(foobar2000)\/((\d+)[\d\.]+)/i, // Foobar2000
/(itunes)\/((\d+)[\d\.]+)/i // iTunes
], [NAME, VERSION], [
/(wmplayer)\/((\d+)[\w\.-]+)/i, // Windows Media Player
/(windows-media-player)\/((\d+)[\w\.-]+)/i
], [[NAME, /-/g, ' '], VERSION], [
/windows\/((\d+)[\w\.-]+) upnp\/[\d\.]+ dlnadoc\/[\d\.]+ (home media server)/i
// Windows Media Server
], [VERSION, [NAME, 'Windows']], [
/(com\.riseupradioalarm)\/((\d+)[\d\.]*)/i // RiseUP Radio Alarm
], [NAME, VERSION], [
/(rad.io)\s((\d+)[\d\.]+)/i, // Rad.io
/(radio.(?:de|at|fr))\s((\d+)[\d\.]+)/i
], [[NAME, 'rad.io'], VERSION]
//////////////////////
// Media players END
////////////////////*/
],
cpu : [[
/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i // AMD64
], [[ARCHITECTURE, 'amd64']], [
/(ia32(?=;))/i // IA32 (quicktime)
], [[ARCHITECTURE, util.lowerize]], [
/((?:i[346]|x)86)[;\)]/i // IA32
], [[ARCHITECTURE, 'ia32']], [
// PocketPC mistakenly identified as PowerPC
/windows\s(ce|mobile);\sppc;/i
], [[ARCHITECTURE, 'arm']], [
/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i // PowerPC
], [[ARCHITECTURE, /ower/, '', util.lowerize]], [
/(sun4\w)[;\)]/i // SPARC
], [[ARCHITECTURE, 'sparc']], [
/((?:avr32|ia64(?=;))|68k(?=\))|arm(?:64|(?=v\d+;))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i
// IA64, 68K, ARM/64, AVR/32, IRIX/64, MIPS/64, SPARC/64, PA-RISC
], [[ARCHITECTURE, util.lowerize]]
],
device : [[
/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i // iPad/PlayBook
], [MODEL, VENDOR, [TYPE, TABLET]], [
/applecoremedia\/[\w\.]+ \((ipad)/ // iPad
], [MODEL, [VENDOR, 'Apple'], [TYPE, TABLET]], [
/(apple\s{0,1}tv)/i // Apple TV
], [[MODEL, 'Apple TV'], [VENDOR, 'Apple']], [
/(archos)\s(gamepad2?)/i, // Archos
/(hp).+(touchpad)/i, // HP TouchPad
/(hp).+(tablet)/i, // HP Tablet
/(kindle)\/([\w\.]+)/i, // Kindle
/\s(nook)[\w\s]+build\/(\w+)/i, // Nook
/(dell)\s(strea[kpr\s\d]*[\dko])/i // Dell Streak
], [VENDOR, MODEL, [TYPE, TABLET]], [
/(kf[A-z]+)\sbuild\/[\w\.]+.*silk\//i // Kindle Fire HD
], [MODEL, [VENDOR, 'Amazon'], [TYPE, TABLET]], [
/(sd|kf)[0349hijorstuw]+\sbuild\/[\w\.]+.*silk\//i // Fire Phone
], [[MODEL, mapper.str, maps.device.amazon.model], [VENDOR, 'Amazon'], [TYPE, MOBILE]], [
/\((ip[honed|\s\w*]+);.+(apple)/i // iPod/iPhone
], [MODEL, VENDOR, [TYPE, MOBILE]], [
/\((ip[honed|\s\w*]+);/i // iPod/iPhone
], [MODEL, [VENDOR, 'Apple'], [TYPE, MOBILE]], [
/(blackberry)[\s-]?(\w+)/i, // BlackBerry
/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|huawei|meizu|motorola|polytron)[\s_-]?([\w-]+)*/i,
// BenQ/Palm/Sony-Ericsson/Acer/Asus/Dell/Huawei/Meizu/Motorola/Polytron
/(hp)\s([\w\s]+\w)/i, // HP iPAQ
/(asus)-?(\w+)/i // Asus
], [VENDOR, MODEL, [TYPE, MOBILE]], [
/\(bb10;\s(\w+)/i // BlackBerry 10
], [MODEL, [VENDOR, 'BlackBerry'], [TYPE, MOBILE]], [
// Asus Tablets
/android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7|padfone)/i
], [MODEL, [VENDOR, 'Asus'], [TYPE, TABLET]], [
/(sony)\s(tablet\s[ps])\sbuild\//i, // Sony
/(sony)?(?:sgp.+)\sbuild\//i
], [[VENDOR, 'Sony'], [MODEL, 'Xperia Tablet'], [TYPE, TABLET]], [
/(?:sony)?(?:(?:(?:c|d)\d{4})|(?:so[-l].+))\sbuild\//i
], [[VENDOR, 'Sony'], [MODEL, 'Xperia Phone'], [TYPE, MOBILE]], [
/\s(ouya)\s/i, // Ouya
/(nintendo)\s([wids3u]+)/i // Nintendo
], [VENDOR, MODEL, [TYPE, CONSOLE]], [
/android.+;\s(shield)\sbuild/i // Nvidia
], [MODEL, [VENDOR, 'Nvidia'], [TYPE, CONSOLE]], [
/(playstation\s[34portablevi]+)/i // Playstation
], [MODEL, [VENDOR, 'Sony'], [TYPE, CONSOLE]], [
/(sprint\s(\w+))/i // Sprint Phones
], [[VENDOR, mapper.str, maps.device.sprint.vendor], [MODEL, mapper.str, maps.device.sprint.model], [TYPE, MOBILE]], [
/(lenovo)\s?(S(?:5000|6000)+(?:[-][\w+]))/i // Lenovo tablets
], [VENDOR, MODEL, [TYPE, TABLET]], [
/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i, // HTC
/(zte)-(\w+)*/i, // ZTE
/(alcatel|geeksphone|huawei|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]+)*/i
// Alcatel/GeeksPhone/Huawei/Lenovo/Nexian/Panasonic/Sony
], [VENDOR, [MODEL, /_/g, ' '], [TYPE, MOBILE]], [
/(nexus\s9)/i // HTC Nexus 9
], [MODEL, [VENDOR, 'HTC'], [TYPE, TABLET]], [
/(nexus\s6p)/i // Huawei Nexus 6P
], [MODEL, [VENDOR, 'Huawei'], [TYPE, MOBILE]], [
/(microsoft);\s(lumia[\s\w]+)/i // Microsoft Lumia
], [VENDOR, MODEL, [TYPE, MOBILE]], [
/[\s\(;](xbox(?:\sone)?)[\s\);]/i // Microsoft Xbox
], [MODEL, [VENDOR, 'Microsoft'], [TYPE, CONSOLE]], [
/(kin\.[onetw]{3})/i // Microsoft Kin
], [[MODEL, /\./g, ' '], [VENDOR, 'Microsoft'], [TYPE, MOBILE]], [
// Motorola
/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?(:?\s4g)?)[\w\s]+build\//i,
/mot[\s-]?(\w+)*/i,
/(XT\d{3,4}) build\//i,
/(nexus\s6)/i
], [MODEL, [VENDOR, 'Motorola'], [TYPE, MOBILE]], [
/android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i
], [MODEL, [VENDOR, 'Motorola'], [TYPE, TABLET]], [
/hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i // HbbTV devices
], [[VENDOR, util.trim], [MODEL, util.trim], [TYPE, SMARTTV]], [
/hbbtv.+maple;(\d+)/i
], [[MODEL, /^/, 'SmartTV'], [VENDOR, 'Samsung'], [TYPE, SMARTTV]], [
/\(dtv[\);].+(aquos)/i // Sharp
], [MODEL, [VENDOR, 'Sharp'], [TYPE, SMARTTV]], [
/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n\d+|sgh-t8[56]9|nexus 10))/i,
/((SM-T\w+))/i
], [[VENDOR, 'Samsung'], MODEL, [TYPE, TABLET]], [ // Samsung
/smart-tv.+(samsung)/i
], [VENDOR, [TYPE, SMARTTV], MODEL], [
/((s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-\w[\w\d]+))/i,
/(sam[sung]*)[\s-]*(\w+-?[\w-]*)*/i,
/sec-((sgh\w+))/i
], [[VENDOR, 'Samsung'], MODEL, [TYPE, MOBILE]], [
/sie-(\w+)*/i // Siemens
], [MODEL, [VENDOR, 'Siemens'], [TYPE, MOBILE]], [
/(maemo|nokia).*(n900|lumia\s\d+)/i, // Nokia
/(nokia)[\s_-]?([\w-]+)*/i
], [[VENDOR, 'Nokia'], MODEL, [TYPE, MOBILE]], [
/android\s3\.[\s\w;-]{10}(a\d{3})/i // Acer
], [MODEL, [VENDOR, 'Acer'], [TYPE, TABLET]], [
/android\s3\.[\s\w;-]{10}(lg?)-([06cv9]{3,4})/i // LG Tablet
], [[VENDOR, 'LG'], MODEL, [TYPE, TABLET]], [
/(lg) netcast\.tv/i // LG SmartTV
], [VENDOR, MODEL, [TYPE, SMARTTV]], [
/(nexus\s[45])/i, // LG
/lg[e;\s\/-]+(\w+)*/i
], [MODEL, [VENDOR, 'LG'], [TYPE, MOBILE]], [
/android.+(ideatab[a-z0-9\-\s]+)/i // Lenovo
], [MODEL, [VENDOR, 'Lenovo'], [TYPE, TABLET]], [
/linux;.+((jolla));/i // Jolla
], [VENDOR, MODEL, [TYPE, MOBILE]], [
/((pebble))app\/[\d\.]+\s/i // Pebble
], [VENDOR, MODEL, [TYPE, WEARABLE]], [
/android.+;\s(glass)\s\d/i // Google Glass
], [MODEL, [VENDOR, 'Google'], [TYPE, WEARABLE]], [
/android.+(\w+)\s+build\/hm\1/i, // Xiaomi Hongmi 'numeric' models
/android.+(hm[\s\-_]*note?[\s_]*(?:\d\w)?)\s+build/i, // Xiaomi Hongmi
/android.+(mi[\s\-_]*(?:one|one[\s_]plus|note lte)?[\s_]*(?:\d\w)?)\s+build/i // Xiaomi Mi
], [[MODEL, /_/g, ' '], [VENDOR, 'Xiaomi'], [TYPE, MOBILE]], [
/android.+a000(1)\s+build/i // OnePlus
], [MODEL, [VENDOR, 'OnePlus'], [TYPE, MOBILE]], [
/\s(tablet)[;\/]/i, // Unidentifiable Tablet
/\s(mobile)(?:[;\/]|\ssafari)/i // Unidentifiable Mobile
], [[TYPE, util.lowerize], VENDOR, MODEL]
/*//////////////////////////
// TODO: move to string map
////////////////////////////
/(C6603)/i // Sony Xperia Z C6603
], [[MODEL, 'Xperia Z C6603'], [VENDOR, 'Sony'], [TYPE, MOBILE]], [
/(C6903)/i // Sony Xperia Z 1
], [[MODEL, 'Xperia Z 1'], [VENDOR, 'Sony'], [TYPE, MOBILE]], [
/(SM-G900[F|H])/i // Samsung Galaxy S5
], [[MODEL, 'Galaxy S5'], [VENDOR, 'Samsung'], [TYPE, MOBILE]], [
/(SM-G7102)/i // Samsung Galaxy Grand 2
], [[MODEL, 'Galaxy Grand 2'], [VENDOR, 'Samsung'], [TYPE, MOBILE]], [
/(SM-G530H)/i // Samsung Galaxy Grand Prime
], [[MODEL, 'Galaxy Grand Prime'], [VENDOR, 'Samsung'], [TYPE, MOBILE]], [
/(SM-G313HZ)/i // Samsung Galaxy V
], [[MODEL, 'Galaxy V'], [VENDOR, 'Samsung'], [TYPE, MOBILE]], [
/(SM-T805)/i // Samsung Galaxy Tab S 10.5
], [[MODEL, 'Galaxy Tab S 10.5'], [VENDOR, 'Samsung'], [TYPE, TABLET]], [
/(SM-G800F)/i // Samsung Galaxy S5 Mini
], [[MODEL, 'Galaxy S5 Mini'], [VENDOR, 'Samsung'], [TYPE, MOBILE]], [
/(SM-T311)/i // Samsung Galaxy Tab 3 8.0
], [[MODEL, 'Galaxy Tab 3 8.0'], [VENDOR, 'Samsung'], [TYPE, TABLET]], [
/(R1001)/i // Oppo R1001
], [MODEL, [VENDOR, 'OPPO'], [TYPE, MOBILE]], [
/(X9006)/i // Oppo Find 7a
], [[MODEL, 'Find 7a'], [VENDOR, 'Oppo'], [TYPE, MOBILE]], [
/(R2001)/i // Oppo YOYO R2001
], [[MODEL, 'Yoyo R2001'], [VENDOR, 'Oppo'], [TYPE, MOBILE]], [
/(R815)/i // Oppo Clover R815
], [[MODEL, 'Clover R815'], [VENDOR, 'Oppo'], [TYPE, MOBILE]], [
/(U707)/i // Oppo Find Way S
], [[MODEL, 'Find Way S'], [VENDOR, 'Oppo'], [TYPE, MOBILE]], [
/(T3C)/i // Advan Vandroid T3C
], [MODEL, [VENDOR, 'Advan'], [TYPE, TABLET]], [
/(ADVAN T1J\+)/i // Advan Vandroid T1J+
], [[MODEL, 'Vandroid T1J+'], [VENDOR, 'Advan'], [TYPE, TABLET]], [
/(ADVAN S4A)/i // Advan Vandroid S4A
], [[MODEL, 'Vandroid S4A'], [VENDOR, 'Advan'], [TYPE, MOBILE]], [
/(V972M)/i // ZTE V972M
], [MODEL, [VENDOR, 'ZTE'], [TYPE, MOBILE]], [
/(i-mobile)\s(IQ\s[\d\.]+)/i // i-mobile IQ
], [VENDOR, MODEL, [TYPE, MOBILE]], [
/(IQ6.3)/i // i-mobile IQ IQ 6.3
], [[MODEL, 'IQ 6.3'], [VENDOR, 'i-mobile'], [TYPE, MOBILE]], [
/(i-mobile)\s(i-style\s[\d\.]+)/i // i-mobile i-STYLE
], [VENDOR, MODEL, [TYPE, MOBILE]], [
/(i-STYLE2.1)/i // i-mobile i-STYLE 2.1
], [[MODEL, 'i-STYLE 2.1'], [VENDOR, 'i-mobile'], [TYPE, MOBILE]], [
/(mobiistar touch LAI 512)/i // mobiistar touch LAI 512
], [[MODEL, 'Touch LAI 512'], [VENDOR, 'mobiistar'], [TYPE, MOBILE]], [
/////////////
// END TODO
///////////*/
],
engine : [[
/windows.+\sedge\/([\w\.]+)/i // EdgeHTML
], [VERSION, [NAME, 'EdgeHTML']], [
/(presto)\/([\w\.]+)/i, // Presto
/(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i, // WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m
/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i, // KHTML/Tasman/Links
/(icab)[\/\s]([23]\.[\d\.]+)/i // iCab
], [NAME, VERSION], [
/rv\:([\w\.]+).*(gecko)/i // Gecko
], [VERSION, NAME]
],
os : [[
// Windows based
/microsoft\s(windows)\s(vista|xp)/i // Windows (iTunes)
], [NAME, VERSION], [
/(windows)\snt\s6\.2;\s(arm)/i, // Windows RT
/(windows\sphone(?:\sos)*)[\s\/]?([\d\.\s]+\w)*/i, // Windows Phone
/(windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i
], [NAME, [VERSION, mapper.str, maps.os.windows.version]], [
/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i
], [[NAME, 'Windows'], [VERSION, mapper.str, maps.os.windows.version]], [
// Mobile/Embedded OS
/\((bb)(10);/i // BlackBerry 10
], [[NAME, 'BlackBerry'], VERSION], [
/(blackberry)\w*\/?([\w\.]+)*/i, // Blackberry
/(tizen)[\/\s]([\w\.]+)/i, // Tizen
/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|contiki)[\/\s-]?([\w\.]+)*/i,
// Android/WebOS/Palm/QNX/Bada/RIM/MeeGo/Contiki
/linux;.+(sailfish);/i // Sailfish OS
], [NAME, VERSION], [
/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i // Symbian
], [[NAME, 'Symbian'], VERSION], [
/\((series40);/i // Series 40
], [NAME], [
/mozilla.+\(mobile;.+gecko.+firefox/i // Firefox OS
], [[NAME, 'Firefox OS'], VERSION], [
// Console
/(nintendo|playstation)\s([wids34portablevu]+)/i, // Nintendo/Playstation
// GNU/Linux based
/(mint)[\/\s\(]?(\w+)*/i, // Mint
/(mageia|vectorlinux)[;\s]/i, // Mageia/VectorLinux
/(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|(?=\s)arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?(?!chrom)([\w\.-]+)*/i,
// Joli/Ubuntu/Debian/SUSE/Gentoo/Arch/Slackware
// Fedora/Mandriva/CentOS/PCLinuxOS/RedHat/Zenwalk/Linpus
/(hurd|linux)\s?([\w\.]+)*/i, // Hurd/Linux
/(gnu)\s?([\w\.]+)*/i // GNU
], [NAME, VERSION], [
/(cros)\s[\w]+\s([\w\.]+\w)/i // Chromium OS
], [[NAME, 'Chromium OS'], VERSION],[
// Solaris
/(sunos)\s?([\w\.]+\d)*/i // Solaris
], [[NAME, 'Solaris'], VERSION], [
// BSD based
/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i // FreeBSD/NetBSD/OpenBSD/PC-BSD/DragonFly
], [NAME, VERSION],[
/(haiku)\s(\w+)/i // Haiku
], [NAME, VERSION],[
/(ip[honead]+)(?:.*os\s([\w]+)*\slike\smac|;\sopera)/i // iOS
], [[NAME, 'iOS'], [VERSION, /_/g, '.']], [
/(mac\sos\sx)\s?([\w\s\.]+\w)*/i,
/(macintosh|mac(?=_powerpc)\s)/i // Mac OS
], [[NAME, 'Mac OS'], [VERSION, /_/g, '.']], [
// Other
/((?:open)?solaris)[\/\s-]?([\w\.]+)*/i, // Solaris
/(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i, // AIX
/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms)/i,
// Plan9/Minix/BeOS/OS2/AmigaOS/MorphOS/RISCOS/OpenVMS
/(unix)\s?([\w\.]+)*/i // UNIX
], [NAME, VERSION]
]
};
/////////////////
// Constructor
////////////////
var UAParser = function (uastring, extensions) {
if (!(this instanceof UAParser)) {
return new UAParser(uastring, extensions).getResult();
}
var ua = uastring || ((window && window.navigator && window.navigator.userAgent) ? window.navigator.userAgent : EMPTY);
var rgxmap = extensions ? util.extend(regexes, extensions) : regexes;
this.getBrowser = function () {
var browser = mapper.rgx.apply(this, rgxmap.browser);
browser.major = util.major(browser.version);
return browser;
};
this.getCPU = function () {
return mapper.rgx.apply(this, rgxmap.cpu);
};
this.getDevice = function () {
return mapper.rgx.apply(this, rgxmap.device);
};
this.getEngine = function () {
return mapper.rgx.apply(this, rgxmap.engine);
};
this.getOS = function () {
return mapper.rgx.apply(this, rgxmap.os);
};
this.getResult = function() {
return {
ua : this.getUA(),
browser : this.getBrowser(),
engine : this.getEngine(),
os : this.getOS(),
device : this.getDevice(),
cpu : this.getCPU()
};
};
this.getUA = function () {
return ua;
};
this.setUA = function (uastring) {
ua = uastring;
return this;
};
return this;
};
UAParser.VERSION = LIBVERSION;
UAParser.BROWSER = {
NAME : NAME,
MAJOR : MAJOR, // deprecated
VERSION : VERSION
};
UAParser.CPU = {
ARCHITECTURE : ARCHITECTURE
};
UAParser.DEVICE = {
MODEL : MODEL,
VENDOR : VENDOR,
TYPE : TYPE,
CONSOLE : CONSOLE,
MOBILE : MOBILE,
SMARTTV : SMARTTV,
TABLET : TABLET,
WEARABLE: WEARABLE,
EMBEDDED: EMBEDDED
};
UAParser.ENGINE = {
NAME : NAME,
VERSION : VERSION
};
UAParser.OS = {
NAME : NAME,
VERSION : VERSION
};
///////////
// Export
//////////
// check js environment
if (typeof(exports) !== UNDEF_TYPE) {
// nodejs env
if (typeof module !== UNDEF_TYPE && module.exports) {
exports = module.exports = UAParser;
}
exports.UAParser = UAParser;
} else {
// requirejs env (optional)
if ("function" === FUNC_TYPE && __webpack_require__(/*! !webpack amd options */ 1139)) {
!(__WEBPACK_AMD_DEFINE_RESULT__ = function () {
return UAParser;
}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
} else {
// browser env
window.UAParser = UAParser;
}
}
// jQuery/Zepto specific (optional)
// Note:
// In AMD env the global scope should be kept clean, but jQuery is an exception.
// jQuery always exports to global scope, unless jQuery.noConflict(true) is used,
// and we should catch that.
var $ = window.jQuery || window.Zepto;
if (typeof $ !== UNDEF_TYPE) {
var parser = new UAParser();
$.ua = parser.getResult();
$.ua.get = function() {
return parser.getUA();
};
$.ua.set = function (uastring) {
parser.setUA(uastring);
var result = parser.getResult();
for (var prop in result) {
$.ua[prop] = result[prop];
}
};
}
})(typeof window === 'object' ? window : this);
/***/ },
/* 1139 */
/*!****************************************!*\
!*** (webpack)/buildin/amd-options.js ***!
\****************************************/
/***/ function(module, exports) {
/* WEBPACK VAR INJECTION */(function(__webpack_amd_options__) {module.exports = __webpack_amd_options__;
/* WEBPACK VAR INJECTION */}.call(exports, {}))
/***/ },
/* 1140 */
/*!************************************!*\
!*** ./~/fbjs/lib/VersionRange.js ***!
\************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var invariant = __webpack_require__(/*! ./invariant */ 9);
var componentRegex = /\./;
var orRegex = /\|\|/;
var rangeRegex = /\s+\-\s+/;
var modifierRegex = /^(<=|<|=|>=|~>|~|>|)?\s*(.+)/;
var numericRegex = /^(\d*)(.*)/;
/**
* Splits input `range` on "||" and returns true if any subrange matches
* `version`.
*
* @param {string} range
* @param {string} version
* @returns {boolean}
*/
function checkOrExpression(range, version) {
var expressions = range.split(orRegex);
if (expressions.length > 1) {
return expressions.some(function (range) {
return VersionRange.contains(range, version);
});
} else {
range = expressions[0].trim();
return checkRangeExpression(range, version);
}
}
/**
* Splits input `range` on " - " (the surrounding whitespace is required) and
* returns true if version falls between the two operands.
*
* @param {string} range
* @param {string} version
* @returns {boolean}
*/
function checkRangeExpression(range, version) {
var expressions = range.split(rangeRegex);
!(expressions.length > 0 && expressions.length <= 2) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'the "-" operator expects exactly 2 operands') : invariant(false) : void 0;
if (expressions.length === 1) {
return checkSimpleExpression(expressions[0], version);
} else {
var startVersion = expressions[0],
endVersion = expressions[1];
!(isSimpleVersion(startVersion) && isSimpleVersion(endVersion)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'operands to the "-" operator must be simple (no modifiers)') : invariant(false) : void 0;
return checkSimpleExpression('>=' + startVersion, version) && checkSimpleExpression('<=' + endVersion, version);
}
}
/**
* Checks if `range` matches `version`. `range` should be a "simple" range (ie.
* not a compound range using the " - " or "||" operators).
*
* @param {string} range
* @param {string} version
* @returns {boolean}
*/
function checkSimpleExpression(range, version) {
range = range.trim();
if (range === '') {
return true;
}
var versionComponents = version.split(componentRegex);
var _getModifierAndCompon = getModifierAndComponents(range),
modifier = _getModifierAndCompon.modifier,
rangeComponents = _getModifierAndCompon.rangeComponents;
switch (modifier) {
case '<':
return checkLessThan(versionComponents, rangeComponents);
case '<=':
return checkLessThanOrEqual(versionComponents, rangeComponents);
case '>=':
return checkGreaterThanOrEqual(versionComponents, rangeComponents);
case '>':
return checkGreaterThan(versionComponents, rangeComponents);
case '~':
case '~>':
return checkApproximateVersion(versionComponents, rangeComponents);
default:
return checkEqual(versionComponents, rangeComponents);
}
}
/**
* Checks whether `a` is less than `b`.
*
* @param {array<string>} a
* @param {array<string>} b
* @returns {boolean}
*/
function checkLessThan(a, b) {
return compareComponents(a, b) === -1;
}
/**
* Checks whether `a` is less than or equal to `b`.
*
* @param {array<string>} a
* @param {array<string>} b
* @returns {boolean}
*/
function checkLessThanOrEqual(a, b) {
var result = compareComponents(a, b);
return result === -1 || result === 0;
}
/**
* Checks whether `a` is equal to `b`.
*
* @param {array<string>} a
* @param {array<string>} b
* @returns {boolean}
*/
function checkEqual(a, b) {
return compareComponents(a, b) === 0;
}
/**
* Checks whether `a` is greater than or equal to `b`.
*
* @param {array<string>} a
* @param {array<string>} b
* @returns {boolean}
*/
function checkGreaterThanOrEqual(a, b) {
var result = compareComponents(a, b);
return result === 1 || result === 0;
}
/**
* Checks whether `a` is greater than `b`.
*
* @param {array<string>} a
* @param {array<string>} b
* @returns {boolean}
*/
function checkGreaterThan(a, b) {
return compareComponents(a, b) === 1;
}
/**
* Checks whether `a` is "reasonably close" to `b` (as described in
* https://www.npmjs.org/doc/misc/semver.html). For example, if `b` is "1.3.1"
* then "reasonably close" is defined as ">= 1.3.1 and < 1.4".
*
* @param {array<string>} a
* @param {array<string>} b
* @returns {boolean}
*/
function checkApproximateVersion(a, b) {
var lowerBound = b.slice();
var upperBound = b.slice();
if (upperBound.length > 1) {
upperBound.pop();
}
var lastIndex = upperBound.length - 1;
var numeric = parseInt(upperBound[lastIndex], 10);
if (isNumber(numeric)) {
upperBound[lastIndex] = numeric + 1 + '';
}
return checkGreaterThanOrEqual(a, lowerBound) && checkLessThan(a, upperBound);
}
/**
* Extracts the optional modifier (<, <=, =, >=, >, ~, ~>) and version
* components from `range`.
*
* For example, given `range` ">= 1.2.3" returns an object with a `modifier` of
* `">="` and `components` of `[1, 2, 3]`.
*
* @param {string} range
* @returns {object}
*/
function getModifierAndComponents(range) {
var rangeComponents = range.split(componentRegex);
var matches = rangeComponents[0].match(modifierRegex);
!matches ? process.env.NODE_ENV !== 'production' ? invariant(false, 'expected regex to match but it did not') : invariant(false) : void 0;
return {
modifier: matches[1],
rangeComponents: [matches[2]].concat(rangeComponents.slice(1))
};
}
/**
* Determines if `number` is a number.
*
* @param {mixed} number
* @returns {boolean}
*/
function isNumber(number) {
return !isNaN(number) && isFinite(number);
}
/**
* Tests whether `range` is a "simple" version number without any modifiers
* (">", "~" etc).
*
* @param {string} range
* @returns {boolean}
*/
function isSimpleVersion(range) {
return !getModifierAndComponents(range).modifier;
}
/**
* Zero-pads array `array` until it is at least `length` long.
*
* @param {array} array
* @param {number} length
*/
function zeroPad(array, length) {
for (var i = array.length; i < length; i++) {
array[i] = '0';
}
}
/**
* Normalizes `a` and `b` in preparation for comparison by doing the following:
*
* - zero-pads `a` and `b`
* - marks any "x", "X" or "*" component in `b` as equivalent by zero-ing it out
* in both `a` and `b`
* - marks any final "*" component in `b` as a greedy wildcard by zero-ing it
* and all of its successors in `a`
*
* @param {array<string>} a
* @param {array<string>} b
* @returns {array<array<string>>}
*/
function normalizeVersions(a, b) {
a = a.slice();
b = b.slice();
zeroPad(a, b.length);
// mark "x" and "*" components as equal
for (var i = 0; i < b.length; i++) {
var matches = b[i].match(/^[x*]$/i);
if (matches) {
b[i] = a[i] = '0';
// final "*" greedily zeros all remaining components
if (matches[0] === '*' && i === b.length - 1) {
for (var j = i; j < a.length; j++) {
a[j] = '0';
}
}
}
}
zeroPad(b, a.length);
return [a, b];
}
/**
* Returns the numerical -- not the lexicographical -- ordering of `a` and `b`.
*
* For example, `10-alpha` is greater than `2-beta`.
*
* @param {string} a
* @param {string} b
* @returns {number} -1, 0 or 1 to indicate whether `a` is less than, equal to,
* or greater than `b`, respectively
*/
function compareNumeric(a, b) {
var aPrefix = a.match(numericRegex)[1];
var bPrefix = b.match(numericRegex)[1];
var aNumeric = parseInt(aPrefix, 10);
var bNumeric = parseInt(bPrefix, 10);
if (isNumber(aNumeric) && isNumber(bNumeric) && aNumeric !== bNumeric) {
return compare(aNumeric, bNumeric);
} else {
return compare(a, b);
}
}
/**
* Returns the ordering of `a` and `b`.
*
* @param {string|number} a
* @param {string|number} b
* @returns {number} -1, 0 or 1 to indicate whether `a` is less than, equal to,
* or greater than `b`, respectively
*/
function compare(a, b) {
!(typeof a === typeof b) ? process.env.NODE_ENV !== 'production' ? invariant(false, '"a" and "b" must be of the same type') : invariant(false) : void 0;
if (a > b) {
return 1;
} else if (a < b) {
return -1;
} else {
return 0;
}
}
/**
* Compares arrays of version components.
*
* @param {array<string>} a
* @param {array<string>} b
* @returns {number} -1, 0 or 1 to indicate whether `a` is less than, equal to,
* or greater than `b`, respectively
*/
function compareComponents(a, b) {
var _normalizeVersions = normalizeVersions(a, b),
aNormalized = _normalizeVersions[0],
bNormalized = _normalizeVersions[1];
for (var i = 0; i < bNormalized.length; i++) {
var result = compareNumeric(aNormalized[i], bNormalized[i]);
if (result) {
return result;
}
}
return 0;
}
var VersionRange = {
/**
* Checks whether `version` satisfies the `range` specification.
*
* We support a subset of the expressions defined in
* https://www.npmjs.org/doc/misc/semver.html:
*
* version Must match version exactly
* =version Same as just version
* >version Must be greater than version
* >=version Must be greater than or equal to version
* <version Must be less than version
* <=version Must be less than or equal to version
* ~version Must be at least version, but less than the next significant
* revision above version:
* "~1.2.3" is equivalent to ">= 1.2.3 and < 1.3"
* ~>version Equivalent to ~version
* 1.2.x Must match "1.2.x", where "x" is a wildcard that matches
* anything
* 1.2.* Similar to "1.2.x", but "*" in the trailing position is a
* "greedy" wildcard, so will match any number of additional
* components:
* "1.2.*" will match "1.2.1", "1.2.1.1", "1.2.1.1.1" etc
* * Any version
* "" (Empty string) Same as *
* v1 - v2 Equivalent to ">= v1 and <= v2"
* r1 || r2 Passes if either r1 or r2 are satisfied
*
* @param {string} range
* @param {string} version
* @returns {boolean}
*/
contains: function contains(range, version) {
return checkOrExpression(range.trim(), version.trim());
}
};
module.exports = VersionRange;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 1141 */
/*!*********************************!*\
!*** ./~/fbjs/lib/mapObject.js ***!
\*********************************/
/***/ function(module, exports) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var hasOwnProperty = Object.prototype.hasOwnProperty;
/**
* Executes the provided `callback` once for each enumerable own property in the
* object and constructs a new object from the results. The `callback` is
* invoked with three arguments:
*
* - the property value
* - the property name
* - the object being traversed
*
* Properties that are added after the call to `mapObject` will not be visited
* by `callback`. If the values of existing properties are changed, the value
* passed to `callback` will be the value at the time `mapObject` visits them.
* Properties that are deleted before being visited are not visited.
*
* @grep function objectMap()
* @grep function objMap()
*
* @param {?object} object
* @param {function} callback
* @param {*} context
* @return {?object}
*/
function mapObject(object, callback, context) {
if (!object) {
return null;
}
var result = {};
for (var name in object) {
if (hasOwnProperty.call(object, name)) {
result[name] = callback.call(context, object[name], name, object);
}
}
return result;
}
module.exports = mapObject;
/***/ },
/* 1142 */
/*!***************************************************!*\
!*** ./~/draft-js/lib/setDraftEditorSelection.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule setDraftEditorSelection
* @typechecks
*
*/
'use strict';
var containsNode = __webpack_require__(/*! fbjs/lib/containsNode */ 150);
var getActiveElement = __webpack_require__(/*! fbjs/lib/getActiveElement */ 153);
/**
* In modern non-IE browsers, we can support both forward and backward
* selections.
*
* Note: IE10+ supports the Selection object, but it does not support
* the `extend` method, which means that even in modern IE, it's not possible
* to programatically create a backward selection. Thus, for all IE
* versions, we use the old IE API to create our selections.
*/
function setDraftEditorSelection(selectionState, node, blockKey, nodeStart, nodeEnd) {
// It's possible that the editor has been removed from the DOM but
// our selection code doesn't know it yet. Forcing selection in
// this case may lead to errors, so just bail now.
if (!containsNode(document.documentElement, node)) {
return;
}
var selection = global.getSelection();
var anchorKey = selectionState.getAnchorKey();
var anchorOffset = selectionState.getAnchorOffset();
var focusKey = selectionState.getFocusKey();
var focusOffset = selectionState.getFocusOffset();
var isBackward = selectionState.getIsBackward();
// IE doesn't support backward selection. Swap key/offset pairs.
if (!selection.extend && isBackward) {
var tempKey = anchorKey;
var tempOffset = anchorOffset;
anchorKey = focusKey;
anchorOffset = focusOffset;
focusKey = tempKey;
focusOffset = tempOffset;
isBackward = false;
}
var hasAnchor = anchorKey === blockKey && nodeStart <= anchorOffset && nodeEnd >= anchorOffset;
var hasFocus = focusKey === blockKey && nodeStart <= focusOffset && nodeEnd >= focusOffset;
// If the selection is entirely bound within this node, set the selection
// and be done.
if (hasAnchor && hasFocus) {
selection.removeAllRanges();
addPointToSelection(selection, node, anchorOffset - nodeStart);
addFocusToSelection(selection, node, focusOffset - nodeStart);
return;
}
if (!isBackward) {
// If the anchor is within this node, set the range start.
if (hasAnchor) {
selection.removeAllRanges();
addPointToSelection(selection, node, anchorOffset - nodeStart);
}
// If the focus is within this node, we can assume that we have
// already set the appropriate start range on the selection, and
// can simply extend the selection.
if (hasFocus) {
addFocusToSelection(selection, node, focusOffset - nodeStart);
}
} else {
// If this node has the focus, set the selection range to be a
// collapsed range beginning here. Later, when we encounter the anchor,
// we'll use this information to extend the selection.
if (hasFocus) {
selection.removeAllRanges();
addPointToSelection(selection, node, focusOffset - nodeStart);
}
// If this node has the anchor, we may assume that the correct
// focus information is already stored on the selection object.
// We keep track of it, reset the selection range, and extend it
// back to the focus point.
if (hasAnchor) {
var storedFocusNode = selection.focusNode;
var storedFocusOffset = selection.focusOffset;
selection.removeAllRanges();
addPointToSelection(selection, node, anchorOffset - nodeStart);
addFocusToSelection(selection, storedFocusNode, storedFocusOffset);
}
}
}
/**
* Extend selection towards focus point.
*/
function addFocusToSelection(selection, node, offset) {
if (selection.extend && containsNode(getActiveElement(), node)) {
// If `extend` is called while another element has focus, an error is
// thrown. We therefore disable `extend` if the active element is somewhere
// other than the node we are selecting. This should only occur in Firefox,
// since it is the only browser to support multiple selections.
// See https://bugzilla.mozilla.org/show_bug.cgi?id=921444.
selection.extend(node, offset);
} else {
// IE doesn't support extend. This will mean no backward selection.
// Extract the existing selection range and add focus to it.
// Additionally, clone the selection range. IE11 throws an
// InvalidStateError when attempting to access selection properties
// after the range is detached.
var range = selection.getRangeAt(0);
range.setEnd(node, offset);
selection.addRange(range.cloneRange());
}
}
function addPointToSelection(selection, node, offset) {
var range = document.createRange();
range.setStart(node, offset);
selection.addRange(range);
}
module.exports = setDraftEditorSelection;
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
/***/ },
/* 1143 */
/*!******************************************!*\
!*** ./~/draft-js/lib/DraftOffsetKey.js ***!
\******************************************/
/***/ function(module, exports) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule DraftOffsetKey
*
*/
'use strict';
var KEY_DELIMITER = '-';
var DraftOffsetKey = {
encode: function encode(blockKey, decoratorKey, leafKey) {
return blockKey + KEY_DELIMITER + decoratorKey + KEY_DELIMITER + leafKey;
},
decode: function decode(offsetKey) {
var _offsetKey$split = offsetKey.split(KEY_DELIMITER);
var blockKey = _offsetKey$split[0];
var decoratorKey = _offsetKey$split[1];
var leafKey = _offsetKey$split[2];
return {
blockKey: blockKey,
decoratorKey: parseInt(decoratorKey, 10),
leafKey: parseInt(leafKey, 10)
};
}
};
module.exports = DraftOffsetKey;
/***/ },
/* 1144 */
/*!******************************!*\
!*** ./~/fbjs/lib/Scroll.js ***!
\******************************/
/***/ function(module, exports) {
"use strict";
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
/**
* @param {DOMElement} element
* @param {DOMDocument} doc
* @return {boolean}
*/
function _isViewportScrollElement(element, doc) {
return !!doc && (element === doc.documentElement || element === doc.body);
}
/**
* Scroll Module. This class contains 4 simple static functions
* to be used to access Element.scrollTop/scrollLeft properties.
* To solve the inconsistencies between browsers when either
* document.body or document.documentElement is supplied,
* below logic will be used to alleviate the issue:
*
* 1. If 'element' is either 'document.body' or 'document.documentElement,
* get whichever element's 'scroll{Top,Left}' is larger.
* 2. If 'element' is either 'document.body' or 'document.documentElement',
* set the 'scroll{Top,Left}' on both elements.
*/
var Scroll = {
/**
* @param {DOMElement} element
* @return {number}
*/
getTop: function getTop(element) {
var doc = element.ownerDocument;
return _isViewportScrollElement(element, doc) ?
// In practice, they will either both have the same value,
// or one will be zero and the other will be the scroll position
// of the viewport. So we can use `X || Y` instead of `Math.max(X, Y)`
doc.body.scrollTop || doc.documentElement.scrollTop : element.scrollTop;
},
/**
* @param {DOMElement} element
* @param {number} newTop
*/
setTop: function setTop(element, newTop) {
var doc = element.ownerDocument;
if (_isViewportScrollElement(element, doc)) {
doc.body.scrollTop = doc.documentElement.scrollTop = newTop;
} else {
element.scrollTop = newTop;
}
},
/**
* @param {DOMElement} element
* @return {number}
*/
getLeft: function getLeft(element) {
var doc = element.ownerDocument;
return _isViewportScrollElement(element, doc) ? doc.body.scrollLeft || doc.documentElement.scrollLeft : element.scrollLeft;
},
/**
* @param {DOMElement} element
* @param {number} newLeft
*/
setLeft: function setLeft(element, newLeft) {
var doc = element.ownerDocument;
if (_isViewportScrollElement(element, doc)) {
doc.body.scrollLeft = doc.documentElement.scrollLeft = newLeft;
} else {
element.scrollLeft = newLeft;
}
}
};
module.exports = Scroll;
/***/ },
/* 1145 */
/*!*****************************!*\
!*** ./~/fbjs/lib/Style.js ***!
\*****************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @typechecks
*/
var getStyleProperty = __webpack_require__(/*! ./getStyleProperty */ 1146);
/**
* @param {DOMNode} element [description]
* @param {string} name Overflow style property name.
* @return {boolean} True if the supplied ndoe is scrollable.
*/
function _isNodeScrollable(element, name) {
var overflow = Style.get(element, name);
return overflow === 'auto' || overflow === 'scroll';
}
/**
* Utilities for querying and mutating style properties.
*/
var Style = {
/**
* Gets the style property for the supplied node. This will return either the
* computed style, if available, or the declared style.
*
* @param {DOMNode} node
* @param {string} name Style property name.
* @return {?string} Style property value.
*/
get: getStyleProperty,
/**
* Determines the nearest ancestor of a node that is scrollable.
*
* NOTE: This can be expensive if used repeatedly or on a node nested deeply.
*
* @param {?DOMNode} node Node from which to start searching.
* @return {?DOMWindow|DOMElement} Scroll parent of the supplied node.
*/
getScrollParent: function getScrollParent(node) {
if (!node) {
return null;
}
while (node && node !== document.body) {
if (_isNodeScrollable(node, 'overflow') || _isNodeScrollable(node, 'overflowY') || _isNodeScrollable(node, 'overflowX')) {
return node;
}
node = node.parentNode;
}
return window;
}
};
module.exports = Style;
/***/ },
/* 1146 */
/*!****************************************!*\
!*** ./~/fbjs/lib/getStyleProperty.js ***!
\****************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @typechecks
*/
var camelize = __webpack_require__(/*! ./camelize */ 99);
var hyphenate = __webpack_require__(/*! ./hyphenate */ 102);
function asString(value) /*?string*/{
return value == null ? value : String(value);
}
function getStyleProperty( /*DOMNode*/node, /*string*/name) /*?string*/{
var computedStyle = void 0;
// W3C Standard
if (window.getComputedStyle) {
// In certain cases such as within an iframe in FF3, this returns null.
computedStyle = window.getComputedStyle(node, null);
if (computedStyle) {
return asString(computedStyle.getPropertyValue(hyphenate(name)));
}
}
// Safari
if (document.defaultView && document.defaultView.getComputedStyle) {
computedStyle = document.defaultView.getComputedStyle(node, null);
// A Safari bug causes this to return null for `display: none` elements.
if (computedStyle) {
return asString(computedStyle.getPropertyValue(hyphenate(name)));
}
if (name === 'display') {
return 'none';
}
}
// Internet Explorer
if (node.currentStyle) {
if (name === 'float') {
return asString(node.currentStyle.cssFloat || node.currentStyle.styleFloat);
}
return asString(node.currentStyle[camelize(name)]);
}
return asString(node.style && node.style[camelize(name)]);
}
module.exports = getStyleProperty;
/***/ },
/* 1147 */
/*!******************************************!*\
!*** ./~/fbjs/lib/getElementPosition.js ***!
\******************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @typechecks
*/
var getElementRect = __webpack_require__(/*! ./getElementRect */ 1148);
/**
* Gets an element's position in pixels relative to the viewport. The returned
* object represents the position of the element's top left corner.
*
* @param {DOMElement} element
* @return {object}
*/
function getElementPosition(element) {
var rect = getElementRect(element);
return {
x: rect.left,
y: rect.top,
width: rect.right - rect.left,
height: rect.bottom - rect.top
};
}
module.exports = getElementPosition;
/***/ },
/* 1148 */
/*!**************************************!*\
!*** ./~/fbjs/lib/getElementRect.js ***!
\**************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @typechecks
*/
var containsNode = __webpack_require__(/*! ./containsNode */ 150);
/**
* Gets an element's bounding rect in pixels relative to the viewport.
*
* @param {DOMElement} elem
* @return {object}
*/
function getElementRect(elem) {
var docElem = document.documentElement;
// FF 2, Safari 3 and Opera 9.5- do not support getBoundingClientRect().
// IE9- will throw if the element is not in the document.
if (!('getBoundingClientRect' in elem) || !containsNode(docElem, elem)) {
return {
left: 0,
right: 0,
top: 0,
bottom: 0
};
}
// Subtracts clientTop/Left because IE8- added a 2px border to the
// <html> element (see http://fburl.com/1493213). IE 7 in
// Quicksmode does not report clientLeft/clientTop so there
// will be an unaccounted offset of 2px when in quirksmode
var rect = elem.getBoundingClientRect();
return {
left: Math.round(rect.left) - docElem.clientLeft,
right: Math.round(rect.right) - docElem.clientLeft,
top: Math.round(rect.top) - docElem.clientTop,
bottom: Math.round(rect.bottom) - docElem.clientTop
};
}
module.exports = getElementRect;
/***/ },
/* 1149 */
/*!*****************************************!*\
!*** ./~/fbjs/lib/getScrollPosition.js ***!
\*****************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @typechecks
*/
'use strict';
var getDocumentScrollElement = __webpack_require__(/*! ./getDocumentScrollElement */ 1150);
var getUnboundedScrollPosition = __webpack_require__(/*! ./getUnboundedScrollPosition */ 144);
/**
* Gets the scroll position of the supplied element or window.
*
* The return values are bounded. This means that if the scroll position is
* negative or exceeds the element boundaries (which is possible using inertial
* scrolling), you will get zero or the maximum scroll position, respectively.
*
* If you need the unbound scroll position, use `getUnboundedScrollPosition`.
*
* @param {DOMWindow|DOMElement} scrollable
* @return {object} Map with `x` and `y` keys.
*/
function getScrollPosition(scrollable) {
var documentScrollElement = getDocumentScrollElement();
if (scrollable === window) {
scrollable = documentScrollElement;
}
var scrollPosition = getUnboundedScrollPosition(scrollable);
var viewport = scrollable === documentScrollElement ? document.documentElement : scrollable;
var xMax = scrollable.scrollWidth - viewport.clientWidth;
var yMax = scrollable.scrollHeight - viewport.clientHeight;
scrollPosition.x = Math.max(0, Math.min(scrollPosition.x, xMax));
scrollPosition.y = Math.max(0, Math.min(scrollPosition.y, yMax));
return scrollPosition;
}
module.exports = getScrollPosition;
/***/ },
/* 1150 */
/*!************************************************!*\
!*** ./~/fbjs/lib/getDocumentScrollElement.js ***!
\************************************************/
/***/ function(module, exports) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @typechecks
*/
'use strict';
var isWebkit = typeof navigator !== 'undefined' && navigator.userAgent.indexOf('AppleWebKit') > -1;
/**
* Gets the element with the document scroll properties such as `scrollLeft` and
* `scrollHeight`. This may differ across different browsers.
*
* NOTE: The return value can be null if the DOM is not yet ready.
*
* @param {?DOMDocument} doc Defaults to current document.
* @return {?DOMElement}
*/
function getDocumentScrollElement(doc) {
doc = doc || document;
return !isWebkit && doc.compatMode === 'CSS1Compat' ? doc.documentElement : doc.body;
}
module.exports = getDocumentScrollElement;
/***/ },
/* 1151 */
/*!*********************************************!*\
!*** ./~/fbjs/lib/getViewportDimensions.js ***!
\*********************************************/
/***/ function(module, exports) {
"use strict";
function getViewportWidth() {
var width = void 0;
if (document.documentElement) {
width = document.documentElement.clientWidth;
}
if (!width && document.body) {
width = document.body.clientWidth;
}
return width || 0;
} /**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
* @typechecks
*/
function getViewportHeight() {
var height = void 0;
if (document.documentElement) {
height = document.documentElement.clientHeight;
}
if (!height && document.body) {
height = document.body.clientHeight;
}
return height || 0;
}
/**
* Gets the viewport dimensions including any scrollbars.
*/
function getViewportDimensions() {
return {
width: window.innerWidth || getViewportWidth(),
height: window.innerHeight || getViewportHeight()
};
}
/**
* Gets the viewport dimensions excluding any scrollbars.
*/
getViewportDimensions.withoutScrollbars = function () {
return {
width: getViewportWidth(),
height: getViewportHeight()
};
};
module.exports = getViewportDimensions;
/***/ },
/* 1152 */
/*!***********************************!*\
!*** ./~/fbjs/lib/joinClasses.js ***!
\***********************************/
/***/ function(module, exports) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @typechecks static-only
*/
'use strict';
/**
* Combines multiple className strings into one.
* http://jsperf.com/joinclasses-args-vs-array
*
* @param {...?string} className
* @return {string}
*/
function joinClasses(className /*, ... */) {
if (!className) {
className = '';
}
var nextClass = void 0;
var argLength = arguments.length;
if (argLength > 1) {
for (var ii = 1; ii < argLength; ii++) {
nextClass = arguments[ii];
if (nextClass) {
className = (className ? className + ' ' : '') + nextClass;
}
}
}
return className;
}
module.exports = joinClasses;
/***/ },
/* 1153 */
/*!**************************************************!*\
!*** ./~/draft-js/lib/DraftEditorDragHandler.js ***!
\**************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule DraftEditorDragHandler
* @typechecks
*
*/
'use strict';
var DataTransfer = __webpack_require__(/*! fbjs/lib/DataTransfer */ 1154);
var DraftModifier = __webpack_require__(/*! ./DraftModifier */ 1095);
var EditorState = __webpack_require__(/*! ./EditorState */ 1113);
var findAncestorOffsetKey = __webpack_require__(/*! ./findAncestorOffsetKey */ 1156);
var getTextContentFromFiles = __webpack_require__(/*! ./getTextContentFromFiles */ 1158);
var getUpdatedSelectionState = __webpack_require__(/*! ./getUpdatedSelectionState */ 1159);
var nullthrows = __webpack_require__(/*! fbjs/lib/nullthrows */ 1122);
var isEventHandled = __webpack_require__(/*! ./isEventHandled */ 1160);
/**
* Get a SelectionState for the supplied mouse event.
*/
function getSelectionForEvent(event, editorState) {
var node = null;
var offset = null;
if (typeof document.caretRangeFromPoint === 'function') {
var dropRange = document.caretRangeFromPoint(event.x, event.y);
node = dropRange.startContainer;
offset = dropRange.startOffset;
} else if (event.rangeParent) {
node = event.rangeParent;
offset = event.rangeOffset;
} else {
return null;
}
node = nullthrows(node);
offset = nullthrows(offset);
var offsetKey = nullthrows(findAncestorOffsetKey(node));
return getUpdatedSelectionState(editorState, offsetKey, offset, offsetKey, offset);
}
var DraftEditorDragHandler = {
/**
* Drag originating from input terminated.
*/
onDragEnd: function onDragEnd() {
this.exitCurrentMode();
},
/**
* Handle data being dropped.
*/
onDrop: function onDrop(e) {
var _this = this;
var data = new DataTransfer(e.nativeEvent.dataTransfer);
var editorState = this.props.editorState;
var dropSelection = getSelectionForEvent(e.nativeEvent, editorState);
e.preventDefault();
this.exitCurrentMode();
if (dropSelection == null) {
return;
}
var files = data.getFiles();
if (files.length > 0) {
if (this.props.handleDroppedFiles && isEventHandled(this.props.handleDroppedFiles(dropSelection, files))) {
return;
}
getTextContentFromFiles(files, function (fileText) {
fileText && _this.update(insertTextAtSelection(editorState, nullthrows(dropSelection), // flow wtf
fileText));
});
return;
}
var dragType = this._internalDrag ? 'internal' : 'external';
if (this.props.handleDrop && isEventHandled(this.props.handleDrop(dropSelection, data, dragType))) {
return;
}
if (this._internalDrag) {
this.update(moveText(editorState, dropSelection));
return;
}
this.update(insertTextAtSelection(editorState, dropSelection, data.getText()));
}
};
function moveText(editorState, targetSelection) {
var newContentState = DraftModifier.moveText(editorState.getCurrentContent(), editorState.getSelection(), targetSelection);
return EditorState.push(editorState, newContentState, 'insert-fragment');
}
/**
* Insert text at a specified selection.
*/
function insertTextAtSelection(editorState, selection, text) {
var newContentState = DraftModifier.insertText(editorState.getCurrentContent(), selection, text, editorState.getCurrentInlineStyle());
return EditorState.push(editorState, newContentState, 'insert-fragment');
}
module.exports = DraftEditorDragHandler;
/***/ },
/* 1154 */
/*!************************************!*\
!*** ./~/fbjs/lib/DataTransfer.js ***!
\************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @typechecks
*/
var PhotosMimeType = __webpack_require__(/*! ./PhotosMimeType */ 1155);
var createArrayFromMixed = __webpack_require__(/*! ./createArrayFromMixed */ 90);
var emptyFunction = __webpack_require__(/*! ./emptyFunction */ 13);
var CR_LF_REGEX = new RegExp('\r\n', 'g');
var LF_ONLY = '\n';
var RICH_TEXT_TYPES = {
'text/rtf': 1,
'text/html': 1
};
/**
* If DataTransferItem is a file then return the Blob of data.
*
* @param {object} item
* @return {?blob}
*/
function getFileFromDataTransfer(item) {
if (item.kind == 'file') {
return item.getAsFile();
}
}
var DataTransfer = function () {
/**
* @param {object} data
*/
function DataTransfer(data) {
_classCallCheck(this, DataTransfer);
this.data = data;
// Types could be DOMStringList or array
this.types = data.types ? createArrayFromMixed(data.types) : [];
}
/**
* Is this likely to be a rich text data transfer?
*
* @return {boolean}
*/
DataTransfer.prototype.isRichText = function isRichText() {
// If HTML is available, treat this data as rich text. This way, we avoid
// using a pasted image if it is packaged with HTML -- this may occur with
// pastes from MS Word, for example. However this is only rich text if
// there's accompanying text.
if (this.getHTML() && this.getText()) {
return true;
}
// When an image is copied from a preview window, you end up with two
// DataTransferItems one of which is a file's metadata as text. Skip those.
if (this.isImage()) {
return false;
}
return this.types.some(function (type) {
return RICH_TEXT_TYPES[type];
});
};
/**
* Get raw text.
*
* @return {?string}
*/
DataTransfer.prototype.getText = function getText() {
var text;
if (this.data.getData) {
if (!this.types.length) {
text = this.data.getData('Text');
} else if (this.types.indexOf('text/plain') != -1) {
text = this.data.getData('text/plain');
}
}
return text ? text.replace(CR_LF_REGEX, LF_ONLY) : null;
};
/**
* Get HTML paste data
*
* @return {?string}
*/
DataTransfer.prototype.getHTML = function getHTML() {
if (this.data.getData) {
if (!this.types.length) {
return this.data.getData('Text');
} else if (this.types.indexOf('text/html') != -1) {
return this.data.getData('text/html');
}
}
};
/**
* Is this a link data transfer?
*
* @return {boolean}
*/
DataTransfer.prototype.isLink = function isLink() {
return this.types.some(function (type) {
return type.indexOf('Url') != -1 || type.indexOf('text/uri-list') != -1 || type.indexOf('text/x-moz-url');
});
};
/**
* Get a link url.
*
* @return {?string}
*/
DataTransfer.prototype.getLink = function getLink() {
if (this.data.getData) {
if (this.types.indexOf('text/x-moz-url') != -1) {
var url = this.data.getData('text/x-moz-url').split('\n');
return url[0];
}
return this.types.indexOf('text/uri-list') != -1 ? this.data.getData('text/uri-list') : this.data.getData('url');
}
return null;
};
/**
* Is this an image data transfer?
*
* @return {boolean}
*/
DataTransfer.prototype.isImage = function isImage() {
var isImage = this.types.some(function (type) {
// Firefox will have a type of application/x-moz-file for images during
// dragging
return type.indexOf('application/x-moz-file') != -1;
});
if (isImage) {
return true;
}
var items = this.getFiles();
for (var i = 0; i < items.length; i++) {
var type = items[i].type;
if (!PhotosMimeType.isImage(type)) {
return false;
}
}
return true;
};
DataTransfer.prototype.getCount = function getCount() {
if (this.data.hasOwnProperty('items')) {
return this.data.items.length;
} else if (this.data.hasOwnProperty('mozItemCount')) {
return this.data.mozItemCount;
} else if (this.data.files) {
return this.data.files.length;
}
return null;
};
/**
* Get files.
*
* @return {array}
*/
DataTransfer.prototype.getFiles = function getFiles() {
if (this.data.items) {
// createArrayFromMixed doesn't properly handle DataTransferItemLists.
return Array.prototype.slice.call(this.data.items).map(getFileFromDataTransfer).filter(emptyFunction.thatReturnsArgument);
} else if (this.data.files) {
return Array.prototype.slice.call(this.data.files);
} else {
return [];
}
};
/**
* Are there any files to fetch?
*
* @return {boolean}
*/
DataTransfer.prototype.hasFiles = function hasFiles() {
return this.getFiles().length > 0;
};
return DataTransfer;
}();
module.exports = DataTransfer;
/***/ },
/* 1155 */
/*!**************************************!*\
!*** ./~/fbjs/lib/PhotosMimeType.js ***!
\**************************************/
/***/ function(module, exports) {
'use strict';
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
var PhotosMimeType = {
isImage: function isImage(mimeString) {
return getParts(mimeString)[0] === 'image';
},
isJpeg: function isJpeg(mimeString) {
var parts = getParts(mimeString);
return PhotosMimeType.isImage(mimeString) && (
// see http://fburl.com/10972194
parts[1] === 'jpeg' || parts[1] === 'pjpeg');
}
};
function getParts(mimeString) {
return mimeString.split('/');
}
module.exports = PhotosMimeType;
/***/ },
/* 1156 */
/*!*************************************************!*\
!*** ./~/draft-js/lib/findAncestorOffsetKey.js ***!
\*************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule findAncestorOffsetKey
* @typechecks
*
*/
'use strict';
var getSelectionOffsetKeyForNode = __webpack_require__(/*! ./getSelectionOffsetKeyForNode */ 1157);
/**
* Get the key from the node's nearest offset-aware ancestor.
*/
function findAncestorOffsetKey(node) {
var searchNode = node;
while (searchNode && searchNode !== document.documentElement) {
var key = getSelectionOffsetKeyForNode(searchNode);
if (key != null) {
return key;
}
searchNode = searchNode.parentNode;
}
return null;
}
module.exports = findAncestorOffsetKey;
/***/ },
/* 1157 */
/*!********************************************************!*\
!*** ./~/draft-js/lib/getSelectionOffsetKeyForNode.js ***!
\********************************************************/
/***/ function(module, exports) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule getSelectionOffsetKeyForNode
* @typechecks
*
*/
'use strict';
/**
* Get offset key from a node or it's child nodes. Return the first offset key
* found on the DOM tree of given node.
*/
function getSelectionOffsetKeyForNode(node) {
if (node instanceof Element) {
var offsetKey = node.getAttribute('data-offset-key');
if (offsetKey) {
return offsetKey;
}
for (var ii = 0; ii < node.childNodes.length; ii++) {
var childOffsetKey = getSelectionOffsetKeyForNode(node.childNodes[ii]);
if (childOffsetKey) {
return childOffsetKey;
}
}
}
return null;
}
module.exports = getSelectionOffsetKeyForNode;
/***/ },
/* 1158 */
/*!***************************************************!*\
!*** ./~/draft-js/lib/getTextContentFromFiles.js ***!
\***************************************************/
/***/ function(module, exports) {
/* WEBPACK VAR INJECTION */(function(global) {/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule getTextContentFromFiles
*
*/
'use strict';
var TEXT_CLIPPING_REGEX = /\.textClipping$/;
var TEXT_TYPES = {
'text/plain': true,
'text/html': true,
'text/rtf': true
};
// Somewhat arbitrary upper bound on text size. Let's not lock up the browser.
var TEXT_SIZE_UPPER_BOUND = 5000;
/**
* Extract the text content from a file list.
*/
function getTextContentFromFiles(files, callback) {
var readCount = 0;
var results = [];
files.forEach(function ( /*blob*/file) {
readFile(file, function ( /*string*/text) {
readCount++;
text && results.push(text.slice(0, TEXT_SIZE_UPPER_BOUND));
if (readCount == files.length) {
callback(results.join('\r'));
}
});
});
}
/**
* todo isaac: Do work to turn html/rtf into a content fragment.
*/
function readFile(file, callback) {
if (!global.FileReader || file.type && !(file.type in TEXT_TYPES)) {
callback('');
return;
}
if (file.type === '') {
var contents = '';
// Special-case text clippings, which have an empty type but include
// `.textClipping` in the file name. `readAsText` results in an empty
// string for text clippings, so we force the file name to serve
// as the text value for the file.
if (TEXT_CLIPPING_REGEX.test(file.name)) {
contents = file.name.replace(TEXT_CLIPPING_REGEX, '');
}
callback(contents);
return;
}
var reader = new FileReader();
reader.onload = function () {
callback(reader.result);
};
reader.onerror = function () {
callback('');
};
reader.readAsText(file);
}
module.exports = getTextContentFromFiles;
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
/***/ },
/* 1159 */
/*!****************************************************!*\
!*** ./~/draft-js/lib/getUpdatedSelectionState.js ***!
\****************************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule getUpdatedSelectionState
*
*/
'use strict';
var DraftOffsetKey = __webpack_require__(/*! ./DraftOffsetKey */ 1143);
var nullthrows = __webpack_require__(/*! fbjs/lib/nullthrows */ 1122);
function getUpdatedSelectionState(editorState, anchorKey, anchorOffset, focusKey, focusOffset) {
var selection = nullthrows(editorState.getSelection());
if (process.env.NODE_ENV !== 'production') {
if (!anchorKey || !focusKey) {
/*eslint-disable no-console */
console.warn('Invalid selection state.', arguments, editorState.toJS());
/*eslint-enable no-console */
return selection;
}
}
var anchorPath = DraftOffsetKey.decode(anchorKey);
var anchorBlockKey = anchorPath.blockKey;
var anchorLeaf = editorState.getBlockTree(anchorBlockKey).getIn([anchorPath.decoratorKey, 'leaves', anchorPath.leafKey]);
var focusPath = DraftOffsetKey.decode(focusKey);
var focusBlockKey = focusPath.blockKey;
var focusLeaf = editorState.getBlockTree(focusBlockKey).getIn([focusPath.decoratorKey, 'leaves', focusPath.leafKey]);
var anchorLeafStart = anchorLeaf.get('start');
var focusLeafStart = focusLeaf.get('start');
var anchorBlockOffset = anchorLeaf ? anchorLeafStart + anchorOffset : null;
var focusBlockOffset = focusLeaf ? focusLeafStart + focusOffset : null;
var areEqual = selection.getAnchorKey() === anchorBlockKey && selection.getAnchorOffset() === anchorBlockOffset && selection.getFocusKey() === focusBlockKey && selection.getFocusOffset() === focusBlockOffset;
if (areEqual) {
return selection;
}
var isBackward = false;
if (anchorBlockKey === focusBlockKey) {
var anchorLeafEnd = anchorLeaf.get('end');
var focusLeafEnd = focusLeaf.get('end');
if (focusLeafStart === anchorLeafStart && focusLeafEnd === anchorLeafEnd) {
isBackward = focusOffset < anchorOffset;
} else {
isBackward = focusLeafStart < anchorLeafStart;
}
} else {
var startKey = editorState.getCurrentContent().getBlockMap().keySeq().skipUntil(function (v) {
return v === anchorBlockKey || v === focusBlockKey;
}).first();
isBackward = startKey === focusBlockKey;
}
return selection.merge({
anchorKey: anchorBlockKey,
anchorOffset: anchorBlockOffset,
focusKey: focusBlockKey,
focusOffset: focusBlockOffset,
isBackward: isBackward
});
}
module.exports = getUpdatedSelectionState;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 1160 */
/*!******************************************!*\
!*** ./~/draft-js/lib/isEventHandled.js ***!
\******************************************/
/***/ function(module, exports) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule isEventHandled
* @typechecks
*
*/
'use strict';
/**
* Utility method for determining whether or not the value returned
* from a handler indicates that it was handled.
*/
function isEventHandled(value) {
return value === 'handled' || value === true;
}
module.exports = isEventHandled;
/***/ },
/* 1161 */
/*!**************************************************!*\
!*** ./~/draft-js/lib/DraftEditorEditHandler.js ***!
\**************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule DraftEditorEditHandler
*
*/
'use strict';
var onBeforeInput = __webpack_require__(/*! ./editOnBeforeInput */ 1162);
var onBlur = __webpack_require__(/*! ./editOnBlur */ 1163);
var onCompositionStart = __webpack_require__(/*! ./editOnCompositionStart */ 1164);
var onCopy = __webpack_require__(/*! ./editOnCopy */ 1165);
var onCut = __webpack_require__(/*! ./editOnCut */ 1167);
var onDragOver = __webpack_require__(/*! ./editOnDragOver */ 1168);
var onDragStart = __webpack_require__(/*! ./editOnDragStart */ 1169);
var onFocus = __webpack_require__(/*! ./editOnFocus */ 1170);
var onInput = __webpack_require__(/*! ./editOnInput */ 1171);
var onKeyDown = __webpack_require__(/*! ./editOnKeyDown */ 1172);
var onPaste = __webpack_require__(/*! ./editOnPaste */ 1194);
var onSelect = __webpack_require__(/*! ./editOnSelect */ 1200);
var DraftEditorEditHandler = {
onBeforeInput: onBeforeInput,
onBlur: onBlur,
onCompositionStart: onCompositionStart,
onCopy: onCopy,
onCut: onCut,
onDragOver: onDragOver,
onDragStart: onDragStart,
onFocus: onFocus,
onInput: onInput,
onKeyDown: onKeyDown,
onPaste: onPaste,
onSelect: onSelect
};
module.exports = DraftEditorEditHandler;
/***/ },
/* 1162 */
/*!*********************************************!*\
!*** ./~/draft-js/lib/editOnBeforeInput.js ***!
\*********************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule editOnBeforeInput
*
*/
'use strict';
var BlockTree = __webpack_require__(/*! ./BlockTree */ 1114);
var DraftModifier = __webpack_require__(/*! ./DraftModifier */ 1095);
var EditorState = __webpack_require__(/*! ./EditorState */ 1113);
var UserAgent = __webpack_require__(/*! fbjs/lib/UserAgent */ 1136);
var getEntityKeyForSelection = __webpack_require__(/*! ./getEntityKeyForSelection */ 1130);
var isSelectionAtLeafStart = __webpack_require__(/*! ./isSelectionAtLeafStart */ 1131);
var nullthrows = __webpack_require__(/*! fbjs/lib/nullthrows */ 1122);
var isEventHandled = __webpack_require__(/*! ./isEventHandled */ 1160);
// When nothing is focused, Firefox regards two characters, `'` and `/`, as
// commands that should open and focus the "quickfind" search bar. This should
// *never* happen while a contenteditable is focused, but as of v28, it
// sometimes does, even when the keypress event target is the contenteditable.
// This breaks the input. Special case these characters to ensure that when
// they are typed, we prevent default on the event to make sure not to
// trigger quickfind.
var FF_QUICKFIND_CHAR = '\'';
var FF_QUICKFIND_LINK_CHAR = '\/';
var isFirefox = UserAgent.isBrowser('Firefox');
function mustPreventDefaultForCharacter(character) {
return isFirefox && (character == FF_QUICKFIND_CHAR || character == FF_QUICKFIND_LINK_CHAR);
}
/**
* Replace the current selection with the specified text string, with the
* inline style and entity key applied to the newly inserted text.
*/
function replaceText(editorState, text, inlineStyle, entityKey) {
var contentState = DraftModifier.replaceText(editorState.getCurrentContent(), editorState.getSelection(), text, inlineStyle, entityKey);
return EditorState.push(editorState, contentState, 'insert-characters');
}
/**
* When `onBeforeInput` executes, the browser is attempting to insert a
* character into the editor. Apply this character data to the document,
* allowing native insertion if possible.
*
* Native insertion is encouraged in order to limit re-rendering and to
* preserve spellcheck highlighting, which disappears or flashes if re-render
* occurs on the relevant text nodes.
*/
function editOnBeforeInput(e) {
var chars = e.data;
// In some cases (ex: IE ideographic space insertion) no character data
// is provided. There's nothing to do when this happens.
if (!chars) {
return;
}
// Allow the top-level component to handle the insertion manually. This is
// useful when triggering interesting behaviors for a character insertion,
// Simple examples: replacing a raw text ':)' with a smile emoji or image
// decorator, or setting a block to be a list item after typing '- ' at the
// start of the block.
if (this.props.handleBeforeInput && isEventHandled(this.props.handleBeforeInput(chars))) {
e.preventDefault();
return;
}
// If selection is collapsed, conditionally allow native behavior. This
// reduces re-renders and preserves spellcheck highlighting. If the selection
// is not collapsed, we will re-render.
var editorState = this.props.editorState;
var selection = editorState.getSelection();
if (!selection.isCollapsed()) {
e.preventDefault();
this.update(replaceText(editorState, chars, editorState.getCurrentInlineStyle(), getEntityKeyForSelection(editorState.getCurrentContent(), editorState.getSelection())));
return;
}
var mayAllowNative = !isSelectionAtLeafStart(editorState);
var newEditorState = replaceText(editorState, chars, editorState.getCurrentInlineStyle(), getEntityKeyForSelection(editorState.getCurrentContent(), editorState.getSelection()));
if (!mayAllowNative) {
e.preventDefault();
this.update(newEditorState);
return;
}
var anchorKey = selection.getAnchorKey();
var anchorTree = editorState.getBlockTree(anchorKey);
// Check the old and new "fingerprints" of the current block to determine
// whether this insertion requires any addition or removal of text nodes,
// in which case we would prevent the native character insertion.
var originalFingerprint = BlockTree.getFingerprint(anchorTree);
var newFingerprint = BlockTree.getFingerprint(newEditorState.getBlockTree(anchorKey));
if (mustPreventDefaultForCharacter(chars) || originalFingerprint !== newFingerprint || nullthrows(newEditorState.getDirectionMap()).get(anchorKey) !== nullthrows(editorState.getDirectionMap()).get(anchorKey)) {
e.preventDefault();
} else {
// The native event is allowed to occur.
newEditorState = EditorState.set(newEditorState, {
nativelyRenderedContent: newEditorState.getCurrentContent()
});
}
this.update(newEditorState);
}
module.exports = editOnBeforeInput;
/***/ },
/* 1163 */
/*!**************************************!*\
!*** ./~/draft-js/lib/editOnBlur.js ***!
\**************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule editOnBlur
*
*/
'use strict';
var EditorState = __webpack_require__(/*! ./EditorState */ 1113);
var UserAgent = __webpack_require__(/*! fbjs/lib/UserAgent */ 1136);
var getActiveElement = __webpack_require__(/*! fbjs/lib/getActiveElement */ 153);
var isWebKit = UserAgent.isEngine('WebKit');
function editOnBlur(e) {
// Webkit has a bug in which blurring a contenteditable by clicking on
// other active elements will trigger the `blur` event but will not remove
// the DOM selection from the contenteditable. We therefore force the
// issue to be certain, checking whether the active element is `body`
// to force it when blurring occurs within the window (as opposed to
// clicking to another tab or window).
if (isWebKit && getActiveElement() === document.body) {
global.getSelection().removeAllRanges();
}
var editorState = this.props.editorState;
var currentSelection = editorState.getSelection();
if (!currentSelection.getHasFocus()) {
return;
}
var selection = currentSelection.set('hasFocus', false);
this.props.onBlur && this.props.onBlur(e);
this.update(EditorState.acceptSelection(editorState, selection));
}
module.exports = editOnBlur;
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
/***/ },
/* 1164 */
/*!**************************************************!*\
!*** ./~/draft-js/lib/editOnCompositionStart.js ***!
\**************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule editOnCompositionStart
*
*/
'use strict';
var EditorState = __webpack_require__(/*! ./EditorState */ 1113);
/**
* The user has begun using an IME input system. Switching to `composite` mode
* allows handling composition input and disables other edit behavior.
*/
function editOnCompositionStart() {
this.setRenderGuard();
this.setMode('composite');
this.update(EditorState.set(this.props.editorState, { inCompositionMode: true }));
}
module.exports = editOnCompositionStart;
/***/ },
/* 1165 */
/*!**************************************!*\
!*** ./~/draft-js/lib/editOnCopy.js ***!
\**************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule editOnCopy
*
*/
'use strict';
var getFragmentFromSelection = __webpack_require__(/*! ./getFragmentFromSelection */ 1166);
/**
* If we have a selection, create a ContentState fragment and store
* it in our internal clipboard. Subsequent paste events will use this
* fragment if no external clipboard data is supplied.
*/
function editOnCopy(e) {
var editorState = this.props.editorState;
var selection = editorState.getSelection();
// No selection, so there's nothing to copy.
if (selection.isCollapsed()) {
e.preventDefault();
return;
}
this.setClipboard(getFragmentFromSelection(this.props.editorState));
}
module.exports = editOnCopy;
/***/ },
/* 1166 */
/*!****************************************************!*\
!*** ./~/draft-js/lib/getFragmentFromSelection.js ***!
\****************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule getFragmentFromSelection
*
*/
'use strict';
var getContentStateFragment = __webpack_require__(/*! ./getContentStateFragment */ 1104);
function getFragmentFromSelection(editorState) {
var selectionState = editorState.getSelection();
if (selectionState.isCollapsed()) {
return null;
}
return getContentStateFragment(editorState.getCurrentContent(), selectionState);
}
module.exports = getFragmentFromSelection;
/***/ },
/* 1167 */
/*!*************************************!*\
!*** ./~/draft-js/lib/editOnCut.js ***!
\*************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule editOnCut
*
*/
'use strict';
var DraftModifier = __webpack_require__(/*! ./DraftModifier */ 1095);
var EditorState = __webpack_require__(/*! ./EditorState */ 1113);
var Style = __webpack_require__(/*! fbjs/lib/Style */ 1145);
var getFragmentFromSelection = __webpack_require__(/*! ./getFragmentFromSelection */ 1166);
var getScrollPosition = __webpack_require__(/*! fbjs/lib/getScrollPosition */ 1149);
/**
* On `cut` events, native behavior is allowed to occur so that the system
* clipboard is set properly. This means that we need to take steps to recover
* the editor DOM state after the `cut` has occurred in order to maintain
* control of the component.
*
* In addition, we can keep a copy of the removed fragment, including all
* styles and entities, for use as an internal paste.
*/
function editOnCut(e) {
var _this = this;
var editorState = this.props.editorState;
var selection = editorState.getSelection();
// No selection, so there's nothing to cut.
if (selection.isCollapsed()) {
e.preventDefault();
return;
}
// Track the current scroll position so that it can be forced back in place
// after the editor regains control of the DOM.
var scrollParent = Style.getScrollParent(e.target);
var _getScrollPosition = getScrollPosition(scrollParent);
var x = _getScrollPosition.x;
var y = _getScrollPosition.y;
var fragment = getFragmentFromSelection(editorState);
this.setClipboard(fragment);
// Set `cut` mode to disable all event handling temporarily.
this.setRenderGuard();
this.setMode('cut');
// Let native `cut` behavior occur, then recover control.
setTimeout(function () {
_this.restoreEditorDOM({ x: x, y: y });
_this.removeRenderGuard();
_this.exitCurrentMode();
_this.update(removeFragment(editorState));
}, 0);
}
function removeFragment(editorState) {
var newContent = DraftModifier.removeRange(editorState.getCurrentContent(), editorState.getSelection(), 'forward');
return EditorState.push(editorState, newContent, 'remove-range');
}
module.exports = editOnCut;
/***/ },
/* 1168 */
/*!******************************************!*\
!*** ./~/draft-js/lib/editOnDragOver.js ***!
\******************************************/
/***/ function(module, exports) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule editOnDragOver
*
*/
'use strict';
/**
* Drag behavior has begun from outside the editor element.
*/
function editOnDragOver(e) {
this._internalDrag = false;
this.setMode('drag');
e.preventDefault();
}
module.exports = editOnDragOver;
/***/ },
/* 1169 */
/*!*******************************************!*\
!*** ./~/draft-js/lib/editOnDragStart.js ***!
\*******************************************/
/***/ function(module, exports) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule editOnDragStart
*
*/
'use strict';
/**
* A `dragstart` event has begun within the text editor component.
*/
function editOnDragStart() {
this._internalDrag = true;
this.setMode('drag');
}
module.exports = editOnDragStart;
/***/ },
/* 1170 */
/*!***************************************!*\
!*** ./~/draft-js/lib/editOnFocus.js ***!
\***************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule editOnFocus
*
*/
'use strict';
var EditorState = __webpack_require__(/*! ./EditorState */ 1113);
function editOnFocus(e) {
var editorState = this.props.editorState;
var currentSelection = editorState.getSelection();
if (currentSelection.getHasFocus()) {
return;
}
var selection = currentSelection.set('hasFocus', true);
this.props.onFocus && this.props.onFocus(e);
// When the tab containing this text editor is hidden and the user does a
// find-in-page in a _different_ tab, Chrome on Mac likes to forget what the
// selection was right after sending this focus event and (if you let it)
// moves the cursor back to the beginning of the editor, so we force the
// selection here instead of simply accepting it in order to preserve the
// old cursor position. See https://crbug.com/540004.
this.update(EditorState.forceSelection(editorState, selection));
}
module.exports = editOnFocus;
/***/ },
/* 1171 */
/*!***************************************!*\
!*** ./~/draft-js/lib/editOnInput.js ***!
\***************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule editOnInput
*
*/
'use strict';
var DraftModifier = __webpack_require__(/*! ./DraftModifier */ 1095);
var DraftOffsetKey = __webpack_require__(/*! ./DraftOffsetKey */ 1143);
var EditorState = __webpack_require__(/*! ./EditorState */ 1113);
var Entity = __webpack_require__(/*! ./DraftEntity */ 1100);
var UserAgent = __webpack_require__(/*! fbjs/lib/UserAgent */ 1136);
var findAncestorOffsetKey = __webpack_require__(/*! ./findAncestorOffsetKey */ 1156);
var nullthrows = __webpack_require__(/*! fbjs/lib/nullthrows */ 1122);
var isGecko = UserAgent.isEngine('Gecko');
var DOUBLE_NEWLINE = '\n\n';
/**
* This function is intended to handle spellcheck and autocorrect changes,
* which occur in the DOM natively without any opportunity to observe or
* interpret the changes before they occur.
*
* The `input` event fires in contentEditable elements reliably for non-IE
* browsers, immediately after changes occur to the editor DOM. Since our other
* handlers override or otherwise handle cover other varieties of text input,
* the DOM state should match the model in all controlled input cases. Thus,
* when an `input` change leads to a DOM/model mismatch, the change should be
* due to a spellcheck change, and we can incorporate it into our model.
*/
function editOnInput() {
var domSelection = global.getSelection();
var anchorNode = domSelection.anchorNode;
var isCollapsed = domSelection.isCollapsed;
if (anchorNode.nodeType !== Node.TEXT_NODE) {
return;
}
var domText = anchorNode.textContent;
var editorState = this.props.editorState;
var offsetKey = nullthrows(findAncestorOffsetKey(anchorNode));
var _DraftOffsetKey$decod = DraftOffsetKey.decode(offsetKey);
var blockKey = _DraftOffsetKey$decod.blockKey;
var decoratorKey = _DraftOffsetKey$decod.decoratorKey;
var leafKey = _DraftOffsetKey$decod.leafKey;
var _editorState$getBlock = editorState.getBlockTree(blockKey).getIn([decoratorKey, 'leaves', leafKey]);
var start = _editorState$getBlock.start;
var end = _editorState$getBlock.end;
var content = editorState.getCurrentContent();
var block = content.getBlockForKey(blockKey);
var modelText = block.getText().slice(start, end);
// Special-case soft newlines here. If the DOM text ends in a soft newline,
// we will have manually inserted an extra soft newline in DraftEditorLeaf.
// We want to remove this extra newline for the purpose of our comparison
// of DOM and model text.
if (domText.endsWith(DOUBLE_NEWLINE)) {
domText = domText.slice(0, -1);
}
// No change -- the DOM is up to date. Nothing to do here.
if (domText === modelText) {
return;
}
var selection = editorState.getSelection();
// We'll replace the entire leaf with the text content of the target.
var targetRange = selection.merge({
anchorOffset: start,
focusOffset: end,
isBackward: false
});
var entityKey = block.getEntityAt(start);
var entity = entityKey && Entity.get(entityKey);
var entityType = entity && entity.getMutability();
var preserveEntity = entityType === 'MUTABLE';
// Immutable or segmented entities cannot properly be handled by the
// default browser undo, so we have to use a different change type to
// force using our internal undo method instead of falling through to the
// native browser undo.
var changeType = preserveEntity ? 'spellcheck-change' : 'apply-entity';
var newContent = DraftModifier.replaceText(content, targetRange, domText, block.getInlineStyleAt(start), preserveEntity ? block.getEntityAt(start) : null);
var anchorOffset, focusOffset, startOffset, endOffset;
if (isGecko) {
// Firefox selection does not change while the context menu is open, so
// we preserve the anchor and focus values of the DOM selection.
anchorOffset = domSelection.anchorOffset;
focusOffset = domSelection.focusOffset;
startOffset = start + Math.min(anchorOffset, focusOffset);
endOffset = startOffset + Math.abs(anchorOffset - focusOffset);
anchorOffset = startOffset;
focusOffset = endOffset;
} else {
// Browsers other than Firefox may adjust DOM selection while the context
// menu is open, and Safari autocorrect is prone to providing an inaccurate
// DOM selection. Don't trust it. Instead, use our existing SelectionState
// and adjust it based on the number of characters changed during the
// mutation.
var charDelta = domText.length - modelText.length;
startOffset = selection.getStartOffset();
endOffset = selection.getEndOffset();
anchorOffset = isCollapsed ? endOffset + charDelta : startOffset;
focusOffset = endOffset + charDelta;
}
// Segmented entities are completely or partially removed when their
// text content changes. For this case we do not want any text to be selected
// after the change, so we are not merging the selection.
var contentWithAdjustedDOMSelection = newContent.merge({
selectionBefore: content.getSelectionAfter(),
selectionAfter: selection.merge({ anchorOffset: anchorOffset, focusOffset: focusOffset })
});
this.update(EditorState.push(editorState, contentWithAdjustedDOMSelection, changeType));
}
module.exports = editOnInput;
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
/***/ },
/* 1172 */
/*!*****************************************!*\
!*** ./~/draft-js/lib/editOnKeyDown.js ***!
\*****************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule editOnKeyDown
*
*/
'use strict';
var DraftModifier = __webpack_require__(/*! ./DraftModifier */ 1095);
var EditorState = __webpack_require__(/*! ./EditorState */ 1113);
var KeyBindingUtil = __webpack_require__(/*! ./KeyBindingUtil */ 1173);
var Keys = __webpack_require__(/*! fbjs/lib/Keys */ 1129);
var SecondaryClipboard = __webpack_require__(/*! ./SecondaryClipboard */ 1174);
var UserAgent = __webpack_require__(/*! fbjs/lib/UserAgent */ 1136);
var keyCommandBackspaceToStartOfLine = __webpack_require__(/*! ./keyCommandBackspaceToStartOfLine */ 1175);
var keyCommandBackspaceWord = __webpack_require__(/*! ./keyCommandBackspaceWord */ 1182);
var keyCommandDeleteWord = __webpack_require__(/*! ./keyCommandDeleteWord */ 1185);
var keyCommandInsertNewline = __webpack_require__(/*! ./keyCommandInsertNewline */ 1187);
var keyCommandPlainBackspace = __webpack_require__(/*! ./keyCommandPlainBackspace */ 1188);
var keyCommandPlainDelete = __webpack_require__(/*! ./keyCommandPlainDelete */ 1189);
var keyCommandMoveSelectionToEndOfBlock = __webpack_require__(/*! ./keyCommandMoveSelectionToEndOfBlock */ 1190);
var keyCommandMoveSelectionToStartOfBlock = __webpack_require__(/*! ./keyCommandMoveSelectionToStartOfBlock */ 1191);
var keyCommandTransposeCharacters = __webpack_require__(/*! ./keyCommandTransposeCharacters */ 1192);
var keyCommandUndo = __webpack_require__(/*! ./keyCommandUndo */ 1193);
var isEventHandled = __webpack_require__(/*! ./isEventHandled */ 1160);
var isOptionKeyCommand = KeyBindingUtil.isOptionKeyCommand;
var isChrome = UserAgent.isBrowser('Chrome');
/**
* Map a `DraftEditorCommand` command value to a corresponding function.
*/
function onKeyCommand(command, editorState) {
switch (command) {
case 'redo':
return EditorState.redo(editorState);
case 'delete':
return keyCommandPlainDelete(editorState);
case 'delete-word':
return keyCommandDeleteWord(editorState);
case 'backspace':
return keyCommandPlainBackspace(editorState);
case 'backspace-word':
return keyCommandBackspaceWord(editorState);
case 'backspace-to-start-of-line':
return keyCommandBackspaceToStartOfLine(editorState);
case 'split-block':
return keyCommandInsertNewline(editorState);
case 'transpose-characters':
return keyCommandTransposeCharacters(editorState);
case 'move-selection-to-start-of-block':
return keyCommandMoveSelectionToStartOfBlock(editorState);
case 'move-selection-to-end-of-block':
return keyCommandMoveSelectionToEndOfBlock(editorState);
case 'secondary-cut':
return SecondaryClipboard.cut(editorState);
case 'secondary-paste':
return SecondaryClipboard.paste(editorState);
default:
return editorState;
}
}
/**
* Intercept keydown behavior to handle keys and commands manually, if desired.
*
* Keydown combinations may be mapped to `DraftCommand` values, which may
* correspond to command functions that modify the editor or its contents.
*
* See `getDefaultKeyBinding` for defaults. Alternatively, the top-level
* component may provide a custom mapping via the `keyBindingFn` prop.
*/
function editOnKeyDown(e) {
var keyCode = e.which;
var editorState = this.props.editorState;
switch (keyCode) {
case Keys.RETURN:
e.preventDefault();
// The top-level component may manually handle newline insertion. If
// no special handling is performed, fall through to command handling.
if (this.props.handleReturn && isEventHandled(this.props.handleReturn(e))) {
return;
}
break;
case Keys.ESC:
e.preventDefault();
this.props.onEscape && this.props.onEscape(e);
return;
case Keys.TAB:
this.props.onTab && this.props.onTab(e);
return;
case Keys.UP:
this.props.onUpArrow && this.props.onUpArrow(e);
return;
case Keys.DOWN:
this.props.onDownArrow && this.props.onDownArrow(e);
return;
case Keys.SPACE:
// Handling for OSX where option + space scrolls.
if (isChrome && isOptionKeyCommand(e)) {
e.preventDefault();
// Insert a nbsp into the editor.
var contentState = DraftModifier.replaceText(editorState.getCurrentContent(), editorState.getSelection(), ' ');
this.update(EditorState.push(editorState, contentState, 'insert-characters'));
return;
}
}
var command = this.props.keyBindingFn(e);
// If no command is specified, allow keydown event to continue.
if (!command) {
return;
}
if (command === 'undo') {
// Since undo requires some special updating behavior to keep the editor
// in sync, handle it separately.
keyCommandUndo(e, editorState, this.update);
return;
}
// At this point, we know that we're handling a command of some kind, so
// we don't want to insert a character following the keydown.
e.preventDefault();
// Allow components higher up the tree to handle the command first.
if (this.props.handleKeyCommand && isEventHandled(this.props.handleKeyCommand(command))) {
return;
}
var newState = onKeyCommand(command, editorState);
if (newState !== editorState) {
this.update(newState);
}
}
module.exports = editOnKeyDown;
/***/ },
/* 1173 */
/*!******************************************!*\
!*** ./~/draft-js/lib/KeyBindingUtil.js ***!
\******************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule KeyBindingUtil
* @typechecks
*
*/
'use strict';
var UserAgent = __webpack_require__(/*! fbjs/lib/UserAgent */ 1136);
var isOSX = UserAgent.isPlatform('Mac OS X');
var KeyBindingUtil = {
/**
* Check whether the ctrlKey modifier is *not* being used in conjunction with
* the altKey modifier. If they are combined, the result is an `altGraph`
* key modifier, which should not be handled by this set of key bindings.
*/
isCtrlKeyCommand: function isCtrlKeyCommand(e) {
return !!e.ctrlKey && !e.altKey;
},
isOptionKeyCommand: function isOptionKeyCommand(e) {
return isOSX && e.altKey;
},
hasCommandModifier: function hasCommandModifier(e) {
return isOSX ? !!e.metaKey && !e.altKey : KeyBindingUtil.isCtrlKeyCommand(e);
}
};
module.exports = KeyBindingUtil;
/***/ },
/* 1174 */
/*!**********************************************!*\
!*** ./~/draft-js/lib/SecondaryClipboard.js ***!
\**********************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule SecondaryClipboard
*
*/
'use strict';
var DraftModifier = __webpack_require__(/*! ./DraftModifier */ 1095);
var EditorState = __webpack_require__(/*! ./EditorState */ 1113);
var getContentStateFragment = __webpack_require__(/*! ./getContentStateFragment */ 1104);
var nullthrows = __webpack_require__(/*! fbjs/lib/nullthrows */ 1122);
var clipboard = null;
/**
* Some systems offer a "secondary" clipboard to allow quick internal cut
* and paste behavior. For instance, Ctrl+K (cut) and Ctrl+Y (paste).
*/
var SecondaryClipboard = {
cut: function cut(editorState) {
var content = editorState.getCurrentContent();
var selection = editorState.getSelection();
var targetRange = null;
if (selection.isCollapsed()) {
var anchorKey = selection.getAnchorKey();
var blockEnd = content.getBlockForKey(anchorKey).getLength();
if (blockEnd === selection.getAnchorOffset()) {
return editorState;
}
targetRange = selection.set('focusOffset', blockEnd);
} else {
targetRange = selection;
}
targetRange = nullthrows(targetRange);
clipboard = getContentStateFragment(content, targetRange);
var afterRemoval = DraftModifier.removeRange(content, targetRange, 'forward');
if (afterRemoval === content) {
return editorState;
}
return EditorState.push(editorState, afterRemoval, 'remove-range');
},
paste: function paste(editorState) {
if (!clipboard) {
return editorState;
}
var newContent = DraftModifier.replaceWithFragment(editorState.getCurrentContent(), editorState.getSelection(), clipboard);
return EditorState.push(editorState, newContent, 'insert-fragment');
}
};
module.exports = SecondaryClipboard;
/***/ },
/* 1175 */
/*!************************************************************!*\
!*** ./~/draft-js/lib/keyCommandBackspaceToStartOfLine.js ***!
\************************************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule keyCommandBackspaceToStartOfLine
*
*/
'use strict';
var EditorState = __webpack_require__(/*! ./EditorState */ 1113);
var expandRangeToStartOfLine = __webpack_require__(/*! ./expandRangeToStartOfLine */ 1176);
var getDraftEditorSelectionWithNodes = __webpack_require__(/*! ./getDraftEditorSelectionWithNodes */ 1179);
var moveSelectionBackward = __webpack_require__(/*! ./moveSelectionBackward */ 1180);
var removeTextWithStrategy = __webpack_require__(/*! ./removeTextWithStrategy */ 1181);
function keyCommandBackspaceToStartOfLine(editorState) {
var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {
var selection = strategyState.getSelection();
if (selection.isCollapsed() && selection.getAnchorOffset() === 0) {
return moveSelectionBackward(strategyState, 1);
}
var domSelection = global.getSelection();
var range = domSelection.getRangeAt(0);
range = expandRangeToStartOfLine(range);
return getDraftEditorSelectionWithNodes(strategyState, null, range.endContainer, range.endOffset, range.startContainer, range.startOffset).selectionState;
}, 'backward');
if (afterRemoval === editorState.getCurrentContent()) {
return editorState;
}
return EditorState.push(editorState, afterRemoval, 'remove-range');
}
module.exports = keyCommandBackspaceToStartOfLine;
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
/***/ },
/* 1176 */
/*!****************************************************!*\
!*** ./~/draft-js/lib/expandRangeToStartOfLine.js ***!
\****************************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {'use strict';
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule expandRangeToStartOfLine
* @typechecks
*
*/
var UnicodeUtils = __webpack_require__(/*! fbjs/lib/UnicodeUtils */ 1177);
var getRangeClientRects = __webpack_require__(/*! ./getRangeClientRects */ 1178);
var invariant = __webpack_require__(/*! fbjs/lib/invariant */ 9);
/**
* Return the computed line height, in pixels, for the provided element.
*/
function getLineHeightPx(element) {
var computed = getComputedStyle(element);
var div = document.createElement('div');
div.style.fontFamily = computed.fontFamily;
div.style.fontSize = computed.fontSize;
div.style.fontStyle = computed.fontStyle;
div.style.fontWeight = computed.fontWeight;
div.style.lineHeight = computed.lineHeight;
div.style.position = 'absolute';
div.textContent = 'M';
// forced layout here
document.body.appendChild(div);
var rect = div.getBoundingClientRect();
document.body.removeChild(div);
return rect.height;
}
/**
* Return whether every ClientRect in the provided list lies on the same line.
*
* We assume that the rects on the same line all contain the baseline, so the
* lowest top line needs to be above the highest bottom line (i.e., if you were
* to project the rects onto the y-axis, their intersection would be nonempty).
*
* In addition, we require that no two boxes are lineHeight (or more) apart at
* either top or bottom, which helps protect against false positives for fonts
* with extremely large glyph heights (e.g., with a font size of 17px, Zapfino
* produces rects of height 58px!).
*/
function areRectsOnOneLine(rects, lineHeight) {
var minTop = Infinity;
var minBottom = Infinity;
var maxTop = -Infinity;
var maxBottom = -Infinity;
for (var ii = 0; ii < rects.length; ii++) {
var rect = rects[ii];
if (rect.width === 0 || rect.width === 1) {
// When a range starts or ends a soft wrap, many browsers (Chrome, IE,
// Safari) include an empty rect on the previous or next line. When the
// text lies in a container whose position is not integral (e.g., from
// margin: auto), Safari makes these empty rects have width 1 (instead of
// 0). Having one-pixel-wide characters seems unlikely (and most browsers
// report widths in subpixel precision anyway) so it's relatively safe to
// skip over them.
continue;
}
minTop = Math.min(minTop, rect.top);
minBottom = Math.min(minBottom, rect.bottom);
maxTop = Math.max(maxTop, rect.top);
maxBottom = Math.max(maxBottom, rect.bottom);
}
return maxTop <= minBottom && maxTop - minTop < lineHeight && maxBottom - minBottom < lineHeight;
}
/**
* Return the length of a node, as used by Range offsets.
*/
function getNodeLength(node) {
// http://www.w3.org/TR/dom/#concept-node-length
switch (node.nodeType) {
case Node.DOCUMENT_TYPE_NODE:
return 0;
case Node.TEXT_NODE:
case Node.PROCESSING_INSTRUCTION_NODE:
case Node.COMMENT_NODE:
return node.length;
default:
return node.childNodes.length;
}
}
/**
* Given a collapsed range, move the start position backwards as far as
* possible while the range still spans only a single line.
*/
function expandRangeToStartOfLine(range) {
!range.collapsed ? process.env.NODE_ENV !== 'production' ? invariant(false, 'expandRangeToStartOfLine: Provided range is not collapsed.') : invariant(false) : void 0;
range = range.cloneRange();
var containingElement = range.startContainer;
if (containingElement.nodeType !== 1) {
containingElement = containingElement.parentNode;
}
var lineHeight = getLineHeightPx(containingElement);
// Imagine our text looks like:
// <div><span>once upon a time, there was a <em>boy
// who lived</em> </span><q><strong>under^ the
// stairs</strong> in a small closet.</q></div>
// where the caret represents the cursor. First, we crawl up the tree until
// the range spans multiple lines (setting the start point to before
// "<strong>", then before "<div>"), then at each level we do a search to
// find the latest point which is still on a previous line. We'll find that
// the break point is inside the span, then inside the <em>, then in its text
// node child, the actual break point before "who".
var bestContainer = range.endContainer;
var bestOffset = range.endOffset;
range.setStart(range.startContainer, 0);
while (areRectsOnOneLine(getRangeClientRects(range), lineHeight)) {
bestContainer = range.startContainer;
bestOffset = range.startOffset;
!bestContainer.parentNode ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Found unexpected detached subtree when traversing.') : invariant(false) : void 0;
range.setStartBefore(bestContainer);
if (bestContainer.nodeType === 1 && getComputedStyle(bestContainer).display !== 'inline') {
// The start of the line is never in a different block-level container.
break;
}
}
// In the above example, range now spans from "<div>" to "under",
// bestContainer is <div>, and bestOffset is 1 (index of <q> inside <div>)].
// Picking out which child to recurse into here is a special case since we
// don't want to check past <q> -- once we find that the final range starts
// in <span>, we can look at all of its children (and all of their children)
// to find the break point.
// At all times, (bestContainer, bestOffset) is the latest single-line start
// point that we know of.
var currentContainer = bestContainer;
var maxIndexToConsider = bestOffset - 1;
do {
var nodeValue = currentContainer.nodeValue;
for (var ii = maxIndexToConsider; ii >= 0; ii--) {
if (nodeValue != null && ii > 0 && UnicodeUtils.isSurrogatePair(nodeValue, ii - 1)) {
// We're in the middle of a surrogate pair -- skip over so we never
// return a range with an endpoint in the middle of a code point.
continue;
}
range.setStart(currentContainer, ii);
if (areRectsOnOneLine(getRangeClientRects(range), lineHeight)) {
bestContainer = currentContainer;
bestOffset = ii;
} else {
break;
}
}
if (ii === -1 || currentContainer.childNodes.length === 0) {
// If ii === -1, then (bestContainer, bestOffset), which is equal to
// (currentContainer, 0), was a single-line start point but a start
// point before currentContainer wasn't, so the line break seems to
// have occurred immediately after currentContainer's start tag
//
// If currentContainer.childNodes.length === 0, we're already at a
// terminal node (e.g., text node) and should return our current best.
break;
}
currentContainer = currentContainer.childNodes[ii];
maxIndexToConsider = getNodeLength(currentContainer);
} while (true);
range.setStart(bestContainer, bestOffset);
return range;
}
module.exports = expandRangeToStartOfLine;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 1177 */
/*!************************************!*\
!*** ./~/fbjs/lib/UnicodeUtils.js ***!
\************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @typechecks
*/
/**
* Unicode-enabled replacesments for basic String functions.
*
* All the functions in this module assume that the input string is a valid
* UTF-16 encoding of a Unicode sequence. If it's not the case, the behavior
* will be undefined.
*
* WARNING: Since this module is typechecks-enforced, you may find new bugs
* when replacing normal String functions with ones provided here.
*/
'use strict';
var invariant = __webpack_require__(/*! ./invariant */ 9);
// These two ranges are consecutive so anything in [HIGH_START, LOW_END] is a
// surrogate code unit.
var SURROGATE_HIGH_START = 0xD800;
var SURROGATE_HIGH_END = 0xDBFF;
var SURROGATE_LOW_START = 0xDC00;
var SURROGATE_LOW_END = 0xDFFF;
var SURROGATE_UNITS_REGEX = /[\uD800-\uDFFF]/;
/**
* @param {number} codeUnit A Unicode code-unit, in range [0, 0x10FFFF]
* @return {boolean} Whether code-unit is in a surrogate (hi/low) range
*/
function isCodeUnitInSurrogateRange(codeUnit) {
return SURROGATE_HIGH_START <= codeUnit && codeUnit <= SURROGATE_LOW_END;
}
/**
* Returns whether the two characters starting at `index` form a surrogate pair.
* For example, given the string s = "\uD83D\uDE0A", (s, 0) returns true and
* (s, 1) returns false.
*
* @param {string} str
* @param {number} index
* @return {boolean}
*/
function isSurrogatePair(str, index) {
!(0 <= index && index < str.length) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'isSurrogatePair: Invalid index %s for string length %s.', index, str.length) : invariant(false) : void 0;
if (index + 1 === str.length) {
return false;
}
var first = str.charCodeAt(index);
var second = str.charCodeAt(index + 1);
return SURROGATE_HIGH_START <= first && first <= SURROGATE_HIGH_END && SURROGATE_LOW_START <= second && second <= SURROGATE_LOW_END;
}
/**
* @param {string} str Non-empty string
* @return {boolean} True if the input includes any surrogate code units
*/
function hasSurrogateUnit(str) {
return SURROGATE_UNITS_REGEX.test(str);
}
/**
* Return the length of the original Unicode character at given position in the
* String by looking into the UTF-16 code unit; that is equal to 1 for any
* non-surrogate characters in BMP ([U+0000..U+D7FF] and [U+E000, U+FFFF]); and
* returns 2 for the hi/low surrogates ([U+D800..U+DFFF]), which are in fact
* representing non-BMP characters ([U+10000..U+10FFFF]).
*
* Examples:
* - '\u0020' => 1
* - '\u3020' => 1
* - '\uD835' => 2
* - '\uD835\uDDEF' => 2
* - '\uDDEF' => 2
*
* @param {string} str Non-empty string
* @param {number} pos Position in the string to look for one code unit
* @return {number} Number 1 or 2
*/
function getUTF16Length(str, pos) {
return 1 + isCodeUnitInSurrogateRange(str.charCodeAt(pos));
}
/**
* Fully Unicode-enabled replacement for String#length
*
* @param {string} str Valid Unicode string
* @return {number} The number of Unicode characters in the string
*/
function strlen(str) {
// Call the native functions if there's no surrogate char
if (!hasSurrogateUnit(str)) {
return str.length;
}
var len = 0;
for (var pos = 0; pos < str.length; pos += getUTF16Length(str, pos)) {
len++;
}
return len;
}
/**
* Fully Unicode-enabled replacement for String#substr()
*
* @param {string} str Valid Unicode string
* @param {number} start Location in Unicode sequence to begin extracting
* @param {?number} length The number of Unicode characters to extract
* (default: to the end of the string)
* @return {string} Extracted sub-string
*/
function substr(str, start, length) {
start = start || 0;
length = length === undefined ? Infinity : length || 0;
// Call the native functions if there's no surrogate char
if (!hasSurrogateUnit(str)) {
return str.substr(start, length);
}
// Obvious cases
var size = str.length;
if (size <= 0 || start > size || length <= 0) {
return '';
}
// Find the actual starting position
var posA = 0;
if (start > 0) {
for (; start > 0 && posA < size; start--) {
posA += getUTF16Length(str, posA);
}
if (posA >= size) {
return '';
}
} else if (start < 0) {
for (posA = size; start < 0 && 0 < posA; start++) {
posA -= getUTF16Length(str, posA - 1);
}
if (posA < 0) {
posA = 0;
}
}
// Find the actual ending position
var posB = size;
if (length < size) {
for (posB = posA; length > 0 && posB < size; length--) {
posB += getUTF16Length(str, posB);
}
}
return str.substring(posA, posB);
}
/**
* Fully Unicode-enabled replacement for String#substring()
*
* @param {string} str Valid Unicode string
* @param {number} start Location in Unicode sequence to begin extracting
* @param {?number} end Location in Unicode sequence to end extracting
* (default: end of the string)
* @return {string} Extracted sub-string
*/
function substring(str, start, end) {
start = start || 0;
end = end === undefined ? Infinity : end || 0;
if (start < 0) {
start = 0;
}
if (end < 0) {
end = 0;
}
var length = Math.abs(end - start);
start = start < end ? start : end;
return substr(str, start, length);
}
/**
* Get a list of Unicode code-points from a String
*
* @param {string} str Valid Unicode string
* @return {array<number>} A list of code-points in [0..0x10FFFF]
*/
function getCodePoints(str) {
var codePoints = [];
for (var pos = 0; pos < str.length; pos += getUTF16Length(str, pos)) {
codePoints.push(str.codePointAt(pos));
}
return codePoints;
}
var UnicodeUtils = {
getCodePoints: getCodePoints,
getUTF16Length: getUTF16Length,
hasSurrogateUnit: hasSurrogateUnit,
isCodeUnitInSurrogateRange: isCodeUnitInSurrogateRange,
isSurrogatePair: isSurrogatePair,
strlen: strlen,
substring: substring,
substr: substr
};
module.exports = UnicodeUtils;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 1178 */
/*!***********************************************!*\
!*** ./~/draft-js/lib/getRangeClientRects.js ***!
\***********************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule getRangeClientRects
* @typechecks
*
*/
'use strict';
var UserAgent = __webpack_require__(/*! fbjs/lib/UserAgent */ 1136);
var invariant = __webpack_require__(/*! fbjs/lib/invariant */ 9);
var isChrome = UserAgent.isBrowser('Chrome');
// In Chrome, the client rects will include the entire bounds of all nodes that
// begin (have a start tag) within the selection, even if the selection does
// not overlap the entire node. To resolve this, we split the range at each
// start tag and join the client rects together.
// https://code.google.com/p/chromium/issues/detail?id=324437
/* eslint-disable consistent-return */
function getRangeClientRectsChrome(range) {
var tempRange = range.cloneRange();
var clientRects = [];
for (var ancestor = range.endContainer; ancestor != null; ancestor = ancestor.parentNode) {
// If we've climbed up to the common ancestor, we can now use the
// original start point and stop climbing the tree.
var atCommonAncestor = ancestor === range.commonAncestorContainer;
if (atCommonAncestor) {
tempRange.setStart(range.startContainer, range.startOffset);
} else {
tempRange.setStart(tempRange.endContainer, 0);
}
var rects = Array.from(tempRange.getClientRects());
clientRects.push(rects);
if (atCommonAncestor) {
var _ref;
clientRects.reverse();
return (_ref = []).concat.apply(_ref, clientRects);
}
tempRange.setEndBefore(ancestor);
}
true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Found an unexpected detached subtree when getting range client rects.') : invariant(false) : void 0;
}
/* eslint-enable consistent-return */
/**
* Like range.getClientRects() but normalizes for browser bugs.
*/
var getRangeClientRects = isChrome ? getRangeClientRectsChrome : function (range) {
return Array.from(range.getClientRects());
};
module.exports = getRangeClientRects;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 1179 */
/*!************************************************************!*\
!*** ./~/draft-js/lib/getDraftEditorSelectionWithNodes.js ***!
\************************************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule getDraftEditorSelectionWithNodes
* @typechecks
*
*/
'use strict';
var findAncestorOffsetKey = __webpack_require__(/*! ./findAncestorOffsetKey */ 1156);
var getSelectionOffsetKeyForNode = __webpack_require__(/*! ./getSelectionOffsetKeyForNode */ 1157);
var getUpdatedSelectionState = __webpack_require__(/*! ./getUpdatedSelectionState */ 1159);
var invariant = __webpack_require__(/*! fbjs/lib/invariant */ 9);
var nullthrows = __webpack_require__(/*! fbjs/lib/nullthrows */ 1122);
/**
* Convert the current selection range to an anchor/focus pair of offset keys
* and values that can be interpreted by components.
*/
function getDraftEditorSelectionWithNodes(editorState, root, anchorNode, anchorOffset, focusNode, focusOffset) {
var anchorIsTextNode = anchorNode.nodeType === Node.TEXT_NODE;
var focusIsTextNode = focusNode.nodeType === Node.TEXT_NODE;
// If the selection range lies only on text nodes, the task is simple.
// Find the nearest offset-aware elements and use the
// offset values supplied by the selection range.
if (anchorIsTextNode && focusIsTextNode) {
return {
selectionState: getUpdatedSelectionState(editorState, nullthrows(findAncestorOffsetKey(anchorNode)), anchorOffset, nullthrows(findAncestorOffsetKey(focusNode)), focusOffset),
needsRecovery: false
};
}
var anchorPoint = null;
var focusPoint = null;
var needsRecovery = true;
// An element is selected. Convert this selection range into leaf offset
// keys and offset values for consumption at the component level. This
// is common in Firefox, where select-all and triple click behavior leads
// to entire elements being selected.
//
// Note that we use the `needsRecovery` parameter in the callback here. This
// is because when certain elements are selected, the behavior for subsequent
// cursor movement (e.g. via arrow keys) is uncertain and may not match
// expectations at the component level. For example, if an entire <div> is
// selected and the user presses the right arrow, Firefox keeps the selection
// on the <div>. If we allow subsequent keypresses to insert characters
// natively, they will be inserted into a browser-created text node to the
// right of that <div>. This is obviously undesirable.
//
// With the `needsRecovery` flag, we inform the caller that it is responsible
// for manually setting the selection state on the rendered document to
// ensure proper selection state maintenance.
if (anchorIsTextNode) {
anchorPoint = {
key: nullthrows(findAncestorOffsetKey(anchorNode)),
offset: anchorOffset
};
focusPoint = getPointForNonTextNode(root, focusNode, focusOffset);
} else if (focusIsTextNode) {
focusPoint = {
key: nullthrows(findAncestorOffsetKey(focusNode)),
offset: focusOffset
};
anchorPoint = getPointForNonTextNode(root, anchorNode, anchorOffset);
} else {
anchorPoint = getPointForNonTextNode(root, anchorNode, anchorOffset);
focusPoint = getPointForNonTextNode(root, focusNode, focusOffset);
// If the selection is collapsed on an empty block, don't force recovery.
// This way, on arrow key selection changes, the browser can move the
// cursor from a non-zero offset on one block, through empty blocks,
// to a matching non-zero offset on other text blocks.
if (anchorNode === focusNode && anchorOffset === focusOffset) {
needsRecovery = !!anchorNode.firstChild && anchorNode.firstChild.nodeName !== 'BR';
}
}
return {
selectionState: getUpdatedSelectionState(editorState, anchorPoint.key, anchorPoint.offset, focusPoint.key, focusPoint.offset),
needsRecovery: needsRecovery
};
}
/**
* Identify the first leaf descendant for the given node.
*/
function getFirstLeaf(node) {
while (node.firstChild && getSelectionOffsetKeyForNode(node.firstChild)) {
node = node.firstChild;
}
return node;
}
/**
* Identify the last leaf descendant for the given node.
*/
function getLastLeaf(node) {
while (node.lastChild && getSelectionOffsetKeyForNode(node.lastChild)) {
node = node.lastChild;
}
return node;
}
function getPointForNonTextNode(editorRoot, startNode, childOffset) {
var node = startNode;
var offsetKey = findAncestorOffsetKey(node);
!(offsetKey != null || editorRoot && (editorRoot === node || editorRoot.firstChild === node)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unknown node in selection range.') : invariant(false) : void 0;
// If the editorRoot is the selection, step downward into the content
// wrapper.
if (editorRoot === node) {
node = node.firstChild;
!(node instanceof Element && node.getAttribute('data-contents') === 'true') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Invalid DraftEditorContents structure.') : invariant(false) : void 0;
if (childOffset > 0) {
childOffset = node.childNodes.length;
}
}
// If the child offset is zero and we have an offset key, we're done.
// If there's no offset key because the entire editor is selected,
// find the leftmost ("first") leaf in the tree and use that as the offset
// key.
if (childOffset === 0) {
var key = null;
if (offsetKey != null) {
key = offsetKey;
} else {
var firstLeaf = getFirstLeaf(node);
key = nullthrows(getSelectionOffsetKeyForNode(firstLeaf));
}
return { key: key, offset: 0 };
}
var nodeBeforeCursor = node.childNodes[childOffset - 1];
var leafKey = null;
var textLength = null;
if (!getSelectionOffsetKeyForNode(nodeBeforeCursor)) {
// Our target node may be a leaf or a text node, in which case we're
// already where we want to be and can just use the child's length as
// our offset.
leafKey = nullthrows(offsetKey);
textLength = getTextContentLength(nodeBeforeCursor);
} else {
// Otherwise, we'll look at the child to the left of the cursor and find
// the last leaf node in its subtree.
var lastLeaf = getLastLeaf(nodeBeforeCursor);
leafKey = nullthrows(getSelectionOffsetKeyForNode(lastLeaf));
textLength = getTextContentLength(lastLeaf);
}
return {
key: leafKey,
offset: textLength
};
}
/**
* Return the length of a node's textContent, regarding single newline
* characters as zero-length. This allows us to avoid problems with identifying
* the correct selection offset for empty blocks in IE, in which we
* render newlines instead of break tags.
*/
function getTextContentLength(node) {
var textContent = node.textContent;
return textContent === '\n' ? 0 : textContent.length;
}
module.exports = getDraftEditorSelectionWithNodes;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 1180 */
/*!*************************************************!*\
!*** ./~/draft-js/lib/moveSelectionBackward.js ***!
\*************************************************/
/***/ function(module, exports) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule moveSelectionBackward
*
*/
'use strict';
/**
* Given a collapsed selection, move the focus `maxDistance` backward within
* the selected block. If the selection will go beyond the start of the block,
* move focus to the end of the previous block, but no further.
*
* This function is not Unicode-aware, so surrogate pairs will be treated
* as having length 2.
*/
function moveSelectionBackward(editorState, maxDistance) {
var selection = editorState.getSelection();
var content = editorState.getCurrentContent();
var key = selection.getStartKey();
var offset = selection.getStartOffset();
var focusKey = key;
var focusOffset = 0;
if (maxDistance > offset) {
var keyBefore = content.getKeyBefore(key);
if (keyBefore == null) {
focusKey = key;
} else {
focusKey = keyBefore;
var blockBefore = content.getBlockForKey(keyBefore);
focusOffset = blockBefore.getText().length;
}
} else {
focusOffset = offset - maxDistance;
}
return selection.merge({
focusKey: focusKey,
focusOffset: focusOffset,
isBackward: true
});
}
module.exports = moveSelectionBackward;
/***/ },
/* 1181 */
/*!**************************************************!*\
!*** ./~/draft-js/lib/removeTextWithStrategy.js ***!
\**************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule removeTextWithStrategy
*
*/
'use strict';
var DraftModifier = __webpack_require__(/*! ./DraftModifier */ 1095);
/**
* For a collapsed selection state, remove text based on the specified strategy.
* If the selection state is not collapsed, remove the entire selected range.
*/
function removeTextWithStrategy(editorState, strategy, direction) {
var selection = editorState.getSelection();
var content = editorState.getCurrentContent();
var target = selection;
if (selection.isCollapsed()) {
if (direction === 'forward') {
if (editorState.isSelectionAtEndOfContent()) {
return content;
}
} else if (editorState.isSelectionAtStartOfContent()) {
return content;
}
target = strategy(editorState);
if (target === selection) {
return content;
}
}
return DraftModifier.removeRange(content, target, direction);
}
module.exports = removeTextWithStrategy;
/***/ },
/* 1182 */
/*!***************************************************!*\
!*** ./~/draft-js/lib/keyCommandBackspaceWord.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule keyCommandBackspaceWord
*
*/
'use strict';
var DraftRemovableWord = __webpack_require__(/*! ./DraftRemovableWord */ 1183);
var EditorState = __webpack_require__(/*! ./EditorState */ 1113);
var moveSelectionBackward = __webpack_require__(/*! ./moveSelectionBackward */ 1180);
var removeTextWithStrategy = __webpack_require__(/*! ./removeTextWithStrategy */ 1181);
/**
* Delete the word that is left of the cursor, as well as any spaces or
* punctuation after the word.
*/
function keyCommandBackspaceWord(editorState) {
var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {
var selection = strategyState.getSelection();
var offset = selection.getStartOffset();
// If there are no words before the cursor, remove the preceding newline.
if (offset === 0) {
return moveSelectionBackward(strategyState, 1);
}
var key = selection.getStartKey();
var content = strategyState.getCurrentContent();
var text = content.getBlockForKey(key).getText().slice(0, offset);
var toRemove = DraftRemovableWord.getBackward(text);
return moveSelectionBackward(strategyState, toRemove.length || 1);
}, 'backward');
if (afterRemoval === editorState.getCurrentContent()) {
return editorState;
}
return EditorState.push(editorState, afterRemoval, 'remove-range');
}
module.exports = keyCommandBackspaceWord;
/***/ },
/* 1183 */
/*!**********************************************!*\
!*** ./~/draft-js/lib/DraftRemovableWord.js ***!
\**********************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule DraftRemovableWord
* @typechecks
*
*/
'use strict';
var TokenizeUtil = __webpack_require__(/*! fbjs/lib/TokenizeUtil */ 1184);
var punctuation = TokenizeUtil.getPunctuation();
// The apostrophe and curly single quotes behave in a curious way: when
// surrounded on both sides by word characters, they behave as word chars; when
// either neighbor is punctuation or an end of the string, they behave as
// punctuation.
var CHAMELEON_CHARS = '[\'‘’]';
// Remove the underscore, which should count as part of the removable word. The
// "chameleon chars" also count as punctuation in this regex.
var WHITESPACE_AND_PUNCTUATION = '\\s|(?![_])' + punctuation;
var DELETE_STRING = '^' + '(?:' + WHITESPACE_AND_PUNCTUATION + ')*' + '(?:' + CHAMELEON_CHARS + '|(?!' + WHITESPACE_AND_PUNCTUATION + ').)*' + '(?:(?!' + WHITESPACE_AND_PUNCTUATION + ').)';
var DELETE_REGEX = new RegExp(DELETE_STRING);
var BACKSPACE_STRING = '(?:(?!' + WHITESPACE_AND_PUNCTUATION + ').)' + '(?:' + CHAMELEON_CHARS + '|(?!' + WHITESPACE_AND_PUNCTUATION + ').)*' + '(?:' + WHITESPACE_AND_PUNCTUATION + ')*' + '$';
var BACKSPACE_REGEX = new RegExp(BACKSPACE_STRING);
function getRemovableWord(text, isBackward) {
var matches = isBackward ? BACKSPACE_REGEX.exec(text) : DELETE_REGEX.exec(text);
return matches ? matches[0] : text;
}
var DraftRemovableWord = {
getBackward: function getBackward(text) {
return getRemovableWord(text, true);
},
getForward: function getForward(text) {
return getRemovableWord(text, false);
}
};
module.exports = DraftRemovableWord;
/***/ },
/* 1184 */
/*!************************************!*\
!*** ./~/fbjs/lib/TokenizeUtil.js ***!
\************************************/
/***/ function(module, exports) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @typechecks
* @stub
*
*/
'use strict';
// \u00a1-\u00b1\u00b4-\u00b8\u00ba\u00bb\u00bf
// is latin supplement punctuation except fractions and superscript
// numbers
// \u2010-\u2027\u2030-\u205e
// is punctuation from the general punctuation block:
// weird quotes, commas, bullets, dashes, etc.
// \u30fb\u3001\u3002\u3008-\u3011\u3014-\u301f
// is CJK punctuation
// \uff1a-\uff1f\uff01-\uff0f\uff3b-\uff40\uff5b-\uff65
// is some full-width/half-width punctuation
// \u2E2E\u061f\u066a-\u066c\u061b\u060c\u060d\uFD3e\uFD3F
// is some Arabic punctuation marks
// \u1801\u0964\u104a\u104b
// is misc. other language punctuation marks
var PUNCTUATION = '[.,+*?$|#{}()\'\\^\\-\\[\\]\\\\\\/!@%"~=<>_:;' + '\u30FB\u3001\u3002\u3008-\u3011\u3014-\u301F\uFF1A-\uFF1F\uFF01-\uFF0F' + '\uFF3B-\uFF40\uFF5B-\uFF65\u2E2E\u061F\u066A-\u066C\u061B\u060C\u060D' + '\uFD3E\uFD3F\u1801\u0964\u104A\u104B\u2010-\u2027\u2030-\u205E' + '\xA1-\xB1\xB4-\xB8\xBA\xBB\xBF]';
module.exports = {
getPunctuation: function getPunctuation() {
return PUNCTUATION;
}
};
/***/ },
/* 1185 */
/*!************************************************!*\
!*** ./~/draft-js/lib/keyCommandDeleteWord.js ***!
\************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule keyCommandDeleteWord
*
*/
'use strict';
var DraftRemovableWord = __webpack_require__(/*! ./DraftRemovableWord */ 1183);
var EditorState = __webpack_require__(/*! ./EditorState */ 1113);
var moveSelectionForward = __webpack_require__(/*! ./moveSelectionForward */ 1186);
var removeTextWithStrategy = __webpack_require__(/*! ./removeTextWithStrategy */ 1181);
/**
* Delete the word that is right of the cursor, as well as any spaces or
* punctuation before the word.
*/
function keyCommandDeleteWord(editorState) {
var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {
var selection = strategyState.getSelection();
var offset = selection.getStartOffset();
var key = selection.getStartKey();
var content = strategyState.getCurrentContent();
var text = content.getBlockForKey(key).getText().slice(offset);
var toRemove = DraftRemovableWord.getForward(text);
// If there are no words in front of the cursor, remove the newline.
return moveSelectionForward(strategyState, toRemove.length || 1);
}, 'forward');
if (afterRemoval === editorState.getCurrentContent()) {
return editorState;
}
return EditorState.push(editorState, afterRemoval, 'remove-range');
}
module.exports = keyCommandDeleteWord;
/***/ },
/* 1186 */
/*!************************************************!*\
!*** ./~/draft-js/lib/moveSelectionForward.js ***!
\************************************************/
/***/ function(module, exports) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule moveSelectionForward
*
*/
'use strict';
/**
* Given a collapsed selection, move the focus `maxDistance` forward within
* the selected block. If the selection will go beyond the end of the block,
* move focus to the start of the next block, but no further.
*
* This function is not Unicode-aware, so surrogate pairs will be treated
* as having length 2.
*/
function moveSelectionForward(editorState, maxDistance) {
var selection = editorState.getSelection();
var key = selection.getStartKey();
var offset = selection.getStartOffset();
var content = editorState.getCurrentContent();
var focusKey = key;
var focusOffset;
var block = content.getBlockForKey(key);
if (maxDistance > block.getText().length - offset) {
focusKey = content.getKeyAfter(key);
focusOffset = 0;
} else {
focusOffset = offset + maxDistance;
}
return selection.merge({ focusKey: focusKey, focusOffset: focusOffset });
}
module.exports = moveSelectionForward;
/***/ },
/* 1187 */
/*!***************************************************!*\
!*** ./~/draft-js/lib/keyCommandInsertNewline.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule keyCommandInsertNewline
*
*/
'use strict';
var DraftModifier = __webpack_require__(/*! ./DraftModifier */ 1095);
var EditorState = __webpack_require__(/*! ./EditorState */ 1113);
function keyCommandInsertNewline(editorState) {
var contentState = DraftModifier.splitBlock(editorState.getCurrentContent(), editorState.getSelection());
return EditorState.push(editorState, contentState, 'split-block');
}
module.exports = keyCommandInsertNewline;
/***/ },
/* 1188 */
/*!****************************************************!*\
!*** ./~/draft-js/lib/keyCommandPlainBackspace.js ***!
\****************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule keyCommandPlainBackspace
*
*/
'use strict';
var EditorState = __webpack_require__(/*! ./EditorState */ 1113);
var UnicodeUtils = __webpack_require__(/*! fbjs/lib/UnicodeUtils */ 1177);
var moveSelectionBackward = __webpack_require__(/*! ./moveSelectionBackward */ 1180);
var removeTextWithStrategy = __webpack_require__(/*! ./removeTextWithStrategy */ 1181);
/**
* Remove the selected range. If the cursor is collapsed, remove the preceding
* character. This operation is Unicode-aware, so removing a single character
* will remove a surrogate pair properly as well.
*/
function keyCommandPlainBackspace(editorState) {
var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {
var selection = strategyState.getSelection();
var content = strategyState.getCurrentContent();
var key = selection.getAnchorKey();
var offset = selection.getAnchorOffset();
var charBehind = content.getBlockForKey(key).getText()[offset - 1];
return moveSelectionBackward(strategyState, charBehind ? UnicodeUtils.getUTF16Length(charBehind, 0) : 1);
}, 'backward');
if (afterRemoval === editorState.getCurrentContent()) {
return editorState;
}
var selection = editorState.getSelection();
return EditorState.push(editorState, afterRemoval.set('selectionBefore', selection), selection.isCollapsed() ? 'backspace-character' : 'remove-range');
}
module.exports = keyCommandPlainBackspace;
/***/ },
/* 1189 */
/*!*************************************************!*\
!*** ./~/draft-js/lib/keyCommandPlainDelete.js ***!
\*************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule keyCommandPlainDelete
*
*/
'use strict';
var EditorState = __webpack_require__(/*! ./EditorState */ 1113);
var UnicodeUtils = __webpack_require__(/*! fbjs/lib/UnicodeUtils */ 1177);
var moveSelectionForward = __webpack_require__(/*! ./moveSelectionForward */ 1186);
var removeTextWithStrategy = __webpack_require__(/*! ./removeTextWithStrategy */ 1181);
/**
* Remove the selected range. If the cursor is collapsed, remove the following
* character. This operation is Unicode-aware, so removing a single character
* will remove a surrogate pair properly as well.
*/
function keyCommandPlainDelete(editorState) {
var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {
var selection = strategyState.getSelection();
var content = strategyState.getCurrentContent();
var key = selection.getAnchorKey();
var offset = selection.getAnchorOffset();
var charAhead = content.getBlockForKey(key).getText()[offset];
return moveSelectionForward(strategyState, charAhead ? UnicodeUtils.getUTF16Length(charAhead, 0) : 1);
}, 'forward');
if (afterRemoval === editorState.getCurrentContent()) {
return editorState;
}
var selection = editorState.getSelection();
return EditorState.push(editorState, afterRemoval.set('selectionBefore', selection), selection.isCollapsed() ? 'delete-character' : 'remove-range');
}
module.exports = keyCommandPlainDelete;
/***/ },
/* 1190 */
/*!***************************************************************!*\
!*** ./~/draft-js/lib/keyCommandMoveSelectionToEndOfBlock.js ***!
\***************************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule keyCommandMoveSelectionToEndOfBlock
*
*/
'use strict';
var EditorState = __webpack_require__(/*! ./EditorState */ 1113);
/**
* See comment for `moveSelectionToStartOfBlock`.
*/
function keyCommandMoveSelectionToEndOfBlock(editorState) {
var selection = editorState.getSelection();
var endKey = selection.getEndKey();
var content = editorState.getCurrentContent();
var textLength = content.getBlockForKey(endKey).getLength();
return EditorState.set(editorState, {
selection: selection.merge({
anchorKey: endKey,
anchorOffset: textLength,
focusKey: endKey,
focusOffset: textLength,
isBackward: false
}),
forceSelection: true
});
}
module.exports = keyCommandMoveSelectionToEndOfBlock;
/***/ },
/* 1191 */
/*!*****************************************************************!*\
!*** ./~/draft-js/lib/keyCommandMoveSelectionToStartOfBlock.js ***!
\*****************************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule keyCommandMoveSelectionToStartOfBlock
*
*/
'use strict';
var EditorState = __webpack_require__(/*! ./EditorState */ 1113);
/**
* Collapse selection at the start of the first selected block. This is used
* for Firefox versions that attempt to navigate forward/backward instead of
* moving the cursor. Other browsers are able to move the cursor natively.
*/
function keyCommandMoveSelectionToStartOfBlock(editorState) {
var selection = editorState.getSelection();
var startKey = selection.getStartKey();
return EditorState.set(editorState, {
selection: selection.merge({
anchorKey: startKey,
anchorOffset: 0,
focusKey: startKey,
focusOffset: 0,
isBackward: false
}),
forceSelection: true
});
}
module.exports = keyCommandMoveSelectionToStartOfBlock;
/***/ },
/* 1192 */
/*!*********************************************************!*\
!*** ./~/draft-js/lib/keyCommandTransposeCharacters.js ***!
\*********************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule keyCommandTransposeCharacters
*
*/
'use strict';
var DraftModifier = __webpack_require__(/*! ./DraftModifier */ 1095);
var EditorState = __webpack_require__(/*! ./EditorState */ 1113);
var getContentStateFragment = __webpack_require__(/*! ./getContentStateFragment */ 1104);
/**
* Transpose the characters on either side of a collapsed cursor, or
* if the cursor is at the end of the block, transpose the last two
* characters.
*/
function keyCommandTransposeCharacters(editorState) {
var selection = editorState.getSelection();
if (!selection.isCollapsed()) {
return editorState;
}
var offset = selection.getAnchorOffset();
if (offset === 0) {
return editorState;
}
var blockKey = selection.getAnchorKey();
var content = editorState.getCurrentContent();
var block = content.getBlockForKey(blockKey);
var length = block.getLength();
// Nothing to transpose if there aren't two characters.
if (length <= 1) {
return editorState;
}
var removalRange;
var finalSelection;
if (offset === length) {
// The cursor is at the end of the block. Swap the last two characters.
removalRange = selection.set('anchorOffset', offset - 1);
finalSelection = selection;
} else {
removalRange = selection.set('focusOffset', offset + 1);
finalSelection = removalRange.set('anchorOffset', offset + 1);
}
// Extract the character to move as a fragment. This preserves its
// styling and entity, if any.
var movedFragment = getContentStateFragment(content, removalRange);
var afterRemoval = DraftModifier.removeRange(content, removalRange, 'backward');
// After the removal, the insertion target is one character back.
var selectionAfter = afterRemoval.getSelectionAfter();
var targetOffset = selectionAfter.getAnchorOffset() - 1;
var targetRange = selectionAfter.merge({
anchorOffset: targetOffset,
focusOffset: targetOffset
});
var afterInsert = DraftModifier.replaceWithFragment(afterRemoval, targetRange, movedFragment);
var newEditorState = EditorState.push(editorState, afterInsert, 'insert-fragment');
return EditorState.acceptSelection(newEditorState, finalSelection);
}
module.exports = keyCommandTransposeCharacters;
/***/ },
/* 1193 */
/*!******************************************!*\
!*** ./~/draft-js/lib/keyCommandUndo.js ***!
\******************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule keyCommandUndo
*
*/
'use strict';
var EditorState = __webpack_require__(/*! ./EditorState */ 1113);
function keyCommandUndo(e, editorState, updateFn) {
var undoneState = EditorState.undo(editorState);
// If the last change to occur was a spellcheck change, allow the undo
// event to fall through to the browser. This allows the browser to record
// the unwanted change, which should soon lead it to learn not to suggest
// the correction again.
if (editorState.getLastChangeType() === 'spellcheck-change') {
var nativelyRenderedContent = undoneState.getCurrentContent();
updateFn(EditorState.set(undoneState, { nativelyRenderedContent: nativelyRenderedContent }));
return;
}
// Otheriwse, manage the undo behavior manually.
e.preventDefault();
if (!editorState.getNativelyRenderedContent()) {
updateFn(undoneState);
return;
}
// Trigger a re-render with the current content state to ensure that the
// component tree has up-to-date props for comparison.
updateFn(EditorState.set(editorState, { nativelyRenderedContent: null }));
// Wait to ensure that the re-render has occurred before performing
// the undo action.
setTimeout(function () {
updateFn(undoneState);
}, 0);
}
module.exports = keyCommandUndo;
/***/ },
/* 1194 */
/*!***************************************!*\
!*** ./~/draft-js/lib/editOnPaste.js ***!
\***************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule editOnPaste
*
*/
'use strict';
var BlockMapBuilder = __webpack_require__(/*! ./BlockMapBuilder */ 1090);
var CharacterMetadata = __webpack_require__(/*! ./CharacterMetadata */ 1092);
var DataTransfer = __webpack_require__(/*! fbjs/lib/DataTransfer */ 1154);
var DraftModifier = __webpack_require__(/*! ./DraftModifier */ 1095);
var DraftPasteProcessor = __webpack_require__(/*! ./DraftPasteProcessor */ 1195);
var EditorState = __webpack_require__(/*! ./EditorState */ 1113);
var getEntityKeyForSelection = __webpack_require__(/*! ./getEntityKeyForSelection */ 1130);
var getTextContentFromFiles = __webpack_require__(/*! ./getTextContentFromFiles */ 1158);
var splitTextIntoTextBlocks = __webpack_require__(/*! ./splitTextIntoTextBlocks */ 1199);
var isEventHandled = __webpack_require__(/*! ./isEventHandled */ 1160);
/**
* Paste content.
*/
function editOnPaste(e) {
var _this = this;
e.preventDefault();
var data = new DataTransfer(e.clipboardData);
// Get files, unless this is likely to be a string the user wants inline.
if (!data.isRichText()) {
var files = data.getFiles();
var defaultFileText = data.getText();
if (files.length > 0) {
// Allow customized paste handling for images, etc. Otherwise, fall
// through to insert text contents into the editor.
if (this.props.handlePastedFiles && isEventHandled(this.props.handlePastedFiles(files))) {
return;
}
getTextContentFromFiles(files, function ( /*string*/fileText) {
fileText = fileText || defaultFileText;
if (!fileText) {
return;
}
var editorState = _this.props.editorState;
var blocks = splitTextIntoTextBlocks(fileText);
var character = CharacterMetadata.create({
style: editorState.getCurrentInlineStyle(),
entity: getEntityKeyForSelection(editorState.getCurrentContent(), editorState.getSelection())
});
var text = DraftPasteProcessor.processText(blocks, character);
var fragment = BlockMapBuilder.createFromArray(text);
var withInsertedText = DraftModifier.replaceWithFragment(editorState.getCurrentContent(), editorState.getSelection(), fragment);
_this.update(EditorState.push(editorState, withInsertedText, 'insert-fragment'));
});
return;
}
}
var textBlocks = [];
var text = data.getText();
var html = data.getHTML();
if (this.props.handlePastedText && isEventHandled(this.props.handlePastedText(text, html))) {
return;
}
if (text) {
textBlocks = splitTextIntoTextBlocks(text);
}
if (!this.props.stripPastedStyles) {
// If the text from the paste event is rich content that matches what we
// already have on the internal clipboard, assume that we should just use
// the clipboard fragment for the paste. This will allow us to preserve
// styling and entities, if any are present. Note that newlines are
// stripped during comparison -- this is because copy/paste within the
// editor in Firefox and IE will not include empty lines. The resulting
// paste will preserve the newlines correctly.
var internalClipboard = this.getClipboard();
if (data.isRichText() && internalClipboard) {
if (
// If the editorKey is present in the pasted HTML, it should be safe to
// assume this is an internal paste.
html.indexOf(this.getEditorKey()) !== -1 ||
// The copy may have been made within a single block, in which case the
// editor key won't be part of the paste. In this case, just check
// whether the pasted text matches the internal clipboard.
textBlocks.length === 1 && internalClipboard.size === 1 && internalClipboard.first().getText() === text) {
this.update(insertFragment(this.props.editorState, internalClipboard));
return;
}
} else if (internalClipboard && data.types.includes('com.apple.webarchive') && !data.types.includes('text/html') && areTextBlocksAndClipboardEqual(textBlocks, internalClipboard)) {
// Safari does not properly store text/html in some cases.
// Use the internalClipboard if present and equal to what is on
// the clipboard. See https://bugs.webkit.org/show_bug.cgi?id=19893.
this.update(insertFragment(this.props.editorState, internalClipboard));
return;
}
// If there is html paste data, try to parse that.
if (html) {
var htmlFragment = DraftPasteProcessor.processHTML(html, this.props.blockRenderMap);
if (htmlFragment) {
var htmlMap = BlockMapBuilder.createFromArray(htmlFragment);
this.update(insertFragment(this.props.editorState, htmlMap));
return;
}
}
// Otherwise, create a new fragment from our pasted text. Also
// empty the internal clipboard, since it's no longer valid.
this.setClipboard(null);
}
if (textBlocks) {
var editorState = this.props.editorState;
var character = CharacterMetadata.create({
style: editorState.getCurrentInlineStyle(),
entity: getEntityKeyForSelection(editorState.getCurrentContent(), editorState.getSelection())
});
var textFragment = DraftPasteProcessor.processText(textBlocks, character);
var textMap = BlockMapBuilder.createFromArray(textFragment);
this.update(insertFragment(this.props.editorState, textMap));
}
}
function insertFragment(editorState, fragment) {
var newContent = DraftModifier.replaceWithFragment(editorState.getCurrentContent(), editorState.getSelection(), fragment);
return EditorState.push(editorState, newContent, 'insert-fragment');
}
function areTextBlocksAndClipboardEqual(textBlocks, blockMap) {
return textBlocks.length === blockMap.size && blockMap.valueSeq().every(function (block, ii) {
return block.getText() === textBlocks[ii];
});
}
module.exports = editOnPaste;
/***/ },
/* 1195 */
/*!***********************************************!*\
!*** ./~/draft-js/lib/DraftPasteProcessor.js ***!
\***********************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule DraftPasteProcessor
* @typechecks
*
*/
'use strict';
var CharacterMetadata = __webpack_require__(/*! ./CharacterMetadata */ 1092);
var ContentBlock = __webpack_require__(/*! ./ContentBlock */ 1093);
var Immutable = __webpack_require__(/*! immutable */ 1091);
var convertFromHTMLtoContentBlocks = __webpack_require__(/*! ./convertFromHTMLToContentBlocks */ 1196);
var generateRandomKey = __webpack_require__(/*! ./generateRandomKey */ 1105);
var getSafeBodyFromHTML = __webpack_require__(/*! ./getSafeBodyFromHTML */ 1198);
var sanitizeDraftText = __webpack_require__(/*! ./sanitizeDraftText */ 1117);
var List = Immutable.List;
var Repeat = Immutable.Repeat;
var DraftPasteProcessor = {
processHTML: function processHTML(html, blockRenderMap) {
return convertFromHTMLtoContentBlocks(html, getSafeBodyFromHTML, blockRenderMap);
},
processText: function processText(textBlocks, character) {
return textBlocks.map(function (textLine) {
textLine = sanitizeDraftText(textLine);
return new ContentBlock({
key: generateRandomKey(),
type: 'unstyled',
text: textLine,
characterList: List(Repeat(character, textLine.length))
});
});
}
};
module.exports = DraftPasteProcessor;
/***/ },
/* 1196 */
/*!**********************************************************!*\
!*** ./~/draft-js/lib/convertFromHTMLToContentBlocks.js ***!
\**********************************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule convertFromHTMLToContentBlocks
* @typechecks
*
*/
'use strict';
var CharacterMetadata = __webpack_require__(/*! ./CharacterMetadata */ 1092);
var ContentBlock = __webpack_require__(/*! ./ContentBlock */ 1093);
var DefaultDraftBlockRenderMap = __webpack_require__(/*! ./DefaultDraftBlockRenderMap */ 1124);
var DraftEntity = __webpack_require__(/*! ./DraftEntity */ 1100);
var Immutable = __webpack_require__(/*! immutable */ 1091);
var URI = __webpack_require__(/*! fbjs/lib/URI */ 1197);
var generateRandomKey = __webpack_require__(/*! ./generateRandomKey */ 1105);
var getSafeBodyFromHTML = __webpack_require__(/*! ./getSafeBodyFromHTML */ 1198);
var invariant = __webpack_require__(/*! fbjs/lib/invariant */ 9);
var nullthrows = __webpack_require__(/*! fbjs/lib/nullthrows */ 1122);
var sanitizeDraftText = __webpack_require__(/*! ./sanitizeDraftText */ 1117);
var List = Immutable.List;
var OrderedSet = Immutable.OrderedSet;
var NBSP = ' ';
var SPACE = ' ';
// Arbitrary max indent
var MAX_DEPTH = 4;
// used for replacing characters in HTML
var REGEX_CR = new RegExp('\r', 'g');
var REGEX_LF = new RegExp('\n', 'g');
var REGEX_NBSP = new RegExp(NBSP, 'g');
var REGEX_CARRIAGE = new RegExp(' ?', 'g');
var REGEX_ZWS = new RegExp('​?', 'g');
// https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight
var boldValues = ['bold', 'bolder', '500', '600', '700', '800', '900'];
var notBoldValues = ['light', 'lighter', '100', '200', '300', '400'];
// Block tag flow is different because LIs do not have
// a deterministic style ;_;
var inlineTags = {
b: 'BOLD',
code: 'CODE',
del: 'STRIKETHROUGH',
em: 'ITALIC',
i: 'ITALIC',
s: 'STRIKETHROUGH',
strike: 'STRIKETHROUGH',
strong: 'BOLD',
u: 'UNDERLINE'
};
var anchorAttr = ['className', 'href', 'rel', 'target', 'title'];
var lastBlock;
function getEmptyChunk() {
return {
text: '',
inlines: [],
entities: [],
blocks: []
};
}
function getWhitespaceChunk(inEntity) {
var entities = new Array(1);
if (inEntity) {
entities[0] = inEntity;
}
return {
text: SPACE,
inlines: [OrderedSet()],
entities: entities,
blocks: []
};
}
function getSoftNewlineChunk() {
return {
text: '\n',
inlines: [OrderedSet()],
entities: new Array(1),
blocks: []
};
}
function getBlockDividerChunk(block, depth) {
return {
text: '\r',
inlines: [OrderedSet()],
entities: new Array(1),
blocks: [{
type: block,
depth: Math.max(0, Math.min(MAX_DEPTH, depth))
}]
};
}
function getListBlockType(tag, lastList) {
if (tag === 'li') {
return lastList === 'ol' ? 'ordered-list-item' : 'unordered-list-item';
}
return null;
}
function getBlockMapSupportedTags(blockRenderMap) {
var unstyledElement = blockRenderMap.get('unstyled').element;
return blockRenderMap.map(function (config) {
return config.element;
}).valueSeq().toSet().filter(function (tag) {
return tag && tag !== unstyledElement;
}).toArray().sort();
}
// custom element conversions
function getMultiMatchedType(tag, lastList, multiMatchExtractor) {
for (var ii = 0; ii < multiMatchExtractor.length; ii++) {
var matchType = multiMatchExtractor[ii](tag, lastList);
if (matchType) {
return matchType;
}
}
return null;
}
function getBlockTypeForTag(tag, lastList, blockRenderMap) {
var matchedTypes = blockRenderMap.filter(function (config) {
return config.element === tag || config.wrapper === tag;
}).keySeq().toSet().toArray().sort();
// if we dont have any matched type, return unstyled
// if we have one matched type return it
// if we have multi matched types use the multi-match function to gather type
switch (matchedTypes.length) {
case 0:
return 'unstyled';
case 1:
return matchedTypes[0];
default:
return getMultiMatchedType(tag, lastList, [getListBlockType]) || 'unstyled';
}
}
function processInlineTag(tag, node, currentStyle) {
var styleToCheck = inlineTags[tag];
if (styleToCheck) {
currentStyle = currentStyle.add(styleToCheck).toOrderedSet();
} else if (node instanceof HTMLElement) {
(function () {
var htmlElement = node;
currentStyle = currentStyle.withMutations(function (style) {
var fontWeight = htmlElement.style.fontWeight;
var fontStyle = htmlElement.style.fontStyle;
var textDecoration = htmlElement.style.textDecoration;
if (boldValues.indexOf(fontWeight) >= 0) {
style.add('BOLD');
} else if (notBoldValues.indexOf(fontWeight) >= 0) {
style.remove('BOLD');
}
if (fontStyle === 'italic') {
style.add('ITALIC');
} else if (fontStyle === 'normal') {
style.remove('ITALIC');
}
if (textDecoration === 'underline') {
style.add('UNDERLINE');
}
if (textDecoration === 'line-through') {
style.add('STRIKETHROUGH');
}
if (textDecoration === 'none') {
style.remove('UNDERLINE');
style.remove('STRIKETHROUGH');
}
}).toOrderedSet();
})();
}
return currentStyle;
}
function joinChunks(A, B) {
// Sometimes two blocks will touch in the DOM and we need to strip the
// extra delimiter to preserve niceness.
var lastInA = A.text.slice(-1);
var firstInB = B.text.slice(0, 1);
if (lastInA === '\r' && firstInB === '\r') {
A.text = A.text.slice(0, -1);
A.inlines.pop();
A.entities.pop();
A.blocks.pop();
}
// Kill whitespace after blocks
if (lastInA === '\r') {
if (B.text === SPACE || B.text === '\n') {
return A;
} else if (firstInB === SPACE || firstInB === '\n') {
B.text = B.text.slice(1);
B.inlines.shift();
B.entities.shift();
}
}
return {
text: A.text + B.text,
inlines: A.inlines.concat(B.inlines),
entities: A.entities.concat(B.entities),
blocks: A.blocks.concat(B.blocks)
};
}
/**
* Check to see if we have anything like <p> <blockquote> <h1>... to create
* block tags from. If we do, we can use those and ignore <div> tags. If we
* don't, we can treat <div> tags as meaningful (unstyled) blocks.
*/
function containsSemanticBlockMarkup(html, blockTags) {
return blockTags.some(function (tag) {
return html.indexOf('<' + tag) !== -1;
});
}
function hasValidLinkText(link) {
!(link instanceof HTMLAnchorElement) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Link must be an HTMLAnchorElement.') : invariant(false) : void 0;
var protocol = link.protocol;
return protocol === 'http:' || protocol === 'https:' || protocol === 'mailto:';
}
function genFragment(node, inlineStyle, lastList, inBlock, blockTags, depth, blockRenderMap, inEntity) {
var nodeName = node.nodeName.toLowerCase();
var newBlock = false;
var nextBlockType = 'unstyled';
var lastLastBlock = lastBlock;
// Base Case
if (nodeName === '#text') {
var text = node.textContent;
if (text.trim() === '' && inBlock !== 'pre') {
return getWhitespaceChunk(inEntity);
}
if (inBlock !== 'pre') {
// Can't use empty string because MSWord
text = text.replace(REGEX_LF, SPACE);
}
// save the last block so we can use it later
lastBlock = nodeName;
return {
text: text,
inlines: Array(text.length).fill(inlineStyle),
entities: Array(text.length).fill(inEntity),
blocks: []
};
}
// save the last block so we can use it later
lastBlock = nodeName;
// BR tags
if (nodeName === 'br') {
if (lastLastBlock === 'br' && (!inBlock || getBlockTypeForTag(inBlock, lastList, blockRenderMap) === 'unstyled')) {
return getBlockDividerChunk('unstyled', depth);
}
return getSoftNewlineChunk();
}
var chunk = getEmptyChunk();
var newChunk = null;
// Inline tags
inlineStyle = processInlineTag(nodeName, node, inlineStyle);
// Handle lists
if (nodeName === 'ul' || nodeName === 'ol') {
if (lastList) {
depth += 1;
}
lastList = nodeName;
}
// Block Tags
if (!inBlock && blockTags.indexOf(nodeName) !== -1) {
chunk = getBlockDividerChunk(getBlockTypeForTag(nodeName, lastList, blockRenderMap), depth);
inBlock = nodeName;
newBlock = true;
} else if (lastList && inBlock === 'li' && nodeName === 'li') {
chunk = getBlockDividerChunk(getBlockTypeForTag(nodeName, lastList, blockRenderMap), depth);
inBlock = nodeName;
newBlock = true;
nextBlockType = lastList === 'ul' ? 'unordered-list-item' : 'ordered-list-item';
}
// Recurse through children
var child = node.firstChild;
if (child != null) {
nodeName = child.nodeName.toLowerCase();
}
var entityId = null;
while (child) {
if (child instanceof HTMLAnchorElement && child.href && hasValidLinkText(child)) {
(function () {
var anchor = child;
var entityConfig = {};
anchorAttr.forEach(function (attr) {
var anchorAttribute = anchor.getAttribute(attr);
if (anchorAttribute) {
entityConfig[attr] = anchorAttribute;
}
});
entityConfig.url = new URI(anchor.href).toString();
entityId = DraftEntity.create('LINK', 'MUTABLE', entityConfig);
})();
} else {
entityId = undefined;
}
newChunk = genFragment(child, inlineStyle, lastList, inBlock, blockTags, depth, blockRenderMap, entityId || inEntity);
chunk = joinChunks(chunk, newChunk);
var sibling = child.nextSibling;
// Put in a newline to break up blocks inside blocks
if (sibling && blockTags.indexOf(nodeName) >= 0 && inBlock) {
chunk = joinChunks(chunk, getSoftNewlineChunk());
}
if (sibling) {
nodeName = sibling.nodeName.toLowerCase();
}
child = sibling;
}
if (newBlock) {
chunk = joinChunks(chunk, getBlockDividerChunk(nextBlockType, depth));
}
return chunk;
}
function getChunkForHTML(html, DOMBuilder, blockRenderMap) {
html = html.trim().replace(REGEX_CR, '').replace(REGEX_NBSP, SPACE).replace(REGEX_CARRIAGE, '').replace(REGEX_ZWS, '');
var supportedBlockTags = getBlockMapSupportedTags(blockRenderMap);
var safeBody = DOMBuilder(html);
if (!safeBody) {
return null;
}
lastBlock = null;
// Sometimes we aren't dealing with content that contains nice semantic
// tags. In this case, use divs to separate everything out into paragraphs
// and hope for the best.
var workingBlocks = containsSemanticBlockMarkup(html, supportedBlockTags) ? supportedBlockTags : ['div'];
// Start with -1 block depth to offset the fact that we are passing in a fake
// UL block to start with.
var chunk = genFragment(safeBody, OrderedSet(), 'ul', null, workingBlocks, -1, blockRenderMap);
// join with previous block to prevent weirdness on paste
if (chunk.text.indexOf('\r') === 0) {
chunk = {
text: chunk.text.slice(1),
inlines: chunk.inlines.slice(1),
entities: chunk.entities.slice(1),
blocks: chunk.blocks
};
}
// Kill block delimiter at the end
if (chunk.text.slice(-1) === '\r') {
chunk.text = chunk.text.slice(0, -1);
chunk.inlines = chunk.inlines.slice(0, -1);
chunk.entities = chunk.entities.slice(0, -1);
chunk.blocks.pop();
}
// If we saw no block tags, put an unstyled one in
if (chunk.blocks.length === 0) {
chunk.blocks.push({ type: 'unstyled', depth: 0 });
}
// Sometimes we start with text that isn't in a block, which is then
// followed by blocks. Need to fix up the blocks to add in
// an unstyled block for this content
if (chunk.text.split('\r').length === chunk.blocks.length + 1) {
chunk.blocks.unshift({ type: 'unstyled', depth: 0 });
}
return chunk;
}
function convertFromHTMLtoContentBlocks(html) {
var DOMBuilder = arguments.length <= 1 || arguments[1] === undefined ? getSafeBodyFromHTML : arguments[1];
var blockRenderMap = arguments.length <= 2 || arguments[2] === undefined ? DefaultDraftBlockRenderMap : arguments[2];
// Be ABSOLUTELY SURE that the dom builder you pass here won't execute
// arbitrary code in whatever environment you're running this in. For an
// example of how we try to do this in-browser, see getSafeBodyFromHTML.
var chunk = getChunkForHTML(html, DOMBuilder, blockRenderMap);
if (chunk == null) {
return null;
}
var start = 0;
return chunk.text.split('\r').map(function (textBlock, ii) {
// Make absolutely certain that our text is acceptable.
textBlock = sanitizeDraftText(textBlock);
var end = start + textBlock.length;
var inlines = nullthrows(chunk).inlines.slice(start, end);
var entities = nullthrows(chunk).entities.slice(start, end);
var characterList = List(inlines.map(function (style, ii) {
var data = { style: style, entity: null };
if (entities[ii]) {
data.entity = entities[ii];
}
return CharacterMetadata.create(data);
}));
start = end + 1;
return new ContentBlock({
key: generateRandomKey(),
type: nullthrows(chunk).blocks[ii].type,
depth: nullthrows(chunk).blocks[ii].depth,
text: textBlock,
characterList: characterList
});
});
}
module.exports = convertFromHTMLtoContentBlocks;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../../process/browser.js */ 4)))
/***/ },
/* 1197 */
/*!***************************!*\
!*** ./~/fbjs/lib/URI.js ***!
\***************************/
/***/ function(module, exports) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
'use strict';
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var URI = function () {
function URI(uri) {
_classCallCheck(this, URI);
this._uri = uri;
}
URI.prototype.toString = function toString() {
return this._uri;
};
return URI;
}();
module.exports = URI;
/***/ },
/* 1198 */
/*!***********************************************!*\
!*** ./~/draft-js/lib/getSafeBodyFromHTML.js ***!
\***********************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule getSafeBodyFromHTML
*
*/
'use strict';
var UserAgent = __webpack_require__(/*! fbjs/lib/UserAgent */ 1136);
var isOldIE = UserAgent.isBrowser('IE <= 9');
// Provides a dom node that will not execute scripts
// https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation.createHTMLDocument
// https://developer.mozilla.org/en-US/Add-ons/Code_snippets/HTML_to_DOM
function getSafeBodyFromHTML(html) {
var doc;
var root = null;
// Provides a safe context
if (!isOldIE && document.implementation && document.implementation.createHTMLDocument) {
doc = document.implementation.createHTMLDocument('foo');
doc.documentElement.innerHTML = html;
root = doc.getElementsByTagName('body')[0];
}
return root;
}
module.exports = getSafeBodyFromHTML;
/***/ },
/* 1199 */
/*!***************************************************!*\
!*** ./~/draft-js/lib/splitTextIntoTextBlocks.js ***!
\***************************************************/
/***/ function(module, exports) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule splitTextIntoTextBlocks
*
*/
'use strict';
var NEWLINE_REGEX = /\r\n?|\n/g;
function splitTextIntoTextBlocks(text) {
return text.split(NEWLINE_REGEX);
}
module.exports = splitTextIntoTextBlocks;
/***/ },
/* 1200 */
/*!****************************************!*\
!*** ./~/draft-js/lib/editOnSelect.js ***!
\****************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule editOnSelect
*
*/
'use strict';
var EditorState = __webpack_require__(/*! ./EditorState */ 1113);
var ReactDOM = __webpack_require__(/*! react-dom */ 33);
var getDraftEditorSelection = __webpack_require__(/*! ./getDraftEditorSelection */ 1201);
function editOnSelect() {
if (this._blockSelectEvents) {
return;
}
var editorState = this.props.editorState;
var documentSelection = getDraftEditorSelection(editorState, ReactDOM.findDOMNode(this.refs.editorContainer).firstChild);
var updatedSelectionState = documentSelection.selectionState;
if (updatedSelectionState !== editorState.getSelection()) {
if (documentSelection.needsRecovery) {
editorState = EditorState.forceSelection(editorState, updatedSelectionState);
} else {
editorState = EditorState.acceptSelection(editorState, updatedSelectionState);
}
this.update(editorState);
}
}
module.exports = editOnSelect;
/***/ },
/* 1201 */
/*!***************************************************!*\
!*** ./~/draft-js/lib/getDraftEditorSelection.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule getDraftEditorSelection
* @typechecks
*
*/
'use strict';
var getDraftEditorSelectionWithNodes = __webpack_require__(/*! ./getDraftEditorSelectionWithNodes */ 1179);
/**
* Convert the current selection range to an anchor/focus pair of offset keys
* and values that can be interpreted by components.
*/
function getDraftEditorSelection(editorState, root) {
var selection = global.getSelection();
// No active selection.
if (selection.rangeCount === 0) {
return {
selectionState: editorState.getSelection().set('hasFocus', false),
needsRecovery: false
};
}
return getDraftEditorSelectionWithNodes(editorState, root, selection.anchorNode, selection.anchorOffset, selection.focusNode, selection.focusOffset);
}
module.exports = getDraftEditorSelection;
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
/***/ },
/* 1202 */
/*!********************************************************!*\
!*** ./~/draft-js/lib/DraftEditorPlaceholder.react.js ***!
\********************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule DraftEditorPlaceholder.react
* @typechecks
*
*/
'use strict';
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 React = __webpack_require__(/*! react */ 2);
var cx = __webpack_require__(/*! fbjs/lib/cx */ 1125);
/**
* This component is responsible for rendering placeholder text for the
* `DraftEditor` component.
*
* Override placeholder style via CSS.
*/
var DraftEditorPlaceholder = function (_React$Component) {
_inherits(DraftEditorPlaceholder, _React$Component);
function DraftEditorPlaceholder() {
_classCallCheck(this, DraftEditorPlaceholder);
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
}
DraftEditorPlaceholder.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps) {
return this.props.text !== nextProps.text || this.props.editorState.getSelection().getHasFocus() !== nextProps.editorState.getSelection().getHasFocus();
};
DraftEditorPlaceholder.prototype.render = function render() {
var hasFocus = this.props.editorState.getSelection().getHasFocus();
var className = cx({
'public/DraftEditorPlaceholder/root': true,
'public/DraftEditorPlaceholder/hasFocus': hasFocus
});
return React.createElement(
'div',
{ className: className },
React.createElement(
'div',
{
className: cx('public/DraftEditorPlaceholder/inner'),
id: this.props.accessibilityID },
this.props.text
)
);
};
return DraftEditorPlaceholder;
}(React.Component);
module.exports = DraftEditorPlaceholder;
/***/ },
/* 1203 */
/*!************************************************!*\
!*** ./~/draft-js/lib/getDefaultKeyBinding.js ***!
\************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule getDefaultKeyBinding
* @typechecks
*
*/
'use strict';
var KeyBindingUtil = __webpack_require__(/*! ./KeyBindingUtil */ 1173);
var Keys = __webpack_require__(/*! fbjs/lib/Keys */ 1129);
var UserAgent = __webpack_require__(/*! fbjs/lib/UserAgent */ 1136);
var isOSX = UserAgent.isPlatform('Mac OS X');
var isWindows = UserAgent.isPlatform('Windows');
// Firefox on OSX had a bug resulting in navigation instead of cursor movement.
// This bug was fixed in Firefox 29. Feature detection is virtually impossible
// so we just check the version number. See #342765.
var shouldFixFirefoxMovement = isOSX && UserAgent.isBrowser('Firefox < 29');
var hasCommandModifier = KeyBindingUtil.hasCommandModifier;
var isCtrlKeyCommand = KeyBindingUtil.isCtrlKeyCommand;
function shouldRemoveWord(e) {
return isOSX && e.altKey || isCtrlKeyCommand(e);
}
/**
* Get the appropriate undo/redo command for a Z key command.
*/
function getZCommand(e) {
if (!hasCommandModifier(e)) {
return null;
}
return e.shiftKey ? 'redo' : 'undo';
}
function getDeleteCommand(e) {
// Allow default "cut" behavior for Windows on Shift + Delete.
if (isWindows && e.shiftKey) {
return null;
}
return shouldRemoveWord(e) ? 'delete-word' : 'delete';
}
function getBackspaceCommand(e) {
if (hasCommandModifier(e) && isOSX) {
return 'backspace-to-start-of-line';
}
return shouldRemoveWord(e) ? 'backspace-word' : 'backspace';
}
/**
* Retrieve a bound key command for the given event.
*/
function getDefaultKeyBinding(e) {
switch (e.keyCode) {
case 66:
// B
return hasCommandModifier(e) ? 'bold' : null;
case 68:
// D
return isCtrlKeyCommand(e) ? 'delete' : null;
case 72:
// H
return isCtrlKeyCommand(e) ? 'backspace' : null;
case 73:
// I
return hasCommandModifier(e) ? 'italic' : null;
case 74:
// J
return hasCommandModifier(e) ? 'code' : null;
case 75:
// K
return !isWindows && isCtrlKeyCommand(e) ? 'secondary-cut' : null;
case 77:
// M
return isCtrlKeyCommand(e) ? 'split-block' : null;
case 79:
// O
return isCtrlKeyCommand(e) ? 'split-block' : null;
case 84:
// T
return isOSX && isCtrlKeyCommand(e) ? 'transpose-characters' : null;
case 85:
// U
return hasCommandModifier(e) ? 'underline' : null;
case 87:
// W
return isOSX && isCtrlKeyCommand(e) ? 'backspace-word' : null;
case 89:
// Y
if (isCtrlKeyCommand(e)) {
return isWindows ? 'redo' : 'secondary-paste';
}
return null;
case 90:
// Z
return getZCommand(e) || null;
case Keys.RETURN:
return 'split-block';
case Keys.DELETE:
return getDeleteCommand(e);
case Keys.BACKSPACE:
return getBackspaceCommand(e);
// LEFT/RIGHT handlers serve as a workaround for a Firefox bug.
case Keys.LEFT:
return shouldFixFirefoxMovement && hasCommandModifier(e) ? 'move-selection-to-start-of-block' : null;
case Keys.RIGHT:
return shouldFixFirefoxMovement && hasCommandModifier(e) ? 'move-selection-to-end-of-block' : null;
default:
return null;
}
}
module.exports = getDefaultKeyBinding;
/***/ },
/* 1204 */
/*!**********************************************!*\
!*** ./~/draft-js/lib/RichTextEditorUtil.js ***!
\**********************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule RichTextEditorUtil
* @typechecks
*
*/
'use strict';
var DraftEntity = __webpack_require__(/*! ./DraftEntity */ 1100);
var DraftModifier = __webpack_require__(/*! ./DraftModifier */ 1095);
var EditorState = __webpack_require__(/*! ./EditorState */ 1113);
var SelectionState = __webpack_require__(/*! ./SelectionState */ 1116);
var adjustBlockDepthForContentState = __webpack_require__(/*! ./adjustBlockDepthForContentState */ 1205);
var nullthrows = __webpack_require__(/*! fbjs/lib/nullthrows */ 1122);
var RichTextEditorUtil = {
currentBlockContainsLink: function currentBlockContainsLink(editorState) {
var selection = editorState.getSelection();
return editorState.getCurrentContent().getBlockForKey(selection.getAnchorKey()).getCharacterList().slice(selection.getStartOffset(), selection.getEndOffset()).some(function (v) {
var entity = v.getEntity();
return !!entity && DraftEntity.get(entity).getType() === 'LINK';
});
},
getCurrentBlockType: function getCurrentBlockType(editorState) {
var selection = editorState.getSelection();
return editorState.getCurrentContent().getBlockForKey(selection.getStartKey()).getType();
},
getDataObjectForLinkURL: function getDataObjectForLinkURL(uri) {
return { url: uri.toString() };
},
handleKeyCommand: function handleKeyCommand(editorState, command) {
switch (command) {
case 'bold':
return RichTextEditorUtil.toggleInlineStyle(editorState, 'BOLD');
case 'italic':
return RichTextEditorUtil.toggleInlineStyle(editorState, 'ITALIC');
case 'underline':
return RichTextEditorUtil.toggleInlineStyle(editorState, 'UNDERLINE');
case 'code':
return RichTextEditorUtil.toggleCode(editorState);
case 'backspace':
case 'backspace-word':
case 'backspace-to-start-of-line':
return RichTextEditorUtil.onBackspace(editorState);
case 'delete':
case 'delete-word':
case 'delete-to-end-of-block':
return RichTextEditorUtil.onDelete(editorState);
default:
return null;
}
},
insertSoftNewline: function insertSoftNewline(editorState) {
var contentState = DraftModifier.insertText(editorState.getCurrentContent(), editorState.getSelection(), '\n', editorState.getCurrentInlineStyle(), null);
var newEditorState = EditorState.push(editorState, contentState, 'insert-characters');
return EditorState.forceSelection(newEditorState, contentState.getSelectionAfter());
},
/**
* For collapsed selections at the start of styled blocks, backspace should
* just remove the existing style.
*/
onBackspace: function onBackspace(editorState) {
var selection = editorState.getSelection();
if (!selection.isCollapsed() || selection.getAnchorOffset() || selection.getFocusOffset()) {
return null;
}
// First, try to remove a preceding atomic block.
var content = editorState.getCurrentContent();
var startKey = selection.getStartKey();
var blockBefore = content.getBlockBefore(startKey);
if (blockBefore && blockBefore.getType() === 'atomic') {
var atomicBlockTarget = selection.merge({
anchorKey: blockBefore.getKey(),
anchorOffset: 0
});
var asCurrentStyle = DraftModifier.setBlockType(content, atomicBlockTarget, content.getBlockForKey(startKey).getType());
var withoutAtomicBlock = DraftModifier.removeRange(asCurrentStyle, atomicBlockTarget, 'backward');
if (withoutAtomicBlock !== content) {
return EditorState.push(editorState, withoutAtomicBlock, 'remove-range');
}
}
// If that doesn't succeed, try to remove the current block style.
var withoutBlockStyle = RichTextEditorUtil.tryToRemoveBlockStyle(editorState);
if (withoutBlockStyle) {
return EditorState.push(editorState, withoutBlockStyle, 'change-block-type');
}
return null;
},
onDelete: function onDelete(editorState) {
var selection = editorState.getSelection();
if (!selection.isCollapsed()) {
return null;
}
var content = editorState.getCurrentContent();
var startKey = selection.getStartKey();
var block = content.getBlockForKey(startKey);
var length = block.getLength();
// The cursor is somewhere within the text. Behave normally.
if (selection.getStartOffset() < length) {
return null;
}
var blockAfter = content.getBlockAfter(startKey);
if (!blockAfter || blockAfter.getType() !== 'atomic') {
return null;
}
var atomicBlockTarget = selection.merge({
focusKey: blockAfter.getKey(),
focusOffset: blockAfter.getLength()
});
var withoutAtomicBlock = DraftModifier.removeRange(content, atomicBlockTarget, 'forward');
if (withoutAtomicBlock !== content) {
return EditorState.push(editorState, withoutAtomicBlock, 'remove-range');
}
return null;
},
onTab: function onTab(event, editorState, maxDepth) {
var selection = editorState.getSelection();
var key = selection.getAnchorKey();
if (key !== selection.getFocusKey()) {
return editorState;
}
var content = editorState.getCurrentContent();
var block = content.getBlockForKey(key);
var type = block.getType();
if (type !== 'unordered-list-item' && type !== 'ordered-list-item') {
return editorState;
}
event.preventDefault();
// Only allow indenting one level beyond the block above, and only if
// the block above is a list item as well.
var blockAbove = content.getBlockBefore(key);
if (!blockAbove) {
return editorState;
}
var typeAbove = blockAbove.getType();
if (typeAbove !== 'unordered-list-item' && typeAbove !== 'ordered-list-item') {
return editorState;
}
var depth = block.getDepth();
if (!event.shiftKey && depth === maxDepth) {
return editorState;
}
maxDepth = Math.min(blockAbove.getDepth() + 1, maxDepth);
var withAdjustment = adjustBlockDepthForContentState(content, selection, event.shiftKey ? -1 : 1, maxDepth);
return EditorState.push(editorState, withAdjustment, 'adjust-depth');
},
toggleBlockType: function toggleBlockType(editorState, blockType) {
var selection = editorState.getSelection();
var startKey = selection.getStartKey();
var endKey = selection.getEndKey();
var content = editorState.getCurrentContent();
var target = selection;
// Triple-click can lead to a selection that includes offset 0 of the
// following block. The `SelectionState` for this case is accurate, but
// we should avoid toggling block type for the trailing block because it
// is a confusing interaction.
if (startKey !== endKey && selection.getEndOffset() === 0) {
var blockBefore = nullthrows(content.getBlockBefore(endKey));
endKey = blockBefore.getKey();
target = target.merge({
anchorKey: startKey,
anchorOffset: selection.getStartOffset(),
focusKey: endKey,
focusOffset: blockBefore.getLength(),
isBackward: false
});
}
var hasAtomicBlock = content.getBlockMap().skipWhile(function (_, k) {
return k !== startKey;
}).reverse().skipWhile(function (_, k) {
return k !== endKey;
}).some(function (v) {
return v.getType() === 'atomic';
});
if (hasAtomicBlock) {
return editorState;
}
var typeToSet = content.getBlockForKey(startKey).getType() === blockType ? 'unstyled' : blockType;
return EditorState.push(editorState, DraftModifier.setBlockType(content, target, typeToSet), 'change-block-type');
},
toggleCode: function toggleCode(editorState) {
var selection = editorState.getSelection();
var anchorKey = selection.getAnchorKey();
var focusKey = selection.getFocusKey();
if (selection.isCollapsed() || anchorKey !== focusKey) {
return RichTextEditorUtil.toggleBlockType(editorState, 'code-block');
}
return RichTextEditorUtil.toggleInlineStyle(editorState, 'CODE');
},
/**
* Toggle the specified inline style for the selection. If the
* user's selection is collapsed, apply or remove the style for the
* internal state. If it is not collapsed, apply the change directly
* to the document state.
*/
toggleInlineStyle: function toggleInlineStyle(editorState, inlineStyle) {
var selection = editorState.getSelection();
var currentStyle = editorState.getCurrentInlineStyle();
// If the selection is collapsed, toggle the specified style on or off and
// set the result as the new inline style override. This will then be
// used as the inline style for the next character to be inserted.
if (selection.isCollapsed()) {
return EditorState.setInlineStyleOverride(editorState, currentStyle.has(inlineStyle) ? currentStyle.remove(inlineStyle) : currentStyle.add(inlineStyle));
}
// If characters are selected, immediately apply or remove the
// inline style on the document state itself.
var content = editorState.getCurrentContent();
var newContent;
// If the style is already present for the selection range, remove it.
// Otherwise, apply it.
if (currentStyle.has(inlineStyle)) {
newContent = DraftModifier.removeInlineStyle(content, selection, inlineStyle);
} else {
newContent = DraftModifier.applyInlineStyle(content, selection, inlineStyle);
}
return EditorState.push(editorState, newContent, 'change-inline-style');
},
toggleLink: function toggleLink(editorState, targetSelection, entityKey) {
var withoutLink = DraftModifier.applyEntity(editorState.getCurrentContent(), targetSelection, entityKey);
return EditorState.push(editorState, withoutLink, 'apply-entity');
},
/**
* When a collapsed cursor is at the start of an empty styled block, allow
* certain key commands (newline, backspace) to simply change the
* style of the block instead of the default behavior.
*/
tryToRemoveBlockStyle: function tryToRemoveBlockStyle(editorState) {
var selection = editorState.getSelection();
var offset = selection.getAnchorOffset();
if (selection.isCollapsed() && offset === 0) {
var key = selection.getAnchorKey();
var content = editorState.getCurrentContent();
var block = content.getBlockForKey(key);
if (block.getLength() > 0) {
return null;
}
var type = block.getType();
var blockBefore = content.getBlockBefore(key);
if (type === 'code-block' && blockBefore && blockBefore.getType() === 'code-block') {
return null;
}
if (type !== 'unstyled') {
return DraftModifier.setBlockType(content, selection, 'unstyled');
}
}
return null;
}
};
module.exports = RichTextEditorUtil;
/***/ },
/* 1205 */
/*!***********************************************************!*\
!*** ./~/draft-js/lib/adjustBlockDepthForContentState.js ***!
\***********************************************************/
/***/ function(module, exports) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule adjustBlockDepthForContentState
* @typechecks
*
*/
'use strict';
function adjustBlockDepthForContentState(contentState, selectionState, adjustment, maxDepth) {
var startKey = selectionState.getStartKey();
var endKey = selectionState.getEndKey();
var blockMap = contentState.getBlockMap();
var blocks = blockMap.toSeq().skipUntil(function (_, k) {
return k === startKey;
}).takeUntil(function (_, k) {
return k === endKey;
}).concat([[endKey, blockMap.get(endKey)]]).map(function (block) {
var depth = block.getDepth() + adjustment;
depth = Math.max(0, Math.min(depth, maxDepth));
return block.set('depth', depth);
});
blockMap = blockMap.merge(blocks);
return contentState.merge({
blockMap: blockMap,
selectionBefore: selectionState,
selectionAfter: selectionState
});
}
module.exports = adjustBlockDepthForContentState;
/***/ },
/* 1206 */
/*!******************************************************!*\
!*** ./~/draft-js/lib/convertFromDraftStateToRaw.js ***!
\******************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule convertFromDraftStateToRaw
*
*/
'use strict';
var DraftEntity = __webpack_require__(/*! ./DraftEntity */ 1100);
var DraftStringKey = __webpack_require__(/*! ./DraftStringKey */ 1207);
var encodeEntityRanges = __webpack_require__(/*! ./encodeEntityRanges */ 1208);
var encodeInlineStyleRanges = __webpack_require__(/*! ./encodeInlineStyleRanges */ 1209);
function convertFromDraftStateToRaw(contentState) {
var entityStorageKey = 0;
var entityStorageMap = {};
var rawBlocks = [];
contentState.getBlockMap().forEach(function (block, blockKey) {
block.findEntityRanges(function (character) {
return character.getEntity() !== null;
}, function (start) {
// Stringify to maintain order of otherwise numeric keys.
var stringifiedEntityKey = DraftStringKey.stringify(block.getEntityAt(start));
if (!entityStorageMap.hasOwnProperty(stringifiedEntityKey)) {
entityStorageMap[stringifiedEntityKey] = '' + entityStorageKey++;
}
});
rawBlocks.push({
key: blockKey,
text: block.getText(),
type: block.getType(),
depth: block.getDepth(),
inlineStyleRanges: encodeInlineStyleRanges(block),
entityRanges: encodeEntityRanges(block, entityStorageMap),
data: block.getData().toObject()
});
});
// Flip storage map so that our storage keys map to global
// DraftEntity keys.
var entityKeys = Object.keys(entityStorageMap);
var flippedStorageMap = {};
entityKeys.forEach(function (key, jj) {
var entity = DraftEntity.get(DraftStringKey.unstringify(key));
flippedStorageMap[jj] = {
type: entity.getType(),
mutability: entity.getMutability(),
data: entity.getData()
};
});
return {
entityMap: flippedStorageMap,
blocks: rawBlocks
};
}
module.exports = convertFromDraftStateToRaw;
/***/ },
/* 1207 */
/*!******************************************!*\
!*** ./~/draft-js/lib/DraftStringKey.js ***!
\******************************************/
/***/ function(module, exports) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule DraftStringKey
* @typechecks
*
*/
'use strict';
var DraftStringKey = {
stringify: function stringify(key) {
return '_' + String(key);
},
unstringify: function unstringify(key) {
return key.slice(1);
}
};
module.exports = DraftStringKey;
/***/ },
/* 1208 */
/*!**********************************************!*\
!*** ./~/draft-js/lib/encodeEntityRanges.js ***!
\**********************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule encodeEntityRanges
* @typechecks
*
*/
'use strict';
var DraftStringKey = __webpack_require__(/*! ./DraftStringKey */ 1207);
var UnicodeUtils = __webpack_require__(/*! fbjs/lib/UnicodeUtils */ 1177);
var strlen = UnicodeUtils.strlen;
/**
* Convert to UTF-8 character counts for storage.
*/
function encodeEntityRanges(block, storageMap) {
var encoded = [];
block.findEntityRanges(function (character) {
return !!character.getEntity();
}, function ( /*number*/start, /*number*/end) {
var text = block.getText();
var key = block.getEntityAt(start);
encoded.push({
offset: strlen(text.slice(0, start)),
length: strlen(text.slice(start, end)),
// Encode the key as a number for range storage.
key: Number(storageMap[DraftStringKey.stringify(key)])
});
});
return encoded;
}
module.exports = encodeEntityRanges;
/***/ },
/* 1209 */
/*!***************************************************!*\
!*** ./~/draft-js/lib/encodeInlineStyleRanges.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule encodeInlineStyleRanges
*
*/
'use strict';
var UnicodeUtils = __webpack_require__(/*! fbjs/lib/UnicodeUtils */ 1177);
var findRangesImmutable = __webpack_require__(/*! ./findRangesImmutable */ 1094);
var areEqual = function areEqual(a, b) {
return a === b;
};
var isTruthy = function isTruthy(a) {
return !!a;
};
var EMPTY_ARRAY = [];
/**
* Helper function for getting encoded styles for each inline style. Convert
* to UTF-8 character counts for storage.
*/
function getEncodedInlinesForType(block, styleList, styleToEncode) {
var ranges = [];
// Obtain an array with ranges for only the specified style.
var filteredInlines = styleList.map(function (style) {
return style.has(styleToEncode);
}).toList();
findRangesImmutable(filteredInlines, areEqual,
// We only want to keep ranges with nonzero style values.
isTruthy, function (start, end) {
var text = block.getText();
ranges.push({
offset: UnicodeUtils.strlen(text.slice(0, start)),
length: UnicodeUtils.strlen(text.slice(start, end)),
style: styleToEncode
});
});
return ranges;
}
/*
* Retrieve the encoded arrays of inline styles, with each individual style
* treated separately.
*/
function encodeInlineStyleRanges(block) {
var styleList = block.getCharacterList().map(function (c) {
return c.getStyle();
}).toList();
var ranges = styleList.flatten().toSet().map(function (style) {
return getEncodedInlinesForType(block, styleList, style);
});
return Array.prototype.concat.apply(EMPTY_ARRAY, ranges.toJS());
}
module.exports = encodeInlineStyleRanges;
/***/ },
/* 1210 */
/*!******************************************************!*\
!*** ./~/draft-js/lib/convertFromRawToDraftState.js ***!
\******************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule convertFromRawToDraftState
*
*/
'use strict';
var _assign = __webpack_require__(/*! object-assign */ 5);
var _extends = _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 ContentBlock = __webpack_require__(/*! ./ContentBlock */ 1093);
var ContentState = __webpack_require__(/*! ./ContentState */ 1115);
var DraftEntity = __webpack_require__(/*! ./DraftEntity */ 1100);
var Immutable = __webpack_require__(/*! immutable */ 1091);
var createCharacterList = __webpack_require__(/*! ./createCharacterList */ 1211);
var decodeEntityRanges = __webpack_require__(/*! ./decodeEntityRanges */ 1212);
var decodeInlineStyleRanges = __webpack_require__(/*! ./decodeInlineStyleRanges */ 1213);
var generateRandomKey = __webpack_require__(/*! ./generateRandomKey */ 1105);
var Map = Immutable.Map;
function convertFromRawToDraftState(rawState) {
var blocks = rawState.blocks;
var entityMap = rawState.entityMap;
var fromStorageToLocal = {};
Object.keys(entityMap).forEach(function (storageKey) {
var encodedEntity = entityMap[storageKey];
var type = encodedEntity.type;
var mutability = encodedEntity.mutability;
var data = encodedEntity.data;
var newKey = DraftEntity.create(type, mutability, data || {});
fromStorageToLocal[storageKey] = newKey;
});
var contentBlocks = blocks.map(function (block) {
var key = block.key;
var type = block.type;
var text = block.text;
var depth = block.depth;
var inlineStyleRanges = block.inlineStyleRanges;
var entityRanges = block.entityRanges;
var data = block.data;
key = key || generateRandomKey();
depth = depth || 0;
inlineStyleRanges = inlineStyleRanges || [];
entityRanges = entityRanges || [];
data = Map(data);
var inlineStyles = decodeInlineStyleRanges(text, inlineStyleRanges);
// Translate entity range keys to the DraftEntity map.
var filteredEntityRanges = entityRanges.filter(function (range) {
return fromStorageToLocal.hasOwnProperty(range.key);
}).map(function (range) {
return _extends({}, range, { key: fromStorageToLocal[range.key] });
});
var entities = decodeEntityRanges(text, filteredEntityRanges);
var characterList = createCharacterList(inlineStyles, entities);
return new ContentBlock({ key: key, type: type, text: text, depth: depth, characterList: characterList, data: data });
});
return ContentState.createFromBlockArray(contentBlocks);
}
module.exports = convertFromRawToDraftState;
/***/ },
/* 1211 */
/*!***********************************************!*\
!*** ./~/draft-js/lib/createCharacterList.js ***!
\***********************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule createCharacterList
* @typechecks
*
*/
'use strict';
var CharacterMetadata = __webpack_require__(/*! ./CharacterMetadata */ 1092);
var Immutable = __webpack_require__(/*! immutable */ 1091);
var List = Immutable.List;
function createCharacterList(inlineStyles, entities) {
var characterArray = inlineStyles.map(function (style, ii) {
var entity = entities[ii];
return CharacterMetadata.create({ style: style, entity: entity });
});
return List(characterArray);
}
module.exports = createCharacterList;
/***/ },
/* 1212 */
/*!**********************************************!*\
!*** ./~/draft-js/lib/decodeEntityRanges.js ***!
\**********************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule decodeEntityRanges
* @typechecks
*
*/
'use strict';
var UnicodeUtils = __webpack_require__(/*! fbjs/lib/UnicodeUtils */ 1177);
var substr = UnicodeUtils.substr;
/**
* Convert to native JavaScript string lengths to determine ranges.
*/
function decodeEntityRanges(text, ranges) {
var entities = Array(text.length).fill(null);
if (ranges) {
ranges.forEach(function (range) {
// Using Unicode-enabled substrings converted to JavaScript lengths,
// fill the output array with entity keys.
var start = substr(text, 0, range.offset).length;
var end = start + substr(text, range.offset, range.length).length;
for (var ii = start; ii < end; ii++) {
entities[ii] = range.key;
}
});
}
return entities;
}
module.exports = decodeEntityRanges;
/***/ },
/* 1213 */
/*!***************************************************!*\
!*** ./~/draft-js/lib/decodeInlineStyleRanges.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule decodeInlineStyleRanges
* @typechecks
*
*/
'use strict';
var UnicodeUtils = __webpack_require__(/*! fbjs/lib/UnicodeUtils */ 1177);
var _require = __webpack_require__(/*! immutable */ 1091);
var OrderedSet = _require.OrderedSet;
var substr = UnicodeUtils.substr;
var EMPTY_SET = OrderedSet();
/**
* Convert to native JavaScript string lengths to determine ranges.
*/
function decodeInlineStyleRanges(text, ranges) {
var styles = Array(text.length).fill(EMPTY_SET);
if (ranges) {
ranges.forEach(function ( /*object*/range) {
var cursor = substr(text, 0, range.offset).length;
var end = cursor + substr(text, range.offset, range.length).length;
while (cursor < end) {
styles[cursor] = styles[cursor].add(range.style);
cursor++;
}
});
}
return styles;
}
module.exports = decodeInlineStyleRanges;
/***/ },
/* 1214 */
/*!***************************************************!*\
!*** ./~/draft-js/lib/getVisibleSelectionRect.js ***!
\***************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule getVisibleSelectionRect
* @typechecks
*
*/
'use strict';
var getRangeBoundingClientRect = __webpack_require__(/*! ./getRangeBoundingClientRect */ 1215);
/**
* Return the bounding ClientRect for the visible DOM selection, if any.
* In cases where there are no selected ranges or the bounding rect is
* temporarily invalid, return null.
*/
function getVisibleSelectionRect(global) {
var selection = global.getSelection();
if (!selection.rangeCount) {
return null;
}
var range = selection.getRangeAt(0);
var boundingRect = getRangeBoundingClientRect(range);
var top = boundingRect.top;
var right = boundingRect.right;
var bottom = boundingRect.bottom;
var left = boundingRect.left;
// When a re-render leads to a node being removed, the DOM selection will
// temporarily be placed on an ancestor node, which leads to an invalid
// bounding rect. Discard this state.
if (top === 0 && right === 0 && bottom === 0 && left === 0) {
return null;
}
return boundingRect;
}
module.exports = getVisibleSelectionRect;
/***/ },
/* 1215 */
/*!******************************************************!*\
!*** ./~/draft-js/lib/getRangeBoundingClientRect.js ***!
\******************************************************/
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule getRangeBoundingClientRect
* @typechecks
*
*/
'use strict';
var getRangeClientRects = __webpack_require__(/*! ./getRangeClientRects */ 1178);
/**
* Like range.getBoundingClientRect() but normalizes for browser bugs.
*/
function getRangeBoundingClientRect(range) {
// "Return a DOMRect object describing the smallest rectangle that includes
// the first rectangle in list and all of the remaining rectangles of which
// the height or width is not zero."
// http://www.w3.org/TR/cssom-view/#dom-range-getboundingclientrect
var rects = getRangeClientRects(range);
var top = 0;
var right = 0;
var bottom = 0;
var left = 0;
if (rects.length) {
var _rects$ = rects[0];
top = _rects$.top;
right = _rects$.right;
bottom = _rects$.bottom;
left = _rects$.left;
for (var ii = 1; ii < rects.length; ii++) {
var rect = rects[ii];
if (rect.height !== 0 || rect.width !== 0) {
top = Math.min(top, rect.top);
right = Math.max(right, rect.right);
bottom = Math.max(bottom, rect.bottom);
left = Math.min(left, rect.left);
}
}
}
return {
top: top,
right: right,
bottom: bottom,
left: left,
width: right - left,
height: bottom - top
};
}
module.exports = getRangeBoundingClientRect;
/***/ },
/* 1216 */
/*!***************************************!*\
!*** ./~/react-rte/dist/react-rte.js ***!
\***************************************/
/***/ function(module, exports, __webpack_require__) {
module.exports = /******/
function(modules) {
/******/
/******/
// 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] = {
/******/
exports: {},
/******/
id: moduleId,
/******/
loaded: !1
};
/******/
/******/
// Return the exports of the module
/******/
/******/
/******/
// Execute the module function
/******/
/******/
/******/
// Flag the module as loaded
/******/
return modules[moduleId].call(module.exports, module, module.exports, __webpack_require__),
module.loaded = !0, module.exports;
}
// webpackBootstrap
/******/
// The module cache
/******/
var installedModules = {};
/******/
/******/
// Load entry module and return exports
/******/
/******/
/******/
/******/
// expose the modules object (__webpack_modules__)
/******/
/******/
/******/
// expose the module cache
/******/
/******/
/******/
// __webpack_public_path__
/******/
return __webpack_require__.m = modules, __webpack_require__.c = installedModules,
__webpack_require__.p = "", __webpack_require__(0);
}([ /* 0 */
/***/
function(module, exports, __webpack_require__) {
"use strict";
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function _defineProperty(obj, key, value) {
return key in obj ? Object.defineProperty(obj, key, {
value: value,
enumerable: !0,
configurable: !0,
writable: !0
}) : obj[key] = value, obj;
}
function _objectWithoutProperties(obj, keys) {
var target = {};
for (var i in obj) keys.indexOf(i) >= 0 || Object.prototype.hasOwnProperty.call(obj, i) && (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 || "object" != typeof call && "function" != typeof call ? self : call;
}
function _inherits(subClass, superClass) {
if ("function" != typeof superClass && null !== superClass) 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: !1,
writable: !0,
configurable: !0
}
}), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass);
}
function defaultBlockStyleFn(block) {
var result = _RichTextEditor2.default.block;
switch (block.getType()) {
case "unstyled":
return (0, _classnames2.default)(result, _RichTextEditor2.default.paragraph);
case "blockquote":
return (0, _classnames2.default)(result, _RichTextEditor2.default.blockquote);
case "code-block":
return (0, _classnames2.default)(result, _RichTextEditor2.default.codeBlock);
default:
return result;
}
}
function createEmptyValue() {
return _EditorValue2.default.createEmpty(decorator);
}
function createValueFromString(markup, format, options) {
return _EditorValue2.default.createFromString(markup, format, decorator, options);
}
Object.defineProperty(exports, "__esModule", {
value: !0
}), exports.createValueFromString = exports.createEmptyValue = exports.decorator = exports.EditorValue = void 0;
var _extends = Object.assign || function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]);
}
return target;
}, _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0,
"value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps),
Constructor;
};
}(), _react = __webpack_require__(1), _react2 = _interopRequireDefault(_react), _draftJs = __webpack_require__(2), _getDefaultKeyBinding = __webpack_require__(130), _getDefaultKeyBinding2 = _interopRequireDefault(_getDefaultKeyBinding), _changeBlockDepth = __webpack_require__(143), _changeBlockDepth2 = _interopRequireDefault(_changeBlockDepth), _changeBlockType = __webpack_require__(144), _changeBlockType2 = _interopRequireDefault(_changeBlockType), _insertBlockAfter = __webpack_require__(145), _insertBlockAfter2 = _interopRequireDefault(_insertBlockAfter), _isListItem = __webpack_require__(146), _isListItem2 = _interopRequireDefault(_isListItem), _isSoftNewlineEvent = __webpack_require__(154), _isSoftNewlineEvent2 = _interopRequireDefault(_isSoftNewlineEvent), _EditorToolbar = __webpack_require__(155), _EditorToolbar2 = _interopRequireDefault(_EditorToolbar), _EditorValue = __webpack_require__(185), _EditorValue2 = _interopRequireDefault(_EditorValue), _LinkDecorator = __webpack_require__(204), _LinkDecorator2 = _interopRequireDefault(_LinkDecorator), _composite = __webpack_require__(205), _composite2 = _interopRequireDefault(_composite), _classnames = __webpack_require__(159), _classnames2 = _interopRequireDefault(_classnames), _classAutobind = __webpack_require__(161), _classAutobind2 = _interopRequireDefault(_classAutobind), _events = __webpack_require__(206), _events2 = _interopRequireDefault(_events), _draftJsUtils = __webpack_require__(147);
__webpack_require__(207);
var _RichTextEditor = __webpack_require__(209), _RichTextEditor2 = _interopRequireDefault(_RichTextEditor), MAX_LIST_DEPTH = 2, styleMap = {
CODE: {
backgroundColor: "#f3f3f3",
fontFamily: '"Inconsolata", "Menlo", "Consolas", monospace',
fontSize: 16,
padding: 2
}
}, RichTextEditor = function(_Component) {
function RichTextEditor() {
_classCallCheck(this, RichTextEditor);
var _this = _possibleConstructorReturn(this, (RichTextEditor.__proto__ || Object.getPrototypeOf(RichTextEditor)).apply(this, arguments));
return _this._keyEmitter = new _events2.default(), (0, _classAutobind2.default)(_this),
_this;
}
return _inherits(RichTextEditor, _Component), _createClass(RichTextEditor, [ {
key: "componentDidMount",
value: function() {
var autoFocus = this.props.autoFocus;
autoFocus && this._focus();
}
}, {
key: "render",
value: function() {
var _cx, _props = this.props, value = _props.value, className = _props.className, toolbarClassName = _props.toolbarClassName, editorClassName = _props.editorClassName, placeholder = _props.placeholder, customStyleMap = _props.customStyleMap, readOnly = _props.readOnly, disabled = _props.disabled, toolbarConfig = _props.toolbarConfig, blockStyleFn = _props.blockStyleFn, otherProps = _objectWithoutProperties(_props, [ "value", "className", "toolbarClassName", "editorClassName", "placeholder", "customStyleMap", "readOnly", "disabled", "toolbarConfig", "blockStyleFn" ]), editorState = value.getEditorState();
customStyleMap = customStyleMap ? _extends({}, styleMap, customStyleMap) : styleMap;
// If the user changes block type before entering any text, we can either
// style the placeholder or hide it. Let's just hide it for now.
var combinedEditorClassName = (0, _classnames2.default)((_cx = {}, _defineProperty(_cx, _RichTextEditor2.default.editor, !0),
_defineProperty(_cx, _RichTextEditor2.default.hidePlaceholder, this._shouldHidePlaceholder()),
_cx), editorClassName);
null == readOnly && (readOnly = disabled);
var editorToolbar = void 0;
return readOnly || (editorToolbar = _react2.default.createElement(_EditorToolbar2.default, {
className: toolbarClassName,
keyEmitter: this._keyEmitter,
editorState: editorState,
onChange: this._onChange,
focusEditor: this._focus,
toolbarConfig: toolbarConfig
})), _react2.default.createElement("div", {
className: (0, _classnames2.default)(_RichTextEditor2.default.root, className)
}, editorToolbar, _react2.default.createElement("div", {
className: combinedEditorClassName
}, _react2.default.createElement(_draftJs.Editor, _extends({}, otherProps, {
blockStyleFn: (0, _composite2.default)(defaultBlockStyleFn, blockStyleFn),
customStyleMap: customStyleMap,
editorState: editorState,
handleReturn: this._handleReturn,
keyBindingFn: this._customKeyHandler,
handleKeyCommand: this._handleKeyCommand,
onTab: this._onTab,
onChange: this._onChange,
placeholder: placeholder,
ref: "editor",
spellCheck: !0,
readOnly: readOnly
}))));
}
}, {
key: "_shouldHidePlaceholder",
value: function() {
var editorState = this.props.value.getEditorState(), contentState = editorState.getCurrentContent();
return !contentState.hasText() && "unstyled" !== contentState.getBlockMap().first().getType();
}
}, {
key: "_handleReturn",
value: function(event) {
var handleReturn = this.props.handleReturn;
return !(null == handleReturn || !handleReturn(event)) || (!!this._handleReturnSoftNewline(event) || (!!this._handleReturnEmptyListItem() || !!this._handleReturnSpecialBlock()));
}
}, {
key: "_handleReturnSoftNewline",
value: function(event) {
var editorState = this.props.value.getEditorState();
if ((0, _isSoftNewlineEvent2.default)(event)) {
var selection = editorState.getSelection();
if (selection.isCollapsed()) this._onChange(_draftJs.RichUtils.insertSoftNewline(editorState)); else {
var content = editorState.getCurrentContent(), newContent = _draftJs.Modifier.removeRange(content, selection, "forward"), newSelection = newContent.getSelectionAfter(), _block = newContent.getBlockForKey(newSelection.getStartKey());
newContent = _draftJs.Modifier.insertText(newContent, newSelection, "\n", _block.getInlineStyleAt(newSelection.getStartOffset()), null),
this._onChange(_draftJs.EditorState.push(editorState, newContent, "insert-fragment"));
}
return !0;
}
return !1;
}
}, {
key: "_handleReturnEmptyListItem",
value: function() {
var editorState = this.props.value.getEditorState(), selection = editorState.getSelection();
if (selection.isCollapsed()) {
var contentState = editorState.getCurrentContent(), blockKey = selection.getStartKey(), _block2 = contentState.getBlockForKey(blockKey);
if ((0, _isListItem2.default)(_block2) && 0 === _block2.getLength()) {
var depth = _block2.getDepth(), newState = 0 === depth ? (0, _changeBlockType2.default)(editorState, blockKey, _draftJsUtils.BLOCK_TYPE.UNSTYLED) : (0,
_changeBlockDepth2.default)(editorState, blockKey, depth - 1);
return this._onChange(newState), !0;
}
}
return !1;
}
}, {
key: "_handleReturnSpecialBlock",
value: function() {
var editorState = this.props.value.getEditorState(), selection = editorState.getSelection();
if (selection.isCollapsed()) {
var contentState = editorState.getCurrentContent(), blockKey = selection.getStartKey(), _block3 = contentState.getBlockForKey(blockKey);
if (!(0, _isListItem2.default)(_block3) && _block3.getType() !== _draftJsUtils.BLOCK_TYPE.UNSTYLED && _block3.getLength() === selection.getStartOffset()) {
var newEditorState = (0, _insertBlockAfter2.default)(editorState, blockKey, _draftJsUtils.BLOCK_TYPE.UNSTYLED);
return this._onChange(newEditorState), !0;
}
}
return !1;
}
}, {
key: "_onTab",
value: function(event) {
var editorState = this.props.value.getEditorState(), newEditorState = _draftJs.RichUtils.onTab(event, editorState, MAX_LIST_DEPTH);
newEditorState !== editorState && this._onChange(newEditorState);
}
}, {
key: "_customKeyHandler",
value: function(event) {
// Allow toolbar to catch key combinations.
var eventFlags = {};
return this._keyEmitter.emit("keypress", event, eventFlags), eventFlags.wasHandled ? null : (0,
_getDefaultKeyBinding2.default)(event);
}
}, {
key: "_handleKeyCommand",
value: function(command) {
var editorState = this.props.value.getEditorState(), newEditorState = _draftJs.RichUtils.handleKeyCommand(editorState, command);
return !!newEditorState && (this._onChange(newEditorState), !0);
}
}, {
key: "_onChange",
value: function(editorState) {
var _props2 = this.props, onChange = _props2.onChange, value = _props2.value;
if (null != onChange) {
var newValue = value.setEditorState(editorState);
onChange(newValue);
}
}
}, {
key: "_focus",
value: function() {
this.refs.editor.focus();
}
} ]), RichTextEditor;
}(_react.Component);
exports.default = RichTextEditor;
var decorator = new _draftJs.CompositeDecorator([ _LinkDecorator2.default ]);
// $FlowIssue - This should probably not be done this way.
Object.assign(RichTextEditor, {
EditorValue: _EditorValue2.default,
decorator: decorator,
createEmptyValue: createEmptyValue,
createValueFromString: createValueFromString
}), exports.EditorValue = _EditorValue2.default, exports.decorator = decorator,
exports.createEmptyValue = createEmptyValue, exports.createValueFromString = createValueFromString;
}, /* 1 */
/***/
function(module, exports) {
module.exports = __webpack_require__(/*! react */ 2);
}, /* 2 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule Draft
*/
"use strict";
var AtomicBlockUtils = __webpack_require__(3), BlockMapBuilder = __webpack_require__(4), CharacterMetadata = __webpack_require__(6), CompositeDraftDecorator = __webpack_require__(40), ContentBlock = __webpack_require__(7), ContentState = __webpack_require__(32), DefaultDraftBlockRenderMap = __webpack_require__(41), DefaultDraftInlineStyle = __webpack_require__(43), DraftEditor = __webpack_require__(44), DraftEditorBlock = __webpack_require__(50), DraftModifier = __webpack_require__(9), DraftEntity = __webpack_require__(14), DraftEntityInstance = __webpack_require__(16), EditorState = __webpack_require__(29), KeyBindingUtil = __webpack_require__(100), RichTextEditorUtil = __webpack_require__(131), SelectionState = __webpack_require__(33), convertFromDraftStateToRaw = __webpack_require__(133), convertFromHTMLToContentBlocks = __webpack_require__(123), convertFromRawToDraftState = __webpack_require__(137), generateRandomKey = __webpack_require__(21), getDefaultKeyBinding = __webpack_require__(130), getVisibleSelectionRect = __webpack_require__(141), DraftPublic = {
Editor: DraftEditor,
EditorBlock: DraftEditorBlock,
EditorState: EditorState,
CompositeDecorator: CompositeDraftDecorator,
Entity: DraftEntity,
EntityInstance: DraftEntityInstance,
BlockMapBuilder: BlockMapBuilder,
CharacterMetadata: CharacterMetadata,
ContentBlock: ContentBlock,
ContentState: ContentState,
SelectionState: SelectionState,
AtomicBlockUtils: AtomicBlockUtils,
KeyBindingUtil: KeyBindingUtil,
Modifier: DraftModifier,
RichUtils: RichTextEditorUtil,
DefaultDraftBlockRenderMap: DefaultDraftBlockRenderMap,
DefaultDraftInlineStyle: DefaultDraftInlineStyle,
convertFromHTML: convertFromHTMLToContentBlocks,
convertFromRaw: convertFromRawToDraftState,
convertToRaw: convertFromDraftStateToRaw,
genKey: generateRandomKey,
getDefaultKeyBinding: getDefaultKeyBinding,
getVisibleSelectionRect: getVisibleSelectionRect
};
module.exports = DraftPublic;
}, /* 3 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule AtomicBlockUtils
* @typechecks
*
*/
"use strict";
var BlockMapBuilder = __webpack_require__(4), CharacterMetadata = __webpack_require__(6), ContentBlock = __webpack_require__(7), DraftModifier = __webpack_require__(9), EditorState = __webpack_require__(29), Immutable = __webpack_require__(5), generateRandomKey = __webpack_require__(21), List = Immutable.List, Repeat = Immutable.Repeat, AtomicBlockUtils = {
insertAtomicBlock: function(editorState, entityKey, character) {
var contentState = editorState.getCurrentContent(), selectionState = editorState.getSelection(), afterRemoval = DraftModifier.removeRange(contentState, selectionState, "backward"), targetSelection = afterRemoval.getSelectionAfter(), afterSplit = DraftModifier.splitBlock(afterRemoval, targetSelection), insertionTarget = afterSplit.getSelectionAfter(), asAtomicBlock = DraftModifier.setBlockType(afterSplit, insertionTarget, "atomic"), charData = CharacterMetadata.create({
entity: entityKey
}), fragmentArray = [ new ContentBlock({
key: generateRandomKey(),
type: "atomic",
text: character,
characterList: List(Repeat(charData, character.length))
}), new ContentBlock({
key: generateRandomKey(),
type: "unstyled",
text: "",
characterList: List()
}) ], fragment = BlockMapBuilder.createFromArray(fragmentArray), withAtomicBlock = DraftModifier.replaceWithFragment(asAtomicBlock, insertionTarget, fragment), newContent = withAtomicBlock.merge({
selectionBefore: selectionState,
selectionAfter: withAtomicBlock.getSelectionAfter().set("hasFocus", !0)
});
return EditorState.push(editorState, newContent, "insert-fragment");
}
};
module.exports = AtomicBlockUtils;
}, /* 4 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule BlockMapBuilder
*
*/
"use strict";
var Immutable = __webpack_require__(5), OrderedMap = Immutable.OrderedMap, BlockMapBuilder = {
createFromArray: function(blocks) {
return OrderedMap(blocks.map(function(block) {
return [ block.getKey(), block ];
}));
}
};
module.exports = BlockMapBuilder;
}, /* 5 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 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.
*/
!function(global, factory) {
module.exports = factory();
}(this, function() {
"use strict";
function createClass(ctor, superClass) {
superClass && (ctor.prototype = Object.create(superClass.prototype)), ctor.prototype.constructor = ctor;
}
function Iterable(value) {
return isIterable(value) ? value : Seq(value);
}
function KeyedIterable(value) {
return isKeyed(value) ? value : KeyedSeq(value);
}
function IndexedIterable(value) {
return isIndexed(value) ? value : IndexedSeq(value);
}
function SetIterable(value) {
return isIterable(value) && !isAssociative(value) ? value : SetSeq(value);
}
function isIterable(maybeIterable) {
return !(!maybeIterable || !maybeIterable[IS_ITERABLE_SENTINEL]);
}
function isKeyed(maybeKeyed) {
return !(!maybeKeyed || !maybeKeyed[IS_KEYED_SENTINEL]);
}
function isIndexed(maybeIndexed) {
return !(!maybeIndexed || !maybeIndexed[IS_INDEXED_SENTINEL]);
}
function isAssociative(maybeAssociative) {
return isKeyed(maybeAssociative) || isIndexed(maybeAssociative);
}
function isOrdered(maybeOrdered) {
return !(!maybeOrdered || !maybeOrdered[IS_ORDERED_SENTINEL]);
}
function MakeRef(ref) {
return ref.value = !1, ref;
}
function SetRef(ref) {
ref && (ref.value = !0);
}
// A function which returns a value representing an "owner" for transient writes
// to tries. The return value will only ever equal itself, and will not equal
// the return of any subsequent call of this function.
function OwnerID() {}
// http://jsperf.com/copy-array-inline
function arrCopy(arr, offset) {
offset = offset || 0;
for (var len = Math.max(0, arr.length - offset), newArr = new Array(len), ii = 0; ii < len; ii++) newArr[ii] = arr[ii + offset];
return newArr;
}
function ensureSize(iter) {
return void 0 === iter.size && (iter.size = iter.__iterate(returnTrue)), iter.size;
}
function wrapIndex(iter, index) {
// This implements "is array index" which the ECMAString spec defines as:
//
// A String property name P is an array index if and only if
// ToString(ToUint32(P)) is equal to P and ToUint32(P) is not equal
// to 2^32−1.
//
// http://www.ecma-international.org/ecma-262/6.0/#sec-array-exotic-objects
if ("number" != typeof index) {
var uint32Index = index >>> 0;
// N >>> 0 is shorthand for ToUint32
if ("" + uint32Index !== index || 4294967295 === uint32Index) return NaN;
index = uint32Index;
}
return index < 0 ? ensureSize(iter) + index : index;
}
function returnTrue() {
return !0;
}
function wholeSlice(begin, end, size) {
return (0 === begin || void 0 !== size && begin <= -size) && (void 0 === end || void 0 !== size && end >= size);
}
function resolveBegin(begin, size) {
return resolveIndex(begin, size, 0);
}
function resolveEnd(end, size) {
return resolveIndex(end, size, size);
}
function resolveIndex(index, size, defaultIndex) {
return void 0 === index ? defaultIndex : index < 0 ? Math.max(0, size + index) : void 0 === size ? index : Math.min(size, index);
}
function Iterator(next) {
this.next = next;
}
function iteratorValue(type, k, v, iteratorResult) {
var value = 0 === type ? k : 1 === type ? v : [ k, v ];
return iteratorResult ? iteratorResult.value = value : iteratorResult = {
value: value,
done: !1
}, iteratorResult;
}
function iteratorDone() {
return {
value: void 0,
done: !0
};
}
function hasIterator(maybeIterable) {
return !!getIteratorFn(maybeIterable);
}
function isIterator(maybeIterator) {
return maybeIterator && "function" == typeof maybeIterator.next;
}
function getIterator(iterable) {
var iteratorFn = getIteratorFn(iterable);
return iteratorFn && iteratorFn.call(iterable);
}
function getIteratorFn(iterable) {
var iteratorFn = iterable && (REAL_ITERATOR_SYMBOL && iterable[REAL_ITERATOR_SYMBOL] || iterable[FAUX_ITERATOR_SYMBOL]);
if ("function" == typeof iteratorFn) return iteratorFn;
}
function isArrayLike(value) {
return value && "number" == typeof value.length;
}
function Seq(value) {
return null === value || void 0 === value ? emptySequence() : isIterable(value) ? value.toSeq() : seqFromValue(value);
}
function KeyedSeq(value) {
return null === value || void 0 === value ? emptySequence().toKeyedSeq() : isIterable(value) ? isKeyed(value) ? value.toSeq() : value.fromEntrySeq() : keyedSeqFromValue(value);
}
function IndexedSeq(value) {
return null === value || void 0 === value ? emptySequence() : isIterable(value) ? isKeyed(value) ? value.entrySeq() : value.toIndexedSeq() : indexedSeqFromValue(value);
}
function SetSeq(value) {
return (null === value || void 0 === value ? emptySequence() : isIterable(value) ? isKeyed(value) ? value.entrySeq() : value : indexedSeqFromValue(value)).toSetSeq();
}
function ArraySeq(array) {
this._array = array, this.size = array.length;
}
function ObjectSeq(object) {
var keys = Object.keys(object);
this._object = object, this._keys = keys, this.size = keys.length;
}
function IterableSeq(iterable) {
this._iterable = iterable, this.size = iterable.length || iterable.size;
}
function IteratorSeq(iterator) {
this._iterator = iterator, this._iteratorCache = [];
}
// # pragma Helper functions
function isSeq(maybeSeq) {
return !(!maybeSeq || !maybeSeq[IS_SEQ_SENTINEL]);
}
function emptySequence() {
return EMPTY_SEQ || (EMPTY_SEQ = new ArraySeq([]));
}
function keyedSeqFromValue(value) {
var seq = Array.isArray(value) ? new ArraySeq(value).fromEntrySeq() : isIterator(value) ? new IteratorSeq(value).fromEntrySeq() : hasIterator(value) ? new IterableSeq(value).fromEntrySeq() : "object" == typeof value ? new ObjectSeq(value) : void 0;
if (!seq) throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: " + value);
return seq;
}
function indexedSeqFromValue(value) {
var seq = maybeIndexedSeqFromValue(value);
if (!seq) throw new TypeError("Expected Array or iterable object of values: " + value);
return seq;
}
function seqFromValue(value) {
var seq = maybeIndexedSeqFromValue(value) || "object" == typeof value && new ObjectSeq(value);
if (!seq) throw new TypeError("Expected Array or iterable object of values, or keyed object: " + value);
return seq;
}
function maybeIndexedSeqFromValue(value) {
return isArrayLike(value) ? new ArraySeq(value) : isIterator(value) ? new IteratorSeq(value) : hasIterator(value) ? new IterableSeq(value) : void 0;
}
function seqIterate(seq, fn, reverse, useKeys) {
var cache = seq._cache;
if (cache) {
for (var maxIndex = cache.length - 1, ii = 0; ii <= maxIndex; ii++) {
var entry = cache[reverse ? maxIndex - ii : ii];
if (fn(entry[1], useKeys ? entry[0] : ii, seq) === !1) return ii + 1;
}
return ii;
}
return seq.__iterateUncached(fn, reverse);
}
function seqIterator(seq, type, reverse, useKeys) {
var cache = seq._cache;
if (cache) {
var maxIndex = cache.length - 1, ii = 0;
return new Iterator(function() {
var entry = cache[reverse ? maxIndex - ii : ii];
return ii++ > maxIndex ? iteratorDone() : iteratorValue(type, useKeys ? entry[0] : ii - 1, entry[1]);
});
}
return seq.__iteratorUncached(type, reverse);
}
function fromJS(json, converter) {
return converter ? fromJSWith(converter, json, "", {
"": json
}) : fromJSDefault(json);
}
function fromJSWith(converter, json, key, parentJSON) {
return Array.isArray(json) ? converter.call(parentJSON, key, IndexedSeq(json).map(function(v, k) {
return fromJSWith(converter, v, k, json);
})) : isPlainObj(json) ? converter.call(parentJSON, key, KeyedSeq(json).map(function(v, k) {
return fromJSWith(converter, v, k, json);
})) : json;
}
function fromJSDefault(json) {
return Array.isArray(json) ? IndexedSeq(json).map(fromJSDefault).toList() : isPlainObj(json) ? KeyedSeq(json).map(fromJSDefault).toMap() : json;
}
function isPlainObj(value) {
return value && (value.constructor === Object || void 0 === value.constructor);
}
/**
* An extension of the "same-value" algorithm as [described for use by ES6 Map
* and Set](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map#Key_equality)
*
* NaN is considered the same as NaN, however -0 and 0 are considered the same
* value, which is different from the algorithm described by
* [`Object.is`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is).
*
* This is extended further to allow Objects to describe the values they
* represent, by way of `valueOf` or `equals` (and `hashCode`).
*
* Note: because of this extension, the key equality of Immutable.Map and the
* value equality of Immutable.Set will differ from ES6 Map and Set.
*
* ### Defining custom values
*
* The easiest way to describe the value an object represents is by implementing
* `valueOf`. For example, `Date` represents a value by returning a unix
* timestamp for `valueOf`:
*
* var date1 = new Date(1234567890000); // Fri Feb 13 2009 ...
* var date2 = new Date(1234567890000);
* date1.valueOf(); // 1234567890000
* assert( date1 !== date2 );
* assert( Immutable.is( date1, date2 ) );
*
* Note: overriding `valueOf` may have other implications if you use this object
* where JavaScript expects a primitive, such as implicit string coercion.
*
* For more complex types, especially collections, implementing `valueOf` may
* not be performant. An alternative is to implement `equals` and `hashCode`.
*
* `equals` takes another object, presumably of similar type, and returns true
* if the it is equal. Equality is symmetrical, so the same result should be
* returned if this and the argument are flipped.
*
* assert( a.equals(b) === b.equals(a) );
*
* `hashCode` returns a 32bit integer number representing the object which will
* be used to determine how to store the value object in a Map or Set. You must
* provide both or neither methods, one must not exist without the other.
*
* Also, an important relationship between these methods must be upheld: if two
* values are equal, they *must* return the same hashCode. If the values are not
* equal, they might have the same hashCode; this is called a hash collision,
* and while undesirable for performance reasons, it is acceptable.
*
* if (a.equals(b)) {
* assert( a.hashCode() === b.hashCode() );
* }
*
* All Immutable collections implement `equals` and `hashCode`.
*
*/
function is(valueA, valueB) {
if (valueA === valueB || valueA !== valueA && valueB !== valueB) return !0;
if (!valueA || !valueB) return !1;
if ("function" == typeof valueA.valueOf && "function" == typeof valueB.valueOf) {
if (valueA = valueA.valueOf(), valueB = valueB.valueOf(), valueA === valueB || valueA !== valueA && valueB !== valueB) return !0;
if (!valueA || !valueB) return !1;
}
return !("function" != typeof valueA.equals || "function" != typeof valueB.equals || !valueA.equals(valueB));
}
function deepEqual(a, b) {
if (a === b) return !0;
if (!isIterable(b) || void 0 !== a.size && void 0 !== b.size && a.size !== b.size || void 0 !== a.__hash && void 0 !== b.__hash && a.__hash !== b.__hash || isKeyed(a) !== isKeyed(b) || isIndexed(a) !== isIndexed(b) || isOrdered(a) !== isOrdered(b)) return !1;
if (0 === a.size && 0 === b.size) return !0;
var notAssociative = !isAssociative(a);
if (isOrdered(a)) {
var entries = a.entries();
return b.every(function(v, k) {
var entry = entries.next().value;
return entry && is(entry[1], v) && (notAssociative || is(entry[0], k));
}) && entries.next().done;
}
var flipped = !1;
if (void 0 === a.size) if (void 0 === b.size) "function" == typeof a.cacheResult && a.cacheResult(); else {
flipped = !0;
var _ = a;
a = b, b = _;
}
var allEqual = !0, bSize = b.__iterate(function(v, k) {
if (notAssociative ? !a.has(v) : flipped ? !is(v, a.get(k, NOT_SET)) : !is(a.get(k, NOT_SET), v)) return allEqual = !1,
!1;
});
return allEqual && a.size === bSize;
}
function Repeat(value, times) {
if (!(this instanceof Repeat)) return new Repeat(value, times);
if (this._value = value, this.size = void 0 === times ? 1 / 0 : Math.max(0, times),
0 === this.size) {
if (EMPTY_REPEAT) return EMPTY_REPEAT;
EMPTY_REPEAT = this;
}
}
function invariant(condition, error) {
if (!condition) throw new Error(error);
}
function Range(start, end, step) {
if (!(this instanceof Range)) return new Range(start, end, step);
if (invariant(0 !== step, "Cannot step a Range by 0"), start = start || 0, void 0 === end && (end = 1 / 0),
step = void 0 === step ? 1 : Math.abs(step), end < start && (step = -step), this._start = start,
this._end = end, this._step = step, this.size = Math.max(0, Math.ceil((end - start) / step - 1) + 1),
0 === this.size) {
if (EMPTY_RANGE) return EMPTY_RANGE;
EMPTY_RANGE = this;
}
}
function Collection() {
throw TypeError("Abstract");
}
function KeyedCollection() {}
function IndexedCollection() {}
function SetCollection() {}
// v8 has an optimization for storing 31-bit signed numbers.
// Values which have either 00 or 11 as the high order bits qualify.
// This function drops the highest order bit in a signed number, maintaining
// the sign bit.
function smi(i32) {
return i32 >>> 1 & 1073741824 | 3221225471 & i32;
}
function hash(o) {
if (o === !1 || null === o || void 0 === o) return 0;
if ("function" == typeof o.valueOf && (o = o.valueOf(), o === !1 || null === o || void 0 === o)) return 0;
if (o === !0) return 1;
var type = typeof o;
if ("number" === type) {
var h = 0 | o;
for (h !== o && (h ^= 4294967295 * o); o > 4294967295; ) o /= 4294967295, h ^= o;
return smi(h);
}
if ("string" === type) return o.length > STRING_HASH_CACHE_MIN_STRLEN ? cachedHashString(o) : hashString(o);
if ("function" == typeof o.hashCode) return o.hashCode();
if ("object" === type) return hashJSObj(o);
if ("function" == typeof o.toString) return hashString(o.toString());
throw new Error("Value type " + type + " cannot be hashed.");
}
function cachedHashString(string) {
var hash = stringHashCache[string];
return void 0 === hash && (hash = hashString(string), STRING_HASH_CACHE_SIZE === STRING_HASH_CACHE_MAX_SIZE && (STRING_HASH_CACHE_SIZE = 0,
stringHashCache = {}), STRING_HASH_CACHE_SIZE++, stringHashCache[string] = hash),
hash;
}
// http://jsperf.com/hashing-strings
function hashString(string) {
for (var hash = 0, ii = 0; ii < string.length; ii++) hash = 31 * hash + string.charCodeAt(ii) | 0;
return smi(hash);
}
function hashJSObj(obj) {
var hash;
if (usingWeakMap && (hash = weakMap.get(obj), void 0 !== hash)) return hash;
if (hash = obj[UID_HASH_KEY], void 0 !== hash) return hash;
if (!canDefineProperty) {
if (hash = obj.propertyIsEnumerable && obj.propertyIsEnumerable[UID_HASH_KEY], void 0 !== hash) return hash;
if (hash = getIENodeHash(obj), void 0 !== hash) return hash;
}
if (hash = ++objHashUID, 1073741824 & objHashUID && (objHashUID = 0), usingWeakMap) weakMap.set(obj, hash); else {
if (void 0 !== isExtensible && isExtensible(obj) === !1) throw new Error("Non-extensible objects are not allowed as keys.");
if (canDefineProperty) Object.defineProperty(obj, UID_HASH_KEY, {
enumerable: !1,
configurable: !1,
writable: !1,
value: hash
}); else if (void 0 !== obj.propertyIsEnumerable && obj.propertyIsEnumerable === obj.constructor.prototype.propertyIsEnumerable) // Since we can't define a non-enumerable property on the object
// we'll hijack one of the less-used non-enumerable properties to
// save our hash on it. Since this is a function it will not show up in
// `JSON.stringify` which is what we want.
obj.propertyIsEnumerable = function() {
return this.constructor.prototype.propertyIsEnumerable.apply(this, arguments);
}, obj.propertyIsEnumerable[UID_HASH_KEY] = hash; else {
if (void 0 === obj.nodeType) throw new Error("Unable to set a non-enumerable property on object.");
// At this point we couldn't get the IE `uniqueID` to use as a hash
// and we couldn't use a non-enumerable property to exploit the
// dontEnum bug so we simply add the `UID_HASH_KEY` on the node
// itself.
obj[UID_HASH_KEY] = hash;
}
}
return hash;
}
// IE has a `uniqueID` property on DOM nodes. We can construct the hash from it
// and avoid memory leaks from the IE cloneNode bug.
function getIENodeHash(node) {
if (node && node.nodeType > 0) switch (node.nodeType) {
case 1:
// Element
return node.uniqueID;
case 9:
// Document
return node.documentElement && node.documentElement.uniqueID;
}
}
function assertNotInfinite(size) {
invariant(size !== 1 / 0, "Cannot perform this action with an infinite size.");
}
// @pragma Construction
function Map(value) {
return null === value || void 0 === value ? emptyMap() : isMap(value) && !isOrdered(value) ? value : emptyMap().withMutations(function(map) {
var iter = KeyedIterable(value);
assertNotInfinite(iter.size), iter.forEach(function(v, k) {
return map.set(k, v);
});
});
}
function isMap(maybeMap) {
return !(!maybeMap || !maybeMap[IS_MAP_SENTINEL]);
}
// #pragma Trie Nodes
function ArrayMapNode(ownerID, entries) {
this.ownerID = ownerID, this.entries = entries;
}
function BitmapIndexedNode(ownerID, bitmap, nodes) {
this.ownerID = ownerID, this.bitmap = bitmap, this.nodes = nodes;
}
function HashArrayMapNode(ownerID, count, nodes) {
this.ownerID = ownerID, this.count = count, this.nodes = nodes;
}
function HashCollisionNode(ownerID, keyHash, entries) {
this.ownerID = ownerID, this.keyHash = keyHash, this.entries = entries;
}
function ValueNode(ownerID, keyHash, entry) {
this.ownerID = ownerID, this.keyHash = keyHash, this.entry = entry;
}
function MapIterator(map, type, reverse) {
this._type = type, this._reverse = reverse, this._stack = map._root && mapIteratorFrame(map._root);
}
function mapIteratorValue(type, entry) {
return iteratorValue(type, entry[0], entry[1]);
}
function mapIteratorFrame(node, prev) {
return {
node: node,
index: 0,
__prev: prev
};
}
function makeMap(size, root, ownerID, hash) {
var map = Object.create(MapPrototype);
return map.size = size, map._root = root, map.__ownerID = ownerID, map.__hash = hash,
map.__altered = !1, map;
}
function emptyMap() {
return EMPTY_MAP || (EMPTY_MAP = makeMap(0));
}
function updateMap(map, k, v) {
var newRoot, newSize;
if (map._root) {
var didChangeSize = MakeRef(CHANGE_LENGTH), didAlter = MakeRef(DID_ALTER);
if (newRoot = updateNode(map._root, map.__ownerID, 0, void 0, k, v, didChangeSize, didAlter),
!didAlter.value) return map;
newSize = map.size + (didChangeSize.value ? v === NOT_SET ? -1 : 1 : 0);
} else {
if (v === NOT_SET) return map;
newSize = 1, newRoot = new ArrayMapNode(map.__ownerID, [ [ k, v ] ]);
}
return map.__ownerID ? (map.size = newSize, map._root = newRoot, map.__hash = void 0,
map.__altered = !0, map) : newRoot ? makeMap(newSize, newRoot) : emptyMap();
}
function updateNode(node, ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {
return node ? node.update(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) : value === NOT_SET ? node : (SetRef(didAlter),
SetRef(didChangeSize), new ValueNode(ownerID, keyHash, [ key, value ]));
}
function isLeafNode(node) {
return node.constructor === ValueNode || node.constructor === HashCollisionNode;
}
function mergeIntoNode(node, ownerID, shift, keyHash, entry) {
if (node.keyHash === keyHash) return new HashCollisionNode(ownerID, keyHash, [ node.entry, entry ]);
var newNode, idx1 = (0 === shift ? node.keyHash : node.keyHash >>> shift) & MASK, idx2 = (0 === shift ? keyHash : keyHash >>> shift) & MASK, nodes = idx1 === idx2 ? [ mergeIntoNode(node, ownerID, shift + SHIFT, keyHash, entry) ] : (newNode = new ValueNode(ownerID, keyHash, entry),
idx1 < idx2 ? [ node, newNode ] : [ newNode, node ]);
return new BitmapIndexedNode(ownerID, 1 << idx1 | 1 << idx2, nodes);
}
function createNodes(ownerID, entries, key, value) {
ownerID || (ownerID = new OwnerID());
for (var node = new ValueNode(ownerID, hash(key), [ key, value ]), ii = 0; ii < entries.length; ii++) {
var entry = entries[ii];
node = node.update(ownerID, 0, void 0, entry[0], entry[1]);
}
return node;
}
function packNodes(ownerID, nodes, count, excluding) {
for (var bitmap = 0, packedII = 0, packedNodes = new Array(count), ii = 0, bit = 1, len = nodes.length; ii < len; ii++,
bit <<= 1) {
var node = nodes[ii];
void 0 !== node && ii !== excluding && (bitmap |= bit, packedNodes[packedII++] = node);
}
return new BitmapIndexedNode(ownerID, bitmap, packedNodes);
}
function expandNodes(ownerID, nodes, bitmap, including, node) {
for (var count = 0, expandedNodes = new Array(SIZE), ii = 0; 0 !== bitmap; ii++,
bitmap >>>= 1) expandedNodes[ii] = 1 & bitmap ? nodes[count++] : void 0;
return expandedNodes[including] = node, new HashArrayMapNode(ownerID, count + 1, expandedNodes);
}
function mergeIntoMapWith(map, merger, iterables) {
for (var iters = [], ii = 0; ii < iterables.length; ii++) {
var value = iterables[ii], iter = KeyedIterable(value);
isIterable(value) || (iter = iter.map(function(v) {
return fromJS(v);
})), iters.push(iter);
}
return mergeIntoCollectionWith(map, merger, iters);
}
function deepMerger(existing, value, key) {
return existing && existing.mergeDeep && isIterable(value) ? existing.mergeDeep(value) : is(existing, value) ? existing : value;
}
function deepMergerWith(merger) {
return function(existing, value, key) {
if (existing && existing.mergeDeepWith && isIterable(value)) return existing.mergeDeepWith(merger, value);
var nextValue = merger(existing, value, key);
return is(existing, nextValue) ? existing : nextValue;
};
}
function mergeIntoCollectionWith(collection, merger, iters) {
return iters = iters.filter(function(x) {
return 0 !== x.size;
}), 0 === iters.length ? collection : 0 !== collection.size || collection.__ownerID || 1 !== iters.length ? collection.withMutations(function(collection) {
for (var mergeIntoMap = merger ? function(value, key) {
collection.update(key, NOT_SET, function(existing) {
return existing === NOT_SET ? value : merger(existing, value, key);
});
} : function(value, key) {
collection.set(key, value);
}, ii = 0; ii < iters.length; ii++) iters[ii].forEach(mergeIntoMap);
}) : collection.constructor(iters[0]);
}
function updateInDeepMap(existing, keyPathIter, notSetValue, updater) {
var isNotSet = existing === NOT_SET, step = keyPathIter.next();
if (step.done) {
var existingValue = isNotSet ? notSetValue : existing, newValue = updater(existingValue);
return newValue === existingValue ? existing : newValue;
}
invariant(isNotSet || existing && existing.set, "invalid keyPath");
var key = step.value, nextExisting = isNotSet ? NOT_SET : existing.get(key, NOT_SET), nextUpdated = updateInDeepMap(nextExisting, keyPathIter, notSetValue, updater);
return nextUpdated === nextExisting ? existing : nextUpdated === NOT_SET ? existing.remove(key) : (isNotSet ? emptyMap() : existing).set(key, nextUpdated);
}
function popCount(x) {
return x -= x >> 1 & 1431655765, x = (858993459 & x) + (x >> 2 & 858993459), x = x + (x >> 4) & 252645135,
x += x >> 8, x += x >> 16, 127 & x;
}
function setIn(array, idx, val, canEdit) {
var newArray = canEdit ? array : arrCopy(array);
return newArray[idx] = val, newArray;
}
function spliceIn(array, idx, val, canEdit) {
var newLen = array.length + 1;
if (canEdit && idx + 1 === newLen) return array[idx] = val, array;
for (var newArray = new Array(newLen), after = 0, ii = 0; ii < newLen; ii++) ii === idx ? (newArray[ii] = val,
after = -1) : newArray[ii] = array[ii + after];
return newArray;
}
function spliceOut(array, idx, canEdit) {
var newLen = array.length - 1;
if (canEdit && idx === newLen) return array.pop(), array;
for (var newArray = new Array(newLen), after = 0, ii = 0; ii < newLen; ii++) ii === idx && (after = 1),
newArray[ii] = array[ii + after];
return newArray;
}
// @pragma Construction
function List(value) {
var empty = emptyList();
if (null === value || void 0 === value) return empty;
if (isList(value)) return value;
var iter = IndexedIterable(value), size = iter.size;
return 0 === size ? empty : (assertNotInfinite(size), size > 0 && size < SIZE ? makeList(0, size, SHIFT, null, new VNode(iter.toArray())) : empty.withMutations(function(list) {
list.setSize(size), iter.forEach(function(v, i) {
return list.set(i, v);
});
}));
}
function isList(maybeList) {
return !(!maybeList || !maybeList[IS_LIST_SENTINEL]);
}
function VNode(array, ownerID) {
this.array = array, this.ownerID = ownerID;
}
function iterateList(list, reverse) {
function iterateNodeOrLeaf(node, level, offset) {
return 0 === level ? iterateLeaf(node, offset) : iterateNode(node, level, offset);
}
function iterateLeaf(node, offset) {
var array = offset === tailPos ? tail && tail.array : node && node.array, from = offset > left ? 0 : left - offset, to = right - offset;
return to > SIZE && (to = SIZE), function() {
if (from === to) return DONE;
var idx = reverse ? --to : from++;
return array && array[idx];
};
}
function iterateNode(node, level, offset) {
var values, array = node && node.array, from = offset > left ? 0 : left - offset >> level, to = (right - offset >> level) + 1;
return to > SIZE && (to = SIZE), function() {
for (;;) {
if (values) {
var value = values();
if (value !== DONE) return value;
values = null;
}
if (from === to) return DONE;
var idx = reverse ? --to : from++;
values = iterateNodeOrLeaf(array && array[idx], level - SHIFT, offset + (idx << level));
}
};
}
var left = list._origin, right = list._capacity, tailPos = getTailOffset(right), tail = list._tail;
return iterateNodeOrLeaf(list._root, list._level, 0);
}
function makeList(origin, capacity, level, root, tail, ownerID, hash) {
var list = Object.create(ListPrototype);
return list.size = capacity - origin, list._origin = origin, list._capacity = capacity,
list._level = level, list._root = root, list._tail = tail, list.__ownerID = ownerID,
list.__hash = hash, list.__altered = !1, list;
}
function emptyList() {
return EMPTY_LIST || (EMPTY_LIST = makeList(0, 0, SHIFT));
}
function updateList(list, index, value) {
if (index = wrapIndex(list, index), index !== index) return list;
if (index >= list.size || index < 0) return list.withMutations(function(list) {
index < 0 ? setListBounds(list, index).set(0, value) : setListBounds(list, 0, index + 1).set(index, value);
});
index += list._origin;
var newTail = list._tail, newRoot = list._root, didAlter = MakeRef(DID_ALTER);
return index >= getTailOffset(list._capacity) ? newTail = updateVNode(newTail, list.__ownerID, 0, index, value, didAlter) : newRoot = updateVNode(newRoot, list.__ownerID, list._level, index, value, didAlter),
didAlter.value ? list.__ownerID ? (list._root = newRoot, list._tail = newTail, list.__hash = void 0,
list.__altered = !0, list) : makeList(list._origin, list._capacity, list._level, newRoot, newTail) : list;
}
function updateVNode(node, ownerID, level, index, value, didAlter) {
var idx = index >>> level & MASK, nodeHas = node && idx < node.array.length;
if (!nodeHas && void 0 === value) return node;
var newNode;
if (level > 0) {
var lowerNode = node && node.array[idx], newLowerNode = updateVNode(lowerNode, ownerID, level - SHIFT, index, value, didAlter);
return newLowerNode === lowerNode ? node : (newNode = editableVNode(node, ownerID),
newNode.array[idx] = newLowerNode, newNode);
}
return nodeHas && node.array[idx] === value ? node : (SetRef(didAlter), newNode = editableVNode(node, ownerID),
void 0 === value && idx === newNode.array.length - 1 ? newNode.array.pop() : newNode.array[idx] = value,
newNode);
}
function editableVNode(node, ownerID) {
return ownerID && node && ownerID === node.ownerID ? node : new VNode(node ? node.array.slice() : [], ownerID);
}
function listNodeFor(list, rawIndex) {
if (rawIndex >= getTailOffset(list._capacity)) return list._tail;
if (rawIndex < 1 << list._level + SHIFT) {
for (var node = list._root, level = list._level; node && level > 0; ) node = node.array[rawIndex >>> level & MASK],
level -= SHIFT;
return node;
}
}
function setListBounds(list, begin, end) {
// Sanitize begin & end using this shorthand for ToInt32(argument)
// http://www.ecma-international.org/ecma-262/6.0/#sec-toint32
void 0 !== begin && (begin |= 0), void 0 !== end && (end |= 0);
var owner = list.__ownerID || new OwnerID(), oldOrigin = list._origin, oldCapacity = list._capacity, newOrigin = oldOrigin + begin, newCapacity = void 0 === end ? oldCapacity : end < 0 ? oldCapacity + end : oldOrigin + end;
if (newOrigin === oldOrigin && newCapacity === oldCapacity) return list;
// If it's going to end after it starts, it's empty.
if (newOrigin >= newCapacity) return list.clear();
for (var newLevel = list._level, newRoot = list._root, offsetShift = 0; newOrigin + offsetShift < 0; ) newRoot = new VNode(newRoot && newRoot.array.length ? [ void 0, newRoot ] : [], owner),
newLevel += SHIFT, offsetShift += 1 << newLevel;
offsetShift && (newOrigin += offsetShift, oldOrigin += offsetShift, newCapacity += offsetShift,
oldCapacity += offsetShift);
// New size might need creating a higher root.
for (var oldTailOffset = getTailOffset(oldCapacity), newTailOffset = getTailOffset(newCapacity); newTailOffset >= 1 << newLevel + SHIFT; ) newRoot = new VNode(newRoot && newRoot.array.length ? [ newRoot ] : [], owner),
newLevel += SHIFT;
// Locate or create the new tail.
var oldTail = list._tail, newTail = newTailOffset < oldTailOffset ? listNodeFor(list, newCapacity - 1) : newTailOffset > oldTailOffset ? new VNode([], owner) : oldTail;
// Merge Tail into tree.
if (oldTail && newTailOffset > oldTailOffset && newOrigin < oldCapacity && oldTail.array.length) {
newRoot = editableVNode(newRoot, owner);
for (var node = newRoot, level = newLevel; level > SHIFT; level -= SHIFT) {
var idx = oldTailOffset >>> level & MASK;
node = node.array[idx] = editableVNode(node.array[idx], owner);
}
node.array[oldTailOffset >>> SHIFT & MASK] = oldTail;
}
// If the new origin is within the tail, then we do not need a root.
if (// If the size has been reduced, there's a chance the tail needs to be trimmed.
newCapacity < oldCapacity && (newTail = newTail && newTail.removeAfter(owner, 0, newCapacity)),
newOrigin >= newTailOffset) newOrigin -= newTailOffset, newCapacity -= newTailOffset,
newLevel = SHIFT, newRoot = null, newTail = newTail && newTail.removeBefore(owner, 0, newOrigin); else if (newOrigin > oldOrigin || newTailOffset < oldTailOffset) {
// Identify the new top root node of the subtree of the old root.
for (offsetShift = 0; newRoot; ) {
var beginIndex = newOrigin >>> newLevel & MASK;
if (beginIndex !== newTailOffset >>> newLevel & MASK) break;
beginIndex && (offsetShift += (1 << newLevel) * beginIndex), newLevel -= SHIFT,
newRoot = newRoot.array[beginIndex];
}
// Trim the new sides of the new root.
newRoot && newOrigin > oldOrigin && (newRoot = newRoot.removeBefore(owner, newLevel, newOrigin - offsetShift)),
newRoot && newTailOffset < oldTailOffset && (newRoot = newRoot.removeAfter(owner, newLevel, newTailOffset - offsetShift)),
offsetShift && (newOrigin -= offsetShift, newCapacity -= offsetShift);
}
return list.__ownerID ? (list.size = newCapacity - newOrigin, list._origin = newOrigin,
list._capacity = newCapacity, list._level = newLevel, list._root = newRoot, list._tail = newTail,
list.__hash = void 0, list.__altered = !0, list) : makeList(newOrigin, newCapacity, newLevel, newRoot, newTail);
}
function mergeIntoListWith(list, merger, iterables) {
for (var iters = [], maxSize = 0, ii = 0; ii < iterables.length; ii++) {
var value = iterables[ii], iter = IndexedIterable(value);
iter.size > maxSize && (maxSize = iter.size), isIterable(value) || (iter = iter.map(function(v) {
return fromJS(v);
})), iters.push(iter);
}
return maxSize > list.size && (list = list.setSize(maxSize)), mergeIntoCollectionWith(list, merger, iters);
}
function getTailOffset(size) {
return size < SIZE ? 0 : size - 1 >>> SHIFT << SHIFT;
}
// @pragma Construction
function OrderedMap(value) {
return null === value || void 0 === value ? emptyOrderedMap() : isOrderedMap(value) ? value : emptyOrderedMap().withMutations(function(map) {
var iter = KeyedIterable(value);
assertNotInfinite(iter.size), iter.forEach(function(v, k) {
return map.set(k, v);
});
});
}
function isOrderedMap(maybeOrderedMap) {
return isMap(maybeOrderedMap) && isOrdered(maybeOrderedMap);
}
function makeOrderedMap(map, list, ownerID, hash) {
var omap = Object.create(OrderedMap.prototype);
return omap.size = map ? map.size : 0, omap._map = map, omap._list = list, omap.__ownerID = ownerID,
omap.__hash = hash, omap;
}
function emptyOrderedMap() {
return EMPTY_ORDERED_MAP || (EMPTY_ORDERED_MAP = makeOrderedMap(emptyMap(), emptyList()));
}
function updateOrderedMap(omap, k, v) {
var newMap, newList, map = omap._map, list = omap._list, i = map.get(k), has = void 0 !== i;
if (v === NOT_SET) {
// removed
if (!has) return omap;
list.size >= SIZE && list.size >= 2 * map.size ? (newList = list.filter(function(entry, idx) {
return void 0 !== entry && i !== idx;
}), newMap = newList.toKeyedSeq().map(function(entry) {
return entry[0];
}).flip().toMap(), omap.__ownerID && (newMap.__ownerID = newList.__ownerID = omap.__ownerID)) : (newMap = map.remove(k),
newList = i === list.size - 1 ? list.pop() : list.set(i, void 0));
} else if (has) {
if (v === list.get(i)[1]) return omap;
newMap = map, newList = list.set(i, [ k, v ]);
} else newMap = map.set(k, list.size), newList = list.set(list.size, [ k, v ]);
return omap.__ownerID ? (omap.size = newMap.size, omap._map = newMap, omap._list = newList,
omap.__hash = void 0, omap) : makeOrderedMap(newMap, newList);
}
function ToKeyedSequence(indexed, useKeys) {
this._iter = indexed, this._useKeys = useKeys, this.size = indexed.size;
}
function ToIndexedSequence(iter) {
this._iter = iter, this.size = iter.size;
}
function ToSetSequence(iter) {
this._iter = iter, this.size = iter.size;
}
function FromEntriesSequence(entries) {
this._iter = entries, this.size = entries.size;
}
function flipFactory(iterable) {
var flipSequence = makeSequence(iterable);
return flipSequence._iter = iterable, flipSequence.size = iterable.size, flipSequence.flip = function() {
return iterable;
}, flipSequence.reverse = function() {
var reversedSequence = iterable.reverse.apply(this);
// super.reverse()
return reversedSequence.flip = function() {
return iterable.reverse();
}, reversedSequence;
}, flipSequence.has = function(key) {
return iterable.includes(key);
}, flipSequence.includes = function(key) {
return iterable.has(key);
}, flipSequence.cacheResult = cacheResultThrough, flipSequence.__iterateUncached = function(fn, reverse) {
var this$0 = this;
return iterable.__iterate(function(v, k) {
return fn(k, v, this$0) !== !1;
}, reverse);
}, flipSequence.__iteratorUncached = function(type, reverse) {
if (type === ITERATE_ENTRIES) {
var iterator = iterable.__iterator(type, reverse);
return new Iterator(function() {
var step = iterator.next();
if (!step.done) {
var k = step.value[0];
step.value[0] = step.value[1], step.value[1] = k;
}
return step;
});
}
return iterable.__iterator(type === ITERATE_VALUES ? ITERATE_KEYS : ITERATE_VALUES, reverse);
}, flipSequence;
}
function mapFactory(iterable, mapper, context) {
var mappedSequence = makeSequence(iterable);
return mappedSequence.size = iterable.size, mappedSequence.has = function(key) {
return iterable.has(key);
}, mappedSequence.get = function(key, notSetValue) {
var v = iterable.get(key, NOT_SET);
return v === NOT_SET ? notSetValue : mapper.call(context, v, key, iterable);
}, mappedSequence.__iterateUncached = function(fn, reverse) {
var this$0 = this;
return iterable.__iterate(function(v, k, c) {
return fn(mapper.call(context, v, k, c), k, this$0) !== !1;
}, reverse);
}, mappedSequence.__iteratorUncached = function(type, reverse) {
var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);
return new Iterator(function() {
var step = iterator.next();
if (step.done) return step;
var entry = step.value, key = entry[0];
return iteratorValue(type, key, mapper.call(context, entry[1], key, iterable), step);
});
}, mappedSequence;
}
function reverseFactory(iterable, useKeys) {
var reversedSequence = makeSequence(iterable);
return reversedSequence._iter = iterable, reversedSequence.size = iterable.size,
reversedSequence.reverse = function() {
return iterable;
}, iterable.flip && (reversedSequence.flip = function() {
var flipSequence = flipFactory(iterable);
return flipSequence.reverse = function() {
return iterable.flip();
}, flipSequence;
}), reversedSequence.get = function(key, notSetValue) {
return iterable.get(useKeys ? key : -1 - key, notSetValue);
}, reversedSequence.has = function(key) {
return iterable.has(useKeys ? key : -1 - key);
}, reversedSequence.includes = function(value) {
return iterable.includes(value);
}, reversedSequence.cacheResult = cacheResultThrough, reversedSequence.__iterate = function(fn, reverse) {
var this$0 = this;
return iterable.__iterate(function(v, k) {
return fn(v, k, this$0);
}, !reverse);
}, reversedSequence.__iterator = function(type, reverse) {
return iterable.__iterator(type, !reverse);
}, reversedSequence;
}
function filterFactory(iterable, predicate, context, useKeys) {
var filterSequence = makeSequence(iterable);
return useKeys && (filterSequence.has = function(key) {
var v = iterable.get(key, NOT_SET);
return v !== NOT_SET && !!predicate.call(context, v, key, iterable);
}, filterSequence.get = function(key, notSetValue) {
var v = iterable.get(key, NOT_SET);
return v !== NOT_SET && predicate.call(context, v, key, iterable) ? v : notSetValue;
}), filterSequence.__iterateUncached = function(fn, reverse) {
var this$0 = this, iterations = 0;
return iterable.__iterate(function(v, k, c) {
if (predicate.call(context, v, k, c)) return iterations++, fn(v, useKeys ? k : iterations - 1, this$0);
}, reverse), iterations;
}, filterSequence.__iteratorUncached = function(type, reverse) {
var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse), iterations = 0;
return new Iterator(function() {
for (;;) {
var step = iterator.next();
if (step.done) return step;
var entry = step.value, key = entry[0], value = entry[1];
if (predicate.call(context, value, key, iterable)) return iteratorValue(type, useKeys ? key : iterations++, value, step);
}
});
}, filterSequence;
}
function countByFactory(iterable, grouper, context) {
var groups = Map().asMutable();
return iterable.__iterate(function(v, k) {
groups.update(grouper.call(context, v, k, iterable), 0, function(a) {
return a + 1;
});
}), groups.asImmutable();
}
function groupByFactory(iterable, grouper, context) {
var isKeyedIter = isKeyed(iterable), groups = (isOrdered(iterable) ? OrderedMap() : Map()).asMutable();
iterable.__iterate(function(v, k) {
groups.update(grouper.call(context, v, k, iterable), function(a) {
return a = a || [], a.push(isKeyedIter ? [ k, v ] : v), a;
});
});
var coerce = iterableClass(iterable);
return groups.map(function(arr) {
return reify(iterable, coerce(arr));
});
}
function sliceFactory(iterable, begin, end, useKeys) {
var originalSize = iterable.size;
if (// Sanitize begin & end using this shorthand for ToInt32(argument)
// http://www.ecma-international.org/ecma-262/6.0/#sec-toint32
void 0 !== begin && (begin |= 0), void 0 !== end && (end |= 0), wholeSlice(begin, end, originalSize)) return iterable;
var resolvedBegin = resolveBegin(begin, originalSize), resolvedEnd = resolveEnd(end, originalSize);
// begin or end will be NaN if they were provided as negative numbers and
// this iterable's size is unknown. In that case, cache first so there is
// a known size and these do not resolve to NaN.
if (resolvedBegin !== resolvedBegin || resolvedEnd !== resolvedEnd) return sliceFactory(iterable.toSeq().cacheResult(), begin, end, useKeys);
// Note: resolvedEnd is undefined when the original sequence's length is
// unknown and this slice did not supply an end and should contain all
// elements after resolvedBegin.
// In that case, resolvedSize will be NaN and sliceSize will remain undefined.
var sliceSize, resolvedSize = resolvedEnd - resolvedBegin;
resolvedSize === resolvedSize && (sliceSize = resolvedSize < 0 ? 0 : resolvedSize);
var sliceSeq = makeSequence(iterable);
// If iterable.size is undefined, the size of the realized sliceSeq is
// unknown at this point unless the number of items to slice is 0
return sliceSeq.size = 0 === sliceSize ? sliceSize : iterable.size && sliceSize || void 0,
!useKeys && isSeq(iterable) && sliceSize >= 0 && (sliceSeq.get = function(index, notSetValue) {
return index = wrapIndex(this, index), index >= 0 && index < sliceSize ? iterable.get(index + resolvedBegin, notSetValue) : notSetValue;
}), sliceSeq.__iterateUncached = function(fn, reverse) {
var this$0 = this;
if (0 === sliceSize) return 0;
if (reverse) return this.cacheResult().__iterate(fn, reverse);
var skipped = 0, isSkipping = !0, iterations = 0;
return iterable.__iterate(function(v, k) {
if (!isSkipping || !(isSkipping = skipped++ < resolvedBegin)) return iterations++,
fn(v, useKeys ? k : iterations - 1, this$0) !== !1 && iterations !== sliceSize;
}), iterations;
}, sliceSeq.__iteratorUncached = function(type, reverse) {
if (0 !== sliceSize && reverse) return this.cacheResult().__iterator(type, reverse);
// Don't bother instantiating parent iterator if taking 0.
var iterator = 0 !== sliceSize && iterable.__iterator(type, reverse), skipped = 0, iterations = 0;
return new Iterator(function() {
for (;skipped++ < resolvedBegin; ) iterator.next();
if (++iterations > sliceSize) return iteratorDone();
var step = iterator.next();
return useKeys || type === ITERATE_VALUES ? step : type === ITERATE_KEYS ? iteratorValue(type, iterations - 1, void 0, step) : iteratorValue(type, iterations - 1, step.value[1], step);
});
}, sliceSeq;
}
function takeWhileFactory(iterable, predicate, context) {
var takeSequence = makeSequence(iterable);
return takeSequence.__iterateUncached = function(fn, reverse) {
var this$0 = this;
if (reverse) return this.cacheResult().__iterate(fn, reverse);
var iterations = 0;
return iterable.__iterate(function(v, k, c) {
return predicate.call(context, v, k, c) && ++iterations && fn(v, k, this$0);
}), iterations;
}, takeSequence.__iteratorUncached = function(type, reverse) {
var this$0 = this;
if (reverse) return this.cacheResult().__iterator(type, reverse);
var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse), iterating = !0;
return new Iterator(function() {
if (!iterating) return iteratorDone();
var step = iterator.next();
if (step.done) return step;
var entry = step.value, k = entry[0], v = entry[1];
return predicate.call(context, v, k, this$0) ? type === ITERATE_ENTRIES ? step : iteratorValue(type, k, v, step) : (iterating = !1,
iteratorDone());
});
}, takeSequence;
}
function skipWhileFactory(iterable, predicate, context, useKeys) {
var skipSequence = makeSequence(iterable);
return skipSequence.__iterateUncached = function(fn, reverse) {
var this$0 = this;
if (reverse) return this.cacheResult().__iterate(fn, reverse);
var isSkipping = !0, iterations = 0;
return iterable.__iterate(function(v, k, c) {
if (!isSkipping || !(isSkipping = predicate.call(context, v, k, c))) return iterations++,
fn(v, useKeys ? k : iterations - 1, this$0);
}), iterations;
}, skipSequence.__iteratorUncached = function(type, reverse) {
var this$0 = this;
if (reverse) return this.cacheResult().__iterator(type, reverse);
var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse), skipping = !0, iterations = 0;
return new Iterator(function() {
var step, k, v;
do {
if (step = iterator.next(), step.done) return useKeys || type === ITERATE_VALUES ? step : type === ITERATE_KEYS ? iteratorValue(type, iterations++, void 0, step) : iteratorValue(type, iterations++, step.value[1], step);
var entry = step.value;
k = entry[0], v = entry[1], skipping && (skipping = predicate.call(context, v, k, this$0));
} while (skipping);
return type === ITERATE_ENTRIES ? step : iteratorValue(type, k, v, step);
});
}, skipSequence;
}
function concatFactory(iterable, values) {
var isKeyedIterable = isKeyed(iterable), iters = [ iterable ].concat(values).map(function(v) {
return isIterable(v) ? isKeyedIterable && (v = KeyedIterable(v)) : v = isKeyedIterable ? keyedSeqFromValue(v) : indexedSeqFromValue(Array.isArray(v) ? v : [ v ]),
v;
}).filter(function(v) {
return 0 !== v.size;
});
if (0 === iters.length) return iterable;
if (1 === iters.length) {
var singleton = iters[0];
if (singleton === iterable || isKeyedIterable && isKeyed(singleton) || isIndexed(iterable) && isIndexed(singleton)) return singleton;
}
var concatSeq = new ArraySeq(iters);
return isKeyedIterable ? concatSeq = concatSeq.toKeyedSeq() : isIndexed(iterable) || (concatSeq = concatSeq.toSetSeq()),
concatSeq = concatSeq.flatten(!0), concatSeq.size = iters.reduce(function(sum, seq) {
if (void 0 !== sum) {
var size = seq.size;
if (void 0 !== size) return sum + size;
}
}, 0), concatSeq;
}
function flattenFactory(iterable, depth, useKeys) {
var flatSequence = makeSequence(iterable);
return flatSequence.__iterateUncached = function(fn, reverse) {
function flatDeep(iter, currentDepth) {
var this$0 = this;
iter.__iterate(function(v, k) {
return (!depth || currentDepth < depth) && isIterable(v) ? flatDeep(v, currentDepth + 1) : fn(v, useKeys ? k : iterations++, this$0) === !1 && (stopped = !0),
!stopped;
}, reverse);
}
var iterations = 0, stopped = !1;
return flatDeep(iterable, 0), iterations;
}, flatSequence.__iteratorUncached = function(type, reverse) {
var iterator = iterable.__iterator(type, reverse), stack = [], iterations = 0;
return new Iterator(function() {
for (;iterator; ) {
var step = iterator.next();
if (step.done === !1) {
var v = step.value;
if (type === ITERATE_ENTRIES && (v = v[1]), depth && !(stack.length < depth) || !isIterable(v)) return useKeys ? step : iteratorValue(type, iterations++, v, step);
stack.push(iterator), iterator = v.__iterator(type, reverse);
} else iterator = stack.pop();
}
return iteratorDone();
});
}, flatSequence;
}
function flatMapFactory(iterable, mapper, context) {
var coerce = iterableClass(iterable);
return iterable.toSeq().map(function(v, k) {
return coerce(mapper.call(context, v, k, iterable));
}).flatten(!0);
}
function interposeFactory(iterable, separator) {
var interposedSequence = makeSequence(iterable);
return interposedSequence.size = iterable.size && 2 * iterable.size - 1, interposedSequence.__iterateUncached = function(fn, reverse) {
var this$0 = this, iterations = 0;
return iterable.__iterate(function(v, k) {
return (!iterations || fn(separator, iterations++, this$0) !== !1) && fn(v, iterations++, this$0) !== !1;
}, reverse), iterations;
}, interposedSequence.__iteratorUncached = function(type, reverse) {
var step, iterator = iterable.__iterator(ITERATE_VALUES, reverse), iterations = 0;
return new Iterator(function() {
return (!step || iterations % 2) && (step = iterator.next(), step.done) ? step : iterations % 2 ? iteratorValue(type, iterations++, separator) : iteratorValue(type, iterations++, step.value, step);
});
}, interposedSequence;
}
function sortFactory(iterable, comparator, mapper) {
comparator || (comparator = defaultComparator);
var isKeyedIterable = isKeyed(iterable), index = 0, entries = iterable.toSeq().map(function(v, k) {
return [ k, v, index++, mapper ? mapper(v, k, iterable) : v ];
}).toArray();
return entries.sort(function(a, b) {
return comparator(a[3], b[3]) || a[2] - b[2];
}).forEach(isKeyedIterable ? function(v, i) {
entries[i].length = 2;
} : function(v, i) {
entries[i] = v[1];
}), isKeyedIterable ? KeyedSeq(entries) : isIndexed(iterable) ? IndexedSeq(entries) : SetSeq(entries);
}
function maxFactory(iterable, comparator, mapper) {
if (comparator || (comparator = defaultComparator), mapper) {
var entry = iterable.toSeq().map(function(v, k) {
return [ v, mapper(v, k, iterable) ];
}).reduce(function(a, b) {
return maxCompare(comparator, a[1], b[1]) ? b : a;
});
return entry && entry[0];
}
return iterable.reduce(function(a, b) {
return maxCompare(comparator, a, b) ? b : a;
});
}
function maxCompare(comparator, a, b) {
var comp = comparator(b, a);
// b is considered the new max if the comparator declares them equal, but
// they are not equal and b is in fact a nullish value.
return 0 === comp && b !== a && (void 0 === b || null === b || b !== b) || comp > 0;
}
function zipWithFactory(keyIter, zipper, iters) {
var zipSequence = makeSequence(keyIter);
// Note: this a generic base implementation of __iterate in terms of
// __iterator which may be more generically useful in the future.
return zipSequence.size = new ArraySeq(iters).map(function(i) {
return i.size;
}).min(), zipSequence.__iterate = function(fn, reverse) {
for (/* generic:
var iterator = this.__iterator(ITERATE_ENTRIES, reverse);
var step;
var iterations = 0;
while (!(step = iterator.next()).done) {
iterations++;
if (fn(step.value[1], step.value[0], this) === false) {
break;
}
}
return iterations;
*/
// indexed:
var step, iterator = this.__iterator(ITERATE_VALUES, reverse), iterations = 0; !(step = iterator.next()).done && fn(step.value, iterations++, this) !== !1; ) ;
return iterations;
}, zipSequence.__iteratorUncached = function(type, reverse) {
var iterators = iters.map(function(i) {
return i = Iterable(i), getIterator(reverse ? i.reverse() : i);
}), iterations = 0, isDone = !1;
return new Iterator(function() {
var steps;
return isDone || (steps = iterators.map(function(i) {
return i.next();
}), isDone = steps.some(function(s) {
return s.done;
})), isDone ? iteratorDone() : iteratorValue(type, iterations++, zipper.apply(null, steps.map(function(s) {
return s.value;
})));
});
}, zipSequence;
}
// #pragma Helper Functions
function reify(iter, seq) {
return isSeq(iter) ? seq : iter.constructor(seq);
}
function validateEntry(entry) {
if (entry !== Object(entry)) throw new TypeError("Expected [K, V] tuple: " + entry);
}
function resolveSize(iter) {
return assertNotInfinite(iter.size), ensureSize(iter);
}
function iterableClass(iterable) {
return isKeyed(iterable) ? KeyedIterable : isIndexed(iterable) ? IndexedIterable : SetIterable;
}
function makeSequence(iterable) {
return Object.create((isKeyed(iterable) ? KeyedSeq : isIndexed(iterable) ? IndexedSeq : SetSeq).prototype);
}
function cacheResultThrough() {
return this._iter.cacheResult ? (this._iter.cacheResult(), this.size = this._iter.size,
this) : Seq.prototype.cacheResult.call(this);
}
function defaultComparator(a, b) {
return a > b ? 1 : a < b ? -1 : 0;
}
function forceIterator(keyPath) {
var iter = getIterator(keyPath);
if (!iter) {
// Array might not be iterable in this environment, so we need a fallback
// to our wrapped type.
if (!isArrayLike(keyPath)) throw new TypeError("Expected iterable or array-like: " + keyPath);
iter = getIterator(Iterable(keyPath));
}
return iter;
}
function Record(defaultValues, name) {
var hasInitialized, RecordType = function(values) {
if (values instanceof RecordType) return values;
if (!(this instanceof RecordType)) return new RecordType(values);
if (!hasInitialized) {
hasInitialized = !0;
var keys = Object.keys(defaultValues);
setProps(RecordTypePrototype, keys), RecordTypePrototype.size = keys.length, RecordTypePrototype._name = name,
RecordTypePrototype._keys = keys, RecordTypePrototype._defaultValues = defaultValues;
}
this._map = Map(values);
}, RecordTypePrototype = RecordType.prototype = Object.create(RecordPrototype);
return RecordTypePrototype.constructor = RecordType, RecordType;
}
function makeRecord(likeRecord, map, ownerID) {
var record = Object.create(Object.getPrototypeOf(likeRecord));
return record._map = map, record.__ownerID = ownerID, record;
}
function recordName(record) {
return record._name || record.constructor.name || "Record";
}
function setProps(prototype, names) {
try {
names.forEach(setProp.bind(void 0, prototype));
} catch (error) {}
}
function setProp(prototype, name) {
Object.defineProperty(prototype, name, {
get: function() {
return this.get(name);
},
set: function(value) {
invariant(this.__ownerID, "Cannot set on an immutable record."), this.set(name, value);
}
});
}
// @pragma Construction
function Set(value) {
return null === value || void 0 === value ? emptySet() : isSet(value) && !isOrdered(value) ? value : emptySet().withMutations(function(set) {
var iter = SetIterable(value);
assertNotInfinite(iter.size), iter.forEach(function(v) {
return set.add(v);
});
});
}
function isSet(maybeSet) {
return !(!maybeSet || !maybeSet[IS_SET_SENTINEL]);
}
function updateSet(set, newMap) {
return set.__ownerID ? (set.size = newMap.size, set._map = newMap, set) : newMap === set._map ? set : 0 === newMap.size ? set.__empty() : set.__make(newMap);
}
function makeSet(map, ownerID) {
var set = Object.create(SetPrototype);
return set.size = map ? map.size : 0, set._map = map, set.__ownerID = ownerID, set;
}
function emptySet() {
return EMPTY_SET || (EMPTY_SET = makeSet(emptyMap()));
}
// @pragma Construction
function OrderedSet(value) {
return null === value || void 0 === value ? emptyOrderedSet() : isOrderedSet(value) ? value : emptyOrderedSet().withMutations(function(set) {
var iter = SetIterable(value);
assertNotInfinite(iter.size), iter.forEach(function(v) {
return set.add(v);
});
});
}
function isOrderedSet(maybeOrderedSet) {
return isSet(maybeOrderedSet) && isOrdered(maybeOrderedSet);
}
function makeOrderedSet(map, ownerID) {
var set = Object.create(OrderedSetPrototype);
return set.size = map ? map.size : 0, set._map = map, set.__ownerID = ownerID, set;
}
function emptyOrderedSet() {
return EMPTY_ORDERED_SET || (EMPTY_ORDERED_SET = makeOrderedSet(emptyOrderedMap()));
}
// @pragma Construction
function Stack(value) {
return null === value || void 0 === value ? emptyStack() : isStack(value) ? value : emptyStack().unshiftAll(value);
}
function isStack(maybeStack) {
return !(!maybeStack || !maybeStack[IS_STACK_SENTINEL]);
}
function makeStack(size, head, ownerID, hash) {
var map = Object.create(StackPrototype);
return map.size = size, map._head = head, map.__ownerID = ownerID, map.__hash = hash,
map.__altered = !1, map;
}
function emptyStack() {
return EMPTY_STACK || (EMPTY_STACK = makeStack(0));
}
/**
* Contributes additional methods to a constructor
*/
function mixin(ctor, methods) {
var keyCopier = function(key) {
ctor.prototype[key] = methods[key];
};
return Object.keys(methods).forEach(keyCopier), Object.getOwnPropertySymbols && Object.getOwnPropertySymbols(methods).forEach(keyCopier),
ctor;
}
// #pragma Helper functions
function keyMapper(v, k) {
return k;
}
function entryMapper(v, k) {
return [ k, v ];
}
function not(predicate) {
return function() {
return !predicate.apply(this, arguments);
};
}
function neg(predicate) {
return function() {
return -predicate.apply(this, arguments);
};
}
function quoteString(value) {
return "string" == typeof value ? JSON.stringify(value) : value;
}
function defaultZipper() {
return arrCopy(arguments);
}
function defaultNegComparator(a, b) {
return a < b ? 1 : a > b ? -1 : 0;
}
function hashIterable(iterable) {
if (iterable.size === 1 / 0) return 0;
var ordered = isOrdered(iterable), keyed = isKeyed(iterable), h = ordered ? 1 : 0, size = iterable.__iterate(keyed ? ordered ? function(v, k) {
h = 31 * h + hashMerge(hash(v), hash(k)) | 0;
} : function(v, k) {
h = h + hashMerge(hash(v), hash(k)) | 0;
} : ordered ? function(v) {
h = 31 * h + hash(v) | 0;
} : function(v) {
h = h + hash(v) | 0;
});
return murmurHashOfSize(size, h);
}
function murmurHashOfSize(size, h) {
return h = imul(h, 3432918353), h = imul(h << 15 | h >>> -15, 461845907), h = imul(h << 13 | h >>> -13, 5),
h = (h + 3864292196 | 0) ^ size, h = imul(h ^ h >>> 16, 2246822507), h = imul(h ^ h >>> 13, 3266489909),
h = smi(h ^ h >>> 16);
}
function hashMerge(a, b) {
return a ^ b + 2654435769 + (a << 6) + (a >> 2) | 0;
}
var SLICE$0 = Array.prototype.slice;
createClass(KeyedIterable, Iterable), createClass(IndexedIterable, Iterable), createClass(SetIterable, Iterable),
Iterable.isIterable = isIterable, Iterable.isKeyed = isKeyed, Iterable.isIndexed = isIndexed,
Iterable.isAssociative = isAssociative, Iterable.isOrdered = isOrdered, Iterable.Keyed = KeyedIterable,
Iterable.Indexed = IndexedIterable, Iterable.Set = SetIterable;
var IS_ITERABLE_SENTINEL = "@@__IMMUTABLE_ITERABLE__@@", IS_KEYED_SENTINEL = "@@__IMMUTABLE_KEYED__@@", IS_INDEXED_SENTINEL = "@@__IMMUTABLE_INDEXED__@@", IS_ORDERED_SENTINEL = "@@__IMMUTABLE_ORDERED__@@", DELETE = "delete", SHIFT = 5, SIZE = 1 << SHIFT, MASK = SIZE - 1, NOT_SET = {}, CHANGE_LENGTH = {
value: !1
}, DID_ALTER = {
value: !1
}, ITERATE_KEYS = 0, ITERATE_VALUES = 1, ITERATE_ENTRIES = 2, REAL_ITERATOR_SYMBOL = "function" == typeof Symbol && Symbol.iterator, FAUX_ITERATOR_SYMBOL = "@@iterator", ITERATOR_SYMBOL = REAL_ITERATOR_SYMBOL || FAUX_ITERATOR_SYMBOL;
Iterator.prototype.toString = function() {
return "[Iterator]";
}, Iterator.KEYS = ITERATE_KEYS, Iterator.VALUES = ITERATE_VALUES, Iterator.ENTRIES = ITERATE_ENTRIES,
Iterator.prototype.inspect = Iterator.prototype.toSource = function() {
return this.toString();
}, Iterator.prototype[ITERATOR_SYMBOL] = function() {
return this;
}, createClass(Seq, Iterable), Seq.of = function() {
return Seq(arguments);
}, Seq.prototype.toSeq = function() {
return this;
}, Seq.prototype.toString = function() {
return this.__toString("Seq {", "}");
}, Seq.prototype.cacheResult = function() {
return !this._cache && this.__iterateUncached && (this._cache = this.entrySeq().toArray(),
this.size = this._cache.length), this;
}, // abstract __iterateUncached(fn, reverse)
Seq.prototype.__iterate = function(fn, reverse) {
return seqIterate(this, fn, reverse, !0);
}, // abstract __iteratorUncached(type, reverse)
Seq.prototype.__iterator = function(type, reverse) {
return seqIterator(this, type, reverse, !0);
}, createClass(KeyedSeq, Seq), KeyedSeq.prototype.toKeyedSeq = function() {
return this;
}, createClass(IndexedSeq, Seq), IndexedSeq.of = function() {
return IndexedSeq(arguments);
}, IndexedSeq.prototype.toIndexedSeq = function() {
return this;
}, IndexedSeq.prototype.toString = function() {
return this.__toString("Seq [", "]");
}, IndexedSeq.prototype.__iterate = function(fn, reverse) {
return seqIterate(this, fn, reverse, !1);
}, IndexedSeq.prototype.__iterator = function(type, reverse) {
return seqIterator(this, type, reverse, !1);
}, createClass(SetSeq, Seq), SetSeq.of = function() {
return SetSeq(arguments);
}, SetSeq.prototype.toSetSeq = function() {
return this;
}, Seq.isSeq = isSeq, Seq.Keyed = KeyedSeq, Seq.Set = SetSeq, Seq.Indexed = IndexedSeq;
var IS_SEQ_SENTINEL = "@@__IMMUTABLE_SEQ__@@";
Seq.prototype[IS_SEQ_SENTINEL] = !0, createClass(ArraySeq, IndexedSeq), ArraySeq.prototype.get = function(index, notSetValue) {
return this.has(index) ? this._array[wrapIndex(this, index)] : notSetValue;
}, ArraySeq.prototype.__iterate = function(fn, reverse) {
for (var array = this._array, maxIndex = array.length - 1, ii = 0; ii <= maxIndex; ii++) if (fn(array[reverse ? maxIndex - ii : ii], ii, this) === !1) return ii + 1;
return ii;
}, ArraySeq.prototype.__iterator = function(type, reverse) {
var array = this._array, maxIndex = array.length - 1, ii = 0;
return new Iterator(function() {
return ii > maxIndex ? iteratorDone() : iteratorValue(type, ii, array[reverse ? maxIndex - ii++ : ii++]);
});
}, createClass(ObjectSeq, KeyedSeq), ObjectSeq.prototype.get = function(key, notSetValue) {
return void 0 === notSetValue || this.has(key) ? this._object[key] : notSetValue;
}, ObjectSeq.prototype.has = function(key) {
return this._object.hasOwnProperty(key);
}, ObjectSeq.prototype.__iterate = function(fn, reverse) {
for (var object = this._object, keys = this._keys, maxIndex = keys.length - 1, ii = 0; ii <= maxIndex; ii++) {
var key = keys[reverse ? maxIndex - ii : ii];
if (fn(object[key], key, this) === !1) return ii + 1;
}
return ii;
}, ObjectSeq.prototype.__iterator = function(type, reverse) {
var object = this._object, keys = this._keys, maxIndex = keys.length - 1, ii = 0;
return new Iterator(function() {
var key = keys[reverse ? maxIndex - ii : ii];
return ii++ > maxIndex ? iteratorDone() : iteratorValue(type, key, object[key]);
});
}, ObjectSeq.prototype[IS_ORDERED_SENTINEL] = !0, createClass(IterableSeq, IndexedSeq),
IterableSeq.prototype.__iterateUncached = function(fn, reverse) {
if (reverse) return this.cacheResult().__iterate(fn, reverse);
var iterable = this._iterable, iterator = getIterator(iterable), iterations = 0;
if (isIterator(iterator)) for (var step; !(step = iterator.next()).done && fn(step.value, iterations++, this) !== !1; ) ;
return iterations;
}, IterableSeq.prototype.__iteratorUncached = function(type, reverse) {
if (reverse) return this.cacheResult().__iterator(type, reverse);
var iterable = this._iterable, iterator = getIterator(iterable);
if (!isIterator(iterator)) return new Iterator(iteratorDone);
var iterations = 0;
return new Iterator(function() {
var step = iterator.next();
return step.done ? step : iteratorValue(type, iterations++, step.value);
});
}, createClass(IteratorSeq, IndexedSeq), IteratorSeq.prototype.__iterateUncached = function(fn, reverse) {
if (reverse) return this.cacheResult().__iterate(fn, reverse);
for (var iterator = this._iterator, cache = this._iteratorCache, iterations = 0; iterations < cache.length; ) if (fn(cache[iterations], iterations++, this) === !1) return iterations;
for (var step; !(step = iterator.next()).done; ) {
var val = step.value;
if (cache[iterations] = val, fn(val, iterations++, this) === !1) break;
}
return iterations;
}, IteratorSeq.prototype.__iteratorUncached = function(type, reverse) {
if (reverse) return this.cacheResult().__iterator(type, reverse);
var iterator = this._iterator, cache = this._iteratorCache, iterations = 0;
return new Iterator(function() {
if (iterations >= cache.length) {
var step = iterator.next();
if (step.done) return step;
cache[iterations] = step.value;
}
return iteratorValue(type, iterations, cache[iterations++]);
});
};
var EMPTY_SEQ;
createClass(Repeat, IndexedSeq), Repeat.prototype.toString = function() {
return 0 === this.size ? "Repeat []" : "Repeat [ " + this._value + " " + this.size + " times ]";
}, Repeat.prototype.get = function(index, notSetValue) {
return this.has(index) ? this._value : notSetValue;
}, Repeat.prototype.includes = function(searchValue) {
return is(this._value, searchValue);
}, Repeat.prototype.slice = function(begin, end) {
var size = this.size;
return wholeSlice(begin, end, size) ? this : new Repeat(this._value, resolveEnd(end, size) - resolveBegin(begin, size));
}, Repeat.prototype.reverse = function() {
return this;
}, Repeat.prototype.indexOf = function(searchValue) {
return is(this._value, searchValue) ? 0 : -1;
}, Repeat.prototype.lastIndexOf = function(searchValue) {
return is(this._value, searchValue) ? this.size : -1;
}, Repeat.prototype.__iterate = function(fn, reverse) {
for (var ii = 0; ii < this.size; ii++) if (fn(this._value, ii, this) === !1) return ii + 1;
return ii;
}, Repeat.prototype.__iterator = function(type, reverse) {
var this$0 = this, ii = 0;
return new Iterator(function() {
return ii < this$0.size ? iteratorValue(type, ii++, this$0._value) : iteratorDone();
});
}, Repeat.prototype.equals = function(other) {
return other instanceof Repeat ? is(this._value, other._value) : deepEqual(other);
};
var EMPTY_REPEAT;
createClass(Range, IndexedSeq), Range.prototype.toString = function() {
return 0 === this.size ? "Range []" : "Range [ " + this._start + "..." + this._end + (this._step > 1 ? " by " + this._step : "") + " ]";
}, Range.prototype.get = function(index, notSetValue) {
return this.has(index) ? this._start + wrapIndex(this, index) * this._step : notSetValue;
}, Range.prototype.includes = function(searchValue) {
var possibleIndex = (searchValue - this._start) / this._step;
return possibleIndex >= 0 && possibleIndex < this.size && possibleIndex === Math.floor(possibleIndex);
}, Range.prototype.slice = function(begin, end) {
return wholeSlice(begin, end, this.size) ? this : (begin = resolveBegin(begin, this.size),
end = resolveEnd(end, this.size), end <= begin ? new Range(0, 0) : new Range(this.get(begin, this._end), this.get(end, this._end), this._step));
}, Range.prototype.indexOf = function(searchValue) {
var offsetValue = searchValue - this._start;
if (offsetValue % this._step === 0) {
var index = offsetValue / this._step;
if (index >= 0 && index < this.size) return index;
}
return -1;
}, Range.prototype.lastIndexOf = function(searchValue) {
return this.indexOf(searchValue);
}, Range.prototype.__iterate = function(fn, reverse) {
for (var maxIndex = this.size - 1, step = this._step, value = reverse ? this._start + maxIndex * step : this._start, ii = 0; ii <= maxIndex; ii++) {
if (fn(value, ii, this) === !1) return ii + 1;
value += reverse ? -step : step;
}
return ii;
}, Range.prototype.__iterator = function(type, reverse) {
var maxIndex = this.size - 1, step = this._step, value = reverse ? this._start + maxIndex * step : this._start, ii = 0;
return new Iterator(function() {
var v = value;
return value += reverse ? -step : step, ii > maxIndex ? iteratorDone() : iteratorValue(type, ii++, v);
});
}, Range.prototype.equals = function(other) {
return other instanceof Range ? this._start === other._start && this._end === other._end && this._step === other._step : deepEqual(this, other);
};
var EMPTY_RANGE;
createClass(Collection, Iterable), createClass(KeyedCollection, Collection), createClass(IndexedCollection, Collection),
createClass(SetCollection, Collection), Collection.Keyed = KeyedCollection, Collection.Indexed = IndexedCollection,
Collection.Set = SetCollection;
var weakMap, imul = "function" == typeof Math.imul && Math.imul(4294967295, 2) === -2 ? Math.imul : function(a, b) {
a |= 0, // int
b |= 0;
// int
var c = 65535 & a, d = 65535 & b;
// Shift by 0 fixes the sign on the high part.
return c * d + ((a >>> 16) * d + c * (b >>> 16) << 16 >>> 0) | 0;
}, isExtensible = Object.isExtensible, canDefineProperty = function() {
try {
return Object.defineProperty({}, "@", {}), !0;
} catch (e) {
return !1;
}
}(), usingWeakMap = "function" == typeof WeakMap;
usingWeakMap && (weakMap = new WeakMap());
var objHashUID = 0, UID_HASH_KEY = "__immutablehash__";
"function" == typeof Symbol && (UID_HASH_KEY = Symbol(UID_HASH_KEY));
var STRING_HASH_CACHE_MIN_STRLEN = 16, STRING_HASH_CACHE_MAX_SIZE = 255, STRING_HASH_CACHE_SIZE = 0, stringHashCache = {};
createClass(Map, KeyedCollection), Map.prototype.toString = function() {
return this.__toString("Map {", "}");
}, // @pragma Access
Map.prototype.get = function(k, notSetValue) {
return this._root ? this._root.get(0, void 0, k, notSetValue) : notSetValue;
}, // @pragma Modification
Map.prototype.set = function(k, v) {
return updateMap(this, k, v);
}, Map.prototype.setIn = function(keyPath, v) {
return this.updateIn(keyPath, NOT_SET, function() {
return v;
});
}, Map.prototype.remove = function(k) {
return updateMap(this, k, NOT_SET);
}, Map.prototype.deleteIn = function(keyPath) {
return this.updateIn(keyPath, function() {
return NOT_SET;
});
}, Map.prototype.update = function(k, notSetValue, updater) {
return 1 === arguments.length ? k(this) : this.updateIn([ k ], notSetValue, updater);
}, Map.prototype.updateIn = function(keyPath, notSetValue, updater) {
updater || (updater = notSetValue, notSetValue = void 0);
var updatedValue = updateInDeepMap(this, forceIterator(keyPath), notSetValue, updater);
return updatedValue === NOT_SET ? void 0 : updatedValue;
}, Map.prototype.clear = function() {
return 0 === this.size ? this : this.__ownerID ? (this.size = 0, this._root = null,
this.__hash = void 0, this.__altered = !0, this) : emptyMap();
}, // @pragma Composition
Map.prototype.merge = function() {
return mergeIntoMapWith(this, void 0, arguments);
}, Map.prototype.mergeWith = function(merger) {
var iters = SLICE$0.call(arguments, 1);
return mergeIntoMapWith(this, merger, iters);
}, Map.prototype.mergeIn = function(keyPath) {
var iters = SLICE$0.call(arguments, 1);
return this.updateIn(keyPath, emptyMap(), function(m) {
return "function" == typeof m.merge ? m.merge.apply(m, iters) : iters[iters.length - 1];
});
}, Map.prototype.mergeDeep = function() {
return mergeIntoMapWith(this, deepMerger, arguments);
}, Map.prototype.mergeDeepWith = function(merger) {
var iters = SLICE$0.call(arguments, 1);
return mergeIntoMapWith(this, deepMergerWith(merger), iters);
}, Map.prototype.mergeDeepIn = function(keyPath) {
var iters = SLICE$0.call(arguments, 1);
return this.updateIn(keyPath, emptyMap(), function(m) {
return "function" == typeof m.mergeDeep ? m.mergeDeep.apply(m, iters) : iters[iters.length - 1];
});
}, Map.prototype.sort = function(comparator) {
// Late binding
return OrderedMap(sortFactory(this, comparator));
}, Map.prototype.sortBy = function(mapper, comparator) {
// Late binding
return OrderedMap(sortFactory(this, comparator, mapper));
}, // @pragma Mutability
Map.prototype.withMutations = function(fn) {
var mutable = this.asMutable();
return fn(mutable), mutable.wasAltered() ? mutable.__ensureOwner(this.__ownerID) : this;
}, Map.prototype.asMutable = function() {
return this.__ownerID ? this : this.__ensureOwner(new OwnerID());
}, Map.prototype.asImmutable = function() {
return this.__ensureOwner();
}, Map.prototype.wasAltered = function() {
return this.__altered;
}, Map.prototype.__iterator = function(type, reverse) {
return new MapIterator(this, type, reverse);
}, Map.prototype.__iterate = function(fn, reverse) {
var this$0 = this, iterations = 0;
return this._root && this._root.iterate(function(entry) {
return iterations++, fn(entry[1], entry[0], this$0);
}, reverse), iterations;
}, Map.prototype.__ensureOwner = function(ownerID) {
return ownerID === this.__ownerID ? this : ownerID ? makeMap(this.size, this._root, ownerID, this.__hash) : (this.__ownerID = ownerID,
this.__altered = !1, this);
}, Map.isMap = isMap;
var IS_MAP_SENTINEL = "@@__IMMUTABLE_MAP__@@", MapPrototype = Map.prototype;
MapPrototype[IS_MAP_SENTINEL] = !0, MapPrototype[DELETE] = MapPrototype.remove,
MapPrototype.removeIn = MapPrototype.deleteIn, ArrayMapNode.prototype.get = function(shift, keyHash, key, notSetValue) {
for (var entries = this.entries, ii = 0, len = entries.length; ii < len; ii++) if (is(key, entries[ii][0])) return entries[ii][1];
return notSetValue;
}, ArrayMapNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {
for (var removed = value === NOT_SET, entries = this.entries, idx = 0, len = entries.length; idx < len && !is(key, entries[idx][0]); idx++) ;
var exists = idx < len;
if (exists ? entries[idx][1] === value : removed) return this;
if (SetRef(didAlter), (removed || !exists) && SetRef(didChangeSize), !removed || 1 !== entries.length) {
if (!exists && !removed && entries.length >= MAX_ARRAY_MAP_SIZE) return createNodes(ownerID, entries, key, value);
var isEditable = ownerID && ownerID === this.ownerID, newEntries = isEditable ? entries : arrCopy(entries);
return exists ? removed ? idx === len - 1 ? newEntries.pop() : newEntries[idx] = newEntries.pop() : newEntries[idx] = [ key, value ] : newEntries.push([ key, value ]),
isEditable ? (this.entries = newEntries, this) : new ArrayMapNode(ownerID, newEntries);
}
}, BitmapIndexedNode.prototype.get = function(shift, keyHash, key, notSetValue) {
void 0 === keyHash && (keyHash = hash(key));
var bit = 1 << ((0 === shift ? keyHash : keyHash >>> shift) & MASK), bitmap = this.bitmap;
return 0 === (bitmap & bit) ? notSetValue : this.nodes[popCount(bitmap & bit - 1)].get(shift + SHIFT, keyHash, key, notSetValue);
}, BitmapIndexedNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {
void 0 === keyHash && (keyHash = hash(key));
var keyHashFrag = (0 === shift ? keyHash : keyHash >>> shift) & MASK, bit = 1 << keyHashFrag, bitmap = this.bitmap, exists = 0 !== (bitmap & bit);
if (!exists && value === NOT_SET) return this;
var idx = popCount(bitmap & bit - 1), nodes = this.nodes, node = exists ? nodes[idx] : void 0, newNode = updateNode(node, ownerID, shift + SHIFT, keyHash, key, value, didChangeSize, didAlter);
if (newNode === node) return this;
if (!exists && newNode && nodes.length >= MAX_BITMAP_INDEXED_SIZE) return expandNodes(ownerID, nodes, bitmap, keyHashFrag, newNode);
if (exists && !newNode && 2 === nodes.length && isLeafNode(nodes[1 ^ idx])) return nodes[1 ^ idx];
if (exists && newNode && 1 === nodes.length && isLeafNode(newNode)) return newNode;
var isEditable = ownerID && ownerID === this.ownerID, newBitmap = exists ? newNode ? bitmap : bitmap ^ bit : bitmap | bit, newNodes = exists ? newNode ? setIn(nodes, idx, newNode, isEditable) : spliceOut(nodes, idx, isEditable) : spliceIn(nodes, idx, newNode, isEditable);
return isEditable ? (this.bitmap = newBitmap, this.nodes = newNodes, this) : new BitmapIndexedNode(ownerID, newBitmap, newNodes);
}, HashArrayMapNode.prototype.get = function(shift, keyHash, key, notSetValue) {
void 0 === keyHash && (keyHash = hash(key));
var idx = (0 === shift ? keyHash : keyHash >>> shift) & MASK, node = this.nodes[idx];
return node ? node.get(shift + SHIFT, keyHash, key, notSetValue) : notSetValue;
}, HashArrayMapNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {
void 0 === keyHash && (keyHash = hash(key));
var idx = (0 === shift ? keyHash : keyHash >>> shift) & MASK, removed = value === NOT_SET, nodes = this.nodes, node = nodes[idx];
if (removed && !node) return this;
var newNode = updateNode(node, ownerID, shift + SHIFT, keyHash, key, value, didChangeSize, didAlter);
if (newNode === node) return this;
var newCount = this.count;
if (node) {
if (!newNode && (newCount--, newCount < MIN_HASH_ARRAY_MAP_SIZE)) return packNodes(ownerID, nodes, newCount, idx);
} else newCount++;
var isEditable = ownerID && ownerID === this.ownerID, newNodes = setIn(nodes, idx, newNode, isEditable);
return isEditable ? (this.count = newCount, this.nodes = newNodes, this) : new HashArrayMapNode(ownerID, newCount, newNodes);
}, HashCollisionNode.prototype.get = function(shift, keyHash, key, notSetValue) {
for (var entries = this.entries, ii = 0, len = entries.length; ii < len; ii++) if (is(key, entries[ii][0])) return entries[ii][1];
return notSetValue;
}, HashCollisionNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {
void 0 === keyHash && (keyHash = hash(key));
var removed = value === NOT_SET;
if (keyHash !== this.keyHash) return removed ? this : (SetRef(didAlter), SetRef(didChangeSize),
mergeIntoNode(this, ownerID, shift, keyHash, [ key, value ]));
for (var entries = this.entries, idx = 0, len = entries.length; idx < len && !is(key, entries[idx][0]); idx++) ;
var exists = idx < len;
if (exists ? entries[idx][1] === value : removed) return this;
if (SetRef(didAlter), (removed || !exists) && SetRef(didChangeSize), removed && 2 === len) return new ValueNode(ownerID, this.keyHash, entries[1 ^ idx]);
var isEditable = ownerID && ownerID === this.ownerID, newEntries = isEditable ? entries : arrCopy(entries);
return exists ? removed ? idx === len - 1 ? newEntries.pop() : newEntries[idx] = newEntries.pop() : newEntries[idx] = [ key, value ] : newEntries.push([ key, value ]),
isEditable ? (this.entries = newEntries, this) : new HashCollisionNode(ownerID, this.keyHash, newEntries);
}, ValueNode.prototype.get = function(shift, keyHash, key, notSetValue) {
return is(key, this.entry[0]) ? this.entry[1] : notSetValue;
}, ValueNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {
var removed = value === NOT_SET, keyMatch = is(key, this.entry[0]);
return (keyMatch ? value === this.entry[1] : removed) ? this : (SetRef(didAlter),
removed ? void SetRef(didChangeSize) : keyMatch ? ownerID && ownerID === this.ownerID ? (this.entry[1] = value,
this) : new ValueNode(ownerID, this.keyHash, [ key, value ]) : (SetRef(didChangeSize),
mergeIntoNode(this, ownerID, shift, hash(key), [ key, value ])));
}, // #pragma Iterators
ArrayMapNode.prototype.iterate = HashCollisionNode.prototype.iterate = function(fn, reverse) {
for (var entries = this.entries, ii = 0, maxIndex = entries.length - 1; ii <= maxIndex; ii++) if (fn(entries[reverse ? maxIndex - ii : ii]) === !1) return !1;
}, BitmapIndexedNode.prototype.iterate = HashArrayMapNode.prototype.iterate = function(fn, reverse) {
for (var nodes = this.nodes, ii = 0, maxIndex = nodes.length - 1; ii <= maxIndex; ii++) {
var node = nodes[reverse ? maxIndex - ii : ii];
if (node && node.iterate(fn, reverse) === !1) return !1;
}
}, ValueNode.prototype.iterate = function(fn, reverse) {
return fn(this.entry);
}, createClass(MapIterator, Iterator), MapIterator.prototype.next = function() {
for (var type = this._type, stack = this._stack; stack; ) {
var maxIndex, node = stack.node, index = stack.index++;
if (node.entry) {
if (0 === index) return mapIteratorValue(type, node.entry);
} else if (node.entries) {
if (maxIndex = node.entries.length - 1, index <= maxIndex) return mapIteratorValue(type, node.entries[this._reverse ? maxIndex - index : index]);
} else if (maxIndex = node.nodes.length - 1, index <= maxIndex) {
var subNode = node.nodes[this._reverse ? maxIndex - index : index];
if (subNode) {
if (subNode.entry) return mapIteratorValue(type, subNode.entry);
stack = this._stack = mapIteratorFrame(subNode, stack);
}
continue;
}
stack = this._stack = this._stack.__prev;
}
return iteratorDone();
};
var EMPTY_MAP, MAX_ARRAY_MAP_SIZE = SIZE / 4, MAX_BITMAP_INDEXED_SIZE = SIZE / 2, MIN_HASH_ARRAY_MAP_SIZE = SIZE / 4;
createClass(List, IndexedCollection), List.of = function() {
return this(arguments);
}, List.prototype.toString = function() {
return this.__toString("List [", "]");
}, // @pragma Access
List.prototype.get = function(index, notSetValue) {
if (index = wrapIndex(this, index), index >= 0 && index < this.size) {
index += this._origin;
var node = listNodeFor(this, index);
return node && node.array[index & MASK];
}
return notSetValue;
}, // @pragma Modification
List.prototype.set = function(index, value) {
return updateList(this, index, value);
}, List.prototype.remove = function(index) {
return this.has(index) ? 0 === index ? this.shift() : index === this.size - 1 ? this.pop() : this.splice(index, 1) : this;
}, List.prototype.insert = function(index, value) {
return this.splice(index, 0, value);
}, List.prototype.clear = function() {
return 0 === this.size ? this : this.__ownerID ? (this.size = this._origin = this._capacity = 0,
this._level = SHIFT, this._root = this._tail = null, this.__hash = void 0, this.__altered = !0,
this) : emptyList();
}, List.prototype.push = function() {
var values = arguments, oldSize = this.size;
return this.withMutations(function(list) {
setListBounds(list, 0, oldSize + values.length);
for (var ii = 0; ii < values.length; ii++) list.set(oldSize + ii, values[ii]);
});
}, List.prototype.pop = function() {
return setListBounds(this, 0, -1);
}, List.prototype.unshift = function() {
var values = arguments;
return this.withMutations(function(list) {
setListBounds(list, -values.length);
for (var ii = 0; ii < values.length; ii++) list.set(ii, values[ii]);
});
}, List.prototype.shift = function() {
return setListBounds(this, 1);
}, // @pragma Composition
List.prototype.merge = function() {
return mergeIntoListWith(this, void 0, arguments);
}, List.prototype.mergeWith = function(merger) {
var iters = SLICE$0.call(arguments, 1);
return mergeIntoListWith(this, merger, iters);
}, List.prototype.mergeDeep = function() {
return mergeIntoListWith(this, deepMerger, arguments);
}, List.prototype.mergeDeepWith = function(merger) {
var iters = SLICE$0.call(arguments, 1);
return mergeIntoListWith(this, deepMergerWith(merger), iters);
}, List.prototype.setSize = function(size) {
return setListBounds(this, 0, size);
}, // @pragma Iteration
List.prototype.slice = function(begin, end) {
var size = this.size;
return wholeSlice(begin, end, size) ? this : setListBounds(this, resolveBegin(begin, size), resolveEnd(end, size));
}, List.prototype.__iterator = function(type, reverse) {
var index = 0, values = iterateList(this, reverse);
return new Iterator(function() {
var value = values();
return value === DONE ? iteratorDone() : iteratorValue(type, index++, value);
});
}, List.prototype.__iterate = function(fn, reverse) {
for (var value, index = 0, values = iterateList(this, reverse); (value = values()) !== DONE && fn(value, index++, this) !== !1; ) ;
return index;
}, List.prototype.__ensureOwner = function(ownerID) {
return ownerID === this.__ownerID ? this : ownerID ? makeList(this._origin, this._capacity, this._level, this._root, this._tail, ownerID, this.__hash) : (this.__ownerID = ownerID,
this);
}, List.isList = isList;
var IS_LIST_SENTINEL = "@@__IMMUTABLE_LIST__@@", ListPrototype = List.prototype;
ListPrototype[IS_LIST_SENTINEL] = !0, ListPrototype[DELETE] = ListPrototype.remove,
ListPrototype.setIn = MapPrototype.setIn, ListPrototype.deleteIn = ListPrototype.removeIn = MapPrototype.removeIn,
ListPrototype.update = MapPrototype.update, ListPrototype.updateIn = MapPrototype.updateIn,
ListPrototype.mergeIn = MapPrototype.mergeIn, ListPrototype.mergeDeepIn = MapPrototype.mergeDeepIn,
ListPrototype.withMutations = MapPrototype.withMutations, ListPrototype.asMutable = MapPrototype.asMutable,
ListPrototype.asImmutable = MapPrototype.asImmutable, ListPrototype.wasAltered = MapPrototype.wasAltered,
// TODO: seems like these methods are very similar
VNode.prototype.removeBefore = function(ownerID, level, index) {
if (index === level ? 1 << level : 0 === this.array.length) return this;
var originIndex = index >>> level & MASK;
if (originIndex >= this.array.length) return new VNode([], ownerID);
var newChild, removingFirst = 0 === originIndex;
if (level > 0) {
var oldChild = this.array[originIndex];
if (newChild = oldChild && oldChild.removeBefore(ownerID, level - SHIFT, index),
newChild === oldChild && removingFirst) return this;
}
if (removingFirst && !newChild) return this;
var editable = editableVNode(this, ownerID);
if (!removingFirst) for (var ii = 0; ii < originIndex; ii++) editable.array[ii] = void 0;
return newChild && (editable.array[originIndex] = newChild), editable;
}, VNode.prototype.removeAfter = function(ownerID, level, index) {
if (index === (level ? 1 << level : 0) || 0 === this.array.length) return this;
var sizeIndex = index - 1 >>> level & MASK;
if (sizeIndex >= this.array.length) return this;
var newChild;
if (level > 0) {
var oldChild = this.array[sizeIndex];
if (newChild = oldChild && oldChild.removeAfter(ownerID, level - SHIFT, index),
newChild === oldChild && sizeIndex === this.array.length - 1) return this;
}
var editable = editableVNode(this, ownerID);
return editable.array.splice(sizeIndex + 1), newChild && (editable.array[sizeIndex] = newChild),
editable;
};
var EMPTY_LIST, DONE = {};
createClass(OrderedMap, Map), OrderedMap.of = function() {
return this(arguments);
}, OrderedMap.prototype.toString = function() {
return this.__toString("OrderedMap {", "}");
}, // @pragma Access
OrderedMap.prototype.get = function(k, notSetValue) {
var index = this._map.get(k);
return void 0 !== index ? this._list.get(index)[1] : notSetValue;
}, // @pragma Modification
OrderedMap.prototype.clear = function() {
return 0 === this.size ? this : this.__ownerID ? (this.size = 0, this._map.clear(),
this._list.clear(), this) : emptyOrderedMap();
}, OrderedMap.prototype.set = function(k, v) {
return updateOrderedMap(this, k, v);
}, OrderedMap.prototype.remove = function(k) {
return updateOrderedMap(this, k, NOT_SET);
}, OrderedMap.prototype.wasAltered = function() {
return this._map.wasAltered() || this._list.wasAltered();
}, OrderedMap.prototype.__iterate = function(fn, reverse) {
var this$0 = this;
return this._list.__iterate(function(entry) {
return entry && fn(entry[1], entry[0], this$0);
}, reverse);
}, OrderedMap.prototype.__iterator = function(type, reverse) {
return this._list.fromEntrySeq().__iterator(type, reverse);
}, OrderedMap.prototype.__ensureOwner = function(ownerID) {
if (ownerID === this.__ownerID) return this;
var newMap = this._map.__ensureOwner(ownerID), newList = this._list.__ensureOwner(ownerID);
return ownerID ? makeOrderedMap(newMap, newList, ownerID, this.__hash) : (this.__ownerID = ownerID,
this._map = newMap, this._list = newList, this);
}, OrderedMap.isOrderedMap = isOrderedMap, OrderedMap.prototype[IS_ORDERED_SENTINEL] = !0,
OrderedMap.prototype[DELETE] = OrderedMap.prototype.remove;
var EMPTY_ORDERED_MAP;
createClass(ToKeyedSequence, KeyedSeq), ToKeyedSequence.prototype.get = function(key, notSetValue) {
return this._iter.get(key, notSetValue);
}, ToKeyedSequence.prototype.has = function(key) {
return this._iter.has(key);
}, ToKeyedSequence.prototype.valueSeq = function() {
return this._iter.valueSeq();
}, ToKeyedSequence.prototype.reverse = function() {
var this$0 = this, reversedSequence = reverseFactory(this, !0);
return this._useKeys || (reversedSequence.valueSeq = function() {
return this$0._iter.toSeq().reverse();
}), reversedSequence;
}, ToKeyedSequence.prototype.map = function(mapper, context) {
var this$0 = this, mappedSequence = mapFactory(this, mapper, context);
return this._useKeys || (mappedSequence.valueSeq = function() {
return this$0._iter.toSeq().map(mapper, context);
}), mappedSequence;
}, ToKeyedSequence.prototype.__iterate = function(fn, reverse) {
var ii, this$0 = this;
return this._iter.__iterate(this._useKeys ? function(v, k) {
return fn(v, k, this$0);
} : (ii = reverse ? resolveSize(this) : 0, function(v) {
return fn(v, reverse ? --ii : ii++, this$0);
}), reverse);
}, ToKeyedSequence.prototype.__iterator = function(type, reverse) {
if (this._useKeys) return this._iter.__iterator(type, reverse);
var iterator = this._iter.__iterator(ITERATE_VALUES, reverse), ii = reverse ? resolveSize(this) : 0;
return new Iterator(function() {
var step = iterator.next();
return step.done ? step : iteratorValue(type, reverse ? --ii : ii++, step.value, step);
});
}, ToKeyedSequence.prototype[IS_ORDERED_SENTINEL] = !0, createClass(ToIndexedSequence, IndexedSeq),
ToIndexedSequence.prototype.includes = function(value) {
return this._iter.includes(value);
}, ToIndexedSequence.prototype.__iterate = function(fn, reverse) {
var this$0 = this, iterations = 0;
return this._iter.__iterate(function(v) {
return fn(v, iterations++, this$0);
}, reverse);
}, ToIndexedSequence.prototype.__iterator = function(type, reverse) {
var iterator = this._iter.__iterator(ITERATE_VALUES, reverse), iterations = 0;
return new Iterator(function() {
var step = iterator.next();
return step.done ? step : iteratorValue(type, iterations++, step.value, step);
});
}, createClass(ToSetSequence, SetSeq), ToSetSequence.prototype.has = function(key) {
return this._iter.includes(key);
}, ToSetSequence.prototype.__iterate = function(fn, reverse) {
var this$0 = this;
return this._iter.__iterate(function(v) {
return fn(v, v, this$0);
}, reverse);
}, ToSetSequence.prototype.__iterator = function(type, reverse) {
var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);
return new Iterator(function() {
var step = iterator.next();
return step.done ? step : iteratorValue(type, step.value, step.value, step);
});
}, createClass(FromEntriesSequence, KeyedSeq), FromEntriesSequence.prototype.entrySeq = function() {
return this._iter.toSeq();
}, FromEntriesSequence.prototype.__iterate = function(fn, reverse) {
var this$0 = this;
return this._iter.__iterate(function(entry) {
// Check if entry exists first so array access doesn't throw for holes
// in the parent iteration.
if (entry) {
validateEntry(entry);
var indexedIterable = isIterable(entry);
return fn(indexedIterable ? entry.get(1) : entry[1], indexedIterable ? entry.get(0) : entry[0], this$0);
}
}, reverse);
}, FromEntriesSequence.prototype.__iterator = function(type, reverse) {
var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);
return new Iterator(function() {
for (;;) {
var step = iterator.next();
if (step.done) return step;
var entry = step.value;
// Check if entry exists first so array access doesn't throw for holes
// in the parent iteration.
if (entry) {
validateEntry(entry);
var indexedIterable = isIterable(entry);
return iteratorValue(type, indexedIterable ? entry.get(0) : entry[0], indexedIterable ? entry.get(1) : entry[1], step);
}
}
});
}, ToIndexedSequence.prototype.cacheResult = ToKeyedSequence.prototype.cacheResult = ToSetSequence.prototype.cacheResult = FromEntriesSequence.prototype.cacheResult = cacheResultThrough,
createClass(Record, KeyedCollection), Record.prototype.toString = function() {
return this.__toString(recordName(this) + " {", "}");
}, // @pragma Access
Record.prototype.has = function(k) {
return this._defaultValues.hasOwnProperty(k);
}, Record.prototype.get = function(k, notSetValue) {
if (!this.has(k)) return notSetValue;
var defaultVal = this._defaultValues[k];
return this._map ? this._map.get(k, defaultVal) : defaultVal;
}, // @pragma Modification
Record.prototype.clear = function() {
if (this.__ownerID) return this._map && this._map.clear(), this;
var RecordType = this.constructor;
return RecordType._empty || (RecordType._empty = makeRecord(this, emptyMap()));
}, Record.prototype.set = function(k, v) {
if (!this.has(k)) throw new Error('Cannot set unknown key "' + k + '" on ' + recordName(this));
var newMap = this._map && this._map.set(k, v);
return this.__ownerID || newMap === this._map ? this : makeRecord(this, newMap);
}, Record.prototype.remove = function(k) {
if (!this.has(k)) return this;
var newMap = this._map && this._map.remove(k);
return this.__ownerID || newMap === this._map ? this : makeRecord(this, newMap);
}, Record.prototype.wasAltered = function() {
return this._map.wasAltered();
}, Record.prototype.__iterator = function(type, reverse) {
var this$0 = this;
return KeyedIterable(this._defaultValues).map(function(_, k) {
return this$0.get(k);
}).__iterator(type, reverse);
}, Record.prototype.__iterate = function(fn, reverse) {
var this$0 = this;
return KeyedIterable(this._defaultValues).map(function(_, k) {
return this$0.get(k);
}).__iterate(fn, reverse);
}, Record.prototype.__ensureOwner = function(ownerID) {
if (ownerID === this.__ownerID) return this;
var newMap = this._map && this._map.__ensureOwner(ownerID);
return ownerID ? makeRecord(this, newMap, ownerID) : (this.__ownerID = ownerID,
this._map = newMap, this);
};
var RecordPrototype = Record.prototype;
RecordPrototype[DELETE] = RecordPrototype.remove, RecordPrototype.deleteIn = RecordPrototype.removeIn = MapPrototype.removeIn,
RecordPrototype.merge = MapPrototype.merge, RecordPrototype.mergeWith = MapPrototype.mergeWith,
RecordPrototype.mergeIn = MapPrototype.mergeIn, RecordPrototype.mergeDeep = MapPrototype.mergeDeep,
RecordPrototype.mergeDeepWith = MapPrototype.mergeDeepWith, RecordPrototype.mergeDeepIn = MapPrototype.mergeDeepIn,
RecordPrototype.setIn = MapPrototype.setIn, RecordPrototype.update = MapPrototype.update,
RecordPrototype.updateIn = MapPrototype.updateIn, RecordPrototype.withMutations = MapPrototype.withMutations,
RecordPrototype.asMutable = MapPrototype.asMutable, RecordPrototype.asImmutable = MapPrototype.asImmutable,
createClass(Set, SetCollection), Set.of = function() {
return this(arguments);
}, Set.fromKeys = function(value) {
return this(KeyedIterable(value).keySeq());
}, Set.prototype.toString = function() {
return this.__toString("Set {", "}");
}, // @pragma Access
Set.prototype.has = function(value) {
return this._map.has(value);
}, // @pragma Modification
Set.prototype.add = function(value) {
return updateSet(this, this._map.set(value, !0));
}, Set.prototype.remove = function(value) {
return updateSet(this, this._map.remove(value));
}, Set.prototype.clear = function() {
return updateSet(this, this._map.clear());
}, // @pragma Composition
Set.prototype.union = function() {
var iters = SLICE$0.call(arguments, 0);
return iters = iters.filter(function(x) {
return 0 !== x.size;
}), 0 === iters.length ? this : 0 !== this.size || this.__ownerID || 1 !== iters.length ? this.withMutations(function(set) {
for (var ii = 0; ii < iters.length; ii++) SetIterable(iters[ii]).forEach(function(value) {
return set.add(value);
});
}) : this.constructor(iters[0]);
}, Set.prototype.intersect = function() {
var iters = SLICE$0.call(arguments, 0);
if (0 === iters.length) return this;
iters = iters.map(function(iter) {
return SetIterable(iter);
});
var originalSet = this;
return this.withMutations(function(set) {
originalSet.forEach(function(value) {
iters.every(function(iter) {
return iter.includes(value);
}) || set.remove(value);
});
});
}, Set.prototype.subtract = function() {
var iters = SLICE$0.call(arguments, 0);
if (0 === iters.length) return this;
iters = iters.map(function(iter) {
return SetIterable(iter);
});
var originalSet = this;
return this.withMutations(function(set) {
originalSet.forEach(function(value) {
iters.some(function(iter) {
return iter.includes(value);
}) && set.remove(value);
});
});
}, Set.prototype.merge = function() {
return this.union.apply(this, arguments);
}, Set.prototype.mergeWith = function(merger) {
var iters = SLICE$0.call(arguments, 1);
return this.union.apply(this, iters);
}, Set.prototype.sort = function(comparator) {
// Late binding
return OrderedSet(sortFactory(this, comparator));
}, Set.prototype.sortBy = function(mapper, comparator) {
// Late binding
return OrderedSet(sortFactory(this, comparator, mapper));
}, Set.prototype.wasAltered = function() {
return this._map.wasAltered();
}, Set.prototype.__iterate = function(fn, reverse) {
var this$0 = this;
return this._map.__iterate(function(_, k) {
return fn(k, k, this$0);
}, reverse);
}, Set.prototype.__iterator = function(type, reverse) {
return this._map.map(function(_, k) {
return k;
}).__iterator(type, reverse);
}, Set.prototype.__ensureOwner = function(ownerID) {
if (ownerID === this.__ownerID) return this;
var newMap = this._map.__ensureOwner(ownerID);
return ownerID ? this.__make(newMap, ownerID) : (this.__ownerID = ownerID, this._map = newMap,
this);
}, Set.isSet = isSet;
var IS_SET_SENTINEL = "@@__IMMUTABLE_SET__@@", SetPrototype = Set.prototype;
SetPrototype[IS_SET_SENTINEL] = !0, SetPrototype[DELETE] = SetPrototype.remove,
SetPrototype.mergeDeep = SetPrototype.merge, SetPrototype.mergeDeepWith = SetPrototype.mergeWith,
SetPrototype.withMutations = MapPrototype.withMutations, SetPrototype.asMutable = MapPrototype.asMutable,
SetPrototype.asImmutable = MapPrototype.asImmutable, SetPrototype.__empty = emptySet,
SetPrototype.__make = makeSet;
var EMPTY_SET;
createClass(OrderedSet, Set), OrderedSet.of = function() {
return this(arguments);
}, OrderedSet.fromKeys = function(value) {
return this(KeyedIterable(value).keySeq());
}, OrderedSet.prototype.toString = function() {
return this.__toString("OrderedSet {", "}");
}, OrderedSet.isOrderedSet = isOrderedSet;
var OrderedSetPrototype = OrderedSet.prototype;
OrderedSetPrototype[IS_ORDERED_SENTINEL] = !0, OrderedSetPrototype.__empty = emptyOrderedSet,
OrderedSetPrototype.__make = makeOrderedSet;
var EMPTY_ORDERED_SET;
createClass(Stack, IndexedCollection), Stack.of = function() {
return this(arguments);
}, Stack.prototype.toString = function() {
return this.__toString("Stack [", "]");
}, // @pragma Access
Stack.prototype.get = function(index, notSetValue) {
var head = this._head;
for (index = wrapIndex(this, index); head && index--; ) head = head.next;
return head ? head.value : notSetValue;
}, Stack.prototype.peek = function() {
return this._head && this._head.value;
}, // @pragma Modification
Stack.prototype.push = function() {
if (0 === arguments.length) return this;
for (var newSize = this.size + arguments.length, head = this._head, ii = arguments.length - 1; ii >= 0; ii--) head = {
value: arguments[ii],
next: head
};
return this.__ownerID ? (this.size = newSize, this._head = head, this.__hash = void 0,
this.__altered = !0, this) : makeStack(newSize, head);
}, Stack.prototype.pushAll = function(iter) {
if (iter = IndexedIterable(iter), 0 === iter.size) return this;
assertNotInfinite(iter.size);
var newSize = this.size, head = this._head;
return iter.reverse().forEach(function(value) {
newSize++, head = {
value: value,
next: head
};
}), this.__ownerID ? (this.size = newSize, this._head = head, this.__hash = void 0,
this.__altered = !0, this) : makeStack(newSize, head);
}, Stack.prototype.pop = function() {
return this.slice(1);
}, Stack.prototype.unshift = function() {
return this.push.apply(this, arguments);
}, Stack.prototype.unshiftAll = function(iter) {
return this.pushAll(iter);
}, Stack.prototype.shift = function() {
return this.pop.apply(this, arguments);
}, Stack.prototype.clear = function() {
return 0 === this.size ? this : this.__ownerID ? (this.size = 0, this._head = void 0,
this.__hash = void 0, this.__altered = !0, this) : emptyStack();
}, Stack.prototype.slice = function(begin, end) {
if (wholeSlice(begin, end, this.size)) return this;
var resolvedBegin = resolveBegin(begin, this.size), resolvedEnd = resolveEnd(end, this.size);
if (resolvedEnd !== this.size) // super.slice(begin, end);
return IndexedCollection.prototype.slice.call(this, begin, end);
for (var newSize = this.size - resolvedBegin, head = this._head; resolvedBegin--; ) head = head.next;
return this.__ownerID ? (this.size = newSize, this._head = head, this.__hash = void 0,
this.__altered = !0, this) : makeStack(newSize, head);
}, // @pragma Mutability
Stack.prototype.__ensureOwner = function(ownerID) {
return ownerID === this.__ownerID ? this : ownerID ? makeStack(this.size, this._head, ownerID, this.__hash) : (this.__ownerID = ownerID,
this.__altered = !1, this);
}, // @pragma Iteration
Stack.prototype.__iterate = function(fn, reverse) {
if (reverse) return this.reverse().__iterate(fn);
for (var iterations = 0, node = this._head; node && fn(node.value, iterations++, this) !== !1; ) node = node.next;
return iterations;
}, Stack.prototype.__iterator = function(type, reverse) {
if (reverse) return this.reverse().__iterator(type);
var iterations = 0, node = this._head;
return new Iterator(function() {
if (node) {
var value = node.value;
return node = node.next, iteratorValue(type, iterations++, value);
}
return iteratorDone();
});
}, Stack.isStack = isStack;
var IS_STACK_SENTINEL = "@@__IMMUTABLE_STACK__@@", StackPrototype = Stack.prototype;
StackPrototype[IS_STACK_SENTINEL] = !0, StackPrototype.withMutations = MapPrototype.withMutations,
StackPrototype.asMutable = MapPrototype.asMutable, StackPrototype.asImmutable = MapPrototype.asImmutable,
StackPrototype.wasAltered = MapPrototype.wasAltered;
var EMPTY_STACK;
Iterable.Iterator = Iterator, mixin(Iterable, {
// ### Conversion to other types
toArray: function() {
assertNotInfinite(this.size);
var array = new Array(this.size || 0);
return this.valueSeq().__iterate(function(v, i) {
array[i] = v;
}), array;
},
toIndexedSeq: function() {
return new ToIndexedSequence(this);
},
toJS: function() {
return this.toSeq().map(function(value) {
return value && "function" == typeof value.toJS ? value.toJS() : value;
}).__toJS();
},
toJSON: function() {
return this.toSeq().map(function(value) {
return value && "function" == typeof value.toJSON ? value.toJSON() : value;
}).__toJS();
},
toKeyedSeq: function() {
return new ToKeyedSequence(this, !0);
},
toMap: function() {
// Use Late Binding here to solve the circular dependency.
return Map(this.toKeyedSeq());
},
toObject: function() {
assertNotInfinite(this.size);
var object = {};
return this.__iterate(function(v, k) {
object[k] = v;
}), object;
},
toOrderedMap: function() {
// Use Late Binding here to solve the circular dependency.
return OrderedMap(this.toKeyedSeq());
},
toOrderedSet: function() {
// Use Late Binding here to solve the circular dependency.
return OrderedSet(isKeyed(this) ? this.valueSeq() : this);
},
toSet: function() {
// Use Late Binding here to solve the circular dependency.
return Set(isKeyed(this) ? this.valueSeq() : this);
},
toSetSeq: function() {
return new ToSetSequence(this);
},
toSeq: function() {
return isIndexed(this) ? this.toIndexedSeq() : isKeyed(this) ? this.toKeyedSeq() : this.toSetSeq();
},
toStack: function() {
// Use Late Binding here to solve the circular dependency.
return Stack(isKeyed(this) ? this.valueSeq() : this);
},
toList: function() {
// Use Late Binding here to solve the circular dependency.
return List(isKeyed(this) ? this.valueSeq() : this);
},
// ### Common JavaScript methods and properties
toString: function() {
return "[Iterable]";
},
__toString: function(head, tail) {
return 0 === this.size ? head + tail : head + " " + this.toSeq().map(this.__toStringMapper).join(", ") + " " + tail;
},
// ### ES6 Collection methods (ES6 Array and Map)
concat: function() {
var values = SLICE$0.call(arguments, 0);
return reify(this, concatFactory(this, values));
},
includes: function(searchValue) {
return this.some(function(value) {
return is(value, searchValue);
});
},
entries: function() {
return this.__iterator(ITERATE_ENTRIES);
},
every: function(predicate, context) {
assertNotInfinite(this.size);
var returnValue = !0;
return this.__iterate(function(v, k, c) {
if (!predicate.call(context, v, k, c)) return returnValue = !1, !1;
}), returnValue;
},
filter: function(predicate, context) {
return reify(this, filterFactory(this, predicate, context, !0));
},
find: function(predicate, context, notSetValue) {
var entry = this.findEntry(predicate, context);
return entry ? entry[1] : notSetValue;
},
findEntry: function(predicate, context) {
var found;
return this.__iterate(function(v, k, c) {
if (predicate.call(context, v, k, c)) return found = [ k, v ], !1;
}), found;
},
findLastEntry: function(predicate, context) {
return this.toSeq().reverse().findEntry(predicate, context);
},
forEach: function(sideEffect, context) {
return assertNotInfinite(this.size), this.__iterate(context ? sideEffect.bind(context) : sideEffect);
},
join: function(separator) {
assertNotInfinite(this.size), separator = void 0 !== separator ? "" + separator : ",";
var joined = "", isFirst = !0;
return this.__iterate(function(v) {
isFirst ? isFirst = !1 : joined += separator, joined += null !== v && void 0 !== v ? v.toString() : "";
}), joined;
},
keys: function() {
return this.__iterator(ITERATE_KEYS);
},
map: function(mapper, context) {
return reify(this, mapFactory(this, mapper, context));
},
reduce: function(reducer, initialReduction, context) {
assertNotInfinite(this.size);
var reduction, useFirst;
return arguments.length < 2 ? useFirst = !0 : reduction = initialReduction, this.__iterate(function(v, k, c) {
useFirst ? (useFirst = !1, reduction = v) : reduction = reducer.call(context, reduction, v, k, c);
}), reduction;
},
reduceRight: function(reducer, initialReduction, context) {
var reversed = this.toKeyedSeq().reverse();
return reversed.reduce.apply(reversed, arguments);
},
reverse: function() {
return reify(this, reverseFactory(this, !0));
},
slice: function(begin, end) {
return reify(this, sliceFactory(this, begin, end, !0));
},
some: function(predicate, context) {
return !this.every(not(predicate), context);
},
sort: function(comparator) {
return reify(this, sortFactory(this, comparator));
},
values: function() {
return this.__iterator(ITERATE_VALUES);
},
// ### More sequential methods
butLast: function() {
return this.slice(0, -1);
},
isEmpty: function() {
return void 0 !== this.size ? 0 === this.size : !this.some(function() {
return !0;
});
},
count: function(predicate, context) {
return ensureSize(predicate ? this.toSeq().filter(predicate, context) : this);
},
countBy: function(grouper, context) {
return countByFactory(this, grouper, context);
},
equals: function(other) {
return deepEqual(this, other);
},
entrySeq: function() {
var iterable = this;
if (iterable._cache) // We cache as an entries array, so we can just return the cache!
return new ArraySeq(iterable._cache);
var entriesSequence = iterable.toSeq().map(entryMapper).toIndexedSeq();
return entriesSequence.fromEntrySeq = function() {
return iterable.toSeq();
}, entriesSequence;
},
filterNot: function(predicate, context) {
return this.filter(not(predicate), context);
},
findLast: function(predicate, context, notSetValue) {
return this.toKeyedSeq().reverse().find(predicate, context, notSetValue);
},
first: function() {
return this.find(returnTrue);
},
flatMap: function(mapper, context) {
return reify(this, flatMapFactory(this, mapper, context));
},
flatten: function(depth) {
return reify(this, flattenFactory(this, depth, !0));
},
fromEntrySeq: function() {
return new FromEntriesSequence(this);
},
get: function(searchKey, notSetValue) {
return this.find(function(_, key) {
return is(key, searchKey);
}, void 0, notSetValue);
},
getIn: function(searchKeyPath, notSetValue) {
for (var step, nested = this, iter = forceIterator(searchKeyPath); !(step = iter.next()).done; ) {
var key = step.value;
if (nested = nested && nested.get ? nested.get(key, NOT_SET) : NOT_SET, nested === NOT_SET) return notSetValue;
}
return nested;
},
groupBy: function(grouper, context) {
return groupByFactory(this, grouper, context);
},
has: function(searchKey) {
return this.get(searchKey, NOT_SET) !== NOT_SET;
},
hasIn: function(searchKeyPath) {
return this.getIn(searchKeyPath, NOT_SET) !== NOT_SET;
},
isSubset: function(iter) {
return iter = "function" == typeof iter.includes ? iter : Iterable(iter), this.every(function(value) {
return iter.includes(value);
});
},
isSuperset: function(iter) {
return iter = "function" == typeof iter.isSubset ? iter : Iterable(iter), iter.isSubset(this);
},
keySeq: function() {
return this.toSeq().map(keyMapper).toIndexedSeq();
},
last: function() {
return this.toSeq().reverse().first();
},
max: function(comparator) {
return maxFactory(this, comparator);
},
maxBy: function(mapper, comparator) {
return maxFactory(this, comparator, mapper);
},
min: function(comparator) {
return maxFactory(this, comparator ? neg(comparator) : defaultNegComparator);
},
minBy: function(mapper, comparator) {
return maxFactory(this, comparator ? neg(comparator) : defaultNegComparator, mapper);
},
rest: function() {
return this.slice(1);
},
skip: function(amount) {
return this.slice(Math.max(0, amount));
},
skipLast: function(amount) {
return reify(this, this.toSeq().reverse().skip(amount).reverse());
},
skipWhile: function(predicate, context) {
return reify(this, skipWhileFactory(this, predicate, context, !0));
},
skipUntil: function(predicate, context) {
return this.skipWhile(not(predicate), context);
},
sortBy: function(mapper, comparator) {
return reify(this, sortFactory(this, comparator, mapper));
},
take: function(amount) {
return this.slice(0, Math.max(0, amount));
},
takeLast: function(amount) {
return reify(this, this.toSeq().reverse().take(amount).reverse());
},
takeWhile: function(predicate, context) {
return reify(this, takeWhileFactory(this, predicate, context));
},
takeUntil: function(predicate, context) {
return this.takeWhile(not(predicate), context);
},
valueSeq: function() {
return this.toIndexedSeq();
},
// ### Hashable Object
hashCode: function() {
return this.__hash || (this.__hash = hashIterable(this));
}
});
// var IS_ITERABLE_SENTINEL = '@@__IMMUTABLE_ITERABLE__@@';
// var IS_KEYED_SENTINEL = '@@__IMMUTABLE_KEYED__@@';
// var IS_INDEXED_SENTINEL = '@@__IMMUTABLE_INDEXED__@@';
// var IS_ORDERED_SENTINEL = '@@__IMMUTABLE_ORDERED__@@';
var IterablePrototype = Iterable.prototype;
IterablePrototype[IS_ITERABLE_SENTINEL] = !0, IterablePrototype[ITERATOR_SYMBOL] = IterablePrototype.values,
IterablePrototype.__toJS = IterablePrototype.toArray, IterablePrototype.__toStringMapper = quoteString,
IterablePrototype.inspect = IterablePrototype.toSource = function() {
return this.toString();
}, IterablePrototype.chain = IterablePrototype.flatMap, IterablePrototype.contains = IterablePrototype.includes,
// Temporary warning about using length
function() {
try {
Object.defineProperty(IterablePrototype, "length", {
get: function() {
if (!Iterable.noLengthWarning) {
var stack;
try {
throw new Error();
} catch (error) {
stack = error.stack;
}
if (stack.indexOf("_wrapObject") === -1) return console && console.warn && console.warn("iterable.length has been deprecated, use iterable.size or iterable.count(). This warning will become a silent error in a future version. " + stack),
this.size;
}
}
});
} catch (e) {}
}(), mixin(KeyedIterable, {
// ### More sequential methods
flip: function() {
return reify(this, flipFactory(this));
},
findKey: function(predicate, context) {
var entry = this.findEntry(predicate, context);
return entry && entry[0];
},
findLastKey: function(predicate, context) {
return this.toSeq().reverse().findKey(predicate, context);
},
keyOf: function(searchValue) {
return this.findKey(function(value) {
return is(value, searchValue);
});
},
lastKeyOf: function(searchValue) {
return this.findLastKey(function(value) {
return is(value, searchValue);
});
},
mapEntries: function(mapper, context) {
var this$0 = this, iterations = 0;
return reify(this, this.toSeq().map(function(v, k) {
return mapper.call(context, [ k, v ], iterations++, this$0);
}).fromEntrySeq());
},
mapKeys: function(mapper, context) {
var this$0 = this;
return reify(this, this.toSeq().flip().map(function(k, v) {
return mapper.call(context, k, v, this$0);
}).flip());
}
});
var KeyedIterablePrototype = KeyedIterable.prototype;
KeyedIterablePrototype[IS_KEYED_SENTINEL] = !0, KeyedIterablePrototype[ITERATOR_SYMBOL] = IterablePrototype.entries,
KeyedIterablePrototype.__toJS = IterablePrototype.toObject, KeyedIterablePrototype.__toStringMapper = function(v, k) {
return JSON.stringify(k) + ": " + quoteString(v);
}, mixin(IndexedIterable, {
// ### Conversion to other types
toKeyedSeq: function() {
return new ToKeyedSequence(this, !1);
},
// ### ES6 Collection methods (ES6 Array and Map)
filter: function(predicate, context) {
return reify(this, filterFactory(this, predicate, context, !1));
},
findIndex: function(predicate, context) {
var entry = this.findEntry(predicate, context);
return entry ? entry[0] : -1;
},
indexOf: function(searchValue) {
var key = this.toKeyedSeq().keyOf(searchValue);
return void 0 === key ? -1 : key;
},
lastIndexOf: function(searchValue) {
var key = this.toKeyedSeq().reverse().keyOf(searchValue);
return void 0 === key ? -1 : key;
},
reverse: function() {
return reify(this, reverseFactory(this, !1));
},
slice: function(begin, end) {
return reify(this, sliceFactory(this, begin, end, !1));
},
splice: function(index, removeNum) {
var numArgs = arguments.length;
if (removeNum = Math.max(0 | removeNum, 0), 0 === numArgs || 2 === numArgs && !removeNum) return this;
// If index is negative, it should resolve relative to the size of the
// collection. However size may be expensive to compute if not cached, so
// only call count() if the number is in fact negative.
index = resolveBegin(index, index < 0 ? this.count() : this.size);
var spliced = this.slice(0, index);
return reify(this, 1 === numArgs ? spliced : spliced.concat(arrCopy(arguments, 2), this.slice(index + removeNum)));
},
// ### More collection methods
findLastIndex: function(predicate, context) {
var key = this.toKeyedSeq().findLastKey(predicate, context);
return void 0 === key ? -1 : key;
},
first: function() {
return this.get(0);
},
flatten: function(depth) {
return reify(this, flattenFactory(this, depth, !1));
},
get: function(index, notSetValue) {
return index = wrapIndex(this, index), index < 0 || this.size === 1 / 0 || void 0 !== this.size && index > this.size ? notSetValue : this.find(function(_, key) {
return key === index;
}, void 0, notSetValue);
},
has: function(index) {
return index = wrapIndex(this, index), index >= 0 && (void 0 !== this.size ? this.size === 1 / 0 || index < this.size : this.indexOf(index) !== -1);
},
interpose: function(separator) {
return reify(this, interposeFactory(this, separator));
},
interleave: function() {
var iterables = [ this ].concat(arrCopy(arguments)), zipped = zipWithFactory(this.toSeq(), IndexedSeq.of, iterables), interleaved = zipped.flatten(!0);
return zipped.size && (interleaved.size = zipped.size * iterables.length), reify(this, interleaved);
},
last: function() {
return this.get(-1);
},
skipWhile: function(predicate, context) {
return reify(this, skipWhileFactory(this, predicate, context, !1));
},
zip: function() {
var iterables = [ this ].concat(arrCopy(arguments));
return reify(this, zipWithFactory(this, defaultZipper, iterables));
},
zipWith: function(zipper) {
var iterables = arrCopy(arguments);
return iterables[0] = this, reify(this, zipWithFactory(this, zipper, iterables));
}
}), IndexedIterable.prototype[IS_INDEXED_SENTINEL] = !0, IndexedIterable.prototype[IS_ORDERED_SENTINEL] = !0,
mixin(SetIterable, {
// ### ES6 Collection methods (ES6 Array and Map)
get: function(value, notSetValue) {
return this.has(value) ? value : notSetValue;
},
includes: function(value) {
return this.has(value);
},
// ### More sequential methods
keySeq: function() {
return this.valueSeq();
}
}), SetIterable.prototype.has = IterablePrototype.includes, // Mixin subclasses
mixin(KeyedSeq, KeyedIterable.prototype), mixin(IndexedSeq, IndexedIterable.prototype),
mixin(SetSeq, SetIterable.prototype), mixin(KeyedCollection, KeyedIterable.prototype),
mixin(IndexedCollection, IndexedIterable.prototype), mixin(SetCollection, SetIterable.prototype);
var Immutable = {
Iterable: Iterable,
Seq: Seq,
Collection: Collection,
Map: Map,
OrderedMap: OrderedMap,
List: List,
Stack: Stack,
Set: Set,
OrderedSet: OrderedSet,
Record: Record,
Range: Range,
Repeat: Repeat,
is: is,
fromJS: fromJS
};
return Immutable;
});
}, /* 6 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule CharacterMetadata
* @typechecks
*
*/
"use strict";
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 || "object" != typeof call && "function" != typeof call ? self : call;
}
function _inherits(subClass, superClass) {
if ("function" != typeof superClass && null !== superClass) 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: !1,
writable: !0,
configurable: !0
}
}), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass);
}
var _require = __webpack_require__(5), Map = _require.Map, OrderedSet = _require.OrderedSet, Record = _require.Record, EMPTY_SET = OrderedSet(), defaultRecord = {
style: EMPTY_SET,
entity: null
}, CharacterMetadataRecord = Record(defaultRecord), CharacterMetadata = function(_CharacterMetadataRec) {
function CharacterMetadata() {
return _classCallCheck(this, CharacterMetadata), _possibleConstructorReturn(this, _CharacterMetadataRec.apply(this, arguments));
}
/**
* Use this function instead of the `CharacterMetadata` constructor.
* Since most content generally uses only a very small number of
* style/entity permutations, we can reuse these objects as often as
* possible.
*/
return _inherits(CharacterMetadata, _CharacterMetadataRec), CharacterMetadata.prototype.getStyle = function() {
return this.get("style");
}, CharacterMetadata.prototype.getEntity = function() {
return this.get("entity");
}, CharacterMetadata.prototype.hasStyle = function(style) {
return this.getStyle().has(style);
}, CharacterMetadata.applyStyle = function(record, style) {
var withStyle = record.set("style", record.getStyle().add(style));
return CharacterMetadata.create(withStyle);
}, CharacterMetadata.removeStyle = function(record, style) {
var withoutStyle = record.set("style", record.getStyle().remove(style));
return CharacterMetadata.create(withoutStyle);
}, CharacterMetadata.applyEntity = function(record, entityKey) {
var withEntity = record.getEntity() === entityKey ? record : record.set("entity", entityKey);
return CharacterMetadata.create(withEntity);
}, CharacterMetadata.create = function(config) {
if (!config) return EMPTY;
// Fill in unspecified properties, if necessary.
var configMap = Map({
style: EMPTY_SET,
entity: null
}).merge(config), existing = pool.get(configMap);
if (existing) return existing;
var newCharacter = new CharacterMetadata(configMap);
return pool = pool.set(configMap, newCharacter), newCharacter;
}, CharacterMetadata;
}(CharacterMetadataRecord), EMPTY = new CharacterMetadata(), pool = Map([ [ Map(defaultRecord), EMPTY ] ]);
CharacterMetadata.EMPTY = EMPTY, module.exports = CharacterMetadata;
}, /* 7 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule ContentBlock
*
*/
"use strict";
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 || "object" != typeof call && "function" != typeof call ? self : call;
}
function _inherits(subClass, superClass) {
if ("function" != typeof superClass && null !== superClass) 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: !1,
writable: !0,
configurable: !0
}
}), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass);
}
function haveEqualStyle(charA, charB) {
return charA.getStyle() === charB.getStyle();
}
function haveEqualEntity(charA, charB) {
return charA.getEntity() === charB.getEntity();
}
var Immutable = __webpack_require__(5), findRangesImmutable = __webpack_require__(8), List = Immutable.List, Map = Immutable.Map, OrderedSet = Immutable.OrderedSet, Record = Immutable.Record, EMPTY_SET = OrderedSet(), defaultRecord = {
key: "",
type: "unstyled",
text: "",
characterList: List(),
depth: 0,
data: Map()
}, ContentBlockRecord = Record(defaultRecord), ContentBlock = function(_ContentBlockRecord) {
function ContentBlock() {
return _classCallCheck(this, ContentBlock), _possibleConstructorReturn(this, _ContentBlockRecord.apply(this, arguments));
}
/**
* Execute a callback for every contiguous range of styles within the block.
*/
/**
* Execute a callback for every contiguous range of entities within the block.
*/
return _inherits(ContentBlock, _ContentBlockRecord), ContentBlock.prototype.getKey = function() {
return this.get("key");
}, ContentBlock.prototype.getType = function() {
return this.get("type");
}, ContentBlock.prototype.getText = function() {
return this.get("text");
}, ContentBlock.prototype.getCharacterList = function() {
return this.get("characterList");
}, ContentBlock.prototype.getLength = function() {
return this.getText().length;
}, ContentBlock.prototype.getDepth = function() {
return this.get("depth");
}, ContentBlock.prototype.getData = function() {
return this.get("data");
}, ContentBlock.prototype.getInlineStyleAt = function(offset) {
var character = this.getCharacterList().get(offset);
return character ? character.getStyle() : EMPTY_SET;
}, ContentBlock.prototype.getEntityAt = function(offset) {
var character = this.getCharacterList().get(offset);
return character ? character.getEntity() : null;
}, ContentBlock.prototype.findStyleRanges = function(filterFn, callback) {
findRangesImmutable(this.getCharacterList(), haveEqualStyle, filterFn, callback);
}, ContentBlock.prototype.findEntityRanges = function(filterFn, callback) {
findRangesImmutable(this.getCharacterList(), haveEqualEntity, filterFn, callback);
}, ContentBlock;
}(ContentBlockRecord);
module.exports = ContentBlock;
}, /* 8 */
/***/
function(module, exports) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule findRangesImmutable
*
*/
"use strict";
/**
* Search through an array to find contiguous stretches of elements that
* match a specified filter function.
*
* When ranges are found, execute a specified `found` function to supply
* the values to the caller.
*/
function findRangesImmutable(haystack, areEqualFn, filterFn, foundFn) {
if (haystack.size) {
var cursor = 0;
haystack.reduce(function(value, nextValue, nextIndex) {
/* $FlowFixMe(>=0.28.0): `value` could be undefined! */
/* $FlowFixMe(>=0.28.0): `value` could be undefined! */
return areEqualFn(value, nextValue) || (filterFn(value) && foundFn(cursor, nextIndex),
cursor = nextIndex), nextValue;
}), filterFn(haystack.last()) && foundFn(cursor, haystack.count());
}
}
module.exports = findRangesImmutable;
}, /* 9 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule DraftModifier
* @typechecks
*
*/
"use strict";
var CharacterMetadata = __webpack_require__(6), ContentStateInlineStyle = __webpack_require__(10), Immutable = __webpack_require__(5), applyEntityToContentState = __webpack_require__(11), getCharacterRemovalRange = __webpack_require__(13), getContentStateFragment = __webpack_require__(20), insertFragmentIntoContentState = __webpack_require__(23), insertTextIntoContentState = __webpack_require__(25), invariant = __webpack_require__(17), modifyBlockForContentState = __webpack_require__(26), removeEntitiesAtEdges = __webpack_require__(22), removeRangeFromContentState = __webpack_require__(27), splitBlockInContentState = __webpack_require__(28), OrderedSet = Immutable.OrderedSet, DraftModifier = {
replaceText: function(contentState, rangeToReplace, text, inlineStyle, entityKey) {
var withoutEntities = removeEntitiesAtEdges(contentState, rangeToReplace), withoutText = removeRangeFromContentState(withoutEntities, rangeToReplace), character = CharacterMetadata.create({
style: inlineStyle || OrderedSet(),
entity: entityKey || null
});
return insertTextIntoContentState(withoutText, withoutText.getSelectionAfter(), text, character);
},
insertText: function(contentState, targetRange, text, inlineStyle, entityKey) {
return targetRange.isCollapsed() ? void 0 : invariant(!1), DraftModifier.replaceText(contentState, targetRange, text, inlineStyle, entityKey);
},
moveText: function(contentState, removalRange, targetRange) {
var movedFragment = getContentStateFragment(contentState, removalRange), afterRemoval = DraftModifier.removeRange(contentState, removalRange, "backward");
return DraftModifier.replaceWithFragment(afterRemoval, targetRange, movedFragment);
},
replaceWithFragment: function(contentState, targetRange, fragment) {
var withoutEntities = removeEntitiesAtEdges(contentState, targetRange), withoutText = removeRangeFromContentState(withoutEntities, targetRange);
return insertFragmentIntoContentState(withoutText, withoutText.getSelectionAfter(), fragment);
},
removeRange: function(contentState, rangeToRemove, removalDirection) {
// Check whether the selection state overlaps with a single entity.
// If so, try to remove the appropriate substring of the entity text.
if (rangeToRemove.getAnchorKey() === rangeToRemove.getFocusKey()) {
var key = rangeToRemove.getAnchorKey(), startOffset = rangeToRemove.getStartOffset(), endOffset = rangeToRemove.getEndOffset(), block = contentState.getBlockForKey(key), startEntity = block.getEntityAt(startOffset), endEntity = block.getEntityAt(endOffset - 1);
if (startEntity && startEntity === endEntity) {
var adjustedRemovalRange = getCharacterRemovalRange(block, rangeToRemove, removalDirection);
return removeRangeFromContentState(contentState, adjustedRemovalRange);
}
}
var withoutEntities = removeEntitiesAtEdges(contentState, rangeToRemove);
return removeRangeFromContentState(withoutEntities, rangeToRemove);
},
splitBlock: function(contentState, selectionState) {
var withoutEntities = removeEntitiesAtEdges(contentState, selectionState), withoutText = removeRangeFromContentState(withoutEntities, selectionState);
return splitBlockInContentState(withoutText, withoutText.getSelectionAfter());
},
applyInlineStyle: function(contentState, selectionState, inlineStyle) {
return ContentStateInlineStyle.add(contentState, selectionState, inlineStyle);
},
removeInlineStyle: function(contentState, selectionState, inlineStyle) {
return ContentStateInlineStyle.remove(contentState, selectionState, inlineStyle);
},
setBlockType: function(contentState, selectionState, blockType) {
return modifyBlockForContentState(contentState, selectionState, function(block) {
return block.merge({
type: blockType,
depth: 0
});
});
},
setBlockData: function(contentState, selectionState, blockData) {
return modifyBlockForContentState(contentState, selectionState, function(block) {
return block.merge({
data: blockData
});
});
},
mergeBlockData: function(contentState, selectionState, blockData) {
return modifyBlockForContentState(contentState, selectionState, function(block) {
return block.merge({
data: block.getData().merge(blockData)
});
});
},
applyEntity: function(contentState, selectionState, entityKey) {
var withoutEntities = removeEntitiesAtEdges(contentState, selectionState);
return applyEntityToContentState(withoutEntities, selectionState, entityKey);
}
};
module.exports = DraftModifier;
}, /* 10 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule ContentStateInlineStyle
* @typechecks
*
*/
"use strict";
function modifyInlineStyle(contentState, selectionState, inlineStyle, addOrRemove) {
var blockMap = contentState.getBlockMap(), startKey = selectionState.getStartKey(), startOffset = selectionState.getStartOffset(), endKey = selectionState.getEndKey(), endOffset = selectionState.getEndOffset(), newBlocks = blockMap.skipUntil(function(_, k) {
return k === startKey;
}).takeUntil(function(_, k) {
return k === endKey;
}).concat(Map([ [ endKey, blockMap.get(endKey) ] ])).map(function(block, blockKey) {
var sliceStart, sliceEnd;
startKey === endKey ? (sliceStart = startOffset, sliceEnd = endOffset) : (sliceStart = blockKey === startKey ? startOffset : 0,
sliceEnd = blockKey === endKey ? endOffset : block.getLength());
for (var current, chars = block.getCharacterList(); sliceStart < sliceEnd; ) current = chars.get(sliceStart),
chars = chars.set(sliceStart, addOrRemove ? CharacterMetadata.applyStyle(current, inlineStyle) : CharacterMetadata.removeStyle(current, inlineStyle)),
sliceStart++;
return block.set("characterList", chars);
});
return contentState.merge({
blockMap: blockMap.merge(newBlocks),
selectionBefore: selectionState,
selectionAfter: selectionState
});
}
var CharacterMetadata = __webpack_require__(6), _require = __webpack_require__(5), Map = _require.Map, ContentStateInlineStyle = {
add: function(contentState, selectionState, inlineStyle) {
return modifyInlineStyle(contentState, selectionState, inlineStyle, !0);
},
remove: function(contentState, selectionState, inlineStyle) {
return modifyInlineStyle(contentState, selectionState, inlineStyle, !1);
}
};
module.exports = ContentStateInlineStyle;
}, /* 11 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule applyEntityToContentState
* @typechecks
*
*/
"use strict";
function applyEntityToContentState(contentState, selectionState, entityKey) {
var blockMap = contentState.getBlockMap(), startKey = selectionState.getStartKey(), startOffset = selectionState.getStartOffset(), endKey = selectionState.getEndKey(), endOffset = selectionState.getEndOffset(), newBlocks = blockMap.skipUntil(function(_, k) {
return k === startKey;
}).takeUntil(function(_, k) {
return k === endKey;
}).toOrderedMap().merge(Immutable.OrderedMap([ [ endKey, blockMap.get(endKey) ] ])).map(function(block, blockKey) {
var sliceStart = blockKey === startKey ? startOffset : 0, sliceEnd = blockKey === endKey ? endOffset : block.getLength();
return applyEntityToContentBlock(block, sliceStart, sliceEnd, entityKey);
});
return contentState.merge({
blockMap: blockMap.merge(newBlocks),
selectionBefore: selectionState,
selectionAfter: selectionState
});
}
var Immutable = __webpack_require__(5), applyEntityToContentBlock = __webpack_require__(12);
module.exports = applyEntityToContentState;
}, /* 12 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule applyEntityToContentBlock
* @typechecks
*
*/
"use strict";
function applyEntityToContentBlock(contentBlock, start, end, entityKey) {
for (var characterList = contentBlock.getCharacterList(); start < end; ) characterList = characterList.set(start, CharacterMetadata.applyEntity(characterList.get(start), entityKey)),
start++;
return contentBlock.set("characterList", characterList);
}
var CharacterMetadata = __webpack_require__(6);
module.exports = applyEntityToContentBlock;
}, /* 13 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule getCharacterRemovalRange
* @typechecks
*
*/
"use strict";
/**
* Given a SelectionState and a removal direction, determine the entire range
* that should be removed from a ContentState. This is based on any entities
* within the target, with their `mutability` values taken into account.
*
* For instance, if we are attempting to remove part of an "immutable" entity
* range, the entire entity must be removed. The returned `SelectionState`
* will be adjusted accordingly.
*/
function getCharacterRemovalRange(block, selectionState, direction) {
var start = selectionState.getStartOffset(), end = selectionState.getEndOffset(), entityKey = block.getEntityAt(start);
if (!entityKey) return selectionState;
var entity = DraftEntity.get(entityKey), mutability = entity.getMutability();
// `MUTABLE` entities can just have the specified range of text removed
// directly. No adjustments are needed.
if ("MUTABLE" === mutability) return selectionState;
// Find the entity range that overlaps with our removal range.
var entityRanges = getRangesForDraftEntity(block, entityKey).filter(function(range) {
return start < range.end && end > range.start;
});
1 != entityRanges.length ? invariant(!1) : void 0;
var entityRange = entityRanges[0];
// For `IMMUTABLE` entity types, we will remove the entire entity range.
if ("IMMUTABLE" === mutability) return selectionState.merge({
anchorOffset: entityRange.start,
focusOffset: entityRange.end,
isBackward: !1
});
// For `SEGMENTED` entity types, determine the appropriate segment to
// remove.
var removalRange = DraftEntitySegments.getRemovalRange(start, end, block.getText().slice(entityRange.start, entityRange.end), entityRange.start, direction);
return selectionState.merge({
anchorOffset: removalRange.start,
focusOffset: removalRange.end,
isBackward: !1
});
}
var DraftEntity = __webpack_require__(14), DraftEntitySegments = __webpack_require__(18), getRangesForDraftEntity = __webpack_require__(19), invariant = __webpack_require__(17);
module.exports = getCharacterRemovalRange;
}, /* 14 */
/***/
function(module, exports, __webpack_require__) {
"use strict";
var _assign = __webpack_require__(15), _extends = _assign || function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]);
}
return target;
}, DraftEntityInstance = __webpack_require__(16), Immutable = __webpack_require__(5), invariant = __webpack_require__(17), Map = Immutable.Map, instances = Map(), instanceKey = 0, DraftEntity = {
/**
* Create a DraftEntityInstance and store it for later retrieval.
*
* A random key string will be generated and returned. This key may
* be used to track the entity's usage in a ContentBlock, and for
* retrieving data about the entity at render time.
*/
create: function(type, mutability, data) {
return DraftEntity.add(new DraftEntityInstance({
type: type,
mutability: mutability,
data: data || {}
}));
},
/**
* Add an existing DraftEntityInstance to the DraftEntity map. This is
* useful when restoring instances from the server.
*/
add: function(instance) {
var key = "" + ++instanceKey;
return instances = instances.set(key, instance), key;
},
/**
* Retrieve the entity corresponding to the supplied key string.
*/
get: function(key) {
var instance = instances.get(key);
return instance ? void 0 : invariant(!1), instance;
},
/**
* Entity instances are immutable. If you need to update the data for an
* instance, this method will merge your data updates and return a new
* instance.
*/
mergeData: function(key, toMerge) {
var instance = DraftEntity.get(key), newData = _extends({}, instance.getData(), toMerge), newInstance = instance.set("data", newData);
return instances = instances.set(key, newInstance), newInstance;
},
/**
* Completely replace the data for a given instance.
*/
replaceData: function(key, newData) {
var instance = DraftEntity.get(key), newInstance = instance.set("data", newData);
return instances = instances.set(key, newInstance), newInstance;
}
};
module.exports = DraftEntity;
}, /* 15 */
/***/
function(module, exports) {
"use strict";
function toObject(val) {
if (null === val || void 0 === val) throw new TypeError("Object.assign cannot be called with null or undefined");
return Object(val);
}
function shouldUseNative() {
try {
if (!Object.assign) return !1;
// Detect buggy property enumeration order in older V8 versions.
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
var test1 = new String("abc");
if (// eslint-disable-line
test1[5] = "de", "5" === Object.getOwnPropertyNames(test1)[0]) return !1;
for (var test2 = {}, i = 0; i < 10; i++) test2["_" + String.fromCharCode(i)] = i;
var order2 = Object.getOwnPropertyNames(test2).map(function(n) {
return test2[n];
});
if ("0123456789" !== order2.join("")) return !1;
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
var test3 = {};
return "abcdefghijklmnopqrst".split("").forEach(function(letter) {
test3[letter] = letter;
}), "abcdefghijklmnopqrst" === Object.keys(Object.assign({}, test3)).join("");
} catch (e) {
// We don't expect any of the above to throw, but better to be safe.
return !1;
}
}
/* eslint-disable no-unused-vars */
var hasOwnProperty = Object.prototype.hasOwnProperty, propIsEnumerable = Object.prototype.propertyIsEnumerable;
module.exports = shouldUseNative() ? Object.assign : function(target, source) {
for (var from, symbols, to = toObject(target), s = 1; s < arguments.length; s++) {
from = Object(arguments[s]);
for (var key in from) hasOwnProperty.call(from, key) && (to[key] = from[key]);
if (Object.getOwnPropertySymbols) {
symbols = Object.getOwnPropertySymbols(from);
for (var i = 0; i < symbols.length; i++) propIsEnumerable.call(from, symbols[i]) && (to[symbols[i]] = from[symbols[i]]);
}
}
return to;
};
}, /* 16 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule DraftEntityInstance
*
*/
"use strict";
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 || "object" != typeof call && "function" != typeof call ? self : call;
}
function _inherits(subClass, superClass) {
if ("function" != typeof superClass && null !== superClass) 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: !1,
writable: !0,
configurable: !0
}
}), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass);
}
var Immutable = __webpack_require__(5), Record = Immutable.Record, DraftEntityInstanceRecord = Record({
type: "TOKEN",
mutability: "IMMUTABLE",
data: Object
}), DraftEntityInstance = function(_DraftEntityInstanceR) {
function DraftEntityInstance() {
return _classCallCheck(this, DraftEntityInstance), _possibleConstructorReturn(this, _DraftEntityInstanceR.apply(this, arguments));
}
return _inherits(DraftEntityInstance, _DraftEntityInstanceR), DraftEntityInstance.prototype.getType = function() {
return this.get("type");
}, DraftEntityInstance.prototype.getMutability = function() {
return this.get("mutability");
}, DraftEntityInstance.prototype.getData = function() {
return this.get("data");
}, DraftEntityInstance;
}(DraftEntityInstanceRecord);
module.exports = DraftEntityInstance;
}, /* 17 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
"use strict";
/**
* Use invariant() to assert state which your program assumes to be true.
*
* Provide sprintf-style format (only %s is supported) and arguments
* to provide information about what broke and what you were
* expecting.
*
* The invariant message will be stripped in production, but the invariant
* will remain to ensure logic does not differ in production.
*/
function invariant(condition, format, a, b, c, d, e, f) {
if (!condition) {
var error;
if (void 0 === format) 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 ], argIndex = 0;
error = new Error(format.replace(/%s/g, function() {
return args[argIndex++];
})), error.name = "Invariant Violation";
}
// we don't care about invariant's own frame
throw error.framesToPop = 1, error;
}
}
module.exports = invariant;
}, /* 18 */
/***/
function(module, exports) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule DraftEntitySegments
* @typechecks
*
*/
"use strict";
/**
* Identify the range to delete from a segmented entity.
*
* Rules:
*
* Example: 'John F. Kennedy'
*
* - Deletion from within any non-whitespace (i.e. ['John', 'F.', 'Kennedy'])
* will return the range of that text.
*
* 'John F. Kennedy' -> 'John F.'
* ^
*
* - Forward deletion of whitespace will remove the following section:
*
* 'John F. Kennedy' -> 'John Kennedy'
* ^
*
* - Backward deletion of whitespace will remove the previous section:
*
* 'John F. Kennedy' -> 'F. Kennedy'
* ^
*/
var DraftEntitySegments = {
getRemovalRange: function(selectionStart, selectionEnd, text, entityStart, direction) {
var segments = text.split(" ");
segments = segments.map(function(/*string*/ segment, /*number*/ ii) {
if ("forward" === direction) {
if (ii > 0) return " " + segment;
} else if (ii < segments.length - 1) return segment + " ";
return segment;
});
for (var segmentEnd, segment, segmentStart = entityStart, removalStart = null, removalEnd = null, jj = 0; jj < segments.length; jj++) {
// Our selection overlaps this segment.
if (segment = segments[jj], segmentEnd = segmentStart + segment.length, selectionStart < segmentEnd && segmentStart < selectionEnd) null !== removalStart ? removalEnd = segmentEnd : (removalStart = segmentStart,
removalEnd = segmentEnd); else if (null !== removalStart) break;
segmentStart = segmentEnd;
}
var entityEnd = entityStart + text.length, atStart = removalStart === entityStart, atEnd = removalEnd === entityEnd;
return (!atStart && atEnd || atStart && !atEnd) && ("forward" === direction ? removalEnd !== entityEnd && removalEnd++ : removalStart !== entityStart && removalStart--),
{
start: removalStart,
end: removalEnd
};
}
};
module.exports = DraftEntitySegments;
}, /* 19 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule getRangesForDraftEntity
* @typechecks
*
*/
"use strict";
/**
* Obtain the start and end positions of the range that has the
* specified entity applied to it.
*
* Entity keys are applied only to contiguous stretches of text, so this
* method searches for the first instance of the entity key and returns
* the subsequent range.
*/
function getRangesForDraftEntity(block, key) {
var ranges = [];
return block.findEntityRanges(function(c) {
return c.getEntity() === key;
}, function(start, end) {
ranges.push({
start: start,
end: end
});
}), ranges.length ? void 0 : invariant(!1), ranges;
}
var invariant = __webpack_require__(17);
module.exports = getRangesForDraftEntity;
}, /* 20 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule getContentStateFragment
* @typechecks
*
*/
"use strict";
function getContentStateFragment(contentState, selectionState) {
var startKey = selectionState.getStartKey(), startOffset = selectionState.getStartOffset(), endKey = selectionState.getEndKey(), endOffset = selectionState.getEndOffset(), contentWithoutEdgeEntities = removeEntitiesAtEdges(contentState, selectionState), blockMap = contentWithoutEdgeEntities.getBlockMap(), blockKeys = blockMap.keySeq(), startIndex = blockKeys.indexOf(startKey), endIndex = blockKeys.indexOf(endKey) + 1, slice = blockMap.slice(startIndex, endIndex).map(function(block, blockKey) {
var newKey = generateRandomKey(), text = block.getText(), chars = block.getCharacterList();
return startKey === endKey ? block.merge({
key: newKey,
text: text.slice(startOffset, endOffset),
characterList: chars.slice(startOffset, endOffset)
}) : blockKey === startKey ? block.merge({
key: newKey,
text: text.slice(startOffset),
characterList: chars.slice(startOffset)
}) : blockKey === endKey ? block.merge({
key: newKey,
text: text.slice(0, endOffset),
characterList: chars.slice(0, endOffset)
}) : block.set("key", newKey);
});
return slice.toOrderedMap();
}
var generateRandomKey = __webpack_require__(21), removeEntitiesAtEdges = __webpack_require__(22);
module.exports = getContentStateFragment;
}, /* 21 */
/***/
function(module, exports) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule generateRandomKey
* @typechecks
*
*/
"use strict";
function generateRandomKey() {
for (var key = void 0; void 0 === key || seenKeys.hasOwnProperty(key) || !isNaN(+key); ) key = Math.floor(Math.random() * MULTIPLIER).toString(32);
return seenKeys[key] = !0, key;
}
var seenKeys = {}, MULTIPLIER = Math.pow(2, 24);
module.exports = generateRandomKey;
}, /* 22 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule removeEntitiesAtEdges
*
*/
"use strict";
function removeEntitiesAtEdges(contentState, selectionState) {
var blockMap = contentState.getBlockMap(), updatedBlocks = {}, startKey = selectionState.getStartKey(), startOffset = selectionState.getStartOffset(), startBlock = blockMap.get(startKey), updatedStart = removeForBlock(startBlock, startOffset);
updatedStart !== startBlock && (updatedBlocks[startKey] = updatedStart);
var endKey = selectionState.getEndKey(), endOffset = selectionState.getEndOffset(), endBlock = blockMap.get(endKey);
startKey === endKey && (endBlock = updatedStart);
var updatedEnd = removeForBlock(endBlock, endOffset);
return updatedEnd !== endBlock && (updatedBlocks[endKey] = updatedEnd), Object.keys(updatedBlocks).length ? contentState.merge({
blockMap: blockMap.merge(updatedBlocks),
selectionAfter: selectionState
}) : contentState.set("selectionAfter", selectionState);
}
function getRemovalRange(characters, key, offset) {
var removalRange;
return findRangesImmutable(characters, function(a, b) {
return a.getEntity() === b.getEntity();
}, function(element) {
return element.getEntity() === key;
}, function(start, end) {
start <= offset && end >= offset && (removalRange = {
start: start,
end: end
});
}), "object" != typeof removalRange ? invariant(!1) : void 0, removalRange;
}
function removeForBlock(block, offset) {
var chars = block.getCharacterList(), charBefore = offset > 0 ? chars.get(offset - 1) : void 0, charAfter = offset < chars.count() ? chars.get(offset) : void 0, entityBeforeCursor = charBefore ? charBefore.getEntity() : void 0, entityAfterCursor = charAfter ? charAfter.getEntity() : void 0;
if (entityAfterCursor && entityAfterCursor === entityBeforeCursor) {
var entity = DraftEntity.get(entityAfterCursor);
if ("MUTABLE" !== entity.getMutability()) {
for (var current, _getRemovalRange = getRemovalRange(chars, entityAfterCursor, offset), start = _getRemovalRange.start, end = _getRemovalRange.end; start < end; ) current = chars.get(start),
chars = chars.set(start, CharacterMetadata.applyEntity(current, null)), start++;
return block.set("characterList", chars);
}
}
return block;
}
var CharacterMetadata = __webpack_require__(6), DraftEntity = __webpack_require__(14), findRangesImmutable = __webpack_require__(8), invariant = __webpack_require__(17);
module.exports = removeEntitiesAtEdges;
}, /* 23 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule insertFragmentIntoContentState
* @typechecks
*
*/
"use strict";
function insertFragmentIntoContentState(contentState, selectionState, fragment) {
selectionState.isCollapsed() ? void 0 : invariant(!1);
var finalKey, finalOffset, targetKey = selectionState.getStartKey(), targetOffset = selectionState.getStartOffset(), blockMap = contentState.getBlockMap(), fragmentSize = fragment.size;
if (1 === fragmentSize) {
var targetBlock = blockMap.get(targetKey), pastedBlock = fragment.first(), text = targetBlock.getText(), chars = targetBlock.getCharacterList(), newBlock = targetBlock.merge({
text: text.slice(0, targetOffset) + pastedBlock.getText() + text.slice(targetOffset),
characterList: insertIntoList(chars, pastedBlock.getCharacterList(), targetOffset),
data: pastedBlock.getData()
});
return blockMap = blockMap.set(targetKey, newBlock), finalKey = targetKey, finalOffset = targetOffset + pastedBlock.getText().length,
contentState.merge({
blockMap: blockMap.set(targetKey, newBlock),
selectionBefore: selectionState,
selectionAfter: selectionState.merge({
anchorKey: finalKey,
anchorOffset: finalOffset,
focusKey: finalKey,
focusOffset: finalOffset,
isBackward: !1
})
});
}
var newBlockArr = [];
return contentState.getBlockMap().forEach(function(block, blockKey) {
if (blockKey !== targetKey) return void newBlockArr.push(block);
var text = block.getText(), chars = block.getCharacterList(), blockSize = text.length, headText = text.slice(0, targetOffset), headCharacters = chars.slice(0, targetOffset), appendToHead = fragment.first(), modifiedHead = block.merge({
text: headText + appendToHead.getText(),
characterList: headCharacters.concat(appendToHead.getCharacterList()),
type: headText ? block.getType() : appendToHead.getType(),
data: appendToHead.getData()
});
newBlockArr.push(modifiedHead), // Insert fragment blocks after the head and before the tail.
fragment.slice(1, fragmentSize - 1).forEach(function(fragmentBlock) {
newBlockArr.push(fragmentBlock.set("key", generateRandomKey()));
});
// Modify tail portion of block.
var tailText = text.slice(targetOffset, blockSize), tailCharacters = chars.slice(targetOffset, blockSize), prependToTail = fragment.last();
finalKey = generateRandomKey();
var modifiedTail = prependToTail.merge({
key: finalKey,
text: prependToTail.getText() + tailText,
characterList: prependToTail.getCharacterList().concat(tailCharacters),
data: prependToTail.getData()
});
newBlockArr.push(modifiedTail);
}), finalOffset = fragment.last().getLength(), contentState.merge({
blockMap: BlockMapBuilder.createFromArray(newBlockArr),
selectionBefore: selectionState,
selectionAfter: selectionState.merge({
anchorKey: finalKey,
anchorOffset: finalOffset,
focusKey: finalKey,
focusOffset: finalOffset,
isBackward: !1
})
});
}
var BlockMapBuilder = __webpack_require__(4), generateRandomKey = __webpack_require__(21), insertIntoList = __webpack_require__(24), invariant = __webpack_require__(17);
module.exports = insertFragmentIntoContentState;
}, /* 24 */
/***/
function(module, exports) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule insertIntoList
*
*/
"use strict";
/**
* Maintain persistence for target list when appending and prepending.
*/
function insertIntoList(targetList, toInsert, offset) {
if (offset === targetList.count()) toInsert.forEach(function(c) {
targetList = targetList.push(c);
}); else if (0 === offset) toInsert.reverse().forEach(function(c) {
targetList = targetList.unshift(c);
}); else {
var head = targetList.slice(0, offset), tail = targetList.slice(offset);
targetList = head.concat(toInsert, tail).toList();
}
return targetList;
}
module.exports = insertIntoList;
}, /* 25 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule insertTextIntoContentState
* @typechecks
*
*/
"use strict";
function insertTextIntoContentState(contentState, selectionState, text, characterMetadata) {
selectionState.isCollapsed() ? void 0 : invariant(!1);
var len = text.length;
if (!len) return contentState;
var blockMap = contentState.getBlockMap(), key = selectionState.getStartKey(), offset = selectionState.getStartOffset(), block = blockMap.get(key), blockText = block.getText(), newBlock = block.merge({
text: blockText.slice(0, offset) + text + blockText.slice(offset, block.getLength()),
characterList: insertIntoList(block.getCharacterList(), Repeat(characterMetadata, len).toList(), offset)
}), newOffset = offset + len;
return contentState.merge({
blockMap: blockMap.set(key, newBlock),
selectionAfter: selectionState.merge({
anchorOffset: newOffset,
focusOffset: newOffset
})
});
}
var Immutable = __webpack_require__(5), insertIntoList = __webpack_require__(24), invariant = __webpack_require__(17), Repeat = Immutable.Repeat;
module.exports = insertTextIntoContentState;
}, /* 26 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule modifyBlockForContentState
* @typechecks
*
*/
"use strict";
function modifyBlockForContentState(contentState, selectionState, operation) {
var startKey = selectionState.getStartKey(), endKey = selectionState.getEndKey(), blockMap = contentState.getBlockMap(), newBlocks = blockMap.toSeq().skipUntil(function(_, k) {
return k === startKey;
}).takeUntil(function(_, k) {
return k === endKey;
}).concat(Map([ [ endKey, blockMap.get(endKey) ] ])).map(operation);
return contentState.merge({
blockMap: blockMap.merge(newBlocks),
selectionBefore: selectionState,
selectionAfter: selectionState
});
}
var Immutable = __webpack_require__(5), Map = Immutable.Map;
module.exports = modifyBlockForContentState;
}, /* 27 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule removeRangeFromContentState
*
*/
"use strict";
function removeRangeFromContentState(contentState, selectionState) {
if (selectionState.isCollapsed()) return contentState;
var characterList, blockMap = contentState.getBlockMap(), startKey = selectionState.getStartKey(), startOffset = selectionState.getStartOffset(), endKey = selectionState.getEndKey(), endOffset = selectionState.getEndOffset(), startBlock = blockMap.get(startKey), endBlock = blockMap.get(endKey);
characterList = startBlock === endBlock ? removeFromList(startBlock.getCharacterList(), startOffset, endOffset) : startBlock.getCharacterList().slice(0, startOffset).concat(endBlock.getCharacterList().slice(endOffset));
var modifiedStart = startBlock.merge({
text: startBlock.getText().slice(0, startOffset) + endBlock.getText().slice(endOffset),
characterList: characterList
}), newBlocks = blockMap.toSeq().skipUntil(function(_, k) {
return k === startKey;
}).takeUntil(function(_, k) {
return k === endKey;
}).concat(Immutable.Map([ [ endKey, null ] ])).map(function(_, k) {
return k === startKey ? modifiedStart : null;
});
return blockMap = blockMap.merge(newBlocks).filter(function(block) {
return !!block;
}), contentState.merge({
blockMap: blockMap,
selectionBefore: selectionState,
selectionAfter: selectionState.merge({
anchorKey: startKey,
anchorOffset: startOffset,
focusKey: startKey,
focusOffset: startOffset,
isBackward: !1
})
});
}
/**
* Maintain persistence for target list when removing characters on the
* head and tail of the character list.
*/
function removeFromList(targetList, startOffset, endOffset) {
if (0 === startOffset) for (;startOffset < endOffset; ) targetList = targetList.shift(),
startOffset++; else if (endOffset === targetList.count()) for (;endOffset > startOffset; ) targetList = targetList.pop(),
endOffset--; else {
var head = targetList.slice(0, startOffset), tail = targetList.slice(endOffset);
targetList = head.concat(tail).toList();
}
return targetList;
}
var Immutable = __webpack_require__(5);
module.exports = removeRangeFromContentState;
}, /* 28 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule splitBlockInContentState
* @typechecks
*
*/
"use strict";
function splitBlockInContentState(contentState, selectionState) {
selectionState.isCollapsed() ? void 0 : invariant(!1);
var key = selectionState.getAnchorKey(), offset = selectionState.getAnchorOffset(), blockMap = contentState.getBlockMap(), blockToSplit = blockMap.get(key), text = blockToSplit.getText(), chars = blockToSplit.getCharacterList(), blockAbove = blockToSplit.merge({
text: text.slice(0, offset),
characterList: chars.slice(0, offset)
}), keyBelow = generateRandomKey(), blockBelow = blockAbove.merge({
key: keyBelow,
text: text.slice(offset),
characterList: chars.slice(offset),
data: Map()
}), blocksBefore = blockMap.toSeq().takeUntil(function(v) {
return v === blockToSplit;
}), blocksAfter = blockMap.toSeq().skipUntil(function(v) {
return v === blockToSplit;
}).rest(), newBlocks = blocksBefore.concat([ [ blockAbove.getKey(), blockAbove ], [ blockBelow.getKey(), blockBelow ] ], blocksAfter).toOrderedMap();
return contentState.merge({
blockMap: newBlocks,
selectionBefore: selectionState,
selectionAfter: selectionState.merge({
anchorKey: keyBelow,
anchorOffset: 0,
focusKey: keyBelow,
focusOffset: 0,
isBackward: !1
})
});
}
var Immutable = __webpack_require__(5), generateRandomKey = __webpack_require__(21), invariant = __webpack_require__(17), Map = Immutable.Map;
module.exports = splitBlockInContentState;
}, /* 29 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule EditorState
*
*/
"use strict";
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
}
/**
* Set the supplied SelectionState as the new current selection, and set
* the `force` flag to trigger manual selection placement by the view.
*/
function updateSelection(editorState, selection, forceSelection) {
return EditorState.set(editorState, {
selection: selection,
forceSelection: forceSelection,
nativelyRenderedContent: null,
inlineStyleOverride: null
});
}
/**
* Regenerate the entire tree map for a given ContentState and decorator.
* Returns an OrderedMap that maps all available ContentBlock objects.
*/
function generateNewTreeMap(contentState, decorator) {
return contentState.getBlockMap().map(function(block) {
return BlockTree.generate(block, decorator);
}).toOrderedMap();
}
/**
* Regenerate tree map objects for all ContentBlocks that have changed
* between the current editorState and newContent. Returns an OrderedMap
* with only changed regenerated tree map objects.
*/
function regenerateTreeForNewBlocks(editorState, newBlockMap, decorator) {
var prevBlockMap = editorState.getCurrentContent().getBlockMap(), prevTreeMap = editorState.getImmutable().get("treeMap");
return prevTreeMap.merge(newBlockMap.toSeq().filter(function(block, key) {
return block !== prevBlockMap.get(key);
}).map(function(block) {
return BlockTree.generate(block, decorator);
}));
}
/**
* Generate tree map objects for a new decorator object, preserving any
* decorations that are unchanged from the previous decorator.
*
* Note that in order for this to perform optimally, decoration Lists for
* decorators should be preserved when possible to allow for direct immutable
* List comparison.
*/
function regenerateTreeForNewDecorator(blockMap, previousTreeMap, decorator, existingDecorator) {
return previousTreeMap.merge(blockMap.toSeq().filter(function(block) {
return decorator.getDecorations(block) !== existingDecorator.getDecorations(block);
}).map(function(block) {
return BlockTree.generate(block, decorator);
}));
}
/**
* Return whether a change should be considered a boundary state, given
* the previous change type. Allows us to discard potential boundary states
* during standard typing or deletion behavior.
*/
function mustBecomeBoundary(editorState, changeType) {
var lastChangeType = editorState.getLastChangeType();
return changeType !== lastChangeType || "insert-characters" !== changeType && "backspace-character" !== changeType && "delete-character" !== changeType;
}
function getInlineStyleForCollapsedSelection(content, selection) {
var startKey = selection.getStartKey(), startOffset = selection.getStartOffset(), startBlock = content.getBlockForKey(startKey);
// If the cursor is not at the start of the block, look backward to
// preserve the style of the preceding character.
// If the cursor is not at the start of the block, look backward to
// preserve the style of the preceding character.
// The caret is at position zero in this block. If the block has any
// text at all, use the style of the first character.
return startOffset > 0 ? startBlock.getInlineStyleAt(startOffset - 1) : startBlock.getLength() ? startBlock.getInlineStyleAt(0) : lookUpwardForInlineStyle(content, startKey);
}
function getInlineStyleForNonCollapsedSelection(content, selection) {
var startKey = selection.getStartKey(), startOffset = selection.getStartOffset(), startBlock = content.getBlockForKey(startKey);
// If there is a character just inside the selection, use its style.
// If there is a character just inside the selection, use its style.
// Check if the selection at the end of a non-empty block. Use the last
// style in the block.
return startOffset < startBlock.getLength() ? startBlock.getInlineStyleAt(startOffset) : startOffset > 0 ? startBlock.getInlineStyleAt(startOffset - 1) : lookUpwardForInlineStyle(content, startKey);
}
function lookUpwardForInlineStyle(content, fromKey) {
for (var previousLength, previousBlock = content.getBlockBefore(fromKey); previousBlock; ) {
if (previousLength = previousBlock.getLength()) return previousBlock.getInlineStyleAt(previousLength - 1);
previousBlock = content.getBlockBefore(previousBlock.getKey());
}
return OrderedSet();
}
var _assign = __webpack_require__(15), _extends = _assign || function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]);
}
return target;
}, BlockTree = __webpack_require__(30), ContentState = __webpack_require__(32), EditorBidiService = __webpack_require__(35), Immutable = __webpack_require__(5), SelectionState = __webpack_require__(33), OrderedSet = Immutable.OrderedSet, Record = Immutable.Record, Stack = Immutable.Stack, defaultRecord = {
allowUndo: !0,
currentContent: null,
decorator: null,
directionMap: null,
forceSelection: !1,
inCompositionMode: !1,
inlineStyleOverride: null,
lastChangeType: null,
nativelyRenderedContent: null,
redoStack: Stack(),
selection: null,
treeMap: null,
undoStack: Stack()
}, EditorStateRecord = Record(defaultRecord), EditorState = function() {
/**
* Not for public consumption.
*/
function EditorState(immutable) {
_classCallCheck(this, EditorState), this._immutable = immutable;
}
/**
* While editing, the user may apply inline style commands with a collapsed
* cursor, intending to type text that adopts the specified style. In this
* case, we track the specified style as an "override" that takes precedence
* over the inline style of the text adjacent to the cursor.
*
* If null, there is no override in place.
*/
/**
* Get the appropriate inline style for the editor state. If an
* override is in place, use it. Otherwise, the current style is
* based on the location of the selection state.
*/
/**
* Incorporate native DOM selection changes into the EditorState. This
* method can be used when we simply want to accept whatever the DOM
* has given us to represent selection, and we do not need to re-render
* the editor.
*
* To forcibly move the DOM selection, see `EditorState.forceSelection`.
*/
/**
* At times, we need to force the DOM selection to be where we
* need it to be. This can occur when the anchor or focus nodes
* are non-text nodes, for instance. In this case, we want to trigger
* a re-render of the editor, which in turn forces selection into
* the correct place in the DOM. The `forceSelection` method
* accomplishes this.
*
* This method should be used in cases where you need to explicitly
* move the DOM selection from one place to another without a change
* in ContentState.
*/
/**
* Move selection to the end of the editor without forcing focus.
*/
/**
* Force focus to the end of the editor. This is useful in scenarios
* where we want to programmatically focus the input and it makes sense
* to allow the user to continue working seamlessly.
*/
/**
* Push the current ContentState onto the undo stack if it should be
* considered a boundary state, and set the provided ContentState as the
* new current content.
*/
/**
* Make the top ContentState in the undo stack the new current content and
* push the current content onto the redo stack.
*/
/**
* Make the top ContentState in the redo stack the new current content and
* push the current content onto the undo stack.
*/
/**
* Not for public consumption.
*/
return EditorState.createEmpty = function(decorator) {
return EditorState.createWithContent(ContentState.createFromText(""), decorator);
}, EditorState.createWithContent = function(contentState, decorator) {
var firstKey = contentState.getBlockMap().first().getKey();
return EditorState.create({
currentContent: contentState,
undoStack: Stack(),
redoStack: Stack(),
decorator: decorator || null,
selection: SelectionState.createEmpty(firstKey)
});
}, EditorState.create = function(config) {
var currentContent = config.currentContent, decorator = config.decorator, recordConfig = _extends({}, config, {
treeMap: generateNewTreeMap(currentContent, decorator),
directionMap: EditorBidiService.getDirectionMap(currentContent)
});
return new EditorState(new EditorStateRecord(recordConfig));
}, EditorState.set = function(editorState, put) {
var map = editorState.getImmutable().withMutations(function(state) {
var existingDecorator = state.get("decorator"), decorator = existingDecorator;
null === put.decorator ? decorator = null : put.decorator && (decorator = put.decorator);
var newContent = put.currentContent || editorState.getCurrentContent();
if (decorator !== existingDecorator) {
var newTreeMap, treeMap = state.get("treeMap");
return newTreeMap = decorator && existingDecorator ? regenerateTreeForNewDecorator(newContent.getBlockMap(), treeMap, decorator, existingDecorator) : generateNewTreeMap(newContent, decorator),
void state.merge({
decorator: decorator,
treeMap: newTreeMap,
nativelyRenderedContent: null
});
}
var existingContent = editorState.getCurrentContent();
newContent !== existingContent && state.set("treeMap", regenerateTreeForNewBlocks(editorState, newContent.getBlockMap(), decorator)),
state.merge(put);
});
return new EditorState(map);
}, EditorState.prototype.toJS = function() {
return this.getImmutable().toJS();
}, EditorState.prototype.getAllowUndo = function() {
return this.getImmutable().get("allowUndo");
}, EditorState.prototype.getCurrentContent = function() {
return this.getImmutable().get("currentContent");
}, EditorState.prototype.getUndoStack = function() {
return this.getImmutable().get("undoStack");
}, EditorState.prototype.getRedoStack = function() {
return this.getImmutable().get("redoStack");
}, EditorState.prototype.getSelection = function() {
return this.getImmutable().get("selection");
}, EditorState.prototype.getDecorator = function() {
return this.getImmutable().get("decorator");
}, EditorState.prototype.isInCompositionMode = function() {
return this.getImmutable().get("inCompositionMode");
}, EditorState.prototype.mustForceSelection = function() {
return this.getImmutable().get("forceSelection");
}, EditorState.prototype.getNativelyRenderedContent = function() {
return this.getImmutable().get("nativelyRenderedContent");
}, EditorState.prototype.getLastChangeType = function() {
return this.getImmutable().get("lastChangeType");
}, EditorState.prototype.getInlineStyleOverride = function() {
return this.getImmutable().get("inlineStyleOverride");
}, EditorState.setInlineStyleOverride = function(editorState, inlineStyleOverride) {
return EditorState.set(editorState, {
inlineStyleOverride: inlineStyleOverride
});
}, EditorState.prototype.getCurrentInlineStyle = function() {
var override = this.getInlineStyleOverride();
if (null != override) return override;
var content = this.getCurrentContent(), selection = this.getSelection();
return selection.isCollapsed() ? getInlineStyleForCollapsedSelection(content, selection) : getInlineStyleForNonCollapsedSelection(content, selection);
}, EditorState.prototype.getBlockTree = function(blockKey) {
return this.getImmutable().getIn([ "treeMap", blockKey ]);
}, EditorState.prototype.isSelectionAtStartOfContent = function() {
var firstKey = this.getCurrentContent().getBlockMap().first().getKey();
return this.getSelection().hasEdgeWithin(firstKey, 0, 0);
}, EditorState.prototype.isSelectionAtEndOfContent = function() {
var content = this.getCurrentContent(), blockMap = content.getBlockMap(), last = blockMap.last(), end = last.getLength();
return this.getSelection().hasEdgeWithin(last.getKey(), end, end);
}, EditorState.prototype.getDirectionMap = function() {
return this.getImmutable().get("directionMap");
}, EditorState.acceptSelection = function(editorState, selection) {
return updateSelection(editorState, selection, !1);
}, EditorState.forceSelection = function(editorState, selection) {
return selection.getHasFocus() || (selection = selection.set("hasFocus", !0)), updateSelection(editorState, selection, !0);
}, EditorState.moveSelectionToEnd = function(editorState) {
var content = editorState.getCurrentContent(), lastBlock = content.getLastBlock(), lastKey = lastBlock.getKey(), length = lastBlock.getLength();
return EditorState.acceptSelection(editorState, new SelectionState({
anchorKey: lastKey,
anchorOffset: length,
focusKey: lastKey,
focusOffset: length,
isBackward: !1
}));
}, EditorState.moveFocusToEnd = function(editorState) {
var afterSelectionMove = EditorState.moveSelectionToEnd(editorState);
return EditorState.forceSelection(afterSelectionMove, afterSelectionMove.getSelection());
}, EditorState.push = function(editorState, contentState, changeType) {
if (editorState.getCurrentContent() === contentState) return editorState;
var forceSelection = "insert-characters" !== changeType, directionMap = EditorBidiService.getDirectionMap(contentState, editorState.getDirectionMap());
if (!editorState.getAllowUndo()) return EditorState.set(editorState, {
currentContent: contentState,
directionMap: directionMap,
lastChangeType: changeType,
selection: contentState.getSelectionAfter(),
forceSelection: forceSelection,
inlineStyleOverride: null
});
var selection = editorState.getSelection(), currentContent = editorState.getCurrentContent(), undoStack = editorState.getUndoStack(), newContent = contentState;
selection !== currentContent.getSelectionAfter() || mustBecomeBoundary(editorState, changeType) ? (undoStack = undoStack.push(currentContent),
newContent = newContent.set("selectionBefore", selection)) : "insert-characters" !== changeType && "backspace-character" !== changeType && "delete-character" !== changeType || (// Preserve the previous selection.
newContent = newContent.set("selectionBefore", currentContent.getSelectionBefore()));
var inlineStyleOverride = editorState.getInlineStyleOverride();
// Don't discard inline style overrides on block type or depth changes.
"adjust-depth" !== changeType && "change-block-type" !== changeType && (inlineStyleOverride = null);
var editorStateChanges = {
currentContent: newContent,
directionMap: directionMap,
undoStack: undoStack,
redoStack: Stack(),
lastChangeType: changeType,
selection: contentState.getSelectionAfter(),
forceSelection: forceSelection,
inlineStyleOverride: inlineStyleOverride
};
return EditorState.set(editorState, editorStateChanges);
}, EditorState.undo = function(editorState) {
if (!editorState.getAllowUndo()) return editorState;
var undoStack = editorState.getUndoStack(), newCurrentContent = undoStack.peek();
if (!newCurrentContent) return editorState;
var currentContent = editorState.getCurrentContent(), directionMap = EditorBidiService.getDirectionMap(newCurrentContent, editorState.getDirectionMap());
return EditorState.set(editorState, {
currentContent: newCurrentContent,
directionMap: directionMap,
undoStack: undoStack.shift(),
redoStack: editorState.getRedoStack().push(currentContent),
forceSelection: !0,
inlineStyleOverride: null,
lastChangeType: "undo",
nativelyRenderedContent: null,
selection: currentContent.getSelectionBefore()
});
}, EditorState.redo = function(editorState) {
if (!editorState.getAllowUndo()) return editorState;
var redoStack = editorState.getRedoStack(), newCurrentContent = redoStack.peek();
if (!newCurrentContent) return editorState;
var currentContent = editorState.getCurrentContent(), directionMap = EditorBidiService.getDirectionMap(newCurrentContent, editorState.getDirectionMap());
return EditorState.set(editorState, {
currentContent: newCurrentContent,
directionMap: directionMap,
undoStack: editorState.getUndoStack().push(currentContent),
redoStack: redoStack.shift(),
forceSelection: !0,
inlineStyleOverride: null,
lastChangeType: "redo",
nativelyRenderedContent: null,
selection: newCurrentContent.getSelectionAfter()
});
}, EditorState.prototype.getImmutable = function() {
return this._immutable;
}, EditorState;
}();
module.exports = EditorState;
}, /* 30 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule BlockTree
*
*/
"use strict";
/**
* Generate LeafRange records for a given character list.
*/
function generateLeaves(characters, offset) {
var leaves = [], inlineStyles = characters.map(function(c) {
return c.getStyle();
}).toList();
return findRangesImmutable(inlineStyles, areEqual, returnTrue, function(start, end) {
leaves.push(new LeafRange({
start: start + offset,
end: end + offset
}));
}), List(leaves);
}
function areEqual(a, b) {
return a === b;
}
var Immutable = __webpack_require__(5), emptyFunction = __webpack_require__(31), findRangesImmutable = __webpack_require__(8), List = Immutable.List, Repeat = Immutable.Repeat, Record = Immutable.Record, returnTrue = emptyFunction.thatReturnsTrue, FINGERPRINT_DELIMITER = "-", defaultLeafRange = {
start: null,
end: null
}, LeafRange = Record(defaultLeafRange), defaultDecoratorRange = {
start: null,
end: null,
decoratorKey: null,
leaves: null
}, DecoratorRange = Record(defaultDecoratorRange), BlockTree = {
/**
* Generate a block tree for a given ContentBlock/decorator pair.
*/
generate: function(block, decorator) {
var textLength = block.getLength();
if (!textLength) return List.of(new DecoratorRange({
start: 0,
end: 0,
decoratorKey: null,
leaves: List.of(new LeafRange({
start: 0,
end: 0
}))
}));
var leafSets = [], decorations = decorator ? decorator.getDecorations(block) : List(Repeat(null, textLength)), chars = block.getCharacterList();
return findRangesImmutable(decorations, areEqual, returnTrue, function(start, end) {
leafSets.push(new DecoratorRange({
start: start,
end: end,
decoratorKey: decorations.get(start),
leaves: generateLeaves(chars.slice(start, end).toList(), start)
}));
}), List(leafSets);
},
/**
* Create a string representation of the given tree map. This allows us
* to rapidly determine whether a tree has undergone a significant
* structural change.
*/
getFingerprint: function(tree) {
return tree.map(function(leafSet) {
var decoratorKey = leafSet.get("decoratorKey"), fingerprintString = null !== decoratorKey ? decoratorKey + "." + (leafSet.get("end") - leafSet.get("start")) : "";
return "" + fingerprintString + "." + leafSet.get("leaves").size;
}).join(FINGERPRINT_DELIMITER);
}
};
module.exports = BlockTree;
}, /* 31 */
/***/
function(module, exports) {
"use strict";
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
function makeEmptyFunction(arg) {
return function() {
return arg;
};
}
/**
* This function accepts and discards inputs; it has no side effects. This is
* primarily useful idiomatically for overridable function endpoints which
* always need to be callable, since JS lacks a null-call idiom ala Cocoa.
*/
var emptyFunction = function() {};
emptyFunction.thatReturns = makeEmptyFunction, emptyFunction.thatReturnsFalse = makeEmptyFunction(!1),
emptyFunction.thatReturnsTrue = makeEmptyFunction(!0), emptyFunction.thatReturnsNull = makeEmptyFunction(null),
emptyFunction.thatReturnsThis = function() {
return this;
}, emptyFunction.thatReturnsArgument = function(arg) {
return arg;
}, module.exports = emptyFunction;
}, /* 32 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule ContentState
* @typechecks
*
*/
"use strict";
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 || "object" != typeof call && "function" != typeof call ? self : call;
}
function _inherits(subClass, superClass) {
if ("function" != typeof superClass && null !== superClass) 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: !1,
writable: !0,
configurable: !0
}
}), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass);
}
var BlockMapBuilder = __webpack_require__(4), CharacterMetadata = __webpack_require__(6), ContentBlock = __webpack_require__(7), Immutable = __webpack_require__(5), SelectionState = __webpack_require__(33), generateRandomKey = __webpack_require__(21), sanitizeDraftText = __webpack_require__(34), List = Immutable.List, Record = Immutable.Record, Repeat = Immutable.Repeat, defaultRecord = {
blockMap: null,
selectionBefore: null,
selectionAfter: null
}, ContentStateRecord = Record(defaultRecord), ContentState = function(_ContentStateRecord) {
function ContentState() {
return _classCallCheck(this, ContentState), _possibleConstructorReturn(this, _ContentStateRecord.apply(this, arguments));
}
return _inherits(ContentState, _ContentStateRecord), ContentState.prototype.getBlockMap = function() {
return this.get("blockMap");
}, ContentState.prototype.getSelectionBefore = function() {
return this.get("selectionBefore");
}, ContentState.prototype.getSelectionAfter = function() {
return this.get("selectionAfter");
}, ContentState.prototype.getBlockForKey = function(key) {
var block = this.getBlockMap().get(key);
return block;
}, ContentState.prototype.getKeyBefore = function(key) {
return this.getBlockMap().reverse().keySeq().skipUntil(function(v) {
return v === key;
}).skip(1).first();
}, ContentState.prototype.getKeyAfter = function(key) {
return this.getBlockMap().keySeq().skipUntil(function(v) {
return v === key;
}).skip(1).first();
}, ContentState.prototype.getBlockAfter = function(key) {
return this.getBlockMap().skipUntil(function(_, k) {
return k === key;
}).skip(1).first();
}, ContentState.prototype.getBlockBefore = function(key) {
return this.getBlockMap().reverse().skipUntil(function(_, k) {
return k === key;
}).skip(1).first();
}, ContentState.prototype.getBlocksAsArray = function() {
return this.getBlockMap().toArray();
}, ContentState.prototype.getFirstBlock = function() {
return this.getBlockMap().first();
}, ContentState.prototype.getLastBlock = function() {
return this.getBlockMap().last();
}, ContentState.prototype.getPlainText = function(delimiter) {
return this.getBlockMap().map(function(block) {
return block ? block.getText() : "";
}).join(delimiter || "\n");
}, ContentState.prototype.hasText = function() {
var blockMap = this.getBlockMap();
return blockMap.size > 1 || blockMap.first().getLength() > 0;
}, ContentState.createFromBlockArray = function(blocks) {
var blockMap = BlockMapBuilder.createFromArray(blocks), selectionState = SelectionState.createEmpty(blockMap.first().getKey());
return new ContentState({
blockMap: blockMap,
selectionBefore: selectionState,
selectionAfter: selectionState
});
}, ContentState.createFromText = function(text) {
var delimiter = arguments.length <= 1 || void 0 === arguments[1] ? /\r\n?|\n/g : arguments[1], strings = text.split(delimiter), blocks = strings.map(function(block) {
return block = sanitizeDraftText(block), new ContentBlock({
key: generateRandomKey(),
text: block,
type: "unstyled",
characterList: List(Repeat(CharacterMetadata.EMPTY, block.length))
});
});
return ContentState.createFromBlockArray(blocks);
}, ContentState;
}(ContentStateRecord);
module.exports = ContentState;
}, /* 33 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule SelectionState
* @typechecks
*
*/
"use strict";
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 || "object" != typeof call && "function" != typeof call ? self : call;
}
function _inherits(subClass, superClass) {
if ("function" != typeof superClass && null !== superClass) 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: !1,
writable: !0,
configurable: !0
}
}), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass);
}
var Immutable = __webpack_require__(5), Record = Immutable.Record, defaultRecord = {
anchorKey: "",
anchorOffset: 0,
focusKey: "",
focusOffset: 0,
isBackward: !1,
hasFocus: !1
}, SelectionStateRecord = Record(defaultRecord), SelectionState = function(_SelectionStateRecord) {
function SelectionState() {
return _classCallCheck(this, SelectionState), _possibleConstructorReturn(this, _SelectionStateRecord.apply(this, arguments));
}
/**
* Return whether the specified range overlaps with an edge of the
* SelectionState.
*/
return _inherits(SelectionState, _SelectionStateRecord), SelectionState.prototype.serialize = function() {
return "Anchor: " + this.getAnchorKey() + ":" + this.getAnchorOffset() + ", Focus: " + this.getFocusKey() + ":" + this.getFocusOffset() + ", Is Backward: " + String(this.getIsBackward()) + ", Has Focus: " + String(this.getHasFocus());
}, SelectionState.prototype.getAnchorKey = function() {
return this.get("anchorKey");
}, SelectionState.prototype.getAnchorOffset = function() {
return this.get("anchorOffset");
}, SelectionState.prototype.getFocusKey = function() {
return this.get("focusKey");
}, SelectionState.prototype.getFocusOffset = function() {
return this.get("focusOffset");
}, SelectionState.prototype.getIsBackward = function() {
return this.get("isBackward");
}, SelectionState.prototype.getHasFocus = function() {
return this.get("hasFocus");
}, SelectionState.prototype.hasEdgeWithin = function(blockKey, start, end) {
var anchorKey = this.getAnchorKey(), focusKey = this.getFocusKey();
if (anchorKey === focusKey && anchorKey === blockKey) {
var selectionStart = this.getStartOffset(), selectionEnd = this.getEndOffset();
return start <= selectionEnd && selectionStart <= end;
}
if (blockKey !== anchorKey && blockKey !== focusKey) return !1;
var offsetToCheck = blockKey === anchorKey ? this.getAnchorOffset() : this.getFocusOffset();
return start <= offsetToCheck && end >= offsetToCheck;
}, SelectionState.prototype.isCollapsed = function() {
return this.getAnchorKey() === this.getFocusKey() && this.getAnchorOffset() === this.getFocusOffset();
}, SelectionState.prototype.getStartKey = function() {
return this.getIsBackward() ? this.getFocusKey() : this.getAnchorKey();
}, SelectionState.prototype.getStartOffset = function() {
return this.getIsBackward() ? this.getFocusOffset() : this.getAnchorOffset();
}, SelectionState.prototype.getEndKey = function() {
return this.getIsBackward() ? this.getAnchorKey() : this.getFocusKey();
}, SelectionState.prototype.getEndOffset = function() {
return this.getIsBackward() ? this.getAnchorOffset() : this.getFocusOffset();
}, SelectionState.createEmpty = function(key) {
return new SelectionState({
anchorKey: key,
anchorOffset: 0,
focusKey: key,
focusOffset: 0,
isBackward: !1,
hasFocus: !1
});
}, SelectionState;
}(SelectionStateRecord);
module.exports = SelectionState;
}, /* 34 */
/***/
function(module, exports) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule sanitizeDraftText
*
*/
"use strict";
function sanitizeDraftText(input) {
return input.replace(REGEX_BLOCK_DELIMITER, "");
}
var REGEX_BLOCK_DELIMITER = new RegExp("\r", "g");
module.exports = sanitizeDraftText;
}, /* 35 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule EditorBidiService
* @typechecks
*
*/
"use strict";
var bidiService, Immutable = __webpack_require__(5), UnicodeBidiService = __webpack_require__(36), nullthrows = __webpack_require__(39), OrderedMap = Immutable.OrderedMap, EditorBidiService = {
getDirectionMap: function(content, prevBidiMap) {
bidiService ? bidiService.reset() : bidiService = new UnicodeBidiService();
var blockMap = content.getBlockMap(), nextBidi = blockMap.valueSeq().map(function(block) {
return nullthrows(bidiService).getDirection(block.getText());
}), bidiMap = OrderedMap(blockMap.keySeq().zip(nextBidi));
return null != prevBidiMap && Immutable.is(prevBidiMap, bidiMap) ? prevBidiMap : bidiMap;
}
};
module.exports = EditorBidiService;
}, /* 36 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @typechecks
*
*/
/**
* Stateful API for text direction detection
*
* This class can be used in applications where you need to detect the
* direction of a sequence of text blocks, where each direction shall be used
* as the fallback direction for the next one.
*
* NOTE: A default direction, if not provided, is set based on the global
* direction, as defined by `UnicodeBidiDirection`.
*
* == Example ==
* ```
* var UnicodeBidiService = require('UnicodeBidiService');
*
* var bidiService = new UnicodeBidiService();
*
* ...
*
* bidiService.reset();
* for (var para in paragraphs) {
* var dir = bidiService.getDirection(para);
* ...
* }
* ```
*
* Part of our implementation of Unicode Bidirectional Algorithm (UBA)
* Unicode Standard Annex #9 (UAX9)
* http://www.unicode.org/reports/tr9/
*/
"use strict";
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
}
var UnicodeBidi = __webpack_require__(37), UnicodeBidiDirection = __webpack_require__(38), invariant = __webpack_require__(17), UnicodeBidiService = function() {
/**
* Stateful class for paragraph direction detection
*
* @param defaultDir Default direction of the service
*/
function UnicodeBidiService(defaultDir) {
_classCallCheck(this, UnicodeBidiService), defaultDir ? UnicodeBidiDirection.isStrong(defaultDir) ? void 0 : invariant(!1) : defaultDir = UnicodeBidiDirection.getGlobalDir(),
this._defaultDir = defaultDir, this.reset();
}
/**
* Reset the internal state
*
* Instead of creating a new instance, you can just reset() your instance
* everytime you start a new loop.
*/
/**
* Returns the direction of a block of text, and remembers it as the
* fall-back direction for the next paragraph.
*
* @param str A text block, e.g. paragraph, table cell, tag
* @return The resolved direction
*/
return UnicodeBidiService.prototype.reset = function() {
this._lastDir = this._defaultDir;
}, UnicodeBidiService.prototype.getDirection = function(str) {
return this._lastDir = UnicodeBidi.getDirection(str, this._lastDir), this._lastDir;
}, UnicodeBidiService;
}();
module.exports = UnicodeBidiService;
}, /* 37 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @typechecks
*
*/
/**
* Basic (stateless) API for text direction detection
*
* Part of our implementation of Unicode Bidirectional Algorithm (UBA)
* Unicode Standard Annex #9 (UAX9)
* http://www.unicode.org/reports/tr9/
*/
"use strict";
/**
* Returns the first strong character (has Bidi_Class value of L, R, or AL).
*
* @param str A text block; e.g. paragraph, table cell, tag
* @return A character with strong bidi direction, or null if not found
*/
function firstStrongChar(str) {
var match = REGEX_STRONG.exec(str);
return null == match ? null : match[0];
}
/**
* Returns the direction of a block of text, based on the direction of its
* first strong character (has Bidi_Class value of L, R, or AL).
*
* @param str A text block; e.g. paragraph, table cell, tag
* @return The resolved direction
*/
function firstStrongCharDir(str) {
var strongChar = firstStrongChar(str);
return null == strongChar ? UnicodeBidiDirection.NEUTRAL : REGEX_RTL.exec(strongChar) ? UnicodeBidiDirection.RTL : UnicodeBidiDirection.LTR;
}
/**
* Returns the direction of a block of text, based on the direction of its
* first strong character (has Bidi_Class value of L, R, or AL), or a fallback
* direction, if no strong character is found.
*
* This function is supposed to be used in respect to Higher-Level Protocol
* rule HL1. (http://www.unicode.org/reports/tr9/#HL1)
*
* @param str A text block; e.g. paragraph, table cell, tag
* @param fallback Fallback direction, used if no strong direction detected
* for the block (default = NEUTRAL)
* @return The resolved direction
*/
function resolveBlockDir(str, fallback) {
if (fallback = fallback || UnicodeBidiDirection.NEUTRAL, !str.length) return fallback;
var blockDir = firstStrongCharDir(str);
return blockDir === UnicodeBidiDirection.NEUTRAL ? fallback : blockDir;
}
/**
* Returns the direction of a block of text, based on the direction of its
* first strong character (has Bidi_Class value of L, R, or AL), or a fallback
* direction, if no strong character is found.
*
* NOTE: This function is similar to resolveBlockDir(), but uses the global
* direction as the fallback, so it *always* returns a Strong direction,
* making it useful for integration in places that you need to make the final
* decision, like setting some CSS class.
*
* This function is supposed to be used in respect to Higher-Level Protocol
* rule HL1. (http://www.unicode.org/reports/tr9/#HL1)
*
* @param str A text block; e.g. paragraph, table cell
* @param strongFallback Fallback direction, used if no strong direction
* detected for the block (default = global direction)
* @return The resolved Strong direction
*/
function getDirection(str, strongFallback) {
return strongFallback || (strongFallback = UnicodeBidiDirection.getGlobalDir()),
UnicodeBidiDirection.isStrong(strongFallback) ? void 0 : invariant(!1), resolveBlockDir(str, strongFallback);
}
/**
* Returns true if getDirection(arguments...) returns LTR.
*
* @param str A text block; e.g. paragraph, table cell
* @param strongFallback Fallback direction, used if no strong direction
* detected for the block (default = global direction)
* @return True if the resolved direction is LTR
*/
function isDirectionLTR(str, strongFallback) {
return getDirection(str, strongFallback) === UnicodeBidiDirection.LTR;
}
/**
* Returns true if getDirection(arguments...) returns RTL.
*
* @param str A text block; e.g. paragraph, table cell
* @param strongFallback Fallback direction, used if no strong direction
* detected for the block (default = global direction)
* @return True if the resolved direction is RTL
*/
function isDirectionRTL(str, strongFallback) {
return getDirection(str, strongFallback) === UnicodeBidiDirection.RTL;
}
var UnicodeBidiDirection = __webpack_require__(38), invariant = __webpack_require__(17), RANGE_BY_BIDI_TYPE = {
L: "A-Za-zªµºÀ-ÖØ-öø-ƺƻƼ-ƿǀ-ǃDŽ-ʓʔʕ-ʯʰ-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͷͺͻ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҂Ҋ-ԯԱ-Ֆՙ՚-՟ա-և։ःऄ-हऻऽा-ीॉ-ौॎ-ॏॐक़-ॡ।-॥०-९॰ॱॲ-ঀং-ঃঅ-ঌএ-ঐও-নপ-রলশ-হঽা-ীে-ৈো-ৌৎৗড়-ঢ়য়-ৡ০-৯ৰ-ৱ৴-৹৺ਃਅ-ਊਏ-ਐਓ-ਨਪ-ਰਲ-ਲ਼ਵ-ਸ਼ਸ-ਹਾ-ੀਖ਼-ੜਫ਼੦-੯ੲ-ੴઃઅ-ઍએ-ઑઓ-નપ-રલ-ળવ-હઽા-ીૉો-ૌૐૠ-ૡ૦-૯૰ଂ-ଃଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହଽାୀେ-ୈୋ-ୌୗଡ଼-ଢ଼ୟ-ୡ୦-୯୰ୱ୲-୷ஃஅ-ஊஎ-ஐஒ-கங-சஜஞ-டண-தந-பம-ஹா-ிு-ூெ-ைொ-ௌௐௗ௦-௯௰-௲ఁ-ఃఅ-ఌఎ-ఐఒ-నప-హఽు-ౄౘ-ౙౠ-ౡ౦-౯౿ಂ-ಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽಾಿೀ-ೄೆೇ-ೈೊ-ೋೕ-ೖೞೠ-ೡ೦-೯ೱ-ೲം-ഃഅ-ഌഎ-ഐഒ-ഺഽാ-ീെ-ൈൊ-ൌൎൗൠ-ൡ൦-൯൰-൵൹ൺ-ൿං-ඃඅ-ඖක-නඳ-රලව-ෆා-ෑෘ-ෟ෦-෯ෲ-ෳ෴ก-ะา-ำเ-ๅๆ๏๐-๙๚-๛ກ-ຂຄງ-ຈຊຍດ-ທນ-ຟມ-ຣລວສ-ຫອ-ະາ-ຳຽເ-ໄໆ໐-໙ໜ-ໟༀ༁-༃༄-༒༓༔༕-༗༚-༟༠-༩༪-༳༴༶༸༾-༿ཀ-ཇཉ-ཬཿ྅ྈ-ྌ྾-࿅࿇-࿌࿎-࿏࿐-࿔࿕-࿘࿙-࿚က-ဪါ-ာေးျ-ြဿ၀-၉၊-၏ၐ-ၕၖ-ၗၚ-ၝၡၢ-ၤၥ-ၦၧ-ၭၮ-ၰၵ-ႁႃ-ႄႇ-ႌႎႏ႐-႙ႚ-ႜ႞-႟Ⴀ-ჅჇჍა-ჺ჻ჼჽ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፠-፨፩-፼ᎀ-ᎏᎠ-Ᏼᐁ-ᙬ᙭-᙮ᙯ-ᙿᚁ-ᚚᚠ-ᛪ᛫-᛭ᛮ-ᛰᛱ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱ᜵-᜶ᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳាើ-ៅះ-ៈ។-៖ៗ៘-៚ៜ០-៩᠐-᠙ᠠ-ᡂᡃᡄ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᤣ-ᤦᤩ-ᤫᤰ-ᤱᤳ-ᤸ᥆-᥏ᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧀᧁ-ᧇᧈ-ᧉ᧐-᧙᧚ᨀ-ᨖᨙ-ᨚ᨞-᨟ᨠ-ᩔᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪉᪐-᪙᪠-᪦ᪧ᪨-᪭ᬄᬅ-ᬳᬵᬻᬽ-ᭁᭃ-᭄ᭅ-ᭋ᭐-᭙᭚-᭠᭡-᭪᭴-᭼ᮂᮃ-ᮠᮡᮦ-ᮧ᮪ᮮ-ᮯ᮰-᮹ᮺ-ᯥᯧᯪ-ᯬᯮ᯲-᯳᯼-᯿ᰀ-ᰣᰤ-ᰫᰴ-ᰵ᰻-᰿᱀-᱉ᱍ-ᱏ᱐-᱙ᱚ-ᱷᱸ-ᱽ᱾-᱿᳀-᳇᳓᳡ᳩ-ᳬᳮ-ᳱᳲ-ᳳᳵ-ᳶᴀ-ᴫᴬ-ᵪᵫ-ᵷᵸᵹ-ᶚᶛ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℴℵ-ℸℹℼ-ℿⅅ-ⅉⅎ⅏Ⅰ-ↂↃ-ↄↅ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-Ⱞⰰ-ⱞⱠ-ⱻⱼ-ⱽⱾ-ⳤⳫ-ⳮⳲ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵰ⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々〆〇〡-〩〮-〯〱-〵〸-〺〻〼ぁ-ゖゝ-ゞゟァ-ヺー-ヾヿㄅ-ㄭㄱ-ㆎ㆐-㆑㆒-㆕㆖-㆟ㆠ-ㆺㇰ-ㇿ㈀-㈜㈠-㈩㈪-㉇㉈-㉏㉠-㉻㉿㊀-㊉㊊-㊰㋀-㋋㋐-㋾㌀-㍶㍻-㏝㏠-㏾㐀-䶵一-鿌ꀀ-ꀔꀕꀖ-ꒌꓐ-ꓷꓸ-ꓽ꓾-꓿ꔀ-ꘋꘌꘐ-ꘟ꘠-꘩ꘪ-ꘫꙀ-ꙭꙮꚀ-ꚛꚜ-ꚝꚠ-ꛥꛦ-ꛯ꛲-꛷Ꜣ-ꝯꝰꝱ-ꞇ꞉-꞊Ꞌ-ꞎꞐ-ꞭꞰ-Ʇꟷꟸ-ꟹꟺꟻ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꠣ-ꠤꠧ꠰-꠵꠶-꠷ꡀ-ꡳꢀ-ꢁꢂ-ꢳꢴ-ꣃ꣎-꣏꣐-꣙ꣲ-ꣷ꣸-꣺ꣻ꤀-꤉ꤊ-ꤥ꤮-꤯ꤰ-ꥆꥒ-꥓꥟ꥠ-ꥼꦃꦄ-ꦲꦴ-ꦵꦺ-ꦻꦽ-꧀꧁-꧍ꧏ꧐-꧙꧞-꧟ꧠ-ꧤꧦꧧ-ꧯ꧰-꧹ꧺ-ꧾꨀ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ꩐-꩙꩜-꩟ꩠ-ꩯꩰꩱ-ꩶ꩷-꩹ꩺꩻꩽꩾ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂꫛ-ꫜꫝ꫞-꫟ꫠ-ꫪꫫꫮ-ꫯ꫰-꫱ꫲꫳ-ꫴꫵꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚ꭛ꭜ-ꭟꭤ-ꭥꯀ-ꯢꯣ-ꯤꯦ-ꯧꯩ-ꯪ꯫꯬꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ-豈-舘並-龎ff-stﬓ-ﬗA-Za-zヲ-ッーア-ン゙-゚ᅠ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",
R: "־׀׃׆-א-ת-ׯװ-ײ׳-״-߀-߉ߊ-ߪߴ-ߵߺ-߿ࠀ-ࠕࠚࠤࠨ-࠰-࠾ࡀ-ࡘ-࡞-࢟יִײַ-ﬨשׁ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﭏ",
AL: "؈؋؍؛؝؞-؟ؠ-ؿـف-ي٭ٮ-ٯٱ-ۓ۔ەۥ-ۦۮ-ۯۺ-ۼ۽-۾ۿ܀-܍ܐܒ-ܯ-ݍ-ޥޱ-ࢠ-ࢲࢳ-ࣣﭐ-ﮱ﮲-﯁﯂-ﯓ-ﴽ﵀-﵏ﵐ-ﶏ-ﶒ-ﷇ-﷏ﷰ-ﷻ﷼﷾-﷿ﹰ-ﹴﹶ-ﻼ-"
}, REGEX_STRONG = new RegExp("[" + RANGE_BY_BIDI_TYPE.L + RANGE_BY_BIDI_TYPE.R + RANGE_BY_BIDI_TYPE.AL + "]"), REGEX_RTL = new RegExp("[" + RANGE_BY_BIDI_TYPE.R + RANGE_BY_BIDI_TYPE.AL + "]"), UnicodeBidi = {
firstStrongChar: firstStrongChar,
firstStrongCharDir: firstStrongCharDir,
resolveBlockDir: resolveBlockDir,
getDirection: getDirection,
isDirectionLTR: isDirectionLTR,
isDirectionRTL: isDirectionRTL
};
module.exports = UnicodeBidi;
}, /* 38 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @typechecks
*
*/
/**
* Constants to represent text directionality
*
* Also defines a *global* direciton, to be used in bidi algorithms as a
* default fallback direciton, when no better direction is found or provided.
*
* NOTE: Use `setGlobalDir()`, or update `initGlobalDir()`, to set the initial
* global direction value based on the application.
*
* Part of the implementation of Unicode Bidirectional Algorithm (UBA)
* Unicode Standard Annex #9 (UAX9)
* http://www.unicode.org/reports/tr9/
*/
"use strict";
// == Helpers ==
/**
* Check if a directionality value is a Strong one
*/
function isStrong(dir) {
return dir === LTR || dir === RTL;
}
/**
* Get string value to be used for `dir` HTML attribute or `direction` CSS
* property.
*/
function getHTMLDir(dir) {
return isStrong(dir) ? void 0 : invariant(!1), dir === LTR ? "ltr" : "rtl";
}
/**
* Get string value to be used for `dir` HTML attribute or `direction` CSS
* property, but returns null if `dir` has same value as `otherDir`.
* `null`.
*/
function getHTMLDirIfDifferent(dir, otherDir) {
return isStrong(dir) ? void 0 : invariant(!1), isStrong(otherDir) ? void 0 : invariant(!1),
dir === otherDir ? null : getHTMLDir(dir);
}
// == Global Direction ==
/**
* Set the global direction.
*/
function setGlobalDir(dir) {
globalDir = dir;
}
/**
* Initialize the global direction
*/
function initGlobalDir() {
setGlobalDir(LTR);
}
/**
* Get the global direction
*/
function getGlobalDir() {
return globalDir || this.initGlobalDir(), globalDir ? void 0 : invariant(!1), globalDir;
}
var invariant = __webpack_require__(17), NEUTRAL = "NEUTRAL", LTR = "LTR", RTL = "RTL", globalDir = null, UnicodeBidiDirection = {
// Values
NEUTRAL: NEUTRAL,
LTR: LTR,
RTL: RTL,
// Helpers
isStrong: isStrong,
getHTMLDir: getHTMLDir,
getHTMLDirIfDifferent: getHTMLDirIfDifferent,
// Global Direction
setGlobalDir: setGlobalDir,
initGlobalDir: initGlobalDir,
getGlobalDir: getGlobalDir
};
module.exports = UnicodeBidiDirection;
}, /* 39 */
/***/
function(module, exports) {
"use strict";
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
var nullthrows = function(x) {
if (null != x) return x;
throw new Error("Got unexpected null or undefined");
};
module.exports = nullthrows;
}, /* 40 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule CompositeDraftDecorator
* @typechecks
*
*/
"use strict";
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
}
/**
* Determine whether we can occupy the specified slice of the decorations
* array.
*/
function canOccupySlice(decorations, start, end) {
for (var ii = start; ii < end; ii++) if (null != decorations[ii]) return !1;
return !0;
}
/**
* Splice the specified component into our decoration array at the desired
* range.
*/
function occupySlice(targetArr, start, end, componentKey) {
for (var ii = start; ii < end; ii++) targetArr[ii] = componentKey;
}
var Immutable = __webpack_require__(5), List = Immutable.List, DELIMITER = ".", CompositeDraftDecorator = function() {
function CompositeDraftDecorator(decorators) {
_classCallCheck(this, CompositeDraftDecorator), // Copy the decorator array, since we use this array order to determine
// precedence of decoration matching. If the array is mutated externally,
// we don't want to be affected here.
this._decorators = decorators.slice();
}
return CompositeDraftDecorator.prototype.getDecorations = function(block) {
var decorations = Array(block.getText().length).fill(null);
return this._decorators.forEach(function(/*object*/ decorator, /*number*/ ii) {
var counter = 0, strategy = decorator.strategy;
strategy(block, function(/*number*/ start, /*number*/ end) {
// Find out if any of our matching range is already occupied
// by another decorator. If so, discard the match. Otherwise, store
// the component key for rendering.
canOccupySlice(decorations, start, end) && (occupySlice(decorations, start, end, ii + DELIMITER + counter),
counter++);
});
}), List(decorations);
}, CompositeDraftDecorator.prototype.getComponentForKey = function(key) {
var componentKey = parseInt(key.split(DELIMITER)[0], 10);
return this._decorators[componentKey].component;
}, CompositeDraftDecorator.prototype.getPropsForKey = function(key) {
var componentKey = parseInt(key.split(DELIMITER)[0], 10);
return this._decorators[componentKey].props;
}, CompositeDraftDecorator;
}();
module.exports = CompositeDraftDecorator;
}, /* 41 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule DefaultDraftBlockRenderMap
*
*/
"use strict";
var _require = __webpack_require__(5), Map = _require.Map, React = __webpack_require__(1), cx = __webpack_require__(42), UL_WRAP = React.createElement("ul", {
className: cx("public/DraftStyleDefault/ul")
}), OL_WRAP = React.createElement("ol", {
className: cx("public/DraftStyleDefault/ol")
}), PRE_WRAP = React.createElement("pre", {
className: cx("public/DraftStyleDefault/pre")
});
module.exports = Map({
"header-one": {
element: "h1"
},
"header-two": {
element: "h2"
},
"header-three": {
element: "h3"
},
"header-four": {
element: "h4"
},
"header-five": {
element: "h5"
},
"header-six": {
element: "h6"
},
"unordered-list-item": {
element: "li",
wrapper: UL_WRAP
},
"ordered-list-item": {
element: "li",
wrapper: OL_WRAP
},
blockquote: {
element: "blockquote"
},
atomic: {
element: "figure"
},
"code-block": {
element: "pre",
wrapper: PRE_WRAP
},
unstyled: {
element: "div"
}
});
}, /* 42 */
/***/
function(module, exports) {
"use strict";
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
/**
* This function is used to mark string literals representing CSS class names
* so that they can be transformed statically. This allows for modularization
* and minification of CSS class names.
*
* In static_upstream, this function is actually implemented, but it should
* eventually be replaced with something more descriptive, and the transform
* that is used in the main stack should be ported for use elsewhere.
*
* @param string|object className to modularize, or an object of key/values.
* In the object case, the values are conditions that
* determine if the className keys should be included.
* @param [string ...] Variable list of classNames in the string case.
* @return string Renderable space-separated CSS className.
*/
function cx(classNames) {
return "object" == typeof classNames ? Object.keys(classNames).filter(function(className) {
return classNames[className];
}).map(replace).join(" ") : Array.prototype.map.call(arguments, replace).join(" ");
}
function replace(str) {
return str.replace(/\//g, "-");
}
module.exports = cx;
}, /* 43 */
/***/
function(module, exports) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule DefaultDraftInlineStyle
*
*/
"use strict";
module.exports = {
BOLD: {
fontWeight: "bold"
},
CODE: {
fontFamily: "monospace",
wordWrap: "break-word"
},
ITALIC: {
fontStyle: "italic"
},
STRIKETHROUGH: {
textDecoration: "line-through"
},
UNDERLINE: {
textDecoration: "underline"
}
};
}, /* 44 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule DraftEditor.react
* @typechecks
*
*/
"use strict";
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 || "object" != typeof call && "function" != typeof call ? self : call;
}
function _inherits(subClass, superClass) {
if ("function" != typeof superClass && null !== superClass) 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: !1,
writable: !0,
configurable: !0
}
}), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass);
}
var _assign = __webpack_require__(15), _extends = _assign || function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]);
}
return target;
}, DefaultDraftBlockRenderMap = __webpack_require__(41), DefaultDraftInlineStyle = __webpack_require__(43), DraftEditorCompositionHandler = __webpack_require__(45), DraftEditorContents = __webpack_require__(49), DraftEditorDragHandler = __webpack_require__(79), DraftEditorEditHandler = __webpack_require__(88), DraftEditorPlaceholder = __webpack_require__(129), EditorState = __webpack_require__(29), React = __webpack_require__(1), ReactDOM = __webpack_require__(53), Scroll = __webpack_require__(67), Style = __webpack_require__(68), UserAgent = __webpack_require__(54), cx = __webpack_require__(42), emptyFunction = __webpack_require__(31), generateRandomKey = __webpack_require__(21), getDefaultKeyBinding = __webpack_require__(130), nullthrows = __webpack_require__(39), getScrollPosition = __webpack_require__(74), isIE = UserAgent.isBrowser("IE"), allowSpellCheck = !isIE, handlerMap = {
edit: DraftEditorEditHandler,
composite: DraftEditorCompositionHandler,
drag: DraftEditorDragHandler,
cut: null,
render: null
}, DraftEditor = function(_React$Component) {
function DraftEditor(props) {
_classCallCheck(this, DraftEditor);
var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));
// Manual binding for public and internal methods.
// See `_restoreEditorDOM()`.
return _this._blockSelectEvents = !1, _this._clipboard = null, _this._guardAgainstRender = !1,
_this._handler = null, _this._dragCount = 0, _this._editorKey = generateRandomKey(),
_this._placeholderAccessibilityID = "placeholder-" + _this._editorKey, _this._onBeforeInput = _this._buildHandler("onBeforeInput"),
_this._onBlur = _this._buildHandler("onBlur"), _this._onCharacterData = _this._buildHandler("onCharacterData"),
_this._onCompositionEnd = _this._buildHandler("onCompositionEnd"), _this._onCompositionStart = _this._buildHandler("onCompositionStart"),
_this._onCopy = _this._buildHandler("onCopy"), _this._onCut = _this._buildHandler("onCut"),
_this._onDragEnd = _this._buildHandler("onDragEnd"), _this._onDragOver = _this._buildHandler("onDragOver"),
_this._onDragStart = _this._buildHandler("onDragStart"), _this._onDrop = _this._buildHandler("onDrop"),
_this._onInput = _this._buildHandler("onInput"), _this._onFocus = _this._buildHandler("onFocus"),
_this._onKeyDown = _this._buildHandler("onKeyDown"), _this._onKeyPress = _this._buildHandler("onKeyPress"),
_this._onKeyUp = _this._buildHandler("onKeyUp"), _this._onMouseDown = _this._buildHandler("onMouseDown"),
_this._onMouseUp = _this._buildHandler("onMouseUp"), _this._onPaste = _this._buildHandler("onPaste"),
_this._onSelect = _this._buildHandler("onSelect"), _this.focus = _this._focus.bind(_this),
_this.blur = _this._blur.bind(_this), _this.setMode = _this._setMode.bind(_this),
_this.exitCurrentMode = _this._exitCurrentMode.bind(_this), _this.restoreEditorDOM = _this._restoreEditorDOM.bind(_this),
_this.setRenderGuard = _this._setRenderGuard.bind(_this), _this.removeRenderGuard = _this._removeRenderGuard.bind(_this),
_this.setClipboard = _this._setClipboard.bind(_this), _this.getClipboard = _this._getClipboard.bind(_this),
_this.getEditorKey = function() {
return _this._editorKey;
}, _this.update = _this._update.bind(_this), _this.onDragEnter = _this._onDragEnter.bind(_this),
_this.onDragLeave = _this._onDragLeave.bind(_this), _this.state = {
containerKey: 0
}, _this;
}
/**
* Build a method that will pass the event to the specified handler method.
* This allows us to look up the correct handler function for the current
* editor mode, if any has been specified.
*/
/**
* Define proxies that can route events to the current handler.
*/
/**
* Prevent selection events from affecting the current editor state. This
* is mostly intended to defend against IE, which fires off `selectionchange`
* events regardless of whether the selection is set via the browser or
* programmatically. We only care about selection events that occur because
* of browser interaction, not re-renders and forced selections.
*/
/**
* Used via `this.focus()`.
*
* Force focus back onto the editor node.
*
* Forcing focus causes the browser to scroll to the top of the editor, which
* may be undesirable when the editor is taller than the viewport. To solve
* this, either use a specified scroll position (in cases like `cut` behavior
* where it should be restored to a known position) or store the current
* scroll state and put it back in place after focus has been forced.
*/
/**
* Used via `this.setMode(...)`.
*
* Set the behavior mode for the editor component. This switches the current
* handler module to ensure that DOM events are managed appropriately for
* the active mode.
*/
/**
* Used via `this.restoreEditorDOM()`.
*
* Force a complete re-render of the editor based on the current EditorState.
* This is useful when we know we are going to lose control of the DOM
* state (cut command, IME) and we want to make sure that reconciliation
* occurs on a version of the DOM that is synchronized with our EditorState.
*/
/**
* Guard against rendering. Intended for use when we need to manually
* reset editor contents, to ensure that no outside influences lead to
* React reconciliation when we are in an uncertain state.
*/
/**
* Used via `this.setClipboard(...)`.
*
* Set the clipboard state for a cut/copy event.
*/
/**
* Used via `this.getClipboard()`.
*
* Retrieve the clipboard state for a cut/copy event.
*/
/**
* Used via `this.update(...)`.
*
* Propagate a new `EditorState` object to higher-level components. This is
* the method by which event handlers inform the `DraftEditor` component of
* state changes. A component that composes a `DraftEditor` **must** provide
* an `onChange` prop to receive state updates passed along from this
* function.
*/
/**
* Used in conjunction with `_onDragLeave()`, by counting the number of times
* a dragged element enters and leaves the editor (or any of its children),
* to determine when the dragged element absolutely leaves the editor.
*/
/**
* See `_onDragEnter()`.
*/
return _inherits(DraftEditor, _React$Component), DraftEditor.prototype._buildHandler = function(eventName) {
var _this2 = this;
return function(e) {
if (!_this2.props.readOnly) {
var method = _this2._handler && _this2._handler[eventName];
method && method.call(_this2, e);
}
};
}, DraftEditor.prototype._showPlaceholder = function() {
return !!this.props.placeholder && !this.props.editorState.isInCompositionMode() && !this.props.editorState.getCurrentContent().hasText();
}, DraftEditor.prototype._renderPlaceholder = function() {
return this._showPlaceholder() ? React.createElement(DraftEditorPlaceholder, {
text: nullthrows(this.props.placeholder),
editorState: this.props.editorState,
textAlignment: this.props.textAlignment,
accessibilityID: this._placeholderAccessibilityID
}) : null;
}, DraftEditor.prototype.render = function() {
var _props = this.props, readOnly = _props.readOnly, textAlignment = _props.textAlignment, rootClass = cx({
"DraftEditor/root": !0,
"DraftEditor/alignLeft": "left" === textAlignment,
"DraftEditor/alignRight": "right" === textAlignment,
"DraftEditor/alignCenter": "center" === textAlignment
}), contentStyle = {
outline: "none",
whiteSpace: "pre-wrap",
wordWrap: "break-word"
};
return React.createElement("div", {
className: rootClass
}, this._renderPlaceholder(), React.createElement("div", {
className: cx("DraftEditor/editorContainer"),
key: "editor" + this.state.containerKey,
ref: "editorContainer"
}, React.createElement("div", {
"aria-activedescendant": readOnly ? null : this.props.ariaActiveDescendantID,
"aria-autocomplete": readOnly ? null : this.props.ariaAutoComplete,
"aria-describedby": this._showPlaceholder() ? this._placeholderAccessibilityID : null,
"aria-expanded": readOnly ? null : this.props.ariaExpanded,
"aria-haspopup": readOnly ? null : this.props.ariaHasPopup,
"aria-label": this.props.ariaLabel,
"aria-owns": readOnly ? null : this.props.ariaOwneeID,
className: cx("public/DraftEditor/content"),
contentEditable: !readOnly,
"data-testid": this.props.webDriverTestID,
onBeforeInput: this._onBeforeInput,
onBlur: this._onBlur,
onCompositionEnd: this._onCompositionEnd,
onCompositionStart: this._onCompositionStart,
onCopy: this._onCopy,
onCut: this._onCut,
onDragEnd: this._onDragEnd,
onDragEnter: this.onDragEnter,
onDragLeave: this.onDragLeave,
onDragOver: this._onDragOver,
onDragStart: this._onDragStart,
onDrop: this._onDrop,
onFocus: this._onFocus,
onInput: this._onInput,
onKeyDown: this._onKeyDown,
onKeyPress: this._onKeyPress,
onKeyUp: this._onKeyUp,
onMouseUp: this._onMouseUp,
onPaste: this._onPaste,
onSelect: this._onSelect,
ref: "editor",
role: readOnly ? null : this.props.role || "textbox",
spellCheck: allowSpellCheck && this.props.spellCheck,
style: contentStyle,
suppressContentEditableWarning: !0,
tabIndex: this.props.tabIndex
}, React.createElement(DraftEditorContents, {
blockRenderMap: this.props.blockRenderMap,
blockRendererFn: this.props.blockRendererFn,
blockStyleFn: this.props.blockStyleFn,
customStyleMap: _extends({}, DefaultDraftInlineStyle, this.props.customStyleMap),
customStyleFn: this.props.customStyleFn,
editorKey: this._editorKey,
editorState: this.props.editorState
}))));
}, DraftEditor.prototype.componentDidMount = function() {
this.setMode("edit"), /**
* IE has a hardcoded "feature" that attempts to convert link text into
* anchors in contentEditable DOM. This breaks the editor's expectations of
* the DOM, and control is lost. Disable it to make IE behave.
* See: http://blogs.msdn.com/b/ieinternals/archive/2010/09/15/
* ie9-beta-minor-change-list.aspx
*/
isIE && document.execCommand("AutoUrlDetect", !1, !1);
}, DraftEditor.prototype.componentWillUpdate = function() {
this._blockSelectEvents = !0;
}, DraftEditor.prototype.componentDidUpdate = function() {
this._blockSelectEvents = !1;
}, DraftEditor.prototype._focus = function(scrollPosition) {
var editorState = this.props.editorState, alreadyHasFocus = editorState.getSelection().getHasFocus(), editorNode = ReactDOM.findDOMNode(this.refs.editor), scrollParent = Style.getScrollParent(editorNode), _ref = scrollPosition || getScrollPosition(scrollParent), x = _ref.x, y = _ref.y;
editorNode.focus(), scrollParent === window ? window.scrollTo(x, y) : Scroll.setTop(scrollParent, y),
// On Chrome and Safari, calling focus on contenteditable focuses the
// cursor at the first character. This is something you don't expect when
// you're clicking on an input element but not directly on a character.
// Put the cursor back where it was before the blur.
alreadyHasFocus || this.update(EditorState.forceSelection(editorState, editorState.getSelection()));
}, DraftEditor.prototype._blur = function() {
ReactDOM.findDOMNode(this.refs.editor).blur();
}, DraftEditor.prototype._setMode = function(mode) {
this._handler = handlerMap[mode];
}, DraftEditor.prototype._exitCurrentMode = function() {
this.setMode("edit");
}, DraftEditor.prototype._restoreEditorDOM = function(scrollPosition) {
var _this3 = this;
this.setState({
containerKey: this.state.containerKey + 1
}, function() {
_this3._focus(scrollPosition);
});
}, DraftEditor.prototype._setRenderGuard = function() {
this._guardAgainstRender = !0;
}, DraftEditor.prototype._removeRenderGuard = function() {
this._guardAgainstRender = !1;
}, DraftEditor.prototype._setClipboard = function(clipboard) {
this._clipboard = clipboard;
}, DraftEditor.prototype._getClipboard = function() {
return this._clipboard;
}, DraftEditor.prototype._update = function(editorState) {
this.props.onChange(editorState);
}, DraftEditor.prototype._onDragEnter = function() {
this._dragCount++;
}, DraftEditor.prototype._onDragLeave = function() {
this._dragCount--, 0 === this._dragCount && this.exitCurrentMode();
}, DraftEditor;
}(React.Component);
DraftEditor.defaultProps = {
blockRenderMap: DefaultDraftBlockRenderMap,
blockRendererFn: emptyFunction.thatReturnsNull,
blockStyleFn: emptyFunction.thatReturns(""),
keyBindingFn: getDefaultKeyBinding,
readOnly: !1,
spellCheck: !1,
stripPastedStyles: !1
}, module.exports = DraftEditor;
}, /* 45 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule DraftEditorCompositionHandler
*
*/
"use strict";
var DraftModifier = __webpack_require__(9), EditorState = __webpack_require__(29), Keys = __webpack_require__(46), getEntityKeyForSelection = __webpack_require__(47), isSelectionAtLeafStart = __webpack_require__(48), RESOLVE_DELAY = 20, resolved = !1, stillComposing = !1, textInputData = "", DraftEditorCompositionHandler = {
onBeforeInput: function(e) {
textInputData = (textInputData || "") + e.data;
},
/**
* A `compositionstart` event has fired while we're still in composition
* mode. Continue the current composition session to prevent a re-render.
*/
onCompositionStart: function() {
stillComposing = !0;
},
/**
* Attempt to end the current composition session.
*
* Defer handling because browser will still insert the chars into active
* element after `compositionend`. If a `compositionstart` event fires
* before `resolveComposition` executes, our composition session will
* continue.
*
* The `resolved` flag is useful because certain IME interfaces fire the
* `compositionend` event multiple times, thus queueing up multiple attempts
* at handling the composition. Since handling the same composition event
* twice could break the DOM, we only use the first event. Example: Arabic
* Google Input Tools on Windows 8.1 fires `compositionend` three times.
*/
onCompositionEnd: function() {
var _this = this;
resolved = !1, stillComposing = !1, setTimeout(function() {
resolved || DraftEditorCompositionHandler.resolveComposition.call(_this);
}, RESOLVE_DELAY);
},
/**
* In Safari, keydown events may fire when committing compositions. If
* the arrow keys are used to commit, prevent default so that the cursor
* doesn't move, otherwise it will jump back noticeably on re-render.
*/
onKeyDown: function(e) {
e.which !== Keys.RIGHT && e.which !== Keys.LEFT || e.preventDefault();
},
/**
* Keypress events may fire when committing compositions. In Firefox,
* pressing RETURN commits the composition and inserts extra newline
* characters that we do not want. `preventDefault` allows the composition
* to be committed while preventing the extra characters.
*/
onKeyPress: function(e) {
e.which === Keys.RETURN && e.preventDefault();
},
/**
* Attempt to insert composed characters into the document.
*
* If we are still in a composition session, do nothing. Otherwise, insert
* the characters into the document and terminate the composition session.
*
* If no characters were composed -- for instance, the user
* deleted all composed characters and committed nothing new --
* force a re-render. We also re-render when the composition occurs
* at the beginning of a leaf, to ensure that if the browser has
* created a new text node for the composition, we will discard it.
*
* Resetting innerHTML will move focus to the beginning of the editor,
* so we update to force it back to the correct place.
*/
resolveComposition: function() {
if (!stillComposing) {
resolved = !0;
var composedChars = textInputData;
textInputData = "";
var editorState = EditorState.set(this.props.editorState, {
inCompositionMode: !1
}), currentStyle = editorState.getCurrentInlineStyle(), entityKey = getEntityKeyForSelection(editorState.getCurrentContent(), editorState.getSelection()), mustReset = !composedChars || isSelectionAtLeafStart(editorState) || currentStyle.size > 0 || null !== entityKey;
if (mustReset && this.restoreEditorDOM(), this.exitCurrentMode(), this.removeRenderGuard(),
composedChars) {
// If characters have been composed, re-rendering with the update
// is sufficient to reset the editor.
var contentState = DraftModifier.replaceText(editorState.getCurrentContent(), editorState.getSelection(), composedChars, currentStyle, entityKey);
return void this.update(EditorState.push(editorState, contentState, "insert-characters"));
}
mustReset && this.update(EditorState.set(editorState, {
nativelyRenderedContent: null,
forceSelection: !0
}));
}
}
};
module.exports = DraftEditorCompositionHandler;
}, /* 46 */
/***/
function(module, exports) {
"use strict";
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
module.exports = {
BACKSPACE: 8,
TAB: 9,
RETURN: 13,
ALT: 18,
ESC: 27,
SPACE: 32,
PAGE_UP: 33,
PAGE_DOWN: 34,
END: 35,
HOME: 36,
LEFT: 37,
UP: 38,
RIGHT: 39,
DOWN: 40,
DELETE: 46,
COMMA: 188,
PERIOD: 190,
A: 65,
Z: 90,
ZERO: 48,
NUMPAD_0: 96,
NUMPAD_9: 105
};
}, /* 47 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule getEntityKeyForSelection
* @typechecks
*
*/
"use strict";
/**
* Return the entity key that should be used when inserting text for the
* specified target selection, only if the entity is `MUTABLE`. `IMMUTABLE`
* and `SEGMENTED` entities should not be used for insertion behavior.
*/
function getEntityKeyForSelection(contentState, targetSelection) {
var entityKey;
if (targetSelection.isCollapsed()) {
var key = targetSelection.getAnchorKey(), offset = targetSelection.getAnchorOffset();
return offset > 0 ? (entityKey = contentState.getBlockForKey(key).getEntityAt(offset - 1),
filterKey(entityKey)) : null;
}
var startKey = targetSelection.getStartKey(), startOffset = targetSelection.getStartOffset(), startBlock = contentState.getBlockForKey(startKey);
return entityKey = startOffset === startBlock.getLength() ? null : startBlock.getEntityAt(startOffset),
filterKey(entityKey);
}
/**
* Determine whether an entity key corresponds to a `MUTABLE` entity. If so,
* return it. If not, return null.
*/
function filterKey(entityKey) {
if (entityKey) {
var entity = DraftEntity.get(entityKey);
return "MUTABLE" === entity.getMutability() ? entityKey : null;
}
return null;
}
var DraftEntity = __webpack_require__(14);
module.exports = getEntityKeyForSelection;
}, /* 48 */
/***/
function(module, exports) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule isSelectionAtLeafStart
* @typechecks
*
*/
"use strict";
function isSelectionAtLeafStart(editorState) {
var selection = editorState.getSelection(), anchorKey = selection.getAnchorKey(), blockTree = editorState.getBlockTree(anchorKey), offset = selection.getStartOffset(), isAtStart = !1;
return blockTree.some(function(leafSet) {
return offset === leafSet.get("start") ? (isAtStart = !0, !0) : offset < leafSet.get("end") && leafSet.get("leaves").some(function(leaf) {
var leafStart = leaf.get("start");
return offset === leafStart && (isAtStart = !0, !0);
});
}), isAtStart;
}
module.exports = isSelectionAtLeafStart;
}, /* 49 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule DraftEditorContents.react
* @typechecks
*
*/
"use strict";
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 || "object" != typeof call && "function" != typeof call ? self : call;
}
function _inherits(subClass, superClass) {
if ("function" != typeof superClass && null !== superClass) 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: !1,
writable: !0,
configurable: !0
}
}), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass);
}
/**
* Provide default styling for list items. This way, lists will be styled with
* proper counters and indentation even if the caller does not specify
* their own styling at all. If more than five levels of nesting are needed,
* the necessary CSS classes can be provided via `blockStyleFn` configuration.
*/
function getListItemClasses(type, depth, shouldResetCount, direction) {
return cx({
"public/DraftStyleDefault/unorderedListItem": "unordered-list-item" === type,
"public/DraftStyleDefault/orderedListItem": "ordered-list-item" === type,
"public/DraftStyleDefault/reset": shouldResetCount,
"public/DraftStyleDefault/depth0": 0 === depth,
"public/DraftStyleDefault/depth1": 1 === depth,
"public/DraftStyleDefault/depth2": 2 === depth,
"public/DraftStyleDefault/depth3": 3 === depth,
"public/DraftStyleDefault/depth4": 4 === depth,
"public/DraftStyleDefault/listLTR": "LTR" === direction,
"public/DraftStyleDefault/listRTL": "RTL" === direction
});
}
var _assign = __webpack_require__(15), _extends = _assign || function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]);
}
return target;
}, DraftEditorBlock = __webpack_require__(50), DraftOffsetKey = __webpack_require__(66), React = (__webpack_require__(29),
__webpack_require__(1)), cx = __webpack_require__(42), joinClasses = __webpack_require__(78), nullthrows = __webpack_require__(39), DraftEditorContents = function(_React$Component) {
function DraftEditorContents() {
return _classCallCheck(this, DraftEditorContents), _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
}
return _inherits(DraftEditorContents, _React$Component), DraftEditorContents.prototype.shouldComponentUpdate = function(nextProps) {
var prevEditorState = this.props.editorState, nextEditorState = nextProps.editorState, prevDirectionMap = prevEditorState.getDirectionMap(), nextDirectionMap = nextEditorState.getDirectionMap();
// Text direction has changed for one or more blocks. We must re-render.
if (prevDirectionMap !== nextDirectionMap) return !0;
var didHaveFocus = prevEditorState.getSelection().getHasFocus(), nowHasFocus = nextEditorState.getSelection().getHasFocus();
if (didHaveFocus !== nowHasFocus) return !0;
var nextNativeContent = nextEditorState.getNativelyRenderedContent(), wasComposing = prevEditorState.isInCompositionMode(), nowComposing = nextEditorState.isInCompositionMode();
// If the state is unchanged or we're currently rendering a natively
// rendered state, there's nothing new to be done.
if (prevEditorState === nextEditorState || null !== nextNativeContent && nextEditorState.getCurrentContent() === nextNativeContent || wasComposing && nowComposing) return !1;
var prevContent = prevEditorState.getCurrentContent(), nextContent = nextEditorState.getCurrentContent(), prevDecorator = prevEditorState.getDecorator(), nextDecorator = nextEditorState.getDecorator();
return wasComposing !== nowComposing || prevContent !== nextContent || prevDecorator !== nextDecorator || nextEditorState.mustForceSelection();
}, DraftEditorContents.prototype.render = function() {
for (var _props = this.props, blockRenderMap = _props.blockRenderMap, blockRendererFn = _props.blockRendererFn, customStyleMap = _props.customStyleMap, customStyleFn = _props.customStyleFn, editorState = _props.editorState, content = editorState.getCurrentContent(), selection = editorState.getSelection(), forceSelection = editorState.mustForceSelection(), decorator = editorState.getDecorator(), directionMap = nullthrows(editorState.getDirectionMap()), blocksAsArray = content.getBlocksAsArray(), processedBlocks = [], currentDepth = null, lastWrapperTemplate = null, ii = 0; ii < blocksAsArray.length; ii++) {
var _block = blocksAsArray[ii], key = _block.getKey(), blockType = _block.getType(), customRenderer = blockRendererFn(_block), CustomComponent = void 0, customProps = void 0, customEditable = void 0;
customRenderer && (CustomComponent = customRenderer.component, customProps = customRenderer.props,
customEditable = customRenderer.editable);
var direction = directionMap.get(key), offsetKey = DraftOffsetKey.encode(key, 0, 0), componentProps = {
block: _block,
blockProps: customProps,
customStyleMap: customStyleMap,
customStyleFn: customStyleFn,
decorator: decorator,
direction: direction,
forceSelection: forceSelection,
key: key,
offsetKey: offsetKey,
selection: selection,
tree: editorState.getBlockTree(key)
}, configForType = blockRenderMap.get(blockType), wrapperTemplate = configForType.wrapper, _Element = configForType.element || blockRenderMap.get("unstyled").element, depth = _block.getDepth(), className = this.props.blockStyleFn(_block);
// List items are special snowflakes, since we handle nesting and
// counters manually.
if ("li" === _Element) {
var shouldResetCount = lastWrapperTemplate !== wrapperTemplate || null === currentDepth || depth > currentDepth;
className = joinClasses(className, getListItemClasses(blockType, depth, shouldResetCount, direction));
}
var Component = CustomComponent || DraftEditorBlock, childProps = {
className: className,
"data-block": !0,
"data-editor": this.props.editorKey,
"data-offset-key": offsetKey,
key: key
};
void 0 !== customEditable && (childProps = _extends({}, childProps, {
contentEditable: customEditable,
suppressContentEditableWarning: !0
}));
var child = React.createElement(_Element, childProps, React.createElement(Component, componentProps));
processedBlocks.push({
block: child,
wrapperTemplate: wrapperTemplate,
key: key,
offsetKey: offsetKey
}), currentDepth = wrapperTemplate ? _block.getDepth() : null, lastWrapperTemplate = wrapperTemplate;
}
for (var outputBlocks = [], _ii = 0; _ii < processedBlocks.length; ) {
var info = processedBlocks[_ii];
if (info.wrapperTemplate) {
var blocks = [];
do blocks.push(processedBlocks[_ii].block), _ii++; while (_ii < processedBlocks.length && processedBlocks[_ii].wrapperTemplate === info.wrapperTemplate);
var wrapperElement = React.cloneElement(info.wrapperTemplate, {
key: info.key + "-wrap",
"data-offset-key": info.offsetKey
}, blocks);
outputBlocks.push(wrapperElement);
} else outputBlocks.push(info.block), _ii++;
}
return React.createElement("div", {
"data-contents": "true"
}, outputBlocks);
}, DraftEditorContents;
}(React.Component);
module.exports = DraftEditorContents;
}, /* 50 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule DraftEditorBlock.react
* @typechecks
*
*/
"use strict";
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 || "object" != typeof call && "function" != typeof call ? self : call;
}
function _inherits(subClass, superClass) {
if ("function" != typeof superClass && null !== superClass) 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: !1,
writable: !0,
configurable: !0
}
}), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass);
}
/**
* Return whether a block overlaps with either edge of the `SelectionState`.
*/
function isBlockOnSelectionEdge(selection, key) {
return selection.getAnchorKey() === key || selection.getFocusKey() === key;
}
var _assign = __webpack_require__(15), _extends = _assign || function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]);
}
return target;
}, DraftEditorLeaf = (__webpack_require__(7), __webpack_require__(51)), DraftOffsetKey = __webpack_require__(66), React = __webpack_require__(1), ReactDOM = __webpack_require__(53), Scroll = __webpack_require__(67), Style = (__webpack_require__(33),
__webpack_require__(68)), UnicodeBidi = __webpack_require__(37), UnicodeBidiDirection = __webpack_require__(38), cx = __webpack_require__(42), getElementPosition = __webpack_require__(72), getScrollPosition = __webpack_require__(74), getViewportDimensions = __webpack_require__(77), nullthrows = __webpack_require__(39), SCROLL_BUFFER = 10, DraftEditorBlock = function(_React$Component) {
function DraftEditorBlock() {
return _classCallCheck(this, DraftEditorBlock), _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
}
/**
* When a block is mounted and overlaps the selection state, we need to make
* sure that the cursor is visible to match native behavior. This may not
* be the case if the user has pressed `RETURN` or pasted some content, since
* programatically creating these new blocks and setting the DOM selection
* will miss out on the browser natively scrolling to that position.
*
* To replicate native behavior, if the block overlaps the selection state
* on mount, force the scroll position. Check the scroll state of the scroll
* parent, and adjust it to align the entire block to the bottom of the
* scroll parent.
*/
return _inherits(DraftEditorBlock, _React$Component), DraftEditorBlock.prototype.shouldComponentUpdate = function(nextProps) {
return this.props.block !== nextProps.block || this.props.tree !== nextProps.tree || this.props.direction !== nextProps.direction || isBlockOnSelectionEdge(nextProps.selection, nextProps.block.getKey()) && nextProps.forceSelection;
}, DraftEditorBlock.prototype.componentDidMount = function() {
var selection = this.props.selection, endKey = selection.getEndKey();
if (selection.getHasFocus() && endKey === this.props.block.getKey()) {
var scrollDelta, blockNode = ReactDOM.findDOMNode(this), scrollParent = Style.getScrollParent(blockNode), scrollPosition = getScrollPosition(scrollParent);
if (scrollParent === window) {
var nodePosition = getElementPosition(blockNode), nodeBottom = nodePosition.y + nodePosition.height, viewportHeight = getViewportDimensions().height;
scrollDelta = nodeBottom - viewportHeight, scrollDelta > 0 && window.scrollTo(scrollPosition.x, scrollPosition.y + scrollDelta + SCROLL_BUFFER);
} else {
var blockBottom = blockNode.offsetHeight + blockNode.offsetTop, scrollBottom = scrollParent.offsetHeight + scrollPosition.y;
scrollDelta = blockBottom - scrollBottom, scrollDelta > 0 && Scroll.setTop(scrollParent, Scroll.getTop(scrollParent) + scrollDelta + SCROLL_BUFFER);
}
}
}, DraftEditorBlock.prototype._renderChildren = function() {
var _this2 = this, block = this.props.block, blockKey = block.getKey(), text = block.getText(), lastLeafSet = this.props.tree.size - 1, hasSelection = isBlockOnSelectionEdge(this.props.selection, blockKey);
return this.props.tree.map(function(leafSet, ii) {
var leavesForLeafSet = leafSet.get("leaves"), lastLeaf = leavesForLeafSet.size - 1, leaves = leavesForLeafSet.map(function(leaf, jj) {
var offsetKey = DraftOffsetKey.encode(blockKey, ii, jj), start = leaf.get("start"), end = leaf.get("end");
return React.createElement(DraftEditorLeaf, {
key: offsetKey,
offsetKey: offsetKey,
blockKey: blockKey,
start: start,
selection: hasSelection ? _this2.props.selection : void 0,
forceSelection: _this2.props.forceSelection,
text: text.slice(start, end),
styleSet: block.getInlineStyleAt(start),
customStyleMap: _this2.props.customStyleMap,
customStyleFn: _this2.props.customStyleFn,
isLast: ii === lastLeafSet && jj === lastLeaf
});
}).toArray(), decoratorKey = leafSet.get("decoratorKey");
if (null == decoratorKey) return leaves;
if (!_this2.props.decorator) return leaves;
var decorator = nullthrows(_this2.props.decorator), DecoratorComponent = decorator.getComponentForKey(decoratorKey);
if (!DecoratorComponent) return leaves;
var decoratorProps = decorator.getPropsForKey(decoratorKey), decoratorOffsetKey = DraftOffsetKey.encode(blockKey, ii, 0), decoratedText = text.slice(leavesForLeafSet.first().get("start"), leavesForLeafSet.last().get("end")), dir = UnicodeBidiDirection.getHTMLDirIfDifferent(UnicodeBidi.getDirection(decoratedText), _this2.props.direction);
return React.createElement(DecoratorComponent, _extends({}, decoratorProps, {
decoratedText: decoratedText,
dir: dir,
key: decoratorOffsetKey,
entityKey: block.getEntityAt(leafSet.get("start")),
offsetKey: decoratorOffsetKey
}), leaves);
}).toArray();
}, DraftEditorBlock.prototype.render = function() {
var _props = this.props, direction = _props.direction, offsetKey = _props.offsetKey, className = cx({
"public/DraftStyleDefault/block": !0,
"public/DraftStyleDefault/ltr": "LTR" === direction,
"public/DraftStyleDefault/rtl": "RTL" === direction
});
return React.createElement("div", {
"data-offset-key": offsetKey,
className: className
}, this._renderChildren());
}, DraftEditorBlock;
}(React.Component);
module.exports = DraftEditorBlock;
}, /* 51 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule DraftEditorLeaf.react
* @typechecks
*
*/
"use strict";
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 || "object" != typeof call && "function" != typeof call ? self : call;
}
function _inherits(subClass, superClass) {
if ("function" != typeof superClass && null !== superClass) 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: !1,
writable: !0,
configurable: !0
}
}), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass);
}
var _assign = __webpack_require__(15), DraftEditorTextNode = __webpack_require__(52), React = __webpack_require__(1), ReactDOM = __webpack_require__(53), setDraftEditorSelection = (__webpack_require__(33),
__webpack_require__(61)), DraftEditorLeaf = function(_React$Component) {
function DraftEditorLeaf() {
return _classCallCheck(this, DraftEditorLeaf), _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
}
/**
* By making individual leaf instances aware of their context within
* the text of the editor, we can set our selection range more
* easily than we could in the non-React world.
*
* Note that this depends on our maintaining tight control over the
* DOM structure of the TextEditor component. If leaves had multiple
* text nodes, this would be harder.
*/
return _inherits(DraftEditorLeaf, _React$Component), DraftEditorLeaf.prototype._setSelection = function() {
var selection = this.props.selection;
// If selection state is irrelevant to the parent block, no-op.
if (null != selection && selection.getHasFocus()) {
var _props = this.props, blockKey = _props.blockKey, start = _props.start, text = _props.text, end = start + text.length;
if (selection.hasEdgeWithin(blockKey, start, end)) {
// Determine the appropriate target node for selection. If the child
// is not a text node, it is a <br /> spacer. In this case, use the
// <span> itself as the selection target.
var node = ReactDOM.findDOMNode(this), child = node.firstChild, targetNode = void 0;
targetNode = child.nodeType === Node.TEXT_NODE ? child : "BR" === child.tagName ? node : child.firstChild,
setDraftEditorSelection(selection, targetNode, blockKey, start, end);
}
}
}, DraftEditorLeaf.prototype.shouldComponentUpdate = function(nextProps) {
return ReactDOM.findDOMNode(this.refs.leaf).textContent !== nextProps.text || nextProps.styleSet !== this.props.styleSet || nextProps.forceSelection;
}, DraftEditorLeaf.prototype.componentDidUpdate = function() {
this._setSelection();
}, DraftEditorLeaf.prototype.componentDidMount = function() {
this._setSelection();
}, DraftEditorLeaf.prototype.render = function() {
var text = this.props.text;
// If the leaf is at the end of its block and ends in a soft newline, append
// an extra line feed character. Browsers collapse trailing newline
// characters, which leaves the cursor in the wrong place after a
// shift+enter. The extra character repairs this.
text.endsWith("\n") && this.props.isLast && (text += "\n");
var _props2 = this.props, customStyleMap = _props2.customStyleMap, customStyleFn = _props2.customStyleFn, offsetKey = _props2.offsetKey, styleSet = _props2.styleSet, styleObj = styleSet.reduce(function(map, styleName) {
var mergedStyles = {}, style = customStyleMap[styleName];
// .trim() is necessary for IE9/10/11 and Edge
return void 0 !== style && map.textDecoration !== style.textDecoration && (mergedStyles.textDecoration = [ map.textDecoration, style.textDecoration ].join(" ").trim()),
_assign(map, style, mergedStyles);
}, {});
if (customStyleFn) {
var newStyles = customStyleFn(styleSet);
styleObj = _assign(styleObj, newStyles);
}
return React.createElement("span", {
"data-offset-key": offsetKey,
ref: "leaf",
style: styleObj
}, React.createElement(DraftEditorTextNode, null, text));
}, DraftEditorLeaf;
}(React.Component);
module.exports = DraftEditorLeaf;
}, /* 52 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule DraftEditorTextNode.react
* @typechecks
*
*/
"use strict";
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 || "object" != typeof call && "function" != typeof call ? self : call;
}
function _inherits(subClass, superClass) {
if ("function" != typeof superClass && null !== superClass) 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: !1,
writable: !0,
configurable: !0
}
}), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass);
}
/**
* Check whether the node should be considered a newline.
*/
function isNewline(node) {
return useNewlineChar ? "\n" === node.textContent : "BR" === node.tagName;
}
var React = __webpack_require__(1), ReactDOM = __webpack_require__(53), UserAgent = __webpack_require__(54), useNewlineChar = UserAgent.isBrowser("IE <= 11"), NEWLINE_A = useNewlineChar ? React.createElement("span", {
key: "A",
"data-text": "true"
}, "\n") : React.createElement("br", {
key: "A",
"data-text": "true"
}), NEWLINE_B = useNewlineChar ? React.createElement("span", {
key: "B",
"data-text": "true"
}, "\n") : React.createElement("br", {
key: "B",
"data-text": "true"
}), DraftEditorTextNode = function(_React$Component) {
function DraftEditorTextNode(props) {
_classCallCheck(this, DraftEditorTextNode);
var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));
return _this._forceFlag = !1, _this;
}
return _inherits(DraftEditorTextNode, _React$Component), DraftEditorTextNode.prototype.shouldComponentUpdate = function(nextProps) {
var node = ReactDOM.findDOMNode(this), shouldBeNewline = "" === nextProps.children;
return shouldBeNewline ? !isNewline(node) : node.textContent !== nextProps.children;
}, DraftEditorTextNode.prototype.componentWillUpdate = function() {
// By flipping this flag, we also keep flipping keys which forces
// React to remount this node every time it rerenders.
this._forceFlag = !this._forceFlag;
}, DraftEditorTextNode.prototype.render = function() {
return "" === this.props.children ? this._forceFlag ? NEWLINE_A : NEWLINE_B : React.createElement("span", {
key: this._forceFlag ? "A" : "B",
"data-text": "true"
}, this.props.children);
}, DraftEditorTextNode;
}(React.Component);
module.exports = DraftEditorTextNode;
}, /* 53 */
/***/
function(module, exports) {
module.exports = __webpack_require__(/*! react-dom */ 33);
}, /* 54 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
"use strict";
/**
* Checks to see whether `name` and `version` satisfy `query`.
*
* @param {string} name Name of the browser, device, engine or platform
* @param {?string} version Version of the browser, engine or platform
* @param {string} query Query of form "Name [range expression]"
* @param {?function} normalizer Optional pre-processor for range expression
* @return {boolean}
*/
function compare(name, version, query, normalizer) {
// check for exact match with no version
if (name === query) return !0;
// check for non-matching names
if (!query.startsWith(name)) return !1;
// full comparison with version
var range = query.slice(name.length);
return !!version && (range = normalizer ? normalizer(range) : range, VersionRange.contains(range, version));
}
/**
* Normalizes `version` by stripping any "NT" prefix, but only on the Windows
* platform.
*
* Mimics the stripping performed by the `UserAgentWindowsPlatform` PHP class.
*
* @param {string} version
* @return {string}
*/
function normalizePlatformVersion(version) {
return "Windows" === UserAgentData.platformName ? version.replace(/^\s*NT/, "") : version;
}
var UserAgentData = __webpack_require__(55), VersionRange = __webpack_require__(58), mapObject = __webpack_require__(59), memoizeStringOnly = __webpack_require__(60), UserAgent = {
/**
* Check if the User Agent browser matches `query`.
*
* `query` should be a string like "Chrome" or "Chrome > 33".
*
* Valid browser names include:
*
* - ACCESS NetFront
* - AOL
* - Amazon Silk
* - Android
* - BlackBerry
* - BlackBerry PlayBook
* - Chrome
* - Chrome for iOS
* - Chrome frame
* - Facebook PHP SDK
* - Facebook for iOS
* - Firefox
* - IE
* - IE Mobile
* - Mobile Safari
* - Motorola Internet Browser
* - Nokia
* - Openwave Mobile Browser
* - Opera
* - Opera Mini
* - Opera Mobile
* - Safari
* - UIWebView
* - Unknown
* - webOS
* - etc...
*
* An authoritative list can be found in the PHP `BrowserDetector` class and
* related classes in the same file (see calls to `new UserAgentBrowser` here:
* https://fburl.com/50728104).
*
* @note Function results are memoized
*
* @param {string} query Query of the form "Name [range expression]"
* @return {boolean}
*/
isBrowser: function(query) {
return compare(UserAgentData.browserName, UserAgentData.browserFullVersion, query);
},
/**
* Check if the User Agent browser uses a 32 or 64 bit architecture.
*
* @note Function results are memoized
*
* @param {string} query Query of the form "32" or "64".
* @return {boolean}
*/
isBrowserArchitecture: function(query) {
return compare(UserAgentData.browserArchitecture, null, query);
},
/**
* Check if the User Agent device matches `query`.
*
* `query` should be a string like "iPhone" or "iPad".
*
* Valid device names include:
*
* - Kindle
* - Kindle Fire
* - Unknown
* - iPad
* - iPhone
* - iPod
* - etc...
*
* An authoritative list can be found in the PHP `DeviceDetector` class and
* related classes in the same file (see calls to `new UserAgentDevice` here:
* https://fburl.com/50728332).
*
* @note Function results are memoized
*
* @param {string} query Query of the form "Name"
* @return {boolean}
*/
isDevice: function(query) {
return compare(UserAgentData.deviceName, null, query);
},
/**
* Check if the User Agent rendering engine matches `query`.
*
* `query` should be a string like "WebKit" or "WebKit >= 537".
*
* Valid engine names include:
*
* - Gecko
* - Presto
* - Trident
* - WebKit
* - etc...
*
* An authoritative list can be found in the PHP `RenderingEngineDetector`
* class related classes in the same file (see calls to `new
* UserAgentRenderingEngine` here: https://fburl.com/50728617).
*
* @note Function results are memoized
*
* @param {string} query Query of the form "Name [range expression]"
* @return {boolean}
*/
isEngine: function(query) {
return compare(UserAgentData.engineName, UserAgentData.engineVersion, query);
},
/**
* Check if the User Agent platform matches `query`.
*
* `query` should be a string like "Windows" or "iOS 5 - 6".
*
* Valid platform names include:
*
* - Android
* - BlackBerry OS
* - Java ME
* - Linux
* - Mac OS X
* - Mac OS X Calendar
* - Mac OS X Internet Account
* - Symbian
* - SymbianOS
* - Windows
* - Windows Mobile
* - Windows Phone
* - iOS
* - iOS Facebook Integration Account
* - iOS Facebook Social Sharing UI
* - webOS
* - Chrome OS
* - etc...
*
* An authoritative list can be found in the PHP `PlatformDetector` class and
* related classes in the same file (see calls to `new UserAgentPlatform`
* here: https://fburl.com/50729226).
*
* @note Function results are memoized
*
* @param {string} query Query of the form "Name [range expression]"
* @return {boolean}
*/
isPlatform: function(query) {
return compare(UserAgentData.platformName, UserAgentData.platformFullVersion, query, normalizePlatformVersion);
},
/**
* Check if the User Agent platform is a 32 or 64 bit architecture.
*
* @note Function results are memoized
*
* @param {string} query Query of the form "32" or "64".
* @return {boolean}
*/
isPlatformArchitecture: function(query) {
return compare(UserAgentData.platformArchitecture, null, query);
}
};
module.exports = mapObject(UserAgent, memoizeStringOnly);
}, /* 55 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
/**
* Usage note:
* This module makes a best effort to export the same data we would internally.
* At Facebook we use a server-generated module that does the parsing and
* exports the data for the client to use. We can't rely on a server-side
* implementation in open source so instead we make use of an open source
* library to do the heavy lifting and then make some adjustments as necessary.
* It's likely there will be some differences. Some we can smooth over.
* Others are going to be harder.
*/
"use strict";
/**
* Convert from UAParser platform name to what we expect.
*/
function convertPlatformName(name) {
return PLATFORM_MAP[name] || name;
}
/**
* Get the version number in parts. This is very naive. We actually get major
* version as a part of UAParser already, which is generally good enough, but
* let's get the minor just in case.
*/
function getBrowserVersion(version) {
if (!version) return {
major: "",
minor: ""
};
var parts = version.split(".");
return {
major: parts[0],
minor: parts[1]
};
}
var UAParser = __webpack_require__(56), UNKNOWN = "Unknown", PLATFORM_MAP = {
"Mac OS": "Mac OS X"
}, parser = new UAParser(), results = parser.getResult(), browserVersionData = getBrowserVersion(results.browser.version), uaData = {
browserArchitecture: results.cpu.architecture || UNKNOWN,
browserFullVersion: results.browser.version || UNKNOWN,
browserMinorVersion: browserVersionData.minor || UNKNOWN,
browserName: results.browser.name || UNKNOWN,
browserVersion: results.browser.major || UNKNOWN,
deviceName: results.device.model || UNKNOWN,
engineName: results.engine.name || UNKNOWN,
engineVersion: results.engine.version || UNKNOWN,
platformArchitecture: results.cpu.architecture || UNKNOWN,
platformName: convertPlatformName(results.os.name) || UNKNOWN,
platformVersion: results.os.version || UNKNOWN,
platformFullVersion: results.os.version || UNKNOWN
};
module.exports = uaData;
}, /* 56 */
/***/
function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_RESULT__;
/**
* UAParser.js v0.7.10
* Lightweight JavaScript-based User-Agent string parser
* https://github.com/faisalman/ua-parser-js
*
* Copyright © 2012-2015 Faisal Salman <fyzlman@gmail.com>
* Dual licensed under GPLv2 & MIT
*/
!function(window, undefined) {
"use strict";
//////////////
// Constants
/////////////
var LIBVERSION = "0.7.10", EMPTY = "", UNKNOWN = "?", FUNC_TYPE = "function", UNDEF_TYPE = "undefined", OBJ_TYPE = "object", STR_TYPE = "string", MAJOR = "major", // deprecated
MODEL = "model", NAME = "name", TYPE = "type", VENDOR = "vendor", VERSION = "version", ARCHITECTURE = "architecture", CONSOLE = "console", MOBILE = "mobile", TABLET = "tablet", SMARTTV = "smarttv", WEARABLE = "wearable", EMBEDDED = "embedded", util = {
extend: function(regexes, extensions) {
for (var i in extensions) "browser cpu device engine os".indexOf(i) !== -1 && extensions[i].length % 2 === 0 && (regexes[i] = extensions[i].concat(regexes[i]));
return regexes;
},
has: function(str1, str2) {
return "string" == typeof str1 && str2.toLowerCase().indexOf(str1.toLowerCase()) !== -1;
},
lowerize: function(str) {
return str.toLowerCase();
},
major: function(version) {
return typeof version === STR_TYPE ? version.split(".")[0] : undefined;
}
}, mapper = {
rgx: function() {
// loop through all regexes maps
for (var result, j, k, p, q, matches, match, i = 0, args = arguments; i < args.length && !matches; ) {
var regex = args[i], // even sequence (0,2,4,..)
props = args[i + 1];
// odd sequence (1,3,5,..)
// construct object barebones
if (typeof result === UNDEF_TYPE) {
result = {};
for (p in props) props.hasOwnProperty(p) && (q = props[p], typeof q === OBJ_TYPE ? result[q[0]] = undefined : result[q] = undefined);
}
for (// try matching uastring with regexes
j = k = 0; j < regex.length && !matches; ) if (matches = regex[j++].exec(this.getUA())) for (p = 0; p < props.length; p++) match = matches[++k],
q = props[p], // check if given property is actually array
typeof q === OBJ_TYPE && q.length > 0 ? 2 == q.length ? typeof q[1] == FUNC_TYPE ? // assign modified match
result[q[0]] = q[1].call(this, match) : // assign given value, ignore regex match
result[q[0]] = q[1] : 3 == q.length ? // check whether function or regex
typeof q[1] !== FUNC_TYPE || q[1].exec && q[1].test ? // sanitize match using given regex
result[q[0]] = match ? match.replace(q[1], q[2]) : undefined : // call function (usually string mapper)
result[q[0]] = match ? q[1].call(this, match, q[2]) : undefined : 4 == q.length && (result[q[0]] = match ? q[3].call(this, match.replace(q[1], q[2])) : undefined) : result[q] = match ? match : undefined;
i += 2;
}
return result;
},
str: function(str, map) {
for (var i in map) // check if array
if (typeof map[i] === OBJ_TYPE && map[i].length > 0) {
for (var j = 0; j < map[i].length; j++) if (util.has(map[i][j], str)) return i === UNKNOWN ? undefined : i;
} else if (util.has(map[i], str)) return i === UNKNOWN ? undefined : i;
return str;
}
}, maps = {
browser: {
oldsafari: {
version: {
"1.0": "/8",
"1.2": "/1",
"1.3": "/3",
"2.0": "/412",
"2.0.2": "/416",
"2.0.3": "/417",
"2.0.4": "/419",
"?": "/"
}
}
},
device: {
amazon: {
model: {
"Fire Phone": [ "SD", "KF" ]
}
},
sprint: {
model: {
"Evo Shift 4G": "7373KT"
},
vendor: {
HTC: "APA",
Sprint: "Sprint"
}
}
},
os: {
windows: {
version: {
ME: "4.90",
"NT 3.11": "NT3.51",
"NT 4.0": "NT4.0",
"2000": "NT 5.0",
XP: [ "NT 5.1", "NT 5.2" ],
Vista: "NT 6.0",
"7": "NT 6.1",
"8": "NT 6.2",
"8.1": "NT 6.3",
"10": [ "NT 6.4", "NT 10.0" ],
RT: "ARM"
}
}
}
}, regexes = {
browser: [ [ // Presto based
/(opera\smini)\/([\w\.-]+)/i, // Opera Mini
/(opera\s[mobiletab]+).+version\/([\w\.-]+)/i, // Opera Mobi/Tablet
/(opera).+version\/([\w\.]+)/i, // Opera > 9.80
/(opera)[\/\s]+([\w\.]+)/i ], [ NAME, VERSION ], [ /\s(opr)\/([\w\.]+)/i ], [ [ NAME, "Opera" ], VERSION ], [ // Mixed
/(kindle)\/([\w\.]+)/i, // Kindle
/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]+)*/i, // Lunascape/Maxthon/Netfront/Jasmine/Blazer
// Trident based
/(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?([\w\.]*)/i, // Avant/IEMobile/SlimBrowser/Baidu
/(?:ms|\()(ie)\s([\w\.]+)/i, // Internet Explorer
// Webkit/KHTML based
/(rekonq)\/([\w\.]+)*/i, // Rekonq
/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs)\/([\w\.-]+)/i ], [ NAME, VERSION ], [ /(trident).+rv[:\s]([\w\.]+).+like\sgecko/i ], [ [ NAME, "IE" ], VERSION ], [ /(edge)\/((\d+)?[\w\.]+)/i ], [ NAME, VERSION ], [ /(yabrowser)\/([\w\.]+)/i ], [ [ NAME, "Yandex" ], VERSION ], [ /(comodo_dragon)\/([\w\.]+)/i ], [ [ NAME, /_/g, " " ], VERSION ], [ /(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i, // Chrome/OmniWeb/Arora/Tizen/Nokia
/(qqbrowser)[\/\s]?([\w\.]+)/i ], [ NAME, VERSION ], [ /(uc\s?browser)[\/\s]?([\w\.]+)/i, /ucweb.+(ucbrowser)[\/\s]?([\w\.]+)/i, /JUC.+(ucweb)[\/\s]?([\w\.]+)/i ], [ [ NAME, "UCBrowser" ], VERSION ], [ /(dolfin)\/([\w\.]+)/i ], [ [ NAME, "Dolphin" ], VERSION ], [ /((?:android.+)crmo|crios)\/([\w\.]+)/i ], [ [ NAME, "Chrome" ], VERSION ], [ /XiaoMi\/MiuiBrowser\/([\w\.]+)/i ], [ VERSION, [ NAME, "MIUI Browser" ] ], [ /android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)/i ], [ VERSION, [ NAME, "Android Browser" ] ], [ /FBAV\/([\w\.]+);/i ], [ VERSION, [ NAME, "Facebook" ] ], [ /fxios\/([\w\.-]+)/i ], [ VERSION, [ NAME, "Firefox" ] ], [ /version\/([\w\.]+).+?mobile\/\w+\s(safari)/i ], [ VERSION, [ NAME, "Mobile Safari" ] ], [ /version\/([\w\.]+).+?(mobile\s?safari|safari)/i ], [ VERSION, NAME ], [ /webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i ], [ NAME, [ VERSION, mapper.str, maps.browser.oldsafari.version ] ], [ /(konqueror)\/([\w\.]+)/i, // Konqueror
/(webkit|khtml)\/([\w\.]+)/i ], [ NAME, VERSION ], [ // Gecko based
/(navigator|netscape)\/([\w\.-]+)/i ], [ [ NAME, "Netscape" ], VERSION ], [ /(swiftfox)/i, // Swiftfox
/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i, // IceDragon/Iceweasel/Camino/Chimera/Fennec/Maemo/Minimo/Conkeror
/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/([\w\.-]+)/i, // Firefox/SeaMonkey/K-Meleon/IceCat/IceApe/Firebird/Phoenix
/(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i, // Mozilla
// Other
/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i, // Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf/Sleipnir
/(links)\s\(([\w\.]+)/i, // Links
/(gobrowser)\/?([\w\.]+)*/i, // GoBrowser
/(ice\s?browser)\/v?([\w\._]+)/i, // ICE Browser
/(mosaic)[\/\s]([\w\.]+)/i ], [ NAME, VERSION ] ],
cpu: [ [ /(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i ], [ [ ARCHITECTURE, "amd64" ] ], [ /(ia32(?=;))/i ], [ [ ARCHITECTURE, util.lowerize ] ], [ /((?:i[346]|x)86)[;\)]/i ], [ [ ARCHITECTURE, "ia32" ] ], [ // PocketPC mistakenly identified as PowerPC
/windows\s(ce|mobile);\sppc;/i ], [ [ ARCHITECTURE, "arm" ] ], [ /((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i ], [ [ ARCHITECTURE, /ower/, "", util.lowerize ] ], [ /(sun4\w)[;\)]/i ], [ [ ARCHITECTURE, "sparc" ] ], [ /((?:avr32|ia64(?=;))|68k(?=\))|arm(?:64|(?=v\d+;))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i ], [ [ ARCHITECTURE, util.lowerize ] ] ],
device: [ [ /\((ipad|playbook);[\w\s\);-]+(rim|apple)/i ], [ MODEL, VENDOR, [ TYPE, TABLET ] ], [ /applecoremedia\/[\w\.]+ \((ipad)/ ], [ MODEL, [ VENDOR, "Apple" ], [ TYPE, TABLET ] ], [ /(apple\s{0,1}tv)/i ], [ [ MODEL, "Apple TV" ], [ VENDOR, "Apple" ] ], [ /(archos)\s(gamepad2?)/i, // Archos
/(hp).+(touchpad)/i, // HP TouchPad
/(kindle)\/([\w\.]+)/i, // Kindle
/\s(nook)[\w\s]+build\/(\w+)/i, // Nook
/(dell)\s(strea[kpr\s\d]*[\dko])/i ], [ VENDOR, MODEL, [ TYPE, TABLET ] ], [ /(kf[A-z]+)\sbuild\/[\w\.]+.*silk\//i ], [ MODEL, [ VENDOR, "Amazon" ], [ TYPE, TABLET ] ], [ /(sd|kf)[0349hijorstuw]+\sbuild\/[\w\.]+.*silk\//i ], [ [ MODEL, mapper.str, maps.device.amazon.model ], [ VENDOR, "Amazon" ], [ TYPE, MOBILE ] ], [ /\((ip[honed|\s\w*]+);.+(apple)/i ], [ MODEL, VENDOR, [ TYPE, MOBILE ] ], [ /\((ip[honed|\s\w*]+);/i ], [ MODEL, [ VENDOR, "Apple" ], [ TYPE, MOBILE ] ], [ /(blackberry)[\s-]?(\w+)/i, // BlackBerry
/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|huawei|meizu|motorola|polytron)[\s_-]?([\w-]+)*/i, // BenQ/Palm/Sony-Ericsson/Acer/Asus/Dell/Huawei/Meizu/Motorola/Polytron
/(hp)\s([\w\s]+\w)/i, // HP iPAQ
/(asus)-?(\w+)/i ], [ VENDOR, MODEL, [ TYPE, MOBILE ] ], [ /\(bb10;\s(\w+)/i ], [ MODEL, [ VENDOR, "BlackBerry" ], [ TYPE, MOBILE ] ], [ // Asus Tablets
/android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7)/i ], [ MODEL, [ VENDOR, "Asus" ], [ TYPE, TABLET ] ], [ /(sony)\s(tablet\s[ps])\sbuild\//i, // Sony
/(sony)?(?:sgp.+)\sbuild\//i ], [ [ VENDOR, "Sony" ], [ MODEL, "Xperia Tablet" ], [ TYPE, TABLET ] ], [ /(?:sony)?(?:(?:(?:c|d)\d{4})|(?:so[-l].+))\sbuild\//i ], [ [ VENDOR, "Sony" ], [ MODEL, "Xperia Phone" ], [ TYPE, MOBILE ] ], [ /\s(ouya)\s/i, // Ouya
/(nintendo)\s([wids3u]+)/i ], [ VENDOR, MODEL, [ TYPE, CONSOLE ] ], [ /android.+;\s(shield)\sbuild/i ], [ MODEL, [ VENDOR, "Nvidia" ], [ TYPE, CONSOLE ] ], [ /(playstation\s[34portablevi]+)/i ], [ MODEL, [ VENDOR, "Sony" ], [ TYPE, CONSOLE ] ], [ /(sprint\s(\w+))/i ], [ [ VENDOR, mapper.str, maps.device.sprint.vendor ], [ MODEL, mapper.str, maps.device.sprint.model ], [ TYPE, MOBILE ] ], [ /(lenovo)\s?(S(?:5000|6000)+(?:[-][\w+]))/i ], [ VENDOR, MODEL, [ TYPE, TABLET ] ], [ /(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i, // HTC
/(zte)-(\w+)*/i, // ZTE
/(alcatel|geeksphone|huawei|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]+)*/i ], [ VENDOR, [ MODEL, /_/g, " " ], [ TYPE, MOBILE ] ], [ /(nexus\s9)/i ], [ MODEL, [ VENDOR, "HTC" ], [ TYPE, TABLET ] ], [ /[\s\(;](xbox(?:\sone)?)[\s\);]/i ], [ MODEL, [ VENDOR, "Microsoft" ], [ TYPE, CONSOLE ] ], [ /(kin\.[onetw]{3})/i ], [ [ MODEL, /\./g, " " ], [ VENDOR, "Microsoft" ], [ TYPE, MOBILE ] ], [ // Motorola
/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?(:?\s4g)?)[\w\s]+build\//i, /mot[\s-]?(\w+)*/i, /(XT\d{3,4}) build\//i, /(nexus\s[6])/i ], [ MODEL, [ VENDOR, "Motorola" ], [ TYPE, MOBILE ] ], [ /android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i ], [ MODEL, [ VENDOR, "Motorola" ], [ TYPE, TABLET ] ], [ /android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n8000|sgh-t8[56]9|nexus 10))/i, /((SM-T\w+))/i ], [ [ VENDOR, "Samsung" ], MODEL, [ TYPE, TABLET ] ], [ // Samsung
/((s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-n900))/i, /(sam[sung]*)[\s-]*(\w+-?[\w-]*)*/i, /sec-((sgh\w+))/i ], [ [ VENDOR, "Samsung" ], MODEL, [ TYPE, MOBILE ] ], [ /(samsung);smarttv/i ], [ VENDOR, MODEL, [ TYPE, SMARTTV ] ], [ /\(dtv[\);].+(aquos)/i ], [ MODEL, [ VENDOR, "Sharp" ], [ TYPE, SMARTTV ] ], [ /sie-(\w+)*/i ], [ MODEL, [ VENDOR, "Siemens" ], [ TYPE, MOBILE ] ], [ /(maemo|nokia).*(n900|lumia\s\d+)/i, // Nokia
/(nokia)[\s_-]?([\w-]+)*/i ], [ [ VENDOR, "Nokia" ], MODEL, [ TYPE, MOBILE ] ], [ /android\s3\.[\s\w;-]{10}(a\d{3})/i ], [ MODEL, [ VENDOR, "Acer" ], [ TYPE, TABLET ] ], [ /android\s3\.[\s\w;-]{10}(lg?)-([06cv9]{3,4})/i ], [ [ VENDOR, "LG" ], MODEL, [ TYPE, TABLET ] ], [ /(lg) netcast\.tv/i ], [ VENDOR, MODEL, [ TYPE, SMARTTV ] ], [ /(nexus\s[45])/i, // LG
/lg[e;\s\/-]+(\w+)*/i ], [ MODEL, [ VENDOR, "LG" ], [ TYPE, MOBILE ] ], [ /android.+(ideatab[a-z0-9\-\s]+)/i ], [ MODEL, [ VENDOR, "Lenovo" ], [ TYPE, TABLET ] ], [ /linux;.+((jolla));/i ], [ VENDOR, MODEL, [ TYPE, MOBILE ] ], [ /((pebble))app\/[\d\.]+\s/i ], [ VENDOR, MODEL, [ TYPE, WEARABLE ] ], [ /android.+;\s(glass)\s\d/i ], [ MODEL, [ VENDOR, "Google" ], [ TYPE, WEARABLE ] ], [ /android.+(\w+)\s+build\/hm\1/i, // Xiaomi Hongmi 'numeric' models
/android.+(hm[\s\-_]*note?[\s_]*(?:\d\w)?)\s+build/i, // Xiaomi Hongmi
/android.+(mi[\s\-_]*(?:one|one[\s_]plus)?[\s_]*(?:\d\w)?)\s+build/i ], [ [ MODEL, /_/g, " " ], [ VENDOR, "Xiaomi" ], [ TYPE, MOBILE ] ], [ /\s(tablet)[;\/\s]/i, // Unidentifiable Tablet
/\s(mobile)[;\/\s]/i ], [ [ TYPE, util.lowerize ], VENDOR, MODEL ] ],
engine: [ [ /windows.+\sedge\/([\w\.]+)/i ], [ VERSION, [ NAME, "EdgeHTML" ] ], [ /(presto)\/([\w\.]+)/i, // Presto
/(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i, // WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m
/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i, // KHTML/Tasman/Links
/(icab)[\/\s]([23]\.[\d\.]+)/i ], [ NAME, VERSION ], [ /rv\:([\w\.]+).*(gecko)/i ], [ VERSION, NAME ] ],
os: [ [ // Windows based
/microsoft\s(windows)\s(vista|xp)/i ], [ NAME, VERSION ], [ /(windows)\snt\s6\.2;\s(arm)/i, // Windows RT
/(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i ], [ NAME, [ VERSION, mapper.str, maps.os.windows.version ] ], [ /(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i ], [ [ NAME, "Windows" ], [ VERSION, mapper.str, maps.os.windows.version ] ], [ // Mobile/Embedded OS
/\((bb)(10);/i ], [ [ NAME, "BlackBerry" ], VERSION ], [ /(blackberry)\w*\/?([\w\.]+)*/i, // Blackberry
/(tizen)[\/\s]([\w\.]+)/i, // Tizen
/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|contiki)[\/\s-]?([\w\.]+)*/i, // Android/WebOS/Palm/QNX/Bada/RIM/MeeGo/Contiki
/linux;.+(sailfish);/i ], [ NAME, VERSION ], [ /(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i ], [ [ NAME, "Symbian" ], VERSION ], [ /\((series40);/i ], [ NAME ], [ /mozilla.+\(mobile;.+gecko.+firefox/i ], [ [ NAME, "Firefox OS" ], VERSION ], [ // Console
/(nintendo|playstation)\s([wids34portablevu]+)/i, // Nintendo/Playstation
// GNU/Linux based
/(mint)[\/\s\(]?(\w+)*/i, // Mint
/(mageia|vectorlinux)[;\s]/i, // Mageia/VectorLinux
/(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|(?=\s)arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?([\w\.-]+)*/i, // Joli/Ubuntu/Debian/SUSE/Gentoo/Arch/Slackware
// Fedora/Mandriva/CentOS/PCLinuxOS/RedHat/Zenwalk/Linpus
/(hurd|linux)\s?([\w\.]+)*/i, // Hurd/Linux
/(gnu)\s?([\w\.]+)*/i ], [ NAME, VERSION ], [ /(cros)\s[\w]+\s([\w\.]+\w)/i ], [ [ NAME, "Chromium OS" ], VERSION ], [ // Solaris
/(sunos)\s?([\w\.]+\d)*/i ], [ [ NAME, "Solaris" ], VERSION ], [ // BSD based
/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i ], [ NAME, VERSION ], [ /(ip[honead]+)(?:.*os\s([\w]+)*\slike\smac|;\sopera)/i ], [ [ NAME, "iOS" ], [ VERSION, /_/g, "." ] ], [ /(mac\sos\sx)\s?([\w\s\.]+\w)*/i, /(macintosh|mac(?=_powerpc)\s)/i ], [ [ NAME, "Mac OS" ], [ VERSION, /_/g, "." ] ], [ // Other
/((?:open)?solaris)[\/\s-]?([\w\.]+)*/i, // Solaris
/(haiku)\s(\w+)/i, // Haiku
/(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i, // AIX
/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms)/i, // Plan9/Minix/BeOS/OS2/AmigaOS/MorphOS/RISCOS/OpenVMS
/(unix)\s?([\w\.]+)*/i ], [ NAME, VERSION ] ]
}, UAParser = function(uastring, extensions) {
if (!(this instanceof UAParser)) return new UAParser(uastring, extensions).getResult();
var ua = uastring || (window && window.navigator && window.navigator.userAgent ? window.navigator.userAgent : EMPTY), rgxmap = extensions ? util.extend(regexes, extensions) : regexes;
return this.getBrowser = function() {
var browser = mapper.rgx.apply(this, rgxmap.browser);
return browser.major = util.major(browser.version), browser;
}, this.getCPU = function() {
return mapper.rgx.apply(this, rgxmap.cpu);
}, this.getDevice = function() {
return mapper.rgx.apply(this, rgxmap.device);
}, this.getEngine = function() {
return mapper.rgx.apply(this, rgxmap.engine);
}, this.getOS = function() {
return mapper.rgx.apply(this, rgxmap.os);
}, this.getResult = function() {
return {
ua: this.getUA(),
browser: this.getBrowser(),
engine: this.getEngine(),
os: this.getOS(),
device: this.getDevice(),
cpu: this.getCPU()
};
}, this.getUA = function() {
return ua;
}, this.setUA = function(uastring) {
return ua = uastring, this;
}, this.setUA(ua), this;
};
UAParser.VERSION = LIBVERSION, UAParser.BROWSER = {
NAME: NAME,
MAJOR: MAJOR,
// deprecated
VERSION: VERSION
}, UAParser.CPU = {
ARCHITECTURE: ARCHITECTURE
}, UAParser.DEVICE = {
MODEL: MODEL,
VENDOR: VENDOR,
TYPE: TYPE,
CONSOLE: CONSOLE,
MOBILE: MOBILE,
SMARTTV: SMARTTV,
TABLET: TABLET,
WEARABLE: WEARABLE,
EMBEDDED: EMBEDDED
}, UAParser.ENGINE = {
NAME: NAME,
VERSION: VERSION
}, UAParser.OS = {
NAME: NAME,
VERSION: VERSION
}, ///////////
// Export
//////////
// check js environment
typeof exports !== UNDEF_TYPE ? (// nodejs env
typeof module !== UNDEF_TYPE && module.exports && (exports = module.exports = UAParser),
exports.UAParser = UAParser) : // requirejs env (optional)
"function" === FUNC_TYPE && __webpack_require__(57) ? (__WEBPACK_AMD_DEFINE_RESULT__ = function() {
return UAParser;
}.call(exports, __webpack_require__, exports, module), !(__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__))) : // browser env
window.UAParser = UAParser;
// jQuery/Zepto specific (optional)
// Note:
// In AMD env the global scope should be kept clean, but jQuery is an exception.
// jQuery always exports to global scope, unless jQuery.noConflict(true) is used,
// and we should catch that.
var $ = window.jQuery || window.Zepto;
if (typeof $ !== UNDEF_TYPE) {
var parser = new UAParser();
$.ua = parser.getResult(), $.ua.get = function() {
return parser.getUA();
}, $.ua.set = function(uastring) {
parser.setUA(uastring);
var result = parser.getResult();
for (var prop in result) $.ua[prop] = result[prop];
};
}
}("object" == typeof window ? window : this);
}, /* 57 */
/***/
function(module, exports) {
/* WEBPACK VAR INJECTION */
(function(__webpack_amd_options__) {
module.exports = __webpack_amd_options__;
}).call(exports, {});
}, /* 58 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
"use strict";
/**
* Splits input `range` on "||" and returns true if any subrange matches
* `version`.
*
* @param {string} range
* @param {string} version
* @returns {boolean}
*/
function checkOrExpression(range, version) {
var expressions = range.split(orRegex);
return expressions.length > 1 ? expressions.some(function(range) {
return VersionRange.contains(range, version);
}) : (range = expressions[0].trim(), checkRangeExpression(range, version));
}
/**
* Splits input `range` on " - " (the surrounding whitespace is required) and
* returns true if version falls between the two operands.
*
* @param {string} range
* @param {string} version
* @returns {boolean}
*/
function checkRangeExpression(range, version) {
var expressions = range.split(rangeRegex);
if (expressions.length > 0 && expressions.length <= 2 ? void 0 : invariant(!1),
1 === expressions.length) return checkSimpleExpression(expressions[0], version);
var startVersion = expressions[0], endVersion = expressions[1];
return isSimpleVersion(startVersion) && isSimpleVersion(endVersion) ? void 0 : invariant(!1),
checkSimpleExpression(">=" + startVersion, version) && checkSimpleExpression("<=" + endVersion, version);
}
/**
* Checks if `range` matches `version`. `range` should be a "simple" range (ie.
* not a compound range using the " - " or "||" operators).
*
* @param {string} range
* @param {string} version
* @returns {boolean}
*/
function checkSimpleExpression(range, version) {
if (range = range.trim(), "" === range) return !0;
var versionComponents = version.split(componentRegex), _getModifierAndCompon = getModifierAndComponents(range), modifier = _getModifierAndCompon.modifier, rangeComponents = _getModifierAndCompon.rangeComponents;
switch (modifier) {
case "<":
return checkLessThan(versionComponents, rangeComponents);
case "<=":
return checkLessThanOrEqual(versionComponents, rangeComponents);
case ">=":
return checkGreaterThanOrEqual(versionComponents, rangeComponents);
case ">":
return checkGreaterThan(versionComponents, rangeComponents);
case "~":
case "~>":
return checkApproximateVersion(versionComponents, rangeComponents);
default:
return checkEqual(versionComponents, rangeComponents);
}
}
/**
* Checks whether `a` is less than `b`.
*
* @param {array<string>} a
* @param {array<string>} b
* @returns {boolean}
*/
function checkLessThan(a, b) {
return compareComponents(a, b) === -1;
}
/**
* Checks whether `a` is less than or equal to `b`.
*
* @param {array<string>} a
* @param {array<string>} b
* @returns {boolean}
*/
function checkLessThanOrEqual(a, b) {
var result = compareComponents(a, b);
return result === -1 || 0 === result;
}
/**
* Checks whether `a` is equal to `b`.
*
* @param {array<string>} a
* @param {array<string>} b
* @returns {boolean}
*/
function checkEqual(a, b) {
return 0 === compareComponents(a, b);
}
/**
* Checks whether `a` is greater than or equal to `b`.
*
* @param {array<string>} a
* @param {array<string>} b
* @returns {boolean}
*/
function checkGreaterThanOrEqual(a, b) {
var result = compareComponents(a, b);
return 1 === result || 0 === result;
}
/**
* Checks whether `a` is greater than `b`.
*
* @param {array<string>} a
* @param {array<string>} b
* @returns {boolean}
*/
function checkGreaterThan(a, b) {
return 1 === compareComponents(a, b);
}
/**
* Checks whether `a` is "reasonably close" to `b` (as described in
* https://www.npmjs.org/doc/misc/semver.html). For example, if `b` is "1.3.1"
* then "reasonably close" is defined as ">= 1.3.1 and < 1.4".
*
* @param {array<string>} a
* @param {array<string>} b
* @returns {boolean}
*/
function checkApproximateVersion(a, b) {
var lowerBound = b.slice(), upperBound = b.slice();
upperBound.length > 1 && upperBound.pop();
var lastIndex = upperBound.length - 1, numeric = parseInt(upperBound[lastIndex], 10);
return isNumber(numeric) && (upperBound[lastIndex] = numeric + 1 + ""), checkGreaterThanOrEqual(a, lowerBound) && checkLessThan(a, upperBound);
}
/**
* Extracts the optional modifier (<, <=, =, >=, >, ~, ~>) and version
* components from `range`.
*
* For example, given `range` ">= 1.2.3" returns an object with a `modifier` of
* `">="` and `components` of `[1, 2, 3]`.
*
* @param {string} range
* @returns {object}
*/
function getModifierAndComponents(range) {
var rangeComponents = range.split(componentRegex), matches = rangeComponents[0].match(modifierRegex);
return matches ? void 0 : invariant(!1), {
modifier: matches[1],
rangeComponents: [ matches[2] ].concat(rangeComponents.slice(1))
};
}
/**
* Determines if `number` is a number.
*
* @param {mixed} number
* @returns {boolean}
*/
function isNumber(number) {
return !isNaN(number) && isFinite(number);
}
/**
* Tests whether `range` is a "simple" version number without any modifiers
* (">", "~" etc).
*
* @param {string} range
* @returns {boolean}
*/
function isSimpleVersion(range) {
return !getModifierAndComponents(range).modifier;
}
/**
* Zero-pads array `array` until it is at least `length` long.
*
* @param {array} array
* @param {number} length
*/
function zeroPad(array, length) {
for (var i = array.length; i < length; i++) array[i] = "0";
}
/**
* Normalizes `a` and `b` in preparation for comparison by doing the following:
*
* - zero-pads `a` and `b`
* - marks any "x", "X" or "*" component in `b` as equivalent by zero-ing it out
* in both `a` and `b`
* - marks any final "*" component in `b` as a greedy wildcard by zero-ing it
* and all of its successors in `a`
*
* @param {array<string>} a
* @param {array<string>} b
* @returns {array<array<string>>}
*/
function normalizeVersions(a, b) {
a = a.slice(), b = b.slice(), zeroPad(a, b.length);
// mark "x" and "*" components as equal
for (var i = 0; i < b.length; i++) {
var matches = b[i].match(/^[x*]$/i);
if (matches && (b[i] = a[i] = "0", "*" === matches[0] && i === b.length - 1)) for (var j = i; j < a.length; j++) a[j] = "0";
}
return zeroPad(b, a.length), [ a, b ];
}
/**
* Returns the numerical -- not the lexicographical -- ordering of `a` and `b`.
*
* For example, `10-alpha` is greater than `2-beta`.
*
* @param {string} a
* @param {string} b
* @returns {number} -1, 0 or 1 to indicate whether `a` is less than, equal to,
* or greater than `b`, respectively
*/
function compareNumeric(a, b) {
var aPrefix = a.match(numericRegex)[1], bPrefix = b.match(numericRegex)[1], aNumeric = parseInt(aPrefix, 10), bNumeric = parseInt(bPrefix, 10);
return isNumber(aNumeric) && isNumber(bNumeric) && aNumeric !== bNumeric ? compare(aNumeric, bNumeric) : compare(a, b);
}
/**
* Returns the ordering of `a` and `b`.
*
* @param {string|number} a
* @param {string|number} b
* @returns {number} -1, 0 or 1 to indicate whether `a` is less than, equal to,
* or greater than `b`, respectively
*/
function compare(a, b) {
return typeof a != typeof b ? invariant(!1) : void 0, a > b ? 1 : a < b ? -1 : 0;
}
/**
* Compares arrays of version components.
*
* @param {array<string>} a
* @param {array<string>} b
* @returns {number} -1, 0 or 1 to indicate whether `a` is less than, equal to,
* or greater than `b`, respectively
*/
function compareComponents(a, b) {
for (var _normalizeVersions = normalizeVersions(a, b), aNormalized = _normalizeVersions[0], bNormalized = _normalizeVersions[1], i = 0; i < bNormalized.length; i++) {
var result = compareNumeric(aNormalized[i], bNormalized[i]);
if (result) return result;
}
return 0;
}
var invariant = __webpack_require__(17), componentRegex = /\./, orRegex = /\|\|/, rangeRegex = /\s+\-\s+/, modifierRegex = /^(<=|<|=|>=|~>|~|>|)?\s*(.+)/, numericRegex = /^(\d*)(.*)/, VersionRange = {
/**
* Checks whether `version` satisfies the `range` specification.
*
* We support a subset of the expressions defined in
* https://www.npmjs.org/doc/misc/semver.html:
*
* version Must match version exactly
* =version Same as just version
* >version Must be greater than version
* >=version Must be greater than or equal to version
* <version Must be less than version
* <=version Must be less than or equal to version
* ~version Must be at least version, but less than the next significant
* revision above version:
* "~1.2.3" is equivalent to ">= 1.2.3 and < 1.3"
* ~>version Equivalent to ~version
* 1.2.x Must match "1.2.x", where "x" is a wildcard that matches
* anything
* 1.2.* Similar to "1.2.x", but "*" in the trailing position is a
* "greedy" wildcard, so will match any number of additional
* components:
* "1.2.*" will match "1.2.1", "1.2.1.1", "1.2.1.1.1" etc
* * Any version
* "" (Empty string) Same as *
* v1 - v2 Equivalent to ">= v1 and <= v2"
* r1 || r2 Passes if either r1 or r2 are satisfied
*
* @param {string} range
* @param {string} version
* @returns {boolean}
*/
contains: function(range, version) {
return checkOrExpression(range.trim(), version.trim());
}
};
module.exports = VersionRange;
}, /* 59 */
/***/
function(module, exports) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
"use strict";
/**
* Executes the provided `callback` once for each enumerable own property in the
* object and constructs a new object from the results. The `callback` is
* invoked with three arguments:
*
* - the property value
* - the property name
* - the object being traversed
*
* Properties that are added after the call to `mapObject` will not be visited
* by `callback`. If the values of existing properties are changed, the value
* passed to `callback` will be the value at the time `mapObject` visits them.
* Properties that are deleted before being visited are not visited.
*
* @grep function objectMap()
* @grep function objMap()
*
* @param {?object} object
* @param {function} callback
* @param {*} context
* @return {?object}
*/
function mapObject(object, callback, context) {
if (!object) return null;
var result = {};
for (var name in object) hasOwnProperty.call(object, name) && (result[name] = callback.call(context, object[name], name, object));
return result;
}
var hasOwnProperty = Object.prototype.hasOwnProperty;
module.exports = mapObject;
}, /* 60 */
/***/
function(module, exports) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
* @typechecks static-only
*/
"use strict";
/**
* Memoizes the return value of a function that accepts one string argument.
*/
function memoizeStringOnly(callback) {
var cache = {};
return function(string) {
return cache.hasOwnProperty(string) || (cache[string] = callback.call(this, string)),
cache[string];
};
}
module.exports = memoizeStringOnly;
}, /* 61 */
/***/
function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */
(function(global) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule setDraftEditorSelection
* @typechecks
*
*/
"use strict";
/**
* In modern non-IE browsers, we can support both forward and backward
* selections.
*
* Note: IE10+ supports the Selection object, but it does not support
* the `extend` method, which means that even in modern IE, it's not possible
* to programatically create a backward selection. Thus, for all IE
* versions, we use the old IE API to create our selections.
*/
function setDraftEditorSelection(selectionState, node, blockKey, nodeStart, nodeEnd) {
// It's possible that the editor has been removed from the DOM but
// our selection code doesn't know it yet. Forcing selection in
// this case may lead to errors, so just bail now.
if (containsNode(document.documentElement, node)) {
var selection = global.getSelection(), anchorKey = selectionState.getAnchorKey(), anchorOffset = selectionState.getAnchorOffset(), focusKey = selectionState.getFocusKey(), focusOffset = selectionState.getFocusOffset(), isBackward = selectionState.getIsBackward();
// IE doesn't support backward selection. Swap key/offset pairs.
if (!selection.extend && isBackward) {
var tempKey = anchorKey, tempOffset = anchorOffset;
anchorKey = focusKey, anchorOffset = focusOffset, focusKey = tempKey, focusOffset = tempOffset,
isBackward = !1;
}
var hasAnchor = anchorKey === blockKey && nodeStart <= anchorOffset && nodeEnd >= anchorOffset, hasFocus = focusKey === blockKey && nodeStart <= focusOffset && nodeEnd >= focusOffset;
// If the selection is entirely bound within this node, set the selection
// and be done.
if (hasAnchor && hasFocus) return selection.removeAllRanges(), addPointToSelection(selection, node, anchorOffset - nodeStart),
void addFocusToSelection(selection, node, focusOffset - nodeStart);
if (isBackward) {
// If this node has the anchor, we may assume that the correct
// focus information is already stored on the selection object.
// We keep track of it, reset the selection range, and extend it
// back to the focus point.
if (// If this node has the focus, set the selection range to be a
// collapsed range beginning here. Later, when we encounter the anchor,
// we'll use this information to extend the selection.
hasFocus && (selection.removeAllRanges(), addPointToSelection(selection, node, focusOffset - nodeStart)),
hasAnchor) {
var storedFocusNode = selection.focusNode, storedFocusOffset = selection.focusOffset;
selection.removeAllRanges(), addPointToSelection(selection, node, anchorOffset - nodeStart),
addFocusToSelection(selection, storedFocusNode, storedFocusOffset);
}
} else // If the anchor is within this node, set the range start.
hasAnchor && (selection.removeAllRanges(), addPointToSelection(selection, node, anchorOffset - nodeStart)),
// If the focus is within this node, we can assume that we have
// already set the appropriate start range on the selection, and
// can simply extend the selection.
hasFocus && addFocusToSelection(selection, node, focusOffset - nodeStart);
}
}
/**
* Extend selection towards focus point.
*/
function addFocusToSelection(selection, node, offset) {
if (selection.extend && containsNode(getActiveElement(), node)) // If `extend` is called while another element has focus, an error is
// thrown. We therefore disable `extend` if the active element is somewhere
// other than the node we are selecting. This should only occur in Firefox,
// since it is the only browser to support multiple selections.
// See https://bugzilla.mozilla.org/show_bug.cgi?id=921444.
selection.extend(node, offset); else {
// IE doesn't support extend. This will mean no backward selection.
// Extract the existing selection range and add focus to it.
// Additionally, clone the selection range. IE11 throws an
// InvalidStateError when attempting to access selection properties
// after the range is detached.
var range = selection.getRangeAt(0);
range.setEnd(node, offset), selection.addRange(range.cloneRange());
}
}
function addPointToSelection(selection, node, offset) {
var range = document.createRange();
range.setStart(node, offset), selection.addRange(range);
}
var containsNode = __webpack_require__(62), getActiveElement = __webpack_require__(65);
module.exports = setDraftEditorSelection;
}).call(exports, function() {
return this;
}());
}, /* 62 */
/***/
function(module, exports, __webpack_require__) {
"use strict";
/*eslint-disable no-bitwise */
/**
* Checks if a given DOM node contains or is another DOM node.
*/
function containsNode(outerNode, innerNode) {
return !(!outerNode || !innerNode) && (outerNode === innerNode || !isTextNode(outerNode) && (isTextNode(innerNode) ? containsNode(outerNode, innerNode.parentNode) : "contains" in outerNode ? outerNode.contains(innerNode) : !!outerNode.compareDocumentPosition && !!(16 & outerNode.compareDocumentPosition(innerNode))));
}
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
var isTextNode = __webpack_require__(63);
module.exports = containsNode;
}, /* 63 */
/***/
function(module, exports, __webpack_require__) {
"use strict";
/**
* @param {*} object The object to check.
* @return {boolean} Whether or not the object is a DOM text node.
*/
function isTextNode(object) {
return isNode(object) && 3 == object.nodeType;
}
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @typechecks
*/
var isNode = __webpack_require__(64);
module.exports = isTextNode;
}, /* 64 */
/***/
function(module, exports) {
"use strict";
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @typechecks
*/
/**
* @param {*} object The object to check.
* @return {boolean} Whether or not the object is a DOM node.
*/
function isNode(object) {
return !(!object || !("function" == typeof Node ? object instanceof Node : "object" == typeof object && "number" == typeof object.nodeType && "string" == typeof object.nodeName));
}
module.exports = isNode;
}, /* 65 */
/***/
function(module, exports) {
"use strict";
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @typechecks
*/
/* eslint-disable fb-www/typeof-undefined */
/**
* Same as document.activeElement but wraps in a try-catch block. In IE it is
* not safe to call document.activeElement if there is nothing focused.
*
* The activeElement will be null only if the document or document body is not
* yet defined.
*/
function getActiveElement() {
if ("undefined" == typeof document) return null;
try {
return document.activeElement || document.body;
} catch (e) {
return document.body;
}
}
module.exports = getActiveElement;
}, /* 66 */
/***/
function(module, exports) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule DraftOffsetKey
*
*/
"use strict";
var KEY_DELIMITER = "-", DraftOffsetKey = {
encode: function(blockKey, decoratorKey, leafKey) {
return blockKey + KEY_DELIMITER + decoratorKey + KEY_DELIMITER + leafKey;
},
decode: function(offsetKey) {
var _offsetKey$split = offsetKey.split(KEY_DELIMITER), blockKey = _offsetKey$split[0], decoratorKey = _offsetKey$split[1], leafKey = _offsetKey$split[2];
return {
blockKey: blockKey,
decoratorKey: parseInt(decoratorKey, 10),
leafKey: parseInt(leafKey, 10)
};
}
};
module.exports = DraftOffsetKey;
}, /* 67 */
/***/
function(module, exports) {
"use strict";
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
/**
* @param {DOMElement} element
* @param {DOMDocument} doc
* @return {boolean}
*/
function _isViewportScrollElement(element, doc) {
return !!doc && (element === doc.documentElement || element === doc.body);
}
/**
* Scroll Module. This class contains 4 simple static functions
* to be used to access Element.scrollTop/scrollLeft properties.
* To solve the inconsistencies between browsers when either
* document.body or document.documentElement is supplied,
* below logic will be used to alleviate the issue:
*
* 1. If 'element' is either 'document.body' or 'document.documentElement,
* get whichever element's 'scroll{Top,Left}' is larger.
* 2. If 'element' is either 'document.body' or 'document.documentElement',
* set the 'scroll{Top,Left}' on both elements.
*/
var Scroll = {
/**
* @param {DOMElement} element
* @return {number}
*/
getTop: function(element) {
var doc = element.ownerDocument;
// In practice, they will either both have the same value,
// or one will be zero and the other will be the scroll position
// of the viewport. So we can use `X || Y` instead of `Math.max(X, Y)`
return _isViewportScrollElement(element, doc) ? doc.body.scrollTop || doc.documentElement.scrollTop : element.scrollTop;
},
/**
* @param {DOMElement} element
* @param {number} newTop
*/
setTop: function(element, newTop) {
var doc = element.ownerDocument;
_isViewportScrollElement(element, doc) ? doc.body.scrollTop = doc.documentElement.scrollTop = newTop : element.scrollTop = newTop;
},
/**
* @param {DOMElement} element
* @return {number}
*/
getLeft: function(element) {
var doc = element.ownerDocument;
return _isViewportScrollElement(element, doc) ? doc.body.scrollLeft || doc.documentElement.scrollLeft : element.scrollLeft;
},
/**
* @param {DOMElement} element
* @param {number} newLeft
*/
setLeft: function(element, newLeft) {
var doc = element.ownerDocument;
_isViewportScrollElement(element, doc) ? doc.body.scrollLeft = doc.documentElement.scrollLeft = newLeft : element.scrollLeft = newLeft;
}
};
module.exports = Scroll;
}, /* 68 */
/***/
function(module, exports, __webpack_require__) {
"use strict";
/**
* @param {DOMNode} element [description]
* @param {string} name Overflow style property name.
* @return {boolean} True if the supplied ndoe is scrollable.
*/
function _isNodeScrollable(element, name) {
var overflow = Style.get(element, name);
return "auto" === overflow || "scroll" === overflow;
}
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @typechecks
*/
var getStyleProperty = __webpack_require__(69), Style = {
/**
* Gets the style property for the supplied node. This will return either the
* computed style, if available, or the declared style.
*
* @param {DOMNode} node
* @param {string} name Style property name.
* @return {?string} Style property value.
*/
get: getStyleProperty,
/**
* Determines the nearest ancestor of a node that is scrollable.
*
* NOTE: This can be expensive if used repeatedly or on a node nested deeply.
*
* @param {?DOMNode} node Node from which to start searching.
* @return {?DOMWindow|DOMElement} Scroll parent of the supplied node.
*/
getScrollParent: function(node) {
if (!node) return null;
for (;node && node !== document.body; ) {
if (_isNodeScrollable(node, "overflow") || _isNodeScrollable(node, "overflowY") || _isNodeScrollable(node, "overflowX")) return node;
node = node.parentNode;
}
return window;
}
};
module.exports = Style;
}, /* 69 */
/***/
function(module, exports, __webpack_require__) {
"use strict";
function asString(value) {
return null == value ? value : String(value);
}
function getStyleProperty(/*DOMNode*/ node, /*string*/ name) {
var computedStyle = void 0;
// W3C Standard
if (window.getComputedStyle && (// In certain cases such as within an iframe in FF3, this returns null.
computedStyle = window.getComputedStyle(node, null))) return asString(computedStyle.getPropertyValue(hyphenate(name)));
// Safari
if (document.defaultView && document.defaultView.getComputedStyle) {
// A Safari bug causes this to return null for `display: none` elements.
if (computedStyle = document.defaultView.getComputedStyle(node, null)) return asString(computedStyle.getPropertyValue(hyphenate(name)));
if ("display" === name) return "none";
}
// Internet Explorer
// Internet Explorer
return asString(node.currentStyle ? "float" === name ? node.currentStyle.cssFloat || node.currentStyle.styleFloat : node.currentStyle[camelize(name)] : node.style && node.style[camelize(name)]);
}
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @typechecks
*/
var camelize = __webpack_require__(70), hyphenate = __webpack_require__(71);
module.exports = getStyleProperty;
}, /* 70 */
/***/
function(module, exports) {
"use strict";
/**
* Camelcases a hyphenated string, for example:
*
* > camelize('background-color')
* < "backgroundColor"
*
* @param {string} string
* @return {string}
*/
function camelize(string) {
return string.replace(_hyphenPattern, function(_, character) {
return character.toUpperCase();
});
}
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @typechecks
*/
var _hyphenPattern = /-(.)/g;
module.exports = camelize;
}, /* 71 */
/***/
function(module, exports) {
"use strict";
/**
* Hyphenates a camelcased string, for example:
*
* > hyphenate('backgroundColor')
* < "background-color"
*
* For CSS style names, use `hyphenateStyleName` instead which works properly
* with all vendor prefixes, including `ms`.
*
* @param {string} string
* @return {string}
*/
function hyphenate(string) {
return string.replace(_uppercasePattern, "-$1").toLowerCase();
}
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @typechecks
*/
var _uppercasePattern = /([A-Z])/g;
module.exports = hyphenate;
}, /* 72 */
/***/
function(module, exports, __webpack_require__) {
"use strict";
/**
* Gets an element's position in pixels relative to the viewport. The returned
* object represents the position of the element's top left corner.
*
* @param {DOMElement} element
* @return {object}
*/
function getElementPosition(element) {
var rect = getElementRect(element);
return {
x: rect.left,
y: rect.top,
width: rect.right - rect.left,
height: rect.bottom - rect.top
};
}
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @typechecks
*/
var getElementRect = __webpack_require__(73);
module.exports = getElementPosition;
}, /* 73 */
/***/
function(module, exports, __webpack_require__) {
"use strict";
/**
* Gets an element's bounding rect in pixels relative to the viewport.
*
* @param {DOMElement} elem
* @return {object}
*/
function getElementRect(elem) {
var docElem = document.documentElement;
// FF 2, Safari 3 and Opera 9.5- do not support getBoundingClientRect().
// IE9- will throw if the element is not in the document.
if (!("getBoundingClientRect" in elem && containsNode(docElem, elem))) return {
left: 0,
right: 0,
top: 0,
bottom: 0
};
// Subtracts clientTop/Left because IE8- added a 2px border to the
// <html> element (see http://fburl.com/1493213). IE 7 in
// Quicksmode does not report clientLeft/clientTop so there
// will be an unaccounted offset of 2px when in quirksmode
var rect = elem.getBoundingClientRect();
return {
left: Math.round(rect.left) - docElem.clientLeft,
right: Math.round(rect.right) - docElem.clientLeft,
top: Math.round(rect.top) - docElem.clientTop,
bottom: Math.round(rect.bottom) - docElem.clientTop
};
}
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @typechecks
*/
var containsNode = __webpack_require__(62);
module.exports = getElementRect;
}, /* 74 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @typechecks
*/
"use strict";
/**
* Gets the scroll position of the supplied element or window.
*
* The return values are bounded. This means that if the scroll position is
* negative or exceeds the element boundaries (which is possible using inertial
* scrolling), you will get zero or the maximum scroll position, respectively.
*
* If you need the unbound scroll position, use `getUnboundedScrollPosition`.
*
* @param {DOMWindow|DOMElement} scrollable
* @return {object} Map with `x` and `y` keys.
*/
function getScrollPosition(scrollable) {
var documentScrollElement = getDocumentScrollElement();
scrollable === window && (scrollable = documentScrollElement);
var scrollPosition = getUnboundedScrollPosition(scrollable), viewport = scrollable === documentScrollElement ? document.documentElement : scrollable, xMax = scrollable.scrollWidth - viewport.clientWidth, yMax = scrollable.scrollHeight - viewport.clientHeight;
return scrollPosition.x = Math.max(0, Math.min(scrollPosition.x, xMax)), scrollPosition.y = Math.max(0, Math.min(scrollPosition.y, yMax)),
scrollPosition;
}
var getDocumentScrollElement = __webpack_require__(75), getUnboundedScrollPosition = __webpack_require__(76);
module.exports = getScrollPosition;
}, /* 75 */
/***/
function(module, exports) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @typechecks
*/
"use strict";
/**
* Gets the element with the document scroll properties such as `scrollLeft` and
* `scrollHeight`. This may differ across different browsers.
*
* NOTE: The return value can be null if the DOM is not yet ready.
*
* @param {?DOMDocument} doc Defaults to current document.
* @return {?DOMElement}
*/
function getDocumentScrollElement(doc) {
return doc = doc || document, isWebkit || "CSS1Compat" !== doc.compatMode ? doc.body : doc.documentElement;
}
var isWebkit = "undefined" != typeof navigator && navigator.userAgent.indexOf("AppleWebKit") > -1;
module.exports = getDocumentScrollElement;
}, /* 76 */
/***/
function(module, exports) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @typechecks
*/
"use strict";
/**
* Gets the scroll position of the supplied element or window.
*
* The return values are unbounded, unlike `getScrollPosition`. This means they
* may be negative or exceed the element boundaries (which is possible using
* inertial scrolling).
*
* @param {DOMWindow|DOMElement} scrollable
* @return {object} Map with `x` and `y` keys.
*/
function getUnboundedScrollPosition(scrollable) {
return scrollable === window ? {
x: window.pageXOffset || document.documentElement.scrollLeft,
y: window.pageYOffset || document.documentElement.scrollTop
} : {
x: scrollable.scrollLeft,
y: scrollable.scrollTop
};
}
module.exports = getUnboundedScrollPosition;
}, /* 77 */
/***/
function(module, exports) {
"use strict";
function getViewportWidth() {
var width = void 0;
return document.documentElement && (width = document.documentElement.clientWidth),
!width && document.body && (width = document.body.clientWidth), width || 0;
}
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
* @typechecks
*/
function getViewportHeight() {
var height = void 0;
return document.documentElement && (height = document.documentElement.clientHeight),
!height && document.body && (height = document.body.clientHeight), height || 0;
}
/**
* Gets the viewport dimensions including any scrollbars.
*/
function getViewportDimensions() {
return {
width: window.innerWidth || getViewportWidth(),
height: window.innerHeight || getViewportHeight()
};
}
/**
* Gets the viewport dimensions excluding any scrollbars.
*/
getViewportDimensions.withoutScrollbars = function() {
return {
width: getViewportWidth(),
height: getViewportHeight()
};
}, module.exports = getViewportDimensions;
}, /* 78 */
/***/
function(module, exports) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @typechecks static-only
*/
"use strict";
/**
* Combines multiple className strings into one.
* http://jsperf.com/joinclasses-args-vs-array
*
* @param {...?string} className
* @return {string}
*/
function joinClasses(className) {
className || (className = "");
var nextClass = void 0, argLength = arguments.length;
if (argLength > 1) for (var ii = 1; ii < argLength; ii++) nextClass = arguments[ii],
nextClass && (className = (className ? className + " " : "") + nextClass);
return className;
}
module.exports = joinClasses;
}, /* 79 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule DraftEditorDragHandler
* @typechecks
*
*/
"use strict";
/**
* Get a SelectionState for the supplied mouse event.
*/
function getSelectionForEvent(event, editorState) {
var node = null, offset = null;
if ("function" == typeof document.caretRangeFromPoint) {
var dropRange = document.caretRangeFromPoint(event.x, event.y);
node = dropRange.startContainer, offset = dropRange.startOffset;
} else {
if (!event.rangeParent) return null;
node = event.rangeParent, offset = event.rangeOffset;
}
node = nullthrows(node), offset = nullthrows(offset);
var offsetKey = nullthrows(findAncestorOffsetKey(node));
return getUpdatedSelectionState(editorState, offsetKey, offset, offsetKey, offset);
}
function moveText(editorState, targetSelection) {
var newContentState = DraftModifier.moveText(editorState.getCurrentContent(), editorState.getSelection(), targetSelection);
return EditorState.push(editorState, newContentState, "insert-fragment");
}
/**
* Insert text at a specified selection.
*/
function insertTextAtSelection(editorState, selection, text) {
var newContentState = DraftModifier.insertText(editorState.getCurrentContent(), selection, text, editorState.getCurrentInlineStyle());
return EditorState.push(editorState, newContentState, "insert-fragment");
}
var DataTransfer = __webpack_require__(80), DraftModifier = __webpack_require__(9), EditorState = __webpack_require__(29), findAncestorOffsetKey = __webpack_require__(83), getTextContentFromFiles = __webpack_require__(85), getUpdatedSelectionState = __webpack_require__(86), nullthrows = __webpack_require__(39), isEventHandled = __webpack_require__(87), DraftEditorDragHandler = {
/**
* Drag originating from input terminated.
*/
onDragEnd: function() {
this.exitCurrentMode();
},
/**
* Handle data being dropped.
*/
onDrop: function(e) {
var _this = this, data = new DataTransfer(e.nativeEvent.dataTransfer), editorState = this.props.editorState, dropSelection = getSelectionForEvent(e.nativeEvent, editorState);
if (e.preventDefault(), this.exitCurrentMode(), null != dropSelection) {
var files = data.getFiles();
if (files.length > 0) {
if (this.props.handleDroppedFiles && isEventHandled(this.props.handleDroppedFiles(dropSelection, files))) return;
return void getTextContentFromFiles(files, function(fileText) {
fileText && _this.update(insertTextAtSelection(editorState, nullthrows(dropSelection), // flow wtf
fileText));
});
}
var dragType = this._internalDrag ? "internal" : "external";
if (!this.props.handleDrop || !isEventHandled(this.props.handleDrop(dropSelection, data, dragType))) return this._internalDrag ? void this.update(moveText(editorState, dropSelection)) : void this.update(insertTextAtSelection(editorState, dropSelection, data.getText()));
}
}
};
module.exports = DraftEditorDragHandler;
}, /* 80 */
/***/
function(module, exports, __webpack_require__) {
"use strict";
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
}
/**
* If DataTransferItem is a file then return the Blob of data.
*
* @param {object} item
* @return {?blob}
*/
function getFileFromDataTransfer(item) {
if ("file" == item.kind) return item.getAsFile();
}
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @typechecks
*/
var PhotosMimeType = __webpack_require__(81), createArrayFromMixed = __webpack_require__(82), emptyFunction = __webpack_require__(31), CR_LF_REGEX = new RegExp("\r\n", "g"), LF_ONLY = "\n", RICH_TEXT_TYPES = {
"text/rtf": 1,
"text/html": 1
}, DataTransfer = function() {
/**
* @param {object} data
*/
function DataTransfer(data) {
_classCallCheck(this, DataTransfer), this.data = data, // Types could be DOMStringList or array
this.types = data.types ? createArrayFromMixed(data.types) : [];
}
/**
* Is this likely to be a rich text data transfer?
*
* @return {boolean}
*/
/**
* Get raw text.
*
* @return {?string}
*/
/**
* Get HTML paste data
*
* @return {?string}
*/
/**
* Is this a link data transfer?
*
* @return {boolean}
*/
/**
* Get a link url.
*
* @return {?string}
*/
/**
* Is this an image data transfer?
*
* @return {boolean}
*/
/**
* Get files.
*
* @return {array}
*/
/**
* Are there any files to fetch?
*
* @return {boolean}
*/
return DataTransfer.prototype.isRichText = function() {
// If HTML is available, treat this data as rich text. This way, we avoid
// using a pasted image if it is packaged with HTML -- this may occur with
// pastes from MS Word, for example. However this is only rich text if
// there's accompanying text.
// If HTML is available, treat this data as rich text. This way, we avoid
// using a pasted image if it is packaged with HTML -- this may occur with
// pastes from MS Word, for example. However this is only rich text if
// there's accompanying text.
// When an image is copied from a preview window, you end up with two
// DataTransferItems one of which is a file's metadata as text. Skip those.
return !(!this.getHTML() || !this.getText()) || !this.isImage() && this.types.some(function(type) {
return RICH_TEXT_TYPES[type];
});
}, DataTransfer.prototype.getText = function() {
var text;
return this.data.getData && (this.types.length ? this.types.indexOf("text/plain") != -1 && (text = this.data.getData("text/plain")) : text = this.data.getData("Text")),
text ? text.replace(CR_LF_REGEX, LF_ONLY) : null;
}, DataTransfer.prototype.getHTML = function() {
if (this.data.getData) {
if (!this.types.length) return this.data.getData("Text");
if (this.types.indexOf("text/html") != -1) return this.data.getData("text/html");
}
}, DataTransfer.prototype.isLink = function() {
return this.types.some(function(type) {
return type.indexOf("Url") != -1 || type.indexOf("text/uri-list") != -1 || type.indexOf("text/x-moz-url");
});
}, DataTransfer.prototype.getLink = function() {
if (this.data.getData) {
if (this.types.indexOf("text/x-moz-url") != -1) {
var url = this.data.getData("text/x-moz-url").split("\n");
return url[0];
}
return this.types.indexOf("text/uri-list") != -1 ? this.data.getData("text/uri-list") : this.data.getData("url");
}
return null;
}, DataTransfer.prototype.isImage = function isImage() {
var isImage = this.types.some(function(type) {
// Firefox will have a type of application/x-moz-file for images during
// dragging
return type.indexOf("application/x-moz-file") != -1;
});
if (isImage) return !0;
for (var items = this.getFiles(), i = 0; i < items.length; i++) {
var type = items[i].type;
if (!PhotosMimeType.isImage(type)) return !1;
}
return !0;
}, DataTransfer.prototype.getCount = function() {
return this.data.hasOwnProperty("items") ? this.data.items.length : this.data.hasOwnProperty("mozItemCount") ? this.data.mozItemCount : this.data.files ? this.data.files.length : null;
}, DataTransfer.prototype.getFiles = function() {
return this.data.items ? Array.prototype.slice.call(this.data.items).map(getFileFromDataTransfer).filter(emptyFunction.thatReturnsArgument) : this.data.files ? Array.prototype.slice.call(this.data.files) : [];
}, DataTransfer.prototype.hasFiles = function() {
return this.getFiles().length > 0;
}, DataTransfer;
}();
module.exports = DataTransfer;
}, /* 81 */
/***/
function(module, exports) {
"use strict";
function getParts(mimeString) {
return mimeString.split("/");
}
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
var PhotosMimeType = {
isImage: function(mimeString) {
return "image" === getParts(mimeString)[0];
},
isJpeg: function(mimeString) {
var parts = getParts(mimeString);
// see http://fburl.com/10972194
return PhotosMimeType.isImage(mimeString) && ("jpeg" === parts[1] || "pjpeg" === parts[1]);
}
};
module.exports = PhotosMimeType;
}, /* 82 */
/***/
function(module, exports, __webpack_require__) {
"use strict";
/**
* Convert array-like objects to arrays.
*
* This API assumes the caller knows the contents of the data type. For less
* well defined inputs use createArrayFromMixed.
*
* @param {object|function|filelist} obj
* @return {array}
*/
function toArray(obj) {
var length = obj.length;
// Old IE doesn't give collections access to hasOwnProperty. Assume inputs
// without method will throw during the slice call and skip straight to the
// fallback.
if (// Some browsers builtin objects can report typeof 'function' (e.g. NodeList
// in old versions of Safari).
Array.isArray(obj) || "object" != typeof obj && "function" != typeof obj ? invariant(!1) : void 0,
"number" != typeof length ? invariant(!1) : void 0, 0 === length || length - 1 in obj ? void 0 : invariant(!1),
"function" == typeof obj.callee ? invariant(!1) : void 0, obj.hasOwnProperty) try {
return Array.prototype.slice.call(obj);
} catch (e) {}
for (var ret = Array(length), ii = 0; ii < length; ii++) ret[ii] = obj[ii];
return ret;
}
/**
* Perform a heuristic test to determine if an object is "array-like".
*
* A monk asked Joshu, a Zen master, "Has a dog Buddha nature?"
* Joshu replied: "Mu."
*
* This function determines if its argument has "array nature": it returns
* true if the argument is an actual array, an `arguments' object, or an
* HTMLCollection (e.g. node.childNodes or node.getElementsByTagName()).
*
* It will return false for other array-like objects like Filelist.
*
* @param {*} obj
* @return {boolean}
*/
function hasArrayNature(obj) {
// not null/false
// arrays are objects, NodeLists are functions in Safari
// quacks like an array
// not window
// no DOM node should be considered an array-like
// a 'select' element has 'length' and 'item' properties on IE8
// a real array
// arguments
// HTMLCollection/NodeList
return !!obj && ("object" == typeof obj || "function" == typeof obj) && "length" in obj && !("setInterval" in obj) && "number" != typeof obj.nodeType && (Array.isArray(obj) || "callee" in obj || "item" in obj);
}
/**
* Ensure that the argument is an array by wrapping it in an array if it is not.
* Creates a copy of the argument if it is already an array.
*
* This is mostly useful idiomatically:
*
* var createArrayFromMixed = require('createArrayFromMixed');
*
* function takesOneOrMoreThings(things) {
* things = createArrayFromMixed(things);
* ...
* }
*
* This allows you to treat `things' as an array, but accept scalars in the API.
*
* If you need to convert an array-like object, like `arguments`, into an array
* use toArray instead.
*
* @param {*} obj
* @return {array}
*/
function createArrayFromMixed(obj) {
return hasArrayNature(obj) ? Array.isArray(obj) ? obj.slice() : toArray(obj) : [ obj ];
}
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @typechecks
*/
var invariant = __webpack_require__(17);
module.exports = createArrayFromMixed;
}, /* 83 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule findAncestorOffsetKey
* @typechecks
*
*/
"use strict";
/**
* Get the key from the node's nearest offset-aware ancestor.
*/
function findAncestorOffsetKey(node) {
for (var searchNode = node; searchNode && searchNode !== document.documentElement; ) {
var key = getSelectionOffsetKeyForNode(searchNode);
if (null != key) return key;
searchNode = searchNode.parentNode;
}
return null;
}
var getSelectionOffsetKeyForNode = __webpack_require__(84);
module.exports = findAncestorOffsetKey;
}, /* 84 */
/***/
function(module, exports) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule getSelectionOffsetKeyForNode
* @typechecks
*
*/
"use strict";
/**
* Get offset key from a node or it's child nodes. Return the first offset key
* found on the DOM tree of given node.
*/
function getSelectionOffsetKeyForNode(node) {
if (node instanceof Element) {
var offsetKey = node.getAttribute("data-offset-key");
if (offsetKey) return offsetKey;
for (var ii = 0; ii < node.childNodes.length; ii++) {
var childOffsetKey = getSelectionOffsetKeyForNode(node.childNodes[ii]);
if (childOffsetKey) return childOffsetKey;
}
}
return null;
}
module.exports = getSelectionOffsetKeyForNode;
}, /* 85 */
/***/
function(module, exports) {
/* WEBPACK VAR INJECTION */
(function(global) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule getTextContentFromFiles
*
*/
"use strict";
/**
* Extract the text content from a file list.
*/
function getTextContentFromFiles(files, callback) {
var readCount = 0, results = [];
files.forEach(function(/*blob*/ file) {
readFile(file, function(/*string*/ text) {
readCount++, text && results.push(text.slice(0, TEXT_SIZE_UPPER_BOUND)), readCount == files.length && callback(results.join("\r"));
});
});
}
/**
* todo isaac: Do work to turn html/rtf into a content fragment.
*/
function readFile(file, callback) {
if (!global.FileReader || file.type && !(file.type in TEXT_TYPES)) return void callback("");
if ("" === file.type) {
var contents = "";
// Special-case text clippings, which have an empty type but include
// `.textClipping` in the file name. `readAsText` results in an empty
// string for text clippings, so we force the file name to serve
// as the text value for the file.
return TEXT_CLIPPING_REGEX.test(file.name) && (contents = file.name.replace(TEXT_CLIPPING_REGEX, "")),
void callback(contents);
}
var reader = new FileReader();
reader.onload = function() {
callback(reader.result);
}, reader.onerror = function() {
callback("");
}, reader.readAsText(file);
}
var TEXT_CLIPPING_REGEX = /\.textClipping$/, TEXT_TYPES = {
"text/plain": !0,
"text/html": !0,
"text/rtf": !0
}, TEXT_SIZE_UPPER_BOUND = 5e3;
module.exports = getTextContentFromFiles;
}).call(exports, function() {
return this;
}());
}, /* 86 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule getUpdatedSelectionState
*
*/
"use strict";
function getUpdatedSelectionState(editorState, anchorKey, anchorOffset, focusKey, focusOffset) {
var selection = nullthrows(editorState.getSelection()), anchorPath = DraftOffsetKey.decode(anchorKey), anchorBlockKey = anchorPath.blockKey, anchorLeaf = editorState.getBlockTree(anchorBlockKey).getIn([ anchorPath.decoratorKey, "leaves", anchorPath.leafKey ]), focusPath = DraftOffsetKey.decode(focusKey), focusBlockKey = focusPath.blockKey, focusLeaf = editorState.getBlockTree(focusBlockKey).getIn([ focusPath.decoratorKey, "leaves", focusPath.leafKey ]), anchorLeafStart = anchorLeaf.get("start"), focusLeafStart = focusLeaf.get("start"), anchorBlockOffset = anchorLeaf ? anchorLeafStart + anchorOffset : null, focusBlockOffset = focusLeaf ? focusLeafStart + focusOffset : null, areEqual = selection.getAnchorKey() === anchorBlockKey && selection.getAnchorOffset() === anchorBlockOffset && selection.getFocusKey() === focusBlockKey && selection.getFocusOffset() === focusBlockOffset;
if (areEqual) return selection;
var isBackward = !1;
if (anchorBlockKey === focusBlockKey) {
var anchorLeafEnd = anchorLeaf.get("end"), focusLeafEnd = focusLeaf.get("end");
isBackward = focusLeafStart === anchorLeafStart && focusLeafEnd === anchorLeafEnd ? focusOffset < anchorOffset : focusLeafStart < anchorLeafStart;
} else {
var startKey = editorState.getCurrentContent().getBlockMap().keySeq().skipUntil(function(v) {
return v === anchorBlockKey || v === focusBlockKey;
}).first();
isBackward = startKey === focusBlockKey;
}
return selection.merge({
anchorKey: anchorBlockKey,
anchorOffset: anchorBlockOffset,
focusKey: focusBlockKey,
focusOffset: focusBlockOffset,
isBackward: isBackward
});
}
var DraftOffsetKey = __webpack_require__(66), nullthrows = __webpack_require__(39);
module.exports = getUpdatedSelectionState;
}, /* 87 */
/***/
function(module, exports) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule isEventHandled
* @typechecks
*
*/
"use strict";
/**
* Utility method for determining whether or not the value returned
* from a handler indicates that it was handled.
*/
function isEventHandled(value) {
return "handled" === value || value === !0;
}
module.exports = isEventHandled;
}, /* 88 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule DraftEditorEditHandler
*
*/
"use strict";
var onBeforeInput = __webpack_require__(89), onBlur = __webpack_require__(90), onCompositionStart = __webpack_require__(91), onCopy = __webpack_require__(92), onCut = __webpack_require__(94), onDragOver = __webpack_require__(95), onDragStart = __webpack_require__(96), onFocus = __webpack_require__(97), onInput = __webpack_require__(98), onKeyDown = __webpack_require__(99), onPaste = __webpack_require__(121), onSelect = __webpack_require__(127), DraftEditorEditHandler = {
onBeforeInput: onBeforeInput,
onBlur: onBlur,
onCompositionStart: onCompositionStart,
onCopy: onCopy,
onCut: onCut,
onDragOver: onDragOver,
onDragStart: onDragStart,
onFocus: onFocus,
onInput: onInput,
onKeyDown: onKeyDown,
onPaste: onPaste,
onSelect: onSelect
};
module.exports = DraftEditorEditHandler;
}, /* 89 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule editOnBeforeInput
*
*/
"use strict";
function mustPreventDefaultForCharacter(character) {
return isFirefox && (character == FF_QUICKFIND_CHAR || character == FF_QUICKFIND_LINK_CHAR);
}
/**
* Replace the current selection with the specified text string, with the
* inline style and entity key applied to the newly inserted text.
*/
function replaceText(editorState, text, inlineStyle, entityKey) {
var contentState = DraftModifier.replaceText(editorState.getCurrentContent(), editorState.getSelection(), text, inlineStyle, entityKey);
return EditorState.push(editorState, contentState, "insert-characters");
}
/**
* When `onBeforeInput` executes, the browser is attempting to insert a
* character into the editor. Apply this character data to the document,
* allowing native insertion if possible.
*
* Native insertion is encouraged in order to limit re-rendering and to
* preserve spellcheck highlighting, which disappears or flashes if re-render
* occurs on the relevant text nodes.
*/
function editOnBeforeInput(e) {
var chars = e.data;
// In some cases (ex: IE ideographic space insertion) no character data
// is provided. There's nothing to do when this happens.
if (chars) {
// Allow the top-level component to handle the insertion manually. This is
// useful when triggering interesting behaviors for a character insertion,
// Simple examples: replacing a raw text ':)' with a smile emoji or image
// decorator, or setting a block to be a list item after typing '- ' at the
// start of the block.
if (this.props.handleBeforeInput && isEventHandled(this.props.handleBeforeInput(chars))) return void e.preventDefault();
// If selection is collapsed, conditionally allow native behavior. This
// reduces re-renders and preserves spellcheck highlighting. If the selection
// is not collapsed, we will re-render.
var editorState = this.props.editorState, selection = editorState.getSelection();
if (!selection.isCollapsed()) return e.preventDefault(), void this.update(replaceText(editorState, chars, editorState.getCurrentInlineStyle(), getEntityKeyForSelection(editorState.getCurrentContent(), editorState.getSelection())));
var mayAllowNative = !isSelectionAtLeafStart(editorState), newEditorState = replaceText(editorState, chars, editorState.getCurrentInlineStyle(), getEntityKeyForSelection(editorState.getCurrentContent(), editorState.getSelection()));
if (!mayAllowNative) return e.preventDefault(), void this.update(newEditorState);
var anchorKey = selection.getAnchorKey(), anchorTree = editorState.getBlockTree(anchorKey), originalFingerprint = BlockTree.getFingerprint(anchorTree), newFingerprint = BlockTree.getFingerprint(newEditorState.getBlockTree(anchorKey));
mustPreventDefaultForCharacter(chars) || originalFingerprint !== newFingerprint || nullthrows(newEditorState.getDirectionMap()).get(anchorKey) !== nullthrows(editorState.getDirectionMap()).get(anchorKey) ? e.preventDefault() : // The native event is allowed to occur.
newEditorState = EditorState.set(newEditorState, {
nativelyRenderedContent: newEditorState.getCurrentContent()
}), this.update(newEditorState);
}
}
var BlockTree = __webpack_require__(30), DraftModifier = __webpack_require__(9), EditorState = __webpack_require__(29), UserAgent = __webpack_require__(54), getEntityKeyForSelection = __webpack_require__(47), isSelectionAtLeafStart = __webpack_require__(48), nullthrows = __webpack_require__(39), isEventHandled = __webpack_require__(87), FF_QUICKFIND_CHAR = "'", FF_QUICKFIND_LINK_CHAR = "/", isFirefox = UserAgent.isBrowser("Firefox");
module.exports = editOnBeforeInput;
}, /* 90 */
/***/
function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */
(function(global) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule editOnBlur
*
*/
"use strict";
function editOnBlur(e) {
// Webkit has a bug in which blurring a contenteditable by clicking on
// other active elements will trigger the `blur` event but will not remove
// the DOM selection from the contenteditable. We therefore force the
// issue to be certain, checking whether the active element is `body`
// to force it when blurring occurs within the window (as opposed to
// clicking to another tab or window).
isWebKit && getActiveElement() === document.body && global.getSelection().removeAllRanges();
var editorState = this.props.editorState, currentSelection = editorState.getSelection();
if (currentSelection.getHasFocus()) {
var selection = currentSelection.set("hasFocus", !1);
this.props.onBlur && this.props.onBlur(e), this.update(EditorState.acceptSelection(editorState, selection));
}
}
var EditorState = __webpack_require__(29), UserAgent = __webpack_require__(54), getActiveElement = __webpack_require__(65), isWebKit = UserAgent.isEngine("WebKit");
module.exports = editOnBlur;
}).call(exports, function() {
return this;
}());
}, /* 91 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule editOnCompositionStart
*
*/
"use strict";
/**
* The user has begun using an IME input system. Switching to `composite` mode
* allows handling composition input and disables other edit behavior.
*/
function editOnCompositionStart() {
this.setRenderGuard(), this.setMode("composite"), this.update(EditorState.set(this.props.editorState, {
inCompositionMode: !0
}));
}
var EditorState = __webpack_require__(29);
module.exports = editOnCompositionStart;
}, /* 92 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule editOnCopy
*
*/
"use strict";
/**
* If we have a selection, create a ContentState fragment and store
* it in our internal clipboard. Subsequent paste events will use this
* fragment if no external clipboard data is supplied.
*/
function editOnCopy(e) {
var editorState = this.props.editorState, selection = editorState.getSelection();
// No selection, so there's nothing to copy.
// No selection, so there's nothing to copy.
return selection.isCollapsed() ? void e.preventDefault() : void this.setClipboard(getFragmentFromSelection(this.props.editorState));
}
var getFragmentFromSelection = __webpack_require__(93);
module.exports = editOnCopy;
}, /* 93 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule getFragmentFromSelection
*
*/
"use strict";
function getFragmentFromSelection(editorState) {
var selectionState = editorState.getSelection();
return selectionState.isCollapsed() ? null : getContentStateFragment(editorState.getCurrentContent(), selectionState);
}
var getContentStateFragment = __webpack_require__(20);
module.exports = getFragmentFromSelection;
}, /* 94 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule editOnCut
*
*/
"use strict";
/**
* On `cut` events, native behavior is allowed to occur so that the system
* clipboard is set properly. This means that we need to take steps to recover
* the editor DOM state after the `cut` has occurred in order to maintain
* control of the component.
*
* In addition, we can keep a copy of the removed fragment, including all
* styles and entities, for use as an internal paste.
*/
function editOnCut(e) {
var _this = this, editorState = this.props.editorState, selection = editorState.getSelection();
// No selection, so there's nothing to cut.
if (selection.isCollapsed()) return void e.preventDefault();
// Track the current scroll position so that it can be forced back in place
// after the editor regains control of the DOM.
var scrollParent = Style.getScrollParent(e.target), _getScrollPosition = getScrollPosition(scrollParent), x = _getScrollPosition.x, y = _getScrollPosition.y, fragment = getFragmentFromSelection(editorState);
this.setClipboard(fragment), // Set `cut` mode to disable all event handling temporarily.
this.setRenderGuard(), this.setMode("cut"), // Let native `cut` behavior occur, then recover control.
setTimeout(function() {
_this.restoreEditorDOM({
x: x,
y: y
}), _this.removeRenderGuard(), _this.exitCurrentMode(), _this.update(removeFragment(editorState));
}, 0);
}
function removeFragment(editorState) {
var newContent = DraftModifier.removeRange(editorState.getCurrentContent(), editorState.getSelection(), "forward");
return EditorState.push(editorState, newContent, "remove-range");
}
var DraftModifier = __webpack_require__(9), EditorState = __webpack_require__(29), Style = __webpack_require__(68), getFragmentFromSelection = __webpack_require__(93), getScrollPosition = __webpack_require__(74);
module.exports = editOnCut;
}, /* 95 */
/***/
function(module, exports) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule editOnDragOver
*
*/
"use strict";
/**
* Drag behavior has begun from outside the editor element.
*/
function editOnDragOver(e) {
this._internalDrag = !1, this.setMode("drag"), e.preventDefault();
}
module.exports = editOnDragOver;
}, /* 96 */
/***/
function(module, exports) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule editOnDragStart
*
*/
"use strict";
/**
* A `dragstart` event has begun within the text editor component.
*/
function editOnDragStart() {
this._internalDrag = !0, this.setMode("drag");
}
module.exports = editOnDragStart;
}, /* 97 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule editOnFocus
*
*/
"use strict";
function editOnFocus(e) {
var editorState = this.props.editorState, currentSelection = editorState.getSelection();
if (!currentSelection.getHasFocus()) {
var selection = currentSelection.set("hasFocus", !0);
this.props.onFocus && this.props.onFocus(e), // When the tab containing this text editor is hidden and the user does a
// find-in-page in a _different_ tab, Chrome on Mac likes to forget what the
// selection was right after sending this focus event and (if you let it)
// moves the cursor back to the beginning of the editor, so we force the
// selection here instead of simply accepting it in order to preserve the
// old cursor position. See https://crbug.com/540004.
this.update(EditorState.forceSelection(editorState, selection));
}
}
var EditorState = __webpack_require__(29);
module.exports = editOnFocus;
}, /* 98 */
/***/
function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */
(function(global) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule editOnInput
*
*/
"use strict";
/**
* This function is intended to handle spellcheck and autocorrect changes,
* which occur in the DOM natively without any opportunity to observe or
* interpret the changes before they occur.
*
* The `input` event fires in contentEditable elements reliably for non-IE
* browsers, immediately after changes occur to the editor DOM. Since our other
* handlers override or otherwise handle cover other varieties of text input,
* the DOM state should match the model in all controlled input cases. Thus,
* when an `input` change leads to a DOM/model mismatch, the change should be
* due to a spellcheck change, and we can incorporate it into our model.
*/
function editOnInput() {
var domSelection = global.getSelection(), anchorNode = domSelection.anchorNode, isCollapsed = domSelection.isCollapsed;
if (anchorNode.nodeType === Node.TEXT_NODE) {
var domText = anchorNode.textContent, editorState = this.props.editorState, offsetKey = nullthrows(findAncestorOffsetKey(anchorNode)), _DraftOffsetKey$decod = DraftOffsetKey.decode(offsetKey), blockKey = _DraftOffsetKey$decod.blockKey, decoratorKey = _DraftOffsetKey$decod.decoratorKey, leafKey = _DraftOffsetKey$decod.leafKey, _editorState$getBlock = editorState.getBlockTree(blockKey).getIn([ decoratorKey, "leaves", leafKey ]), start = _editorState$getBlock.start, end = _editorState$getBlock.end, content = editorState.getCurrentContent(), block = content.getBlockForKey(blockKey), modelText = block.getText().slice(start, end);
// No change -- the DOM is up to date. Nothing to do here.
if (// Special-case soft newlines here. If the DOM text ends in a soft newline,
// we will have manually inserted an extra soft newline in DraftEditorLeaf.
// We want to remove this extra newline for the purpose of our comparison
// of DOM and model text.
domText.endsWith(DOUBLE_NEWLINE) && (domText = domText.slice(0, -1)), domText !== modelText) {
var anchorOffset, focusOffset, startOffset, endOffset, selection = editorState.getSelection(), targetRange = selection.merge({
anchorOffset: start,
focusOffset: end,
isBackward: !1
}), entityKey = block.getEntityAt(start), entity = entityKey && Entity.get(entityKey), entityType = entity && entity.getMutability(), preserveEntity = "MUTABLE" === entityType, changeType = preserveEntity ? "spellcheck-change" : "apply-entity", newContent = DraftModifier.replaceText(content, targetRange, domText, block.getInlineStyleAt(start), preserveEntity ? block.getEntityAt(start) : null);
if (isGecko) // Firefox selection does not change while the context menu is open, so
// we preserve the anchor and focus values of the DOM selection.
anchorOffset = domSelection.anchorOffset, focusOffset = domSelection.focusOffset,
startOffset = start + Math.min(anchorOffset, focusOffset), endOffset = startOffset + Math.abs(anchorOffset - focusOffset),
anchorOffset = startOffset, focusOffset = endOffset; else {
// Browsers other than Firefox may adjust DOM selection while the context
// menu is open, and Safari autocorrect is prone to providing an inaccurate
// DOM selection. Don't trust it. Instead, use our existing SelectionState
// and adjust it based on the number of characters changed during the
// mutation.
var charDelta = domText.length - modelText.length;
startOffset = selection.getStartOffset(), endOffset = selection.getEndOffset(),
anchorOffset = isCollapsed ? endOffset + charDelta : startOffset, focusOffset = endOffset + charDelta;
}
// Segmented entities are completely or partially removed when their
// text content changes. For this case we do not want any text to be selected
// after the change, so we are not merging the selection.
var contentWithAdjustedDOMSelection = newContent.merge({
selectionBefore: content.getSelectionAfter(),
selectionAfter: selection.merge({
anchorOffset: anchorOffset,
focusOffset: focusOffset
})
});
this.update(EditorState.push(editorState, contentWithAdjustedDOMSelection, changeType));
}
}
}
var DraftModifier = __webpack_require__(9), DraftOffsetKey = __webpack_require__(66), EditorState = __webpack_require__(29), Entity = __webpack_require__(14), UserAgent = __webpack_require__(54), findAncestorOffsetKey = __webpack_require__(83), nullthrows = __webpack_require__(39), isGecko = UserAgent.isEngine("Gecko"), DOUBLE_NEWLINE = "\n\n";
module.exports = editOnInput;
}).call(exports, function() {
return this;
}());
}, /* 99 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule editOnKeyDown
*
*/
"use strict";
/**
* Map a `DraftEditorCommand` command value to a corresponding function.
*/
function onKeyCommand(command, editorState) {
switch (command) {
case "redo":
return EditorState.redo(editorState);
case "delete":
return keyCommandPlainDelete(editorState);
case "delete-word":
return keyCommandDeleteWord(editorState);
case "backspace":
return keyCommandPlainBackspace(editorState);
case "backspace-word":
return keyCommandBackspaceWord(editorState);
case "backspace-to-start-of-line":
return keyCommandBackspaceToStartOfLine(editorState);
case "split-block":
return keyCommandInsertNewline(editorState);
case "transpose-characters":
return keyCommandTransposeCharacters(editorState);
case "move-selection-to-start-of-block":
return keyCommandMoveSelectionToStartOfBlock(editorState);
case "move-selection-to-end-of-block":
return keyCommandMoveSelectionToEndOfBlock(editorState);
case "secondary-cut":
return SecondaryClipboard.cut(editorState);
case "secondary-paste":
return SecondaryClipboard.paste(editorState);
default:
return editorState;
}
}
/**
* Intercept keydown behavior to handle keys and commands manually, if desired.
*
* Keydown combinations may be mapped to `DraftCommand` values, which may
* correspond to command functions that modify the editor or its contents.
*
* See `getDefaultKeyBinding` for defaults. Alternatively, the top-level
* component may provide a custom mapping via the `keyBindingFn` prop.
*/
function editOnKeyDown(e) {
var keyCode = e.which, editorState = this.props.editorState;
switch (keyCode) {
case Keys.RETURN:
// The top-level component may manually handle newline insertion. If
// no special handling is performed, fall through to command handling.
if (e.preventDefault(), this.props.handleReturn && isEventHandled(this.props.handleReturn(e))) return;
break;
case Keys.ESC:
return e.preventDefault(), void (this.props.onEscape && this.props.onEscape(e));
case Keys.TAB:
return void (this.props.onTab && this.props.onTab(e));
case Keys.UP:
return void (this.props.onUpArrow && this.props.onUpArrow(e));
case Keys.DOWN:
return void (this.props.onDownArrow && this.props.onDownArrow(e));
case Keys.SPACE:
// Handling for OSX where option + space scrolls.
if (isChrome && isOptionKeyCommand(e)) {
e.preventDefault();
// Insert a nbsp into the editor.
var contentState = DraftModifier.replaceText(editorState.getCurrentContent(), editorState.getSelection(), " ");
return void this.update(EditorState.push(editorState, contentState, "insert-characters"));
}
}
var command = this.props.keyBindingFn(e);
// If no command is specified, allow keydown event to continue.
if (command) {
if ("undo" === command) // Since undo requires some special updating behavior to keep the editor
// in sync, handle it separately.
return void keyCommandUndo(e, editorState, this.update);
// Allow components higher up the tree to handle the command first.
if (// At this point, we know that we're handling a command of some kind, so
// we don't want to insert a character following the keydown.
e.preventDefault(), !this.props.handleKeyCommand || !isEventHandled(this.props.handleKeyCommand(command))) {
var newState = onKeyCommand(command, editorState);
newState !== editorState && this.update(newState);
}
}
}
var DraftModifier = __webpack_require__(9), EditorState = __webpack_require__(29), KeyBindingUtil = __webpack_require__(100), Keys = __webpack_require__(46), SecondaryClipboard = __webpack_require__(101), UserAgent = __webpack_require__(54), keyCommandBackspaceToStartOfLine = __webpack_require__(102), keyCommandBackspaceWord = __webpack_require__(109), keyCommandDeleteWord = __webpack_require__(112), keyCommandInsertNewline = __webpack_require__(114), keyCommandPlainBackspace = __webpack_require__(115), keyCommandPlainDelete = __webpack_require__(116), keyCommandMoveSelectionToEndOfBlock = __webpack_require__(117), keyCommandMoveSelectionToStartOfBlock = __webpack_require__(118), keyCommandTransposeCharacters = __webpack_require__(119), keyCommandUndo = __webpack_require__(120), isEventHandled = __webpack_require__(87), isOptionKeyCommand = KeyBindingUtil.isOptionKeyCommand, isChrome = UserAgent.isBrowser("Chrome");
module.exports = editOnKeyDown;
}, /* 100 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule KeyBindingUtil
* @typechecks
*
*/
"use strict";
var UserAgent = __webpack_require__(54), isOSX = UserAgent.isPlatform("Mac OS X"), KeyBindingUtil = {
/**
* Check whether the ctrlKey modifier is *not* being used in conjunction with
* the altKey modifier. If they are combined, the result is an `altGraph`
* key modifier, which should not be handled by this set of key bindings.
*/
isCtrlKeyCommand: function(e) {
return !!e.ctrlKey && !e.altKey;
},
isOptionKeyCommand: function(e) {
return isOSX && e.altKey;
},
hasCommandModifier: function(e) {
return isOSX ? !!e.metaKey && !e.altKey : KeyBindingUtil.isCtrlKeyCommand(e);
}
};
module.exports = KeyBindingUtil;
}, /* 101 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule SecondaryClipboard
*
*/
"use strict";
var DraftModifier = __webpack_require__(9), EditorState = __webpack_require__(29), getContentStateFragment = __webpack_require__(20), nullthrows = __webpack_require__(39), clipboard = null, SecondaryClipboard = {
cut: function(editorState) {
var content = editorState.getCurrentContent(), selection = editorState.getSelection(), targetRange = null;
if (selection.isCollapsed()) {
var anchorKey = selection.getAnchorKey(), blockEnd = content.getBlockForKey(anchorKey).getLength();
if (blockEnd === selection.getAnchorOffset()) return editorState;
targetRange = selection.set("focusOffset", blockEnd);
} else targetRange = selection;
targetRange = nullthrows(targetRange), clipboard = getContentStateFragment(content, targetRange);
var afterRemoval = DraftModifier.removeRange(content, targetRange, "forward");
return afterRemoval === content ? editorState : EditorState.push(editorState, afterRemoval, "remove-range");
},
paste: function(editorState) {
if (!clipboard) return editorState;
var newContent = DraftModifier.replaceWithFragment(editorState.getCurrentContent(), editorState.getSelection(), clipboard);
return EditorState.push(editorState, newContent, "insert-fragment");
}
};
module.exports = SecondaryClipboard;
}, /* 102 */
/***/
function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */
(function(global) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule keyCommandBackspaceToStartOfLine
*
*/
"use strict";
function keyCommandBackspaceToStartOfLine(editorState) {
var afterRemoval = removeTextWithStrategy(editorState, function(strategyState) {
var selection = strategyState.getSelection();
if (selection.isCollapsed() && 0 === selection.getAnchorOffset()) return moveSelectionBackward(strategyState, 1);
var domSelection = global.getSelection(), range = domSelection.getRangeAt(0);
return range = expandRangeToStartOfLine(range), getDraftEditorSelectionWithNodes(strategyState, null, range.endContainer, range.endOffset, range.startContainer, range.startOffset).selectionState;
}, "backward");
return afterRemoval === editorState.getCurrentContent() ? editorState : EditorState.push(editorState, afterRemoval, "remove-range");
}
var EditorState = __webpack_require__(29), expandRangeToStartOfLine = __webpack_require__(103), getDraftEditorSelectionWithNodes = __webpack_require__(106), moveSelectionBackward = __webpack_require__(107), removeTextWithStrategy = __webpack_require__(108);
module.exports = keyCommandBackspaceToStartOfLine;
}).call(exports, function() {
return this;
}());
}, /* 103 */
/***/
function(module, exports, __webpack_require__) {
"use strict";
/**
* Return the computed line height, in pixels, for the provided element.
*/
function getLineHeightPx(element) {
var computed = getComputedStyle(element), div = document.createElement("div");
div.style.fontFamily = computed.fontFamily, div.style.fontSize = computed.fontSize,
div.style.fontStyle = computed.fontStyle, div.style.fontWeight = computed.fontWeight,
div.style.lineHeight = computed.lineHeight, div.style.position = "absolute", div.textContent = "M",
// forced layout here
document.body.appendChild(div);
var rect = div.getBoundingClientRect();
return document.body.removeChild(div), rect.height;
}
/**
* Return whether every ClientRect in the provided list lies on the same line.
*
* We assume that the rects on the same line all contain the baseline, so the
* lowest top line needs to be above the highest bottom line (i.e., if you were
* to project the rects onto the y-axis, their intersection would be nonempty).
*
* In addition, we require that no two boxes are lineHeight (or more) apart at
* either top or bottom, which helps protect against false positives for fonts
* with extremely large glyph heights (e.g., with a font size of 17px, Zapfino
* produces rects of height 58px!).
*/
function areRectsOnOneLine(rects, lineHeight) {
for (var minTop = 1 / 0, minBottom = 1 / 0, maxTop = -(1 / 0), maxBottom = -(1 / 0), ii = 0; ii < rects.length; ii++) {
var rect = rects[ii];
0 !== rect.width && 1 !== rect.width && (minTop = Math.min(minTop, rect.top), minBottom = Math.min(minBottom, rect.bottom),
maxTop = Math.max(maxTop, rect.top), maxBottom = Math.max(maxBottom, rect.bottom));
}
return maxTop <= minBottom && maxTop - minTop < lineHeight && maxBottom - minBottom < lineHeight;
}
/**
* Return the length of a node, as used by Range offsets.
*/
function getNodeLength(node) {
// http://www.w3.org/TR/dom/#concept-node-length
switch (node.nodeType) {
case Node.DOCUMENT_TYPE_NODE:
return 0;
case Node.TEXT_NODE:
case Node.PROCESSING_INSTRUCTION_NODE:
case Node.COMMENT_NODE:
return node.length;
default:
return node.childNodes.length;
}
}
/**
* Given a collapsed range, move the start position backwards as far as
* possible while the range still spans only a single line.
*/
function expandRangeToStartOfLine(range) {
range.collapsed ? void 0 : invariant(!1), range = range.cloneRange();
var containingElement = range.startContainer;
1 !== containingElement.nodeType && (containingElement = containingElement.parentNode);
var lineHeight = getLineHeightPx(containingElement), bestContainer = range.endContainer, bestOffset = range.endOffset;
for (range.setStart(range.startContainer, 0); areRectsOnOneLine(getRangeClientRects(range), lineHeight) && (bestContainer = range.startContainer,
bestOffset = range.startOffset, bestContainer.parentNode ? void 0 : invariant(!1),
range.setStartBefore(bestContainer), 1 !== bestContainer.nodeType || "inline" === getComputedStyle(bestContainer).display); ) ;
for (// In the above example, range now spans from "<div>" to "under",
// bestContainer is <div>, and bestOffset is 1 (index of <q> inside <div>)].
// Picking out which child to recurse into here is a special case since we
// don't want to check past <q> -- once we find that the final range starts
// in <span>, we can look at all of its children (and all of their children)
// to find the break point.
// At all times, (bestContainer, bestOffset) is the latest single-line start
// point that we know of.
var currentContainer = bestContainer, maxIndexToConsider = bestOffset - 1; ;) {
for (var nodeValue = currentContainer.nodeValue, ii = maxIndexToConsider; ii >= 0; ii--) if (!(null != nodeValue && ii > 0 && UnicodeUtils.isSurrogatePair(nodeValue, ii - 1))) {
if (range.setStart(currentContainer, ii), !areRectsOnOneLine(getRangeClientRects(range), lineHeight)) break;
bestContainer = currentContainer, bestOffset = ii;
}
if (ii === -1 || 0 === currentContainer.childNodes.length) // If ii === -1, then (bestContainer, bestOffset), which is equal to
// (currentContainer, 0), was a single-line start point but a start
// point before currentContainer wasn't, so the line break seems to
// have occurred immediately after currentContainer's start tag
//
// If currentContainer.childNodes.length === 0, we're already at a
// terminal node (e.g., text node) and should return our current best.
break;
currentContainer = currentContainer.childNodes[ii], maxIndexToConsider = getNodeLength(currentContainer);
}
return range.setStart(bestContainer, bestOffset), range;
}
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule expandRangeToStartOfLine
* @typechecks
*
*/
var UnicodeUtils = __webpack_require__(104), getRangeClientRects = __webpack_require__(105), invariant = __webpack_require__(17);
module.exports = expandRangeToStartOfLine;
}, /* 104 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @typechecks
*/
/**
* Unicode-enabled replacesments for basic String functions.
*
* All the functions in this module assume that the input string is a valid
* UTF-16 encoding of a Unicode sequence. If it's not the case, the behavior
* will be undefined.
*
* WARNING: Since this module is typechecks-enforced, you may find new bugs
* when replacing normal String functions with ones provided here.
*/
"use strict";
/**
* @param {number} codeUnit A Unicode code-unit, in range [0, 0x10FFFF]
* @return {boolean} Whether code-unit is in a surrogate (hi/low) range
*/
function isCodeUnitInSurrogateRange(codeUnit) {
return SURROGATE_HIGH_START <= codeUnit && codeUnit <= SURROGATE_LOW_END;
}
/**
* Returns whether the two characters starting at `index` form a surrogate pair.
* For example, given the string s = "\uD83D\uDE0A", (s, 0) returns true and
* (s, 1) returns false.
*
* @param {string} str
* @param {number} index
* @return {boolean}
*/
function isSurrogatePair(str, index) {
if (0 <= index && index < str.length ? void 0 : invariant(!1), index + 1 === str.length) return !1;
var first = str.charCodeAt(index), second = str.charCodeAt(index + 1);
return SURROGATE_HIGH_START <= first && first <= SURROGATE_HIGH_END && SURROGATE_LOW_START <= second && second <= SURROGATE_LOW_END;
}
/**
* @param {string} str Non-empty string
* @return {boolean} True if the input includes any surrogate code units
*/
function hasSurrogateUnit(str) {
return SURROGATE_UNITS_REGEX.test(str);
}
/**
* Return the length of the original Unicode character at given position in the
* String by looking into the UTF-16 code unit; that is equal to 1 for any
* non-surrogate characters in BMP ([U+0000..U+D7FF] and [U+E000, U+FFFF]); and
* returns 2 for the hi/low surrogates ([U+D800..U+DFFF]), which are in fact
* representing non-BMP characters ([U+10000..U+10FFFF]).
*
* Examples:
* - '\u0020' => 1
* - '\u3020' => 1
* - '\uD835' => 2
* - '\uD835\uDDEF' => 2
* - '\uDDEF' => 2
*
* @param {string} str Non-empty string
* @param {number} pos Position in the string to look for one code unit
* @return {number} Number 1 or 2
*/
function getUTF16Length(str, pos) {
return 1 + isCodeUnitInSurrogateRange(str.charCodeAt(pos));
}
/**
* Fully Unicode-enabled replacement for String#length
*
* @param {string} str Valid Unicode string
* @return {number} The number of Unicode characters in the string
*/
function strlen(str) {
// Call the native functions if there's no surrogate char
if (!hasSurrogateUnit(str)) return str.length;
for (var len = 0, pos = 0; pos < str.length; pos += getUTF16Length(str, pos)) len++;
return len;
}
/**
* Fully Unicode-enabled replacement for String#substr()
*
* @param {string} str Valid Unicode string
* @param {number} start Location in Unicode sequence to begin extracting
* @param {?number} length The number of Unicode characters to extract
* (default: to the end of the string)
* @return {string} Extracted sub-string
*/
function substr(str, start, length) {
// Call the native functions if there's no surrogate char
if (start = start || 0, length = void 0 === length ? 1 / 0 : length || 0, !hasSurrogateUnit(str)) return str.substr(start, length);
// Obvious cases
var size = str.length;
if (size <= 0 || start > size || length <= 0) return "";
// Find the actual starting position
var posA = 0;
if (start > 0) {
for (;start > 0 && posA < size; start--) posA += getUTF16Length(str, posA);
if (posA >= size) return "";
} else if (start < 0) {
for (posA = size; start < 0 && 0 < posA; start++) posA -= getUTF16Length(str, posA - 1);
posA < 0 && (posA = 0);
}
// Find the actual ending position
var posB = size;
if (length < size) for (posB = posA; length > 0 && posB < size; length--) posB += getUTF16Length(str, posB);
return str.substring(posA, posB);
}
/**
* Fully Unicode-enabled replacement for String#substring()
*
* @param {string} str Valid Unicode string
* @param {number} start Location in Unicode sequence to begin extracting
* @param {?number} end Location in Unicode sequence to end extracting
* (default: end of the string)
* @return {string} Extracted sub-string
*/
function substring(str, start, end) {
start = start || 0, end = void 0 === end ? 1 / 0 : end || 0, start < 0 && (start = 0),
end < 0 && (end = 0);
var length = Math.abs(end - start);
return start = start < end ? start : end, substr(str, start, length);
}
/**
* Get a list of Unicode code-points from a String
*
* @param {string} str Valid Unicode string
* @return {array<number>} A list of code-points in [0..0x10FFFF]
*/
function getCodePoints(str) {
for (var codePoints = [], pos = 0; pos < str.length; pos += getUTF16Length(str, pos)) codePoints.push(str.codePointAt(pos));
return codePoints;
}
var invariant = __webpack_require__(17), SURROGATE_HIGH_START = 55296, SURROGATE_HIGH_END = 56319, SURROGATE_LOW_START = 56320, SURROGATE_LOW_END = 57343, SURROGATE_UNITS_REGEX = /[\uD800-\uDFFF]/, UnicodeUtils = {
getCodePoints: getCodePoints,
getUTF16Length: getUTF16Length,
hasSurrogateUnit: hasSurrogateUnit,
isCodeUnitInSurrogateRange: isCodeUnitInSurrogateRange,
isSurrogatePair: isSurrogatePair,
strlen: strlen,
substring: substring,
substr: substr
};
module.exports = UnicodeUtils;
}, /* 105 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule getRangeClientRects
* @typechecks
*
*/
"use strict";
// In Chrome, the client rects will include the entire bounds of all nodes that
// begin (have a start tag) within the selection, even if the selection does
// not overlap the entire node. To resolve this, we split the range at each
// start tag and join the client rects together.
// https://code.google.com/p/chromium/issues/detail?id=324437
/* eslint-disable consistent-return */
function getRangeClientRectsChrome(range) {
for (var tempRange = range.cloneRange(), clientRects = [], ancestor = range.endContainer; null != ancestor; ancestor = ancestor.parentNode) {
// If we've climbed up to the common ancestor, we can now use the
// original start point and stop climbing the tree.
var atCommonAncestor = ancestor === range.commonAncestorContainer;
atCommonAncestor ? tempRange.setStart(range.startContainer, range.startOffset) : tempRange.setStart(tempRange.endContainer, 0);
var rects = Array.from(tempRange.getClientRects());
if (clientRects.push(rects), atCommonAncestor) {
var _ref;
return clientRects.reverse(), (_ref = []).concat.apply(_ref, clientRects);
}
tempRange.setEndBefore(ancestor);
}
invariant(!1);
}
var UserAgent = __webpack_require__(54), invariant = __webpack_require__(17), isChrome = UserAgent.isBrowser("Chrome"), getRangeClientRects = isChrome ? getRangeClientRectsChrome : function(range) {
return Array.from(range.getClientRects());
};
module.exports = getRangeClientRects;
}, /* 106 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule getDraftEditorSelectionWithNodes
* @typechecks
*
*/
"use strict";
/**
* Convert the current selection range to an anchor/focus pair of offset keys
* and values that can be interpreted by components.
*/
function getDraftEditorSelectionWithNodes(editorState, root, anchorNode, anchorOffset, focusNode, focusOffset) {
var anchorIsTextNode = anchorNode.nodeType === Node.TEXT_NODE, focusIsTextNode = focusNode.nodeType === Node.TEXT_NODE;
// If the selection range lies only on text nodes, the task is simple.
// Find the nearest offset-aware elements and use the
// offset values supplied by the selection range.
if (anchorIsTextNode && focusIsTextNode) return {
selectionState: getUpdatedSelectionState(editorState, nullthrows(findAncestorOffsetKey(anchorNode)), anchorOffset, nullthrows(findAncestorOffsetKey(focusNode)), focusOffset),
needsRecovery: !1
};
var anchorPoint = null, focusPoint = null, needsRecovery = !0;
// An element is selected. Convert this selection range into leaf offset
// keys and offset values for consumption at the component level. This
// is common in Firefox, where select-all and triple click behavior leads
// to entire elements being selected.
//
// Note that we use the `needsRecovery` parameter in the callback here. This
// is because when certain elements are selected, the behavior for subsequent
// cursor movement (e.g. via arrow keys) is uncertain and may not match
// expectations at the component level. For example, if an entire <div> is
// selected and the user presses the right arrow, Firefox keeps the selection
// on the <div>. If we allow subsequent keypresses to insert characters
// natively, they will be inserted into a browser-created text node to the
// right of that <div>. This is obviously undesirable.
//
// With the `needsRecovery` flag, we inform the caller that it is responsible
// for manually setting the selection state on the rendered document to
// ensure proper selection state maintenance.
// If the selection is collapsed on an empty block, don't force recovery.
// This way, on arrow key selection changes, the browser can move the
// cursor from a non-zero offset on one block, through empty blocks,
// to a matching non-zero offset on other text blocks.
return anchorIsTextNode ? (anchorPoint = {
key: nullthrows(findAncestorOffsetKey(anchorNode)),
offset: anchorOffset
}, focusPoint = getPointForNonTextNode(root, focusNode, focusOffset)) : focusIsTextNode ? (focusPoint = {
key: nullthrows(findAncestorOffsetKey(focusNode)),
offset: focusOffset
}, anchorPoint = getPointForNonTextNode(root, anchorNode, anchorOffset)) : (anchorPoint = getPointForNonTextNode(root, anchorNode, anchorOffset),
focusPoint = getPointForNonTextNode(root, focusNode, focusOffset), anchorNode === focusNode && anchorOffset === focusOffset && (needsRecovery = !!anchorNode.firstChild && "BR" !== anchorNode.firstChild.nodeName)),
{
selectionState: getUpdatedSelectionState(editorState, anchorPoint.key, anchorPoint.offset, focusPoint.key, focusPoint.offset),
needsRecovery: needsRecovery
};
}
/**
* Identify the first leaf descendant for the given node.
*/
function getFirstLeaf(node) {
for (;node.firstChild && getSelectionOffsetKeyForNode(node.firstChild); ) node = node.firstChild;
return node;
}
/**
* Identify the last leaf descendant for the given node.
*/
function getLastLeaf(node) {
for (;node.lastChild && getSelectionOffsetKeyForNode(node.lastChild); ) node = node.lastChild;
return node;
}
function getPointForNonTextNode(editorRoot, startNode, childOffset) {
var node = startNode, offsetKey = findAncestorOffsetKey(node);
// If the child offset is zero and we have an offset key, we're done.
// If there's no offset key because the entire editor is selected,
// find the leftmost ("first") leaf in the tree and use that as the offset
// key.
if (null != offsetKey || editorRoot && (editorRoot === node || editorRoot.firstChild === node) ? void 0 : invariant(!1),
// If the editorRoot is the selection, step downward into the content
// wrapper.
editorRoot === node && (node = node.firstChild, node instanceof Element && "true" === node.getAttribute("data-contents") ? void 0 : invariant(!1),
childOffset > 0 && (childOffset = node.childNodes.length)), 0 === childOffset) {
var key = null;
if (null != offsetKey) key = offsetKey; else {
var firstLeaf = getFirstLeaf(node);
key = nullthrows(getSelectionOffsetKeyForNode(firstLeaf));
}
return {
key: key,
offset: 0
};
}
var nodeBeforeCursor = node.childNodes[childOffset - 1], leafKey = null, textLength = null;
if (getSelectionOffsetKeyForNode(nodeBeforeCursor)) {
// Otherwise, we'll look at the child to the left of the cursor and find
// the last leaf node in its subtree.
var lastLeaf = getLastLeaf(nodeBeforeCursor);
leafKey = nullthrows(getSelectionOffsetKeyForNode(lastLeaf)), textLength = getTextContentLength(lastLeaf);
} else // Our target node may be a leaf or a text node, in which case we're
// already where we want to be and can just use the child's length as
// our offset.
leafKey = nullthrows(offsetKey), textLength = getTextContentLength(nodeBeforeCursor);
return {
key: leafKey,
offset: textLength
};
}
/**
* Return the length of a node's textContent, regarding single newline
* characters as zero-length. This allows us to avoid problems with identifying
* the correct selection offset for empty blocks in IE, in which we
* render newlines instead of break tags.
*/
function getTextContentLength(node) {
var textContent = node.textContent;
return "\n" === textContent ? 0 : textContent.length;
}
var findAncestorOffsetKey = __webpack_require__(83), getSelectionOffsetKeyForNode = __webpack_require__(84), getUpdatedSelectionState = __webpack_require__(86), invariant = __webpack_require__(17), nullthrows = __webpack_require__(39);
module.exports = getDraftEditorSelectionWithNodes;
}, /* 107 */
/***/
function(module, exports) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule moveSelectionBackward
*
*/
"use strict";
/**
* Given a collapsed selection, move the focus `maxDistance` backward within
* the selected block. If the selection will go beyond the start of the block,
* move focus to the end of the previous block, but no further.
*
* This function is not Unicode-aware, so surrogate pairs will be treated
* as having length 2.
*/
function moveSelectionBackward(editorState, maxDistance) {
var selection = editorState.getSelection(), content = editorState.getCurrentContent(), key = selection.getStartKey(), offset = selection.getStartOffset(), focusKey = key, focusOffset = 0;
if (maxDistance > offset) {
var keyBefore = content.getKeyBefore(key);
if (null == keyBefore) focusKey = key; else {
focusKey = keyBefore;
var blockBefore = content.getBlockForKey(keyBefore);
focusOffset = blockBefore.getText().length;
}
} else focusOffset = offset - maxDistance;
return selection.merge({
focusKey: focusKey,
focusOffset: focusOffset,
isBackward: !0
});
}
module.exports = moveSelectionBackward;
}, /* 108 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule removeTextWithStrategy
*
*/
"use strict";
/**
* For a collapsed selection state, remove text based on the specified strategy.
* If the selection state is not collapsed, remove the entire selected range.
*/
function removeTextWithStrategy(editorState, strategy, direction) {
var selection = editorState.getSelection(), content = editorState.getCurrentContent(), target = selection;
if (selection.isCollapsed()) {
if ("forward" === direction) {
if (editorState.isSelectionAtEndOfContent()) return content;
} else if (editorState.isSelectionAtStartOfContent()) return content;
if (target = strategy(editorState), target === selection) return content;
}
return DraftModifier.removeRange(content, target, direction);
}
var DraftModifier = __webpack_require__(9);
module.exports = removeTextWithStrategy;
}, /* 109 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule keyCommandBackspaceWord
*
*/
"use strict";
/**
* Delete the word that is left of the cursor, as well as any spaces or
* punctuation after the word.
*/
function keyCommandBackspaceWord(editorState) {
var afterRemoval = removeTextWithStrategy(editorState, function(strategyState) {
var selection = strategyState.getSelection(), offset = selection.getStartOffset();
// If there are no words before the cursor, remove the preceding newline.
if (0 === offset) return moveSelectionBackward(strategyState, 1);
var key = selection.getStartKey(), content = strategyState.getCurrentContent(), text = content.getBlockForKey(key).getText().slice(0, offset), toRemove = DraftRemovableWord.getBackward(text);
return moveSelectionBackward(strategyState, toRemove.length || 1);
}, "backward");
return afterRemoval === editorState.getCurrentContent() ? editorState : EditorState.push(editorState, afterRemoval, "remove-range");
}
var DraftRemovableWord = __webpack_require__(110), EditorState = __webpack_require__(29), moveSelectionBackward = __webpack_require__(107), removeTextWithStrategy = __webpack_require__(108);
module.exports = keyCommandBackspaceWord;
}, /* 110 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule DraftRemovableWord
* @typechecks
*
*/
"use strict";
function getRemovableWord(text, isBackward) {
var matches = isBackward ? BACKSPACE_REGEX.exec(text) : DELETE_REGEX.exec(text);
return matches ? matches[0] : text;
}
var TokenizeUtil = __webpack_require__(111), punctuation = TokenizeUtil.getPunctuation(), CHAMELEON_CHARS = "['‘’]", WHITESPACE_AND_PUNCTUATION = "\\s|(?![_])" + punctuation, DELETE_STRING = "^(?:" + WHITESPACE_AND_PUNCTUATION + ")*(?:" + CHAMELEON_CHARS + "|(?!" + WHITESPACE_AND_PUNCTUATION + ").)*(?:(?!" + WHITESPACE_AND_PUNCTUATION + ").)", DELETE_REGEX = new RegExp(DELETE_STRING), BACKSPACE_STRING = "(?:(?!" + WHITESPACE_AND_PUNCTUATION + ").)(?:" + CHAMELEON_CHARS + "|(?!" + WHITESPACE_AND_PUNCTUATION + ").)*(?:" + WHITESPACE_AND_PUNCTUATION + ")*$", BACKSPACE_REGEX = new RegExp(BACKSPACE_STRING), DraftRemovableWord = {
getBackward: function(text) {
return getRemovableWord(text, !0);
},
getForward: function(text) {
return getRemovableWord(text, !1);
}
};
module.exports = DraftRemovableWord;
}, /* 111 */
/***/
function(module, exports) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @typechecks
* @stub
*
*/
"use strict";
// \u00a1-\u00b1\u00b4-\u00b8\u00ba\u00bb\u00bf
// is latin supplement punctuation except fractions and superscript
// numbers
// \u2010-\u2027\u2030-\u205e
// is punctuation from the general punctuation block:
// weird quotes, commas, bullets, dashes, etc.
// \u30fb\u3001\u3002\u3008-\u3011\u3014-\u301f
// is CJK punctuation
// \uff1a-\uff1f\uff01-\uff0f\uff3b-\uff40\uff5b-\uff65
// is some full-width/half-width punctuation
// \u2E2E\u061f\u066a-\u066c\u061b\u060c\u060d\uFD3e\uFD3F
// is some Arabic punctuation marks
// \u1801\u0964\u104a\u104b
// is misc. other language punctuation marks
var PUNCTUATION = "[.,+*?$|#{}()'\\^\\-\\[\\]\\\\\\/!@%\"~=<>_:;・、。〈-】〔-〟:-?!-/[-`{-・⸮؟٪-٬؛،؍﴾﴿᠁।၊။‐-‧‰-⁞¡-±´-¸º»¿]";
module.exports = {
getPunctuation: function() {
return PUNCTUATION;
}
};
}, /* 112 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule keyCommandDeleteWord
*
*/
"use strict";
/**
* Delete the word that is right of the cursor, as well as any spaces or
* punctuation before the word.
*/
function keyCommandDeleteWord(editorState) {
var afterRemoval = removeTextWithStrategy(editorState, function(strategyState) {
var selection = strategyState.getSelection(), offset = selection.getStartOffset(), key = selection.getStartKey(), content = strategyState.getCurrentContent(), text = content.getBlockForKey(key).getText().slice(offset), toRemove = DraftRemovableWord.getForward(text);
// If there are no words in front of the cursor, remove the newline.
return moveSelectionForward(strategyState, toRemove.length || 1);
}, "forward");
return afterRemoval === editorState.getCurrentContent() ? editorState : EditorState.push(editorState, afterRemoval, "remove-range");
}
var DraftRemovableWord = __webpack_require__(110), EditorState = __webpack_require__(29), moveSelectionForward = __webpack_require__(113), removeTextWithStrategy = __webpack_require__(108);
module.exports = keyCommandDeleteWord;
}, /* 113 */
/***/
function(module, exports) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule moveSelectionForward
*
*/
"use strict";
/**
* Given a collapsed selection, move the focus `maxDistance` forward within
* the selected block. If the selection will go beyond the end of the block,
* move focus to the start of the next block, but no further.
*
* This function is not Unicode-aware, so surrogate pairs will be treated
* as having length 2.
*/
function moveSelectionForward(editorState, maxDistance) {
var focusOffset, selection = editorState.getSelection(), key = selection.getStartKey(), offset = selection.getStartOffset(), content = editorState.getCurrentContent(), focusKey = key, block = content.getBlockForKey(key);
return maxDistance > block.getText().length - offset ? (focusKey = content.getKeyAfter(key),
focusOffset = 0) : focusOffset = offset + maxDistance, selection.merge({
focusKey: focusKey,
focusOffset: focusOffset
});
}
module.exports = moveSelectionForward;
}, /* 114 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule keyCommandInsertNewline
*
*/
"use strict";
function keyCommandInsertNewline(editorState) {
var contentState = DraftModifier.splitBlock(editorState.getCurrentContent(), editorState.getSelection());
return EditorState.push(editorState, contentState, "split-block");
}
var DraftModifier = __webpack_require__(9), EditorState = __webpack_require__(29);
module.exports = keyCommandInsertNewline;
}, /* 115 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule keyCommandPlainBackspace
*
*/
"use strict";
/**
* Remove the selected range. If the cursor is collapsed, remove the preceding
* character. This operation is Unicode-aware, so removing a single character
* will remove a surrogate pair properly as well.
*/
function keyCommandPlainBackspace(editorState) {
var afterRemoval = removeTextWithStrategy(editorState, function(strategyState) {
var selection = strategyState.getSelection(), content = strategyState.getCurrentContent(), key = selection.getAnchorKey(), offset = selection.getAnchorOffset(), charBehind = content.getBlockForKey(key).getText()[offset - 1];
return moveSelectionBackward(strategyState, charBehind ? UnicodeUtils.getUTF16Length(charBehind, 0) : 1);
}, "backward");
if (afterRemoval === editorState.getCurrentContent()) return editorState;
var selection = editorState.getSelection();
return EditorState.push(editorState, afterRemoval.set("selectionBefore", selection), selection.isCollapsed() ? "backspace-character" : "remove-range");
}
var EditorState = __webpack_require__(29), UnicodeUtils = __webpack_require__(104), moveSelectionBackward = __webpack_require__(107), removeTextWithStrategy = __webpack_require__(108);
module.exports = keyCommandPlainBackspace;
}, /* 116 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule keyCommandPlainDelete
*
*/
"use strict";
/**
* Remove the selected range. If the cursor is collapsed, remove the following
* character. This operation is Unicode-aware, so removing a single character
* will remove a surrogate pair properly as well.
*/
function keyCommandPlainDelete(editorState) {
var afterRemoval = removeTextWithStrategy(editorState, function(strategyState) {
var selection = strategyState.getSelection(), content = strategyState.getCurrentContent(), key = selection.getAnchorKey(), offset = selection.getAnchorOffset(), charAhead = content.getBlockForKey(key).getText()[offset];
return moveSelectionForward(strategyState, charAhead ? UnicodeUtils.getUTF16Length(charAhead, 0) : 1);
}, "forward");
if (afterRemoval === editorState.getCurrentContent()) return editorState;
var selection = editorState.getSelection();
return EditorState.push(editorState, afterRemoval.set("selectionBefore", selection), selection.isCollapsed() ? "delete-character" : "remove-range");
}
var EditorState = __webpack_require__(29), UnicodeUtils = __webpack_require__(104), moveSelectionForward = __webpack_require__(113), removeTextWithStrategy = __webpack_require__(108);
module.exports = keyCommandPlainDelete;
}, /* 117 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule keyCommandMoveSelectionToEndOfBlock
*
*/
"use strict";
/**
* See comment for `moveSelectionToStartOfBlock`.
*/
function keyCommandMoveSelectionToEndOfBlock(editorState) {
var selection = editorState.getSelection(), endKey = selection.getEndKey(), content = editorState.getCurrentContent(), textLength = content.getBlockForKey(endKey).getLength();
return EditorState.set(editorState, {
selection: selection.merge({
anchorKey: endKey,
anchorOffset: textLength,
focusKey: endKey,
focusOffset: textLength,
isBackward: !1
}),
forceSelection: !0
});
}
var EditorState = __webpack_require__(29);
module.exports = keyCommandMoveSelectionToEndOfBlock;
}, /* 118 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule keyCommandMoveSelectionToStartOfBlock
*
*/
"use strict";
/**
* Collapse selection at the start of the first selected block. This is used
* for Firefox versions that attempt to navigate forward/backward instead of
* moving the cursor. Other browsers are able to move the cursor natively.
*/
function keyCommandMoveSelectionToStartOfBlock(editorState) {
var selection = editorState.getSelection(), startKey = selection.getStartKey();
return EditorState.set(editorState, {
selection: selection.merge({
anchorKey: startKey,
anchorOffset: 0,
focusKey: startKey,
focusOffset: 0,
isBackward: !1
}),
forceSelection: !0
});
}
var EditorState = __webpack_require__(29);
module.exports = keyCommandMoveSelectionToStartOfBlock;
}, /* 119 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule keyCommandTransposeCharacters
*
*/
"use strict";
/**
* Transpose the characters on either side of a collapsed cursor, or
* if the cursor is at the end of the block, transpose the last two
* characters.
*/
function keyCommandTransposeCharacters(editorState) {
var selection = editorState.getSelection();
if (!selection.isCollapsed()) return editorState;
var offset = selection.getAnchorOffset();
if (0 === offset) return editorState;
var blockKey = selection.getAnchorKey(), content = editorState.getCurrentContent(), block = content.getBlockForKey(blockKey), length = block.getLength();
// Nothing to transpose if there aren't two characters.
if (length <= 1) return editorState;
var removalRange, finalSelection;
offset === length ? (// The cursor is at the end of the block. Swap the last two characters.
removalRange = selection.set("anchorOffset", offset - 1), finalSelection = selection) : (removalRange = selection.set("focusOffset", offset + 1),
finalSelection = removalRange.set("anchorOffset", offset + 1));
// Extract the character to move as a fragment. This preserves its
// styling and entity, if any.
var movedFragment = getContentStateFragment(content, removalRange), afterRemoval = DraftModifier.removeRange(content, removalRange, "backward"), selectionAfter = afterRemoval.getSelectionAfter(), targetOffset = selectionAfter.getAnchorOffset() - 1, targetRange = selectionAfter.merge({
anchorOffset: targetOffset,
focusOffset: targetOffset
}), afterInsert = DraftModifier.replaceWithFragment(afterRemoval, targetRange, movedFragment), newEditorState = EditorState.push(editorState, afterInsert, "insert-fragment");
return EditorState.acceptSelection(newEditorState, finalSelection);
}
var DraftModifier = __webpack_require__(9), EditorState = __webpack_require__(29), getContentStateFragment = __webpack_require__(20);
module.exports = keyCommandTransposeCharacters;
}, /* 120 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule keyCommandUndo
*
*/
"use strict";
function keyCommandUndo(e, editorState, updateFn) {
var undoneState = EditorState.undo(editorState);
// If the last change to occur was a spellcheck change, allow the undo
// event to fall through to the browser. This allows the browser to record
// the unwanted change, which should soon lead it to learn not to suggest
// the correction again.
if ("spellcheck-change" === editorState.getLastChangeType()) {
var nativelyRenderedContent = undoneState.getCurrentContent();
return void updateFn(EditorState.set(undoneState, {
nativelyRenderedContent: nativelyRenderedContent
}));
}
// Otheriwse, manage the undo behavior manually.
// Trigger a re-render with the current content state to ensure that the
// component tree has up-to-date props for comparison.
// Wait to ensure that the re-render has occurred before performing
// the undo action.
return e.preventDefault(), editorState.getNativelyRenderedContent() ? (updateFn(EditorState.set(editorState, {
nativelyRenderedContent: null
})), void setTimeout(function() {
updateFn(undoneState);
}, 0)) : void updateFn(undoneState);
}
var EditorState = __webpack_require__(29);
module.exports = keyCommandUndo;
}, /* 121 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule editOnPaste
*
*/
"use strict";
/**
* Paste content.
*/
function editOnPaste(e) {
var _this = this;
e.preventDefault();
var data = new DataTransfer(e.clipboardData);
// Get files, unless this is likely to be a string the user wants inline.
if (!data.isRichText()) {
var files = data.getFiles(), defaultFileText = data.getText();
if (files.length > 0) {
// Allow customized paste handling for images, etc. Otherwise, fall
// through to insert text contents into the editor.
if (this.props.handlePastedFiles && isEventHandled(this.props.handlePastedFiles(files))) return;
return void getTextContentFromFiles(files, function(/*string*/ fileText) {
if (fileText = fileText || defaultFileText) {
var editorState = _this.props.editorState, blocks = splitTextIntoTextBlocks(fileText), character = CharacterMetadata.create({
style: editorState.getCurrentInlineStyle(),
entity: getEntityKeyForSelection(editorState.getCurrentContent(), editorState.getSelection())
}), text = DraftPasteProcessor.processText(blocks, character), fragment = BlockMapBuilder.createFromArray(text), withInsertedText = DraftModifier.replaceWithFragment(editorState.getCurrentContent(), editorState.getSelection(), fragment);
_this.update(EditorState.push(editorState, withInsertedText, "insert-fragment"));
}
});
}
}
var textBlocks = [], text = data.getText(), html = data.getHTML();
if (!this.props.handlePastedText || !isEventHandled(this.props.handlePastedText(text, html))) {
if (text && (textBlocks = splitTextIntoTextBlocks(text)), !this.props.stripPastedStyles) {
// If the text from the paste event is rich content that matches what we
// already have on the internal clipboard, assume that we should just use
// the clipboard fragment for the paste. This will allow us to preserve
// styling and entities, if any are present. Note that newlines are
// stripped during comparison -- this is because copy/paste within the
// editor in Firefox and IE will not include empty lines. The resulting
// paste will preserve the newlines correctly.
var internalClipboard = this.getClipboard();
if (data.isRichText() && internalClipboard) {
if (// If the editorKey is present in the pasted HTML, it should be safe to
// assume this is an internal paste.
html.indexOf(this.getEditorKey()) !== -1 || // The copy may have been made within a single block, in which case the
// editor key won't be part of the paste. In this case, just check
// whether the pasted text matches the internal clipboard.
1 === textBlocks.length && 1 === internalClipboard.size && internalClipboard.first().getText() === text) return void this.update(insertFragment(this.props.editorState, internalClipboard));
} else if (internalClipboard && data.types.includes("com.apple.webarchive") && !data.types.includes("text/html") && areTextBlocksAndClipboardEqual(textBlocks, internalClipboard)) // Safari does not properly store text/html in some cases.
// Use the internalClipboard if present and equal to what is on
// the clipboard. See https://bugs.webkit.org/show_bug.cgi?id=19893.
return void this.update(insertFragment(this.props.editorState, internalClipboard));
// If there is html paste data, try to parse that.
if (html) {
var htmlFragment = DraftPasteProcessor.processHTML(html, this.props.blockRenderMap);
if (htmlFragment) {
var htmlMap = BlockMapBuilder.createFromArray(htmlFragment);
return void this.update(insertFragment(this.props.editorState, htmlMap));
}
}
// Otherwise, create a new fragment from our pasted text. Also
// empty the internal clipboard, since it's no longer valid.
this.setClipboard(null);
}
if (textBlocks) {
var editorState = this.props.editorState, character = CharacterMetadata.create({
style: editorState.getCurrentInlineStyle(),
entity: getEntityKeyForSelection(editorState.getCurrentContent(), editorState.getSelection())
}), textFragment = DraftPasteProcessor.processText(textBlocks, character), textMap = BlockMapBuilder.createFromArray(textFragment);
this.update(insertFragment(this.props.editorState, textMap));
}
}
}
function insertFragment(editorState, fragment) {
var newContent = DraftModifier.replaceWithFragment(editorState.getCurrentContent(), editorState.getSelection(), fragment);
return EditorState.push(editorState, newContent, "insert-fragment");
}
function areTextBlocksAndClipboardEqual(textBlocks, blockMap) {
return textBlocks.length === blockMap.size && blockMap.valueSeq().every(function(block, ii) {
return block.getText() === textBlocks[ii];
});
}
var BlockMapBuilder = __webpack_require__(4), CharacterMetadata = __webpack_require__(6), DataTransfer = __webpack_require__(80), DraftModifier = __webpack_require__(9), DraftPasteProcessor = __webpack_require__(122), EditorState = __webpack_require__(29), getEntityKeyForSelection = __webpack_require__(47), getTextContentFromFiles = __webpack_require__(85), splitTextIntoTextBlocks = __webpack_require__(126), isEventHandled = __webpack_require__(87);
module.exports = editOnPaste;
}, /* 122 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule DraftPasteProcessor
* @typechecks
*
*/
"use strict";
var ContentBlock = (__webpack_require__(6), __webpack_require__(7)), Immutable = __webpack_require__(5), convertFromHTMLtoContentBlocks = __webpack_require__(123), generateRandomKey = __webpack_require__(21), getSafeBodyFromHTML = __webpack_require__(125), sanitizeDraftText = __webpack_require__(34), List = Immutable.List, Repeat = Immutable.Repeat, DraftPasteProcessor = {
processHTML: function(html, blockRenderMap) {
return convertFromHTMLtoContentBlocks(html, getSafeBodyFromHTML, blockRenderMap);
},
processText: function(textBlocks, character) {
return textBlocks.map(function(textLine) {
return textLine = sanitizeDraftText(textLine), new ContentBlock({
key: generateRandomKey(),
type: "unstyled",
text: textLine,
characterList: List(Repeat(character, textLine.length))
});
});
}
};
module.exports = DraftPasteProcessor;
}, /* 123 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule convertFromHTMLToContentBlocks
* @typechecks
*
*/
"use strict";
function getEmptyChunk() {
return {
text: "",
inlines: [],
entities: [],
blocks: []
};
}
function getWhitespaceChunk(inEntity) {
var entities = new Array(1);
return inEntity && (entities[0] = inEntity), {
text: SPACE,
inlines: [ OrderedSet() ],
entities: entities,
blocks: []
};
}
function getSoftNewlineChunk() {
return {
text: "\n",
inlines: [ OrderedSet() ],
entities: new Array(1),
blocks: []
};
}
function getBlockDividerChunk(block, depth) {
return {
text: "\r",
inlines: [ OrderedSet() ],
entities: new Array(1),
blocks: [ {
type: block,
depth: Math.max(0, Math.min(MAX_DEPTH, depth))
} ]
};
}
function getListBlockType(tag, lastList) {
return "li" === tag ? "ol" === lastList ? "ordered-list-item" : "unordered-list-item" : null;
}
function getBlockMapSupportedTags(blockRenderMap) {
var unstyledElement = blockRenderMap.get("unstyled").element;
return blockRenderMap.map(function(config) {
return config.element;
}).valueSeq().toSet().filter(function(tag) {
return tag && tag !== unstyledElement;
}).toArray().sort();
}
// custom element conversions
function getMultiMatchedType(tag, lastList, multiMatchExtractor) {
for (var ii = 0; ii < multiMatchExtractor.length; ii++) {
var matchType = multiMatchExtractor[ii](tag, lastList);
if (matchType) return matchType;
}
return null;
}
function getBlockTypeForTag(tag, lastList, blockRenderMap) {
var matchedTypes = blockRenderMap.filter(function(config) {
return config.element === tag || config.wrapper === tag;
}).keySeq().toSet().toArray().sort();
// if we dont have any matched type, return unstyled
// if we have one matched type return it
// if we have multi matched types use the multi-match function to gather type
switch (matchedTypes.length) {
case 0:
return "unstyled";
case 1:
return matchedTypes[0];
default:
return getMultiMatchedType(tag, lastList, [ getListBlockType ]) || "unstyled";
}
}
function processInlineTag(tag, node, currentStyle) {
var styleToCheck = inlineTags[tag];
return styleToCheck ? currentStyle = currentStyle.add(styleToCheck).toOrderedSet() : node instanceof HTMLElement && !function() {
var htmlElement = node;
currentStyle = currentStyle.withMutations(function(style) {
var fontWeight = htmlElement.style.fontWeight, fontStyle = htmlElement.style.fontStyle, textDecoration = htmlElement.style.textDecoration;
boldValues.indexOf(fontWeight) >= 0 ? style.add("BOLD") : notBoldValues.indexOf(fontWeight) >= 0 && style.remove("BOLD"),
"italic" === fontStyle ? style.add("ITALIC") : "normal" === fontStyle && style.remove("ITALIC"),
"underline" === textDecoration && style.add("UNDERLINE"), "line-through" === textDecoration && style.add("STRIKETHROUGH"),
"none" === textDecoration && (style.remove("UNDERLINE"), style.remove("STRIKETHROUGH"));
}).toOrderedSet();
}(), currentStyle;
}
function joinChunks(A, B) {
// Sometimes two blocks will touch in the DOM and we need to strip the
// extra delimiter to preserve niceness.
var lastInA = A.text.slice(-1), firstInB = B.text.slice(0, 1);
// Kill whitespace after blocks
if ("\r" === lastInA && "\r" === firstInB && (A.text = A.text.slice(0, -1), A.inlines.pop(),
A.entities.pop(), A.blocks.pop()), "\r" === lastInA) {
if (B.text === SPACE || "\n" === B.text) return A;
firstInB !== SPACE && "\n" !== firstInB || (B.text = B.text.slice(1), B.inlines.shift(),
B.entities.shift());
}
return {
text: A.text + B.text,
inlines: A.inlines.concat(B.inlines),
entities: A.entities.concat(B.entities),
blocks: A.blocks.concat(B.blocks)
};
}
/**
* Check to see if we have anything like <p> <blockquote> <h1>... to create
* block tags from. If we do, we can use those and ignore <div> tags. If we
* don't, we can treat <div> tags as meaningful (unstyled) blocks.
*/
function containsSemanticBlockMarkup(html, blockTags) {
return blockTags.some(function(tag) {
return html.indexOf("<" + tag) !== -1;
});
}
function hasValidLinkText(link) {
link instanceof HTMLAnchorElement ? void 0 : invariant(!1);
var protocol = link.protocol;
return "http:" === protocol || "https:" === protocol || "mailto:" === protocol;
}
function genFragment(node, inlineStyle, lastList, inBlock, blockTags, depth, blockRenderMap, inEntity) {
var nodeName = node.nodeName.toLowerCase(), newBlock = !1, nextBlockType = "unstyled", lastLastBlock = lastBlock;
// Base Case
if ("#text" === nodeName) {
var text = node.textContent;
// Can't use empty string because MSWord
// save the last block so we can use it later
return "" === text.trim() && "pre" !== inBlock ? getWhitespaceChunk(inEntity) : ("pre" !== inBlock && (text = text.replace(REGEX_LF, SPACE)),
lastBlock = nodeName, {
text: text,
inlines: Array(text.length).fill(inlineStyle),
entities: Array(text.length).fill(inEntity),
blocks: []
});
}
// BR tags
if (// save the last block so we can use it later
lastBlock = nodeName, "br" === nodeName) return "br" !== lastLastBlock || inBlock && "unstyled" !== getBlockTypeForTag(inBlock, lastList, blockRenderMap) ? getSoftNewlineChunk() : getBlockDividerChunk("unstyled", depth);
var chunk = getEmptyChunk(), newChunk = null;
// Inline tags
inlineStyle = processInlineTag(nodeName, node, inlineStyle), // Handle lists
"ul" !== nodeName && "ol" !== nodeName || (lastList && (depth += 1), lastList = nodeName),
// Block Tags
inBlock || blockTags.indexOf(nodeName) === -1 ? lastList && "li" === inBlock && "li" === nodeName && (chunk = getBlockDividerChunk(getBlockTypeForTag(nodeName, lastList, blockRenderMap), depth),
inBlock = nodeName, newBlock = !0, nextBlockType = "ul" === lastList ? "unordered-list-item" : "ordered-list-item") : (chunk = getBlockDividerChunk(getBlockTypeForTag(nodeName, lastList, blockRenderMap), depth),
inBlock = nodeName, newBlock = !0);
// Recurse through children
var child = node.firstChild;
null != child && (nodeName = child.nodeName.toLowerCase());
for (var entityId = null; child; ) {
child instanceof HTMLAnchorElement && child.href && hasValidLinkText(child) ? !function() {
var anchor = child, entityConfig = {};
anchorAttr.forEach(function(attr) {
var anchorAttribute = anchor.getAttribute(attr);
anchorAttribute && (entityConfig[attr] = anchorAttribute);
}), entityConfig.url = new URI(anchor.href).toString(), entityId = DraftEntity.create("LINK", "MUTABLE", entityConfig);
}() : entityId = void 0, newChunk = genFragment(child, inlineStyle, lastList, inBlock, blockTags, depth, blockRenderMap, entityId || inEntity),
chunk = joinChunks(chunk, newChunk);
var sibling = child.nextSibling;
// Put in a newline to break up blocks inside blocks
sibling && blockTags.indexOf(nodeName) >= 0 && inBlock && (chunk = joinChunks(chunk, getSoftNewlineChunk())),
sibling && (nodeName = sibling.nodeName.toLowerCase()), child = sibling;
}
return newBlock && (chunk = joinChunks(chunk, getBlockDividerChunk(nextBlockType, depth))),
chunk;
}
function getChunkForHTML(html, DOMBuilder, blockRenderMap) {
html = html.trim().replace(REGEX_CR, "").replace(REGEX_NBSP, SPACE).replace(REGEX_CARRIAGE, "").replace(REGEX_ZWS, "");
var supportedBlockTags = getBlockMapSupportedTags(blockRenderMap), safeBody = DOMBuilder(html);
if (!safeBody) return null;
lastBlock = null;
// Sometimes we aren't dealing with content that contains nice semantic
// tags. In this case, use divs to separate everything out into paragraphs
// and hope for the best.
var workingBlocks = containsSemanticBlockMarkup(html, supportedBlockTags) ? supportedBlockTags : [ "div" ], chunk = genFragment(safeBody, OrderedSet(), "ul", null, workingBlocks, -1, blockRenderMap);
// join with previous block to prevent weirdness on paste
// Kill block delimiter at the end
// If we saw no block tags, put an unstyled one in
// Sometimes we start with text that isn't in a block, which is then
// followed by blocks. Need to fix up the blocks to add in
// an unstyled block for this content
return 0 === chunk.text.indexOf("\r") && (chunk = {
text: chunk.text.slice(1),
inlines: chunk.inlines.slice(1),
entities: chunk.entities.slice(1),
blocks: chunk.blocks
}), "\r" === chunk.text.slice(-1) && (chunk.text = chunk.text.slice(0, -1), chunk.inlines = chunk.inlines.slice(0, -1),
chunk.entities = chunk.entities.slice(0, -1), chunk.blocks.pop()), 0 === chunk.blocks.length && chunk.blocks.push({
type: "unstyled",
depth: 0
}), chunk.text.split("\r").length === chunk.blocks.length + 1 && chunk.blocks.unshift({
type: "unstyled",
depth: 0
}), chunk;
}
function convertFromHTMLtoContentBlocks(html) {
var DOMBuilder = arguments.length <= 1 || void 0 === arguments[1] ? getSafeBodyFromHTML : arguments[1], blockRenderMap = arguments.length <= 2 || void 0 === arguments[2] ? DefaultDraftBlockRenderMap : arguments[2], chunk = getChunkForHTML(html, DOMBuilder, blockRenderMap);
if (null == chunk) return null;
var start = 0;
return chunk.text.split("\r").map(function(textBlock, ii) {
// Make absolutely certain that our text is acceptable.
textBlock = sanitizeDraftText(textBlock);
var end = start + textBlock.length, inlines = nullthrows(chunk).inlines.slice(start, end), entities = nullthrows(chunk).entities.slice(start, end), characterList = List(inlines.map(function(style, ii) {
var data = {
style: style,
entity: null
};
return entities[ii] && (data.entity = entities[ii]), CharacterMetadata.create(data);
}));
return start = end + 1, new ContentBlock({
key: generateRandomKey(),
type: nullthrows(chunk).blocks[ii].type,
depth: nullthrows(chunk).blocks[ii].depth,
text: textBlock,
characterList: characterList
});
});
}
var lastBlock, CharacterMetadata = __webpack_require__(6), ContentBlock = __webpack_require__(7), DefaultDraftBlockRenderMap = __webpack_require__(41), DraftEntity = __webpack_require__(14), Immutable = __webpack_require__(5), URI = __webpack_require__(124), generateRandomKey = __webpack_require__(21), getSafeBodyFromHTML = __webpack_require__(125), invariant = __webpack_require__(17), nullthrows = __webpack_require__(39), sanitizeDraftText = __webpack_require__(34), List = Immutable.List, OrderedSet = Immutable.OrderedSet, NBSP = " ", SPACE = " ", MAX_DEPTH = 4, REGEX_CR = new RegExp("\r", "g"), REGEX_LF = new RegExp("\n", "g"), REGEX_NBSP = new RegExp(NBSP, "g"), REGEX_CARRIAGE = new RegExp(" ?", "g"), REGEX_ZWS = new RegExp("​?", "g"), boldValues = [ "bold", "bolder", "500", "600", "700", "800", "900" ], notBoldValues = [ "light", "lighter", "100", "200", "300", "400" ], inlineTags = {
b: "BOLD",
code: "CODE",
del: "STRIKETHROUGH",
em: "ITALIC",
i: "ITALIC",
s: "STRIKETHROUGH",
strike: "STRIKETHROUGH",
strong: "BOLD",
u: "UNDERLINE"
}, anchorAttr = [ "className", "href", "rel", "target", "title" ];
module.exports = convertFromHTMLtoContentBlocks;
}, /* 124 */
/***/
function(module, exports) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
"use strict";
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
}
var URI = function() {
function URI(uri) {
_classCallCheck(this, URI), this._uri = uri;
}
return URI.prototype.toString = function() {
return this._uri;
}, URI;
}();
module.exports = URI;
}, /* 125 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule getSafeBodyFromHTML
*
*/
"use strict";
// Provides a dom node that will not execute scripts
// https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation.createHTMLDocument
// https://developer.mozilla.org/en-US/Add-ons/Code_snippets/HTML_to_DOM
function getSafeBodyFromHTML(html) {
var doc, root = null;
// Provides a safe context
return !isOldIE && document.implementation && document.implementation.createHTMLDocument && (doc = document.implementation.createHTMLDocument("foo"),
doc.documentElement.innerHTML = html, root = doc.getElementsByTagName("body")[0]),
root;
}
var UserAgent = __webpack_require__(54), isOldIE = UserAgent.isBrowser("IE <= 9");
module.exports = getSafeBodyFromHTML;
}, /* 126 */
/***/
function(module, exports) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule splitTextIntoTextBlocks
*
*/
"use strict";
function splitTextIntoTextBlocks(text) {
return text.split(NEWLINE_REGEX);
}
var NEWLINE_REGEX = /\r\n?|\n/g;
module.exports = splitTextIntoTextBlocks;
}, /* 127 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule editOnSelect
*
*/
"use strict";
function editOnSelect() {
if (!this._blockSelectEvents) {
var editorState = this.props.editorState, documentSelection = getDraftEditorSelection(editorState, ReactDOM.findDOMNode(this.refs.editorContainer).firstChild), updatedSelectionState = documentSelection.selectionState;
updatedSelectionState !== editorState.getSelection() && (editorState = documentSelection.needsRecovery ? EditorState.forceSelection(editorState, updatedSelectionState) : EditorState.acceptSelection(editorState, updatedSelectionState),
this.update(editorState));
}
}
var EditorState = __webpack_require__(29), ReactDOM = __webpack_require__(53), getDraftEditorSelection = __webpack_require__(128);
module.exports = editOnSelect;
}, /* 128 */
/***/
function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */
(function(global) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule getDraftEditorSelection
* @typechecks
*
*/
"use strict";
/**
* Convert the current selection range to an anchor/focus pair of offset keys
* and values that can be interpreted by components.
*/
function getDraftEditorSelection(editorState, root) {
var selection = global.getSelection();
// No active selection.
// No active selection.
return 0 === selection.rangeCount ? {
selectionState: editorState.getSelection().set("hasFocus", !1),
needsRecovery: !1
} : getDraftEditorSelectionWithNodes(editorState, root, selection.anchorNode, selection.anchorOffset, selection.focusNode, selection.focusOffset);
}
var getDraftEditorSelectionWithNodes = __webpack_require__(106);
module.exports = getDraftEditorSelection;
}).call(exports, function() {
return this;
}());
}, /* 129 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule DraftEditorPlaceholder.react
* @typechecks
*
*/
"use strict";
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 || "object" != typeof call && "function" != typeof call ? self : call;
}
function _inherits(subClass, superClass) {
if ("function" != typeof superClass && null !== superClass) 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: !1,
writable: !0,
configurable: !0
}
}), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass);
}
var React = __webpack_require__(1), cx = __webpack_require__(42), DraftEditorPlaceholder = function(_React$Component) {
function DraftEditorPlaceholder() {
return _classCallCheck(this, DraftEditorPlaceholder), _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
}
return _inherits(DraftEditorPlaceholder, _React$Component), DraftEditorPlaceholder.prototype.shouldComponentUpdate = function(nextProps) {
return this.props.text !== nextProps.text || this.props.editorState.getSelection().getHasFocus() !== nextProps.editorState.getSelection().getHasFocus();
}, DraftEditorPlaceholder.prototype.render = function() {
var hasFocus = this.props.editorState.getSelection().getHasFocus(), className = cx({
"public/DraftEditorPlaceholder/root": !0,
"public/DraftEditorPlaceholder/hasFocus": hasFocus
});
return React.createElement("div", {
className: className
}, React.createElement("div", {
className: cx("public/DraftEditorPlaceholder/inner"),
id: this.props.accessibilityID
}, this.props.text));
}, DraftEditorPlaceholder;
}(React.Component);
module.exports = DraftEditorPlaceholder;
}, /* 130 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule getDefaultKeyBinding
* @typechecks
*
*/
"use strict";
function shouldRemoveWord(e) {
return isOSX && e.altKey || isCtrlKeyCommand(e);
}
/**
* Get the appropriate undo/redo command for a Z key command.
*/
function getZCommand(e) {
return hasCommandModifier(e) ? e.shiftKey ? "redo" : "undo" : null;
}
function getDeleteCommand(e) {
// Allow default "cut" behavior for Windows on Shift + Delete.
// Allow default "cut" behavior for Windows on Shift + Delete.
return isWindows && e.shiftKey ? null : shouldRemoveWord(e) ? "delete-word" : "delete";
}
function getBackspaceCommand(e) {
return hasCommandModifier(e) && isOSX ? "backspace-to-start-of-line" : shouldRemoveWord(e) ? "backspace-word" : "backspace";
}
/**
* Retrieve a bound key command for the given event.
*/
function getDefaultKeyBinding(e) {
switch (e.keyCode) {
case 66:
// B
return hasCommandModifier(e) ? "bold" : null;
case 68:
// D
return isCtrlKeyCommand(e) ? "delete" : null;
case 72:
// H
return isCtrlKeyCommand(e) ? "backspace" : null;
case 73:
// I
return hasCommandModifier(e) ? "italic" : null;
case 74:
// J
return hasCommandModifier(e) ? "code" : null;
case 75:
// K
return !isWindows && isCtrlKeyCommand(e) ? "secondary-cut" : null;
case 77:
// M
return isCtrlKeyCommand(e) ? "split-block" : null;
case 79:
// O
return isCtrlKeyCommand(e) ? "split-block" : null;
case 84:
// T
return isOSX && isCtrlKeyCommand(e) ? "transpose-characters" : null;
case 85:
// U
return hasCommandModifier(e) ? "underline" : null;
case 87:
// W
return isOSX && isCtrlKeyCommand(e) ? "backspace-word" : null;
case 89:
// Y
// Y
return isCtrlKeyCommand(e) ? isWindows ? "redo" : "secondary-paste" : null;
case 90:
// Z
return getZCommand(e) || null;
case Keys.RETURN:
return "split-block";
case Keys.DELETE:
return getDeleteCommand(e);
case Keys.BACKSPACE:
return getBackspaceCommand(e);
// LEFT/RIGHT handlers serve as a workaround for a Firefox bug.
case Keys.LEFT:
return shouldFixFirefoxMovement && hasCommandModifier(e) ? "move-selection-to-start-of-block" : null;
case Keys.RIGHT:
return shouldFixFirefoxMovement && hasCommandModifier(e) ? "move-selection-to-end-of-block" : null;
default:
return null;
}
}
var KeyBindingUtil = __webpack_require__(100), Keys = __webpack_require__(46), UserAgent = __webpack_require__(54), isOSX = UserAgent.isPlatform("Mac OS X"), isWindows = UserAgent.isPlatform("Windows"), shouldFixFirefoxMovement = isOSX && UserAgent.isBrowser("Firefox < 29"), hasCommandModifier = KeyBindingUtil.hasCommandModifier, isCtrlKeyCommand = KeyBindingUtil.isCtrlKeyCommand;
module.exports = getDefaultKeyBinding;
}, /* 131 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule RichTextEditorUtil
* @typechecks
*
*/
"use strict";
var DraftEntity = __webpack_require__(14), DraftModifier = __webpack_require__(9), EditorState = __webpack_require__(29), adjustBlockDepthForContentState = (__webpack_require__(33),
__webpack_require__(132)), nullthrows = __webpack_require__(39), RichTextEditorUtil = {
currentBlockContainsLink: function(editorState) {
var selection = editorState.getSelection();
return editorState.getCurrentContent().getBlockForKey(selection.getAnchorKey()).getCharacterList().slice(selection.getStartOffset(), selection.getEndOffset()).some(function(v) {
var entity = v.getEntity();
return !!entity && "LINK" === DraftEntity.get(entity).getType();
});
},
getCurrentBlockType: function(editorState) {
var selection = editorState.getSelection();
return editorState.getCurrentContent().getBlockForKey(selection.getStartKey()).getType();
},
getDataObjectForLinkURL: function(uri) {
return {
url: uri.toString()
};
},
handleKeyCommand: function(editorState, command) {
switch (command) {
case "bold":
return RichTextEditorUtil.toggleInlineStyle(editorState, "BOLD");
case "italic":
return RichTextEditorUtil.toggleInlineStyle(editorState, "ITALIC");
case "underline":
return RichTextEditorUtil.toggleInlineStyle(editorState, "UNDERLINE");
case "code":
return RichTextEditorUtil.toggleCode(editorState);
case "backspace":
case "backspace-word":
case "backspace-to-start-of-line":
return RichTextEditorUtil.onBackspace(editorState);
case "delete":
case "delete-word":
case "delete-to-end-of-block":
return RichTextEditorUtil.onDelete(editorState);
default:
return null;
}
},
insertSoftNewline: function(editorState) {
var contentState = DraftModifier.insertText(editorState.getCurrentContent(), editorState.getSelection(), "\n", editorState.getCurrentInlineStyle(), null), newEditorState = EditorState.push(editorState, contentState, "insert-characters");
return EditorState.forceSelection(newEditorState, contentState.getSelectionAfter());
},
/**
* For collapsed selections at the start of styled blocks, backspace should
* just remove the existing style.
*/
onBackspace: function(editorState) {
var selection = editorState.getSelection();
if (!selection.isCollapsed() || selection.getAnchorOffset() || selection.getFocusOffset()) return null;
// First, try to remove a preceding atomic block.
var content = editorState.getCurrentContent(), startKey = selection.getStartKey(), blockBefore = content.getBlockBefore(startKey);
if (blockBefore && "atomic" === blockBefore.getType()) {
var atomicBlockTarget = selection.merge({
anchorKey: blockBefore.getKey(),
anchorOffset: 0
}), asCurrentStyle = DraftModifier.setBlockType(content, atomicBlockTarget, content.getBlockForKey(startKey).getType()), withoutAtomicBlock = DraftModifier.removeRange(asCurrentStyle, atomicBlockTarget, "backward");
if (withoutAtomicBlock !== content) return EditorState.push(editorState, withoutAtomicBlock, "remove-range");
}
// If that doesn't succeed, try to remove the current block style.
var withoutBlockStyle = RichTextEditorUtil.tryToRemoveBlockStyle(editorState);
return withoutBlockStyle ? EditorState.push(editorState, withoutBlockStyle, "change-block-type") : null;
},
onDelete: function(editorState) {
var selection = editorState.getSelection();
if (!selection.isCollapsed()) return null;
var content = editorState.getCurrentContent(), startKey = selection.getStartKey(), block = content.getBlockForKey(startKey), length = block.getLength();
// The cursor is somewhere within the text. Behave normally.
if (selection.getStartOffset() < length) return null;
var blockAfter = content.getBlockAfter(startKey);
if (!blockAfter || "atomic" !== blockAfter.getType()) return null;
var atomicBlockTarget = selection.merge({
focusKey: blockAfter.getKey(),
focusOffset: blockAfter.getLength()
}), withoutAtomicBlock = DraftModifier.removeRange(content, atomicBlockTarget, "forward");
return withoutAtomicBlock !== content ? EditorState.push(editorState, withoutAtomicBlock, "remove-range") : null;
},
onTab: function(event, editorState, maxDepth) {
var selection = editorState.getSelection(), key = selection.getAnchorKey();
if (key !== selection.getFocusKey()) return editorState;
var content = editorState.getCurrentContent(), block = content.getBlockForKey(key), type = block.getType();
if ("unordered-list-item" !== type && "ordered-list-item" !== type) return editorState;
event.preventDefault();
// Only allow indenting one level beyond the block above, and only if
// the block above is a list item as well.
var blockAbove = content.getBlockBefore(key);
if (!blockAbove) return editorState;
var typeAbove = blockAbove.getType();
if ("unordered-list-item" !== typeAbove && "ordered-list-item" !== typeAbove) return editorState;
var depth = block.getDepth();
if (!event.shiftKey && depth === maxDepth) return editorState;
maxDepth = Math.min(blockAbove.getDepth() + 1, maxDepth);
var withAdjustment = adjustBlockDepthForContentState(content, selection, event.shiftKey ? -1 : 1, maxDepth);
return EditorState.push(editorState, withAdjustment, "adjust-depth");
},
toggleBlockType: function(editorState, blockType) {
var selection = editorState.getSelection(), startKey = selection.getStartKey(), endKey = selection.getEndKey(), content = editorState.getCurrentContent(), target = selection;
// Triple-click can lead to a selection that includes offset 0 of the
// following block. The `SelectionState` for this case is accurate, but
// we should avoid toggling block type for the trailing block because it
// is a confusing interaction.
if (startKey !== endKey && 0 === selection.getEndOffset()) {
var blockBefore = nullthrows(content.getBlockBefore(endKey));
endKey = blockBefore.getKey(), target = target.merge({
anchorKey: startKey,
anchorOffset: selection.getStartOffset(),
focusKey: endKey,
focusOffset: blockBefore.getLength(),
isBackward: !1
});
}
var hasAtomicBlock = content.getBlockMap().skipWhile(function(_, k) {
return k !== startKey;
}).reverse().skipWhile(function(_, k) {
return k !== endKey;
}).some(function(v) {
return "atomic" === v.getType();
});
if (hasAtomicBlock) return editorState;
var typeToSet = content.getBlockForKey(startKey).getType() === blockType ? "unstyled" : blockType;
return EditorState.push(editorState, DraftModifier.setBlockType(content, target, typeToSet), "change-block-type");
},
toggleCode: function(editorState) {
var selection = editorState.getSelection(), anchorKey = selection.getAnchorKey(), focusKey = selection.getFocusKey();
return selection.isCollapsed() || anchorKey !== focusKey ? RichTextEditorUtil.toggleBlockType(editorState, "code-block") : RichTextEditorUtil.toggleInlineStyle(editorState, "CODE");
},
/**
* Toggle the specified inline style for the selection. If the
* user's selection is collapsed, apply or remove the style for the
* internal state. If it is not collapsed, apply the change directly
* to the document state.
*/
toggleInlineStyle: function(editorState, inlineStyle) {
var selection = editorState.getSelection(), currentStyle = editorState.getCurrentInlineStyle();
// If the selection is collapsed, toggle the specified style on or off and
// set the result as the new inline style override. This will then be
// used as the inline style for the next character to be inserted.
if (selection.isCollapsed()) return EditorState.setInlineStyleOverride(editorState, currentStyle.has(inlineStyle) ? currentStyle.remove(inlineStyle) : currentStyle.add(inlineStyle));
// If characters are selected, immediately apply or remove the
// inline style on the document state itself.
var newContent, content = editorState.getCurrentContent();
// If the style is already present for the selection range, remove it.
// Otherwise, apply it.
return newContent = currentStyle.has(inlineStyle) ? DraftModifier.removeInlineStyle(content, selection, inlineStyle) : DraftModifier.applyInlineStyle(content, selection, inlineStyle),
EditorState.push(editorState, newContent, "change-inline-style");
},
toggleLink: function(editorState, targetSelection, entityKey) {
var withoutLink = DraftModifier.applyEntity(editorState.getCurrentContent(), targetSelection, entityKey);
return EditorState.push(editorState, withoutLink, "apply-entity");
},
/**
* When a collapsed cursor is at the start of an empty styled block, allow
* certain key commands (newline, backspace) to simply change the
* style of the block instead of the default behavior.
*/
tryToRemoveBlockStyle: function(editorState) {
var selection = editorState.getSelection(), offset = selection.getAnchorOffset();
if (selection.isCollapsed() && 0 === offset) {
var key = selection.getAnchorKey(), content = editorState.getCurrentContent(), block = content.getBlockForKey(key);
if (block.getLength() > 0) return null;
var type = block.getType(), blockBefore = content.getBlockBefore(key);
if ("code-block" === type && blockBefore && "code-block" === blockBefore.getType()) return null;
if ("unstyled" !== type) return DraftModifier.setBlockType(content, selection, "unstyled");
}
return null;
}
};
module.exports = RichTextEditorUtil;
}, /* 132 */
/***/
function(module, exports) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule adjustBlockDepthForContentState
* @typechecks
*
*/
"use strict";
function adjustBlockDepthForContentState(contentState, selectionState, adjustment, maxDepth) {
var startKey = selectionState.getStartKey(), endKey = selectionState.getEndKey(), blockMap = contentState.getBlockMap(), blocks = blockMap.toSeq().skipUntil(function(_, k) {
return k === startKey;
}).takeUntil(function(_, k) {
return k === endKey;
}).concat([ [ endKey, blockMap.get(endKey) ] ]).map(function(block) {
var depth = block.getDepth() + adjustment;
return depth = Math.max(0, Math.min(depth, maxDepth)), block.set("depth", depth);
});
return blockMap = blockMap.merge(blocks), contentState.merge({
blockMap: blockMap,
selectionBefore: selectionState,
selectionAfter: selectionState
});
}
module.exports = adjustBlockDepthForContentState;
}, /* 133 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule convertFromDraftStateToRaw
*
*/
"use strict";
function convertFromDraftStateToRaw(contentState) {
var entityStorageKey = 0, entityStorageMap = {}, rawBlocks = [];
contentState.getBlockMap().forEach(function(block, blockKey) {
block.findEntityRanges(function(character) {
return null !== character.getEntity();
}, function(start) {
// Stringify to maintain order of otherwise numeric keys.
var stringifiedEntityKey = DraftStringKey.stringify(block.getEntityAt(start));
entityStorageMap.hasOwnProperty(stringifiedEntityKey) || (entityStorageMap[stringifiedEntityKey] = "" + entityStorageKey++);
}), rawBlocks.push({
key: blockKey,
text: block.getText(),
type: block.getType(),
depth: block.getDepth(),
inlineStyleRanges: encodeInlineStyleRanges(block),
entityRanges: encodeEntityRanges(block, entityStorageMap),
data: block.getData().toObject()
});
});
// Flip storage map so that our storage keys map to global
// DraftEntity keys.
var entityKeys = Object.keys(entityStorageMap), flippedStorageMap = {};
return entityKeys.forEach(function(key, jj) {
var entity = DraftEntity.get(DraftStringKey.unstringify(key));
flippedStorageMap[jj] = {
type: entity.getType(),
mutability: entity.getMutability(),
data: entity.getData()
};
}), {
entityMap: flippedStorageMap,
blocks: rawBlocks
};
}
var DraftEntity = __webpack_require__(14), DraftStringKey = __webpack_require__(134), encodeEntityRanges = __webpack_require__(135), encodeInlineStyleRanges = __webpack_require__(136);
module.exports = convertFromDraftStateToRaw;
}, /* 134 */
/***/
function(module, exports) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule DraftStringKey
* @typechecks
*
*/
"use strict";
var DraftStringKey = {
stringify: function(key) {
return "_" + String(key);
},
unstringify: function(key) {
return key.slice(1);
}
};
module.exports = DraftStringKey;
}, /* 135 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule encodeEntityRanges
* @typechecks
*
*/
"use strict";
/**
* Convert to UTF-8 character counts for storage.
*/
function encodeEntityRanges(block, storageMap) {
var encoded = [];
return block.findEntityRanges(function(character) {
return !!character.getEntity();
}, function(/*number*/ start, /*number*/ end) {
var text = block.getText(), key = block.getEntityAt(start);
encoded.push({
offset: strlen(text.slice(0, start)),
length: strlen(text.slice(start, end)),
// Encode the key as a number for range storage.
key: Number(storageMap[DraftStringKey.stringify(key)])
});
}), encoded;
}
var DraftStringKey = __webpack_require__(134), UnicodeUtils = __webpack_require__(104), strlen = UnicodeUtils.strlen;
module.exports = encodeEntityRanges;
}, /* 136 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule encodeInlineStyleRanges
*
*/
"use strict";
/**
* Helper function for getting encoded styles for each inline style. Convert
* to UTF-8 character counts for storage.
*/
function getEncodedInlinesForType(block, styleList, styleToEncode) {
var ranges = [], filteredInlines = styleList.map(function(style) {
return style.has(styleToEncode);
}).toList();
// We only want to keep ranges with nonzero style values.
return findRangesImmutable(filteredInlines, areEqual, isTruthy, function(start, end) {
var text = block.getText();
ranges.push({
offset: UnicodeUtils.strlen(text.slice(0, start)),
length: UnicodeUtils.strlen(text.slice(start, end)),
style: styleToEncode
});
}), ranges;
}
/*
* Retrieve the encoded arrays of inline styles, with each individual style
* treated separately.
*/
function encodeInlineStyleRanges(block) {
var styleList = block.getCharacterList().map(function(c) {
return c.getStyle();
}).toList(), ranges = styleList.flatten().toSet().map(function(style) {
return getEncodedInlinesForType(block, styleList, style);
});
return Array.prototype.concat.apply(EMPTY_ARRAY, ranges.toJS());
}
var UnicodeUtils = __webpack_require__(104), findRangesImmutable = __webpack_require__(8), areEqual = function(a, b) {
return a === b;
}, isTruthy = function(a) {
return !!a;
}, EMPTY_ARRAY = [];
module.exports = encodeInlineStyleRanges;
}, /* 137 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule convertFromRawToDraftState
*
*/
"use strict";
function convertFromRawToDraftState(rawState) {
var blocks = rawState.blocks, entityMap = rawState.entityMap, fromStorageToLocal = {};
Object.keys(entityMap).forEach(function(storageKey) {
var encodedEntity = entityMap[storageKey], type = encodedEntity.type, mutability = encodedEntity.mutability, data = encodedEntity.data, newKey = DraftEntity.create(type, mutability, data || {});
fromStorageToLocal[storageKey] = newKey;
});
var contentBlocks = blocks.map(function(block) {
var key = block.key, type = block.type, text = block.text, depth = block.depth, inlineStyleRanges = block.inlineStyleRanges, entityRanges = block.entityRanges, data = block.data;
key = key || generateRandomKey(), depth = depth || 0, inlineStyleRanges = inlineStyleRanges || [],
entityRanges = entityRanges || [], data = Map(data);
var inlineStyles = decodeInlineStyleRanges(text, inlineStyleRanges), filteredEntityRanges = entityRanges.filter(function(range) {
return fromStorageToLocal.hasOwnProperty(range.key);
}).map(function(range) {
return _extends({}, range, {
key: fromStorageToLocal[range.key]
});
}), entities = decodeEntityRanges(text, filteredEntityRanges), characterList = createCharacterList(inlineStyles, entities);
return new ContentBlock({
key: key,
type: type,
text: text,
depth: depth,
characterList: characterList,
data: data
});
});
return ContentState.createFromBlockArray(contentBlocks);
}
var _assign = __webpack_require__(15), _extends = _assign || function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]);
}
return target;
}, ContentBlock = __webpack_require__(7), ContentState = __webpack_require__(32), DraftEntity = __webpack_require__(14), Immutable = __webpack_require__(5), createCharacterList = __webpack_require__(138), decodeEntityRanges = __webpack_require__(139), decodeInlineStyleRanges = __webpack_require__(140), generateRandomKey = __webpack_require__(21), Map = Immutable.Map;
module.exports = convertFromRawToDraftState;
}, /* 138 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule createCharacterList
* @typechecks
*
*/
"use strict";
function createCharacterList(inlineStyles, entities) {
var characterArray = inlineStyles.map(function(style, ii) {
var entity = entities[ii];
return CharacterMetadata.create({
style: style,
entity: entity
});
});
return List(characterArray);
}
var CharacterMetadata = __webpack_require__(6), Immutable = __webpack_require__(5), List = Immutable.List;
module.exports = createCharacterList;
}, /* 139 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule decodeEntityRanges
* @typechecks
*
*/
"use strict";
/**
* Convert to native JavaScript string lengths to determine ranges.
*/
function decodeEntityRanges(text, ranges) {
var entities = Array(text.length).fill(null);
return ranges && ranges.forEach(function(range) {
for (var start = substr(text, 0, range.offset).length, end = start + substr(text, range.offset, range.length).length, ii = start; ii < end; ii++) entities[ii] = range.key;
}), entities;
}
var UnicodeUtils = __webpack_require__(104), substr = UnicodeUtils.substr;
module.exports = decodeEntityRanges;
}, /* 140 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule decodeInlineStyleRanges
* @typechecks
*
*/
"use strict";
/**
* Convert to native JavaScript string lengths to determine ranges.
*/
function decodeInlineStyleRanges(text, ranges) {
var styles = Array(text.length).fill(EMPTY_SET);
return ranges && ranges.forEach(function(/*object*/ range) {
for (var cursor = substr(text, 0, range.offset).length, end = cursor + substr(text, range.offset, range.length).length; cursor < end; ) styles[cursor] = styles[cursor].add(range.style),
cursor++;
}), styles;
}
var UnicodeUtils = __webpack_require__(104), _require = __webpack_require__(5), OrderedSet = _require.OrderedSet, substr = UnicodeUtils.substr, EMPTY_SET = OrderedSet();
module.exports = decodeInlineStyleRanges;
}, /* 141 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule getVisibleSelectionRect
* @typechecks
*
*/
"use strict";
/**
* Return the bounding ClientRect for the visible DOM selection, if any.
* In cases where there are no selected ranges or the bounding rect is
* temporarily invalid, return null.
*/
function getVisibleSelectionRect(global) {
var selection = global.getSelection();
if (!selection.rangeCount) return null;
var range = selection.getRangeAt(0), boundingRect = getRangeBoundingClientRect(range), top = boundingRect.top, right = boundingRect.right, bottom = boundingRect.bottom, left = boundingRect.left;
// When a re-render leads to a node being removed, the DOM selection will
// temporarily be placed on an ancestor node, which leads to an invalid
// bounding rect. Discard this state.
// When a re-render leads to a node being removed, the DOM selection will
// temporarily be placed on an ancestor node, which leads to an invalid
// bounding rect. Discard this state.
return 0 === top && 0 === right && 0 === bottom && 0 === left ? null : boundingRect;
}
var getRangeBoundingClientRect = __webpack_require__(142);
module.exports = getVisibleSelectionRect;
}, /* 142 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule getRangeBoundingClientRect
* @typechecks
*
*/
"use strict";
/**
* Like range.getBoundingClientRect() but normalizes for browser bugs.
*/
function getRangeBoundingClientRect(range) {
// "Return a DOMRect object describing the smallest rectangle that includes
// the first rectangle in list and all of the remaining rectangles of which
// the height or width is not zero."
// http://www.w3.org/TR/cssom-view/#dom-range-getboundingclientrect
var rects = getRangeClientRects(range), top = 0, right = 0, bottom = 0, left = 0;
if (rects.length) {
var _rects$ = rects[0];
top = _rects$.top, right = _rects$.right, bottom = _rects$.bottom, left = _rects$.left;
for (var ii = 1; ii < rects.length; ii++) {
var rect = rects[ii];
0 === rect.height && 0 === rect.width || (top = Math.min(top, rect.top), right = Math.max(right, rect.right),
bottom = Math.max(bottom, rect.bottom), left = Math.min(left, rect.left));
}
}
return {
top: top,
right: right,
bottom: bottom,
left: left,
width: right - left,
height: bottom - top
};
}
var getRangeClientRects = __webpack_require__(105);
module.exports = getRangeBoundingClientRect;
}, /* 143 */
/***/
function(module, exports, __webpack_require__) {
"use strict";
function changeBlockDepth(editorState, blockKey, newDepth) {
var content = editorState.getCurrentContent(), block = content.getBlockForKey(blockKey), depth = block.getDepth();
if (depth === newDepth) return editorState;
var newBlock = block.set("depth", newDepth), newContent = content.merge({
blockMap: content.getBlockMap().set(blockKey, newBlock)
});
return _draftJs.EditorState.push(editorState, newContent, "adjust-depth");
}
Object.defineProperty(exports, "__esModule", {
value: !0
}), exports.default = changeBlockDepth;
var _draftJs = __webpack_require__(2);
}, /* 144 */
/***/
function(module, exports, __webpack_require__) {
"use strict";
function changeBlockType(editorState, blockKey, newType) {
var content = editorState.getCurrentContent(), block = content.getBlockForKey(blockKey), type = block.getType();
if (type === newType) return editorState;
var newBlock = block.set("type", newType), newContent = content.merge({
blockMap: content.getBlockMap().set(blockKey, newBlock)
});
return _draftJs.EditorState.push(editorState, newContent, "change-block-type");
}
Object.defineProperty(exports, "__esModule", {
value: !0
}), exports.default = changeBlockType;
var _draftJs = __webpack_require__(2);
}, /* 145 */
/***/
function(module, exports, __webpack_require__) {
"use strict";
function insertBlockAfter(editorState, blockKey, newType) {
var content = editorState.getCurrentContent(), blockMap = content.getBlockMap(), block = blockMap.get(blockKey), blocksBefore = blockMap.toSeq().takeUntil(function(v) {
return v === block;
}), blocksAfter = blockMap.toSeq().skipUntil(function(v) {
return v === block;
}).rest(), newBlockKey = (0, _draftJs.genKey)(), newBlock = new _draftJs.ContentBlock({
key: newBlockKey,
type: newType,
text: "",
characterList: block.getCharacterList().slice(0, 0),
depth: 0
}), newBlockMap = blocksBefore.concat([ [ blockKey, block ], [ newBlockKey, newBlock ] ], blocksAfter).toOrderedMap(), selection = editorState.getSelection(), newContent = content.merge({
blockMap: newBlockMap,
selectionBefore: selection,
selectionAfter: selection.merge({
anchorKey: newBlockKey,
anchorOffset: 0,
focusKey: newBlockKey,
focusOffset: 0,
isBackward: !1
})
});
return _draftJs.EditorState.push(editorState, newContent, "split-block");
}
Object.defineProperty(exports, "__esModule", {
value: !0
}), exports.default = insertBlockAfter;
var _draftJs = __webpack_require__(2);
}, /* 146 */
/***/
function(module, exports, __webpack_require__) {
"use strict";
function isListItem(block) {
var blockType = block.getType();
return blockType === _draftJsUtils.BLOCK_TYPE.UNORDERED_LIST_ITEM || blockType === _draftJsUtils.BLOCK_TYPE.ORDERED_LIST_ITEM;
}
Object.defineProperty(exports, "__esModule", {
value: !0
}), exports.default = isListItem;
var _draftJsUtils = __webpack_require__(147);
}, /* 147 */
/***/
function(module, exports, __webpack_require__) {
"use strict";
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
Object.defineProperty(exports, "__esModule", {
value: !0
});
var _Constants = __webpack_require__(148);
Object.keys(_Constants).forEach(function(key) {
"default" !== key && "__esModule" !== key && Object.defineProperty(exports, key, {
enumerable: !0,
get: function() {
return _Constants[key];
}
});
}), Object.defineProperty(exports, "Constants", {
enumerable: !0,
get: function() {
return _interopRequireDefault(_Constants).default;
}
});
var _getEntityRanges = __webpack_require__(149);
Object.defineProperty(exports, "getEntityRanges", {
enumerable: !0,
get: function() {
return _interopRequireDefault(_getEntityRanges).default;
}
});
var _getSelectedBlocks = __webpack_require__(151);
Object.defineProperty(exports, "getSelectedBlocks", {
enumerable: !0,
get: function() {
return _interopRequireDefault(_getSelectedBlocks).default;
}
});
var _selectionContainsEntity = __webpack_require__(152);
Object.defineProperty(exports, "selectionContainsEntity", {
enumerable: !0,
get: function() {
return _interopRequireDefault(_selectionContainsEntity).default;
}
});
var _callModifierForSelectedBlocks = __webpack_require__(153);
Object.defineProperty(exports, "callModifierForSelectedBlocks", {
enumerable: !0,
get: function() {
return _interopRequireDefault(_callModifierForSelectedBlocks).default;
}
});
}, /* 148 */
/***/
function(module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: !0
});
var BLOCK_TYPE = exports.BLOCK_TYPE = {
// This is used to represent a normal text block (paragraph).
UNSTYLED: "unstyled",
HEADER_ONE: "header-one",
HEADER_TWO: "header-two",
HEADER_THREE: "header-three",
HEADER_FOUR: "header-four",
HEADER_FIVE: "header-five",
HEADER_SIX: "header-six",
UNORDERED_LIST_ITEM: "unordered-list-item",
ORDERED_LIST_ITEM: "ordered-list-item",
BLOCKQUOTE: "blockquote",
PULLQUOTE: "pullquote",
CODE: "code-block",
ATOMIC: "atomic"
}, ENTITY_TYPE = exports.ENTITY_TYPE = {
LINK: "LINK",
IMAGE: "IMAGE"
}, INLINE_STYLE = exports.INLINE_STYLE = {
BOLD: "BOLD",
CODE: "CODE",
ITALIC: "ITALIC",
STRIKETHROUGH: "STRIKETHROUGH",
UNDERLINE: "UNDERLINE"
};
exports.default = {
BLOCK_TYPE: BLOCK_TYPE,
ENTITY_TYPE: ENTITY_TYPE,
INLINE_STYLE: INLINE_STYLE
};
}, /* 149 */
/***/
function(module, exports, __webpack_require__) {
"use strict";
function getEntityRanges(text, charMetaList) {
for (var charEntity = null, prevCharEntity = null, ranges = [], rangeStart = 0, i = 0, len = text.length; i < len; i++) {
prevCharEntity = charEntity;
var meta = charMetaList.get(i);
charEntity = meta ? meta.getEntity() : null, i > 0 && charEntity !== prevCharEntity && (ranges.push([ prevCharEntity, getStyleRanges(text.slice(rangeStart, i), charMetaList.slice(rangeStart, i)) ]),
rangeStart = i);
}
return ranges.push([ charEntity, getStyleRanges(text.slice(rangeStart), charMetaList.slice(rangeStart)) ]),
ranges;
}
function getStyleRanges(text, charMetaList) {
for (var charStyle = EMPTY_SET, prevCharStyle = EMPTY_SET, ranges = [], rangeStart = 0, i = 0, len = text.length; i < len; i++) {
prevCharStyle = charStyle;
var meta = charMetaList.get(i);
charStyle = meta ? meta.getStyle() : EMPTY_SET, i > 0 && !(0, _immutable.is)(charStyle, prevCharStyle) && (ranges.push([ text.slice(rangeStart, i), prevCharStyle ]),
rangeStart = i);
}
return ranges.push([ text.slice(rangeStart), charStyle ]), ranges;
}
Object.defineProperty(exports, "__esModule", {
value: !0
}), exports.EMPTY_SET = void 0, exports.default = getEntityRanges;
var _immutable = __webpack_require__(150), EMPTY_SET = exports.EMPTY_SET = new _immutable.OrderedSet();
}, /* 150 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 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.
*/
!function(global, factory) {
module.exports = factory();
}(this, function() {
"use strict";
function createClass(ctor, superClass) {
superClass && (ctor.prototype = Object.create(superClass.prototype)), ctor.prototype.constructor = ctor;
}
function Iterable(value) {
return isIterable(value) ? value : Seq(value);
}
function KeyedIterable(value) {
return isKeyed(value) ? value : KeyedSeq(value);
}
function IndexedIterable(value) {
return isIndexed(value) ? value : IndexedSeq(value);
}
function SetIterable(value) {
return isIterable(value) && !isAssociative(value) ? value : SetSeq(value);
}
function isIterable(maybeIterable) {
return !(!maybeIterable || !maybeIterable[IS_ITERABLE_SENTINEL]);
}
function isKeyed(maybeKeyed) {
return !(!maybeKeyed || !maybeKeyed[IS_KEYED_SENTINEL]);
}
function isIndexed(maybeIndexed) {
return !(!maybeIndexed || !maybeIndexed[IS_INDEXED_SENTINEL]);
}
function isAssociative(maybeAssociative) {
return isKeyed(maybeAssociative) || isIndexed(maybeAssociative);
}
function isOrdered(maybeOrdered) {
return !(!maybeOrdered || !maybeOrdered[IS_ORDERED_SENTINEL]);
}
function MakeRef(ref) {
return ref.value = !1, ref;
}
function SetRef(ref) {
ref && (ref.value = !0);
}
// A function which returns a value representing an "owner" for transient writes
// to tries. The return value will only ever equal itself, and will not equal
// the return of any subsequent call of this function.
function OwnerID() {}
// http://jsperf.com/copy-array-inline
function arrCopy(arr, offset) {
offset = offset || 0;
for (var len = Math.max(0, arr.length - offset), newArr = new Array(len), ii = 0; ii < len; ii++) newArr[ii] = arr[ii + offset];
return newArr;
}
function ensureSize(iter) {
return void 0 === iter.size && (iter.size = iter.__iterate(returnTrue)), iter.size;
}
function wrapIndex(iter, index) {
// This implements "is array index" which the ECMAString spec defines as:
//
// A String property name P is an array index if and only if
// ToString(ToUint32(P)) is equal to P and ToUint32(P) is not equal
// to 2^32−1.
//
// http://www.ecma-international.org/ecma-262/6.0/#sec-array-exotic-objects
if ("number" != typeof index) {
var uint32Index = index >>> 0;
// N >>> 0 is shorthand for ToUint32
if ("" + uint32Index !== index || 4294967295 === uint32Index) return NaN;
index = uint32Index;
}
return index < 0 ? ensureSize(iter) + index : index;
}
function returnTrue() {
return !0;
}
function wholeSlice(begin, end, size) {
return (0 === begin || void 0 !== size && begin <= -size) && (void 0 === end || void 0 !== size && end >= size);
}
function resolveBegin(begin, size) {
return resolveIndex(begin, size, 0);
}
function resolveEnd(end, size) {
return resolveIndex(end, size, size);
}
function resolveIndex(index, size, defaultIndex) {
return void 0 === index ? defaultIndex : index < 0 ? Math.max(0, size + index) : void 0 === size ? index : Math.min(size, index);
}
function Iterator(next) {
this.next = next;
}
function iteratorValue(type, k, v, iteratorResult) {
var value = 0 === type ? k : 1 === type ? v : [ k, v ];
return iteratorResult ? iteratorResult.value = value : iteratorResult = {
value: value,
done: !1
}, iteratorResult;
}
function iteratorDone() {
return {
value: void 0,
done: !0
};
}
function hasIterator(maybeIterable) {
return !!getIteratorFn(maybeIterable);
}
function isIterator(maybeIterator) {
return maybeIterator && "function" == typeof maybeIterator.next;
}
function getIterator(iterable) {
var iteratorFn = getIteratorFn(iterable);
return iteratorFn && iteratorFn.call(iterable);
}
function getIteratorFn(iterable) {
var iteratorFn = iterable && (REAL_ITERATOR_SYMBOL && iterable[REAL_ITERATOR_SYMBOL] || iterable[FAUX_ITERATOR_SYMBOL]);
if ("function" == typeof iteratorFn) return iteratorFn;
}
function isArrayLike(value) {
return value && "number" == typeof value.length;
}
function Seq(value) {
return null === value || void 0 === value ? emptySequence() : isIterable(value) ? value.toSeq() : seqFromValue(value);
}
function KeyedSeq(value) {
return null === value || void 0 === value ? emptySequence().toKeyedSeq() : isIterable(value) ? isKeyed(value) ? value.toSeq() : value.fromEntrySeq() : keyedSeqFromValue(value);
}
function IndexedSeq(value) {
return null === value || void 0 === value ? emptySequence() : isIterable(value) ? isKeyed(value) ? value.entrySeq() : value.toIndexedSeq() : indexedSeqFromValue(value);
}
function SetSeq(value) {
return (null === value || void 0 === value ? emptySequence() : isIterable(value) ? isKeyed(value) ? value.entrySeq() : value : indexedSeqFromValue(value)).toSetSeq();
}
function ArraySeq(array) {
this._array = array, this.size = array.length;
}
function ObjectSeq(object) {
var keys = Object.keys(object);
this._object = object, this._keys = keys, this.size = keys.length;
}
function IterableSeq(iterable) {
this._iterable = iterable, this.size = iterable.length || iterable.size;
}
function IteratorSeq(iterator) {
this._iterator = iterator, this._iteratorCache = [];
}
// # pragma Helper functions
function isSeq(maybeSeq) {
return !(!maybeSeq || !maybeSeq[IS_SEQ_SENTINEL]);
}
function emptySequence() {
return EMPTY_SEQ || (EMPTY_SEQ = new ArraySeq([]));
}
function keyedSeqFromValue(value) {
var seq = Array.isArray(value) ? new ArraySeq(value).fromEntrySeq() : isIterator(value) ? new IteratorSeq(value).fromEntrySeq() : hasIterator(value) ? new IterableSeq(value).fromEntrySeq() : "object" == typeof value ? new ObjectSeq(value) : void 0;
if (!seq) throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: " + value);
return seq;
}
function indexedSeqFromValue(value) {
var seq = maybeIndexedSeqFromValue(value);
if (!seq) throw new TypeError("Expected Array or iterable object of values: " + value);
return seq;
}
function seqFromValue(value) {
var seq = maybeIndexedSeqFromValue(value) || "object" == typeof value && new ObjectSeq(value);
if (!seq) throw new TypeError("Expected Array or iterable object of values, or keyed object: " + value);
return seq;
}
function maybeIndexedSeqFromValue(value) {
return isArrayLike(value) ? new ArraySeq(value) : isIterator(value) ? new IteratorSeq(value) : hasIterator(value) ? new IterableSeq(value) : void 0;
}
function seqIterate(seq, fn, reverse, useKeys) {
var cache = seq._cache;
if (cache) {
for (var maxIndex = cache.length - 1, ii = 0; ii <= maxIndex; ii++) {
var entry = cache[reverse ? maxIndex - ii : ii];
if (fn(entry[1], useKeys ? entry[0] : ii, seq) === !1) return ii + 1;
}
return ii;
}
return seq.__iterateUncached(fn, reverse);
}
function seqIterator(seq, type, reverse, useKeys) {
var cache = seq._cache;
if (cache) {
var maxIndex = cache.length - 1, ii = 0;
return new Iterator(function() {
var entry = cache[reverse ? maxIndex - ii : ii];
return ii++ > maxIndex ? iteratorDone() : iteratorValue(type, useKeys ? entry[0] : ii - 1, entry[1]);
});
}
return seq.__iteratorUncached(type, reverse);
}
function fromJS(json, converter) {
return converter ? fromJSWith(converter, json, "", {
"": json
}) : fromJSDefault(json);
}
function fromJSWith(converter, json, key, parentJSON) {
return Array.isArray(json) ? converter.call(parentJSON, key, IndexedSeq(json).map(function(v, k) {
return fromJSWith(converter, v, k, json);
})) : isPlainObj(json) ? converter.call(parentJSON, key, KeyedSeq(json).map(function(v, k) {
return fromJSWith(converter, v, k, json);
})) : json;
}
function fromJSDefault(json) {
return Array.isArray(json) ? IndexedSeq(json).map(fromJSDefault).toList() : isPlainObj(json) ? KeyedSeq(json).map(fromJSDefault).toMap() : json;
}
function isPlainObj(value) {
return value && (value.constructor === Object || void 0 === value.constructor);
}
/**
* An extension of the "same-value" algorithm as [described for use by ES6 Map
* and Set](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map#Key_equality)
*
* NaN is considered the same as NaN, however -0 and 0 are considered the same
* value, which is different from the algorithm described by
* [`Object.is`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is).
*
* This is extended further to allow Objects to describe the values they
* represent, by way of `valueOf` or `equals` (and `hashCode`).
*
* Note: because of this extension, the key equality of Immutable.Map and the
* value equality of Immutable.Set will differ from ES6 Map and Set.
*
* ### Defining custom values
*
* The easiest way to describe the value an object represents is by implementing
* `valueOf`. For example, `Date` represents a value by returning a unix
* timestamp for `valueOf`:
*
* var date1 = new Date(1234567890000); // Fri Feb 13 2009 ...
* var date2 = new Date(1234567890000);
* date1.valueOf(); // 1234567890000
* assert( date1 !== date2 );
* assert( Immutable.is( date1, date2 ) );
*
* Note: overriding `valueOf` may have other implications if you use this object
* where JavaScript expects a primitive, such as implicit string coercion.
*
* For more complex types, especially collections, implementing `valueOf` may
* not be performant. An alternative is to implement `equals` and `hashCode`.
*
* `equals` takes another object, presumably of similar type, and returns true
* if the it is equal. Equality is symmetrical, so the same result should be
* returned if this and the argument are flipped.
*
* assert( a.equals(b) === b.equals(a) );
*
* `hashCode` returns a 32bit integer number representing the object which will
* be used to determine how to store the value object in a Map or Set. You must
* provide both or neither methods, one must not exist without the other.
*
* Also, an important relationship between these methods must be upheld: if two
* values are equal, they *must* return the same hashCode. If the values are not
* equal, they might have the same hashCode; this is called a hash collision,
* and while undesirable for performance reasons, it is acceptable.
*
* if (a.equals(b)) {
* assert( a.hashCode() === b.hashCode() );
* }
*
* All Immutable collections implement `equals` and `hashCode`.
*
*/
function is(valueA, valueB) {
if (valueA === valueB || valueA !== valueA && valueB !== valueB) return !0;
if (!valueA || !valueB) return !1;
if ("function" == typeof valueA.valueOf && "function" == typeof valueB.valueOf) {
if (valueA = valueA.valueOf(), valueB = valueB.valueOf(), valueA === valueB || valueA !== valueA && valueB !== valueB) return !0;
if (!valueA || !valueB) return !1;
}
return !("function" != typeof valueA.equals || "function" != typeof valueB.equals || !valueA.equals(valueB));
}
function deepEqual(a, b) {
if (a === b) return !0;
if (!isIterable(b) || void 0 !== a.size && void 0 !== b.size && a.size !== b.size || void 0 !== a.__hash && void 0 !== b.__hash && a.__hash !== b.__hash || isKeyed(a) !== isKeyed(b) || isIndexed(a) !== isIndexed(b) || isOrdered(a) !== isOrdered(b)) return !1;
if (0 === a.size && 0 === b.size) return !0;
var notAssociative = !isAssociative(a);
if (isOrdered(a)) {
var entries = a.entries();
return b.every(function(v, k) {
var entry = entries.next().value;
return entry && is(entry[1], v) && (notAssociative || is(entry[0], k));
}) && entries.next().done;
}
var flipped = !1;
if (void 0 === a.size) if (void 0 === b.size) "function" == typeof a.cacheResult && a.cacheResult(); else {
flipped = !0;
var _ = a;
a = b, b = _;
}
var allEqual = !0, bSize = b.__iterate(function(v, k) {
if (notAssociative ? !a.has(v) : flipped ? !is(v, a.get(k, NOT_SET)) : !is(a.get(k, NOT_SET), v)) return allEqual = !1,
!1;
});
return allEqual && a.size === bSize;
}
function Repeat(value, times) {
if (!(this instanceof Repeat)) return new Repeat(value, times);
if (this._value = value, this.size = void 0 === times ? 1 / 0 : Math.max(0, times),
0 === this.size) {
if (EMPTY_REPEAT) return EMPTY_REPEAT;
EMPTY_REPEAT = this;
}
}
function invariant(condition, error) {
if (!condition) throw new Error(error);
}
function Range(start, end, step) {
if (!(this instanceof Range)) return new Range(start, end, step);
if (invariant(0 !== step, "Cannot step a Range by 0"), start = start || 0, void 0 === end && (end = 1 / 0),
step = void 0 === step ? 1 : Math.abs(step), end < start && (step = -step), this._start = start,
this._end = end, this._step = step, this.size = Math.max(0, Math.ceil((end - start) / step - 1) + 1),
0 === this.size) {
if (EMPTY_RANGE) return EMPTY_RANGE;
EMPTY_RANGE = this;
}
}
function Collection() {
throw TypeError("Abstract");
}
function KeyedCollection() {}
function IndexedCollection() {}
function SetCollection() {}
// v8 has an optimization for storing 31-bit signed numbers.
// Values which have either 00 or 11 as the high order bits qualify.
// This function drops the highest order bit in a signed number, maintaining
// the sign bit.
function smi(i32) {
return i32 >>> 1 & 1073741824 | 3221225471 & i32;
}
function hash(o) {
if (o === !1 || null === o || void 0 === o) return 0;
if ("function" == typeof o.valueOf && (o = o.valueOf(), o === !1 || null === o || void 0 === o)) return 0;
if (o === !0) return 1;
var type = typeof o;
if ("number" === type) {
if (o !== o || o === 1 / 0) return 0;
var h = 0 | o;
for (h !== o && (h ^= 4294967295 * o); o > 4294967295; ) o /= 4294967295, h ^= o;
return smi(h);
}
if ("string" === type) return o.length > STRING_HASH_CACHE_MIN_STRLEN ? cachedHashString(o) : hashString(o);
if ("function" == typeof o.hashCode) return o.hashCode();
if ("object" === type) return hashJSObj(o);
if ("function" == typeof o.toString) return hashString(o.toString());
throw new Error("Value type " + type + " cannot be hashed.");
}
function cachedHashString(string) {
var hash = stringHashCache[string];
return void 0 === hash && (hash = hashString(string), STRING_HASH_CACHE_SIZE === STRING_HASH_CACHE_MAX_SIZE && (STRING_HASH_CACHE_SIZE = 0,
stringHashCache = {}), STRING_HASH_CACHE_SIZE++, stringHashCache[string] = hash),
hash;
}
// http://jsperf.com/hashing-strings
function hashString(string) {
for (var hash = 0, ii = 0; ii < string.length; ii++) hash = 31 * hash + string.charCodeAt(ii) | 0;
return smi(hash);
}
function hashJSObj(obj) {
var hash;
if (usingWeakMap && (hash = weakMap.get(obj), void 0 !== hash)) return hash;
if (hash = obj[UID_HASH_KEY], void 0 !== hash) return hash;
if (!canDefineProperty) {
if (hash = obj.propertyIsEnumerable && obj.propertyIsEnumerable[UID_HASH_KEY], void 0 !== hash) return hash;
if (hash = getIENodeHash(obj), void 0 !== hash) return hash;
}
if (hash = ++objHashUID, 1073741824 & objHashUID && (objHashUID = 0), usingWeakMap) weakMap.set(obj, hash); else {
if (void 0 !== isExtensible && isExtensible(obj) === !1) throw new Error("Non-extensible objects are not allowed as keys.");
if (canDefineProperty) Object.defineProperty(obj, UID_HASH_KEY, {
enumerable: !1,
configurable: !1,
writable: !1,
value: hash
}); else if (void 0 !== obj.propertyIsEnumerable && obj.propertyIsEnumerable === obj.constructor.prototype.propertyIsEnumerable) // Since we can't define a non-enumerable property on the object
// we'll hijack one of the less-used non-enumerable properties to
// save our hash on it. Since this is a function it will not show up in
// `JSON.stringify` which is what we want.
obj.propertyIsEnumerable = function() {
return this.constructor.prototype.propertyIsEnumerable.apply(this, arguments);
}, obj.propertyIsEnumerable[UID_HASH_KEY] = hash; else {
if (void 0 === obj.nodeType) throw new Error("Unable to set a non-enumerable property on object.");
// At this point we couldn't get the IE `uniqueID` to use as a hash
// and we couldn't use a non-enumerable property to exploit the
// dontEnum bug so we simply add the `UID_HASH_KEY` on the node
// itself.
obj[UID_HASH_KEY] = hash;
}
}
return hash;
}
// IE has a `uniqueID` property on DOM nodes. We can construct the hash from it
// and avoid memory leaks from the IE cloneNode bug.
function getIENodeHash(node) {
if (node && node.nodeType > 0) switch (node.nodeType) {
case 1:
// Element
return node.uniqueID;
case 9:
// Document
return node.documentElement && node.documentElement.uniqueID;
}
}
function assertNotInfinite(size) {
invariant(size !== 1 / 0, "Cannot perform this action with an infinite size.");
}
// @pragma Construction
function Map(value) {
return null === value || void 0 === value ? emptyMap() : isMap(value) && !isOrdered(value) ? value : emptyMap().withMutations(function(map) {
var iter = KeyedIterable(value);
assertNotInfinite(iter.size), iter.forEach(function(v, k) {
return map.set(k, v);
});
});
}
function isMap(maybeMap) {
return !(!maybeMap || !maybeMap[IS_MAP_SENTINEL]);
}
// #pragma Trie Nodes
function ArrayMapNode(ownerID, entries) {
this.ownerID = ownerID, this.entries = entries;
}
function BitmapIndexedNode(ownerID, bitmap, nodes) {
this.ownerID = ownerID, this.bitmap = bitmap, this.nodes = nodes;
}
function HashArrayMapNode(ownerID, count, nodes) {
this.ownerID = ownerID, this.count = count, this.nodes = nodes;
}
function HashCollisionNode(ownerID, keyHash, entries) {
this.ownerID = ownerID, this.keyHash = keyHash, this.entries = entries;
}
function ValueNode(ownerID, keyHash, entry) {
this.ownerID = ownerID, this.keyHash = keyHash, this.entry = entry;
}
function MapIterator(map, type, reverse) {
this._type = type, this._reverse = reverse, this._stack = map._root && mapIteratorFrame(map._root);
}
function mapIteratorValue(type, entry) {
return iteratorValue(type, entry[0], entry[1]);
}
function mapIteratorFrame(node, prev) {
return {
node: node,
index: 0,
__prev: prev
};
}
function makeMap(size, root, ownerID, hash) {
var map = Object.create(MapPrototype);
return map.size = size, map._root = root, map.__ownerID = ownerID, map.__hash = hash,
map.__altered = !1, map;
}
function emptyMap() {
return EMPTY_MAP || (EMPTY_MAP = makeMap(0));
}
function updateMap(map, k, v) {
var newRoot, newSize;
if (map._root) {
var didChangeSize = MakeRef(CHANGE_LENGTH), didAlter = MakeRef(DID_ALTER);
if (newRoot = updateNode(map._root, map.__ownerID, 0, void 0, k, v, didChangeSize, didAlter),
!didAlter.value) return map;
newSize = map.size + (didChangeSize.value ? v === NOT_SET ? -1 : 1 : 0);
} else {
if (v === NOT_SET) return map;
newSize = 1, newRoot = new ArrayMapNode(map.__ownerID, [ [ k, v ] ]);
}
return map.__ownerID ? (map.size = newSize, map._root = newRoot, map.__hash = void 0,
map.__altered = !0, map) : newRoot ? makeMap(newSize, newRoot) : emptyMap();
}
function updateNode(node, ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {
return node ? node.update(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) : value === NOT_SET ? node : (SetRef(didAlter),
SetRef(didChangeSize), new ValueNode(ownerID, keyHash, [ key, value ]));
}
function isLeafNode(node) {
return node.constructor === ValueNode || node.constructor === HashCollisionNode;
}
function mergeIntoNode(node, ownerID, shift, keyHash, entry) {
if (node.keyHash === keyHash) return new HashCollisionNode(ownerID, keyHash, [ node.entry, entry ]);
var newNode, idx1 = (0 === shift ? node.keyHash : node.keyHash >>> shift) & MASK, idx2 = (0 === shift ? keyHash : keyHash >>> shift) & MASK, nodes = idx1 === idx2 ? [ mergeIntoNode(node, ownerID, shift + SHIFT, keyHash, entry) ] : (newNode = new ValueNode(ownerID, keyHash, entry),
idx1 < idx2 ? [ node, newNode ] : [ newNode, node ]);
return new BitmapIndexedNode(ownerID, 1 << idx1 | 1 << idx2, nodes);
}
function createNodes(ownerID, entries, key, value) {
ownerID || (ownerID = new OwnerID());
for (var node = new ValueNode(ownerID, hash(key), [ key, value ]), ii = 0; ii < entries.length; ii++) {
var entry = entries[ii];
node = node.update(ownerID, 0, void 0, entry[0], entry[1]);
}
return node;
}
function packNodes(ownerID, nodes, count, excluding) {
for (var bitmap = 0, packedII = 0, packedNodes = new Array(count), ii = 0, bit = 1, len = nodes.length; ii < len; ii++,
bit <<= 1) {
var node = nodes[ii];
void 0 !== node && ii !== excluding && (bitmap |= bit, packedNodes[packedII++] = node);
}
return new BitmapIndexedNode(ownerID, bitmap, packedNodes);
}
function expandNodes(ownerID, nodes, bitmap, including, node) {
for (var count = 0, expandedNodes = new Array(SIZE), ii = 0; 0 !== bitmap; ii++,
bitmap >>>= 1) expandedNodes[ii] = 1 & bitmap ? nodes[count++] : void 0;
return expandedNodes[including] = node, new HashArrayMapNode(ownerID, count + 1, expandedNodes);
}
function mergeIntoMapWith(map, merger, iterables) {
for (var iters = [], ii = 0; ii < iterables.length; ii++) {
var value = iterables[ii], iter = KeyedIterable(value);
isIterable(value) || (iter = iter.map(function(v) {
return fromJS(v);
})), iters.push(iter);
}
return mergeIntoCollectionWith(map, merger, iters);
}
function deepMerger(existing, value, key) {
return existing && existing.mergeDeep && isIterable(value) ? existing.mergeDeep(value) : is(existing, value) ? existing : value;
}
function deepMergerWith(merger) {
return function(existing, value, key) {
if (existing && existing.mergeDeepWith && isIterable(value)) return existing.mergeDeepWith(merger, value);
var nextValue = merger(existing, value, key);
return is(existing, nextValue) ? existing : nextValue;
};
}
function mergeIntoCollectionWith(collection, merger, iters) {
return iters = iters.filter(function(x) {
return 0 !== x.size;
}), 0 === iters.length ? collection : 0 !== collection.size || collection.__ownerID || 1 !== iters.length ? collection.withMutations(function(collection) {
for (var mergeIntoMap = merger ? function(value, key) {
collection.update(key, NOT_SET, function(existing) {
return existing === NOT_SET ? value : merger(existing, value, key);
});
} : function(value, key) {
collection.set(key, value);
}, ii = 0; ii < iters.length; ii++) iters[ii].forEach(mergeIntoMap);
}) : collection.constructor(iters[0]);
}
function updateInDeepMap(existing, keyPathIter, notSetValue, updater) {
var isNotSet = existing === NOT_SET, step = keyPathIter.next();
if (step.done) {
var existingValue = isNotSet ? notSetValue : existing, newValue = updater(existingValue);
return newValue === existingValue ? existing : newValue;
}
invariant(isNotSet || existing && existing.set, "invalid keyPath");
var key = step.value, nextExisting = isNotSet ? NOT_SET : existing.get(key, NOT_SET), nextUpdated = updateInDeepMap(nextExisting, keyPathIter, notSetValue, updater);
return nextUpdated === nextExisting ? existing : nextUpdated === NOT_SET ? existing.remove(key) : (isNotSet ? emptyMap() : existing).set(key, nextUpdated);
}
function popCount(x) {
return x -= x >> 1 & 1431655765, x = (858993459 & x) + (x >> 2 & 858993459), x = x + (x >> 4) & 252645135,
x += x >> 8, x += x >> 16, 127 & x;
}
function setIn(array, idx, val, canEdit) {
var newArray = canEdit ? array : arrCopy(array);
return newArray[idx] = val, newArray;
}
function spliceIn(array, idx, val, canEdit) {
var newLen = array.length + 1;
if (canEdit && idx + 1 === newLen) return array[idx] = val, array;
for (var newArray = new Array(newLen), after = 0, ii = 0; ii < newLen; ii++) ii === idx ? (newArray[ii] = val,
after = -1) : newArray[ii] = array[ii + after];
return newArray;
}
function spliceOut(array, idx, canEdit) {
var newLen = array.length - 1;
if (canEdit && idx === newLen) return array.pop(), array;
for (var newArray = new Array(newLen), after = 0, ii = 0; ii < newLen; ii++) ii === idx && (after = 1),
newArray[ii] = array[ii + after];
return newArray;
}
// @pragma Construction
function List(value) {
var empty = emptyList();
if (null === value || void 0 === value) return empty;
if (isList(value)) return value;
var iter = IndexedIterable(value), size = iter.size;
return 0 === size ? empty : (assertNotInfinite(size), size > 0 && size < SIZE ? makeList(0, size, SHIFT, null, new VNode(iter.toArray())) : empty.withMutations(function(list) {
list.setSize(size), iter.forEach(function(v, i) {
return list.set(i, v);
});
}));
}
function isList(maybeList) {
return !(!maybeList || !maybeList[IS_LIST_SENTINEL]);
}
function VNode(array, ownerID) {
this.array = array, this.ownerID = ownerID;
}
function iterateList(list, reverse) {
function iterateNodeOrLeaf(node, level, offset) {
return 0 === level ? iterateLeaf(node, offset) : iterateNode(node, level, offset);
}
function iterateLeaf(node, offset) {
var array = offset === tailPos ? tail && tail.array : node && node.array, from = offset > left ? 0 : left - offset, to = right - offset;
return to > SIZE && (to = SIZE), function() {
if (from === to) return DONE;
var idx = reverse ? --to : from++;
return array && array[idx];
};
}
function iterateNode(node, level, offset) {
var values, array = node && node.array, from = offset > left ? 0 : left - offset >> level, to = (right - offset >> level) + 1;
return to > SIZE && (to = SIZE), function() {
for (;;) {
if (values) {
var value = values();
if (value !== DONE) return value;
values = null;
}
if (from === to) return DONE;
var idx = reverse ? --to : from++;
values = iterateNodeOrLeaf(array && array[idx], level - SHIFT, offset + (idx << level));
}
};
}
var left = list._origin, right = list._capacity, tailPos = getTailOffset(right), tail = list._tail;
return iterateNodeOrLeaf(list._root, list._level, 0);
}
function makeList(origin, capacity, level, root, tail, ownerID, hash) {
var list = Object.create(ListPrototype);
return list.size = capacity - origin, list._origin = origin, list._capacity = capacity,
list._level = level, list._root = root, list._tail = tail, list.__ownerID = ownerID,
list.__hash = hash, list.__altered = !1, list;
}
function emptyList() {
return EMPTY_LIST || (EMPTY_LIST = makeList(0, 0, SHIFT));
}
function updateList(list, index, value) {
if (index = wrapIndex(list, index), index !== index) return list;
if (index >= list.size || index < 0) return list.withMutations(function(list) {
index < 0 ? setListBounds(list, index).set(0, value) : setListBounds(list, 0, index + 1).set(index, value);
});
index += list._origin;
var newTail = list._tail, newRoot = list._root, didAlter = MakeRef(DID_ALTER);
return index >= getTailOffset(list._capacity) ? newTail = updateVNode(newTail, list.__ownerID, 0, index, value, didAlter) : newRoot = updateVNode(newRoot, list.__ownerID, list._level, index, value, didAlter),
didAlter.value ? list.__ownerID ? (list._root = newRoot, list._tail = newTail, list.__hash = void 0,
list.__altered = !0, list) : makeList(list._origin, list._capacity, list._level, newRoot, newTail) : list;
}
function updateVNode(node, ownerID, level, index, value, didAlter) {
var idx = index >>> level & MASK, nodeHas = node && idx < node.array.length;
if (!nodeHas && void 0 === value) return node;
var newNode;
if (level > 0) {
var lowerNode = node && node.array[idx], newLowerNode = updateVNode(lowerNode, ownerID, level - SHIFT, index, value, didAlter);
return newLowerNode === lowerNode ? node : (newNode = editableVNode(node, ownerID),
newNode.array[idx] = newLowerNode, newNode);
}
return nodeHas && node.array[idx] === value ? node : (SetRef(didAlter), newNode = editableVNode(node, ownerID),
void 0 === value && idx === newNode.array.length - 1 ? newNode.array.pop() : newNode.array[idx] = value,
newNode);
}
function editableVNode(node, ownerID) {
return ownerID && node && ownerID === node.ownerID ? node : new VNode(node ? node.array.slice() : [], ownerID);
}
function listNodeFor(list, rawIndex) {
if (rawIndex >= getTailOffset(list._capacity)) return list._tail;
if (rawIndex < 1 << list._level + SHIFT) {
for (var node = list._root, level = list._level; node && level > 0; ) node = node.array[rawIndex >>> level & MASK],
level -= SHIFT;
return node;
}
}
function setListBounds(list, begin, end) {
// Sanitize begin & end using this shorthand for ToInt32(argument)
// http://www.ecma-international.org/ecma-262/6.0/#sec-toint32
void 0 !== begin && (begin |= 0), void 0 !== end && (end |= 0);
var owner = list.__ownerID || new OwnerID(), oldOrigin = list._origin, oldCapacity = list._capacity, newOrigin = oldOrigin + begin, newCapacity = void 0 === end ? oldCapacity : end < 0 ? oldCapacity + end : oldOrigin + end;
if (newOrigin === oldOrigin && newCapacity === oldCapacity) return list;
// If it's going to end after it starts, it's empty.
if (newOrigin >= newCapacity) return list.clear();
for (var newLevel = list._level, newRoot = list._root, offsetShift = 0; newOrigin + offsetShift < 0; ) newRoot = new VNode(newRoot && newRoot.array.length ? [ void 0, newRoot ] : [], owner),
newLevel += SHIFT, offsetShift += 1 << newLevel;
offsetShift && (newOrigin += offsetShift, oldOrigin += offsetShift, newCapacity += offsetShift,
oldCapacity += offsetShift);
// New size might need creating a higher root.
for (var oldTailOffset = getTailOffset(oldCapacity), newTailOffset = getTailOffset(newCapacity); newTailOffset >= 1 << newLevel + SHIFT; ) newRoot = new VNode(newRoot && newRoot.array.length ? [ newRoot ] : [], owner),
newLevel += SHIFT;
// Locate or create the new tail.
var oldTail = list._tail, newTail = newTailOffset < oldTailOffset ? listNodeFor(list, newCapacity - 1) : newTailOffset > oldTailOffset ? new VNode([], owner) : oldTail;
// Merge Tail into tree.
if (oldTail && newTailOffset > oldTailOffset && newOrigin < oldCapacity && oldTail.array.length) {
newRoot = editableVNode(newRoot, owner);
for (var node = newRoot, level = newLevel; level > SHIFT; level -= SHIFT) {
var idx = oldTailOffset >>> level & MASK;
node = node.array[idx] = editableVNode(node.array[idx], owner);
}
node.array[oldTailOffset >>> SHIFT & MASK] = oldTail;
}
// If the new origin is within the tail, then we do not need a root.
if (// If the size has been reduced, there's a chance the tail needs to be trimmed.
newCapacity < oldCapacity && (newTail = newTail && newTail.removeAfter(owner, 0, newCapacity)),
newOrigin >= newTailOffset) newOrigin -= newTailOffset, newCapacity -= newTailOffset,
newLevel = SHIFT, newRoot = null, newTail = newTail && newTail.removeBefore(owner, 0, newOrigin); else if (newOrigin > oldOrigin || newTailOffset < oldTailOffset) {
// Identify the new top root node of the subtree of the old root.
for (offsetShift = 0; newRoot; ) {
var beginIndex = newOrigin >>> newLevel & MASK;
if (beginIndex !== newTailOffset >>> newLevel & MASK) break;
beginIndex && (offsetShift += (1 << newLevel) * beginIndex), newLevel -= SHIFT,
newRoot = newRoot.array[beginIndex];
}
// Trim the new sides of the new root.
newRoot && newOrigin > oldOrigin && (newRoot = newRoot.removeBefore(owner, newLevel, newOrigin - offsetShift)),
newRoot && newTailOffset < oldTailOffset && (newRoot = newRoot.removeAfter(owner, newLevel, newTailOffset - offsetShift)),
offsetShift && (newOrigin -= offsetShift, newCapacity -= offsetShift);
}
return list.__ownerID ? (list.size = newCapacity - newOrigin, list._origin = newOrigin,
list._capacity = newCapacity, list._level = newLevel, list._root = newRoot, list._tail = newTail,
list.__hash = void 0, list.__altered = !0, list) : makeList(newOrigin, newCapacity, newLevel, newRoot, newTail);
}
function mergeIntoListWith(list, merger, iterables) {
for (var iters = [], maxSize = 0, ii = 0; ii < iterables.length; ii++) {
var value = iterables[ii], iter = IndexedIterable(value);
iter.size > maxSize && (maxSize = iter.size), isIterable(value) || (iter = iter.map(function(v) {
return fromJS(v);
})), iters.push(iter);
}
return maxSize > list.size && (list = list.setSize(maxSize)), mergeIntoCollectionWith(list, merger, iters);
}
function getTailOffset(size) {
return size < SIZE ? 0 : size - 1 >>> SHIFT << SHIFT;
}
// @pragma Construction
function OrderedMap(value) {
return null === value || void 0 === value ? emptyOrderedMap() : isOrderedMap(value) ? value : emptyOrderedMap().withMutations(function(map) {
var iter = KeyedIterable(value);
assertNotInfinite(iter.size), iter.forEach(function(v, k) {
return map.set(k, v);
});
});
}
function isOrderedMap(maybeOrderedMap) {
return isMap(maybeOrderedMap) && isOrdered(maybeOrderedMap);
}
function makeOrderedMap(map, list, ownerID, hash) {
var omap = Object.create(OrderedMap.prototype);
return omap.size = map ? map.size : 0, omap._map = map, omap._list = list, omap.__ownerID = ownerID,
omap.__hash = hash, omap;
}
function emptyOrderedMap() {
return EMPTY_ORDERED_MAP || (EMPTY_ORDERED_MAP = makeOrderedMap(emptyMap(), emptyList()));
}
function updateOrderedMap(omap, k, v) {
var newMap, newList, map = omap._map, list = omap._list, i = map.get(k), has = void 0 !== i;
if (v === NOT_SET) {
// removed
if (!has) return omap;
list.size >= SIZE && list.size >= 2 * map.size ? (newList = list.filter(function(entry, idx) {
return void 0 !== entry && i !== idx;
}), newMap = newList.toKeyedSeq().map(function(entry) {
return entry[0];
}).flip().toMap(), omap.__ownerID && (newMap.__ownerID = newList.__ownerID = omap.__ownerID)) : (newMap = map.remove(k),
newList = i === list.size - 1 ? list.pop() : list.set(i, void 0));
} else if (has) {
if (v === list.get(i)[1]) return omap;
newMap = map, newList = list.set(i, [ k, v ]);
} else newMap = map.set(k, list.size), newList = list.set(list.size, [ k, v ]);
return omap.__ownerID ? (omap.size = newMap.size, omap._map = newMap, omap._list = newList,
omap.__hash = void 0, omap) : makeOrderedMap(newMap, newList);
}
function ToKeyedSequence(indexed, useKeys) {
this._iter = indexed, this._useKeys = useKeys, this.size = indexed.size;
}
function ToIndexedSequence(iter) {
this._iter = iter, this.size = iter.size;
}
function ToSetSequence(iter) {
this._iter = iter, this.size = iter.size;
}
function FromEntriesSequence(entries) {
this._iter = entries, this.size = entries.size;
}
function flipFactory(iterable) {
var flipSequence = makeSequence(iterable);
return flipSequence._iter = iterable, flipSequence.size = iterable.size, flipSequence.flip = function() {
return iterable;
}, flipSequence.reverse = function() {
var reversedSequence = iterable.reverse.apply(this);
// super.reverse()
return reversedSequence.flip = function() {
return iterable.reverse();
}, reversedSequence;
}, flipSequence.has = function(key) {
return iterable.includes(key);
}, flipSequence.includes = function(key) {
return iterable.has(key);
}, flipSequence.cacheResult = cacheResultThrough, flipSequence.__iterateUncached = function(fn, reverse) {
var this$0 = this;
return iterable.__iterate(function(v, k) {
return fn(k, v, this$0) !== !1;
}, reverse);
}, flipSequence.__iteratorUncached = function(type, reverse) {
if (type === ITERATE_ENTRIES) {
var iterator = iterable.__iterator(type, reverse);
return new Iterator(function() {
var step = iterator.next();
if (!step.done) {
var k = step.value[0];
step.value[0] = step.value[1], step.value[1] = k;
}
return step;
});
}
return iterable.__iterator(type === ITERATE_VALUES ? ITERATE_KEYS : ITERATE_VALUES, reverse);
}, flipSequence;
}
function mapFactory(iterable, mapper, context) {
var mappedSequence = makeSequence(iterable);
return mappedSequence.size = iterable.size, mappedSequence.has = function(key) {
return iterable.has(key);
}, mappedSequence.get = function(key, notSetValue) {
var v = iterable.get(key, NOT_SET);
return v === NOT_SET ? notSetValue : mapper.call(context, v, key, iterable);
}, mappedSequence.__iterateUncached = function(fn, reverse) {
var this$0 = this;
return iterable.__iterate(function(v, k, c) {
return fn(mapper.call(context, v, k, c), k, this$0) !== !1;
}, reverse);
}, mappedSequence.__iteratorUncached = function(type, reverse) {
var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);
return new Iterator(function() {
var step = iterator.next();
if (step.done) return step;
var entry = step.value, key = entry[0];
return iteratorValue(type, key, mapper.call(context, entry[1], key, iterable), step);
});
}, mappedSequence;
}
function reverseFactory(iterable, useKeys) {
var reversedSequence = makeSequence(iterable);
return reversedSequence._iter = iterable, reversedSequence.size = iterable.size,
reversedSequence.reverse = function() {
return iterable;
}, iterable.flip && (reversedSequence.flip = function() {
var flipSequence = flipFactory(iterable);
return flipSequence.reverse = function() {
return iterable.flip();
}, flipSequence;
}), reversedSequence.get = function(key, notSetValue) {
return iterable.get(useKeys ? key : -1 - key, notSetValue);
}, reversedSequence.has = function(key) {
return iterable.has(useKeys ? key : -1 - key);
}, reversedSequence.includes = function(value) {
return iterable.includes(value);
}, reversedSequence.cacheResult = cacheResultThrough, reversedSequence.__iterate = function(fn, reverse) {
var this$0 = this;
return iterable.__iterate(function(v, k) {
return fn(v, k, this$0);
}, !reverse);
}, reversedSequence.__iterator = function(type, reverse) {
return iterable.__iterator(type, !reverse);
}, reversedSequence;
}
function filterFactory(iterable, predicate, context, useKeys) {
var filterSequence = makeSequence(iterable);
return useKeys && (filterSequence.has = function(key) {
var v = iterable.get(key, NOT_SET);
return v !== NOT_SET && !!predicate.call(context, v, key, iterable);
}, filterSequence.get = function(key, notSetValue) {
var v = iterable.get(key, NOT_SET);
return v !== NOT_SET && predicate.call(context, v, key, iterable) ? v : notSetValue;
}), filterSequence.__iterateUncached = function(fn, reverse) {
var this$0 = this, iterations = 0;
return iterable.__iterate(function(v, k, c) {
if (predicate.call(context, v, k, c)) return iterations++, fn(v, useKeys ? k : iterations - 1, this$0);
}, reverse), iterations;
}, filterSequence.__iteratorUncached = function(type, reverse) {
var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse), iterations = 0;
return new Iterator(function() {
for (;;) {
var step = iterator.next();
if (step.done) return step;
var entry = step.value, key = entry[0], value = entry[1];
if (predicate.call(context, value, key, iterable)) return iteratorValue(type, useKeys ? key : iterations++, value, step);
}
});
}, filterSequence;
}
function countByFactory(iterable, grouper, context) {
var groups = Map().asMutable();
return iterable.__iterate(function(v, k) {
groups.update(grouper.call(context, v, k, iterable), 0, function(a) {
return a + 1;
});
}), groups.asImmutable();
}
function groupByFactory(iterable, grouper, context) {
var isKeyedIter = isKeyed(iterable), groups = (isOrdered(iterable) ? OrderedMap() : Map()).asMutable();
iterable.__iterate(function(v, k) {
groups.update(grouper.call(context, v, k, iterable), function(a) {
return a = a || [], a.push(isKeyedIter ? [ k, v ] : v), a;
});
});
var coerce = iterableClass(iterable);
return groups.map(function(arr) {
return reify(iterable, coerce(arr));
});
}
function sliceFactory(iterable, begin, end, useKeys) {
var originalSize = iterable.size;
if (// Sanitize begin & end using this shorthand for ToInt32(argument)
// http://www.ecma-international.org/ecma-262/6.0/#sec-toint32
void 0 !== begin && (begin |= 0), void 0 !== end && (end === 1 / 0 ? end = originalSize : end |= 0),
wholeSlice(begin, end, originalSize)) return iterable;
var resolvedBegin = resolveBegin(begin, originalSize), resolvedEnd = resolveEnd(end, originalSize);
// begin or end will be NaN if they were provided as negative numbers and
// this iterable's size is unknown. In that case, cache first so there is
// a known size and these do not resolve to NaN.
if (resolvedBegin !== resolvedBegin || resolvedEnd !== resolvedEnd) return sliceFactory(iterable.toSeq().cacheResult(), begin, end, useKeys);
// Note: resolvedEnd is undefined when the original sequence's length is
// unknown and this slice did not supply an end and should contain all
// elements after resolvedBegin.
// In that case, resolvedSize will be NaN and sliceSize will remain undefined.
var sliceSize, resolvedSize = resolvedEnd - resolvedBegin;
resolvedSize === resolvedSize && (sliceSize = resolvedSize < 0 ? 0 : resolvedSize);
var sliceSeq = makeSequence(iterable);
// If iterable.size is undefined, the size of the realized sliceSeq is
// unknown at this point unless the number of items to slice is 0
return sliceSeq.size = 0 === sliceSize ? sliceSize : iterable.size && sliceSize || void 0,
!useKeys && isSeq(iterable) && sliceSize >= 0 && (sliceSeq.get = function(index, notSetValue) {
return index = wrapIndex(this, index), index >= 0 && index < sliceSize ? iterable.get(index + resolvedBegin, notSetValue) : notSetValue;
}), sliceSeq.__iterateUncached = function(fn, reverse) {
var this$0 = this;
if (0 === sliceSize) return 0;
if (reverse) return this.cacheResult().__iterate(fn, reverse);
var skipped = 0, isSkipping = !0, iterations = 0;
return iterable.__iterate(function(v, k) {
if (!isSkipping || !(isSkipping = skipped++ < resolvedBegin)) return iterations++,
fn(v, useKeys ? k : iterations - 1, this$0) !== !1 && iterations !== sliceSize;
}), iterations;
}, sliceSeq.__iteratorUncached = function(type, reverse) {
if (0 !== sliceSize && reverse) return this.cacheResult().__iterator(type, reverse);
// Don't bother instantiating parent iterator if taking 0.
var iterator = 0 !== sliceSize && iterable.__iterator(type, reverse), skipped = 0, iterations = 0;
return new Iterator(function() {
for (;skipped++ < resolvedBegin; ) iterator.next();
if (++iterations > sliceSize) return iteratorDone();
var step = iterator.next();
return useKeys || type === ITERATE_VALUES ? step : type === ITERATE_KEYS ? iteratorValue(type, iterations - 1, void 0, step) : iteratorValue(type, iterations - 1, step.value[1], step);
});
}, sliceSeq;
}
function takeWhileFactory(iterable, predicate, context) {
var takeSequence = makeSequence(iterable);
return takeSequence.__iterateUncached = function(fn, reverse) {
var this$0 = this;
if (reverse) return this.cacheResult().__iterate(fn, reverse);
var iterations = 0;
return iterable.__iterate(function(v, k, c) {
return predicate.call(context, v, k, c) && ++iterations && fn(v, k, this$0);
}), iterations;
}, takeSequence.__iteratorUncached = function(type, reverse) {
var this$0 = this;
if (reverse) return this.cacheResult().__iterator(type, reverse);
var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse), iterating = !0;
return new Iterator(function() {
if (!iterating) return iteratorDone();
var step = iterator.next();
if (step.done) return step;
var entry = step.value, k = entry[0], v = entry[1];
return predicate.call(context, v, k, this$0) ? type === ITERATE_ENTRIES ? step : iteratorValue(type, k, v, step) : (iterating = !1,
iteratorDone());
});
}, takeSequence;
}
function skipWhileFactory(iterable, predicate, context, useKeys) {
var skipSequence = makeSequence(iterable);
return skipSequence.__iterateUncached = function(fn, reverse) {
var this$0 = this;
if (reverse) return this.cacheResult().__iterate(fn, reverse);
var isSkipping = !0, iterations = 0;
return iterable.__iterate(function(v, k, c) {
if (!isSkipping || !(isSkipping = predicate.call(context, v, k, c))) return iterations++,
fn(v, useKeys ? k : iterations - 1, this$0);
}), iterations;
}, skipSequence.__iteratorUncached = function(type, reverse) {
var this$0 = this;
if (reverse) return this.cacheResult().__iterator(type, reverse);
var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse), skipping = !0, iterations = 0;
return new Iterator(function() {
var step, k, v;
do {
if (step = iterator.next(), step.done) return useKeys || type === ITERATE_VALUES ? step : type === ITERATE_KEYS ? iteratorValue(type, iterations++, void 0, step) : iteratorValue(type, iterations++, step.value[1], step);
var entry = step.value;
k = entry[0], v = entry[1], skipping && (skipping = predicate.call(context, v, k, this$0));
} while (skipping);
return type === ITERATE_ENTRIES ? step : iteratorValue(type, k, v, step);
});
}, skipSequence;
}
function concatFactory(iterable, values) {
var isKeyedIterable = isKeyed(iterable), iters = [ iterable ].concat(values).map(function(v) {
return isIterable(v) ? isKeyedIterable && (v = KeyedIterable(v)) : v = isKeyedIterable ? keyedSeqFromValue(v) : indexedSeqFromValue(Array.isArray(v) ? v : [ v ]),
v;
}).filter(function(v) {
return 0 !== v.size;
});
if (0 === iters.length) return iterable;
if (1 === iters.length) {
var singleton = iters[0];
if (singleton === iterable || isKeyedIterable && isKeyed(singleton) || isIndexed(iterable) && isIndexed(singleton)) return singleton;
}
var concatSeq = new ArraySeq(iters);
return isKeyedIterable ? concatSeq = concatSeq.toKeyedSeq() : isIndexed(iterable) || (concatSeq = concatSeq.toSetSeq()),
concatSeq = concatSeq.flatten(!0), concatSeq.size = iters.reduce(function(sum, seq) {
if (void 0 !== sum) {
var size = seq.size;
if (void 0 !== size) return sum + size;
}
}, 0), concatSeq;
}
function flattenFactory(iterable, depth, useKeys) {
var flatSequence = makeSequence(iterable);
return flatSequence.__iterateUncached = function(fn, reverse) {
function flatDeep(iter, currentDepth) {
var this$0 = this;
iter.__iterate(function(v, k) {
return (!depth || currentDepth < depth) && isIterable(v) ? flatDeep(v, currentDepth + 1) : fn(v, useKeys ? k : iterations++, this$0) === !1 && (stopped = !0),
!stopped;
}, reverse);
}
var iterations = 0, stopped = !1;
return flatDeep(iterable, 0), iterations;
}, flatSequence.__iteratorUncached = function(type, reverse) {
var iterator = iterable.__iterator(type, reverse), stack = [], iterations = 0;
return new Iterator(function() {
for (;iterator; ) {
var step = iterator.next();
if (step.done === !1) {
var v = step.value;
if (type === ITERATE_ENTRIES && (v = v[1]), depth && !(stack.length < depth) || !isIterable(v)) return useKeys ? step : iteratorValue(type, iterations++, v, step);
stack.push(iterator), iterator = v.__iterator(type, reverse);
} else iterator = stack.pop();
}
return iteratorDone();
});
}, flatSequence;
}
function flatMapFactory(iterable, mapper, context) {
var coerce = iterableClass(iterable);
return iterable.toSeq().map(function(v, k) {
return coerce(mapper.call(context, v, k, iterable));
}).flatten(!0);
}
function interposeFactory(iterable, separator) {
var interposedSequence = makeSequence(iterable);
return interposedSequence.size = iterable.size && 2 * iterable.size - 1, interposedSequence.__iterateUncached = function(fn, reverse) {
var this$0 = this, iterations = 0;
return iterable.__iterate(function(v, k) {
return (!iterations || fn(separator, iterations++, this$0) !== !1) && fn(v, iterations++, this$0) !== !1;
}, reverse), iterations;
}, interposedSequence.__iteratorUncached = function(type, reverse) {
var step, iterator = iterable.__iterator(ITERATE_VALUES, reverse), iterations = 0;
return new Iterator(function() {
return (!step || iterations % 2) && (step = iterator.next(), step.done) ? step : iterations % 2 ? iteratorValue(type, iterations++, separator) : iteratorValue(type, iterations++, step.value, step);
});
}, interposedSequence;
}
function sortFactory(iterable, comparator, mapper) {
comparator || (comparator = defaultComparator);
var isKeyedIterable = isKeyed(iterable), index = 0, entries = iterable.toSeq().map(function(v, k) {
return [ k, v, index++, mapper ? mapper(v, k, iterable) : v ];
}).toArray();
return entries.sort(function(a, b) {
return comparator(a[3], b[3]) || a[2] - b[2];
}).forEach(isKeyedIterable ? function(v, i) {
entries[i].length = 2;
} : function(v, i) {
entries[i] = v[1];
}), isKeyedIterable ? KeyedSeq(entries) : isIndexed(iterable) ? IndexedSeq(entries) : SetSeq(entries);
}
function maxFactory(iterable, comparator, mapper) {
if (comparator || (comparator = defaultComparator), mapper) {
var entry = iterable.toSeq().map(function(v, k) {
return [ v, mapper(v, k, iterable) ];
}).reduce(function(a, b) {
return maxCompare(comparator, a[1], b[1]) ? b : a;
});
return entry && entry[0];
}
return iterable.reduce(function(a, b) {
return maxCompare(comparator, a, b) ? b : a;
});
}
function maxCompare(comparator, a, b) {
var comp = comparator(b, a);
// b is considered the new max if the comparator declares them equal, but
// they are not equal and b is in fact a nullish value.
return 0 === comp && b !== a && (void 0 === b || null === b || b !== b) || comp > 0;
}
function zipWithFactory(keyIter, zipper, iters) {
var zipSequence = makeSequence(keyIter);
// Note: this a generic base implementation of __iterate in terms of
// __iterator which may be more generically useful in the future.
return zipSequence.size = new ArraySeq(iters).map(function(i) {
return i.size;
}).min(), zipSequence.__iterate = function(fn, reverse) {
for (/* generic:
var iterator = this.__iterator(ITERATE_ENTRIES, reverse);
var step;
var iterations = 0;
while (!(step = iterator.next()).done) {
iterations++;
if (fn(step.value[1], step.value[0], this) === false) {
break;
}
}
return iterations;
*/
// indexed:
var step, iterator = this.__iterator(ITERATE_VALUES, reverse), iterations = 0; !(step = iterator.next()).done && fn(step.value, iterations++, this) !== !1; ) ;
return iterations;
}, zipSequence.__iteratorUncached = function(type, reverse) {
var iterators = iters.map(function(i) {
return i = Iterable(i), getIterator(reverse ? i.reverse() : i);
}), iterations = 0, isDone = !1;
return new Iterator(function() {
var steps;
return isDone || (steps = iterators.map(function(i) {
return i.next();
}), isDone = steps.some(function(s) {
return s.done;
})), isDone ? iteratorDone() : iteratorValue(type, iterations++, zipper.apply(null, steps.map(function(s) {
return s.value;
})));
});
}, zipSequence;
}
// #pragma Helper Functions
function reify(iter, seq) {
return isSeq(iter) ? seq : iter.constructor(seq);
}
function validateEntry(entry) {
if (entry !== Object(entry)) throw new TypeError("Expected [K, V] tuple: " + entry);
}
function resolveSize(iter) {
return assertNotInfinite(iter.size), ensureSize(iter);
}
function iterableClass(iterable) {
return isKeyed(iterable) ? KeyedIterable : isIndexed(iterable) ? IndexedIterable : SetIterable;
}
function makeSequence(iterable) {
return Object.create((isKeyed(iterable) ? KeyedSeq : isIndexed(iterable) ? IndexedSeq : SetSeq).prototype);
}
function cacheResultThrough() {
return this._iter.cacheResult ? (this._iter.cacheResult(), this.size = this._iter.size,
this) : Seq.prototype.cacheResult.call(this);
}
function defaultComparator(a, b) {
return a > b ? 1 : a < b ? -1 : 0;
}
function forceIterator(keyPath) {
var iter = getIterator(keyPath);
if (!iter) {
// Array might not be iterable in this environment, so we need a fallback
// to our wrapped type.
if (!isArrayLike(keyPath)) throw new TypeError("Expected iterable or array-like: " + keyPath);
iter = getIterator(Iterable(keyPath));
}
return iter;
}
function Record(defaultValues, name) {
var hasInitialized, RecordType = function(values) {
if (values instanceof RecordType) return values;
if (!(this instanceof RecordType)) return new RecordType(values);
if (!hasInitialized) {
hasInitialized = !0;
var keys = Object.keys(defaultValues);
setProps(RecordTypePrototype, keys), RecordTypePrototype.size = keys.length, RecordTypePrototype._name = name,
RecordTypePrototype._keys = keys, RecordTypePrototype._defaultValues = defaultValues;
}
this._map = Map(values);
}, RecordTypePrototype = RecordType.prototype = Object.create(RecordPrototype);
return RecordTypePrototype.constructor = RecordType, RecordType;
}
function makeRecord(likeRecord, map, ownerID) {
var record = Object.create(Object.getPrototypeOf(likeRecord));
return record._map = map, record.__ownerID = ownerID, record;
}
function recordName(record) {
return record._name || record.constructor.name || "Record";
}
function setProps(prototype, names) {
try {
names.forEach(setProp.bind(void 0, prototype));
} catch (error) {}
}
function setProp(prototype, name) {
Object.defineProperty(prototype, name, {
get: function() {
return this.get(name);
},
set: function(value) {
invariant(this.__ownerID, "Cannot set on an immutable record."), this.set(name, value);
}
});
}
// @pragma Construction
function Set(value) {
return null === value || void 0 === value ? emptySet() : isSet(value) && !isOrdered(value) ? value : emptySet().withMutations(function(set) {
var iter = SetIterable(value);
assertNotInfinite(iter.size), iter.forEach(function(v) {
return set.add(v);
});
});
}
function isSet(maybeSet) {
return !(!maybeSet || !maybeSet[IS_SET_SENTINEL]);
}
function updateSet(set, newMap) {
return set.__ownerID ? (set.size = newMap.size, set._map = newMap, set) : newMap === set._map ? set : 0 === newMap.size ? set.__empty() : set.__make(newMap);
}
function makeSet(map, ownerID) {
var set = Object.create(SetPrototype);
return set.size = map ? map.size : 0, set._map = map, set.__ownerID = ownerID, set;
}
function emptySet() {
return EMPTY_SET || (EMPTY_SET = makeSet(emptyMap()));
}
// @pragma Construction
function OrderedSet(value) {
return null === value || void 0 === value ? emptyOrderedSet() : isOrderedSet(value) ? value : emptyOrderedSet().withMutations(function(set) {
var iter = SetIterable(value);
assertNotInfinite(iter.size), iter.forEach(function(v) {
return set.add(v);
});
});
}
function isOrderedSet(maybeOrderedSet) {
return isSet(maybeOrderedSet) && isOrdered(maybeOrderedSet);
}
function makeOrderedSet(map, ownerID) {
var set = Object.create(OrderedSetPrototype);
return set.size = map ? map.size : 0, set._map = map, set.__ownerID = ownerID, set;
}
function emptyOrderedSet() {
return EMPTY_ORDERED_SET || (EMPTY_ORDERED_SET = makeOrderedSet(emptyOrderedMap()));
}
// @pragma Construction
function Stack(value) {
return null === value || void 0 === value ? emptyStack() : isStack(value) ? value : emptyStack().unshiftAll(value);
}
function isStack(maybeStack) {
return !(!maybeStack || !maybeStack[IS_STACK_SENTINEL]);
}
function makeStack(size, head, ownerID, hash) {
var map = Object.create(StackPrototype);
return map.size = size, map._head = head, map.__ownerID = ownerID, map.__hash = hash,
map.__altered = !1, map;
}
function emptyStack() {
return EMPTY_STACK || (EMPTY_STACK = makeStack(0));
}
/**
* Contributes additional methods to a constructor
*/
function mixin(ctor, methods) {
var keyCopier = function(key) {
ctor.prototype[key] = methods[key];
};
return Object.keys(methods).forEach(keyCopier), Object.getOwnPropertySymbols && Object.getOwnPropertySymbols(methods).forEach(keyCopier),
ctor;
}
// #pragma Helper functions
function keyMapper(v, k) {
return k;
}
function entryMapper(v, k) {
return [ k, v ];
}
function not(predicate) {
return function() {
return !predicate.apply(this, arguments);
};
}
function neg(predicate) {
return function() {
return -predicate.apply(this, arguments);
};
}
function quoteString(value) {
return "string" == typeof value ? JSON.stringify(value) : String(value);
}
function defaultZipper() {
return arrCopy(arguments);
}
function defaultNegComparator(a, b) {
return a < b ? 1 : a > b ? -1 : 0;
}
function hashIterable(iterable) {
if (iterable.size === 1 / 0) return 0;
var ordered = isOrdered(iterable), keyed = isKeyed(iterable), h = ordered ? 1 : 0, size = iterable.__iterate(keyed ? ordered ? function(v, k) {
h = 31 * h + hashMerge(hash(v), hash(k)) | 0;
} : function(v, k) {
h = h + hashMerge(hash(v), hash(k)) | 0;
} : ordered ? function(v) {
h = 31 * h + hash(v) | 0;
} : function(v) {
h = h + hash(v) | 0;
});
return murmurHashOfSize(size, h);
}
function murmurHashOfSize(size, h) {
return h = imul(h, 3432918353), h = imul(h << 15 | h >>> -15, 461845907), h = imul(h << 13 | h >>> -13, 5),
h = (h + 3864292196 | 0) ^ size, h = imul(h ^ h >>> 16, 2246822507), h = imul(h ^ h >>> 13, 3266489909),
h = smi(h ^ h >>> 16);
}
function hashMerge(a, b) {
return a ^ b + 2654435769 + (a << 6) + (a >> 2) | 0;
}
var SLICE$0 = Array.prototype.slice;
createClass(KeyedIterable, Iterable), createClass(IndexedIterable, Iterable), createClass(SetIterable, Iterable),
Iterable.isIterable = isIterable, Iterable.isKeyed = isKeyed, Iterable.isIndexed = isIndexed,
Iterable.isAssociative = isAssociative, Iterable.isOrdered = isOrdered, Iterable.Keyed = KeyedIterable,
Iterable.Indexed = IndexedIterable, Iterable.Set = SetIterable;
var IS_ITERABLE_SENTINEL = "@@__IMMUTABLE_ITERABLE__@@", IS_KEYED_SENTINEL = "@@__IMMUTABLE_KEYED__@@", IS_INDEXED_SENTINEL = "@@__IMMUTABLE_INDEXED__@@", IS_ORDERED_SENTINEL = "@@__IMMUTABLE_ORDERED__@@", DELETE = "delete", SHIFT = 5, SIZE = 1 << SHIFT, MASK = SIZE - 1, NOT_SET = {}, CHANGE_LENGTH = {
value: !1
}, DID_ALTER = {
value: !1
}, ITERATE_KEYS = 0, ITERATE_VALUES = 1, ITERATE_ENTRIES = 2, REAL_ITERATOR_SYMBOL = "function" == typeof Symbol && Symbol.iterator, FAUX_ITERATOR_SYMBOL = "@@iterator", ITERATOR_SYMBOL = REAL_ITERATOR_SYMBOL || FAUX_ITERATOR_SYMBOL;
Iterator.prototype.toString = function() {
return "[Iterator]";
}, Iterator.KEYS = ITERATE_KEYS, Iterator.VALUES = ITERATE_VALUES, Iterator.ENTRIES = ITERATE_ENTRIES,
Iterator.prototype.inspect = Iterator.prototype.toSource = function() {
return this.toString();
}, Iterator.prototype[ITERATOR_SYMBOL] = function() {
return this;
}, createClass(Seq, Iterable), Seq.of = function() {
return Seq(arguments);
}, Seq.prototype.toSeq = function() {
return this;
}, Seq.prototype.toString = function() {
return this.__toString("Seq {", "}");
}, Seq.prototype.cacheResult = function() {
return !this._cache && this.__iterateUncached && (this._cache = this.entrySeq().toArray(),
this.size = this._cache.length), this;
}, // abstract __iterateUncached(fn, reverse)
Seq.prototype.__iterate = function(fn, reverse) {
return seqIterate(this, fn, reverse, !0);
}, // abstract __iteratorUncached(type, reverse)
Seq.prototype.__iterator = function(type, reverse) {
return seqIterator(this, type, reverse, !0);
}, createClass(KeyedSeq, Seq), KeyedSeq.prototype.toKeyedSeq = function() {
return this;
}, createClass(IndexedSeq, Seq), IndexedSeq.of = function() {
return IndexedSeq(arguments);
}, IndexedSeq.prototype.toIndexedSeq = function() {
return this;
}, IndexedSeq.prototype.toString = function() {
return this.__toString("Seq [", "]");
}, IndexedSeq.prototype.__iterate = function(fn, reverse) {
return seqIterate(this, fn, reverse, !1);
}, IndexedSeq.prototype.__iterator = function(type, reverse) {
return seqIterator(this, type, reverse, !1);
}, createClass(SetSeq, Seq), SetSeq.of = function() {
return SetSeq(arguments);
}, SetSeq.prototype.toSetSeq = function() {
return this;
}, Seq.isSeq = isSeq, Seq.Keyed = KeyedSeq, Seq.Set = SetSeq, Seq.Indexed = IndexedSeq;
var IS_SEQ_SENTINEL = "@@__IMMUTABLE_SEQ__@@";
Seq.prototype[IS_SEQ_SENTINEL] = !0, createClass(ArraySeq, IndexedSeq), ArraySeq.prototype.get = function(index, notSetValue) {
return this.has(index) ? this._array[wrapIndex(this, index)] : notSetValue;
}, ArraySeq.prototype.__iterate = function(fn, reverse) {
for (var array = this._array, maxIndex = array.length - 1, ii = 0; ii <= maxIndex; ii++) if (fn(array[reverse ? maxIndex - ii : ii], ii, this) === !1) return ii + 1;
return ii;
}, ArraySeq.prototype.__iterator = function(type, reverse) {
var array = this._array, maxIndex = array.length - 1, ii = 0;
return new Iterator(function() {
return ii > maxIndex ? iteratorDone() : iteratorValue(type, ii, array[reverse ? maxIndex - ii++ : ii++]);
});
}, createClass(ObjectSeq, KeyedSeq), ObjectSeq.prototype.get = function(key, notSetValue) {
return void 0 === notSetValue || this.has(key) ? this._object[key] : notSetValue;
}, ObjectSeq.prototype.has = function(key) {
return this._object.hasOwnProperty(key);
}, ObjectSeq.prototype.__iterate = function(fn, reverse) {
for (var object = this._object, keys = this._keys, maxIndex = keys.length - 1, ii = 0; ii <= maxIndex; ii++) {
var key = keys[reverse ? maxIndex - ii : ii];
if (fn(object[key], key, this) === !1) return ii + 1;
}
return ii;
}, ObjectSeq.prototype.__iterator = function(type, reverse) {
var object = this._object, keys = this._keys, maxIndex = keys.length - 1, ii = 0;
return new Iterator(function() {
var key = keys[reverse ? maxIndex - ii : ii];
return ii++ > maxIndex ? iteratorDone() : iteratorValue(type, key, object[key]);
});
}, ObjectSeq.prototype[IS_ORDERED_SENTINEL] = !0, createClass(IterableSeq, IndexedSeq),
IterableSeq.prototype.__iterateUncached = function(fn, reverse) {
if (reverse) return this.cacheResult().__iterate(fn, reverse);
var iterable = this._iterable, iterator = getIterator(iterable), iterations = 0;
if (isIterator(iterator)) for (var step; !(step = iterator.next()).done && fn(step.value, iterations++, this) !== !1; ) ;
return iterations;
}, IterableSeq.prototype.__iteratorUncached = function(type, reverse) {
if (reverse) return this.cacheResult().__iterator(type, reverse);
var iterable = this._iterable, iterator = getIterator(iterable);
if (!isIterator(iterator)) return new Iterator(iteratorDone);
var iterations = 0;
return new Iterator(function() {
var step = iterator.next();
return step.done ? step : iteratorValue(type, iterations++, step.value);
});
}, createClass(IteratorSeq, IndexedSeq), IteratorSeq.prototype.__iterateUncached = function(fn, reverse) {
if (reverse) return this.cacheResult().__iterate(fn, reverse);
for (var iterator = this._iterator, cache = this._iteratorCache, iterations = 0; iterations < cache.length; ) if (fn(cache[iterations], iterations++, this) === !1) return iterations;
for (var step; !(step = iterator.next()).done; ) {
var val = step.value;
if (cache[iterations] = val, fn(val, iterations++, this) === !1) break;
}
return iterations;
}, IteratorSeq.prototype.__iteratorUncached = function(type, reverse) {
if (reverse) return this.cacheResult().__iterator(type, reverse);
var iterator = this._iterator, cache = this._iteratorCache, iterations = 0;
return new Iterator(function() {
if (iterations >= cache.length) {
var step = iterator.next();
if (step.done) return step;
cache[iterations] = step.value;
}
return iteratorValue(type, iterations, cache[iterations++]);
});
};
var EMPTY_SEQ;
createClass(Repeat, IndexedSeq), Repeat.prototype.toString = function() {
return 0 === this.size ? "Repeat []" : "Repeat [ " + this._value + " " + this.size + " times ]";
}, Repeat.prototype.get = function(index, notSetValue) {
return this.has(index) ? this._value : notSetValue;
}, Repeat.prototype.includes = function(searchValue) {
return is(this._value, searchValue);
}, Repeat.prototype.slice = function(begin, end) {
var size = this.size;
return wholeSlice(begin, end, size) ? this : new Repeat(this._value, resolveEnd(end, size) - resolveBegin(begin, size));
}, Repeat.prototype.reverse = function() {
return this;
}, Repeat.prototype.indexOf = function(searchValue) {
return is(this._value, searchValue) ? 0 : -1;
}, Repeat.prototype.lastIndexOf = function(searchValue) {
return is(this._value, searchValue) ? this.size : -1;
}, Repeat.prototype.__iterate = function(fn, reverse) {
for (var ii = 0; ii < this.size; ii++) if (fn(this._value, ii, this) === !1) return ii + 1;
return ii;
}, Repeat.prototype.__iterator = function(type, reverse) {
var this$0 = this, ii = 0;
return new Iterator(function() {
return ii < this$0.size ? iteratorValue(type, ii++, this$0._value) : iteratorDone();
});
}, Repeat.prototype.equals = function(other) {
return other instanceof Repeat ? is(this._value, other._value) : deepEqual(other);
};
var EMPTY_REPEAT;
createClass(Range, IndexedSeq), Range.prototype.toString = function() {
return 0 === this.size ? "Range []" : "Range [ " + this._start + "..." + this._end + (1 !== this._step ? " by " + this._step : "") + " ]";
}, Range.prototype.get = function(index, notSetValue) {
return this.has(index) ? this._start + wrapIndex(this, index) * this._step : notSetValue;
}, Range.prototype.includes = function(searchValue) {
var possibleIndex = (searchValue - this._start) / this._step;
return possibleIndex >= 0 && possibleIndex < this.size && possibleIndex === Math.floor(possibleIndex);
}, Range.prototype.slice = function(begin, end) {
return wholeSlice(begin, end, this.size) ? this : (begin = resolveBegin(begin, this.size),
end = resolveEnd(end, this.size), end <= begin ? new Range(0, 0) : new Range(this.get(begin, this._end), this.get(end, this._end), this._step));
}, Range.prototype.indexOf = function(searchValue) {
var offsetValue = searchValue - this._start;
if (offsetValue % this._step === 0) {
var index = offsetValue / this._step;
if (index >= 0 && index < this.size) return index;
}
return -1;
}, Range.prototype.lastIndexOf = function(searchValue) {
return this.indexOf(searchValue);
}, Range.prototype.__iterate = function(fn, reverse) {
for (var maxIndex = this.size - 1, step = this._step, value = reverse ? this._start + maxIndex * step : this._start, ii = 0; ii <= maxIndex; ii++) {
if (fn(value, ii, this) === !1) return ii + 1;
value += reverse ? -step : step;
}
return ii;
}, Range.prototype.__iterator = function(type, reverse) {
var maxIndex = this.size - 1, step = this._step, value = reverse ? this._start + maxIndex * step : this._start, ii = 0;
return new Iterator(function() {
var v = value;
return value += reverse ? -step : step, ii > maxIndex ? iteratorDone() : iteratorValue(type, ii++, v);
});
}, Range.prototype.equals = function(other) {
return other instanceof Range ? this._start === other._start && this._end === other._end && this._step === other._step : deepEqual(this, other);
};
var EMPTY_RANGE;
createClass(Collection, Iterable), createClass(KeyedCollection, Collection), createClass(IndexedCollection, Collection),
createClass(SetCollection, Collection), Collection.Keyed = KeyedCollection, Collection.Indexed = IndexedCollection,
Collection.Set = SetCollection;
var weakMap, imul = "function" == typeof Math.imul && Math.imul(4294967295, 2) === -2 ? Math.imul : function(a, b) {
a |= 0, // int
b |= 0;
// int
var c = 65535 & a, d = 65535 & b;
// Shift by 0 fixes the sign on the high part.
return c * d + ((a >>> 16) * d + c * (b >>> 16) << 16 >>> 0) | 0;
}, isExtensible = Object.isExtensible, canDefineProperty = function() {
try {
return Object.defineProperty({}, "@", {}), !0;
} catch (e) {
return !1;
}
}(), usingWeakMap = "function" == typeof WeakMap;
usingWeakMap && (weakMap = new WeakMap());
var objHashUID = 0, UID_HASH_KEY = "__immutablehash__";
"function" == typeof Symbol && (UID_HASH_KEY = Symbol(UID_HASH_KEY));
var STRING_HASH_CACHE_MIN_STRLEN = 16, STRING_HASH_CACHE_MAX_SIZE = 255, STRING_HASH_CACHE_SIZE = 0, stringHashCache = {};
createClass(Map, KeyedCollection), Map.of = function() {
var keyValues = SLICE$0.call(arguments, 0);
return emptyMap().withMutations(function(map) {
for (var i = 0; i < keyValues.length; i += 2) {
if (i + 1 >= keyValues.length) throw new Error("Missing value for key: " + keyValues[i]);
map.set(keyValues[i], keyValues[i + 1]);
}
});
}, Map.prototype.toString = function() {
return this.__toString("Map {", "}");
}, // @pragma Access
Map.prototype.get = function(k, notSetValue) {
return this._root ? this._root.get(0, void 0, k, notSetValue) : notSetValue;
}, // @pragma Modification
Map.prototype.set = function(k, v) {
return updateMap(this, k, v);
}, Map.prototype.setIn = function(keyPath, v) {
return this.updateIn(keyPath, NOT_SET, function() {
return v;
});
}, Map.prototype.remove = function(k) {
return updateMap(this, k, NOT_SET);
}, Map.prototype.deleteIn = function(keyPath) {
return this.updateIn(keyPath, function() {
return NOT_SET;
});
}, Map.prototype.update = function(k, notSetValue, updater) {
return 1 === arguments.length ? k(this) : this.updateIn([ k ], notSetValue, updater);
}, Map.prototype.updateIn = function(keyPath, notSetValue, updater) {
updater || (updater = notSetValue, notSetValue = void 0);
var updatedValue = updateInDeepMap(this, forceIterator(keyPath), notSetValue, updater);
return updatedValue === NOT_SET ? void 0 : updatedValue;
}, Map.prototype.clear = function() {
return 0 === this.size ? this : this.__ownerID ? (this.size = 0, this._root = null,
this.__hash = void 0, this.__altered = !0, this) : emptyMap();
}, // @pragma Composition
Map.prototype.merge = function() {
return mergeIntoMapWith(this, void 0, arguments);
}, Map.prototype.mergeWith = function(merger) {
var iters = SLICE$0.call(arguments, 1);
return mergeIntoMapWith(this, merger, iters);
}, Map.prototype.mergeIn = function(keyPath) {
var iters = SLICE$0.call(arguments, 1);
return this.updateIn(keyPath, emptyMap(), function(m) {
return "function" == typeof m.merge ? m.merge.apply(m, iters) : iters[iters.length - 1];
});
}, Map.prototype.mergeDeep = function() {
return mergeIntoMapWith(this, deepMerger, arguments);
}, Map.prototype.mergeDeepWith = function(merger) {
var iters = SLICE$0.call(arguments, 1);
return mergeIntoMapWith(this, deepMergerWith(merger), iters);
}, Map.prototype.mergeDeepIn = function(keyPath) {
var iters = SLICE$0.call(arguments, 1);
return this.updateIn(keyPath, emptyMap(), function(m) {
return "function" == typeof m.mergeDeep ? m.mergeDeep.apply(m, iters) : iters[iters.length - 1];
});
}, Map.prototype.sort = function(comparator) {
// Late binding
return OrderedMap(sortFactory(this, comparator));
}, Map.prototype.sortBy = function(mapper, comparator) {
// Late binding
return OrderedMap(sortFactory(this, comparator, mapper));
}, // @pragma Mutability
Map.prototype.withMutations = function(fn) {
var mutable = this.asMutable();
return fn(mutable), mutable.wasAltered() ? mutable.__ensureOwner(this.__ownerID) : this;
}, Map.prototype.asMutable = function() {
return this.__ownerID ? this : this.__ensureOwner(new OwnerID());
}, Map.prototype.asImmutable = function() {
return this.__ensureOwner();
}, Map.prototype.wasAltered = function() {
return this.__altered;
}, Map.prototype.__iterator = function(type, reverse) {
return new MapIterator(this, type, reverse);
}, Map.prototype.__iterate = function(fn, reverse) {
var this$0 = this, iterations = 0;
return this._root && this._root.iterate(function(entry) {
return iterations++, fn(entry[1], entry[0], this$0);
}, reverse), iterations;
}, Map.prototype.__ensureOwner = function(ownerID) {
return ownerID === this.__ownerID ? this : ownerID ? makeMap(this.size, this._root, ownerID, this.__hash) : (this.__ownerID = ownerID,
this.__altered = !1, this);
}, Map.isMap = isMap;
var IS_MAP_SENTINEL = "@@__IMMUTABLE_MAP__@@", MapPrototype = Map.prototype;
MapPrototype[IS_MAP_SENTINEL] = !0, MapPrototype[DELETE] = MapPrototype.remove,
MapPrototype.removeIn = MapPrototype.deleteIn, ArrayMapNode.prototype.get = function(shift, keyHash, key, notSetValue) {
for (var entries = this.entries, ii = 0, len = entries.length; ii < len; ii++) if (is(key, entries[ii][0])) return entries[ii][1];
return notSetValue;
}, ArrayMapNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {
for (var removed = value === NOT_SET, entries = this.entries, idx = 0, len = entries.length; idx < len && !is(key, entries[idx][0]); idx++) ;
var exists = idx < len;
if (exists ? entries[idx][1] === value : removed) return this;
if (SetRef(didAlter), (removed || !exists) && SetRef(didChangeSize), !removed || 1 !== entries.length) {
if (!exists && !removed && entries.length >= MAX_ARRAY_MAP_SIZE) return createNodes(ownerID, entries, key, value);
var isEditable = ownerID && ownerID === this.ownerID, newEntries = isEditable ? entries : arrCopy(entries);
return exists ? removed ? idx === len - 1 ? newEntries.pop() : newEntries[idx] = newEntries.pop() : newEntries[idx] = [ key, value ] : newEntries.push([ key, value ]),
isEditable ? (this.entries = newEntries, this) : new ArrayMapNode(ownerID, newEntries);
}
}, BitmapIndexedNode.prototype.get = function(shift, keyHash, key, notSetValue) {
void 0 === keyHash && (keyHash = hash(key));
var bit = 1 << ((0 === shift ? keyHash : keyHash >>> shift) & MASK), bitmap = this.bitmap;
return 0 === (bitmap & bit) ? notSetValue : this.nodes[popCount(bitmap & bit - 1)].get(shift + SHIFT, keyHash, key, notSetValue);
}, BitmapIndexedNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {
void 0 === keyHash && (keyHash = hash(key));
var keyHashFrag = (0 === shift ? keyHash : keyHash >>> shift) & MASK, bit = 1 << keyHashFrag, bitmap = this.bitmap, exists = 0 !== (bitmap & bit);
if (!exists && value === NOT_SET) return this;
var idx = popCount(bitmap & bit - 1), nodes = this.nodes, node = exists ? nodes[idx] : void 0, newNode = updateNode(node, ownerID, shift + SHIFT, keyHash, key, value, didChangeSize, didAlter);
if (newNode === node) return this;
if (!exists && newNode && nodes.length >= MAX_BITMAP_INDEXED_SIZE) return expandNodes(ownerID, nodes, bitmap, keyHashFrag, newNode);
if (exists && !newNode && 2 === nodes.length && isLeafNode(nodes[1 ^ idx])) return nodes[1 ^ idx];
if (exists && newNode && 1 === nodes.length && isLeafNode(newNode)) return newNode;
var isEditable = ownerID && ownerID === this.ownerID, newBitmap = exists ? newNode ? bitmap : bitmap ^ bit : bitmap | bit, newNodes = exists ? newNode ? setIn(nodes, idx, newNode, isEditable) : spliceOut(nodes, idx, isEditable) : spliceIn(nodes, idx, newNode, isEditable);
return isEditable ? (this.bitmap = newBitmap, this.nodes = newNodes, this) : new BitmapIndexedNode(ownerID, newBitmap, newNodes);
}, HashArrayMapNode.prototype.get = function(shift, keyHash, key, notSetValue) {
void 0 === keyHash && (keyHash = hash(key));
var idx = (0 === shift ? keyHash : keyHash >>> shift) & MASK, node = this.nodes[idx];
return node ? node.get(shift + SHIFT, keyHash, key, notSetValue) : notSetValue;
}, HashArrayMapNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {
void 0 === keyHash && (keyHash = hash(key));
var idx = (0 === shift ? keyHash : keyHash >>> shift) & MASK, removed = value === NOT_SET, nodes = this.nodes, node = nodes[idx];
if (removed && !node) return this;
var newNode = updateNode(node, ownerID, shift + SHIFT, keyHash, key, value, didChangeSize, didAlter);
if (newNode === node) return this;
var newCount = this.count;
if (node) {
if (!newNode && (newCount--, newCount < MIN_HASH_ARRAY_MAP_SIZE)) return packNodes(ownerID, nodes, newCount, idx);
} else newCount++;
var isEditable = ownerID && ownerID === this.ownerID, newNodes = setIn(nodes, idx, newNode, isEditable);
return isEditable ? (this.count = newCount, this.nodes = newNodes, this) : new HashArrayMapNode(ownerID, newCount, newNodes);
}, HashCollisionNode.prototype.get = function(shift, keyHash, key, notSetValue) {
for (var entries = this.entries, ii = 0, len = entries.length; ii < len; ii++) if (is(key, entries[ii][0])) return entries[ii][1];
return notSetValue;
}, HashCollisionNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {
void 0 === keyHash && (keyHash = hash(key));
var removed = value === NOT_SET;
if (keyHash !== this.keyHash) return removed ? this : (SetRef(didAlter), SetRef(didChangeSize),
mergeIntoNode(this, ownerID, shift, keyHash, [ key, value ]));
for (var entries = this.entries, idx = 0, len = entries.length; idx < len && !is(key, entries[idx][0]); idx++) ;
var exists = idx < len;
if (exists ? entries[idx][1] === value : removed) return this;
if (SetRef(didAlter), (removed || !exists) && SetRef(didChangeSize), removed && 2 === len) return new ValueNode(ownerID, this.keyHash, entries[1 ^ idx]);
var isEditable = ownerID && ownerID === this.ownerID, newEntries = isEditable ? entries : arrCopy(entries);
return exists ? removed ? idx === len - 1 ? newEntries.pop() : newEntries[idx] = newEntries.pop() : newEntries[idx] = [ key, value ] : newEntries.push([ key, value ]),
isEditable ? (this.entries = newEntries, this) : new HashCollisionNode(ownerID, this.keyHash, newEntries);
}, ValueNode.prototype.get = function(shift, keyHash, key, notSetValue) {
return is(key, this.entry[0]) ? this.entry[1] : notSetValue;
}, ValueNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {
var removed = value === NOT_SET, keyMatch = is(key, this.entry[0]);
return (keyMatch ? value === this.entry[1] : removed) ? this : (SetRef(didAlter),
removed ? void SetRef(didChangeSize) : keyMatch ? ownerID && ownerID === this.ownerID ? (this.entry[1] = value,
this) : new ValueNode(ownerID, this.keyHash, [ key, value ]) : (SetRef(didChangeSize),
mergeIntoNode(this, ownerID, shift, hash(key), [ key, value ])));
}, // #pragma Iterators
ArrayMapNode.prototype.iterate = HashCollisionNode.prototype.iterate = function(fn, reverse) {
for (var entries = this.entries, ii = 0, maxIndex = entries.length - 1; ii <= maxIndex; ii++) if (fn(entries[reverse ? maxIndex - ii : ii]) === !1) return !1;
}, BitmapIndexedNode.prototype.iterate = HashArrayMapNode.prototype.iterate = function(fn, reverse) {
for (var nodes = this.nodes, ii = 0, maxIndex = nodes.length - 1; ii <= maxIndex; ii++) {
var node = nodes[reverse ? maxIndex - ii : ii];
if (node && node.iterate(fn, reverse) === !1) return !1;
}
}, ValueNode.prototype.iterate = function(fn, reverse) {
return fn(this.entry);
}, createClass(MapIterator, Iterator), MapIterator.prototype.next = function() {
for (var type = this._type, stack = this._stack; stack; ) {
var maxIndex, node = stack.node, index = stack.index++;
if (node.entry) {
if (0 === index) return mapIteratorValue(type, node.entry);
} else if (node.entries) {
if (maxIndex = node.entries.length - 1, index <= maxIndex) return mapIteratorValue(type, node.entries[this._reverse ? maxIndex - index : index]);
} else if (maxIndex = node.nodes.length - 1, index <= maxIndex) {
var subNode = node.nodes[this._reverse ? maxIndex - index : index];
if (subNode) {
if (subNode.entry) return mapIteratorValue(type, subNode.entry);
stack = this._stack = mapIteratorFrame(subNode, stack);
}
continue;
}
stack = this._stack = this._stack.__prev;
}
return iteratorDone();
};
var EMPTY_MAP, MAX_ARRAY_MAP_SIZE = SIZE / 4, MAX_BITMAP_INDEXED_SIZE = SIZE / 2, MIN_HASH_ARRAY_MAP_SIZE = SIZE / 4;
createClass(List, IndexedCollection), List.of = function() {
return this(arguments);
}, List.prototype.toString = function() {
return this.__toString("List [", "]");
}, // @pragma Access
List.prototype.get = function(index, notSetValue) {
if (index = wrapIndex(this, index), index >= 0 && index < this.size) {
index += this._origin;
var node = listNodeFor(this, index);
return node && node.array[index & MASK];
}
return notSetValue;
}, // @pragma Modification
List.prototype.set = function(index, value) {
return updateList(this, index, value);
}, List.prototype.remove = function(index) {
return this.has(index) ? 0 === index ? this.shift() : index === this.size - 1 ? this.pop() : this.splice(index, 1) : this;
}, List.prototype.insert = function(index, value) {
return this.splice(index, 0, value);
}, List.prototype.clear = function() {
return 0 === this.size ? this : this.__ownerID ? (this.size = this._origin = this._capacity = 0,
this._level = SHIFT, this._root = this._tail = null, this.__hash = void 0, this.__altered = !0,
this) : emptyList();
}, List.prototype.push = function() {
var values = arguments, oldSize = this.size;
return this.withMutations(function(list) {
setListBounds(list, 0, oldSize + values.length);
for (var ii = 0; ii < values.length; ii++) list.set(oldSize + ii, values[ii]);
});
}, List.prototype.pop = function() {
return setListBounds(this, 0, -1);
}, List.prototype.unshift = function() {
var values = arguments;
return this.withMutations(function(list) {
setListBounds(list, -values.length);
for (var ii = 0; ii < values.length; ii++) list.set(ii, values[ii]);
});
}, List.prototype.shift = function() {
return setListBounds(this, 1);
}, // @pragma Composition
List.prototype.merge = function() {
return mergeIntoListWith(this, void 0, arguments);
}, List.prototype.mergeWith = function(merger) {
var iters = SLICE$0.call(arguments, 1);
return mergeIntoListWith(this, merger, iters);
}, List.prototype.mergeDeep = function() {
return mergeIntoListWith(this, deepMerger, arguments);
}, List.prototype.mergeDeepWith = function(merger) {
var iters = SLICE$0.call(arguments, 1);
return mergeIntoListWith(this, deepMergerWith(merger), iters);
}, List.prototype.setSize = function(size) {
return setListBounds(this, 0, size);
}, // @pragma Iteration
List.prototype.slice = function(begin, end) {
var size = this.size;
return wholeSlice(begin, end, size) ? this : setListBounds(this, resolveBegin(begin, size), resolveEnd(end, size));
}, List.prototype.__iterator = function(type, reverse) {
var index = 0, values = iterateList(this, reverse);
return new Iterator(function() {
var value = values();
return value === DONE ? iteratorDone() : iteratorValue(type, index++, value);
});
}, List.prototype.__iterate = function(fn, reverse) {
for (var value, index = 0, values = iterateList(this, reverse); (value = values()) !== DONE && fn(value, index++, this) !== !1; ) ;
return index;
}, List.prototype.__ensureOwner = function(ownerID) {
return ownerID === this.__ownerID ? this : ownerID ? makeList(this._origin, this._capacity, this._level, this._root, this._tail, ownerID, this.__hash) : (this.__ownerID = ownerID,
this);
}, List.isList = isList;
var IS_LIST_SENTINEL = "@@__IMMUTABLE_LIST__@@", ListPrototype = List.prototype;
ListPrototype[IS_LIST_SENTINEL] = !0, ListPrototype[DELETE] = ListPrototype.remove,
ListPrototype.setIn = MapPrototype.setIn, ListPrototype.deleteIn = ListPrototype.removeIn = MapPrototype.removeIn,
ListPrototype.update = MapPrototype.update, ListPrototype.updateIn = MapPrototype.updateIn,
ListPrototype.mergeIn = MapPrototype.mergeIn, ListPrototype.mergeDeepIn = MapPrototype.mergeDeepIn,
ListPrototype.withMutations = MapPrototype.withMutations, ListPrototype.asMutable = MapPrototype.asMutable,
ListPrototype.asImmutable = MapPrototype.asImmutable, ListPrototype.wasAltered = MapPrototype.wasAltered,
// TODO: seems like these methods are very similar
VNode.prototype.removeBefore = function(ownerID, level, index) {
if (index === level ? 1 << level : 0 === this.array.length) return this;
var originIndex = index >>> level & MASK;
if (originIndex >= this.array.length) return new VNode([], ownerID);
var newChild, removingFirst = 0 === originIndex;
if (level > 0) {
var oldChild = this.array[originIndex];
if (newChild = oldChild && oldChild.removeBefore(ownerID, level - SHIFT, index),
newChild === oldChild && removingFirst) return this;
}
if (removingFirst && !newChild) return this;
var editable = editableVNode(this, ownerID);
if (!removingFirst) for (var ii = 0; ii < originIndex; ii++) editable.array[ii] = void 0;
return newChild && (editable.array[originIndex] = newChild), editable;
}, VNode.prototype.removeAfter = function(ownerID, level, index) {
if (index === (level ? 1 << level : 0) || 0 === this.array.length) return this;
var sizeIndex = index - 1 >>> level & MASK;
if (sizeIndex >= this.array.length) return this;
var newChild;
if (level > 0) {
var oldChild = this.array[sizeIndex];
if (newChild = oldChild && oldChild.removeAfter(ownerID, level - SHIFT, index),
newChild === oldChild && sizeIndex === this.array.length - 1) return this;
}
var editable = editableVNode(this, ownerID);
return editable.array.splice(sizeIndex + 1), newChild && (editable.array[sizeIndex] = newChild),
editable;
};
var EMPTY_LIST, DONE = {};
createClass(OrderedMap, Map), OrderedMap.of = function() {
return this(arguments);
}, OrderedMap.prototype.toString = function() {
return this.__toString("OrderedMap {", "}");
}, // @pragma Access
OrderedMap.prototype.get = function(k, notSetValue) {
var index = this._map.get(k);
return void 0 !== index ? this._list.get(index)[1] : notSetValue;
}, // @pragma Modification
OrderedMap.prototype.clear = function() {
return 0 === this.size ? this : this.__ownerID ? (this.size = 0, this._map.clear(),
this._list.clear(), this) : emptyOrderedMap();
}, OrderedMap.prototype.set = function(k, v) {
return updateOrderedMap(this, k, v);
}, OrderedMap.prototype.remove = function(k) {
return updateOrderedMap(this, k, NOT_SET);
}, OrderedMap.prototype.wasAltered = function() {
return this._map.wasAltered() || this._list.wasAltered();
}, OrderedMap.prototype.__iterate = function(fn, reverse) {
var this$0 = this;
return this._list.__iterate(function(entry) {
return entry && fn(entry[1], entry[0], this$0);
}, reverse);
}, OrderedMap.prototype.__iterator = function(type, reverse) {
return this._list.fromEntrySeq().__iterator(type, reverse);
}, OrderedMap.prototype.__ensureOwner = function(ownerID) {
if (ownerID === this.__ownerID) return this;
var newMap = this._map.__ensureOwner(ownerID), newList = this._list.__ensureOwner(ownerID);
return ownerID ? makeOrderedMap(newMap, newList, ownerID, this.__hash) : (this.__ownerID = ownerID,
this._map = newMap, this._list = newList, this);
}, OrderedMap.isOrderedMap = isOrderedMap, OrderedMap.prototype[IS_ORDERED_SENTINEL] = !0,
OrderedMap.prototype[DELETE] = OrderedMap.prototype.remove;
var EMPTY_ORDERED_MAP;
createClass(ToKeyedSequence, KeyedSeq), ToKeyedSequence.prototype.get = function(key, notSetValue) {
return this._iter.get(key, notSetValue);
}, ToKeyedSequence.prototype.has = function(key) {
return this._iter.has(key);
}, ToKeyedSequence.prototype.valueSeq = function() {
return this._iter.valueSeq();
}, ToKeyedSequence.prototype.reverse = function() {
var this$0 = this, reversedSequence = reverseFactory(this, !0);
return this._useKeys || (reversedSequence.valueSeq = function() {
return this$0._iter.toSeq().reverse();
}), reversedSequence;
}, ToKeyedSequence.prototype.map = function(mapper, context) {
var this$0 = this, mappedSequence = mapFactory(this, mapper, context);
return this._useKeys || (mappedSequence.valueSeq = function() {
return this$0._iter.toSeq().map(mapper, context);
}), mappedSequence;
}, ToKeyedSequence.prototype.__iterate = function(fn, reverse) {
var ii, this$0 = this;
return this._iter.__iterate(this._useKeys ? function(v, k) {
return fn(v, k, this$0);
} : (ii = reverse ? resolveSize(this) : 0, function(v) {
return fn(v, reverse ? --ii : ii++, this$0);
}), reverse);
}, ToKeyedSequence.prototype.__iterator = function(type, reverse) {
if (this._useKeys) return this._iter.__iterator(type, reverse);
var iterator = this._iter.__iterator(ITERATE_VALUES, reverse), ii = reverse ? resolveSize(this) : 0;
return new Iterator(function() {
var step = iterator.next();
return step.done ? step : iteratorValue(type, reverse ? --ii : ii++, step.value, step);
});
}, ToKeyedSequence.prototype[IS_ORDERED_SENTINEL] = !0, createClass(ToIndexedSequence, IndexedSeq),
ToIndexedSequence.prototype.includes = function(value) {
return this._iter.includes(value);
}, ToIndexedSequence.prototype.__iterate = function(fn, reverse) {
var this$0 = this, iterations = 0;
return this._iter.__iterate(function(v) {
return fn(v, iterations++, this$0);
}, reverse);
}, ToIndexedSequence.prototype.__iterator = function(type, reverse) {
var iterator = this._iter.__iterator(ITERATE_VALUES, reverse), iterations = 0;
return new Iterator(function() {
var step = iterator.next();
return step.done ? step : iteratorValue(type, iterations++, step.value, step);
});
}, createClass(ToSetSequence, SetSeq), ToSetSequence.prototype.has = function(key) {
return this._iter.includes(key);
}, ToSetSequence.prototype.__iterate = function(fn, reverse) {
var this$0 = this;
return this._iter.__iterate(function(v) {
return fn(v, v, this$0);
}, reverse);
}, ToSetSequence.prototype.__iterator = function(type, reverse) {
var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);
return new Iterator(function() {
var step = iterator.next();
return step.done ? step : iteratorValue(type, step.value, step.value, step);
});
}, createClass(FromEntriesSequence, KeyedSeq), FromEntriesSequence.prototype.entrySeq = function() {
return this._iter.toSeq();
}, FromEntriesSequence.prototype.__iterate = function(fn, reverse) {
var this$0 = this;
return this._iter.__iterate(function(entry) {
// Check if entry exists first so array access doesn't throw for holes
// in the parent iteration.
if (entry) {
validateEntry(entry);
var indexedIterable = isIterable(entry);
return fn(indexedIterable ? entry.get(1) : entry[1], indexedIterable ? entry.get(0) : entry[0], this$0);
}
}, reverse);
}, FromEntriesSequence.prototype.__iterator = function(type, reverse) {
var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);
return new Iterator(function() {
for (;;) {
var step = iterator.next();
if (step.done) return step;
var entry = step.value;
// Check if entry exists first so array access doesn't throw for holes
// in the parent iteration.
if (entry) {
validateEntry(entry);
var indexedIterable = isIterable(entry);
return iteratorValue(type, indexedIterable ? entry.get(0) : entry[0], indexedIterable ? entry.get(1) : entry[1], step);
}
}
});
}, ToIndexedSequence.prototype.cacheResult = ToKeyedSequence.prototype.cacheResult = ToSetSequence.prototype.cacheResult = FromEntriesSequence.prototype.cacheResult = cacheResultThrough,
createClass(Record, KeyedCollection), Record.prototype.toString = function() {
return this.__toString(recordName(this) + " {", "}");
}, // @pragma Access
Record.prototype.has = function(k) {
return this._defaultValues.hasOwnProperty(k);
}, Record.prototype.get = function(k, notSetValue) {
if (!this.has(k)) return notSetValue;
var defaultVal = this._defaultValues[k];
return this._map ? this._map.get(k, defaultVal) : defaultVal;
}, // @pragma Modification
Record.prototype.clear = function() {
if (this.__ownerID) return this._map && this._map.clear(), this;
var RecordType = this.constructor;
return RecordType._empty || (RecordType._empty = makeRecord(this, emptyMap()));
}, Record.prototype.set = function(k, v) {
if (!this.has(k)) throw new Error('Cannot set unknown key "' + k + '" on ' + recordName(this));
if (this._map && !this._map.has(k)) {
var defaultVal = this._defaultValues[k];
if (v === defaultVal) return this;
}
var newMap = this._map && this._map.set(k, v);
return this.__ownerID || newMap === this._map ? this : makeRecord(this, newMap);
}, Record.prototype.remove = function(k) {
if (!this.has(k)) return this;
var newMap = this._map && this._map.remove(k);
return this.__ownerID || newMap === this._map ? this : makeRecord(this, newMap);
}, Record.prototype.wasAltered = function() {
return this._map.wasAltered();
}, Record.prototype.__iterator = function(type, reverse) {
var this$0 = this;
return KeyedIterable(this._defaultValues).map(function(_, k) {
return this$0.get(k);
}).__iterator(type, reverse);
}, Record.prototype.__iterate = function(fn, reverse) {
var this$0 = this;
return KeyedIterable(this._defaultValues).map(function(_, k) {
return this$0.get(k);
}).__iterate(fn, reverse);
}, Record.prototype.__ensureOwner = function(ownerID) {
if (ownerID === this.__ownerID) return this;
var newMap = this._map && this._map.__ensureOwner(ownerID);
return ownerID ? makeRecord(this, newMap, ownerID) : (this.__ownerID = ownerID,
this._map = newMap, this);
};
var RecordPrototype = Record.prototype;
RecordPrototype[DELETE] = RecordPrototype.remove, RecordPrototype.deleteIn = RecordPrototype.removeIn = MapPrototype.removeIn,
RecordPrototype.merge = MapPrototype.merge, RecordPrototype.mergeWith = MapPrototype.mergeWith,
RecordPrototype.mergeIn = MapPrototype.mergeIn, RecordPrototype.mergeDeep = MapPrototype.mergeDeep,
RecordPrototype.mergeDeepWith = MapPrototype.mergeDeepWith, RecordPrototype.mergeDeepIn = MapPrototype.mergeDeepIn,
RecordPrototype.setIn = MapPrototype.setIn, RecordPrototype.update = MapPrototype.update,
RecordPrototype.updateIn = MapPrototype.updateIn, RecordPrototype.withMutations = MapPrototype.withMutations,
RecordPrototype.asMutable = MapPrototype.asMutable, RecordPrototype.asImmutable = MapPrototype.asImmutable,
createClass(Set, SetCollection), Set.of = function() {
return this(arguments);
}, Set.fromKeys = function(value) {
return this(KeyedIterable(value).keySeq());
}, Set.prototype.toString = function() {
return this.__toString("Set {", "}");
}, // @pragma Access
Set.prototype.has = function(value) {
return this._map.has(value);
}, // @pragma Modification
Set.prototype.add = function(value) {
return updateSet(this, this._map.set(value, !0));
}, Set.prototype.remove = function(value) {
return updateSet(this, this._map.remove(value));
}, Set.prototype.clear = function() {
return updateSet(this, this._map.clear());
}, // @pragma Composition
Set.prototype.union = function() {
var iters = SLICE$0.call(arguments, 0);
return iters = iters.filter(function(x) {
return 0 !== x.size;
}), 0 === iters.length ? this : 0 !== this.size || this.__ownerID || 1 !== iters.length ? this.withMutations(function(set) {
for (var ii = 0; ii < iters.length; ii++) SetIterable(iters[ii]).forEach(function(value) {
return set.add(value);
});
}) : this.constructor(iters[0]);
}, Set.prototype.intersect = function() {
var iters = SLICE$0.call(arguments, 0);
if (0 === iters.length) return this;
iters = iters.map(function(iter) {
return SetIterable(iter);
});
var originalSet = this;
return this.withMutations(function(set) {
originalSet.forEach(function(value) {
iters.every(function(iter) {
return iter.includes(value);
}) || set.remove(value);
});
});
}, Set.prototype.subtract = function() {
var iters = SLICE$0.call(arguments, 0);
if (0 === iters.length) return this;
iters = iters.map(function(iter) {
return SetIterable(iter);
});
var originalSet = this;
return this.withMutations(function(set) {
originalSet.forEach(function(value) {
iters.some(function(iter) {
return iter.includes(value);
}) && set.remove(value);
});
});
}, Set.prototype.merge = function() {
return this.union.apply(this, arguments);
}, Set.prototype.mergeWith = function(merger) {
var iters = SLICE$0.call(arguments, 1);
return this.union.apply(this, iters);
}, Set.prototype.sort = function(comparator) {
// Late binding
return OrderedSet(sortFactory(this, comparator));
}, Set.prototype.sortBy = function(mapper, comparator) {
// Late binding
return OrderedSet(sortFactory(this, comparator, mapper));
}, Set.prototype.wasAltered = function() {
return this._map.wasAltered();
}, Set.prototype.__iterate = function(fn, reverse) {
var this$0 = this;
return this._map.__iterate(function(_, k) {
return fn(k, k, this$0);
}, reverse);
}, Set.prototype.__iterator = function(type, reverse) {
return this._map.map(function(_, k) {
return k;
}).__iterator(type, reverse);
}, Set.prototype.__ensureOwner = function(ownerID) {
if (ownerID === this.__ownerID) return this;
var newMap = this._map.__ensureOwner(ownerID);
return ownerID ? this.__make(newMap, ownerID) : (this.__ownerID = ownerID, this._map = newMap,
this);
}, Set.isSet = isSet;
var IS_SET_SENTINEL = "@@__IMMUTABLE_SET__@@", SetPrototype = Set.prototype;
SetPrototype[IS_SET_SENTINEL] = !0, SetPrototype[DELETE] = SetPrototype.remove,
SetPrototype.mergeDeep = SetPrototype.merge, SetPrototype.mergeDeepWith = SetPrototype.mergeWith,
SetPrototype.withMutations = MapPrototype.withMutations, SetPrototype.asMutable = MapPrototype.asMutable,
SetPrototype.asImmutable = MapPrototype.asImmutable, SetPrototype.__empty = emptySet,
SetPrototype.__make = makeSet;
var EMPTY_SET;
createClass(OrderedSet, Set), OrderedSet.of = function() {
return this(arguments);
}, OrderedSet.fromKeys = function(value) {
return this(KeyedIterable(value).keySeq());
}, OrderedSet.prototype.toString = function() {
return this.__toString("OrderedSet {", "}");
}, OrderedSet.isOrderedSet = isOrderedSet;
var OrderedSetPrototype = OrderedSet.prototype;
OrderedSetPrototype[IS_ORDERED_SENTINEL] = !0, OrderedSetPrototype.__empty = emptyOrderedSet,
OrderedSetPrototype.__make = makeOrderedSet;
var EMPTY_ORDERED_SET;
createClass(Stack, IndexedCollection), Stack.of = function() {
return this(arguments);
}, Stack.prototype.toString = function() {
return this.__toString("Stack [", "]");
}, // @pragma Access
Stack.prototype.get = function(index, notSetValue) {
var head = this._head;
for (index = wrapIndex(this, index); head && index--; ) head = head.next;
return head ? head.value : notSetValue;
}, Stack.prototype.peek = function() {
return this._head && this._head.value;
}, // @pragma Modification
Stack.prototype.push = function() {
if (0 === arguments.length) return this;
for (var newSize = this.size + arguments.length, head = this._head, ii = arguments.length - 1; ii >= 0; ii--) head = {
value: arguments[ii],
next: head
};
return this.__ownerID ? (this.size = newSize, this._head = head, this.__hash = void 0,
this.__altered = !0, this) : makeStack(newSize, head);
}, Stack.prototype.pushAll = function(iter) {
if (iter = IndexedIterable(iter), 0 === iter.size) return this;
assertNotInfinite(iter.size);
var newSize = this.size, head = this._head;
return iter.reverse().forEach(function(value) {
newSize++, head = {
value: value,
next: head
};
}), this.__ownerID ? (this.size = newSize, this._head = head, this.__hash = void 0,
this.__altered = !0, this) : makeStack(newSize, head);
}, Stack.prototype.pop = function() {
return this.slice(1);
}, Stack.prototype.unshift = function() {
return this.push.apply(this, arguments);
}, Stack.prototype.unshiftAll = function(iter) {
return this.pushAll(iter);
}, Stack.prototype.shift = function() {
return this.pop.apply(this, arguments);
}, Stack.prototype.clear = function() {
return 0 === this.size ? this : this.__ownerID ? (this.size = 0, this._head = void 0,
this.__hash = void 0, this.__altered = !0, this) : emptyStack();
}, Stack.prototype.slice = function(begin, end) {
if (wholeSlice(begin, end, this.size)) return this;
var resolvedBegin = resolveBegin(begin, this.size), resolvedEnd = resolveEnd(end, this.size);
if (resolvedEnd !== this.size) // super.slice(begin, end);
return IndexedCollection.prototype.slice.call(this, begin, end);
for (var newSize = this.size - resolvedBegin, head = this._head; resolvedBegin--; ) head = head.next;
return this.__ownerID ? (this.size = newSize, this._head = head, this.__hash = void 0,
this.__altered = !0, this) : makeStack(newSize, head);
}, // @pragma Mutability
Stack.prototype.__ensureOwner = function(ownerID) {
return ownerID === this.__ownerID ? this : ownerID ? makeStack(this.size, this._head, ownerID, this.__hash) : (this.__ownerID = ownerID,
this.__altered = !1, this);
}, // @pragma Iteration
Stack.prototype.__iterate = function(fn, reverse) {
if (reverse) return this.reverse().__iterate(fn);
for (var iterations = 0, node = this._head; node && fn(node.value, iterations++, this) !== !1; ) node = node.next;
return iterations;
}, Stack.prototype.__iterator = function(type, reverse) {
if (reverse) return this.reverse().__iterator(type);
var iterations = 0, node = this._head;
return new Iterator(function() {
if (node) {
var value = node.value;
return node = node.next, iteratorValue(type, iterations++, value);
}
return iteratorDone();
});
}, Stack.isStack = isStack;
var IS_STACK_SENTINEL = "@@__IMMUTABLE_STACK__@@", StackPrototype = Stack.prototype;
StackPrototype[IS_STACK_SENTINEL] = !0, StackPrototype.withMutations = MapPrototype.withMutations,
StackPrototype.asMutable = MapPrototype.asMutable, StackPrototype.asImmutable = MapPrototype.asImmutable,
StackPrototype.wasAltered = MapPrototype.wasAltered;
var EMPTY_STACK;
Iterable.Iterator = Iterator, mixin(Iterable, {
// ### Conversion to other types
toArray: function() {
assertNotInfinite(this.size);
var array = new Array(this.size || 0);
return this.valueSeq().__iterate(function(v, i) {
array[i] = v;
}), array;
},
toIndexedSeq: function() {
return new ToIndexedSequence(this);
},
toJS: function() {
return this.toSeq().map(function(value) {
return value && "function" == typeof value.toJS ? value.toJS() : value;
}).__toJS();
},
toJSON: function() {
return this.toSeq().map(function(value) {
return value && "function" == typeof value.toJSON ? value.toJSON() : value;
}).__toJS();
},
toKeyedSeq: function() {
return new ToKeyedSequence(this, !0);
},
toMap: function() {
// Use Late Binding here to solve the circular dependency.
return Map(this.toKeyedSeq());
},
toObject: function() {
assertNotInfinite(this.size);
var object = {};
return this.__iterate(function(v, k) {
object[k] = v;
}), object;
},
toOrderedMap: function() {
// Use Late Binding here to solve the circular dependency.
return OrderedMap(this.toKeyedSeq());
},
toOrderedSet: function() {
// Use Late Binding here to solve the circular dependency.
return OrderedSet(isKeyed(this) ? this.valueSeq() : this);
},
toSet: function() {
// Use Late Binding here to solve the circular dependency.
return Set(isKeyed(this) ? this.valueSeq() : this);
},
toSetSeq: function() {
return new ToSetSequence(this);
},
toSeq: function() {
return isIndexed(this) ? this.toIndexedSeq() : isKeyed(this) ? this.toKeyedSeq() : this.toSetSeq();
},
toStack: function() {
// Use Late Binding here to solve the circular dependency.
return Stack(isKeyed(this) ? this.valueSeq() : this);
},
toList: function() {
// Use Late Binding here to solve the circular dependency.
return List(isKeyed(this) ? this.valueSeq() : this);
},
// ### Common JavaScript methods and properties
toString: function() {
return "[Iterable]";
},
__toString: function(head, tail) {
return 0 === this.size ? head + tail : head + " " + this.toSeq().map(this.__toStringMapper).join(", ") + " " + tail;
},
// ### ES6 Collection methods (ES6 Array and Map)
concat: function() {
var values = SLICE$0.call(arguments, 0);
return reify(this, concatFactory(this, values));
},
includes: function(searchValue) {
return this.some(function(value) {
return is(value, searchValue);
});
},
entries: function() {
return this.__iterator(ITERATE_ENTRIES);
},
every: function(predicate, context) {
assertNotInfinite(this.size);
var returnValue = !0;
return this.__iterate(function(v, k, c) {
if (!predicate.call(context, v, k, c)) return returnValue = !1, !1;
}), returnValue;
},
filter: function(predicate, context) {
return reify(this, filterFactory(this, predicate, context, !0));
},
find: function(predicate, context, notSetValue) {
var entry = this.findEntry(predicate, context);
return entry ? entry[1] : notSetValue;
},
forEach: function(sideEffect, context) {
return assertNotInfinite(this.size), this.__iterate(context ? sideEffect.bind(context) : sideEffect);
},
join: function(separator) {
assertNotInfinite(this.size), separator = void 0 !== separator ? "" + separator : ",";
var joined = "", isFirst = !0;
return this.__iterate(function(v) {
isFirst ? isFirst = !1 : joined += separator, joined += null !== v && void 0 !== v ? v.toString() : "";
}), joined;
},
keys: function() {
return this.__iterator(ITERATE_KEYS);
},
map: function(mapper, context) {
return reify(this, mapFactory(this, mapper, context));
},
reduce: function(reducer, initialReduction, context) {
assertNotInfinite(this.size);
var reduction, useFirst;
return arguments.length < 2 ? useFirst = !0 : reduction = initialReduction, this.__iterate(function(v, k, c) {
useFirst ? (useFirst = !1, reduction = v) : reduction = reducer.call(context, reduction, v, k, c);
}), reduction;
},
reduceRight: function(reducer, initialReduction, context) {
var reversed = this.toKeyedSeq().reverse();
return reversed.reduce.apply(reversed, arguments);
},
reverse: function() {
return reify(this, reverseFactory(this, !0));
},
slice: function(begin, end) {
return reify(this, sliceFactory(this, begin, end, !0));
},
some: function(predicate, context) {
return !this.every(not(predicate), context);
},
sort: function(comparator) {
return reify(this, sortFactory(this, comparator));
},
values: function() {
return this.__iterator(ITERATE_VALUES);
},
// ### More sequential methods
butLast: function() {
return this.slice(0, -1);
},
isEmpty: function() {
return void 0 !== this.size ? 0 === this.size : !this.some(function() {
return !0;
});
},
count: function(predicate, context) {
return ensureSize(predicate ? this.toSeq().filter(predicate, context) : this);
},
countBy: function(grouper, context) {
return countByFactory(this, grouper, context);
},
equals: function(other) {
return deepEqual(this, other);
},
entrySeq: function() {
var iterable = this;
if (iterable._cache) // We cache as an entries array, so we can just return the cache!
return new ArraySeq(iterable._cache);
var entriesSequence = iterable.toSeq().map(entryMapper).toIndexedSeq();
return entriesSequence.fromEntrySeq = function() {
return iterable.toSeq();
}, entriesSequence;
},
filterNot: function(predicate, context) {
return this.filter(not(predicate), context);
},
findEntry: function(predicate, context, notSetValue) {
var found = notSetValue;
return this.__iterate(function(v, k, c) {
if (predicate.call(context, v, k, c)) return found = [ k, v ], !1;
}), found;
},
findKey: function(predicate, context) {
var entry = this.findEntry(predicate, context);
return entry && entry[0];
},
findLast: function(predicate, context, notSetValue) {
return this.toKeyedSeq().reverse().find(predicate, context, notSetValue);
},
findLastEntry: function(predicate, context, notSetValue) {
return this.toKeyedSeq().reverse().findEntry(predicate, context, notSetValue);
},
findLastKey: function(predicate, context) {
return this.toKeyedSeq().reverse().findKey(predicate, context);
},
first: function() {
return this.find(returnTrue);
},
flatMap: function(mapper, context) {
return reify(this, flatMapFactory(this, mapper, context));
},
flatten: function(depth) {
return reify(this, flattenFactory(this, depth, !0));
},
fromEntrySeq: function() {
return new FromEntriesSequence(this);
},
get: function(searchKey, notSetValue) {
return this.find(function(_, key) {
return is(key, searchKey);
}, void 0, notSetValue);
},
getIn: function(searchKeyPath, notSetValue) {
for (var step, nested = this, iter = forceIterator(searchKeyPath); !(step = iter.next()).done; ) {
var key = step.value;
if (nested = nested && nested.get ? nested.get(key, NOT_SET) : NOT_SET, nested === NOT_SET) return notSetValue;
}
return nested;
},
groupBy: function(grouper, context) {
return groupByFactory(this, grouper, context);
},
has: function(searchKey) {
return this.get(searchKey, NOT_SET) !== NOT_SET;
},
hasIn: function(searchKeyPath) {
return this.getIn(searchKeyPath, NOT_SET) !== NOT_SET;
},
isSubset: function(iter) {
return iter = "function" == typeof iter.includes ? iter : Iterable(iter), this.every(function(value) {
return iter.includes(value);
});
},
isSuperset: function(iter) {
return iter = "function" == typeof iter.isSubset ? iter : Iterable(iter), iter.isSubset(this);
},
keyOf: function(searchValue) {
return this.findKey(function(value) {
return is(value, searchValue);
});
},
keySeq: function() {
return this.toSeq().map(keyMapper).toIndexedSeq();
},
last: function() {
return this.toSeq().reverse().first();
},
lastKeyOf: function(searchValue) {
return this.toKeyedSeq().reverse().keyOf(searchValue);
},
max: function(comparator) {
return maxFactory(this, comparator);
},
maxBy: function(mapper, comparator) {
return maxFactory(this, comparator, mapper);
},
min: function(comparator) {
return maxFactory(this, comparator ? neg(comparator) : defaultNegComparator);
},
minBy: function(mapper, comparator) {
return maxFactory(this, comparator ? neg(comparator) : defaultNegComparator, mapper);
},
rest: function() {
return this.slice(1);
},
skip: function(amount) {
return this.slice(Math.max(0, amount));
},
skipLast: function(amount) {
return reify(this, this.toSeq().reverse().skip(amount).reverse());
},
skipWhile: function(predicate, context) {
return reify(this, skipWhileFactory(this, predicate, context, !0));
},
skipUntil: function(predicate, context) {
return this.skipWhile(not(predicate), context);
},
sortBy: function(mapper, comparator) {
return reify(this, sortFactory(this, comparator, mapper));
},
take: function(amount) {
return this.slice(0, Math.max(0, amount));
},
takeLast: function(amount) {
return reify(this, this.toSeq().reverse().take(amount).reverse());
},
takeWhile: function(predicate, context) {
return reify(this, takeWhileFactory(this, predicate, context));
},
takeUntil: function(predicate, context) {
return this.takeWhile(not(predicate), context);
},
valueSeq: function() {
return this.toIndexedSeq();
},
// ### Hashable Object
hashCode: function() {
return this.__hash || (this.__hash = hashIterable(this));
}
});
// var IS_ITERABLE_SENTINEL = '@@__IMMUTABLE_ITERABLE__@@';
// var IS_KEYED_SENTINEL = '@@__IMMUTABLE_KEYED__@@';
// var IS_INDEXED_SENTINEL = '@@__IMMUTABLE_INDEXED__@@';
// var IS_ORDERED_SENTINEL = '@@__IMMUTABLE_ORDERED__@@';
var IterablePrototype = Iterable.prototype;
IterablePrototype[IS_ITERABLE_SENTINEL] = !0, IterablePrototype[ITERATOR_SYMBOL] = IterablePrototype.values,
IterablePrototype.__toJS = IterablePrototype.toArray, IterablePrototype.__toStringMapper = quoteString,
IterablePrototype.inspect = IterablePrototype.toSource = function() {
return this.toString();
}, IterablePrototype.chain = IterablePrototype.flatMap, IterablePrototype.contains = IterablePrototype.includes,
mixin(KeyedIterable, {
// ### More sequential methods
flip: function() {
return reify(this, flipFactory(this));
},
mapEntries: function(mapper, context) {
var this$0 = this, iterations = 0;
return reify(this, this.toSeq().map(function(v, k) {
return mapper.call(context, [ k, v ], iterations++, this$0);
}).fromEntrySeq());
},
mapKeys: function(mapper, context) {
var this$0 = this;
return reify(this, this.toSeq().flip().map(function(k, v) {
return mapper.call(context, k, v, this$0);
}).flip());
}
});
var KeyedIterablePrototype = KeyedIterable.prototype;
KeyedIterablePrototype[IS_KEYED_SENTINEL] = !0, KeyedIterablePrototype[ITERATOR_SYMBOL] = IterablePrototype.entries,
KeyedIterablePrototype.__toJS = IterablePrototype.toObject, KeyedIterablePrototype.__toStringMapper = function(v, k) {
return JSON.stringify(k) + ": " + quoteString(v);
}, mixin(IndexedIterable, {
// ### Conversion to other types
toKeyedSeq: function() {
return new ToKeyedSequence(this, !1);
},
// ### ES6 Collection methods (ES6 Array and Map)
filter: function(predicate, context) {
return reify(this, filterFactory(this, predicate, context, !1));
},
findIndex: function(predicate, context) {
var entry = this.findEntry(predicate, context);
return entry ? entry[0] : -1;
},
indexOf: function(searchValue) {
var key = this.keyOf(searchValue);
return void 0 === key ? -1 : key;
},
lastIndexOf: function(searchValue) {
var key = this.lastKeyOf(searchValue);
return void 0 === key ? -1 : key;
},
reverse: function() {
return reify(this, reverseFactory(this, !1));
},
slice: function(begin, end) {
return reify(this, sliceFactory(this, begin, end, !1));
},
splice: function(index, removeNum) {
var numArgs = arguments.length;
if (removeNum = Math.max(0 | removeNum, 0), 0 === numArgs || 2 === numArgs && !removeNum) return this;
// If index is negative, it should resolve relative to the size of the
// collection. However size may be expensive to compute if not cached, so
// only call count() if the number is in fact negative.
index = resolveBegin(index, index < 0 ? this.count() : this.size);
var spliced = this.slice(0, index);
return reify(this, 1 === numArgs ? spliced : spliced.concat(arrCopy(arguments, 2), this.slice(index + removeNum)));
},
// ### More collection methods
findLastIndex: function(predicate, context) {
var entry = this.findLastEntry(predicate, context);
return entry ? entry[0] : -1;
},
first: function() {
return this.get(0);
},
flatten: function(depth) {
return reify(this, flattenFactory(this, depth, !1));
},
get: function(index, notSetValue) {
return index = wrapIndex(this, index), index < 0 || this.size === 1 / 0 || void 0 !== this.size && index > this.size ? notSetValue : this.find(function(_, key) {
return key === index;
}, void 0, notSetValue);
},
has: function(index) {
return index = wrapIndex(this, index), index >= 0 && (void 0 !== this.size ? this.size === 1 / 0 || index < this.size : this.indexOf(index) !== -1);
},
interpose: function(separator) {
return reify(this, interposeFactory(this, separator));
},
interleave: function() {
var iterables = [ this ].concat(arrCopy(arguments)), zipped = zipWithFactory(this.toSeq(), IndexedSeq.of, iterables), interleaved = zipped.flatten(!0);
return zipped.size && (interleaved.size = zipped.size * iterables.length), reify(this, interleaved);
},
keySeq: function() {
return Range(0, this.size);
},
last: function() {
return this.get(-1);
},
skipWhile: function(predicate, context) {
return reify(this, skipWhileFactory(this, predicate, context, !1));
},
zip: function() {
var iterables = [ this ].concat(arrCopy(arguments));
return reify(this, zipWithFactory(this, defaultZipper, iterables));
},
zipWith: function(zipper) {
var iterables = arrCopy(arguments);
return iterables[0] = this, reify(this, zipWithFactory(this, zipper, iterables));
}
}), IndexedIterable.prototype[IS_INDEXED_SENTINEL] = !0, IndexedIterable.prototype[IS_ORDERED_SENTINEL] = !0,
mixin(SetIterable, {
// ### ES6 Collection methods (ES6 Array and Map)
get: function(value, notSetValue) {
return this.has(value) ? value : notSetValue;
},
includes: function(value) {
return this.has(value);
},
// ### More sequential methods
keySeq: function() {
return this.valueSeq();
}
}), SetIterable.prototype.has = IterablePrototype.includes, SetIterable.prototype.contains = SetIterable.prototype.includes,
// Mixin subclasses
mixin(KeyedSeq, KeyedIterable.prototype), mixin(IndexedSeq, IndexedIterable.prototype),
mixin(SetSeq, SetIterable.prototype), mixin(KeyedCollection, KeyedIterable.prototype),
mixin(IndexedCollection, IndexedIterable.prototype), mixin(SetCollection, SetIterable.prototype);
var Immutable = {
Iterable: Iterable,
Seq: Seq,
Collection: Collection,
Map: Map,
OrderedMap: OrderedMap,
List: List,
Stack: Stack,
Set: Set,
OrderedSet: OrderedSet,
Record: Record,
Range: Range,
Repeat: Repeat,
is: is,
fromJS: fromJS
};
return Immutable;
});
}, /* 151 */
/***/
function(module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: !0
}), /**
* Returns an array of all `ContentBlock` instances within two block keys
*
* @param {object} contentState A draft.js `ContentState` instance
* @param {string} anchorKey The block key to start searching from
* @param {string} focusKey The block key until which to search
*
* @return {array} An array containing the found content blocks
*/
exports.default = function(contentState, anchorKey, focusKey) {
var isSameBlock = anchorKey === focusKey, startingBlock = contentState.getBlockForKey(anchorKey);
if (!startingBlock) return [];
var selectedBlocks = [ startingBlock ];
if (!isSameBlock) for (var blockKey = anchorKey; blockKey !== focusKey; ) {
var nextBlock = contentState.getBlockAfter(blockKey);
if (!nextBlock) {
selectedBlocks = [];
break;
}
selectedBlocks.push(nextBlock), blockKey = nextBlock.getKey();
}
return selectedBlocks;
};
}, /* 152 */
/***/
function(module, exports, __webpack_require__) {
"use strict";
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
Object.defineProperty(exports, "__esModule", {
value: !0
});
var _getSelectedBlocks = __webpack_require__(151), _getSelectedBlocks2 = _interopRequireDefault(_getSelectedBlocks);
exports.default = function(strategy) {
return function(editorState, selection) {
var contentState = editorState.getCurrentContent(), currentSelection = selection || editorState.getSelection(), startKey = currentSelection.getStartKey(), endKey = currentSelection.getEndKey(), startOffset = currentSelection.getStartOffset(), endOffset = currentSelection.getEndOffset(), isSameBlock = startKey === endKey, selectedBlocks = (0,
_getSelectedBlocks2.default)(contentState, startKey, endKey), entityFound = !1, finalStartOffset = startOffset + 1, finalEndOffset = endOffset - 1;
return selectedBlocks.forEach(function(block) {
strategy(block, function(start, end) {
if (!entityFound) {
var blockKey = block.getKey();
isSameBlock && (end < finalStartOffset || start > finalEndOffset) || blockKey === startKey && end < finalStartOffset || blockKey === endKey && start > finalEndOffset || (entityFound = !0);
}
});
}), entityFound;
};
};
}, /* 153 */
/***/
function(module, exports, __webpack_require__) {
"use strict";
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
Object.defineProperty(exports, "__esModule", {
value: !0
});
var _draftJs = __webpack_require__(2), _getSelectedBlocks = __webpack_require__(151), _getSelectedBlocks2 = _interopRequireDefault(_getSelectedBlocks);
/**
* Calls a provided `modifier` function with a selection for each
* selected block in the current editor selection. Passes through additional
* arguments to the modifier.
*
* Note: At the moment it will retain the original selection and override
* possible selection changes from modifiers
*
* @param {object} editorState The current draft.js editor state object
*
* @param {function} modifier A modifier function to be executed.
* Must have the signature (editorState, selection, ...)
*
* @param {mixed} ...args Additional arguments to be passed through to the modifier
*
* @return {object} The new editor state
*/
exports.default = function(editorState, modifier) {
for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) args[_key - 2] = arguments[_key];
var contentState = editorState.getCurrentContent(), currentSelection = editorState.getSelection(), startKey = currentSelection.getStartKey(), endKey = currentSelection.getEndKey(), startOffset = currentSelection.getStartOffset(), endOffset = currentSelection.getEndOffset(), isSameBlock = startKey === endKey, selectedBlocks = (0,
_getSelectedBlocks2.default)(contentState, startKey, endKey), finalEditorState = editorState;
return selectedBlocks.forEach(function(block) {
var currentBlockKey = block.getKey(), selectionStart = startOffset, selectionEnd = endOffset;
currentBlockKey === startKey ? (selectionStart = startOffset, selectionEnd = isSameBlock ? endOffset : block.getText().length) : currentBlockKey === endKey ? (selectionStart = isSameBlock ? startOffset : 0,
selectionEnd = endOffset) : (selectionStart = 0, selectionEnd = block.getText().length);
var selection = new _draftJs.SelectionState({
anchorKey: currentBlockKey,
anchorOffset: selectionStart,
focusKey: currentBlockKey,
focusOffset: selectionEnd
});
finalEditorState = modifier.apply(void 0, [ finalEditorState, selection ].concat(args));
}), _draftJs.EditorState.forceSelection(finalEditorState, currentSelection);
};
}, /* 154 */
/***/
function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule isSoftNewlineEvent
* @typechecks
*
*/
"use strict";
function isSoftNewlineEvent(e) {
return e.which === Keys.RETURN && (e.getModifierState("Shift") || e.getModifierState("Alt") || e.getModifierState("Control"));
}
var Keys = __webpack_require__(46);
module.exports = isSoftNewlineEvent;
}, /* 155 */
/***/
function(module, exports, __webpack_require__) {
"use strict";
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 || "object" != typeof call && "function" != typeof call ? self : call;
}
function _inherits(subClass, superClass) {
if ("function" != typeof superClass && null !== superClass) 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: !1,
writable: !0,
configurable: !0
}
}), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass);
}
Object.defineProperty(exports, "__esModule", {
value: !0
});
var _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0,
"value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps),
Constructor;
};
}(), _KeyBindingUtil = __webpack_require__(100), _react = __webpack_require__(1), _react2 = _interopRequireDefault(_react), _reactDom = __webpack_require__(53), _reactDom2 = _interopRequireDefault(_reactDom), _draftJs = __webpack_require__(2), _draftJsUtils = __webpack_require__(147), _EditorToolbarConfig = __webpack_require__(156), _EditorToolbarConfig2 = _interopRequireDefault(_EditorToolbarConfig), _StyleButton = __webpack_require__(157), _StyleButton2 = _interopRequireDefault(_StyleButton), _PopoverIconButton = __webpack_require__(171), _PopoverIconButton2 = _interopRequireDefault(_PopoverIconButton), _ButtonGroup = __webpack_require__(173), _ButtonGroup2 = _interopRequireDefault(_ButtonGroup), _Dropdown = __webpack_require__(178), _Dropdown2 = _interopRequireDefault(_Dropdown), _IconButton = __webpack_require__(158), _IconButton2 = _interopRequireDefault(_IconButton), _getEntityAtCursor2 = __webpack_require__(181), _getEntityAtCursor3 = _interopRequireDefault(_getEntityAtCursor2), _clearEntityForRange = __webpack_require__(182), _clearEntityForRange2 = _interopRequireDefault(_clearEntityForRange), _classAutobind = __webpack_require__(161), _classAutobind2 = _interopRequireDefault(_classAutobind), _classnames = __webpack_require__(159), _classnames2 = _interopRequireDefault(_classnames), _EditorToolbar = __webpack_require__(183), _EditorToolbar2 = _interopRequireDefault(_EditorToolbar), EditorToolbar = function(_Component) {
function EditorToolbar() {
_classCallCheck(this, EditorToolbar);
var _this = _possibleConstructorReturn(this, (EditorToolbar.__proto__ || Object.getPrototypeOf(EditorToolbar)).apply(this, arguments));
return (0, _classAutobind2.default)(_this), _this.state = {
showLinkInput: !1
}, _this;
}
return _inherits(EditorToolbar, _Component), _createClass(EditorToolbar, [ {
key: "componentWillMount",
value: function() {
// Technically, we should also attach/detach event listeners when the
// `keyEmitter` prop changes.
this.props.keyEmitter.on("keypress", this._onKeypress);
}
}, {
key: "componentWillUnmount",
value: function() {
this.props.keyEmitter.removeListener("keypress", this._onKeypress);
}
}, {
key: "render",
value: function() {
var _this2 = this, _props = this.props, className = _props.className, toolbarConfig = _props.toolbarConfig;
null == toolbarConfig && (toolbarConfig = _EditorToolbarConfig2.default);
var display = toolbarConfig.display || _EditorToolbarConfig2.default.display, buttonsGroups = display.map(function(groupName) {
switch (groupName) {
case "INLINE_STYLE_BUTTONS":
return _this2._renderInlineStyleButtons(groupName, toolbarConfig);
case "BLOCK_TYPE_DROPDOWN":
return _this2._renderBlockTypeDropdown(groupName, toolbarConfig);
case "LINK_BUTTONS":
return _this2._renderLinkButtons(groupName, toolbarConfig);
case "BLOCK_TYPE_BUTTONS":
return _this2._renderBlockTypeButtons(groupName, toolbarConfig);
case "HISTORY_BUTTONS":
return _this2._renderUndoRedo(groupName, toolbarConfig);
}
});
return _react2.default.createElement("div", {
className: (0, _classnames2.default)(_EditorToolbar2.default.root, className)
}, buttonsGroups);
}
}, {
key: "_renderBlockTypeDropdown",
value: function(name, toolbarConfig) {
var blockType = this._getCurrentBlockType(), choices = new Map((toolbarConfig.BLOCK_TYPE_DROPDOWN || []).map(function(type) {
return [ type.style, {
label: type.label,
className: type.className
} ];
}));
return choices.has(blockType) || (blockType = Array.from(choices.keys())[0]), _react2.default.createElement(_ButtonGroup2.default, {
key: name
}, _react2.default.createElement(_Dropdown2.default, {
choices: choices,
selectedKey: blockType,
onChange: this._selectBlockType
}));
}
}, {
key: "_renderBlockTypeButtons",
value: function(name, toolbarConfig) {
var _this3 = this, blockType = this._getCurrentBlockType(), buttons = (toolbarConfig.BLOCK_TYPE_BUTTONS || []).map(function(type, index) {
return _react2.default.createElement(_StyleButton2.default, {
key: String(index),
isActive: type.style === blockType,
label: type.label,
onToggle: _this3._toggleBlockType,
style: type.style,
className: type.className
});
});
return _react2.default.createElement(_ButtonGroup2.default, {
key: name
}, buttons);
}
}, {
key: "_renderInlineStyleButtons",
value: function(name, toolbarConfig) {
var _this4 = this, editorState = this.props.editorState, currentStyle = editorState.getCurrentInlineStyle(), buttons = (toolbarConfig.INLINE_STYLE_BUTTONS || []).map(function(type, index) {
return _react2.default.createElement(_StyleButton2.default, {
key: String(index),
isActive: currentStyle.has(type.style),
label: type.label,
onToggle: _this4._toggleInlineStyle,
style: type.style,
className: type.className
});
});
return _react2.default.createElement(_ButtonGroup2.default, {
key: name
}, buttons);
}
}, {
key: "_renderLinkButtons",
value: function(name) {
var editorState = this.props.editorState, selection = editorState.getSelection(), entity = this._getEntityAtCursor(), hasSelection = !selection.isCollapsed(), isCursorOnLink = null != entity && entity.type === _draftJsUtils.ENTITY_TYPE.LINK, shouldShowLinkButton = hasSelection || isCursorOnLink;
return _react2.default.createElement(_ButtonGroup2.default, {
key: name
}, _react2.default.createElement(_PopoverIconButton2.default, {
label: "Link",
iconName: "link",
isDisabled: !shouldShowLinkButton,
showPopover: this.state.showLinkInput,
onTogglePopover: this._toggleShowLinkInput,
onSubmit: this._setLink
}), _react2.default.createElement(_IconButton2.default, {
label: "Remove Link",
iconName: "remove-link",
isDisabled: !isCursorOnLink,
onClick: this._removeLink,
focusOnClick: !1
}));
}
}, {
key: "_renderUndoRedo",
value: function(name) {
var editorState = this.props.editorState, canUndo = 0 !== editorState.getUndoStack().size, canRedo = 0 !== editorState.getRedoStack().size;
return _react2.default.createElement(_ButtonGroup2.default, {
key: name
}, _react2.default.createElement(_IconButton2.default, {
label: "Undo",
iconName: "undo",
isDisabled: !canUndo,
onClick: this._undo,
focusOnClick: !1
}), _react2.default.createElement(_IconButton2.default, {
label: "Redo",
iconName: "redo",
isDisabled: !canRedo,
onClick: this._redo,
focusOnClick: !1
}));
}
}, {
key: "_onKeypress",
value: function(event, eventFlags) {
// Catch cmd+k for use with link insertion.
(0, _KeyBindingUtil.hasCommandModifier)(event) && 75 === event.keyCode && (// TODO: Ensure there is some text selected.
this.setState({
showLinkInput: !0
}), eventFlags.wasHandled = !0);
}
}, {
key: "_toggleShowLinkInput",
value: function(event) {
var isShowing = this.state.showLinkInput;
// If this is a hide request, decide if we should focus the editor.
if (isShowing) {
var shouldFocusEditor = !0;
if (event && "click" === event.type) {
// TODO: Use a better way to get the editor root node.
var editorRoot = _reactDom2.default.findDOMNode(this).parentNode, _document = document, activeElement = _document.activeElement, wasClickAway = null == activeElement || activeElement === document.body;
wasClickAway || editorRoot.contains(activeElement) || (shouldFocusEditor = !1);
}
shouldFocusEditor && this.props.focusEditor();
}
this.setState({
showLinkInput: !isShowing
});
}
}, {
key: "_setLink",
value: function(url) {
var editorState = this.props.editorState, selection = editorState.getSelection(), entityKey = _draftJs.Entity.create(_draftJsUtils.ENTITY_TYPE.LINK, "MUTABLE", {
url: url
});
this.setState({
showLinkInput: !1
}), this.props.onChange(_draftJs.RichUtils.toggleLink(editorState, selection, entityKey)),
this._focusEditor();
}
}, {
key: "_removeLink",
value: function() {
var editorState = this.props.editorState, entity = (0, _getEntityAtCursor3.default)(editorState);
if (null != entity) {
var blockKey = entity.blockKey, startOffset = entity.startOffset, endOffset = entity.endOffset;
this.props.onChange((0, _clearEntityForRange2.default)(editorState, blockKey, startOffset, endOffset));
}
}
}, {
key: "_getEntityAtCursor",
value: function() {
var editorState = this.props.editorState, entity = (0, _getEntityAtCursor3.default)(editorState);
return null == entity ? null : _draftJs.Entity.get(entity.entityKey);
}
}, {
key: "_getCurrentBlockType",
value: function() {
var editorState = this.props.editorState, selection = editorState.getSelection();
return editorState.getCurrentContent().getBlockForKey(selection.getStartKey()).getType();
}
}, {
key: "_selectBlockType",
value: function() {
this._toggleBlockType.apply(this, arguments), this._focusEditor();
}
}, {
key: "_toggleBlockType",
value: function(blockType) {
this.props.onChange(_draftJs.RichUtils.toggleBlockType(this.props.editorState, blockType));
}
}, {
key: "_toggleInlineStyle",
value: function(inlineStyle) {
this.props.onChange(_draftJs.RichUtils.toggleInlineStyle(this.props.editorState, inlineStyle));
}
}, {
key: "_undo",
value: function() {
var editorState = this.props.editorState;
this.props.onChange(_draftJs.EditorState.undo(editorState));
}
}, {
key: "_redo",
value: function() {
var editorState = this.props.editorState;
this.props.onChange(_draftJs.EditorState.redo(editorState));
}
}, {
key: "_focusEditor",
value: function() {
var _this5 = this;
// Hacky: Wait to focus the editor so we don't lose selection.
setTimeout(function() {
_this5.props.focusEditor();
}, 50);
}
} ]), EditorToolbar;
}(_react.Component);
exports.default = EditorToolbar;
}, /* 156 */
/***/
function(module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: !0
});
var INLINE_STYLE_BUTTONS = exports.INLINE_STYLE_BUTTONS = [ {
label: "Bold",
style: "BOLD"
}, {
label: "Italic",
style: "ITALIC"
}, {
label: "Strikethrough",
style: "STRIKETHROUGH"
}, {
label: "Monospace",
style: "CODE"
}, {
label: "Underline",
style: "UNDERLINE"
} ], BLOCK_TYPE_DROPDOWN = exports.BLOCK_TYPE_DROPDOWN = [ {
label: "Normal",
style: "unstyled"
}, {
label: "Heading Large",
style: "header-one"
}, {
label: "Heading Medium",
style: "header-two"
}, {
label: "Heading Small",
style: "header-three"
}, {
label: "Code Block",
style: "code-block"
} ], BLOCK_TYPE_BUTTONS = exports.BLOCK_TYPE_BUTTONS = [ {
label: "UL",
style: "unordered-list-item"
}, {
label: "OL",
style: "ordered-list-item"
}, {
label: "Blockquote",
style: "blockquote"
} ], EditorToolbarConfig = {
display: [ "INLINE_STYLE_BUTTONS", "BLOCK_TYPE_BUTTONS", "LINK_BUTTONS", "BLOCK_TYPE_DROPDOWN", "HISTORY_BUTTONS" ],
INLINE_STYLE_BUTTONS: INLINE_STYLE_BUTTONS,
BLOCK_TYPE_DROPDOWN: BLOCK_TYPE_DROPDOWN,
BLOCK_TYPE_BUTTONS: BLOCK_TYPE_BUTTONS
};
exports.default = EditorToolbarConfig;
}, /* 157 */
/***/
function(module, exports, __webpack_require__) {
"use strict";
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function _objectWithoutProperties(obj, keys) {
var target = {};
for (var i in obj) keys.indexOf(i) >= 0 || Object.prototype.hasOwnProperty.call(obj, i) && (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 || "object" != typeof call && "function" != typeof call ? self : call;
}
function _inherits(subClass, superClass) {
if ("function" != typeof superClass && null !== superClass) 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: !1,
writable: !0,
configurable: !0
}
}), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass);
}
Object.defineProperty(exports, "__esModule", {
value: !0
});
var _extends = Object.assign || function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]);
}
return target;
}, _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0,
"value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps),
Constructor;
};
}(), _react = __webpack_require__(1), _react2 = _interopRequireDefault(_react), _IconButton = __webpack_require__(158), _IconButton2 = _interopRequireDefault(_IconButton), _classAutobind = __webpack_require__(161), _classAutobind2 = _interopRequireDefault(_classAutobind), StyleButton = function(_Component) {
function StyleButton() {
_classCallCheck(this, StyleButton);
var _this = _possibleConstructorReturn(this, (StyleButton.__proto__ || Object.getPrototypeOf(StyleButton)).apply(this, arguments));
return (0, _classAutobind2.default)(_this), _this;
}
return _inherits(StyleButton, _Component), _createClass(StyleButton, [ {
key: "render",
value: function() {
var _props = this.props, style = _props.style, otherProps = (_props.onToggle, _objectWithoutProperties(_props, [ "style", "onToggle" ])), iconName = style.toLowerCase();
// `focusOnClick` will prevent the editor from losing focus when a control
// button is clicked.
return _react2.default.createElement(_IconButton2.default, _extends({}, otherProps, {
iconName: iconName,
onClick: this._onClick,
focusOnClick: !1
}));
}
}, {
key: "_onClick",
value: function() {
this.props.onToggle(this.props.style);
}
} ]), StyleButton;
}(_react.Component);
exports.default = StyleButton;
}, /* 158 */
/***/
function(module, exports, __webpack_require__) {
"use strict";
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function _defineProperty(obj, key, value) {
return key in obj ? Object.defineProperty(obj, key, {
value: value,
enumerable: !0,
configurable: !0,
writable: !0
}) : obj[key] = value, obj;
}
function _objectWithoutProperties(obj, keys) {
var target = {};
for (var i in obj) keys.indexOf(i) >= 0 || Object.prototype.hasOwnProperty.call(obj, i) && (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 || "object" != typeof call && "function" != typeof call ? self : call;
}
function _inherits(subClass, superClass) {
if ("function" != typeof superClass && null !== superClass) 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: !1,
writable: !0,
configurable: !0
}
}), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass);
}
Object.defineProperty(exports, "__esModule", {
value: !0
});
var _extends = Object.assign || function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]);
}
return target;
}, _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0,
"value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps),
Constructor;
};
}(), _react = __webpack_require__(1), _react2 = _interopRequireDefault(_react), _classnames = __webpack_require__(159), _classnames2 = _interopRequireDefault(_classnames), _Button = __webpack_require__(160), _Button2 = _interopRequireDefault(_Button), _ButtonWrap = __webpack_require__(166), _ButtonWrap2 = _interopRequireDefault(_ButtonWrap), _IconButton = __webpack_require__(169), _IconButton2 = _interopRequireDefault(_IconButton), IconButton = function(_Component) {
function IconButton() {
return _classCallCheck(this, IconButton), _possibleConstructorReturn(this, (IconButton.__proto__ || Object.getPrototypeOf(IconButton)).apply(this, arguments));
}
return _inherits(IconButton, _Component), _createClass(IconButton, [ {
key: "render",
value: function() {
var _cx, props = this.props, className = props.className, iconName = props.iconName, label = props.label, children = props.children, isActive = props.isActive, otherProps = _objectWithoutProperties(props, [ "className", "iconName", "label", "children", "isActive" ]);
return className = (0, _classnames2.default)(className, (_cx = {}, _defineProperty(_cx, _IconButton2.default.root, !0),
_defineProperty(_cx, _IconButton2.default.isActive, isActive), _cx)), _react2.default.createElement(_ButtonWrap2.default, null, _react2.default.createElement(_Button2.default, _extends({}, otherProps, {
title: label,
className: className
}), _react2.default.createElement("span", {
className: _IconButton2.default["icon-" + iconName]
})), children);
}
} ]), IconButton;
}(_react.Component);
exports.default = IconButton;
}, /* 159 */
/***/
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";
function classNames() {
for (var classes = [], i = 0; i < arguments.length; i++) {
var arg = arguments[i];
if (arg) {
var argType = typeof arg;
if ("string" === argType || "number" === argType) classes.push(arg); else if (Array.isArray(arg)) classes.push(classNames.apply(null, arg)); else if ("object" === argType) for (var key in arg) hasOwn.call(arg, key) && arg[key] && classes.push(key);
}
}
return classes.join(" ");
}
var hasOwn = {}.hasOwnProperty;
"undefined" != typeof module && module.exports ? module.exports = classNames : (__WEBPACK_AMD_DEFINE_ARRAY__ = [],
__WEBPACK_AMD_DEFINE_RESULT__ = function() {
return classNames;
}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), // register as 'classnames', consistent with npm package name
!(void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)));
}();
}, /* 160 */
/***/
function(module, exports, __webpack_require__) {
"use strict";
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function _objectWithoutProperties(obj, keys) {
var target = {};
for (var i in obj) keys.indexOf(i) >= 0 || Object.prototype.hasOwnProperty.call(obj, i) && (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 || "object" != typeof call && "function" != typeof call ? self : call;
}
function _inherits(subClass, superClass) {
if ("function" != typeof superClass && null !== superClass) 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: !1,
writable: !0,
configurable: !0
}
}), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass);
}
Object.defineProperty(exports, "__esModule", {
value: !0
});
var _extends = Object.assign || function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]);
}
return target;
}, _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0,
"value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps),
Constructor;
};
}(), _react = __webpack_require__(1), _react2 = _interopRequireDefault(_react), _classnames = __webpack_require__(159), _classnames2 = _interopRequireDefault(_classnames), _classAutobind = __webpack_require__(161), _classAutobind2 = _interopRequireDefault(_classAutobind), _Button = __webpack_require__(162), _Button2 = _interopRequireDefault(_Button), Button = function(_Component) {
function Button() {
_classCallCheck(this, Button);
var _this = _possibleConstructorReturn(this, (Button.__proto__ || Object.getPrototypeOf(Button)).apply(this, arguments));
return (0, _classAutobind2.default)(_this), _this;
}
return _inherits(Button, _Component), _createClass(Button, [ {
key: "render",
value: function() {
var props = this.props, className = props.className, isDisabled = props.isDisabled, focusOnClick = props.focusOnClick, formSubmit = props.formSubmit, otherProps = _objectWithoutProperties(props, [ "className", "isDisabled", "focusOnClick", "formSubmit" ]);
className = (0, _classnames2.default)(className, _Button2.default.root);
var onMouseDown = focusOnClick === !1 ? this._onMouseDownPreventDefault : props.onMouseDown, type = formSubmit ? "submit" : "button";
return _react2.default.createElement("button", _extends({
type: type
}, otherProps, {
onMouseDown: onMouseDown,
className: className,
disabled: isDisabled
}), props.children);
}
}, {
key: "_onMouseDownPreventDefault",
value: function(event) {
event.preventDefault();
var onMouseDown = this.props.onMouseDown;
null != onMouseDown && onMouseDown(event);
}
} ]), Button;
}(_react.Component);
exports.default = Button;
}, /* 161 */
/***/
function(module, exports) {
"use strict";
function isExcluded(methodName) {
return REACT_EXCLUDE_METHODS[methodName] === !0;
}
function isFunction(item) {
return "function" == typeof item;
}
function autobind(instance, proto) {
null == proto && (proto = Object.getPrototypeOf(instance));
for (var propertyNames = Object.getOwnPropertyNames(proto), _iterator = propertyNames, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator](); ;) {
var _ref;
if (_isArray) {
if (_i >= _iterator.length) break;
_ref = _iterator[_i++];
} else {
if (_i = _iterator.next(), _i.done) break;
_ref = _i.value;
}
var name = _ref, value = proto[name];
isFunction(value) && !isExcluded(name) && (instance[name] = proto[name].bind(instance));
}
}
exports.__esModule = !0, exports.default = autobind;
// The following React methods should not be automatically bound.
var REACT_EXCLUDE_METHODS = {
getChildContext: !0,
render: !0,
componentWillMount: !0,
componentDidMount: !0,
componentWillReceiveProps: !0,
shouldComponentUpdate: !0,
componentWillUpdate: !0,
componentDidUpdate: !0,
componentWillUnmount: !0
};
}, /* 162 */
/***/
function(module, exports, __webpack_require__) {
// style-loader: Adds some css to the DOM by adding a <style> tag
// load the styles
var content = __webpack_require__(163);
"string" == typeof content && (content = [ [ module.id, content, "" ] ]);
// add the styles to the DOM
__webpack_require__(165)(content, {
sourceMap: !0
});
content.locals && (module.exports = content.locals);
}, /* 163 */
/***/
function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__(164)(), // imports
// module
exports.push([ module.id, ".Button__root___1gz0c{display:inline-block;margin:0 5px 0 0;padding:3px 8px;height:30px;line-height:22px;box-sizing:border-box;background:none #fdfdfd;background:linear-gradient(180deg,#fdfdfd 0,#f6f7f8);border:1px solid #999;border-radius:2px;color:#333;text-decoration:none;font-size:inherit;font-family:inherit;cursor:pointer;white-space:nowrap}.Button__root___1gz0c:disabled{cursor:not-allowed;background:none transparent}.Button__root___1gz0c:disabled>*{opacity:.5}", "" ]),
// exports
exports.locals = {
root: "Button__root___1gz0c"
};
}, /* 164 */
/***/
function(module, exports) {
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
// css base code, injected by the css-loader
module.exports = function() {
var list = [];
// return the list of modules as css string
// import a list of modules into the list
return list.toString = function() {
for (var result = [], i = 0; i < this.length; i++) {
var item = this[i];
item[2] ? result.push("@media " + item[2] + "{" + item[1] + "}") : result.push(item[1]);
}
return result.join("");
}, list.i = function(modules, mediaQuery) {
"string" == typeof modules && (modules = [ [ null, modules, "" ] ]);
for (var alreadyImportedModules = {}, i = 0; i < this.length; i++) {
var id = this[i][0];
"number" == typeof id && (alreadyImportedModules[id] = !0);
}
for (i = 0; i < modules.length; i++) {
var item = modules[i];
// skip already imported module
// this implementation is not 100% perfect for weird media query combinations
// when a module is imported multiple times with different media queries.
// I hope this will never occur (Hey this way we have smaller bundles)
"number" == typeof item[0] && alreadyImportedModules[item[0]] || (mediaQuery && !item[2] ? item[2] = mediaQuery : mediaQuery && (item[2] = "(" + item[2] + ") and (" + mediaQuery + ")"),
list.push(item));
}
}, list;
};
}, /* 165 */
/***/
function(module, exports, __webpack_require__) {
function addStylesToDom(styles, options) {
for (var i = 0; i < styles.length; i++) {
var item = styles[i], domStyle = stylesInDom[item.id];
if (domStyle) {
domStyle.refs++;
for (var j = 0; j < domStyle.parts.length; j++) domStyle.parts[j](item.parts[j]);
for (;j < item.parts.length; j++) domStyle.parts.push(addStyle(item.parts[j], options));
} else {
for (var parts = [], j = 0; j < item.parts.length; j++) parts.push(addStyle(item.parts[j], options));
stylesInDom[item.id] = {
id: item.id,
refs: 1,
parts: parts
};
}
}
}
function listToStyles(list) {
for (var styles = [], newStyles = {}, i = 0; i < list.length; i++) {
var item = list[i], id = item[0], css = item[1], media = item[2], sourceMap = item[3], part = {
css: css,
media: media,
sourceMap: sourceMap
};
newStyles[id] ? newStyles[id].parts.push(part) : styles.push(newStyles[id] = {
id: id,
parts: [ part ]
});
}
return styles;
}
function insertStyleElement(options, styleElement) {
var head = getHeadElement(), lastStyleElementInsertedAtTop = styleElementsInsertedAtTop[styleElementsInsertedAtTop.length - 1];
if ("top" === options.insertAt) lastStyleElementInsertedAtTop ? lastStyleElementInsertedAtTop.nextSibling ? head.insertBefore(styleElement, lastStyleElementInsertedAtTop.nextSibling) : head.appendChild(styleElement) : head.insertBefore(styleElement, head.firstChild),
styleElementsInsertedAtTop.push(styleElement); else {
if ("bottom" !== options.insertAt) throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");
head.appendChild(styleElement);
}
}
function removeStyleElement(styleElement) {
styleElement.parentNode.removeChild(styleElement);
var idx = styleElementsInsertedAtTop.indexOf(styleElement);
idx >= 0 && styleElementsInsertedAtTop.splice(idx, 1);
}
function createStyleElement(options) {
var styleElement = document.createElement("style");
return styleElement.type = "text/css", insertStyleElement(options, styleElement),
styleElement;
}
function createLinkElement(options) {
var linkElement = document.createElement("link");
return linkElement.rel = "stylesheet", insertStyleElement(options, linkElement),
linkElement;
}
function addStyle(obj, options) {
var styleElement, update, remove;
if (options.singleton) {
var styleIndex = singletonCounter++;
styleElement = singletonElement || (singletonElement = createStyleElement(options)),
update = applyToSingletonTag.bind(null, styleElement, styleIndex, !1), remove = applyToSingletonTag.bind(null, styleElement, styleIndex, !0);
} else obj.sourceMap && "function" == typeof URL && "function" == typeof URL.createObjectURL && "function" == typeof URL.revokeObjectURL && "function" == typeof Blob && "function" == typeof btoa ? (styleElement = createLinkElement(options),
update = updateLink.bind(null, styleElement), remove = function() {
removeStyleElement(styleElement), styleElement.href && URL.revokeObjectURL(styleElement.href);
}) : (styleElement = createStyleElement(options), update = applyToTag.bind(null, styleElement),
remove = function() {
removeStyleElement(styleElement);
});
return update(obj), function(newObj) {
if (newObj) {
if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) return;
update(obj = newObj);
} else remove();
};
}
function applyToSingletonTag(styleElement, index, remove, obj) {
var css = remove ? "" : obj.css;
if (styleElement.styleSheet) styleElement.styleSheet.cssText = replaceText(index, css); else {
var cssNode = document.createTextNode(css), childNodes = styleElement.childNodes;
childNodes[index] && styleElement.removeChild(childNodes[index]), childNodes.length ? styleElement.insertBefore(cssNode, childNodes[index]) : styleElement.appendChild(cssNode);
}
}
function applyToTag(styleElement, obj) {
var css = obj.css, media = obj.media;
if (media && styleElement.setAttribute("media", media), styleElement.styleSheet) styleElement.styleSheet.cssText = css; else {
for (;styleElement.firstChild; ) styleElement.removeChild(styleElement.firstChild);
styleElement.appendChild(document.createTextNode(css));
}
}
function updateLink(linkElement, obj) {
var css = obj.css, sourceMap = obj.sourceMap;
sourceMap && (// http://stackoverflow.com/a/26603875
css += "\n/*# sourceMappingURL=data:application/json;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + " */");
var blob = new Blob([ css ], {
type: "text/css"
}), oldSrc = linkElement.href;
linkElement.href = URL.createObjectURL(blob), oldSrc && URL.revokeObjectURL(oldSrc);
}
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
var stylesInDom = {}, memoize = function(fn) {
var memo;
return function() {
return "undefined" == typeof memo && (memo = fn.apply(this, arguments)), memo;
};
}, isOldIE = memoize(function() {
return /msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase());
}), getHeadElement = memoize(function() {
return document.head || document.getElementsByTagName("head")[0];
}), singletonElement = null, singletonCounter = 0, styleElementsInsertedAtTop = [];
module.exports = function(list, options) {
options = options || {}, // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
// tags it will allow on a page
"undefined" == typeof options.singleton && (options.singleton = isOldIE()), // By default, add <style> tags to the bottom of <head>.
"undefined" == typeof options.insertAt && (options.insertAt = "bottom");
var styles = listToStyles(list);
return addStylesToDom(styles, options), function(newList) {
for (var mayRemove = [], i = 0; i < styles.length; i++) {
var item = styles[i], domStyle = stylesInDom[item.id];
domStyle.refs--, mayRemove.push(domStyle);
}
if (newList) {
var newStyles = listToStyles(newList);
addStylesToDom(newStyles, options);
}
for (var i = 0; i < mayRemove.length; i++) {
var domStyle = mayRemove[i];
if (0 === domStyle.refs) {
for (var j = 0; j < domStyle.parts.length; j++) domStyle.parts[j]();
delete stylesInDom[domStyle.id];
}
}
};
};
var replaceText = function() {
var textStore = [];
return function(index, replacement) {
return textStore[index] = replacement, textStore.filter(Boolean).join("\n");
};
}();
}, /* 166 */
/***/
function(module, exports, __webpack_require__) {
"use strict";
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function ButtonWrap(props) {
var className = (0, _classnames2.default)(props.className, _ButtonWrap2.default.root);
return _react2.default.createElement("div", _extends({}, props, {
className: className
}));
}
Object.defineProperty(exports, "__esModule", {
value: !0
});
var _extends = Object.assign || function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]);
}
return target;
};
exports.default = ButtonWrap;
var _react = __webpack_require__(1), _react2 = _interopRequireDefault(_react), _classnames = __webpack_require__(159), _classnames2 = _interopRequireDefault(_classnames), _ButtonWrap = __webpack_require__(167), _ButtonWrap2 = _interopRequireDefault(_ButtonWrap);
}, /* 167 */
/***/
function(module, exports, __webpack_require__) {
// style-loader: Adds some css to the DOM by adding a <style> tag
// load the styles
var content = __webpack_require__(168);
"string" == typeof content && (content = [ [ module.id, content, "" ] ]);
// add the styles to the DOM
__webpack_require__(165)(content, {
sourceMap: !0
});
content.locals && (module.exports = content.locals);
}, /* 168 */
/***/
function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__(164)(), // imports
// module
exports.push([ module.id, ".ButtonWrap__root___1EO_R{display:inline-block;position:relative;z-index:10}", "" ]),
// exports
exports.locals = {
root: "ButtonWrap__root___1EO_R"
};
}, /* 169 */
/***/
function(module, exports, __webpack_require__) {
// style-loader: Adds some css to the DOM by adding a <style> tag
// load the styles
var content = __webpack_require__(170);
"string" == typeof content && (content = [ [ module.id, content, "" ] ]);
// add the styles to the DOM
__webpack_require__(165)(content, {
sourceMap: !0
});
content.locals && (module.exports = content.locals);
}, /* 170 */
/***/
function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__(164)(), // imports
// module
exports.push([ module.id, '.IconButton__root___3tqZW{padding-left:3px;padding-right:3px}.IconButton__icon___3YgOS{display:inline-block;width:22px;height:22px;background-position:50%;background-repeat:no-repeat;background-size:18px}.IconButton__isActive___2Ey8p{background:none #d8d8d8}.IconButton__icon-undo___EQSRP{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTcuODU2IDI0YzIuNjY1LTQuODMgMy4xMTUtMTIuMTk1LTcuMzU2LTExLjk1VjE4bC05LTkgOS05djUuODJDMjMuMDM4IDUuNDk1IDI0LjQzNSAxNi44OSAxNy44NTYgMjR6Ii8+PC9zdmc+");background-size:14px}.IconButton__icon-redo___30MVz{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTMuNSA1LjgyVjBsOSA5LTkgOXYtNS45NUMzLjAzIDExLjgwNiAzLjQ3OCAxOS4xNyA2LjE0NCAyNC0uNDM2IDE2Ljg5Ljk2MiA1LjQ5NCAxMy41IDUuODJ6Ii8+PC9zdmc+");background-size:14px}.IconButton__icon-unordered-list-item___Pvkrr{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDE2IDE2Ij48cGF0aCBkPSJNNC42NTYgMy4zNDRIMTR2MS4zMTNINC42NTZWMy4zNDR6bTAgNS4zMTJWNy4zNDNIMTR2MS4zMTNINC42NTZ6bTAgNHYtMS4zMTNIMTR2MS4zMTNINC42NTZ6bS0yLTEuNTNxLjM3NSAwIC42NC4yNXQuMjY3LjYyNC0uMjY2LjYyNS0uNjQuMjUtLjYyNi0uMjVUMS43OCAxMnQuMjUtLjYyNS42MjYtLjI1em0wLTguMTI2cS40MDYgMCAuNzAzLjI4dC4yOTYuNzItLjI5Ny43Mi0uNzA0LjI4LS43MDMtLjI4VDEuNjU2IDR0LjI5Ny0uNzIuNzAzLS4yOHptMCA0cS40MDYgMCAuNzAzLjI4dC4yOTYuNzItLjI5Ny43Mi0uNzA0LjI4LS43MDMtLjI4VDEuNjU2IDh0LjI5Ny0uNzIuNzAzLS4yOHoiLz48L3N2Zz4=")}.IconButton__icon-ordered-list-item___2rzD0{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDE2IDE2Ij48cGF0aCBkPSJNNC42NTYgOC42NTZWNy4zNDNIMTR2MS4zMTNINC42NTZ6bTAgNHYtMS4zMTNIMTR2MS4zMTNINC42NTZ6bTAtOS4zMTJIMTR2MS4zMTNINC42NTZWMy4zNDR6bS0zLjMxMiA0di0uNjg4aDJ2LjYyNWwtMS4yMiAxLjM3NmgxLjIydi42ODhoLTJWOC43MmwxLjE4OC0xLjM3NkgxLjM0NHptLjY1Ni0ydi0yaC0uNjU2di0uNjg4aDEuMzEzdjIuNjg4SDJ6bS0uNjU2IDZ2LS42ODhoMnYyLjY4OGgtMnYtLjY4OGgxLjMxM3YtLjMxM0gydi0uNjg4aC42NTd2LS4zMTNIMS4zNDR6Ii8+PC9zdmc+")}.IconButton__icon-blockquote___17VSX{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDE2IDE2Ij48cGF0aCBkPSJNOS4zNDQgMTEuMzQ0bDEuMzEzLTIuNjg4aC0ydi00aDR2NGwtMS4zMTMgMi42ODhoLTJ6bS01LjM0NCAwbDEuMzQ0LTIuNjg4aC0ydi00aDR2NEw2IDExLjM0NEg0eiIvPjwvc3ZnPg==")}.IconButton__icon-bold___2zl9t{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDE2IDE2Ij48cGF0aCBkPSJNOSAxMC4zNDRxLjQzOCAwIC43Mi0uMjk3dC4yOC0uNzAzLS4yOC0uNzAzVDkgOC4zNDVINi42NTZ2Mkg5em0tMi4zNDQtNnYyaDJxLjQwNiAwIC43MDMtLjI5N3QuMjk2LS43MDMtLjI5Ny0uNzAzLS43MDQtLjI5NmgtMnptMy43NSAyLjg0NHExLjQzOC42NTYgMS40MzggMi4yOCAwIDEuMDY0LS43MDMgMS43OThUOS4zNzYgMTJoLTQuNzJWMi42NTZoNC4xOXExLjEyNCAwIDEuODkuNzh0Ljc2NiAxLjkwNy0xLjA5MyAxLjg0NHoiLz48L3N2Zz4=")}.IconButton__icon-italic___2hHzc{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDE2IDE2Ij48cGF0aCBkPSJNNi42NTYgMi42NTZIMTJ2MmgtMS44NzVMNy44NzUgMTBoMS40N3YySDR2LTJoMS44NzVsMi4yNS01LjM0NGgtMS40N3YtMnoiLz48L3N2Zz4=")}.IconButton__icon-underline___2EmZJ{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDE2IDE2Ij48cGF0aCBkPSJNMy4zNDQgMTIuNjU2aDkuMzEzVjE0SDMuMzQ0di0xLjM0NHpNOCAxMS4zNDRxLTEuNjU2IDAtMi44MjgtMS4xNzJUNCA3LjM0NFYyaDEuNjU2djUuMzQ0cTAgLjk3LjY4OCAxLjY0VDggOS42NTh0MS42NTYtLjY3Mi42ODgtMS42NFYySDEydjUuMzQ0UTEyIDkgMTAuODI4IDEwLjE3MlQ4IDExLjM0NHoiLz48L3N2Zz4=")}.IconButton__icon-strikethrough___QtE2X{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMjMuNTcgMTJxLjE5IDAgLjMxLjEydC4xMi4zMXYuODU2cTAgLjE4OC0uMTIuMzA4dC0uMzEuMTJILjQzcS0uMTg4IDAtLjMwOC0uMTJUMCAxMy4yODZ2LS44NTdxMC0uMTkuMTItLjMxVC40MjggMTJIMjMuNTd6bS0xNy4xLS44NTdxLS4zNzYtLjQ3LS42ODQtMS4wNy0uNjQzLTEuMy0uNjQzLTIuNTIgMC0yLjQyMyAxLjc5NS00LjEzNyAxLjc4LTEuNyA1LjI2My0xLjcuNjcgMCAyLjIzOC4yNTMuODg0LjE2IDIuMzcuNjQyLjEzNS41MS4yODIgMS41OC4xODggMS42NDcuMTg4IDIuNDUgMCAuMjQyLS4wNjcuNjA0bC0uMTYuMDQtMS4xMjUtLjA4LS4xODgtLjAyN3EtLjY3LTEuOTk3LTEuMzgtMi43NDctMS4xNzgtMS4yMi0yLjgxMi0xLjIyLTEuNTI3IDAtMi40MzguNzktLjg5Ny43NzgtLjg5NyAxLjk1NiAwIC45NzcuODg0IDEuODc0dDMuNzM3IDEuNzI4cS45MjUuMjY4IDIuMzE4Ljg4NC43NzcuMzc1IDEuMjcyLjY5Nkg2LjQ3em02Ljc5IDMuNDI4aDUuNTAzcS4wOTQuNTIzLjA5NCAxLjIzMyAwIDEuNDg3LS41NSAyLjg0LS4zMDcuNzM2LS45NSAxLjM5Mi0uNDk2LjQ3LTEuNDYgMS4wODUtMS4wNy42NDMtMi4wNS44ODQtMS4wNy4yOC0yLjcxOC4yOC0xLjUyOCAwLTIuNjEzLS4zMDdsLTEuODc1LS41MzZxLS43NjMtLjIxMy0uOTY0LS4zNzQtLjEwNy0uMTA3LS4xMDctLjI5NXYtLjE3M3EwLTEuNDQ2LS4wMjYtMi4wOS0uMDEzLS40IDAtLjkxbC4wMjctLjQ5NnYtLjU4OGwxLjM2Ny0uMDI3cS4yLjQ1NS40MDIuOTV0LjMuNzUuMTY3LjM2M3EuNDcuNzYzIDEuMDcgMS4yNi41NzcuNDggMS40MDcuNzYyLjc5LjI5NSAxLjc2OC4yOTUuODU3IDAgMS44NjItLjM2MiAxLjAzLS4zNDggMS42MzQtMS4xNTIuNjMtLjgxNi42My0xLjcyNyAwLTEuMTI1LTEuMDg2LTIuMTAzLS40NTUtLjM4OC0xLjgzNS0uOTV6Ii8+PC9zdmc+");background-size:14px}.IconButton__icon-code___3F1pe{background-image:url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTE2IDExNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLW1pdGVybGltaXQ9IjEuNDE0Ij48ZyBmaWxsLXJ1bGU9Im5vbnplcm8iPjxwYXRoIGQ9Ik0yMi40NjQgMjguNDhjMCAyLjg5NS4zNDQgNS45MDUuODA2IDkuMDIuMzQyIDMuMDEuNjkgNi4wMi42OSA4LjkxNyAwIDMuNTYyLS45MTcgNy43OS04Ljk1NSA3LjkxMnY3LjIzNmM4LjAzNi4xMTUgOC45NTYgNC42NzIgOC45NTYgNy45MTIgMCAyLjg4Ni0uMzQ4IDUuNzgzLS42OSA4Ljc4Ny0uNDYyIDMuMDEzLS44MDYgNi4xMzQtLjgwNiA4LjkyIDAgMTEuMjM4IDcuMTA2IDE1LjI1MiAxNy4wODcgMTUuMjUyaDMuMzJ2LTcuOTEyaC0yLjA2MmMtNS43MjYgMC04LjAyNS0zLjIzMy04LjAyNS04Ljc5NiAwLTIuMjM2LjM0NC00LjU3LjgwNi03LjAyMy4yMjctMi40MzguNjg0LTUuMTIuNjg0LTguMTIuMTE1LTcuNzkyLTMuMzItMTEuMjUzLTkuMTc0LTEyLjU4NnYtLjIyNWM1Ljg1NC0xLjMzMiA5LjI5My00LjY3NiA5LjE3LTEyLjQ3IDAtMi44OTUtLjQ1Ny01LjU2NS0uNjg0LTguMDI0LS40NjItMi40NC0uODA3LTQuNzc3LS44MDctNy4wMTIgMC01LjQ1IDIuMDU4LTguNjg4IDguMDI0LTguNjg4aDIuMDY2di04LjAxNGgtMy4zMmMtMTAuMjA1LS4wMDMtMTcuMDg2IDQuNDQ0LTE3LjA4NiAxNC45MTV6TTkyLjA2IDQ2LjQxN2MwLTIuODkzLjQ1My01LjkwMy44MDMtOC45MTguMzQzLTMuMTE0Ljc5Ny02LjEyLjc5Ny05LjAyIDAtMTAuNDctNi44NzUtMTQuOTE3LTE3LjA4LTE0LjkxN2gtMy4zMjd2OC4wMTdoMi4wNmM1Ljg1Mi4xMTQgNy45MSAzLjIzMyA3LjkxIDguNjg4IDAgMi4yMy0uMzQyIDQuNTY1LS42ODUgNy4wMTItLjM1IDIuNDU1LS42OTIgNS4xMjYtLjY5MiA4LjAyNC0uMTA1IDcuNzk3IDMuMzI3IDExLjEzNiA5LjA1NiAxMi40N3YuMjIyYy01LjcyIDEuMzMzLTkuMTYgNC43OTYtOS4wNTYgMTIuNTg3IDAgMyAuMzQyIDUuNjg2LjY5MiA4LjEyLjM0MyAyLjQ1NS42ODYgNC43OS42ODYgNy4wMjUgMCA1LjU1NC0yLjE4IDguNjgtNy45MTIgOC43ODhoLTIuMDZ2Ny45MTJoMy4zMjVjOS45NzUgMCAxNy4wNzYtNC4wMSAxNy4wNzYtMTUuMjUgMC0yLjc4My0uNDU0LTUuOS0uNzk2LTguOTE0LS4zNDctMy4wMS0uODA1LTUuOS0uODA1LTguNzk1IDAtMy4yMzMgMS4wMzUtNy43OSA4Ljk0My03LjkxM1Y1NC4zMmMtNy45MDQtLjExMi04LjkzNS00LjM0LTguOTM1LTcuOTAzeiIvPjwvZz48L3N2Zz4=")}.IconButton__icon-link___2umEl{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMiIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDIyIDI0Ij48cGF0aCBkPSJNMTkuNSAxNi4yODZxMC0uNTM2LS4zNzUtLjkxbC0yLjc4Ni0yLjc4N3EtLjM3Ni0uMzc2LS45MTItLjM3Ni0uNTYzIDAtLjk2NC40M2wuMjU0LjI0N3EuMjE0LjIwOC4yODguMjl0LjIuMjUzLjE3NS4zNDIuMDQ4LjM2OHEwIC41MzYtLjM3NS45MXQtLjkxLjM3NnEtLjIwMiAwLS4zNy0uMDQ4dC0uMzQtLjE3NC0uMjU1LS4yLS4yODgtLjI5LS4yNDgtLjI1M3EtLjQ0Mi40MTUtLjQ0Mi45NzggMCAuNTM2LjM3NS45MWwyLjc2IDIuNzczcS4zNi4zNjIuOTEuMzYyLjUzNiAwIC45MS0uMzQ4bDEuOTctMS45NTVxLjM3NS0uMzc1LjM3NS0uODk3em0tOS40MTUtOS40NDJxMC0uNTM2LS4zNzUtLjkxTDYuOTUgMy4xNnEtLjM3NC0uMzc0LS45MS0uMzc0LS41MjIgMC0uOTEuMzYyTDMuMTYgNS4xMDNxLS4zNzUuMzc1LS4zNzUuODk3IDAgLjUzNi4zNzUuOTFsMi43ODYgMi43ODdxLjM2Mi4zNjIuOTEuMzYyLjU2NCAwIC45NjUtLjQxNmwtLjI1My0uMjQ4cS0uMjEzLS4yMDgtLjI4OC0uMjg4dC0uMjAyLS4yNTQtLjE3NC0uMzQyLS4wNDctLjM2OHEwLS41MzYuMzc1LS45MXQuOTEtLjM3NnEuMjAyIDAgLjM3LjA0N3QuMzQuMTc0LjI1NS4yLjI4OC4yODguMjQ4LjI1NHEuNDQyLS40MTUuNDQyLS45Nzh6bTExLjk4NiA5LjQ0MnEwIDEuNjA3LTEuMTM3IDIuNzJsLTEuOTcgMS45NTRxLTEuMTEgMS4xMTItMi43MTggMS4xMTItMS42MiAwLTIuNzMyLTEuMTM4bC0yLjc2LTIuNzcycS0xLjExLTEuMTEyLTEuMTEtMi43MiAwLTEuNjQ2IDEuMTc4LTIuNzk4bC0xLjE3OC0xLjE4cS0xLjE1MiAxLjE4LTIuNzg2IDEuMTgtMS42MDcgMC0yLjczMi0xLjEyNUwxLjMzOCA4LjczMlEuMjEzIDcuNjA4LjIxMyA2VDEuMzUgMy4yODNsMS45Ny0xLjk1NVE0LjQzMi4yMTUgNi4wNC4yMTVxMS42MiAwIDIuNzMgMS4xMzhsMi43NiAyLjc3MnExLjExMiAxLjExMiAxLjExMiAyLjcyIDAgMS42NDYtMS4xOCAyLjc5OGwxLjE4IDEuMThxMS4xNTItMS4xOCAyLjc4Ni0xLjE4IDEuNjA3IDAgMi43MzIgMS4xMjVsMi43ODYgMi43ODZxMS4xMjUgMS4xMjUgMS4xMjUgMi43MzJ6Ii8+PC9zdmc+");background-size:14px}.IconButton__icon-remove-link___j61pw{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMiIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDIyIDI0Ij48cGF0aCBkPSJNNS44OCAxNy4wMjJsLTMuNDMgMy40M3EtLjEzNC4xMi0uMzA4LjEyLS4xNiAwLS4zMDgtLjEyLS4xMi0uMTM1LS4xMi0uMzF0LjEyLS4zMDdsMy40My0zLjQzcS4xMzMtLjEyLjMwNy0uMTJ0LjMxLjEycS4xMi4xMzUuMTIuMzF0LS4xMi4zMDd6bTIuMjYzLjU1djQuMjg1cTAgLjE4OC0uMTIuMzA4dC0uMzEuMTItLjMwNy0uMTItLjEyLS4zMDhWMTcuNTdxMC0uMTg3LjEyLS4zMDd0LjMwOC0uMTIuMzA4LjEyLjEyLjMwOHptLTMtM3EwIC4xODctLjEyLjMwN3QtLjMxLjEySC40M3EtLjE4OCAwLS4zMDgtLjEyVDAgMTQuNTd0LjEyLS4zMDcuMzA4LS4xMmg0LjI4NnEuMTg4IDAgLjMwOC4xMnQuMTIuMzA4em0xNi45MjggMS43MTRxMCAxLjYwNy0xLjEzNyAyLjcybC0xLjk3IDEuOTU0cS0xLjExIDEuMTEyLTIuNzE4IDEuMTEyLTEuNjIgMC0yLjczMi0xLjEzOEw5LjA0IDE2LjQ0N3EtLjI4LS4yOC0uNTYzLS43NWwzLjItLjI0IDMuNjU3IDMuNjdxLjM2Mi4zNi45MS4zNjd0LjkxMi0uMzU1bDEuOTctMS45NTZxLjM3NC0uMzc1LjM3NC0uODk3IDAtLjUzNi0uMzc1LS45MWwtMy42Ny0zLjY4NC4yNC0zLjJxLjQ3LjI4Ljc1LjU2Mmw0LjUgNC41cTEuMTI2IDEuMTUyIDEuMTI2IDIuNzMyek0xMy44MSA2LjU5bC0zLjIuMjRMNi45NSAzLjE2cS0uMzc0LS4zNzUtLjkxLS4zNzUtLjUyMiAwLS45MS4zNjJMMy4xNiA1LjEwMnEtLjM3NS4zNzUtLjM3NS44OTcgMCAuNTM1LjM3NS45MWwzLjY3IDMuNjctLjI0IDMuMjE0cS0uNDctLjI4LS43NS0uNTYzbC00LjUtNC41US4yMTMgNy41OC4yMTMgNnEwLTEuNjA4IDEuMTM4LTIuNzJsMS45Ny0xLjk1NVE0LjQzLjIxMyA2LjA0LjIxM3ExLjYyIDAgMi43MzIgMS4xMzhsNC40NzMgNC40ODhxLjI4LjI4LjU2My43NXptOC40NzggMS4xMjRxMCAuMTg4LS4xMi4zMDh0LS4zMS4xMmgtNC4yODVxLS4xODcgMC0uMzA3LS4xMnQtLjEyLS4zMDguMTItLjMwOC4zMDgtLjEyaDQuMjg3cS4xODggMCAuMzA4LjEydC4xMi4zMDh6TTE1IC40M3Y0LjI4NXEwIC4xODgtLjEyLjMwOHQtLjMxLjEyLS4zMDctLjEyLS4xMi0uMzA4Vi40M3EwLS4xOS4xMi0uMzFUMTQuNTcgMHQuMzEuMTIuMTIuMzF6bTUuNDUgMi4wMmwtMy40MjggMy40M3EtLjE0Ny4xMi0uMzA4LjEydC0uMzA4LS4xMnEtLjEyLS4xMzQtLjEyLS4zMDh0LjEyLS4zMDhsMy40My0zLjQzcS4xMzMtLjEyLjMwNy0uMTJ0LjMwOC4xMnEuMTIyLjEzNS4xMjIuMzF0LS4xMi4zMDd6Ii8+PC9zdmc+");background-size:14px}.IconButton__icon-cancel___fx4TT{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMjMuNzggMTkuMjhMMTYuNSAxMmw3LjI4LTcuMjhhLjc0OC43NDggMCAwIDAgMC0xLjA2TDIwLjM0LjIxOGEuNzUuNzUgMCAwIDAtMS4wNi0uMDAyTDEyIDcuNDk4IDQuNzE3LjIyYS43NDguNzQ4IDAgMCAwLTEuMDYgMEwuMjE3IDMuNjZhLjc1Ljc1IDAgMCAwIDAgMS4wNkw3LjQ5NyAxMmwtNy4yOCA3LjI4YS43NDguNzQ4IDAgMCAwIDAgMS4wNmwzLjQ0IDMuNDRhLjc1Ljc1IDAgMCAwIDEuMDYuMDAybDcuMjgtNy4yOCA3LjI4MiA3LjI4Yy4wNzguMDc4LjE3LjEzNS4yNjguMTcuMjY3LjEuNTguMDQ0Ljc5My0uMTdsMy40NC0zLjQ0YS43NS43NSAwIDAgMCAwLTEuMDZ6Ii8+PC9zdmc+");background-size:13px}.IconButton__icon-accept___2D6M9{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMjAuMjUgM0w5IDE0LjI1IDMuNzUgOSAwIDEyLjc1bDkgOSAxNS0xNXoiLz48L3N2Zz4=");background-size:13px}', "" ]),
// exports
exports.locals = {
root: "IconButton__root___3tqZW",
icon: "IconButton__icon___3YgOS",
isActive: "IconButton__isActive___2Ey8p",
"icon-undo": "IconButton__icon-undo___EQSRP IconButton__icon___3YgOS",
"icon-redo": "IconButton__icon-redo___30MVz IconButton__icon___3YgOS",
"icon-unordered-list-item": "IconButton__icon-unordered-list-item___Pvkrr IconButton__icon___3YgOS",
"icon-ordered-list-item": "IconButton__icon-ordered-list-item___2rzD0 IconButton__icon___3YgOS",
"icon-blockquote": "IconButton__icon-blockquote___17VSX IconButton__icon___3YgOS",
"icon-bold": "IconButton__icon-bold___2zl9t IconButton__icon___3YgOS",
"icon-italic": "IconButton__icon-italic___2hHzc IconButton__icon___3YgOS",
"icon-underline": "IconButton__icon-underline___2EmZJ IconButton__icon___3YgOS",
"icon-strikethrough": "IconButton__icon-strikethrough___QtE2X IconButton__icon___3YgOS",
"icon-code": "IconButton__icon-code___3F1pe IconButton__icon___3YgOS",
"icon-link": "IconButton__icon-link___2umEl IconButton__icon___3YgOS",
"icon-remove-link": "IconButton__icon-remove-link___j61pw IconButton__icon___3YgOS",
"icon-cancel": "IconButton__icon-cancel___fx4TT IconButton__icon___3YgOS",
"icon-accept": "IconButton__icon-accept___2D6M9 IconButton__icon___3YgOS"
};
}, /* 171 */
/***/
function(module, exports, __webpack_require__) {
"use strict";
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function _objectWithoutProperties(obj, keys) {
var target = {};
for (var i in obj) keys.indexOf(i) >= 0 || Object.prototype.hasOwnProperty.call(obj, i) && (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 || "object" != typeof call && "function" != typeof call ? self : call;
}
function _inherits(subClass, superClass) {
if ("function" != typeof superClass && null !== superClass) 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: !1,
writable: !0,
configurable: !0
}
}), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass);
}
Object.defineProperty(exports, "__esModule", {
value: !0
});
var _extends = Object.assign || function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]);
}
return target;
}, _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0,
"value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps),
Constructor;
};
}(), _react = __webpack_require__(1), _react2 = _interopRequireDefault(_react), _IconButton = __webpack_require__(158), _IconButton2 = _interopRequireDefault(_IconButton), _InputPopover = __webpack_require__(172), _InputPopover2 = _interopRequireDefault(_InputPopover), _classAutobind = __webpack_require__(161), _classAutobind2 = _interopRequireDefault(_classAutobind), PopoverIconButton = function(_Component) {
function PopoverIconButton() {
_classCallCheck(this, PopoverIconButton);
var _this = _possibleConstructorReturn(this, (PopoverIconButton.__proto__ || Object.getPrototypeOf(PopoverIconButton)).apply(this, arguments));
return (0, _classAutobind2.default)(_this), _this;
}
return _inherits(PopoverIconButton, _Component), _createClass(PopoverIconButton, [ {
key: "render",
value: function() {
var _props = this.props, onTogglePopover = _props.onTogglePopover, props = (_props.showPopover,
_objectWithoutProperties(_props, [ "onTogglePopover", "showPopover" ]));
// eslint-disable-line no-unused-vars
return _react2.default.createElement(_IconButton2.default, _extends({}, props, {
onClick: onTogglePopover
}), this._renderPopover());
}
}, {
key: "_renderPopover",
value: function() {
return this.props.showPopover ? _react2.default.createElement(_InputPopover2.default, {
onSubmit: this._onSubmit,
onCancel: this._hidePopover
}) : null;
}
}, {
key: "_onSubmit",
value: function() {
var _props2;
(_props2 = this.props).onSubmit.apply(_props2, arguments);
}
}, {
key: "_hidePopover",
value: function() {
if (this.props.showPopover) {
var _props3;
(_props3 = this.props).onTogglePopover.apply(_props3, arguments);
}
}
} ]), PopoverIconButton;
}(_react.Component);
exports.default = PopoverIconButton;
}, /* 172 */
/***/
function(module, exports, __webpack_require__) {
"use strict";
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 || "object" != typeof call && "function" != typeof call ? self : call;
}
function _inherits(subClass, superClass) {
if ("function" != typeof superClass && null !== superClass) 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: !1,
writable: !0,
configurable: !0
}
}), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass);
}
Object.defineProperty(exports, "__esModule", {
value: !0
});
var _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0,
"value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps),
Constructor;
};
}(), _react = __webpack_require__(1), _react2 = _interopRequireDefault(_react), _reactDom = __webpack_require__(53), _reactDom2 = _interopRequireDefault(_reactDom), _IconButton = __webpack_require__(158), _IconButton2 = _interopRequireDefault(_IconButton), _ButtonGroup = __webpack_require__(173), _ButtonGroup2 = _interopRequireDefault(_ButtonGroup), _classAutobind = __webpack_require__(161), _classAutobind2 = _interopRequireDefault(_classAutobind), _classnames = __webpack_require__(159), _classnames2 = _interopRequireDefault(_classnames), _InputPopover = __webpack_require__(176), _InputPopover2 = _interopRequireDefault(_InputPopover), InputPopover = function(_Component) {
function InputPopover() {
_classCallCheck(this, InputPopover);
var _this = _possibleConstructorReturn(this, (InputPopover.__proto__ || Object.getPrototypeOf(InputPopover)).apply(this, arguments));
return (0, _classAutobind2.default)(_this), _this;
}
return _inherits(InputPopover, _Component), _createClass(InputPopover, [ {
key: "componentDidMount",
value: function() {
document.addEventListener("click", this._onDocumentClick), document.addEventListener("keydown", this._onDocumentKeydown),
this._inputRef && this._inputRef.focus();
}
}, {
key: "componentWillUnmount",
value: function() {
document.removeEventListener("click", this._onDocumentClick), document.removeEventListener("keydown", this._onDocumentKeydown);
}
}, {
key: "render",
value: function() {
var props = this.props, className = (0, _classnames2.default)(props.className, _InputPopover2.default.root);
return _react2.default.createElement("div", {
className: className
}, _react2.default.createElement("div", {
className: _InputPopover2.default.inner
}, _react2.default.createElement("input", {
ref: this._setInputRef,
type: "text",
placeholder: "https://example.com/",
className: _InputPopover2.default.input,
onKeyPress: this._onInputKeyPress
}), _react2.default.createElement(_ButtonGroup2.default, {
className: _InputPopover2.default.buttonGroup
}, _react2.default.createElement(_IconButton2.default, {
label: "Cancel",
iconName: "cancel",
onClick: props.onCancel
}), _react2.default.createElement(_IconButton2.default, {
label: "Submit",
iconName: "accept",
onClick: this._onSubmit
}))));
}
}, {
key: "_setInputRef",
value: function(inputElement) {
this._inputRef = inputElement;
}
}, {
key: "_onInputKeyPress",
value: function(event) {
13 === event.which && (// Avoid submitting a <form> somewhere up the element tree.
event.preventDefault(), this._onSubmit());
}
}, {
key: "_onSubmit",
value: function() {
var value = this._inputRef ? this._inputRef.value : "";
this.props.onSubmit(value);
}
}, {
key: "_onDocumentClick",
value: function(event) {
var rootNode = _reactDom2.default.findDOMNode(this);
rootNode.contains(event.target) || // Here we pass the event so the parent can manage focus.
this.props.onCancel(event);
}
}, {
key: "_onDocumentKeydown",
value: function(event) {
27 === event.keyCode && this.props.onCancel();
}
} ]), InputPopover;
}(_react.Component);
exports.default = InputPopover;
}, /* 173 */
/***/
function(module, exports, __webpack_require__) {
"use strict";
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function ButtonGroup(props) {
var className = (0, _classnames2.default)(props.className, _ButtonGroup2.default.root);
return _react2.default.createElement("div", _extends({}, props, {
className: className
}));
}
Object.defineProperty(exports, "__esModule", {
value: !0
});
var _extends = Object.assign || function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]);
}
return target;
};
exports.default = ButtonGroup;
var _react = __webpack_require__(1), _react2 = _interopRequireDefault(_react), _classnames = __webpack_require__(159), _classnames2 = _interopRequireDefault(_classnames), _ButtonGroup = __webpack_require__(174), _ButtonGroup2 = _interopRequireDefault(_ButtonGroup);
}, /* 174 */
/***/
function(module, exports, __webpack_require__) {
// style-loader: Adds some css to the DOM by adding a <style> tag
// load the styles
var content = __webpack_require__(175);
"string" == typeof content && (content = [ [ module.id, content, "" ] ]);
// add the styles to the DOM
__webpack_require__(165)(content, {
sourceMap: !0
});
content.locals && (module.exports = content.locals);
}, /* 175 */
/***/
function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__(164)(), // imports
// module
exports.push([ module.id, ".ButtonGroup__root___3lEAn{display:inline-block;vertical-align:top;margin:0 5px 5px 0;white-space:nowrap}.ButtonGroup__root___3lEAn:last-child{margin-right:0}.ButtonGroup__root___3lEAn>div>button{margin-right:0;border-radius:0}.ButtonGroup__root___3lEAn>div>button:focus{position:relative;z-index:1}.ButtonGroup__root___3lEAn>div:first-child>button{border-top-left-radius:2px;border-bottom-left-radius:2px}.ButtonGroup__root___3lEAn>div+div>button{border-left-width:0}.ButtonGroup__root___3lEAn>div:last-child>button{border-top-right-radius:2px;border-bottom-right-radius:2px}", "" ]),
// exports
exports.locals = {
root: "ButtonGroup__root___3lEAn"
};
}, /* 176 */
/***/
function(module, exports, __webpack_require__) {
// style-loader: Adds some css to the DOM by adding a <style> tag
// load the styles
var content = __webpack_require__(177);
"string" == typeof content && (content = [ [ module.id, content, "" ] ]);
// add the styles to the DOM
__webpack_require__(165)(content, {
sourceMap: !0
});
content.locals && (module.exports = content.locals);
}, /* 177 */
/***/
function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__(164)(), // imports
// module
exports.push([ module.id, '.InputPopover__root___3Hpj9{position:absolute;top:calc(100% + 5px);left:0;width:260px;background:none #fdfdfd;background:linear-gradient(180deg,#fdfdfd 0,#f6f7f8);border:1px solid #999;border-radius:2px;box-sizing:border-box;padding:4px}.InputPopover__root___3Hpj9:before{top:-10px;border:5px solid transparent;border-bottom-color:#999}.InputPopover__root___3Hpj9:after,.InputPopover__root___3Hpj9:before{content:"";display:block;position:absolute;width:0;height:0;left:10px}.InputPopover__root___3Hpj9:after{top:-9px;border:5px solid transparent;border-bottom-color:#fdfdfd}.InputPopover__inner___32V5P{display:flex}.InputPopover__input___264Za{display:block;flex:1 0 auto;height:30px;background:none #fff;border:1px solid #999;border-radius:2px;box-sizing:border-box;padding:2px 6px;font-family:inherit;font-size:inherit;line-height:24px}.InputPopover__inner___32V5P .InputPopover__buttonGroup___2c3Sl{flex:0 1 auto;margin-left:4px;margin-bottom:0}', "" ]),
// exports
exports.locals = {
root: "InputPopover__root___3Hpj9",
inner: "InputPopover__inner___32V5P",
input: "InputPopover__input___264Za",
buttonGroup: "InputPopover__buttonGroup___2c3Sl"
};
}, /* 178 */
/***/
function(module, exports, __webpack_require__) {
"use strict";
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function _objectWithoutProperties(obj, keys) {
var target = {};
for (var i in obj) keys.indexOf(i) >= 0 || Object.prototype.hasOwnProperty.call(obj, i) && (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 || "object" != typeof call && "function" != typeof call ? self : call;
}
function _inherits(subClass, superClass) {
if ("function" != typeof superClass && null !== superClass) 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: !1,
writable: !0,
configurable: !0
}
}), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass);
}
Object.defineProperty(exports, "__esModule", {
value: !0
});
var _slicedToArray = function() {
function sliceIterator(arr, i) {
var _arr = [], _n = !0, _d = !1, _e = void 0;
try {
for (var _s, _i = arr[Symbol.iterator](); !(_n = (_s = _i.next()).done) && (_arr.push(_s.value),
!i || _arr.length !== i); _n = !0) ;
} catch (err) {
_d = !0, _e = err;
} finally {
try {
!_n && _i.return && _i.return();
} finally {
if (_d) throw _e;
}
}
return _arr;
}
return function(arr, i) {
if (Array.isArray(arr)) return arr;
if (Symbol.iterator in Object(arr)) return sliceIterator(arr, i);
throw new TypeError("Invalid attempt to destructure non-iterable instance");
};
}(), _extends = Object.assign || function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]);
}
return target;
}, _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0,
"value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps),
Constructor;
};
}(), _react = __webpack_require__(1), _react2 = _interopRequireDefault(_react), _classAutobind = __webpack_require__(161), _classAutobind2 = _interopRequireDefault(_classAutobind), _classnames = __webpack_require__(159), _classnames2 = _interopRequireDefault(_classnames), _Dropdown = __webpack_require__(179), _Dropdown2 = _interopRequireDefault(_Dropdown), Dropdown = function(_Component) {
function Dropdown() {
_classCallCheck(this, Dropdown);
var _this = _possibleConstructorReturn(this, (Dropdown.__proto__ || Object.getPrototypeOf(Dropdown)).apply(this, arguments));
return (0, _classAutobind2.default)(_this), _this;
}
return _inherits(Dropdown, _Component), _createClass(Dropdown, [ {
key: "render",
value: function() {
var _props = this.props, choices = _props.choices, selectedKey = _props.selectedKey, className = _props.className, otherProps = _objectWithoutProperties(_props, [ "choices", "selectedKey", "className" ]);
className = (0, _classnames2.default)(className, _Dropdown2.default.root);
var selectedItem = null == selectedKey ? null : choices.get(selectedKey), selectedValue = selectedItem && selectedItem.label || "";
return _react2.default.createElement("span", {
className: className,
title: selectedValue
}, _react2.default.createElement("select", _extends({}, otherProps, {
value: selectedKey,
onChange: this._onChange
}), this._renderChoices()), _react2.default.createElement("span", {
className: _Dropdown2.default.value
}, selectedValue));
}
}, {
key: "_onChange",
value: function(event) {
var value = event.target.value;
this.props.onChange(value);
}
}, {
key: "_renderChoices",
value: function() {
var choices = this.props.choices, entries = Array.from(choices.entries());
return entries.map(function(_ref) {
var _ref2 = _slicedToArray(_ref, 2), key = _ref2[0], _ref2$ = _ref2[1], label = _ref2$.label, className = _ref2$.className;
return _react2.default.createElement("option", {
key: key,
value: key,
className: className
}, label);
});
}
} ]), Dropdown;
}(_react.Component);
exports.default = Dropdown;
}, /* 179 */
/***/
function(module, exports, __webpack_require__) {
// style-loader: Adds some css to the DOM by adding a <style> tag
// load the styles
var content = __webpack_require__(180);
"string" == typeof content && (content = [ [ module.id, content, "" ] ]);
// add the styles to the DOM
__webpack_require__(165)(content, {
sourceMap: !0
});
content.locals && (module.exports = content.locals);
}, /* 180 */
/***/
function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__(164)(), // imports
// module
exports.push([ module.id, '.Dropdown__root___3ALmx{display:inline-block;position:relative;line-height:22px;vertical-align:top;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.Dropdown__root___3ALmx select{position:relative;z-index:2;display:inline-block;box-sizing:border-box;height:30px;line-height:inherit;font-family:inherit;font-size:inherit;color:inherit;margin:0;padding:0;border:4px solid transparent;border-right-width:10px;border-left-width:5px;background:none transparent;opacity:0;cursor:pointer}.Dropdown__root___3ALmx .Dropdown__value___34Py9{display:block;position:absolute;z-index:1;left:0;top:0;right:0;bottom:0;line-height:23px;border:1px solid #999;border-radius:2px;padding:3px;padding-right:33px;padding-left:12px;white-space:nowrap;text-overflow:ellipsis}.Dropdown__root___3ALmx .Dropdown__value___34Py9:after,.Dropdown__root___3ALmx .Dropdown__value___34Py9:before{display:block;content:"";position:absolute;top:50%;right:10px;width:0;height:0;border:4px solid transparent}.Dropdown__root___3ALmx .Dropdown__value___34Py9:before{margin-top:-10px;border-bottom-color:#555}.Dropdown__root___3ALmx .Dropdown__value___34Py9:after{margin-top:1px;border-top-color:#555}.Dropdown__root___3ALmx select:focus+.Dropdown__value___34Py9{border-color:#66afe9}@media screen and (-webkit-min-device-pixel-ratio:0){.Dropdown__root___3ALmx select{opacity:1;color:inherit;-webkit-appearance:none;border-left-width:12px;border-right-width:35px}.Dropdown__root___3ALmx select+.Dropdown__value___34Py9{color:transparent}.Dropdown__root___3ALmx select:focus+.Dropdown__value___34Py9{border-color:#999}}', "" ]),
// exports
exports.locals = {
root: "Dropdown__root___3ALmx",
value: "Dropdown__value___34Py9"
};
}, /* 181 */
/***/
function(module, exports) {
"use strict";
function getEntityAtOffset(block, offset) {
var entityKey = block.getEntityAt(offset);
if (null == entityKey) return null;
for (var startOffset = offset; startOffset > 0 && block.getEntityAt(startOffset - 1) === entityKey; ) startOffset -= 1;
for (var endOffset = startOffset, blockLength = block.getLength(); endOffset < blockLength && block.getEntityAt(endOffset + 1) === entityKey; ) endOffset += 1;
return {
entityKey: entityKey,
blockKey: block.getKey(),
startOffset: startOffset,
endOffset: endOffset + 1
};
}
function getEntityAtCursor(editorState) {
var selection = editorState.getSelection(), startKey = selection.getStartKey(), startBlock = editorState.getCurrentContent().getBlockForKey(startKey), startOffset = selection.getStartOffset();
if (selection.isCollapsed()) // Get the entity before the cursor (unless the cursor is at the start).
return getEntityAtOffset(startBlock, 0 === startOffset ? startOffset : startOffset - 1);
if (startKey !== selection.getEndKey()) return null;
for (var endOffset = selection.getEndOffset(), startEntityKey = startBlock.getEntityAt(startOffset), i = startOffset; i < endOffset; i++) {
var _entityKey = startBlock.getEntityAt(i);
if (null == _entityKey || _entityKey !== startEntityKey) return null;
}
return {
entityKey: startEntityKey,
blockKey: startBlock.getKey(),
startOffset: startOffset,
endOffset: endOffset
};
}
Object.defineProperty(exports, "__esModule", {
value: !0
}), exports.default = getEntityAtCursor;
}, /* 182 */
/***/
function(module, exports, __webpack_require__) {
"use strict";
function clearEntityForRange(editorState, blockKey, startOffset, endOffset) {
var contentState = editorState.getCurrentContent(), blockMap = contentState.getBlockMap(), block = blockMap.get(blockKey), charList = block.getCharacterList(), newCharList = charList.map(function(char, i) {
return i >= startOffset && i < endOffset ? _draftJs.CharacterMetadata.applyEntity(char, null) : char;
}), newBlock = block.set("characterList", newCharList), newBlockMap = blockMap.set(blockKey, newBlock), newContentState = contentState.set("blockMap", newBlockMap);
return _draftJs.EditorState.push(editorState, newContentState, "apply-entity");
}
Object.defineProperty(exports, "__esModule", {
value: !0
}), exports.default = clearEntityForRange;
var _draftJs = __webpack_require__(2);
}, /* 183 */
/***/
function(module, exports, __webpack_require__) {
// style-loader: Adds some css to the DOM by adding a <style> tag
// load the styles
var content = __webpack_require__(184);
"string" == typeof content && (content = [ [ module.id, content, "" ] ]);
// add the styles to the DOM
__webpack_require__(165)(content, {
sourceMap: !0
});
content.locals && (module.exports = content.locals);
}, /* 184 */
/***/
function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__(164)(), // imports
// module
exports.push([ module.id, ".EditorToolbar__root___3_Aqz{font-family:Helvetica,sans-serif;font-size:14px;margin:0 10px;padding:10px 0 5px;border-bottom:1px solid #ddd;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}", "" ]),
// exports
exports.locals = {
root: "EditorToolbar__root___3_Aqz"
};
}, /* 185 */
/***/
function(module, exports, __webpack_require__) {
"use strict";
function _defineProperty(obj, key, value) {
return key in obj ? Object.defineProperty(obj, key, {
value: value,
enumerable: !0,
configurable: !0,
writable: !0
}) : obj[key] = value, obj;
}
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
}
function _toString(editorState, format, options) {
var contentState = editorState.getCurrentContent();
switch (format) {
case "html":
return (0, _draftJsExportHtml.stateToHTML)(contentState, options);
case "markdown":
return (0, _draftJsExportMarkdown.stateToMarkdown)(contentState);
case "raw":
return JSON.stringify((0, _draftJs.convertToRaw)(contentState));
default:
throw new Error("Format not supported: " + format);
}
}
function fromString(markup, format, options) {
switch (format) {
case "html":
return (0, _draftJsImportHtml.stateFromHTML)(markup, options);
case "markdown":
return (0, _draftJsImportMarkdown.stateFromMarkdown)(markup);
case "raw":
return (0, _draftJs.convertFromRaw)(JSON.parse(markup));
default:
throw new Error("Format not supported: " + format);
}
}
Object.defineProperty(exports, "__esModule", {
value: !0
});
var _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0,
"value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps),
Constructor;
};
}(), _draftJs = __webpack_require__(2), _draftJsExportHtml = __webpack_require__(186), _draftJsImportHtml = __webpack_require__(192), _draftJsExportMarkdown = __webpack_require__(199), _draftJsImportMarkdown = __webpack_require__(201), EditorValue = function() {
function EditorValue(editorState) {
var cache = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
_classCallCheck(this, EditorValue), this._cache = cache, this._editorState = editorState;
}
return _createClass(EditorValue, [ {
key: "getEditorState",
value: function() {
return this._editorState;
}
}, {
key: "setEditorState",
value: function(editorState) {
return this._editorState === editorState ? this : new EditorValue(editorState);
}
}, {
key: "toString",
value: function(format, options) {
var fromCache = this._cache[format];
return null != fromCache ? fromCache : this._cache[format] = _toString(this.getEditorState(), format, options);
}
}, {
key: "setContentFromString",
value: function(markup, format, options) {
var editorState = _draftJs.EditorState.push(this._editorState, fromString(markup, format, options), "secondary-paste");
return new EditorValue(editorState, _defineProperty({}, format, markup));
}
} ], [ {
key: "createEmpty",
value: function(decorator) {
var editorState = _draftJs.EditorState.createEmpty(decorator);
return new EditorValue(editorState);
}
}, {
key: "createFromState",
value: function(editorState) {
return new EditorValue(editorState);
}
}, {
key: "createFromString",
value: function(markup, format, decorator, options) {
var contentState = fromString(markup, format, options), editorState = _draftJs.EditorState.createWithContent(contentState, decorator);
return new EditorValue(editorState, _defineProperty({}, format, markup));
}
} ]), EditorValue;
}();
exports.default = EditorValue;
}, /* 186 */
/***/
function(module, exports, __webpack_require__) {
"use strict";
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
Object.defineProperty(exports, "__esModule", {
value: !0
});
var _stateToHTML = __webpack_require__(187);
Object.defineProperty(exports, "stateToHTML", {
enumerable: !0,
get: function() {
return _interopRequireDefault(_stateToHTML).default;
}
});
}, /* 187 */
/***/
function(module, exports, __webpack_require__) {
"use strict";
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 _defineProperty(obj, key, value) {
return key in obj ? Object.defineProperty(obj, key, {
value: value,
enumerable: !0,
configurable: !0,
writable: !0
}) : obj[key] = value, obj;
}
// The reason this returns an array is because a single block might get wrapped
// in two tags.
function getTags(blockType) {
switch (blockType) {
case _draftJsUtils.BLOCK_TYPE.HEADER_ONE:
return [ "h1" ];
case _draftJsUtils.BLOCK_TYPE.HEADER_TWO:
return [ "h2" ];
case _draftJsUtils.BLOCK_TYPE.HEADER_THREE:
return [ "h3" ];
case _draftJsUtils.BLOCK_TYPE.HEADER_FOUR:
return [ "h4" ];
case _draftJsUtils.BLOCK_TYPE.HEADER_FIVE:
return [ "h5" ];
case _draftJsUtils.BLOCK_TYPE.HEADER_SIX:
return [ "h6" ];
case _draftJsUtils.BLOCK_TYPE.UNORDERED_LIST_ITEM:
case _draftJsUtils.BLOCK_TYPE.ORDERED_LIST_ITEM:
return [ "li" ];
case _draftJsUtils.BLOCK_TYPE.BLOCKQUOTE:
return [ "blockquote" ];
case _draftJsUtils.BLOCK_TYPE.CODE:
return [ "pre", "code" ];
case _draftJsUtils.BLOCK_TYPE.ATOMIC:
return [ "figure" ];
default:
return [ "p" ];
}
}
function getWrapperTag(blockType) {
switch (blockType) {
case _draftJsUtils.BLOCK_TYPE.UNORDERED_LIST_ITEM:
return "ul";
case _draftJsUtils.BLOCK_TYPE.ORDERED_LIST_ITEM:
return "ol";
default:
return null;
}
}
function stringifyAttrs(attrs) {
if (null == attrs) return "";
var parts = [], _iteratorNormalCompletion6 = !0, _didIteratorError6 = !1, _iteratorError6 = void 0;
try {
for (var _step6, _iterator6 = Object.keys(attrs)[Symbol.iterator](); !(_iteratorNormalCompletion6 = (_step6 = _iterator6.next()).done); _iteratorNormalCompletion6 = !0) {
var name = _step6.value, value = attrs[name];
null != value && parts.push(" " + name + '="' + encodeAttr(value + "") + '"');
}
} catch (err) {
_didIteratorError6 = !0, _iteratorError6 = err;
} finally {
try {
!_iteratorNormalCompletion6 && _iterator6.return && _iterator6.return();
} finally {
if (_didIteratorError6) throw _iteratorError6;
}
}
return parts.join("");
}
function canHaveDepth(blockType) {
switch (blockType) {
case _draftJsUtils.BLOCK_TYPE.UNORDERED_LIST_ITEM:
case _draftJsUtils.BLOCK_TYPE.ORDERED_LIST_ITEM:
return !0;
default:
return !1;
}
}
function encodeContent(text) {
return text.split("&").join("&").split("<").join("<").split(">").join(">").split(" ").join(" ").split("\n").join(BREAK + "\n");
}
function encodeAttr(text) {
return text.split("&").join("&").split("<").join("<").split(">").join(">").split('"').join(""");
}
function stateToHTML(content, options) {
return new MarkupGenerator(content, options).generate();
}
Object.defineProperty(exports, "__esModule", {
value: !0
});
var _DEFAULT_STYLE_MAP, _ENTITY_ATTR_MAP, _DATA_TO_ATTR, _extends = Object.assign || function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]);
}
return target;
}, _slicedToArray = function() {
function sliceIterator(arr, i) {
var _arr = [], _n = !0, _d = !1, _e = void 0;
try {
for (var _s, _i = arr[Symbol.iterator](); !(_n = (_s = _i.next()).done) && (_arr.push(_s.value),
!i || _arr.length !== i); _n = !0) ;
} catch (err) {
_d = !0, _e = err;
} finally {
try {
!_n && _i.return && _i.return();
} finally {
if (_d) throw _e;
}
}
return _arr;
}
return function(arr, i) {
if (Array.isArray(arr)) return arr;
if (Symbol.iterator in Object(arr)) return sliceIterator(arr, i);
throw new TypeError("Invalid attempt to destructure non-iterable instance");
};
}(), _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0,
"value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps),
Constructor;
};
}();
exports.default = stateToHTML;
var _combineOrderedStyles3 = __webpack_require__(188), _combineOrderedStyles4 = _interopRequireDefault(_combineOrderedStyles3), _normalizeAttributes = __webpack_require__(189), _normalizeAttributes2 = _interopRequireDefault(_normalizeAttributes), _styleToCSS = __webpack_require__(190), _styleToCSS2 = _interopRequireDefault(_styleToCSS), _draftJs = __webpack_require__(2), _draftJsUtils = __webpack_require__(147), BOLD = _draftJsUtils.INLINE_STYLE.BOLD, CODE = _draftJsUtils.INLINE_STYLE.CODE, ITALIC = _draftJsUtils.INLINE_STYLE.ITALIC, STRIKETHROUGH = _draftJsUtils.INLINE_STYLE.STRIKETHROUGH, UNDERLINE = _draftJsUtils.INLINE_STYLE.UNDERLINE, INDENT = " ", BREAK = "<br>", DATA_ATTRIBUTE = /^data-([a-z0-9-]+)$/, DEFAULT_STYLE_MAP = (_DEFAULT_STYLE_MAP = {},
_defineProperty(_DEFAULT_STYLE_MAP, BOLD, {
element: "strong"
}), _defineProperty(_DEFAULT_STYLE_MAP, CODE, {
element: "code"
}), _defineProperty(_DEFAULT_STYLE_MAP, ITALIC, {
element: "em"
}), _defineProperty(_DEFAULT_STYLE_MAP, STRIKETHROUGH, {
element: "del"
}), _defineProperty(_DEFAULT_STYLE_MAP, UNDERLINE, {
element: "ins"
}), _DEFAULT_STYLE_MAP), DEFAULT_STYLE_ORDER = [ BOLD, ITALIC, UNDERLINE, STRIKETHROUGH, CODE ], ENTITY_ATTR_MAP = (_ENTITY_ATTR_MAP = {},
_defineProperty(_ENTITY_ATTR_MAP, _draftJsUtils.ENTITY_TYPE.LINK, {
url: "href",
rel: "rel",
target: "target",
title: "title",
className: "class"
}), _defineProperty(_ENTITY_ATTR_MAP, _draftJsUtils.ENTITY_TYPE.IMAGE, {
src: "src",
height: "height",
width: "width",
alt: "alt",
className: "class"
}), _ENTITY_ATTR_MAP), DATA_TO_ATTR = (_DATA_TO_ATTR = {}, _defineProperty(_DATA_TO_ATTR, _draftJsUtils.ENTITY_TYPE.LINK, function(entityType, entity) {
var attrMap = ENTITY_ATTR_MAP.hasOwnProperty(entityType) ? ENTITY_ATTR_MAP[entityType] : {}, data = entity.getData(), attrs = {}, _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
try {
for (var _step, _iterator = Object.keys(data)[Symbol.iterator](); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
var dataKey = _step.value, dataValue = data[dataKey];
if (attrMap.hasOwnProperty(dataKey)) {
var attrKey = attrMap[dataKey];
attrs[attrKey] = dataValue;
} else DATA_ATTRIBUTE.test(dataKey) && (attrs[dataKey] = dataValue);
}
} catch (err) {
_didIteratorError = !0, _iteratorError = err;
} finally {
try {
!_iteratorNormalCompletion && _iterator.return && _iterator.return();
} finally {
if (_didIteratorError) throw _iteratorError;
}
}
return attrs;
}), _defineProperty(_DATA_TO_ATTR, _draftJsUtils.ENTITY_TYPE.IMAGE, function(entityType, entity) {
var attrMap = ENTITY_ATTR_MAP.hasOwnProperty(entityType) ? ENTITY_ATTR_MAP[entityType] : {}, data = entity.getData(), attrs = {}, _iteratorNormalCompletion2 = !0, _didIteratorError2 = !1, _iteratorError2 = void 0;
try {
for (var _step2, _iterator2 = Object.keys(data)[Symbol.iterator](); !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = !0) {
var dataKey = _step2.value, dataValue = data[dataKey];
if (attrMap.hasOwnProperty(dataKey)) {
var attrKey = attrMap[dataKey];
attrs[attrKey] = dataValue;
} else DATA_ATTRIBUTE.test(dataKey) && (attrs[dataKey] = dataValue);
}
} catch (err) {
_didIteratorError2 = !0, _iteratorError2 = err;
} finally {
try {
!_iteratorNormalCompletion2 && _iterator2.return && _iterator2.return();
} finally {
if (_didIteratorError2) throw _iteratorError2;
}
}
return attrs;
}), _DATA_TO_ATTR), MarkupGenerator = function() {
// These are related to state.
function MarkupGenerator(contentState, options) {
_classCallCheck(this, MarkupGenerator), null == options && (options = {}), this.contentState = contentState,
this.options = options;
var _combineOrderedStyles = (0, _combineOrderedStyles4.default)(options.inlineStyles, [ DEFAULT_STYLE_MAP, DEFAULT_STYLE_ORDER ]), _combineOrderedStyles2 = _slicedToArray(_combineOrderedStyles, 2), inlineStyles = _combineOrderedStyles2[0], styleOrder = _combineOrderedStyles2[1];
this.inlineStyles = inlineStyles, this.styleOrder = styleOrder;
}
// These are related to user-defined options.
return _createClass(MarkupGenerator, [ {
key: "generate",
value: function() {
for (this.output = [], this.blocks = this.contentState.getBlocksAsArray(), this.totalBlocks = this.blocks.length,
this.currentBlock = 0, this.indentLevel = 0, this.wrapperTag = null; this.currentBlock < this.totalBlocks; ) this.processBlock();
return this.closeWrapperTag(), this.output.join("").trim();
}
}, {
key: "processBlock",
value: function() {
var blockRenderers = this.options.blockRenderers, block = this.blocks[this.currentBlock], blockType = block.getType(), newWrapperTag = getWrapperTag(blockType);
this.wrapperTag !== newWrapperTag && (this.wrapperTag && this.closeWrapperTag(),
newWrapperTag && this.openWrapperTag(newWrapperTag)), this.indent();
// Allow blocks to be rendered using a custom renderer.
var customRenderer = null != blockRenderers && blockRenderers.hasOwnProperty(blockType) ? blockRenderers[blockType] : null, customRendererOutput = customRenderer ? customRenderer(block) : null;
// Renderer can return null, which will cause processing to continue as normal.
if (null != customRendererOutput) return this.output.push(customRendererOutput),
this.output.push("\n"), void (this.currentBlock += 1);
this.writeStartTag(block), this.output.push(this.renderBlockContent(block));
// Look ahead and see if we will nest list.
var nextBlock = this.getNextBlock();
if (canHaveDepth(blockType) && nextBlock && nextBlock.getDepth() === block.getDepth() + 1) {
this.output.push("\n");
// This is a litle hacky: temporarily stash our current wrapperTag and
// render child list(s).
var thisWrapperTag = this.wrapperTag;
this.wrapperTag = null, this.indentLevel += 1, this.currentBlock += 1, this.processBlocksAtDepth(nextBlock.getDepth()),
this.wrapperTag = thisWrapperTag, this.indentLevel -= 1, this.indent();
} else this.currentBlock += 1;
this.writeEndTag(block);
}
}, {
key: "processBlocksAtDepth",
value: function(depth) {
for (var block = this.blocks[this.currentBlock]; block && block.getDepth() === depth; ) this.processBlock(),
block = this.blocks[this.currentBlock];
this.closeWrapperTag();
}
}, {
key: "getNextBlock",
value: function() {
return this.blocks[this.currentBlock + 1];
}
}, {
key: "writeStartTag",
value: function(block) {
var tags = getTags(block.getType()), attrString = void 0;
if (this.options.blockStyleFn) {
var _ref = this.options.blockStyleFn(block) || {}, _attributes = _ref.attributes, _style = _ref.style;
if (// Normalize `className` -> `class`, etc.
_attributes = (0, _normalizeAttributes2.default)(_attributes), null != _style) {
var styleAttr = (0, _styleToCSS2.default)(_style);
_attributes = null == _attributes ? {
style: styleAttr
} : _extends({}, _attributes, {
style: styleAttr
});
}
attrString = stringifyAttrs(_attributes);
} else attrString = "";
var _iteratorNormalCompletion3 = !0, _didIteratorError3 = !1, _iteratorError3 = void 0;
try {
for (var _step3, _iterator3 = tags[Symbol.iterator](); !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = !0) {
var tag = _step3.value;
this.output.push("<" + tag + attrString + ">");
}
} catch (err) {
_didIteratorError3 = !0, _iteratorError3 = err;
} finally {
try {
!_iteratorNormalCompletion3 && _iterator3.return && _iterator3.return();
} finally {
if (_didIteratorError3) throw _iteratorError3;
}
}
}
}, {
key: "writeEndTag",
value: function(block) {
var tags = getTags(block.getType());
if (1 === tags.length) this.output.push("</" + tags[0] + ">\n"); else {
var output = [], _iteratorNormalCompletion4 = !0, _didIteratorError4 = !1, _iteratorError4 = void 0;
try {
for (var _step4, _iterator4 = tags[Symbol.iterator](); !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = !0) {
var tag = _step4.value;
output.unshift("</" + tag + ">");
}
} catch (err) {
_didIteratorError4 = !0, _iteratorError4 = err;
} finally {
try {
!_iteratorNormalCompletion4 && _iterator4.return && _iterator4.return();
} finally {
if (_didIteratorError4) throw _iteratorError4;
}
}
this.output.push(output.join("") + "\n");
}
}
}, {
key: "openWrapperTag",
value: function(wrapperTag) {
this.wrapperTag = wrapperTag, this.indent(), this.output.push("<" + wrapperTag + ">\n"),
this.indentLevel += 1;
}
}, {
key: "closeWrapperTag",
value: function() {
var wrapperTag = this.wrapperTag;
wrapperTag && (this.indentLevel -= 1, this.indent(), this.output.push("</" + wrapperTag + ">\n"),
this.wrapperTag = null);
}
}, {
key: "indent",
value: function() {
this.output.push(INDENT.repeat(this.indentLevel));
}
}, {
key: "renderBlockContent",
value: function(block) {
var _this = this, blockType = block.getType(), text = block.getText();
if ("" === text) // Prevent element collapse if completely empty.
return BREAK;
text = this.preserveWhitespace(text);
var charMetaList = block.getCharacterList(), entityPieces = (0, _draftJsUtils.getEntityRanges)(text, charMetaList);
return entityPieces.map(function(_ref2) {
var _ref3 = _slicedToArray(_ref2, 2), entityKey = _ref3[0], stylePieces = _ref3[1], content = stylePieces.map(function(_ref4) {
var _ref5 = _slicedToArray(_ref4, 2), text = _ref5[0], styleSet = _ref5[1], content = encodeContent(text), _iteratorNormalCompletion5 = !0, _didIteratorError5 = !1, _iteratorError5 = void 0;
try {
for (var _step5, _iterator5 = _this.styleOrder[Symbol.iterator](); !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = !0) {
var _styleName = _step5.value;
// If our block type is CODE then don't wrap inline code elements.
if ((_styleName !== CODE || blockType !== _draftJsUtils.BLOCK_TYPE.CODE) && styleSet.has(_styleName)) {
var _inlineStyles$_styleN = _this.inlineStyles[_styleName], _element = _inlineStyles$_styleN.element, _attributes2 = _inlineStyles$_styleN.attributes, _style2 = _inlineStyles$_styleN.style;
if (null == _element && (_element = "span"), // Normalize `className` -> `class`, etc.
_attributes2 = (0, _normalizeAttributes2.default)(_attributes2), null != _style2) {
var styleAttr = (0, _styleToCSS2.default)(_style2);
_attributes2 = null == _attributes2 ? {
style: styleAttr
} : _extends({}, _attributes2, {
style: styleAttr
});
}
var attrString = stringifyAttrs(_attributes2);
content = "<" + _element + attrString + ">" + content + "</" + _element + ">";
}
}
} catch (err) {
_didIteratorError5 = !0, _iteratorError5 = err;
} finally {
try {
!_iteratorNormalCompletion5 && _iterator5.return && _iterator5.return();
} finally {
if (_didIteratorError5) throw _iteratorError5;
}
}
return content;
}).join(""), entity = entityKey ? _draftJs.Entity.get(entityKey) : null, entityType = null == entity ? null : entity.getType().toUpperCase();
if (null != entityType && entityType === _draftJsUtils.ENTITY_TYPE.LINK) {
var attrs = DATA_TO_ATTR.hasOwnProperty(entityType) ? DATA_TO_ATTR[entityType](entityType, entity) : null, attrString = stringifyAttrs(attrs);
return "<a" + attrString + ">" + content + "</a>";
}
if (null != entityType && entityType === _draftJsUtils.ENTITY_TYPE.IMAGE) {
var _attrs = DATA_TO_ATTR.hasOwnProperty(entityType) ? DATA_TO_ATTR[entityType](entityType, entity) : null, _attrString = stringifyAttrs(_attrs);
return "<img" + _attrString + "/>";
}
return content;
}).join("");
}
}, {
key: "preserveWhitespace",
value: function(text) {
for (var length = text.length, newText = new Array(length), i = 0; i < length; i++) " " !== text[i] || 0 !== i && i !== length - 1 && " " !== text[i - 1] ? newText[i] = text[i] : newText[i] = " ";
return newText.join("");
}
} ]), MarkupGenerator;
}();
}, /* 188 */
/***/
function(module, exports) {
"use strict";
function _toConsumableArray(arr) {
if (Array.isArray(arr)) {
for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
return arr2;
}
return Array.from(arr);
}
function combineOrderedStyles(customMap, defaults) {
if (null == customMap) return defaults;
var _defaults = _slicedToArray(defaults, 2), defaultStyleMap = _defaults[0], defaultStyleOrder = _defaults[1], styleMap = _extends({}, defaultStyleMap), styleOrder = [].concat(_toConsumableArray(defaultStyleOrder)), _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
try {
for (var _step, _iterator = Object.keys(customMap)[Symbol.iterator](); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
var _styleName = _step.value;
if (defaultStyleMap.hasOwnProperty(_styleName)) {
var defaultStyles = defaultStyleMap[_styleName];
styleMap[_styleName] = _extends({}, defaultStyles, customMap[_styleName]);
} else styleMap[_styleName] = customMap[_styleName], styleOrder.push(_styleName);
}
} catch (err) {
_didIteratorError = !0, _iteratorError = err;
} finally {
try {
!_iteratorNormalCompletion && _iterator.return && _iterator.return();
} finally {
if (_didIteratorError) throw _iteratorError;
}
}
return [ styleMap, styleOrder ];
}
Object.defineProperty(exports, "__esModule", {
value: !0
});
var _extends = Object.assign || function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]);
}
return target;
}, _slicedToArray = function() {
function sliceIterator(arr, i) {
var _arr = [], _n = !0, _d = !1, _e = void 0;
try {
for (var _s, _i = arr[Symbol.iterator](); !(_n = (_s = _i.next()).done) && (_arr.push(_s.value),
!i || _arr.length !== i); _n = !0) ;
} catch (err) {
_d = !0, _e = err;
} finally {
try {
!_n && _i.return && _i.return();
} finally {
if (_d) throw _e;
}
}
return _arr;
}
return function(arr, i) {
if (Array.isArray(arr)) return arr;
if (Symbol.iterator in Object(arr)) return sliceIterator(arr, i);
throw new TypeError("Invalid attempt to destructure non-iterable instance");
};
}();
exports.default = combineOrderedStyles;
}, /* 189 */
/***/
function(module, exports) {
"use strict";
function normalizeAttributes(attributes) {
if (null == attributes) return attributes;
var normalized = {}, didNormalize = !1, _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
try {
for (var _step, _iterator = Object.keys(attributes)[Symbol.iterator](); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
var name = _step.value, newName = name;
ATTR_NAME_MAP.hasOwnProperty(name) && (newName = ATTR_NAME_MAP[name], didNormalize = !0),
normalized[newName] = attributes[name];
}
} catch (err) {
_didIteratorError = !0, _iteratorError = err;
} finally {
try {
!_iteratorNormalCompletion && _iterator.return && _iterator.return();
} finally {
if (_didIteratorError) throw _iteratorError;
}
}
return didNormalize ? normalized : attributes;
}
Object.defineProperty(exports, "__esModule", {
value: !0
});
// Lifted from: https://github.com/facebook/react/blob/master/src/renderers/dom/shared/HTMLDOMPropertyConfig.js
var ATTR_NAME_MAP = {
acceptCharset: "accept-charset",
className: "class",
htmlFor: "for",
httpEquiv: "http-equiv"
};
exports.default = normalizeAttributes;
}, /* 190 */
/***/
function(module, exports, __webpack_require__) {
"use strict";
// Lifted from: https://github.com/facebook/react/blob/master/src/renderers/dom/shared/CSSPropertyOperations.js
function processStyleName(name) {
return name.replace(UPPERCASE_PATTERN, "-$1").toLowerCase().replace(VENDOR_PREFIX, "-$1-");
}
// Lifted from: https://github.com/facebook/react/blob/master/src/renderers/dom/shared/dangerousStyleValue.js
function processStyleValue(name, value) {
var isNumeric = void 0;
return "string" == typeof value ? isNumeric = NUMERIC_STRING.test(value) : (isNumeric = !0,
value = String(value)), isNumeric && "0" !== value && _CSSProperty.isUnitlessNumber[name] !== !0 ? value + "px" : value;
}
function styleToCSS(styleDescr) {
return Object.keys(styleDescr).map(function(name) {
var styleValue = processStyleValue(name, styleDescr[name]), styleName = processStyleName(name);
return styleName + ": " + styleValue;
}).join("; ");
}
Object.defineProperty(exports, "__esModule", {
value: !0
});
var _CSSProperty = __webpack_require__(191), VENDOR_PREFIX = /^(moz|ms|o|webkit)-/, NUMERIC_STRING = /^\d+$/, UPPERCASE_PATTERN = /([A-Z])/g;
exports.default = styleToCSS;
}, /* 191 */
/***/
function(module, exports) {
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule CSSProperty
*/
"use strict";
/**
* @param {string} prefix vendor-specific prefix, eg: Webkit
* @param {string} key style name, eg: transitionDuration
* @return {string} style name prefixed with `prefix`, properly camelCased, eg:
* WebkitTransitionDuration
*/
function prefixKey(prefix, key) {
return prefix + key.charAt(0).toUpperCase() + key.substring(1);
}
/**
* CSS properties which accept numbers but are not in units of "px".
*/
var isUnitlessNumber = {
animationIterationCount: !0,
borderImageOutset: !0,
borderImageSlice: !0,
borderImageWidth: !0,
boxFlex: !0,
boxFlexGroup: !0,
boxOrdinalGroup: !0,
columnCount: !0,
flex: !0,
flexGrow: !0,
flexPositive: !0,
flexShrink: !0,
flexNegative: !0,
flexOrder: !0,
gridRow: !0,
gridColumn: !0,
fontWeight: !0,
lineClamp: !0,
lineHeight: !0,
opacity: !0,
order: !0,
orphans: !0,
tabSize: !0,
widows: !0,
zIndex: !0,
zoom: !0,
// SVG-related properties
fillOpacity: !0,
floodOpacity: !0,
stopOpacity: !0,
strokeDasharray: !0,
strokeDashoffset: !0,
strokeMiterlimit: !0,
strokeOpacity: !0,
strokeWidth: !0
}, prefixes = [ "Webkit", "ms", "Moz", "O" ];
// Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an
// infinite loop, because it iterates over the newly added props too.
Object.keys(isUnitlessNumber).forEach(function(prop) {
prefixes.forEach(function(prefix) {
isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];
});
});
/**
* Most style properties can be unset by doing .style[prop] = '' but IE8
* doesn't like doing that with shorthand properties so for the properties that
* IE8 breaks on, which are listed here, we instead unset each of the
* individual properties. See http://bugs.jquery.com/ticket/12385.
* The 4-value 'clock' properties like margin, padding, border-width seem to
* behave without any problems. Curiously, list-style works too without any
* special prodding.
*/
var shorthandPropertyExpansions = {
background: {
backgroundAttachment: !0,
backgroundColor: !0,
backgroundImage: !0,
backgroundPositionX: !0,
backgroundPositionY: !0,
backgroundRepeat: !0
},
backgroundPosition: {
backgroundPositionX: !0,
backgroundPositionY: !0
},
border: {
borderWidth: !0,
borderStyle: !0,
borderColor: !0
},
borderBottom: {
borderBottomWidth: !0,
borderBottomStyle: !0,
borderBottomColor: !0
},
borderLeft: {
borderLeftWidth: !0,
borderLeftStyle: !0,
borderLeftColor: !0
},
borderRight: {
borderRightWidth: !0,
borderRightStyle: !0,
borderRightColor: !0
},
borderTop: {
borderTopWidth: !0,
borderTopStyle: !0,
borderTopColor: !0
},
font: {
fontStyle: !0,
fontVariant: !0,
fontWeight: !0,
fontSize: !0,
lineHeight: !0,
fontFamily: !0
},
outline: {
outlineWidth: !0,
outlineStyle: !0,
outlineColor: !0
}
}, CSSProperty = {
isUnitlessNumber: isUnitlessNumber,
shorthandPropertyExpansions: shorthandPropertyExpansions
};
module.exports = CSSProperty;
}, /* 192 */
/***/
function(module, exports, __webpack_require__) {
"use strict";
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
Object.defineProperty(exports, "__esModule", {
value: !0
});
var _stateFromHTML = __webpack_require__(193);
Object.defineProperty(exports, "stateFromHTML", {
enumerable: !0,
get: function() {
return _interopRequireDefault(_stateFromHTML).default;
}
});
}, /* 193 */
/***/
function(module, exports, __webpack_require__) {
"use strict";
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function stateFromHTML(html, options) {
var parser = null == options || null == options.parser ? _parseHTML2.default : options.parser, element = parser(html);
return (0, _draftJsImportElement.stateFromElement)(element, options);
}
Object.defineProperty(exports, "__esModule", {
value: !0
}), exports.default = stateFromHTML;
var _draftJsImportElement = __webpack_require__(194), _parseHTML = __webpack_require__(198), _parseHTML2 = _interopRequireDefault(_parseHTML);
}, /* 194 */
/***/
function(module, exports, __webpack_require__) {
"use strict";
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
Object.defineProperty(exports, "__esModule", {
value: !0
});
var _stateFromElement = __webpack_require__(195);
Object.defineProperty(exports, "stateFromElement", {
enumerable: !0,
get: function() {
return _interopRequireDefault(_stateFromElement).default;
}
});
}, /* 195 */
/***/
function(module, exports, __webpack_require__) {
"use strict";
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 trimLeadingNewline(text, characterMeta) {
return "\n" === text.charAt(0) && (text = text.slice(1), characterMeta = characterMeta.slice(1)),
{
text: text,
characterMeta: characterMeta
};
}
function trimLeadingSpace(text, characterMeta) {
for (;" " === text.charAt(0); ) text = text.slice(1), characterMeta = characterMeta.slice(1);
return {
text: text,
characterMeta: characterMeta
};
}
function trimTrailingSpace(text, characterMeta) {
for (;" " === text.slice(-1); ) text = text.slice(0, -1), characterMeta = characterMeta.slice(0, -1);
return {
text: text,
characterMeta: characterMeta
};
}
function collapseWhiteSpace(text, characterMeta) {
text = text.replace(/[ \t\n]/g, " ");
var _trimLeadingSpace = trimLeadingSpace(text, characterMeta);
text = _trimLeadingSpace.text, characterMeta = _trimLeadingSpace.characterMeta;
var _trimTrailingSpace = trimTrailingSpace(text, characterMeta);
text = _trimTrailingSpace.text, characterMeta = _trimTrailingSpace.characterMeta;
for (var i = text.length; i--; ) " " === text.charAt(i) && " " === text.charAt(i - 1) && (text = text.slice(0, i) + text.slice(i + 1),
characterMeta = characterMeta.slice(0, i).concat(characterMeta.slice(i + 1)));
// There could still be one space on either side of a softbreak.
var _replaceTextWithMeta = (0, _replaceTextWithMeta4.default)({
text: text,
characterMeta: characterMeta
}, SOFT_BREAK_PLACEHOLDER + " ", SOFT_BREAK_PLACEHOLDER);
text = _replaceTextWithMeta.text, characterMeta = _replaceTextWithMeta.characterMeta;
var _replaceTextWithMeta2 = (0, _replaceTextWithMeta4.default)({
text: text,
characterMeta: characterMeta
}, " " + SOFT_BREAK_PLACEHOLDER, SOFT_BREAK_PLACEHOLDER);
return text = _replaceTextWithMeta2.text, characterMeta = _replaceTextWithMeta2.characterMeta,
{
text: text,
characterMeta: characterMeta
};
}
function canHaveDepth(blockType) {
switch (blockType) {
case _draftJsUtils.BLOCK_TYPE.UNORDERED_LIST_ITEM:
case _draftJsUtils.BLOCK_TYPE.ORDERED_LIST_ITEM:
return !0;
default:
return !1;
}
}
function concatFragments(fragments) {
var text = "", characterMeta = (0, _immutable.Seq)();
return fragments.forEach(function(textFragment) {
text += textFragment.text, characterMeta = characterMeta.concat(textFragment.characterMeta);
}), {
text: text,
characterMeta: characterMeta
};
}
function addStyleFromTagName(styleSet, tagName, elementStyles) {
switch (tagName) {
case "b":
case "strong":
return styleSet.add(_draftJsUtils.INLINE_STYLE.BOLD);
case "i":
case "em":
return styleSet.add(_draftJsUtils.INLINE_STYLE.ITALIC);
case "ins":
return styleSet.add(_draftJsUtils.INLINE_STYLE.UNDERLINE);
case "code":
return styleSet.add(_draftJsUtils.INLINE_STYLE.CODE);
case "del":
return styleSet.add(_draftJsUtils.INLINE_STYLE.STRIKETHROUGH);
default:
// Allow custom styles to be provided.
// Allow custom styles to be provided.
return elementStyles && elementStyles[tagName] ? styleSet.add(elementStyles[tagName]) : styleSet;
}
}
function stateFromElement(element, options) {
var blocks = new BlockGenerator(options).process(element);
return _draftJs.ContentState.createFromBlockArray(blocks);
}
Object.defineProperty(exports, "__esModule", {
value: !0
});
var _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0,
"value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps),
Constructor;
};
}();
exports.default = stateFromElement;
var _replaceTextWithMeta3 = __webpack_require__(196), _replaceTextWithMeta4 = _interopRequireDefault(_replaceTextWithMeta3), _draftJs = __webpack_require__(2), _immutable = __webpack_require__(150), _draftJsUtils = __webpack_require__(147), _syntheticDom = __webpack_require__(197), NO_STYLE = (0,
_immutable.OrderedSet)(), NO_ENTITY = null, EMPTY_BLOCK = new _draftJs.ContentBlock({
key: (0, _draftJs.genKey)(),
text: "",
type: _draftJsUtils.BLOCK_TYPE.UNSTYLED,
characterList: (0, _immutable.List)(),
depth: 0
}), LINE_BREAKS = /(\r\n|\r|\n)/g, SOFT_BREAK_PLACEHOLDER = "\r", ZERO_WIDTH_SPACE = "", DATA_ATTRIBUTE = /^data-([a-z0-9-]+)$/, ELEM_ATTR_MAP = {
a: {
href: "url",
rel: "rel",
target: "target",
title: "title"
},
img: {
src: "src",
alt: "alt"
}
}, getEntityData = function(tagName, element) {
var data = {};
if (ELEM_ATTR_MAP.hasOwnProperty(tagName)) for (var attrMap = ELEM_ATTR_MAP[tagName], i = 0; i < element.attributes.length; i++) {
var _element$attributes$i = element.attributes[i], name = _element$attributes$i.name, value = _element$attributes$i.value;
if (null != value) if (attrMap.hasOwnProperty(name)) {
var newName = attrMap[name];
data[newName] = value;
} else DATA_ATTRIBUTE.test(name) && (data[name] = value);
}
return data;
}, ELEM_TO_ENTITY = {
a: function(tagName, element) {
var data = getEntityData(tagName, element);
// Don't add `<a>` elements with no href.
if (null != data.url) return _draftJs.Entity.create(_draftJsUtils.ENTITY_TYPE.LINK, "MUTABLE", data);
},
img: function(tagName, element) {
var data = getEntityData(tagName, element);
// Don't add `<img>` elements with no src.
if (null != data.src) return _draftJs.Entity.create(_draftJsUtils.ENTITY_TYPE.IMAGE, "MUTABLE", data);
}
}, INLINE_ELEMENTS = {
a: 1,
abbr: 1,
area: 1,
audio: 1,
b: 1,
bdi: 1,
bdo: 1,
br: 1,
button: 1,
canvas: 1,
cite: 1,
code: 1,
command: 1,
datalist: 1,
del: 1,
dfn: 1,
em: 1,
embed: 1,
i: 1,
iframe: 1,
img: 1,
input: 1,
ins: 1,
kbd: 1,
keygen: 1,
label: 1,
map: 1,
mark: 1,
meter: 1,
noscript: 1,
object: 1,
output: 1,
progress: 1,
q: 1,
ruby: 1,
s: 1,
samp: 1,
script: 1,
select: 1,
small: 1,
span: 1,
strong: 1,
sub: 1,
sup: 1,
textarea: 1,
time: 1,
u: 1,
var: 1,
video: 1,
wbr: 1,
acronym: 1,
applet: 1,
basefont: 1,
big: 1,
font: 1,
isindex: 1,
strike: 1,
style: 1,
tt: 1
}, SPECIAL_ELEMENTS = {
area: 1,
base: 1,
br: 1,
col: 1,
colgroup: 1,
command: 1,
dl: 1,
embed: 1,
head: 1,
hgroup: 1,
hr: 1,
iframe: 1,
img: 1,
input: 1,
keygen: 1,
link: 1,
meta: 1,
ol: 1,
optgroup: 1,
option: 1,
param: 1,
script: 1,
select: 1,
source: 1,
style: 1,
table: 1,
tbody: 1,
textarea: 1,
tfoot: 1,
thead: 1,
title: 1,
tr: 1,
track: 1,
ul: 1,
wbr: 1,
basefont: 1,
dialog: 1,
dir: 1,
isindex: 1
}, SELF_CLOSING_ELEMENTS = {
img: 1
}, BlockGenerator = function() {
function BlockGenerator() {
var options = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
_classCallCheck(this, BlockGenerator), this.options = options, // This represents the hierarchy as we traverse nested elements; for
// example [body, ul, li] where we must know li's parent type (ul or ol).
this.blockStack = [], // This is a linear list of blocks that will form the output; for example
// [p, li, li, blockquote].
this.blockList = [], this.depth = 0;
}
return _createClass(BlockGenerator, [ {
key: "process",
value: function(element) {
this.processBlockElement(element);
var contentBlocks = [];
return this.blockList.forEach(function(block) {
var _concatFragments = concatFragments(block.textFragments), text = _concatFragments.text, characterMeta = _concatFragments.characterMeta, includeEmptyBlock = !1;
if (// If the block contains only a soft break then don't discard the block,
// but discard the soft break.
text === SOFT_BREAK_PLACEHOLDER && (includeEmptyBlock = !0, text = ""), "pre" === block.tagName) {
var _trimLeadingNewline = trimLeadingNewline(text, characterMeta);
text = _trimLeadingNewline.text, characterMeta = _trimLeadingNewline.characterMeta;
} else {
var _collapseWhiteSpace = collapseWhiteSpace(text, characterMeta);
text = _collapseWhiteSpace.text, characterMeta = _collapseWhiteSpace.characterMeta;
}
// Previously we were using a placeholder for soft breaks. Now that we
// have collapsed whitespace we can change it back to normal line breaks.
text = text.split(SOFT_BREAK_PLACEHOLDER).join("\n"), // Discard empty blocks (unless otherwise specified).
(text.length || includeEmptyBlock) && contentBlocks.push(new _draftJs.ContentBlock({
key: (0, _draftJs.genKey)(),
text: text,
type: block.type,
characterList: characterMeta.toList(),
depth: block.depth
}));
}), contentBlocks.length ? contentBlocks : [ EMPTY_BLOCK ];
}
}, {
key: "getBlockTypeFromTagName",
value: function(tagName) {
var blockTypes = this.options.blockTypes;
if (blockTypes && blockTypes[tagName]) return blockTypes[tagName];
switch (tagName) {
case "li":
var parent = this.blockStack.slice(-1)[0];
return "ol" === parent.tagName ? _draftJsUtils.BLOCK_TYPE.ORDERED_LIST_ITEM : _draftJsUtils.BLOCK_TYPE.UNORDERED_LIST_ITEM;
case "blockquote":
return _draftJsUtils.BLOCK_TYPE.BLOCKQUOTE;
case "h1":
return _draftJsUtils.BLOCK_TYPE.HEADER_ONE;
case "h2":
return _draftJsUtils.BLOCK_TYPE.HEADER_TWO;
case "h3":
return _draftJsUtils.BLOCK_TYPE.HEADER_THREE;
case "h4":
return _draftJsUtils.BLOCK_TYPE.HEADER_FOUR;
case "h5":
return _draftJsUtils.BLOCK_TYPE.HEADER_FIVE;
case "h6":
return _draftJsUtils.BLOCK_TYPE.HEADER_SIX;
case "pre":
return _draftJsUtils.BLOCK_TYPE.CODE;
case "figure":
return _draftJsUtils.BLOCK_TYPE.ATOMIC;
default:
return _draftJsUtils.BLOCK_TYPE.UNSTYLED;
}
}
}, {
key: "processBlockElement",
value: function(element) {
if (element) {
var tagName = element.nodeName.toLowerCase(), type = this.getBlockTypeFromTagName(tagName), hasDepth = canHaveDepth(type), allowRender = !SPECIAL_ELEMENTS.hasOwnProperty(tagName), block = {
tagName: tagName,
textFragments: [],
type: type,
styleStack: [ NO_STYLE ],
entityStack: [ NO_ENTITY ],
depth: hasDepth ? this.depth : 0
};
allowRender && (this.blockList.push(block), hasDepth && (this.depth += 1)), this.blockStack.push(block),
null != element.childNodes && Array.from(element.childNodes).forEach(this.processNode, this),
this.blockStack.pop(), allowRender && hasDepth && (this.depth -= 1);
}
}
}, {
key: "processInlineElement",
value: function(element) {
var tagName = element.nodeName.toLowerCase();
if ("br" === tagName) return void this.processText(SOFT_BREAK_PLACEHOLDER);
var block = this.blockStack.slice(-1)[0], style = block.styleStack.slice(-1)[0], entityKey = block.entityStack.slice(-1)[0];
style = addStyleFromTagName(style, tagName, this.options.elementStyles), ELEM_TO_ENTITY.hasOwnProperty(tagName) && (// If the to-entity function returns nothing, use the existing entity.
entityKey = ELEM_TO_ENTITY[tagName](tagName, element) || entityKey), block.styleStack.push(style),
block.entityStack.push(entityKey), null != element.childNodes && Array.from(element.childNodes).forEach(this.processNode, this),
SELF_CLOSING_ELEMENTS.hasOwnProperty(tagName) && this.processText(" "), block.entityStack.pop(),
block.styleStack.pop();
}
}, {
key: "processTextNode",
value: function(node) {
var text = node.nodeValue;
// This is important because we will use \r as a placeholder for a soft break.
text = text.replace(LINE_BREAKS, "\n"), // Replace zero-width space (we use it as a placeholder in markdown) with a
// soft break.
// TODO: The import-markdown package should correctly turn breaks into <br>
// elements so we don't need to include this hack.
text = text.split(ZERO_WIDTH_SPACE).join(SOFT_BREAK_PLACEHOLDER), this.processText(text);
}
}, {
key: "processText",
value: function(text) {
var block = this.blockStack.slice(-1)[0], style = block.styleStack.slice(-1)[0], entity = block.entityStack.slice(-1)[0], charMetadata = _draftJs.CharacterMetadata.create({
style: style,
entity: entity
}), seq = (0, _immutable.Repeat)(charMetadata, text.length);
block.textFragments.push({
text: text,
characterMeta: seq
});
}
}, {
key: "processNode",
value: function(node) {
if (node.nodeType === _syntheticDom.NODE_TYPE_ELEMENT) {
var element = node, _tagName = element.nodeName.toLowerCase();
INLINE_ELEMENTS.hasOwnProperty(_tagName) ? this.processInlineElement(element) : this.processBlockElement(element);
} else node.nodeType === _syntheticDom.NODE_TYPE_TEXT && this.processTextNode(node);
}
} ]), BlockGenerator;
}();
}, /* 196 */
/***/
function(module, exports) {
"use strict";
function replaceTextWithMeta(subject, searchText, replaceText) {
for (var text = subject.text, characterMeta = subject.characterMeta, searchTextLength = searchText.length, replaceTextLength = replaceText.length, resultTextParts = [], resultCharMeta = characterMeta.slice(0, 0), lastEndIndex = 0, index = text.indexOf(searchText); index !== -1; ) resultTextParts.push(text.slice(lastEndIndex, index) + replaceText),
resultCharMeta = resultCharMeta.concat(characterMeta.slice(lastEndIndex, index), // Use the metadata of the first char we are replacing.
repeatSeq(characterMeta.slice(index, index + 1), replaceTextLength)), lastEndIndex = index + searchTextLength,
index = text.indexOf(searchText, lastEndIndex);
return resultTextParts.push(text.slice(lastEndIndex)), resultCharMeta = resultCharMeta.concat(characterMeta.slice(lastEndIndex)),
{
text: resultTextParts.join(""),
characterMeta: resultCharMeta
};
}
function repeatSeq(seq, count) {
for (var result = seq.slice(0, 0); count-- > 0; ) result = result.concat(seq);
return result;
}
Object.defineProperty(exports, "__esModule", {
value: !0
}), exports.default = replaceTextWithMeta;
}, /* 197 */
/***/
function(module, exports) {
"use strict";
function _toConsumableArray(arr) {
if (Array.isArray(arr)) {
for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
return arr2;
}
return Array.from(arr);
}
function _possibleConstructorReturn(self, call) {
if (!self) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !call || "object" != typeof call && "function" != typeof call ? self : call;
}
function _inherits(subClass, superClass) {
if ("function" != typeof superClass && null !== superClass) 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: !1,
writable: !0,
configurable: !0
}
}), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass);
}
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
}
function escape(html) {
return html.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
}
function escapeAttr(html) {
return html.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
}
Object.defineProperty(exports, "__esModule", {
value: !0
});
var _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0,
"value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps),
Constructor;
};
}(), EMPTY_ATTR_LIST = [], NODE_TYPE_ELEMENT = exports.NODE_TYPE_ELEMENT = 1, NODE_TYPE_TEXT = exports.NODE_TYPE_TEXT = 3, NODE_TYPE_FRAGMENT = exports.NODE_TYPE_FRAGMENT = 11, SELF_CLOSING = exports.SELF_CLOSING = {
area: !0,
base: !0,
br: !0,
col: !0,
embed: !0,
hr: !0,
img: !0,
input: !0,
keygen: !0,
link: !0,
meta: !0,
param: !0,
source: !0,
track: !0,
wbr: !0
}, Node = exports.Node = function Node() {
_classCallCheck(this, Node);
};
exports.TextNode = function(_Node) {
function TextNode(value) {
_classCallCheck(this, TextNode);
var _this = _possibleConstructorReturn(this, (TextNode.__proto__ || Object.getPrototypeOf(TextNode)).apply(this, arguments));
return _this.nodeType = NODE_TYPE_TEXT, _this.nodeName = "#text", _this.nodeValue = value,
_this;
}
return _inherits(TextNode, _Node), _createClass(TextNode, [ {
key: "toString",
value: function() {
return escape(this.nodeValue);
}
} ]), TextNode;
}(Node), exports.ElementNode = function(_Node2) {
function ElementNode(name, attributes, childNodes) {
_classCallCheck(this, ElementNode);
var _this2 = _possibleConstructorReturn(this, (ElementNode.__proto__ || Object.getPrototypeOf(ElementNode)).apply(this, arguments));
null == attributes && (attributes = EMPTY_ATTR_LIST);
var isSelfClosing = SELF_CLOSING[name] === !0;
return _this2.nodeType = NODE_TYPE_ELEMENT, _this2.nodeName = name, _this2.attributes = attributes,
_this2.attrMap = new Map(attributes.map(function(attr) {
return [ attr.name, attr ];
})), _this2.childNodes = [], _this2.isSelfClosing = isSelfClosing, !isSelfClosing && childNodes && childNodes.forEach(_this2.appendChild, _this2),
_this2;
}
return _inherits(ElementNode, _Node2), _createClass(ElementNode, [ {
key: "appendChild",
value: function(node) {
if (node.nodeType === NODE_TYPE_FRAGMENT) {
if (null != node.childNodes) {
var _childNodes, childNodes = node.childNodes;
(_childNodes = this.childNodes).push.apply(_childNodes, _toConsumableArray(childNodes));
}
} else this.childNodes.push(node);
}
}, {
key: "getAttribute",
value: function(name) {
var attr = this.attrMap.get(name);
if (attr) return attr.value;
}
}, {
key: "toString",
value: function(isXHTML) {
var attributes = [], _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
try {
for (var _step, _iterator = this.attributes[Symbol.iterator](); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
var _step$value = _step.value, _name = _step$value.name, _value = _step$value.value;
attributes.push(_name + (_value ? '="' + escapeAttr(_value) + '"' : ""));
}
} catch (err) {
_didIteratorError = !0, _iteratorError = err;
} finally {
try {
!_iteratorNormalCompletion && _iterator.return && _iterator.return();
} finally {
if (_didIteratorError) throw _iteratorError;
}
}
var attrString = attributes.length ? " " + attributes.join(" ") : "";
if (this.isSelfClosing) return "<" + this.nodeName + attrString + (isXHTML ? "/>" : ">");
var childNodes = this.childNodes.map(function(node) {
return node.toString(isXHTML);
}).join("");
return "<" + this.nodeName + attrString + ">" + childNodes + "</" + this.nodeName + ">";
}
} ]), ElementNode;
}(Node), exports.FragmentNode = function(_Node3) {
function FragmentNode(childNodes) {
_classCallCheck(this, FragmentNode);
var _this3 = _possibleConstructorReturn(this, (FragmentNode.__proto__ || Object.getPrototypeOf(FragmentNode)).apply(this, arguments));
return _this3.nodeType = NODE_TYPE_FRAGMENT, _this3.childNodes = [], childNodes && childNodes.forEach(_this3.appendChild, _this3),
_this3;
}
return _inherits(FragmentNode, _Node3), _createClass(FragmentNode, [ {
key: "appendChild",
value: function(node) {
if (node.nodeType === NODE_TYPE_FRAGMENT) {
if (null != node.childNodes) {
var _childNodes2, childNodes = node.childNodes;
(_childNodes2 = this.childNodes).push.apply(_childNodes2, _toConsumableArray(childNodes));
}
} else this.childNodes.push(node);
}
}, {
key: "toString",
value: function(isXHTML) {
return this.childNodes.map(function(node) {
return node.toString(isXHTML);
}).join("");
}
} ]), FragmentNode;
}(Node);
}, /* 198 */
/***/
function(module, exports) {
"use strict";
function parseHTML(html) {
var doc = void 0;
if ("undefined" != typeof DOMParser) {
var parser = new DOMParser();
doc = parser.parseFromString(html, "text/html");
} else doc = document.implementation.createHTMLDocument(""), doc.documentElement.innerHTML = html;
return doc.body;
}
Object.defineProperty(exports, "__esModule", {
value: !0
}), exports.default = parseHTML;
}, /* 199 */
/***/
function(module, exports, __webpack_require__) {
"use strict";
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
Object.defineProperty(exports, "__esModule", {
value: !0
});
var _stateToMarkdown = __webpack_require__(200);
Object.defineProperty(exports, "stateToMarkdown", {
enumerable: !0,
get: function() {
return _interopRequireDefault(_stateToMarkdown).default;
}
});
}, /* 200 */
/***/
function(module, exports, __webpack_require__) {
"use strict";
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
}
function canHaveDepth(blockType) {
switch (blockType) {
case _draftJsUtils.BLOCK_TYPE.UNORDERED_LIST_ITEM:
case _draftJsUtils.BLOCK_TYPE.ORDERED_LIST_ITEM:
return !0;
default:
return !1;
}
}
function encodeContent(text) {
return text.replace(/[*_`]/g, "\\$&");
}
// Encode chars that would normally be allowed in a URL but would conflict with
// our markdown syntax: `[foo](http://foo/)`
function encodeURL(url) {
return url.replace(/\)/g, "%29");
}
// Escape quotes using backslash.
function escapeTitle(text) {
return text.replace(/"/g, '\\"');
}
function stateToMarkdown(content) {
return new MarkupGenerator(content).generate();
}
Object.defineProperty(exports, "__esModule", {
value: !0
});
var _slicedToArray = function() {
function sliceIterator(arr, i) {
var _arr = [], _n = !0, _d = !1, _e = void 0;
try {
for (var _s, _i = arr[Symbol.iterator](); !(_n = (_s = _i.next()).done) && (_arr.push(_s.value),
!i || _arr.length !== i); _n = !0) ;
} catch (err) {
_d = !0, _e = err;
} finally {
try {
!_n && _i.return && _i.return();
} finally {
if (_d) throw _e;
}
}
return _arr;
}
return function(arr, i) {
if (Array.isArray(arr)) return arr;
if (Symbol.iterator in Object(arr)) return sliceIterator(arr, i);
throw new TypeError("Invalid attempt to destructure non-iterable instance");
};
}(), _createClass = function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0,
"value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps),
Constructor;
};
}();
exports.default = stateToMarkdown;
var _draftJsUtils = __webpack_require__(147), _draftJs = __webpack_require__(2), BOLD = _draftJsUtils.INLINE_STYLE.BOLD, CODE = _draftJsUtils.INLINE_STYLE.CODE, ITALIC = _draftJsUtils.INLINE_STYLE.ITALIC, STRIKETHROUGH = _draftJsUtils.INLINE_STYLE.STRIKETHROUGH, UNDERLINE = _draftJsUtils.INLINE_STYLE.UNDERLINE, CODE_INDENT = " ", MarkupGenerator = function() {
function MarkupGenerator(contentState) {
_classCallCheck(this, MarkupGenerator), this.contentState = contentState;
}
return _createClass(MarkupGenerator, [ {
key: "generate",
value: function() {
for (this.output = [], this.blocks = this.contentState.getBlockMap().toArray(),
this.totalBlocks = this.blocks.length, this.currentBlock = 0, this.listItemCounts = {}; this.currentBlock < this.totalBlocks; ) this.processBlock();
return this.output.join("");
}
}, {
key: "processBlock",
value: function() {
var block = this.blocks[this.currentBlock], blockType = block.getType();
switch (blockType) {
case _draftJsUtils.BLOCK_TYPE.HEADER_ONE:
this.insertLineBreaks(1), this.output.push("# " + this.renderBlockContent(block) + "\n");
break;
case _draftJsUtils.BLOCK_TYPE.HEADER_TWO:
this.insertLineBreaks(1), this.output.push("## " + this.renderBlockContent(block) + "\n");
break;
case _draftJsUtils.BLOCK_TYPE.HEADER_THREE:
this.insertLineBreaks(1), this.output.push("### " + this.renderBlockContent(block) + "\n");
break;
case _draftJsUtils.BLOCK_TYPE.HEADER_FOUR:
this.insertLineBreaks(1), this.output.push("#### " + this.renderBlockContent(block) + "\n");
break;
case _draftJsUtils.BLOCK_TYPE.HEADER_FIVE:
this.insertLineBreaks(1), this.output.push("##### " + this.renderBlockContent(block) + "\n");
break;
case _draftJsUtils.BLOCK_TYPE.HEADER_SIX:
this.insertLineBreaks(1), this.output.push("###### " + this.renderBlockContent(block) + "\n");
break;
case _draftJsUtils.BLOCK_TYPE.UNORDERED_LIST_ITEM:
var blockDepth = block.getDepth(), lastBlock = this.getLastBlock(), lastBlockType = lastBlock ? lastBlock.getType() : null, lastBlockDepth = lastBlock && canHaveDepth(lastBlockType) ? lastBlock.getDepth() : null;
lastBlockType !== blockType && lastBlockDepth !== blockDepth - 1 && (this.insertLineBreaks(1),
// Insert an additional line break if following opposite list type.
lastBlockType === _draftJsUtils.BLOCK_TYPE.ORDERED_LIST_ITEM && this.insertLineBreaks(1));
var indent = " ".repeat(4 * block.depth);
this.output.push(indent + "- " + this.renderBlockContent(block) + "\n");
break;
case _draftJsUtils.BLOCK_TYPE.ORDERED_LIST_ITEM:
var _blockDepth = block.getDepth(), _lastBlock = this.getLastBlock(), _lastBlockType = _lastBlock ? _lastBlock.getType() : null, _lastBlockDepth = _lastBlock && canHaveDepth(_lastBlockType) ? _lastBlock.getDepth() : null;
_lastBlockType !== blockType && _lastBlockDepth !== _blockDepth - 1 && (this.insertLineBreaks(1),
// Insert an additional line break if following opposite list type.
_lastBlockType === _draftJsUtils.BLOCK_TYPE.UNORDERED_LIST_ITEM && this.insertLineBreaks(1));
var _indent = " ".repeat(4 * _blockDepth), count = this.getListItemCount(block) % 10;
this.output.push(_indent + (count + ". ") + this.renderBlockContent(block) + "\n");
break;
case _draftJsUtils.BLOCK_TYPE.BLOCKQUOTE:
this.insertLineBreaks(1), this.output.push(" > " + this.renderBlockContent(block) + "\n");
break;
case _draftJsUtils.BLOCK_TYPE.CODE:
this.insertLineBreaks(1), this.output.push(CODE_INDENT + this.renderBlockContent(block) + "\n");
break;
default:
this.insertLineBreaks(1), this.output.push(this.renderBlockContent(block) + "\n");
}
this.currentBlock += 1;
}
}, {
key: "getLastBlock",
value: function() {
return this.blocks[this.currentBlock - 1];
}
}, {
key: "getNextBlock",
value: function() {
return this.blocks[this.currentBlock + 1];
}
}, {
key: "getListItemCount",
value: function(block) {
for (var blockType = block.getType(), blockDepth = block.getDepth(), index = this.currentBlock - 1, prevBlock = this.blocks[index]; prevBlock && canHaveDepth(prevBlock.getType()) && prevBlock.getDepth() > blockDepth; ) index -= 1,
prevBlock = this.blocks[index];
return prevBlock && prevBlock.getType() === blockType && prevBlock.getDepth() === blockDepth || (this.listItemCounts[blockDepth] = 0),
this.listItemCounts[blockDepth] = this.listItemCounts[blockDepth] + 1;
}
}, {
key: "insertLineBreaks",
value: function() {
this.currentBlock > 0 && this.output.push("\n");
}
}, {
key: "renderBlockContent",
value: function(block) {
var blockType = block.getType(), text = block.getText();
if ("" === text) // Prevent element collapse if completely empty.
// TODO: Replace with constant.
return "";
var charMetaList = block.getCharacterList(), entityPieces = (0, _draftJsUtils.getEntityRanges)(text, charMetaList);
return entityPieces.map(function(_ref) {
var _ref2 = _slicedToArray(_ref, 2), entityKey = _ref2[0], stylePieces = _ref2[1], content = stylePieces.map(function(_ref3) {
var _ref4 = _slicedToArray(_ref3, 2), text = _ref4[0], style = _ref4[1];
// Don't allow empty inline elements.
if (!text) return "";
var content = encodeContent(text);
// TODO: encode `+`?
// TODO: encode `~`?
return style.has(BOLD) && (content = "**" + content + "**"), style.has(UNDERLINE) && (content = "++" + content + "++"),
style.has(ITALIC) && (content = "_" + content + "_"), style.has(STRIKETHROUGH) && (content = "~~" + content + "~~"),
style.has(CODE) && (content = blockType === _draftJsUtils.BLOCK_TYPE.CODE ? content : "`" + content + "`"),
content;
}).join(""), entity = entityKey ? _draftJs.Entity.get(entityKey) : null;
if (null != entity && entity.getType() === _draftJsUtils.ENTITY_TYPE.LINK) {
var data = entity.getData(), url = data.url || "", title = data.title ? ' "' + escapeTitle(data.title) + '"' : "";
return "[" + content + "](" + encodeURL(url) + title + ")";
}
if (null != entity && entity.getType() === _draftJsUtils.ENTITY_TYPE.IMAGE) {
var _data = entity.getData(), src = _data.src || "", alt = _data.alt ? ' "' + escapeTitle(_data.alt) + '"' : "";
return "![" + alt + "](" + encodeURL(src) + ")";
}
return content;
}).join("");
}
} ]), MarkupGenerator;
}();
}, /* 201 */
/***/
function(module, exports, __webpack_require__) {
"use strict";
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
Object.defineProperty(exports, "__esModule", {
value: !0
});
var _stateFromMarkdown = __webpack_require__(202);
Object.defineProperty(exports, "stateFromMarkdown", {
enumerable: !0,
get: function() {
return _interopRequireDefault(_stateFromMarkdown).default;
}
});
}, /* 202 */
/***/
function(module, exports, __webpack_require__) {
"use strict";
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function stateFromMarkdown(markdown) {
var element = _MarkdownParser2.default.parse(markdown, {
getAST: !0
});
return (0, _draftJsImportElement.stateFromElement)(element);
}
Object.defineProperty(exports, "__esModule", {
value: !0
}), exports.default = stateFromMarkdown;
var _MarkdownParser = __webpack_require__(203), _MarkdownParser2 = _interopRequireDefault(_MarkdownParser), _draftJsImportElement = __webpack_require__(194);
}, /* 203 */
/***/
function(module, exports, __webpack_require__) {
"use strict";
/**
* Block Lexer
*/
function Lexer(options) {
this.tokens = [], this.tokens.links = {}, this.options = assign({}, options || defaults),
this.rules = block.normal, this.options.gfm && (this.rules = block.gfm);
}
/**
* Inline Lexer & Compiler
*/
function InlineLexer(links, options) {
if (this.options = assign({}, options || defaults), this.links = links, this.rules = inline.normal,
this.renderer = this.options.renderer || new Renderer(), this.renderer.options = this.options,
!this.links) throw new Error("Tokens array requires a `links` property.");
this.options.gfm ? this.options.breaks ? this.rules = inline.breaks : this.rules = inline.gfm : this.options.pedantic && (this.rules = inline.pedantic);
}
/**
* Renderer
*/
function Renderer(options) {
this.options = options || {};
}
/**
* Parsing & Compiling
*/
function Parser(options) {
this.tokens = [], this.token = null, this.options = assign({}, options || defaults),
this.options.renderer = this.options.renderer || new Renderer(), this.renderer = this.options.renderer,
this.renderer.options = this.options;
}
/**
* Helpers
*/
function replace(regex, options) {
return regex = regex.source, options = options || "", function self(name, val) {
return name ? (val = val.source || val, val = val.replace(/(^|[^\[])\^/g, "$1"),
regex = regex.replace(name, val), self) : new RegExp(regex, options);
};
}
Object.defineProperty(exports, "__esModule", {
value: !0
});
var _syntheticDom = __webpack_require__(197), hasOwnProperty = Object.prototype.hasOwnProperty, assign = Object.assign || function(obj) {
for (var i = 1; i < arguments.length; i++) {
var target = arguments[i];
for (var key in target) hasOwnProperty.call(target, key) && (obj[key] = target[key]);
}
return obj;
}, noop = function() {};
noop.exec = noop;
var defaults = {
gfm: !0,
breaks: !1,
pedantic: !1,
smartLists: !1,
silent: !1,
langPrefix: "lang-",
renderer: new Renderer(),
xhtml: !1
}, block = {
newline: /^\n+/,
code: /^( {4}[^\n]+\n*)+/,
fences: noop,
hr: /^( *[-*_]){3,} *(?:\n+|$)/,
heading: /^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,
nptable: noop,
lheading: /^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,
blockquote: /^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,
list: /^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,
def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,
paragraph: /^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|def))+)\n*/,
text: /^[^\n]+/
};
block.bullet = /(?:[*+-]|\d+\.)/, block.item = /^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,
block.item = replace(block.item, "gm")(/bull/g, block.bullet)(), block.list = replace(block.list)(/bull/g, block.bullet)("hr", "\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def", "\\n+(?=" + block.def.source + ")")(),
block.blockquote = replace(block.blockquote)("def", block.def)(), block.paragraph = replace(block.paragraph)("hr", block.hr)("heading", block.heading)("lheading", block.lheading)("blockquote", block.blockquote)("def", block.def)(),
/**
* Normal Block Grammar
*/
block.normal = assign({}, block), /**
* GFM Block Grammar
*/
block.gfm = assign({}, block.normal, {
fences: /^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/,
paragraph: /^/,
heading: /^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/
}), block.gfm.paragraph = replace(block.paragraph)("(?!", "(?!" + block.gfm.fences.source.replace("\\1", "\\2") + "|" + block.list.source.replace("\\1", "\\3") + "|")(),
/**
* Expose Block Rules
*/
Lexer.rules = block, /**
* Static Lex Method
*/
Lexer.parse = function(src, options) {
var lexer = new Lexer(options);
return lexer.parse(src);
}, /**
* Preprocessing
*/
Lexer.prototype.parse = function(src) {
return src = src.replace(/\r\n|\r/g, "\n").replace(/\t/g, " ").replace(/\u00a0/g, " ").replace(/\u2424/g, "\n"),
this.token(src, !0);
}, /**
* Lexing
*/
Lexer.prototype.token = function(src, top, bq) {
var next, loose, cap, bull, b, item, space, i, l;
for (src = src.replace(/^ +$/gm, ""); src; ) // code
if (// newline
(cap = this.rules.newline.exec(src)) && (src = src.substring(cap[0].length), cap[0].length > 1 && this.tokens.push({
type: "space"
})), cap = this.rules.code.exec(src)) src = src.substring(cap[0].length), cap = cap[0].replace(/^ {4}/gm, ""),
this.tokens.push({
type: "code",
text: this.options.pedantic ? cap : cap.replace(/\n+$/, "")
}); else // fences (gfm)
if (cap = this.rules.fences.exec(src)) src = src.substring(cap[0].length), this.tokens.push({
type: "code",
lang: cap[2],
text: cap[3]
}); else // heading
if (cap = this.rules.heading.exec(src)) src = src.substring(cap[0].length), this.tokens.push({
type: "heading",
depth: cap[1].length,
text: cap[2]
}); else // lheading
if (cap = this.rules.lheading.exec(src)) src = src.substring(cap[0].length), this.tokens.push({
type: "heading",
depth: "=" === cap[2] ? 1 : 2,
text: cap[1]
}); else // hr
if (cap = this.rules.hr.exec(src)) src = src.substring(cap[0].length), this.tokens.push({
type: "hr"
}); else // blockquote
if (cap = this.rules.blockquote.exec(src)) src = src.substring(cap[0].length), this.tokens.push({
type: "blockquote_start"
}), cap = cap[0].replace(/^ *> ?/gm, ""), // Pass `top` to keep the current
// "toplevel" state. This is exactly
// how markdown.pl works.
this.token(cap, top, !0), this.tokens.push({
type: "blockquote_end"
}); else // list
if (cap = this.rules.list.exec(src)) {
for (src = src.substring(cap[0].length), bull = cap[2], this.tokens.push({
type: "list_start",
ordered: bull.length > 1
}), // Get each top-level item.
cap = cap[0].match(this.rules.item), next = !1, l = cap.length, i = 0; i < l; i++) item = cap[i],
// Remove the list item's bullet
// so it is seen as the next token.
space = item.length, item = item.replace(/^ *([*+-]|\d+\.) +/, ""), // Outdent whatever the
// list item contains. Hacky.
~item.indexOf("\n ") && (space -= item.length, item = this.options.pedantic ? item.replace(/^ {1,4}/gm, "") : item.replace(new RegExp("^ {1," + space + "}", "gm"), "")),
// Determine whether the next list item belongs here.
// Backpedal if it does not belong in this list.
this.options.smartLists && i !== l - 1 && (b = block.bullet.exec(cap[i + 1])[0],
bull === b || bull.length > 1 && b.length > 1 || (src = cap.slice(i + 1).join("\n") + src,
i = l - 1)), // Determine whether item is loose or not.
// Use: /(^|\n)(?! )[^\n]+\n\n(?!\s*$)/
// for discount behavior.
loose = next || /\n\n(?!\s*$)/.test(item), i !== l - 1 && (next = "\n" === item.charAt(item.length - 1),
loose || (loose = next)), this.tokens.push({
type: loose ? "loose_item_start" : "list_item_start"
}), // Recurse.
this.token(item, !1, bq), this.tokens.push({
type: "list_item_end"
});
this.tokens.push({
type: "list_end"
});
} else // def
if (!bq && top && (cap = this.rules.def.exec(src))) src = src.substring(cap[0].length),
this.tokens.links[cap[1].toLowerCase()] = {
href: cap[2],
title: cap[3]
}; else // top-level paragraph
if (top && (cap = this.rules.paragraph.exec(src))) src = src.substring(cap[0].length),
this.tokens.push({
type: "paragraph",
text: "\n" === cap[1].charAt(cap[1].length - 1) ? cap[1].slice(0, -1) : cap[1]
}); else // text
if (cap = this.rules.text.exec(src)) // Top-level should never reach here.
src = src.substring(cap[0].length), this.tokens.push({
type: "text",
text: cap[0]
}); else if (src) throw new Error("Infinite loop on byte: " + src.charCodeAt(0));
return this.tokens;
};
/**
* Inline-Level Grammar
*/
var inline = {
escape: /^\\([\\`*{}\[\]()#+\-.!_>])/,
link: /^!?\[(inside)\]\(href\)/,
reflink: /^!?\[(inside)\]\s*\[([^\]]*)\]/,
nolink: /^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,
strong: /^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,
em: /^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,
code: /^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,
br: /^ {2,}\n(?!\s*$)/,
del: noop,
ins: noop,
text: /^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/
};
inline._inside = /(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/, inline._href = /\s*<?([\s\S]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/,
inline.link = replace(inline.link)("inside", inline._inside)("href", inline._href)(),
inline.reflink = replace(inline.reflink)("inside", inline._inside)(), /**
* Normal Inline Grammar
*/
inline.normal = assign({}, inline), /**
* Pedantic Inline Grammar
*/
inline.pedantic = assign({}, inline.normal, {
strong: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,
em: /^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/
}), /**
* GFM Inline Grammar
*/
inline.gfm = assign({}, inline.normal, {
escape: replace(inline.escape)("])", "~|])")(),
del: /^~~(?=\S)([\s\S]*?\S)~~/,
ins: /^\+\+(?=\S)([\s\S]*?\S)\+\+/,
text: replace(inline.text)("]|", "~+]|")()
}), /**
* GFM + Line Breaks Inline Grammar
*/
inline.breaks = assign({}, inline.gfm, {
br: replace(inline.br)("{2,}", "*")(),
text: replace(inline.gfm.text)("{2,}", "*")()
}), /**
* Expose Inline Rules
*/
InlineLexer.rules = inline, /**
* Static Lexing/Compiling Method
*/
InlineLexer.parse = function(src, links, options) {
var inline = new InlineLexer(links, options);
return inline.parse(src);
}, /**
* Lexing/Compiling
*/
InlineLexer.prototype.parse = function(src) {
for (var link, cap, out = new _syntheticDom.FragmentNode(); src; ) // escape
if (cap = this.rules.escape.exec(src)) src = src.substring(cap[0].length), out.appendChild(new _syntheticDom.TextNode(cap[1])); else // link
if (cap = this.rules.link.exec(src)) src = src.substring(cap[0].length), this.inLink = !0,
out.appendChild(this.outputLink(cap, {
href: cap[2],
title: cap[3]
})), this.inLink = !1; else // reflink, nolink
if ((cap = this.rules.reflink.exec(src)) || (cap = this.rules.nolink.exec(src))) {
if (src = src.substring(cap[0].length), link = (cap[2] || cap[1]).replace(/\s+/g, " "),
link = this.links[link.toLowerCase()], !link || !link.href) {
out.appendChild(new _syntheticDom.TextNode(cap[0].charAt(0))), src = cap[0].substring(1) + src;
continue;
}
this.inLink = !0, out.appendChild(this.outputLink(cap, link)), this.inLink = !1;
} else // strong
if (cap = this.rules.strong.exec(src)) src = src.substring(cap[0].length), out.appendChild(this.renderer.strong(this.parse(cap[2] || cap[1]))); else // em
if (cap = this.rules.em.exec(src)) src = src.substring(cap[0].length), out.appendChild(this.renderer.em(this.parse(cap[2] || cap[1]))); else // code
if (cap = this.rules.code.exec(src)) src = src.substring(cap[0].length), out.appendChild(this.renderer.codespan(cap[2])); else // br
if (cap = this.rules.br.exec(src)) src = src.substring(cap[0].length), out.appendChild(this.renderer.br()); else // del (gfm)
if (cap = this.rules.del.exec(src)) src = src.substring(cap[0].length), out.appendChild(this.renderer.del(this.parse(cap[1]))); else // ins (gfm extended)
if (cap = this.rules.ins.exec(src)) src = src.substring(cap[0].length), out.appendChild(this.renderer.ins(this.parse(cap[1]))); else // text
if (cap = this.rules.text.exec(src)) src = src.substring(cap[0].length), out.appendChild(this.renderer.text(new _syntheticDom.TextNode(cap[0]))); else if (src) throw new Error("Infinite loop on byte: " + src.charCodeAt(0));
return out;
}, /**
* Compile Link
*/
InlineLexer.prototype.outputLink = function(cap, link) {
var href = link.href, title = link.title;
return "!" !== cap[0].charAt(0) ? this.renderer.link(href, title, this.parse(cap[1])) : this.renderer.image(href, title, cap[1]);
}, Renderer.prototype.code = function(childNode, lang) {
var attributes = [];
lang && attributes.push([ "class", this.options.langPrefix + lang ]);
var codeNode = new _syntheticDom.ElementNode("code", attributes, [ childNode ]);
return new _syntheticDom.ElementNode("pre", [], [ codeNode ]);
}, Renderer.prototype.blockquote = function(childNode) {
return new _syntheticDom.ElementNode("blockquote", [], [ childNode ]);
}, Renderer.prototype.heading = function(childNode, level) {
return new _syntheticDom.ElementNode("h" + level, [], [ childNode ]);
}, Renderer.prototype.hr = function() {
return new _syntheticDom.ElementNode("hr", [], _syntheticDom.SELF_CLOSING);
}, Renderer.prototype.list = function(childNode, isOrdered) {
return new _syntheticDom.ElementNode(isOrdered ? "ol" : "ul", [], [ childNode ]);
}, Renderer.prototype.listitem = function(childNode) {
return new _syntheticDom.ElementNode("li", [], [ childNode ]);
}, Renderer.prototype.paragraph = function(childNode) {
return new _syntheticDom.ElementNode("p", [], [ childNode ]);
}, // span level renderer
Renderer.prototype.strong = function(childNode) {
return new _syntheticDom.ElementNode("strong", [], [ childNode ]);
}, Renderer.prototype.em = function(childNode) {
return new _syntheticDom.ElementNode("em", [], [ childNode ]);
}, Renderer.prototype.codespan = function(text) {
return new _syntheticDom.ElementNode("code", [], [ new _syntheticDom.TextNode(text) ]);
}, Renderer.prototype.br = function() {
return new _syntheticDom.ElementNode("br", [], _syntheticDom.SELF_CLOSING);
}, Renderer.prototype.del = function(childNode) {
return new _syntheticDom.ElementNode("del", [], [ childNode ]);
}, Renderer.prototype.ins = function(childNode) {
return new _syntheticDom.ElementNode("ins", [], [ childNode ]);
}, Renderer.prototype.link = function(href, title, childNode) {
var attributes = [ [ "href", href ] ];
return title && attributes.push([ "title", title ]), new _syntheticDom.ElementNode("a", attributes, [ childNode ]);
}, Renderer.prototype.image = function(href, title, alt) {
var attributes = [ [ "src", href ] ];
return title && attributes.push([ "title", title ]), alt && attributes.push([ "alt", alt ]),
new _syntheticDom.ElementNode("img", attributes, _syntheticDom.SELF_CLOSING);
}, Renderer.prototype.text = function(childNode) {
return childNode;
}, /**
* Static Parse Method
*/
Parser.parse = function(src, options, renderer) {
var parser = new Parser(options, renderer);
return parser.parse(src);
}, /**
* Parse Loop
*/
Parser.prototype.parse = function(src) {
this.inline = new InlineLexer(src.links, this.options, this.renderer), this.tokens = src.slice().reverse();
for (var out = new _syntheticDom.FragmentNode(); this.next(); ) out.appendChild(this.tok());
return out;
}, /**
* Next Token
*/
Parser.prototype.next = function() {
return this.token = this.tokens.pop();
}, /**
* Preview Next Token
*/
Parser.prototype.peek = function() {
return this.tokens[this.tokens.length - 1] || 0;
}, /**
* Parse Text Tokens
*/
Parser.prototype.parseText = function() {
for (var body = this.token.text; "text" === this.peek().type; ) body += "\n" + this.next().text;
return this.inline.parse(body);
}, /**
* Parse Current Token
*/
Parser.prototype.tok = function() {
switch (this.token.type) {
case "space":
return new _syntheticDom.TextNode("");
case "hr":
return this.renderer.hr();
case "heading":
return this.renderer.heading(this.inline.parse(this.token.text), this.token.depth);
case "code":
return this.renderer.code(this.token.text, this.token.lang);
case "blockquote_start":
for (var body = new _syntheticDom.FragmentNode(); "blockquote_end" !== this.next().type; ) body.appendChild(this.tok());
return this.renderer.blockquote(body);
case "list_start":
for (var _body = new _syntheticDom.FragmentNode(), ordered = this.token.ordered; "list_end" !== this.next().type; ) _body.appendChild(this.tok());
return this.renderer.list(_body, ordered);
case "list_item_start":
for (var _body2 = new _syntheticDom.FragmentNode(); "list_item_end" !== this.next().type; ) _body2.appendChild("text" === this.token.type ? this.parseText() : this.tok());
return this.renderer.listitem(_body2);
case "loose_item_start":
for (var _body3 = new _syntheticDom.FragmentNode(); "list_item_end" !== this.next().type; ) _body3.appendChild(this.tok());
return this.renderer.listitem(_body3);
case "paragraph":
return this.renderer.paragraph(this.inline.parse(this.token.text));
case "text":
return this.renderer.paragraph(this.parseText());
}
};
var MarkdownParser = {
parse: function(src, options) {
options = assign({}, defaults, options);
try {
var fragment = Parser.parse(Lexer.parse(src, options), options);
} catch (e) {
if (!options.silent) throw e;
fragment = new _syntheticDom.FragmentNode([ new _syntheticDom.ElementNode("p", [], [ new _syntheticDom.TextNode("An error occured:") ]), new _syntheticDom.ElementNode("pre", [], [ new _syntheticDom.TextNode(e.message) ]) ]);
}
return options.getAST ? new _syntheticDom.ElementNode("body", [], [ fragment ]) : fragment.toString(this.options.xhtml);
}
};
exports.default = MarkdownParser;
}, /* 204 */
/***/
function(module, exports, __webpack_require__) {
"use strict";
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function Link(props) {
var _Entity$get$getData = _draftJs.Entity.get(props.entityKey).getData(), url = _Entity$get$getData.url;
return _react2.default.createElement("a", {
href: url
}, props.children);
}
function findLinkEntities(contentBlock, callback) {
contentBlock.findEntityRanges(function(character) {
var entityKey = character.getEntity();
return null != entityKey && _draftJs.Entity.get(entityKey).getType() === _draftJsUtils.ENTITY_TYPE.LINK;
}, callback);
}
Object.defineProperty(exports, "__esModule", {
value: !0
});
var _react = __webpack_require__(1), _react2 = _interopRequireDefault(_react), _draftJs = __webpack_require__(2), _draftJsUtils = __webpack_require__(147);
exports.default = {
strategy: findLinkEntities,
component: Link
};
}, /* 205 */
/***/
function(module, exports) {
"use strict";
function composite(defaultFunc, customFunc) {
return function(input) {
if (customFunc) {
var result = customFunc(input);
if (null != result) return result;
}
return defaultFunc(input);
};
}
Object.defineProperty(exports, "__esModule", {
value: !0
}), exports.default = composite;
}, /* 206 */
/***/
function(module, exports) {
// Copyright Joyent, Inc. and other Node 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.
function EventEmitter() {
this._events = this._events || {}, this._maxListeners = this._maxListeners || void 0;
}
function isFunction(arg) {
return "function" == typeof arg;
}
function isNumber(arg) {
return "number" == typeof arg;
}
function isObject(arg) {
return "object" == typeof arg && null !== arg;
}
function isUndefined(arg) {
return void 0 === arg;
}
module.exports = EventEmitter, // Backwards-compat with node 0.10.x
EventEmitter.EventEmitter = EventEmitter, EventEmitter.prototype._events = void 0,
EventEmitter.prototype._maxListeners = void 0, // By default EventEmitters will print a warning if more than 10 listeners are
// added to it. This is a useful default which helps finding memory leaks.
EventEmitter.defaultMaxListeners = 10, // Obviously not all Emitters should be limited to 10. This function allows
// that to be increased. Set to zero for unlimited.
EventEmitter.prototype.setMaxListeners = function(n) {
if (!isNumber(n) || n < 0 || isNaN(n)) throw TypeError("n must be a positive number");
return this._maxListeners = n, this;
}, EventEmitter.prototype.emit = function(type) {
var er, handler, len, args, i, listeners;
// If there is no 'error' event listener then throw.
if (this._events || (this._events = {}), "error" === type && (!this._events.error || isObject(this._events.error) && !this._events.error.length)) {
if (er = arguments[1], er instanceof Error) throw er;
// At least give some kind of context to the user
var err = new Error('Uncaught, unspecified "error" event. (' + er + ")");
throw err.context = er, err;
}
if (handler = this._events[type], isUndefined(handler)) return !1;
if (isFunction(handler)) switch (arguments.length) {
// fast cases
case 1:
handler.call(this);
break;
case 2:
handler.call(this, arguments[1]);
break;
case 3:
handler.call(this, arguments[1], arguments[2]);
break;
// slower
default:
args = Array.prototype.slice.call(arguments, 1), handler.apply(this, args);
} else if (isObject(handler)) for (args = Array.prototype.slice.call(arguments, 1),
listeners = handler.slice(), len = listeners.length, i = 0; i < len; i++) listeners[i].apply(this, args);
return !0;
}, EventEmitter.prototype.addListener = function(type, listener) {
var m;
if (!isFunction(listener)) throw TypeError("listener must be a function");
// To avoid recursion in the case that type === "newListener"! Before
// adding it to the listeners, first emit "newListener".
// If we've already got an array, just append.
// Adding the second element, need to change to array.
// Optimize the case of one listener. Don't need the extra array object.
// Check for listener leak
// not supported in IE 10
return this._events || (this._events = {}), this._events.newListener && this.emit("newListener", type, isFunction(listener.listener) ? listener.listener : listener),
this._events[type] ? isObject(this._events[type]) ? this._events[type].push(listener) : this._events[type] = [ this._events[type], listener ] : this._events[type] = listener,
isObject(this._events[type]) && !this._events[type].warned && (m = isUndefined(this._maxListeners) ? EventEmitter.defaultMaxListeners : this._maxListeners,
m && m > 0 && this._events[type].length > m && (this._events[type].warned = !0,
console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", this._events[type].length),
"function" == typeof console.trace && console.trace())), this;
}, EventEmitter.prototype.on = EventEmitter.prototype.addListener, EventEmitter.prototype.once = function(type, listener) {
function g() {
this.removeListener(type, g), fired || (fired = !0, listener.apply(this, arguments));
}
if (!isFunction(listener)) throw TypeError("listener must be a function");
var fired = !1;
return g.listener = listener, this.on(type, g), this;
}, // emits a 'removeListener' event iff the listener was removed
EventEmitter.prototype.removeListener = function(type, listener) {
var list, position, length, i;
if (!isFunction(listener)) throw TypeError("listener must be a function");
if (!this._events || !this._events[type]) return this;
if (list = this._events[type], length = list.length, position = -1, list === listener || isFunction(list.listener) && list.listener === listener) delete this._events[type],
this._events.removeListener && this.emit("removeListener", type, listener); else if (isObject(list)) {
for (i = length; i-- > 0; ) if (list[i] === listener || list[i].listener && list[i].listener === listener) {
position = i;
break;
}
if (position < 0) return this;
1 === list.length ? (list.length = 0, delete this._events[type]) : list.splice(position, 1),
this._events.removeListener && this.emit("removeListener", type, listener);
}
return this;
}, EventEmitter.prototype.removeAllListeners = function(type) {
var key, listeners;
if (!this._events) return this;
// not listening for removeListener, no need to emit
if (!this._events.removeListener) return 0 === arguments.length ? this._events = {} : this._events[type] && delete this._events[type],
this;
// emit removeListener for all listeners on all events
if (0 === arguments.length) {
for (key in this._events) "removeListener" !== key && this.removeAllListeners(key);
return this.removeAllListeners("removeListener"), this._events = {}, this;
}
if (listeners = this._events[type], isFunction(listeners)) this.removeListener(type, listeners); else if (listeners) // LIFO order
for (;listeners.length; ) this.removeListener(type, listeners[listeners.length - 1]);
return delete this._events[type], this;
}, EventEmitter.prototype.listeners = function(type) {
var ret;
return ret = this._events && this._events[type] ? isFunction(this._events[type]) ? [ this._events[type] ] : this._events[type].slice() : [];
}, EventEmitter.prototype.listenerCount = function(type) {
if (this._events) {
var evlistener = this._events[type];
if (isFunction(evlistener)) return 1;
if (evlistener) return evlistener.length;
}
return 0;
}, EventEmitter.listenerCount = function(emitter, type) {
return emitter.listenerCount(type);
};
}, /* 207 */
/***/
function(module, exports, __webpack_require__) {
// style-loader: Adds some css to the DOM by adding a <style> tag
// load the styles
var content = __webpack_require__(208);
"string" == typeof content && (content = [ [ module.id, content, "" ] ]);
// add the styles to the DOM
__webpack_require__(165)(content, {});
content.locals && (module.exports = content.locals);
}, /* 208 */
/***/
function(module, exports) {
module.exports = '/**\n * We inherit the height of the container by default\n */\n\n.DraftEditor-root,\n.DraftEditor-editorContainer,\n.public-DraftEditor-content {\n height: inherit;\n text-align: initial;\n}\n\n.DraftEditor-root {\n position: relative;\n}\n\n/**\n * Zero-opacity background used to allow focus in IE. Otherwise, clicks\n * fall through to the placeholder.\n */\n\n.DraftEditor-editorContainer {\n background-color: rgba(255, 255, 255, 0);\n /* Repair mysterious missing Safari cursor */\n border: 1px solid transparent;\n position: relative;\n z-index: 1;\n}\n\n.public-DraftEditor-content {\n outline: none;\n white-space: pre-wrap;\n}\n\n.public-DraftEditor-block {\n position: relative;\n}\n\n.DraftEditor-alignLeft .public-DraftEditor-block {\n text-align: left;\n}\n\n.DraftEditor-alignLeft .public-DraftEditorPlaceholder-root {\n left: 0;\n text-align: left;\n}\n\n.DraftEditor-alignCenter .public-DraftEditor-block {\n text-align: center;\n}\n\n.DraftEditor-alignCenter .public-DraftEditorPlaceholder-root {\n margin: 0 auto;\n text-align: center;\n width: 100%;\n}\n\n.DraftEditor-alignRight .public-DraftEditor-block {\n text-align: right;\n}\n\n.DraftEditor-alignRight .public-DraftEditorPlaceholder-root {\n right: 0;\n text-align: right;\n}\n/**\n * @providesModule DraftEditorPlaceholder\n */\n\n.public-DraftEditorPlaceholder-root {\n color: #9197a3;\n position: absolute;\n z-index: 0;\n}\n\n.public-DraftEditorPlaceholder-hasFocus {\n color: #bdc1c9;\n}\n\n.DraftEditorPlaceholder-hidden {\n display: none;\n}\n/**\n * @providesModule DraftStyleDefault\n */\n\n.public-DraftStyleDefault-block {\n position: relative;\n white-space: pre-wrap;\n}\n\n/* @noflip */\n\n.public-DraftStyleDefault-ltr {\n direction: ltr;\n text-align: left;\n}\n\n/* @noflip */\n\n.public-DraftStyleDefault-rtl {\n direction: rtl;\n text-align: right;\n}\n\n/**\n * These rules provide appropriate text direction for counter pseudo-elements.\n */\n\n/* @noflip */\n\n.public-DraftStyleDefault-listLTR {\n direction: ltr;\n}\n\n/* @noflip */\n\n.public-DraftStyleDefault-listRTL {\n direction: rtl;\n}\n\n/**\n * Default spacing for list container elements. Override with CSS as needed.\n */\n\n.public-DraftStyleDefault-ul,\n.public-DraftStyleDefault-ol {\n margin: 16px 0;\n padding: 0;\n}\n\n/**\n * Default counters and styles are provided for five levels of nesting.\n * If you require nesting beyond that level, you should use your own CSS\n * classes to do so. If you care about handling RTL languages, the rules you\n * create should look a lot like these.\n */\n\n/* @noflip */\n\n.public-DraftStyleDefault-depth0.public-DraftStyleDefault-listLTR {\n margin-left: 1.5em;\n}\n\n/* @noflip */\n\n.public-DraftStyleDefault-depth0.public-DraftStyleDefault-listRTL {\n margin-right: 1.5em;\n}\n\n/* @noflip */\n\n.public-DraftStyleDefault-depth1.public-DraftStyleDefault-listLTR {\n margin-left: 3em;\n}\n\n/* @noflip */\n\n.public-DraftStyleDefault-depth1.public-DraftStyleDefault-listRTL {\n margin-right: 3em;\n}\n\n/* @noflip */\n\n.public-DraftStyleDefault-depth2.public-DraftStyleDefault-listLTR {\n margin-left: 4.5em;\n}\n\n/* @noflip */\n\n.public-DraftStyleDefault-depth2.public-DraftStyleDefault-listRTL {\n margin-right: 4.5em;\n}\n\n/* @noflip */\n\n.public-DraftStyleDefault-depth3.public-DraftStyleDefault-listLTR {\n margin-left: 6em;\n}\n\n/* @noflip */\n\n.public-DraftStyleDefault-depth3.public-DraftStyleDefault-listRTL {\n margin-right: 6em;\n}\n\n/* @noflip */\n\n.public-DraftStyleDefault-depth4.public-DraftStyleDefault-listLTR {\n margin-left: 7.5em;\n}\n\n/* @noflip */\n\n.public-DraftStyleDefault-depth4.public-DraftStyleDefault-listRTL {\n margin-right: 7.5em;\n}\n\n/**\n * Only use `square` list-style after the first two levels.\n */\n\n.public-DraftStyleDefault-unorderedListItem {\n list-style-type: square;\n position: relative;\n}\n\n.public-DraftStyleDefault-unorderedListItem.public-DraftStyleDefault-depth0 {\n list-style-type: disc;\n}\n\n.public-DraftStyleDefault-unorderedListItem.public-DraftStyleDefault-depth1 {\n list-style-type: circle;\n}\n\n/**\n * Ordered list item counters are managed with CSS, since all list nesting is\n * purely visual.\n */\n\n.public-DraftStyleDefault-orderedListItem {\n list-style-type: none;\n position: relative;\n}\n\n/* @noflip */\n\n.public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-listLTR:before {\n left: -36px;\n position: absolute;\n text-align: right;\n width: 30px;\n}\n\n/* @noflip */\n\n.public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-listRTL:before {\n position: absolute;\n right: -36px;\n text-align: left;\n width: 30px;\n}\n\n/**\n * Counters are reset in JavaScript. If you need different counter styles,\n * override these rules. If you need more nesting, create your own rules to\n * do so.\n */\n\n.public-DraftStyleDefault-orderedListItem:before {\n content: counter(ol0) ". ";\n counter-increment: ol0;\n}\n\n.public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth1:before {\n content: counter(ol1) ". ";\n counter-increment: ol1;\n}\n\n.public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth2:before {\n content: counter(ol2) ". ";\n counter-increment: ol2;\n}\n\n.public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth3:before {\n content: counter(ol3) ". ";\n counter-increment: ol3;\n}\n\n.public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth4:before {\n content: counter(ol4) ". ";\n counter-increment: ol4;\n}\n\n.public-DraftStyleDefault-depth0.public-DraftStyleDefault-reset {\n counter-reset: ol0;\n}\n\n.public-DraftStyleDefault-depth1.public-DraftStyleDefault-reset {\n counter-reset: ol1;\n}\n\n.public-DraftStyleDefault-depth2.public-DraftStyleDefault-reset {\n counter-reset: ol2;\n}\n\n.public-DraftStyleDefault-depth3.public-DraftStyleDefault-reset {\n counter-reset: ol3;\n}\n\n.public-DraftStyleDefault-depth4.public-DraftStyleDefault-reset {\n counter-reset: ol4;\n}\n';
}, /* 209 */
/***/
function(module, exports, __webpack_require__) {
// style-loader: Adds some css to the DOM by adding a <style> tag
// load the styles
var content = __webpack_require__(210);
"string" == typeof content && (content = [ [ module.id, content, "" ] ]);
// add the styles to the DOM
__webpack_require__(165)(content, {
sourceMap: !0
});
content.locals && (module.exports = content.locals);
}, /* 210 */
/***/
function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__(164)(), // imports
// module
exports.push([ module.id, ".RichTextEditor__root___2QXK-{background:#fff;border:1px solid #ddd;border-radius:3px;font-family:Georgia,serif;font-size:14px}.RichTextEditor__editor___1QqIU{cursor:text;font-size:16px}.RichTextEditor__editor___1QqIU .public-DraftEditor-content,.RichTextEditor__editor___1QqIU .public-DraftEditorPlaceholder-root{margin:0;padding:9px}.RichTextEditor__editor___1QqIU .public-DraftEditor-content{overflow:auto}.RichTextEditor__hidePlaceholder___3WLid .public-DraftEditorPlaceholder-root{display:none}.RichTextEditor__editor___1QqIU .RichTextEditor__paragraph___3NTf9,.RichTextEditor__editor___1QqIU pre{margin:14px 0}.RichTextEditor__editor___1QqIU .RichTextEditor__codeBlock____KD4Q{background-color:#f3f3f3;font-family:Inconsolata,Menlo,Consolas,monospace;font-size:16px;margin:14px 0;padding:20px}.RichTextEditor__editor___1QqIU .RichTextEditor__codeBlock____KD4Q span[style]{padding:0!important}.RichTextEditor__editor___1QqIU .RichTextEditor__blockquote___1vCYl{border-left:5px solid #eee;color:#666;font-family:Hoefler Text,Georgia,serif;font-style:italic;margin:16px 0;padding:10px 20px}.RichTextEditor__editor___1QqIU .RichTextEditor__block___2Vs_D:first-child,.RichTextEditor__editor___1QqIU ol:first-child,.RichTextEditor__editor___1QqIU pre:first-child,.RichTextEditor__editor___1QqIU ul:first-child{margin-top:0}.RichTextEditor__editor___1QqIU .RichTextEditor__block___2Vs_D:last-child,.RichTextEditor__editor___1QqIU ol:last-child,.RichTextEditor__editor___1QqIU pre:last-child,.RichTextEditor__editor___1QqIU ul:last-child{margin-bottom:0}", "" ]),
// exports
exports.locals = {
root: "RichTextEditor__root___2QXK-",
editor: "RichTextEditor__editor___1QqIU",
hidePlaceholder: "RichTextEditor__hidePlaceholder___3WLid",
paragraph: "RichTextEditor__paragraph___3NTf9",
codeBlock: "RichTextEditor__codeBlock____KD4Q",
blockquote: "RichTextEditor__blockquote___1vCYl",
block: "RichTextEditor__block___2Vs_D"
};
} ]);
/***/ },
/* 1217 */
/*!**********************************************!*\
!*** ./app/containers/FinalStepContainer.js ***!
\**********************************************/
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _reactRedux = __webpack_require__(/*! react-redux */ 200);
var _Actions = __webpack_require__(/*! Actions */ 229);
var _FinalStep = __webpack_require__(/*! FinalStep */ 1218);
var _FinalStep2 = _interopRequireDefault(_FinalStep);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var mapStateToProps = function mapStateToProps(state) {
return { busy: state.finalStep.busy };
};
var mapDispatchToProps = function mapDispatchToProps(dispatch) {
return {
toggleBusy: function toggleBusy() {
return dispatch((0, _Actions.toggleFinalStepBusy)());
}
};
};
var FinalStepContainer = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_FinalStep2.default);
exports.default = FinalStepContainer;
/***/ },
/* 1218 */
/*!*************************************!*\
!*** ./app/components/FinalStep.js ***!
\*************************************/
/***/ 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__(/*! react */ 2);
var _react2 = _interopRequireDefault(_react);
var _semanticUiReact = __webpack_require__(/*! semantic-ui-react */ 532);
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 FinalStep = function (_React$Component) {
_inherits(FinalStep, _React$Component);
function FinalStep() {
_classCallCheck(this, FinalStep);
return _possibleConstructorReturn(this, (FinalStep.__proto__ || Object.getPrototypeOf(FinalStep)).apply(this, arguments));
}
_createClass(FinalStep, [{
key: 'componentWillMount',
value: function componentWillMount() {
// stuff
}
}, {
key: 'render',
value: function render() {
var _props = this.props,
busy = _props.busy,
toggleBusy = _props.toggleBusy;
return _react2.default.createElement(
'div',
null,
_react2.default.createElement(
_semanticUiReact.Dimmer.Dimmable,
{ as: _semanticUiReact.Segment, dimmed: busy, style: FinalStep.style },
_react2.default.createElement(
_semanticUiReact.Dimmer,
{ active: busy, inverted: busy },
_react2.default.createElement(
_semanticUiReact.Loader,
{ size: 'large' },
'Dotting the t\'s and crossing the i\'s...'
)
),
'There is stuff in here probably'
)
);
}
}]);
return FinalStep;
}(_react2.default.Component);
FinalStep.propTypes = {
busy: _react2.default.PropTypes.bool.isRequired,
toggleBusy: _react2.default.PropTypes.func
};
FinalStep.defaultProps = {
toggleBusy: function toggleBusy() {
return null;
}
};
FinalStep.style = {
height: '350px'
};
exports.default = FinalStep;
/***/ }
/******/ ]);
//# sourceMappingURL=bundle.js.map