joyent-portal/packages/ui-toolkit/styleguide/build/bundle.968e47c5.js

123498 lines
3.7 MiB
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/******/ (function(modules) { // webpackBootstrap
/******/ // install a JSONP callback for chunk loading
/******/ var parentJsonpFunction = window["webpackJsonp"];
/******/ window["webpackJsonp"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {
/******/ // add "moreModules" to the modules object,
/******/ // then flag all "chunkIds" as loaded and fire callback
/******/ var moduleId, chunkId, i = 0, resolves = [], result;
/******/ for(;i < chunkIds.length; i++) {
/******/ chunkId = chunkIds[i];
/******/ if(installedChunks[chunkId]) {
/******/ resolves.push(installedChunks[chunkId][0]);
/******/ }
/******/ installedChunks[chunkId] = 0;
/******/ }
/******/ for(moduleId in moreModules) {
/******/ if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {
/******/ modules[moduleId] = moreModules[moduleId];
/******/ }
/******/ }
/******/ if(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);
/******/ while(resolves.length) {
/******/ resolves.shift()();
/******/ }
/******/
/******/ };
/******/
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // objects to store loaded and loading chunks
/******/ var installedChunks = {
/******/ 1: 0
/******/ };
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/ // This file contains only the entry chunk.
/******/ // The chunk loading function for additional chunks
/******/ __webpack_require__.e = function requireEnsure(chunkId) {
/******/ var installedChunkData = installedChunks[chunkId];
/******/ if(installedChunkData === 0) {
/******/ return new Promise(function(resolve) { resolve(); });
/******/ }
/******/
/******/ // a Promise means "currently loading".
/******/ if(installedChunkData) {
/******/ return installedChunkData[2];
/******/ }
/******/
/******/ // setup Promise in chunk cache
/******/ var promise = new Promise(function(resolve, reject) {
/******/ installedChunkData = installedChunks[chunkId] = [resolve, reject];
/******/ });
/******/ installedChunkData[2] = promise;
/******/
/******/ // start chunk loading
/******/ var head = document.getElementsByTagName('head')[0];
/******/ var script = document.createElement('script');
/******/ script.type = 'text/javascript';
/******/ script.charset = 'utf-8';
/******/ script.async = true;
/******/ script.timeout = 120000;
/******/
/******/ if (__webpack_require__.nc) {
/******/ script.setAttribute("nonce", __webpack_require__.nc);
/******/ }
/******/ script.src = __webpack_require__.p + "build/" + ({}[chunkId]||chunkId) + "." + {"0":"8d987fcd"}[chunkId] + ".js";
/******/ var timeout = setTimeout(onScriptComplete, 120000);
/******/ script.onerror = script.onload = onScriptComplete;
/******/ function onScriptComplete() {
/******/ // avoid mem leaks in IE.
/******/ script.onerror = script.onload = null;
/******/ clearTimeout(timeout);
/******/ var chunk = installedChunks[chunkId];
/******/ if(chunk !== 0) {
/******/ if(chunk) {
/******/ chunk[1](new Error('Loading chunk ' + chunkId + ' failed.'));
/******/ }
/******/ installedChunks[chunkId] = undefined;
/******/ }
/******/ };
/******/ head.appendChild(script);
/******/
/******/ return promise;
/******/ };
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // identity function for calling harmony imports with the correct context
/******/ __webpack_require__.i = function(value) { return value; };
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // on error function for async loading
/******/ __webpack_require__.oe = function(err) { console.error(err); throw err; };
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 1035);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
module.exports = __webpack_require__(60);
/***/ }),
/* 1 */
/***/ (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.
*/
if (false) {
var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' &&
Symbol.for &&
Symbol.for('react.element')) ||
0xeac7;
var isValidElement = function(object) {
return typeof object === 'object' &&
object !== null &&
object.$$typeof === REACT_ELEMENT_TYPE;
};
// By explicitly using `prop-types` you are opting into new development behavior.
// http://fb.me/prop-types-in-prod
var throwOnDirectAccess = true;
module.exports = require('./factoryWithTypeCheckers')(isValidElement, throwOnDirectAccess);
} else {
// By explicitly using `prop-types` you are opting into new production behavior.
// http://fb.me/prop-types-in-prod
module.exports = __webpack_require__(712)();
}
/***/ }),
/* 2 */
/***/ (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.
*
*/
/**
* 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 (false) {
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;
/***/ }),
/* 3 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(process) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return css; });
/* unused harmony export keyframes */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return injectGlobal; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return ThemeProvider; });
/* unused harmony export withTheme */
/* unused harmony export ServerStyleSheet */
/* unused harmony export StyleSheetManager */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_stylis__ = __webpack_require__(1016);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_stylis___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_stylis__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_react__);
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in 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$2(string) {
return string.replace(_uppercasePattern, '-$1').toLowerCase();
}
var hyphenate_1 = hyphenate$2;
var hyphenate = hyphenate_1;
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-');
}
var hyphenateStyleName_1 = hyphenateStyleName;
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
return typeof obj;
} : function (obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};
var classCallCheck = function (instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
};
var createClass = function () {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function (Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
var _extends = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
var inherits = function (subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
};
var objectWithoutProperties = function (obj, keys) {
var target = {};
for (var i in obj) {
if (keys.indexOf(i) >= 0) continue;
if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;
target[i] = obj[i];
}
return target;
};
var possibleConstructorReturn = function (self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && (typeof call === "object" || typeof call === "function") ? call : self;
};
/*!
* isobject <https://github.com/jonschlinkert/isobject>
*
* Copyright (c) 2014-2015, Jon Schlinkert.
* Licensed under the MIT License.
*/
var index$1 = function isObject(val) {
return val != null && (typeof val === 'undefined' ? 'undefined' : _typeof(val)) === 'object' && !Array.isArray(val);
};
var isObject$1 = index$1;
function isObjectObject(o) {
return isObject$1(o) === true && Object.prototype.toString.call(o) === '[object Object]';
}
var index = function isPlainObject(o) {
var ctor, prot;
if (isObjectObject(o) === false) return false;
// If has modified constructor
ctor = o.constructor;
if (typeof ctor !== 'function') return false;
// If has modified prototype
prot = ctor.prototype;
if (isObjectObject(prot) === false) return false;
// If constructor does not have an Object-specific method
if (prot.hasOwnProperty('isPrototypeOf') === false) {
return false;
}
// Most likely a plain Object
return true;
};
//
var objToCss = function objToCss(obj, prevKey) {
var css = Object.keys(obj).map(function (key) {
if (index(obj[key])) return objToCss(obj[key], key);
return hyphenateStyleName_1(key) + ': ' + obj[key] + ';';
}).join(' ');
return prevKey ? prevKey + ' {\n ' + css + '\n}' : css;
};
var flatten = function flatten(chunks, executionContext) {
return chunks.reduce(function (ruleSet, chunk) {
/* Remove falsey values */
if (chunk === undefined || chunk === null || chunk === false || chunk === '') return ruleSet;
/* Flatten ruleSet */
if (Array.isArray(chunk)) return [].concat(ruleSet, flatten(chunk, executionContext));
/* Handle other components */
// $FlowFixMe not sure how to make this pass
if (chunk.hasOwnProperty('styledComponentId')) return [].concat(ruleSet, ['.' + chunk.styledComponentId]);
/* Either execute or defer the function */
if (typeof chunk === 'function') {
return executionContext ? ruleSet.concat.apply(ruleSet, flatten([chunk(executionContext)], executionContext)) : ruleSet.concat(chunk);
}
/* Handle objects */
// $FlowFixMe have to add %checks somehow to isPlainObject
return ruleSet.concat(index(chunk) ? objToCss(chunk) : chunk.toString());
}, []);
};
//
var stringifyRules = function stringifyRules(rules, selector, prefix) {
var flatCSS = rules.join('').replace(/^\s*\/\/.*$/gm, ''); // replace JS comments
var cssStr = selector && prefix ? prefix + ' ' + selector + ' { ' + flatCSS + ' }' : flatCSS;
var css = __WEBPACK_IMPORTED_MODULE_0_stylis___default()(prefix || !selector ? '' : selector, cssStr, false, false);
return css;
};
//
var chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('');
var charsLength = chars.length;
/* Some high number, usually 9-digit base-10. Map it to base-😎 */
var generateAlphabeticName = function generateAlphabeticName(code) {
var name = '';
var x = void 0;
for (x = code; x > charsLength; x = Math.floor(x / chars.length)) {
name = chars[x % charsLength] + name;
}
return chars[x % charsLength] + name;
};
//
var interleave = (function (strings, interpolations) {
return interpolations.reduce(function (array, interp, i) {
return array.concat(interp, strings[i + 1]);
}, [strings[0]]);
});
//
var css = (function (strings) {
for (var _len = arguments.length, interpolations = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
interpolations[_key - 1] = arguments[_key];
}
return flatten(interleave(strings, interpolations));
});
//
var SC_COMPONENT_ID = /^[^\S\n]*?\/\* sc-component-id:\s+(\S+)\s+\*\//mg;
var extractCompsFromCSS = (function (maybeCSS) {
var css = '' + (maybeCSS || ''); // Definitely a string, and a clone
var existingComponents = [];
css.replace(SC_COMPONENT_ID, function (match, componentId, matchIndex) {
existingComponents.push({ componentId: componentId, matchIndex: matchIndex });
return match;
});
return existingComponents.map(function (_ref, i) {
var componentId = _ref.componentId,
matchIndex = _ref.matchIndex;
var nextComp = existingComponents[i + 1];
var cssFromDOM = nextComp ? css.slice(matchIndex, nextComp.matchIndex) : css.slice(matchIndex);
return { componentId: componentId, cssFromDOM: cssFromDOM };
});
});
//
/*
* Browser Style Sheet with Rehydration
*
* <style data-styled-components="x y z"
* data-styled-components-is-local="true">
* /· sc-component-id: a ·/
* .sc-a { ... }
* .x { ... }
* /· sc-component-id: b ·/
* .sc-b { ... }
* .y { ... }
* .z { ... }
* </style>
*
* Note: replace · with * in the above snippet.
* */
var COMPONENTS_PER_TAG = 40;
var BrowserTag = function () {
function BrowserTag(el, isLocal) {
var existingSource = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
classCallCheck(this, BrowserTag);
this.el = el;
this.isLocal = isLocal;
this.ready = false;
var extractedComps = extractCompsFromCSS(existingSource);
this.size = extractedComps.length;
this.components = extractedComps.reduce(function (acc, obj) {
acc[obj.componentId] = obj; // eslint-disable-line no-param-reassign
return acc;
}, {});
}
BrowserTag.prototype.isFull = function isFull() {
return this.size >= COMPONENTS_PER_TAG;
};
BrowserTag.prototype.addComponent = function addComponent(componentId) {
if (!this.ready) this.replaceElement();
if (this.components[componentId]) throw new Error('Trying to add Component \'' + componentId + '\' twice!');
var comp = { componentId: componentId, textNode: document.createTextNode('') };
this.el.appendChild(comp.textNode);
this.size += 1;
this.components[componentId] = comp;
};
BrowserTag.prototype.inject = function inject(componentId, css, name) {
if (!this.ready) this.replaceElement();
var comp = this.components[componentId];
if (!comp) throw new Error('Must add a new component before you can inject css into it');
if (comp.textNode.data === '') comp.textNode.appendData('\n/* sc-component-id: ' + componentId + ' */\n');
comp.textNode.appendData(css);
if (name) {
var existingNames = this.el.getAttribute(SC_ATTR);
this.el.setAttribute(SC_ATTR, existingNames ? existingNames + ' ' + name : name);
}
};
BrowserTag.prototype.toHTML = function toHTML() {
return this.el.outerHTML;
};
BrowserTag.prototype.toReactElement = function toReactElement() {
throw new Error('BrowserTag doesn\'t implement toReactElement!');
};
BrowserTag.prototype.clone = function clone() {
throw new Error('BrowserTag cannot be cloned!');
};
/* Because we care about source order, before we can inject anything we need to
* create a text node for each component and replace the existing CSS. */
BrowserTag.prototype.replaceElement = function replaceElement() {
var _this = this;
this.ready = true;
// We have nothing to inject. Use the current el.
if (this.size === 0) return;
// Build up our replacement style tag
var newEl = this.el.cloneNode();
newEl.appendChild(document.createTextNode('\n'));
Object.keys(this.components).forEach(function (key) {
var comp = _this.components[key];
// eslint-disable-next-line no-param-reassign
comp.textNode = document.createTextNode(comp.cssFromDOM);
newEl.appendChild(comp.textNode);
});
if (!this.el.parentNode) throw new Error("Trying to replace an element that wasn't mounted!");
// The ol' switcheroo
this.el.parentNode.replaceChild(newEl, this.el);
this.el = newEl;
};
return BrowserTag;
}();
/* Factory function to separate DOM operations from logical ones*/
var BrowserStyleSheet = {
create: function create() {
var tags = [];
var names = {};
/* Construct existing state from DOM */
var nodes = document.querySelectorAll('[' + SC_ATTR + ']');
var nodesLength = nodes.length;
for (var i = 0; i < nodesLength; i += 1) {
var el = nodes[i];
tags.push(new BrowserTag(el, el.getAttribute(LOCAL_ATTR) === 'true', el.innerHTML));
var attr = el.getAttribute(SC_ATTR);
if (attr) {
attr.trim().split(/\s+/).forEach(function (name) {
names[name] = true;
});
}
}
/* Factory for making more tags */
var tagConstructor = function tagConstructor(isLocal) {
var el = document.createElement('style');
el.type = 'text/css';
el.setAttribute(SC_ATTR, '');
el.setAttribute(LOCAL_ATTR, isLocal ? 'true' : 'false');
if (!document.head) throw new Error('Missing document <head>');
document.head.appendChild(el);
return new BrowserTag(el, isLocal);
};
return new StyleSheet(tagConstructor, tags, names);
}
};
//
var SC_ATTR = 'data-styled-components';
var LOCAL_ATTR = 'data-styled-components-is-local';
var CONTEXT_KEY = '__styled-components-stylesheet__';
var instance = null;
// eslint-disable-next-line no-use-before-define
var clones = [];
var StyleSheet = function () {
function StyleSheet(tagConstructor) {
var tags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
var names = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
classCallCheck(this, StyleSheet);
this.hashes = {};
this.deferredInjections = {};
this.tagConstructor = tagConstructor;
this.tags = tags;
this.names = names;
this.constructComponentTagMap();
}
StyleSheet.prototype.constructComponentTagMap = function constructComponentTagMap() {
var _this = this;
this.componentTags = {};
this.tags.forEach(function (tag) {
Object.keys(tag.components).forEach(function (componentId) {
_this.componentTags[componentId] = tag;
});
});
};
/* Best level of caching—get the name from the hash straight away. */
StyleSheet.prototype.getName = function getName(hash) {
return this.hashes[hash.toString()];
};
/* Second level of caching—if the name is already in the dom, don't
* inject anything and record the hash for getName next time. */
StyleSheet.prototype.alreadyInjected = function alreadyInjected(hash, name) {
if (!this.names[name]) return false;
this.hashes[hash.toString()] = name;
return true;
};
/* Third type of caching—don't inject components' componentId twice. */
StyleSheet.prototype.hasInjectedComponent = function hasInjectedComponent(componentId) {
return !!this.componentTags[componentId];
};
StyleSheet.prototype.deferredInject = function deferredInject(componentId, isLocal, css) {
if (this === instance) {
clones.forEach(function (clone) {
clone.deferredInject(componentId, isLocal, css);
});
}
this.getOrCreateTag(componentId, isLocal);
this.deferredInjections[componentId] = css;
};
StyleSheet.prototype.inject = function inject(componentId, isLocal, css, hash, name) {
if (this === instance) {
clones.forEach(function (clone) {
clone.inject(componentId, isLocal, css);
});
}
var tag = this.getOrCreateTag(componentId, isLocal);
var deferredInjection = this.deferredInjections[componentId];
if (deferredInjection) {
tag.inject(componentId, deferredInjection);
delete this.deferredInjections[componentId];
}
tag.inject(componentId, css, name);
if (hash && name) {
this.hashes[hash.toString()] = name;
}
};
StyleSheet.prototype.toHTML = function toHTML() {
return this.tags.map(function (tag) {
return tag.toHTML();
}).join('');
};
StyleSheet.prototype.toReactElements = function toReactElements() {
return this.tags.map(function (tag, i) {
return tag.toReactElement('sc-' + i);
});
};
StyleSheet.prototype.getOrCreateTag = function getOrCreateTag(componentId, isLocal) {
var existingTag = this.componentTags[componentId];
if (existingTag) {
return existingTag;
}
var lastTag = this.tags[this.tags.length - 1];
var componentTag = !lastTag || lastTag.isFull() || lastTag.isLocal !== isLocal ? this.createNewTag(isLocal) : lastTag;
this.componentTags[componentId] = componentTag;
componentTag.addComponent(componentId);
return componentTag;
};
StyleSheet.prototype.createNewTag = function createNewTag(isLocal) {
var newTag = this.tagConstructor(isLocal);
this.tags.push(newTag);
return newTag;
};
StyleSheet.reset = function reset(isServer) {
instance = StyleSheet.create(isServer);
};
/* We can make isServer totally implicit once Jest 20 drops and we
* can change environment on a per-test basis. */
StyleSheet.create = function create() {
var isServer = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : typeof document === 'undefined';
return (isServer ? ServerStyleSheet : BrowserStyleSheet).create();
};
StyleSheet.clone = function clone(oldSheet) {
var newSheet = new StyleSheet(oldSheet.tagConstructor, oldSheet.tags.map(function (tag) {
return tag.clone();
}), _extends({}, oldSheet.names));
newSheet.hashes = _extends({}, oldSheet.hashes);
newSheet.deferredInjections = _extends({}, oldSheet.deferredInjections);
clones.push(newSheet);
return newSheet;
};
createClass(StyleSheet, null, [{
key: 'instance',
get: function get() {
return instance || (instance = StyleSheet.create());
}
}]);
return StyleSheet;
}();
function createCommonjsModule(fn, module) {
return module = { exports: {} }, fn(module, module.exports), 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.
*
*
*/
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$1 = function emptyFunction$1() {};
emptyFunction$1.thatReturns = makeEmptyFunction;
emptyFunction$1.thatReturnsFalse = makeEmptyFunction(false);
emptyFunction$1.thatReturnsTrue = makeEmptyFunction(true);
emptyFunction$1.thatReturnsNull = makeEmptyFunction(null);
emptyFunction$1.thatReturnsThis = function () {
return this;
};
emptyFunction$1.thatReturnsArgument = function (arg) {
return arg;
};
var emptyFunction_1 = emptyFunction$1;
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in 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 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) {};
{
validateFormat = function validateFormat(format) {
if (format === undefined) {
throw new Error('invariant requires an error message argument');
}
};
}
function invariant$1(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;
}
}
var invariant_1 = invariant$1;
var emptyFunction$2 = emptyFunction_1;
/**
* 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$1 = emptyFunction$2;
{
(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$1 = function warning$1(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));
}
};
})();
}
var warning_1 = warning$1;
/**
* 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.
*/
var ReactPropTypesSecret$1 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
var ReactPropTypesSecret_1 = ReactPropTypesSecret$1;
{
var invariant$2 = invariant_1;
var warning$2 = warning_1;
var ReactPropTypesSecret$2 = ReactPropTypesSecret_1;
var loggedTypeFailures = {};
}
/**
* Assert that the values match with the type specs.
* Error messages are memorized and will only be shown once.
*
* @param {object} typeSpecs Map of name to a ReactPropType
* @param {object} values Runtime values that need to be type-checked
* @param {string} location e.g. "prop", "context", "child context"
* @param {string} componentName Name of the component for error messages.
* @param {?Function} getStack Returns the component stack.
* @private
*/
function checkPropTypes$1(typeSpecs, values, location, componentName, getStack) {
{
for (var typeSpecName in typeSpecs) {
if (typeSpecs.hasOwnProperty(typeSpecName)) {
var error;
// Prop type validation may throw. In case they do, we don't want to
// fail the render phase where it didn't fail before. So we log it.
// After these have been cleaned up, we'll let them throw.
try {
// This is intentionally an invariant that gets caught. It's the same
// behavior as without this statement except with a better message.
invariant$2(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', componentName || 'React class', location, typeSpecName);
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret$2);
} catch (ex) {
error = ex;
}
warning$2(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error === 'undefined' ? 'undefined' : _typeof(error));
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
// Only monitor this failure once because there tends to be a lot of the
// same error.
loggedTypeFailures[error.message] = true;
var stack = getStack ? getStack() : '';
warning$2(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '');
}
}
}
}
}
var checkPropTypes_1 = checkPropTypes$1;
var emptyFunction = emptyFunction_1;
var invariant = invariant_1;
var warning = warning_1;
var ReactPropTypesSecret = ReactPropTypesSecret_1;
var checkPropTypes = checkPropTypes_1;
var factoryWithTypeCheckers = function factoryWithTypeCheckers(isValidElement, throwOnDirectAccess) {
/* global Symbol */
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
/**
* Returns the iterator method function contained on the iterable object.
*
* Be sure to invoke the function with the iterable as context:
*
* var iteratorFn = getIteratorFn(myIterable);
* if (iteratorFn) {
* var iterator = iteratorFn.call(myIterable);
* ...
* }
*
* @param {?object} maybeIterable
* @return {?function}
*/
function getIteratorFn(maybeIterable) {
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
if (typeof iteratorFn === 'function') {
return iteratorFn;
}
}
/**
* Collection of methods that allow declaration and validation of props that are
* supplied to React components. Example usage:
*
* var Props = require('ReactPropTypes');
* var MyArticle = React.createClass({
* propTypes: {
* // An optional string prop named "description".
* description: Props.string,
*
* // A required enum prop named "category".
* category: Props.oneOf(['News','Photos']).isRequired,
*
* // A prop named "dialog" that requires an instance of Dialog.
* dialog: Props.instanceOf(Dialog).isRequired
* },
* render: function() { ... }
* });
*
* A more formal specification of how these methods are used:
*
* type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
* decl := ReactPropTypes.{type}(.isRequired)?
*
* Each and every declaration produces a function with the same signature. This
* allows the creation of custom validation functions. For example:
*
* var MyLink = React.createClass({
* propTypes: {
* // An optional string or URI prop named "href".
* href: function(props, propName, componentName) {
* var propValue = props[propName];
* if (propValue != null && typeof propValue !== 'string' &&
* !(propValue instanceof URI)) {
* return new Error(
* 'Expected a string or an URI for ' + propName + ' in ' +
* componentName
* );
* }
* }
* },
* render: function() {...}
* });
*
* @internal
*/
var ANONYMOUS = '<<anonymous>>';
// Important!
// Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
var ReactPropTypes = {
array: createPrimitiveTypeChecker('array'),
bool: createPrimitiveTypeChecker('boolean'),
func: createPrimitiveTypeChecker('function'),
number: createPrimitiveTypeChecker('number'),
object: createPrimitiveTypeChecker('object'),
string: createPrimitiveTypeChecker('string'),
symbol: createPrimitiveTypeChecker('symbol'),
any: createAnyTypeChecker(),
arrayOf: createArrayOfTypeChecker,
element: createElementTypeChecker(),
instanceOf: createInstanceTypeChecker,
node: createNodeChecker(),
objectOf: createObjectOfTypeChecker,
oneOf: createEnumTypeChecker,
oneOfType: createUnionTypeChecker,
shape: createShapeTypeChecker
};
/**
* 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) {
{
var manualPropTypeCallCache = {};
var manualPropTypeWarningCount = 0;
}
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
componentName = componentName || ANONYMOUS;
propFullName = propFullName || propName;
if (secret !== ReactPropTypesSecret) {
if (throwOnDirectAccess) {
// New behavior only for users of `prop-types` package
invariant(false, 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use `PropTypes.checkPropTypes()` to call them. ' + 'Read more at http://fb.me/use-check-prop-types');
} else if ("development" !== 'production' && typeof console !== 'undefined') {
// Old behavior for people using React.PropTypes
var cacheKey = componentName + ':' + propName;
if (!manualPropTypeCallCache[cacheKey] &&
// Avoid spamming the console because they are often not actionable except for lib authors
manualPropTypeWarningCount < 3) {
warning(false, 'You are manually calling a React.PropTypes validation ' + 'function for the `%s` prop on `%s`. This is deprecated ' + 'and will throw in the standalone `prop-types` package. ' + 'You may be seeing this warning due to a third-party PropTypes ' + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.', propFullName, componentName);
manualPropTypeCallCache[cacheKey] = true;
manualPropTypeWarningCount++;
}
}
}
if (props[propName] == null) {
if (isRequired) {
if (props[propName] === null) {
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
}
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
}
return null;
} else {
return validate(props, propName, componentName, location, propFullName);
}
}
var chainedCheckType = checkType.bind(null, false);
chainedCheckType.isRequired = checkType.bind(null, true);
return chainedCheckType;
}
function createPrimitiveTypeChecker(expectedType) {
function validate(props, propName, componentName, location, propFullName, secret) {
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== expectedType) {
// `propValue` being instance of, say, date/regexp, pass the 'object'
// check, but we can offer a more precise error message here rather than
// 'of type `object`'.
var preciseType = getPreciseType(propValue);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createAnyTypeChecker() {
return createChainableTypeChecker(emptyFunction.thatReturnsNull);
}
function createArrayOfTypeChecker(typeChecker) {
function validate(props, propName, componentName, location, propFullName) {
if (typeof typeChecker !== 'function') {
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
}
var propValue = props[propName];
if (!Array.isArray(propValue)) {
var propType = getPropType(propValue);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
}
for (var i = 0; i < propValue.length; i++) {
var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
if (error instanceof Error) {
return error;
}
}
return null;
}
return createChainableTypeChecker(validate);
}
function createElementTypeChecker() {
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
if (!isValidElement(propValue)) {
var propType = getPropType(propValue);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createInstanceTypeChecker(expectedClass) {
function validate(props, propName, componentName, location, propFullName) {
if (!(props[propName] instanceof expectedClass)) {
var expectedClassName = expectedClass.name || ANONYMOUS;
var actualClassName = getClassName(props[propName]);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createEnumTypeChecker(expectedValues) {
if (!Array.isArray(expectedValues)) {
warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.');
return emptyFunction.thatReturnsNull;
}
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
for (var i = 0; i < expectedValues.length; i++) {
if (is(propValue, expectedValues[i])) {
return null;
}
}
var valuesString = JSON.stringify(expectedValues);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
}
return createChainableTypeChecker(validate);
}
function createObjectOfTypeChecker(typeChecker) {
function validate(props, propName, componentName, location, propFullName) {
if (typeof typeChecker !== 'function') {
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
}
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== 'object') {
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
}
for (var key in propValue) {
if (propValue.hasOwnProperty(key)) {
var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
if (error instanceof Error) {
return error;
}
}
}
return null;
}
return createChainableTypeChecker(validate);
}
function createUnionTypeChecker(arrayOfTypeCheckers) {
if (!Array.isArray(arrayOfTypeCheckers)) {
warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.');
return emptyFunction.thatReturnsNull;
}
function validate(props, propName, componentName, location, propFullName) {
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
var checker = arrayOfTypeCheckers[i];
if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {
return null;
}
}
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
}
return createChainableTypeChecker(validate);
}
function createNodeChecker() {
function validate(props, propName, componentName, location, propFullName) {
if (!isNode(props[propName])) {
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createShapeTypeChecker(shapeTypes) {
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== 'object') {
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
}
for (var key in shapeTypes) {
var checker = shapeTypes[key];
if (!checker) {
continue;
}
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
if (error) {
return error;
}
}
return null;
}
return createChainableTypeChecker(validate);
}
function isNode(propValue) {
switch (typeof propValue === 'undefined' ? 'undefined' : _typeof(propValue)) {
case 'number':
case 'string':
case 'undefined':
return true;
case 'boolean':
return !propValue;
case 'object':
if (Array.isArray(propValue)) {
return propValue.every(isNode);
}
if (propValue === null || isValidElement(propValue)) {
return true;
}
var iteratorFn = getIteratorFn(propValue);
if (iteratorFn) {
var iterator = iteratorFn.call(propValue);
var step;
if (iteratorFn !== propValue.entries) {
while (!(step = iterator.next()).done) {
if (!isNode(step.value)) {
return false;
}
}
} else {
// Iterator will provide entry [k,v] tuples rather than values.
while (!(step = iterator.next()).done) {
var entry = step.value;
if (entry) {
if (!isNode(entry[1])) {
return false;
}
}
}
}
} else {
return false;
}
return true;
default:
return false;
}
}
function isSymbol(propType, propValue) {
// Native Symbol.
if (propType === 'symbol') {
return true;
}
// 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
if (propValue['@@toStringTag'] === 'Symbol') {
return true;
}
// Fallback for non-spec compliant Symbols which are polyfilled.
if (typeof Symbol === 'function' && propValue instanceof Symbol) {
return true;
}
return false;
}
// Equivalent of `typeof` but with special handling for array and regexp.
function getPropType(propValue) {
var propType = typeof propValue === 'undefined' ? 'undefined' : _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;
}
ReactPropTypes.checkPropTypes = checkPropTypes;
ReactPropTypes.PropTypes = ReactPropTypes;
return ReactPropTypes;
};
var index$3 = createCommonjsModule(function (module) {
/**
* 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.
*/
{
var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol.for && Symbol.for('react.element') || 0xeac7;
var isValidElement = function isValidElement(object) {
return (typeof object === 'undefined' ? 'undefined' : _typeof(object)) === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
};
// By explicitly using `prop-types` you are opting into new development behavior.
// http://fb.me/prop-types-in-prod
var throwOnDirectAccess = true;
module.exports = factoryWithTypeCheckers(isValidElement, throwOnDirectAccess);
}
});
var _StyleSheetManager$ch;
//
var StyleSheetManager = function (_Component) {
inherits(StyleSheetManager, _Component);
function StyleSheetManager() {
classCallCheck(this, StyleSheetManager);
return possibleConstructorReturn(this, _Component.apply(this, arguments));
}
StyleSheetManager.prototype.getChildContext = function getChildContext() {
var _ref;
return _ref = {}, _ref[CONTEXT_KEY] = this.props.sheet, _ref;
};
StyleSheetManager.prototype.render = function render() {
/* eslint-disable react/prop-types */
// $FlowFixMe
return __WEBPACK_IMPORTED_MODULE_1_react___default.a.Children.only(this.props.children);
};
return StyleSheetManager;
}(__WEBPACK_IMPORTED_MODULE_1_react__["Component"]);
StyleSheetManager.childContextTypes = (_StyleSheetManager$ch = {}, _StyleSheetManager$ch[CONTEXT_KEY] = index$3.instanceOf(StyleSheet).isRequired, _StyleSheetManager$ch);
StyleSheetManager.propTypes = {
sheet: index$3.instanceOf(StyleSheet).isRequired
};
//
var ServerTag = function () {
function ServerTag(isLocal) {
classCallCheck(this, ServerTag);
this.isLocal = isLocal;
this.components = {};
this.size = 0;
this.names = [];
}
ServerTag.prototype.isFull = function isFull() {
return false;
};
ServerTag.prototype.addComponent = function addComponent(componentId) {
if (this.components[componentId]) throw new Error('Trying to add Component \'' + componentId + '\' twice!');
this.components[componentId] = { componentId: componentId, css: '' };
this.size += 1;
};
ServerTag.prototype.inject = function inject(componentId, css, name) {
var comp = this.components[componentId];
if (!comp) throw new Error('Must add a new component before you can inject css into it');
if (comp.css === '') comp.css = '/* sc-component-id: ' + componentId + ' */\n';
comp.css += css.replace(/\n*$/, '\n');
if (name) this.names.push(name);
};
ServerTag.prototype.toHTML = function toHTML() {
var _this = this;
var namesAttr = SC_ATTR + '="' + this.names.join(' ') + '"';
var localAttr = LOCAL_ATTR + '="' + (this.isLocal ? 'true' : 'false') + '"';
var css = Object.keys(this.components).map(function (key) {
return _this.components[key].css;
}).join('');
return '<style type="text/css" ' + namesAttr + ' ' + localAttr + '>\n' + css + '\n</style>';
};
ServerTag.prototype.toReactElement = function toReactElement(key) {
var _attributes,
_this2 = this;
var attributes = (_attributes = {}, _attributes[SC_ATTR] = this.names.join(' '), _attributes[LOCAL_ATTR] = this.isLocal.toString(), _attributes);
var css = Object.keys(this.components).map(function (k) {
return _this2.components[k].css;
}).join('');
return __WEBPACK_IMPORTED_MODULE_1_react___default.a.createElement('style', _extends({
key: key, type: 'text/css' }, attributes, {
dangerouslySetInnerHTML: { __html: css }
}));
};
ServerTag.prototype.clone = function clone() {
var _this3 = this;
var copy = new ServerTag(this.isLocal);
copy.names = [].concat(this.names);
copy.size = this.size;
copy.components = Object.keys(this.components).reduce(function (acc, key) {
acc[key] = _extends({}, _this3.components[key]); // eslint-disable-line no-param-reassign
return acc;
}, {});
return copy;
};
return ServerTag;
}();
var ServerStyleSheet = function () {
function ServerStyleSheet() {
classCallCheck(this, ServerStyleSheet);
this.instance = StyleSheet.clone(StyleSheet.instance);
}
ServerStyleSheet.prototype.collectStyles = function collectStyles(children) {
if (this.closed) throw new Error("Can't collect styles once you've called getStyleTags!");
return __WEBPACK_IMPORTED_MODULE_1_react___default.a.createElement(
StyleSheetManager,
{ sheet: this.instance },
children
);
};
ServerStyleSheet.prototype.getStyleTags = function getStyleTags() {
if (!this.closed) {
clones.splice(clones.indexOf(this.instance), 1);
this.closed = true;
}
return this.instance.toHTML();
};
ServerStyleSheet.prototype.getStyleElement = function getStyleElement() {
if (!this.closed) {
clones.splice(clones.indexOf(this.instance), 1);
this.closed = true;
}
return this.instance.toReactElements();
};
ServerStyleSheet.create = function create() {
return new StyleSheet(function (isLocal) {
return new ServerTag(isLocal);
});
};
return ServerStyleSheet;
}();
//
var LIMIT = 200;
var createWarnTooManyClasses = (function (displayName) {
var generatedClasses = {};
var warningSeen = false;
return function (className) {
if (!warningSeen) {
generatedClasses[className] = true;
if (Object.keys(generatedClasses).length >= LIMIT) {
// Unable to find latestRule in test environment.
/* eslint-disable no-console, prefer-template */
console.warn('Over ' + LIMIT + ' classes were generated for component ' + displayName + '. ' + 'Consider using style property for frequently changed styles.\n' + 'Example:\n' + ' const StyledComp = styled.div`width: 100%;`\n' + ' <StyledComp style={{ background: background }} />');
warningSeen = true;
generatedClasses = {};
}
}
};
});
//
/* Trying to avoid the unknown-prop errors on styled components
by filtering by React's attribute whitelist.
*/
/* Logic copied from ReactDOMUnknownPropertyHook */
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,
className: true,
/* List copied from https://facebook.github.io/react/docs/events.html */
onCopy: true,
onCut: true,
onPaste: true,
onCompositionEnd: true,
onCompositionStart: true,
onCompositionUpdate: true,
onKeyDown: true,
onKeyPress: true,
onKeyUp: true,
onFocus: true,
onBlur: true,
onChange: true,
onInput: true,
onSubmit: true,
onClick: true,
onContextMenu: true,
onDoubleClick: true,
onDrag: true,
onDragEnd: true,
onDragEnter: true,
onDragExit: true,
onDragLeave: true,
onDragOver: true,
onDragStart: true,
onDrop: true,
onMouseDown: true,
onMouseEnter: true,
onMouseLeave: true,
onMouseMove: true,
onMouseOut: true,
onMouseOver: true,
onMouseUp: true,
onSelect: true,
onTouchCancel: true,
onTouchEnd: true,
onTouchMove: true,
onTouchStart: true,
onScroll: true,
onWheel: true,
onAbort: true,
onCanPlay: true,
onCanPlayThrough: true,
onDurationChange: true,
onEmptied: true,
onEncrypted: true,
onEnded: true,
onError: true,
onLoadedData: true,
onLoadedMetadata: true,
onLoadStart: true,
onPause: true,
onPlay: true,
onPlaying: true,
onProgress: true,
onRateChange: true,
onSeeked: true,
onSeeking: true,
onStalled: true,
onSuspend: true,
onTimeUpdate: true,
onVolumeChange: true,
onWaiting: true,
onLoad: true,
onAnimationStart: true,
onAnimationEnd: true,
onAnimationIteration: true,
onTransitionEnd: true,
onCopyCapture: true,
onCutCapture: true,
onPasteCapture: true,
onCompositionEndCapture: true,
onCompositionStartCapture: true,
onCompositionUpdateCapture: true,
onKeyDownCapture: true,
onKeyPressCapture: true,
onKeyUpCapture: true,
onFocusCapture: true,
onBlurCapture: true,
onChangeCapture: true,
onInputCapture: true,
onSubmitCapture: true,
onClickCapture: true,
onContextMenuCapture: true,
onDoubleClickCapture: true,
onDragCapture: true,
onDragEndCapture: true,
onDragEnterCapture: true,
onDragExitCapture: true,
onDragLeaveCapture: true,
onDragOverCapture: true,
onDragStartCapture: true,
onDropCapture: true,
onMouseDownCapture: true,
onMouseEnterCapture: true,
onMouseLeaveCapture: true,
onMouseMoveCapture: true,
onMouseOutCapture: true,
onMouseOverCapture: true,
onMouseUpCapture: true,
onSelectCapture: true,
onTouchCancelCapture: true,
onTouchEndCapture: true,
onTouchMoveCapture: true,
onTouchStartCapture: true,
onScrollCapture: true,
onWheelCapture: true,
onAbortCapture: true,
onCanPlayCapture: true,
onCanPlayThroughCapture: true,
onDurationChangeCapture: true,
onEmptiedCapture: true,
onEncryptedCapture: true,
onEndedCapture: true,
onErrorCapture: true,
onLoadedDataCapture: true,
onLoadedMetadataCapture: true,
onLoadStartCapture: true,
onPauseCapture: true,
onPlayCapture: true,
onPlayingCapture: true,
onProgressCapture: true,
onRateChangeCapture: true,
onSeekedCapture: true,
onSeekingCapture: true,
onStalledCapture: true,
onSuspendCapture: true,
onTimeUpdateCapture: true,
onVolumeChangeCapture: true,
onWaitingCapture: true,
onLoadCapture: true,
onAnimationStartCapture: true,
onAnimationEndCapture: true,
onAnimationIterationCapture: true,
onTransitionEndCapture: true
};
/* From HTMLDOMPropertyConfig */
var htmlProps = {
/**
* Standard Properties
*/
accept: true,
acceptCharset: true,
accessKey: true,
action: true,
allowFullScreen: true,
allowTransparency: true,
alt: true,
// specifies target context for links with `preload` type
as: true,
async: true,
autoComplete: true,
// autoFocus is polyfilled/normalized by AutoFocusUtils
// autoFocus: true,
autoPlay: true,
capture: true,
cellPadding: true,
cellSpacing: true,
charSet: true,
challenge: true,
checked: true,
cite: true,
classID: true,
className: true,
cols: true,
colSpan: true,
content: true,
contentEditable: true,
contextMenu: true,
controls: true,
coords: true,
crossOrigin: true,
data: true, // For `<object />` acts as `src`.
dateTime: true,
default: true,
defer: true,
dir: true,
disabled: true,
download: true,
draggable: true,
encType: true,
form: true,
formAction: true,
formEncType: true,
formMethod: true,
formNoValidate: true,
formTarget: true,
frameBorder: true,
headers: true,
height: true,
hidden: true,
high: true,
href: true,
hrefLang: true,
htmlFor: true,
httpEquiv: true,
icon: true,
id: true,
inputMode: true,
integrity: true,
is: true,
keyParams: true,
keyType: true,
kind: true,
label: true,
lang: true,
list: true,
loop: true,
low: true,
manifest: true,
marginHeight: true,
marginWidth: true,
max: true,
maxLength: true,
media: true,
mediaGroup: true,
method: true,
min: true,
minLength: true,
// Caution; `option.selected` is not updated if `select.multiple` is
// disabled with `removeAttribute`.
multiple: true,
muted: true,
name: true,
nonce: true,
noValidate: true,
open: true,
optimum: true,
pattern: true,
placeholder: true,
playsInline: true,
poster: true,
preload: true,
profile: true,
radioGroup: true,
readOnly: true,
referrerPolicy: true,
rel: true,
required: true,
reversed: true,
role: true,
rows: true,
rowSpan: true,
sandbox: true,
scope: true,
scoped: true,
scrolling: true,
seamless: true,
selected: true,
shape: true,
size: true,
sizes: true,
span: true,
spellCheck: true,
src: true,
srcDoc: true,
srcLang: true,
srcSet: true,
start: true,
step: true,
style: true,
summary: true,
tabIndex: true,
target: true,
title: true,
// Setting .type throws on non-<input> tags
type: true,
useMap: true,
value: true,
width: true,
wmode: true,
wrap: true,
/**
* RDFa Properties
*/
about: true,
datatype: true,
inlist: true,
prefix: true,
// property is also supported for OpenGraph in meta tags.
property: true,
resource: true,
typeof: true,
vocab: true,
/**
* Non-standard Properties
*/
// autoCapitalize and autoCorrect are supported in Mobile Safari for
// keyboard hints.
autoCapitalize: true,
autoCorrect: true,
// autoSave allows WebKit/Blink to persist values of input fields on page reloads
autoSave: true,
// color is for Safari mask-icon link
color: true,
// itemProp, itemScope, itemType are for
// Microdata support. See http://schema.org/docs/gs.html
itemProp: true,
itemScope: true,
itemType: true,
// 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: true,
itemRef: true,
// results show looking glass icon and recent searches on input
// search fields in WebKit/Blink
results: true,
// IE-only attribute that specifies security restrictions on an iframe
// as an alternative to the sandbox attribute on IE<10
security: true,
// IE-only attribute that controls focus behavior
unselectable: 0
};
var svgProps = {
accentHeight: true,
accumulate: true,
additive: true,
alignmentBaseline: true,
allowReorder: true,
alphabetic: true,
amplitude: true,
arabicForm: true,
ascent: true,
attributeName: true,
attributeType: true,
autoReverse: true,
azimuth: true,
baseFrequency: true,
baseProfile: true,
baselineShift: true,
bbox: true,
begin: true,
bias: true,
by: true,
calcMode: true,
capHeight: true,
clip: true,
clipPath: true,
clipRule: true,
clipPathUnits: true,
colorInterpolation: true,
colorInterpolationFilters: true,
colorProfile: true,
colorRendering: true,
contentScriptType: true,
contentStyleType: true,
cursor: true,
cx: true,
cy: true,
d: true,
decelerate: true,
descent: true,
diffuseConstant: true,
direction: true,
display: true,
divisor: true,
dominantBaseline: true,
dur: true,
dx: true,
dy: true,
edgeMode: true,
elevation: true,
enableBackground: true,
end: true,
exponent: true,
externalResourcesRequired: true,
fill: true,
fillOpacity: true,
fillRule: true,
filter: true,
filterRes: true,
filterUnits: true,
floodColor: true,
floodOpacity: true,
focusable: true,
fontFamily: true,
fontSize: true,
fontSizeAdjust: true,
fontStretch: true,
fontStyle: true,
fontVariant: true,
fontWeight: true,
format: true,
from: true,
fx: true,
fy: true,
g1: true,
g2: true,
glyphName: true,
glyphOrientationHorizontal: true,
glyphOrientationVertical: true,
glyphRef: true,
gradientTransform: true,
gradientUnits: true,
hanging: true,
horizAdvX: true,
horizOriginX: true,
ideographic: true,
imageRendering: true,
in: true,
in2: true,
intercept: true,
k: true,
k1: true,
k2: true,
k3: true,
k4: true,
kernelMatrix: true,
kernelUnitLength: true,
kerning: true,
keyPoints: true,
keySplines: true,
keyTimes: true,
lengthAdjust: true,
letterSpacing: true,
lightingColor: true,
limitingConeAngle: true,
local: true,
markerEnd: true,
markerMid: true,
markerStart: true,
markerHeight: true,
markerUnits: true,
markerWidth: true,
mask: true,
maskContentUnits: true,
maskUnits: true,
mathematical: true,
mode: true,
numOctaves: true,
offset: true,
opacity: true,
operator: true,
order: true,
orient: true,
orientation: true,
origin: true,
overflow: true,
overlinePosition: true,
overlineThickness: true,
paintOrder: true,
panose1: true,
pathLength: true,
patternContentUnits: true,
patternTransform: true,
patternUnits: true,
pointerEvents: true,
points: true,
pointsAtX: true,
pointsAtY: true,
pointsAtZ: true,
preserveAlpha: true,
preserveAspectRatio: true,
primitiveUnits: true,
r: true,
radius: true,
refX: true,
refY: true,
renderingIntent: true,
repeatCount: true,
repeatDur: true,
requiredExtensions: true,
requiredFeatures: true,
restart: true,
result: true,
rotate: true,
rx: true,
ry: true,
scale: true,
seed: true,
shapeRendering: true,
slope: true,
spacing: true,
specularConstant: true,
specularExponent: true,
speed: true,
spreadMethod: true,
startOffset: true,
stdDeviation: true,
stemh: true,
stemv: true,
stitchTiles: true,
stopColor: true,
stopOpacity: true,
strikethroughPosition: true,
strikethroughThickness: true,
string: true,
stroke: true,
strokeDasharray: true,
strokeDashoffset: true,
strokeLinecap: true,
strokeLinejoin: true,
strokeMiterlimit: true,
strokeOpacity: true,
strokeWidth: true,
surfaceScale: true,
systemLanguage: true,
tableValues: true,
targetX: true,
targetY: true,
textAnchor: true,
textDecoration: true,
textRendering: true,
textLength: true,
to: true,
transform: true,
u1: true,
u2: true,
underlinePosition: true,
underlineThickness: true,
unicode: true,
unicodeBidi: true,
unicodeRange: true,
unitsPerEm: true,
vAlphabetic: true,
vHanging: true,
vIdeographic: true,
vMathematical: true,
values: true,
vectorEffect: true,
version: true,
vertAdvY: true,
vertOriginX: true,
vertOriginY: true,
viewBox: true,
viewTarget: true,
visibility: true,
widths: true,
wordSpacing: true,
writingMode: true,
x: true,
xHeight: true,
x1: true,
x2: true,
xChannelSelector: true,
xlinkActuate: true,
xlinkArcrole: true,
xlinkHref: true,
xlinkRole: true,
xlinkShow: true,
xlinkTitle: true,
xlinkType: true,
xmlBase: true,
xmlns: true,
xmlnsXlink: true,
xmlLang: true,
xmlSpace: true,
y: true,
y1: true,
y2: true,
yChannelSelector: true,
z: true,
zoomAndPan: true
};
/* From DOMProperty */
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';
var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + '\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040';
var isCustomAttribute = RegExp.prototype.test.bind(new RegExp('^(data|aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$'));
var hasOwnProperty = {}.hasOwnProperty;
var validAttr = (function (name) {
return hasOwnProperty.call(htmlProps, name) || hasOwnProperty.call(svgProps, name) || isCustomAttribute(name.toLowerCase()) || hasOwnProperty.call(reactProps, name);
});
//
function isTag(target) /* : %checks */{
return typeof target === 'string';
}
//
function isStyledComponent(target) /* : %checks */{
return typeof target === 'function' && typeof target.styledComponentId === 'string';
}
//
/* eslint-disable no-undef */
function getComponentName(target) {
return target.displayName || target.name || 'Component';
}
var index$4 = isFunction;
var toString = Object.prototype.toString;
function isFunction(fn) {
var string = toString.call(fn);
return string === '[object Function]' || typeof fn === 'function' && string !== '[object RegExp]' || typeof window !== 'undefined' && (
// IE8 and below
fn === window.setTimeout || fn === window.alert || fn === window.confirm || fn === window.prompt);
}
//
/**
* Creates a broadcast that can be listened to, i.e. simple event emitter
*
* @see https://github.com/ReactTraining/react-broadcast
*/
var createBroadcast = function createBroadcast(initialValue) {
var listeners = [];
var currentValue = initialValue;
return {
publish: function publish(value) {
currentValue = value;
listeners.forEach(function (listener) {
return listener(currentValue);
});
},
subscribe: function subscribe(listener) {
listeners.push(listener);
// Publish to this subscriber once immediately.
listener(currentValue);
return function () {
listeners = listeners.filter(function (item) {
return item !== listener;
});
};
}
};
};
var _ThemeProvider$childC;
var _ThemeProvider$contex;
//
/* globals React$Element */
// NOTE: DO NOT CHANGE, changing this is a semver major change!
var CHANNEL = '__styled-components__';
/**
* Provide a theme to an entire react component tree via context and event listeners (have to do
* both context and event emitter as pure components block context updates)
*/
var ThemeProvider = function (_Component) {
inherits(ThemeProvider, _Component);
function ThemeProvider() {
classCallCheck(this, ThemeProvider);
var _this = possibleConstructorReturn(this, _Component.call(this));
_this.getTheme = _this.getTheme.bind(_this);
return _this;
}
ThemeProvider.prototype.componentWillMount = function componentWillMount() {
var _this2 = this;
// If there is a ThemeProvider wrapper anywhere around this theme provider, merge this theme
// with the outer theme
if (this.context[CHANNEL]) {
var subscribe = this.context[CHANNEL];
this.unsubscribeToOuter = subscribe(function (theme) {
_this2.outerTheme = theme;
});
}
this.broadcast = createBroadcast(this.getTheme());
};
ThemeProvider.prototype.getChildContext = function getChildContext() {
var _babelHelpers$extends;
return _extends({}, this.context, (_babelHelpers$extends = {}, _babelHelpers$extends[CHANNEL] = this.broadcast.subscribe, _babelHelpers$extends));
};
ThemeProvider.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
if (this.props.theme !== nextProps.theme) this.broadcast.publish(this.getTheme(nextProps.theme));
};
ThemeProvider.prototype.componentWillUnmount = function componentWillUnmount() {
if (this.context[CHANNEL]) {
this.unsubscribeToOuter();
}
};
// Get the theme from the props, supporting both (outerTheme) => {} as well as object notation
ThemeProvider.prototype.getTheme = function getTheme(passedTheme) {
var theme = passedTheme || this.props.theme;
if (index$4(theme)) {
var mergedTheme = theme(this.outerTheme);
if (!index(mergedTheme)) {
throw new Error('[ThemeProvider] Please return an object from your theme function, i.e. theme={() => ({})}!');
}
return mergedTheme;
}
if (!index(theme)) {
throw new Error('[ThemeProvider] Please make your theme prop a plain object');
}
return _extends({}, this.outerTheme, theme);
};
ThemeProvider.prototype.render = function render() {
if (!this.props.children) {
return null;
}
return __WEBPACK_IMPORTED_MODULE_1_react___default.a.Children.only(this.props.children);
};
return ThemeProvider;
}(__WEBPACK_IMPORTED_MODULE_1_react__["Component"]);
ThemeProvider.childContextTypes = (_ThemeProvider$childC = {}, _ThemeProvider$childC[CHANNEL] = index$3.func.isRequired, _ThemeProvider$childC);
ThemeProvider.contextTypes = (_ThemeProvider$contex = {}, _ThemeProvider$contex[CHANNEL] = index$3.func, _ThemeProvider$contex);
var _AbstractStyledCompon;
//
var AbstractStyledComponent = function (_Component) {
inherits(AbstractStyledComponent, _Component);
function AbstractStyledComponent() {
classCallCheck(this, AbstractStyledComponent);
return possibleConstructorReturn(this, _Component.apply(this, arguments));
}
return AbstractStyledComponent;
}(__WEBPACK_IMPORTED_MODULE_1_react__["Component"]);
AbstractStyledComponent.contextTypes = (_AbstractStyledCompon = {}, _AbstractStyledCompon[CHANNEL] = index$3.func, _AbstractStyledCompon[CONTEXT_KEY] = index$3.instanceOf(StyleSheet), _AbstractStyledCompon);
//
var escapeRegex = /[[\].#*$><+~=|^:(),"'`]/g;
var multiDashRegex = /--+/g;
var _StyledComponent = (function (ComponentStyle, constructWithOptions) {
/* We depend on components having unique IDs */
var identifiers = {};
var generateId = function generateId(_displayName) {
var displayName = typeof _displayName !== 'string' ? 'sc' : _displayName.replace(escapeRegex, '-') // Replace all possible CSS selectors
.replace(multiDashRegex, '-'); // Replace multiple -- with single -
var nr = (identifiers[displayName] || 0) + 1;
identifiers[displayName] = nr;
var hash = ComponentStyle.generateName(displayName + nr);
return displayName + '-' + hash;
};
var BaseStyledComponent = function (_AbstractStyledCompon) {
inherits(BaseStyledComponent, _AbstractStyledCompon);
function BaseStyledComponent() {
var _temp, _this, _ret;
classCallCheck(this, BaseStyledComponent);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = possibleConstructorReturn(this, _AbstractStyledCompon.call.apply(_AbstractStyledCompon, [this].concat(args))), _this), _this.attrs = {}, _this.state = {
theme: null,
generatedClassName: ''
}, _temp), possibleConstructorReturn(_this, _ret);
}
BaseStyledComponent.prototype.buildExecutionContext = function buildExecutionContext(theme, props) {
var attrs = this.constructor.attrs;
var context = _extends({}, props, { theme: theme });
if (attrs === undefined) {
return context;
}
this.attrs = Object.keys(attrs).reduce(function (acc, key) {
var attr = attrs[key];
// eslint-disable-next-line no-param-reassign
acc[key] = typeof attr === 'function' ? attr(context) : attr;
return acc;
}, {});
return _extends({}, context, this.attrs);
};
BaseStyledComponent.prototype.generateAndInjectStyles = function generateAndInjectStyles(theme, props) {
var _constructor = this.constructor,
componentStyle = _constructor.componentStyle,
warnTooManyClasses = _constructor.warnTooManyClasses;
var executionContext = this.buildExecutionContext(theme, props);
var styleSheet = this.context[CONTEXT_KEY] || StyleSheet.instance;
var className = componentStyle.generateAndInjectStyles(executionContext, styleSheet);
if (warnTooManyClasses !== undefined) warnTooManyClasses(className);
return className;
};
BaseStyledComponent.prototype.componentWillMount = function componentWillMount() {
var _this2 = this;
// If there is a theme in the context, subscribe to the event emitter. This
// is necessary due to pure components blocking context updates, this circumvents
// that by updating when an event is emitted
if (this.context[CHANNEL]) {
var subscribe = this.context[CHANNEL];
this.unsubscribe = subscribe(function (nextTheme) {
// This will be called once immediately
// Props should take precedence over ThemeProvider, which should take precedence over
// defaultProps, but React automatically puts defaultProps on props.
var defaultProps = _this2.constructor.defaultProps;
var isDefaultTheme = defaultProps && _this2.props.theme === defaultProps.theme;
var theme = _this2.props.theme && !isDefaultTheme ? _this2.props.theme : nextTheme;
var generatedClassName = _this2.generateAndInjectStyles(theme, _this2.props);
_this2.setState({ theme: theme, generatedClassName: generatedClassName });
});
} else {
var theme = this.props.theme || {};
var generatedClassName = this.generateAndInjectStyles(theme, this.props);
this.setState({ theme: theme, generatedClassName: generatedClassName });
}
};
BaseStyledComponent.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
var _this3 = this;
this.setState(function (oldState) {
// Props should take precedence over ThemeProvider, which should take precedence over
// defaultProps, but React automatically puts defaultProps on props.
var defaultProps = _this3.constructor.defaultProps;
var isDefaultTheme = defaultProps && nextProps.theme === defaultProps.theme;
var theme = nextProps.theme && !isDefaultTheme ? nextProps.theme : oldState.theme;
var generatedClassName = _this3.generateAndInjectStyles(theme, nextProps);
return { theme: theme, generatedClassName: generatedClassName };
});
};
BaseStyledComponent.prototype.componentWillUnmount = function componentWillUnmount() {
if (this.unsubscribe) {
this.unsubscribe();
}
};
BaseStyledComponent.prototype.render = function render() {
var _this4 = this;
var innerRef = this.props.innerRef;
var generatedClassName = this.state.generatedClassName;
var _constructor2 = this.constructor,
styledComponentId = _constructor2.styledComponentId,
target = _constructor2.target;
var isTargetTag = isTag(target);
var className = [this.props.className, styledComponentId, this.attrs.className, generatedClassName].filter(Boolean).join(' ');
var baseProps = _extends({}, this.attrs, {
className: className
});
if (isStyledComponent(target)) {
baseProps.innerRef = innerRef;
} else {
baseProps.ref = innerRef;
}
var propsForElement = Object.keys(this.props).reduce(function (acc, propName) {
// Don't pass through non HTML tags through to HTML elements
// always omit innerRef
if (propName !== 'innerRef' && propName !== 'className' && (!isTargetTag || validAttr(propName))) {
// eslint-disable-next-line no-param-reassign
acc[propName] = _this4.props[propName];
}
return acc;
}, baseProps);
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1_react__["createElement"])(target, propsForElement);
};
return BaseStyledComponent;
}(AbstractStyledComponent);
var createStyledComponent = function createStyledComponent(target, options, rules) {
var _StyledComponent$cont;
var _options$displayName = options.displayName,
displayName = _options$displayName === undefined ? isTag(target) ? 'styled.' + target : 'Styled(' + getComponentName(target) + ')' : _options$displayName,
_options$componentId = options.componentId,
componentId = _options$componentId === undefined ? generateId(options.displayName) : _options$componentId,
_options$ParentCompon = options.ParentComponent,
ParentComponent = _options$ParentCompon === undefined ? BaseStyledComponent : _options$ParentCompon,
extendingRules = options.rules,
attrs = options.attrs;
var styledComponentId = options.displayName && options.componentId ? options.displayName + '-' + options.componentId : componentId;
var warnTooManyClasses = void 0;
if (typeof process !== 'undefined' && "development" !== 'production') {
warnTooManyClasses = createWarnTooManyClasses(displayName);
}
var componentStyle = new ComponentStyle(extendingRules === undefined ? rules : extendingRules.concat(rules), styledComponentId);
var StyledComponent = function (_ParentComponent) {
inherits(StyledComponent, _ParentComponent);
function StyledComponent() {
classCallCheck(this, StyledComponent);
return possibleConstructorReturn(this, _ParentComponent.apply(this, arguments));
}
StyledComponent.withComponent = function withComponent(tag) {
var _ = options.displayName,
__ = options.componentId,
optionsToCopy = objectWithoutProperties(options, ['displayName', 'componentId']);
var newOptions = _extends({}, optionsToCopy, { ParentComponent: StyledComponent });
return createStyledComponent(tag, newOptions, rules);
};
createClass(StyledComponent, null, [{
key: 'extend',
get: function get() {
var _ = options.displayName,
__ = options.componentId,
optionsToCopy = objectWithoutProperties(options, ['displayName', 'componentId']);
var newOptions = _extends({}, optionsToCopy, { rules: rules, ParentComponent: StyledComponent });
return constructWithOptions(createStyledComponent, target, newOptions);
}
}]);
return StyledComponent;
}(ParentComponent);
StyledComponent.contextTypes = (_StyledComponent$cont = {}, _StyledComponent$cont[CHANNEL] = index$3.func, _StyledComponent$cont[CONTEXT_KEY] = index$3.instanceOf(StyleSheet), _StyledComponent$cont);
StyledComponent.displayName = displayName;
StyledComponent.styledComponentId = styledComponentId;
StyledComponent.attrs = attrs;
StyledComponent.componentStyle = componentStyle;
StyledComponent.warnTooManyClasses = warnTooManyClasses;
StyledComponent.target = target;
return StyledComponent;
};
return createStyledComponent;
});
// murmurhash2 via https://gist.github.com/raycmorgan/588423
function doHash(str, seed) {
var m = 0x5bd1e995;
var r = 24;
var h = seed ^ str.length;
var length = str.length;
var currentIndex = 0;
while (length >= 4) {
var k = UInt32(str, currentIndex);
k = Umul32(k, m);
k ^= k >>> r;
k = Umul32(k, m);
h = Umul32(h, m);
h ^= k;
currentIndex += 4;
length -= 4;
}
switch (length) {
case 3:
h ^= UInt16(str, currentIndex);
h ^= str.charCodeAt(currentIndex + 2) << 16;
h = Umul32(h, m);
break;
case 2:
h ^= UInt16(str, currentIndex);
h = Umul32(h, m);
break;
case 1:
h ^= str.charCodeAt(currentIndex);
h = Umul32(h, m);
break;
}
h ^= h >>> 13;
h = Umul32(h, m);
h ^= h >>> 15;
return h >>> 0;
}
function UInt32(str, pos) {
return str.charCodeAt(pos++) + (str.charCodeAt(pos++) << 8) + (str.charCodeAt(pos++) << 16) + (str.charCodeAt(pos) << 24);
}
function UInt16(str, pos) {
return str.charCodeAt(pos++) + (str.charCodeAt(pos++) << 8);
}
function Umul32(n, m) {
n = n | 0;
m = m | 0;
var nlo = n & 0xffff;
var nhi = n >>> 16;
var res = nlo * m + ((nhi * m & 0xffff) << 16) | 0;
return res;
}
//
/*
ComponentStyle is all the CSS-specific stuff, not
the React-specific stuff.
*/
var _ComponentStyle = (function (nameGenerator, flatten, stringifyRules) {
var ComponentStyle = function () {
function ComponentStyle(rules, componentId) {
classCallCheck(this, ComponentStyle);
this.rules = rules;
this.componentId = componentId;
if (!StyleSheet.instance.hasInjectedComponent(this.componentId)) {
var placeholder = '.' + componentId + ' {}';
StyleSheet.instance.deferredInject(componentId, true, placeholder);
}
}
/*
* Flattens a rule set into valid CSS
* Hashes it, wraps the whole chunk in a .hash1234 {}
* Returns the hash to be injected on render()
* */
ComponentStyle.prototype.generateAndInjectStyles = function generateAndInjectStyles(executionContext, styleSheet) {
var flatCSS = flatten(this.rules, executionContext);
var hash = doHash(this.componentId + flatCSS.join(''));
var existingName = styleSheet.getName(hash);
if (existingName) return existingName;
var name = nameGenerator(hash);
if (styleSheet.alreadyInjected(hash, name)) return name;
var css = '\n' + stringifyRules(flatCSS, '.' + name);
styleSheet.inject(this.componentId, true, css, hash, name);
return name;
};
ComponentStyle.generateName = function generateName(str) {
return nameGenerator(doHash(str));
};
return ComponentStyle;
}();
return ComponentStyle;
});
//
// Thanks to ReactDOMFactories for this handy list!
var domElements = ['a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'main', 'map', 'mark', 'menu', 'menuitem', 'meta', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'u', 'ul', 'var', 'video', 'wbr',
// SVG
'circle', 'clipPath', 'defs', 'ellipse', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'svg', 'text', 'tspan'];
//
var _styled = (function (styledComponent, constructWithOptions) {
var styled = function styled(tag) {
return constructWithOptions(styledComponent, tag);
};
// Shorthands for all valid HTML Elements
domElements.forEach(function (domElement) {
styled[domElement] = styled(domElement);
});
return styled;
});
//
var replaceWhitespace = function replaceWhitespace(str) {
return str.replace(/\s|\\n/g, '');
};
var _keyframes = (function (nameGenerator, stringifyRules, css) {
return function (strings) {
for (var _len = arguments.length, interpolations = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
interpolations[_key - 1] = arguments[_key];
}
var rules = css.apply(undefined, [strings].concat(interpolations));
var hash = doHash(replaceWhitespace(JSON.stringify(rules)));
var existingName = StyleSheet.instance.getName(hash);
if (existingName) return existingName;
var name = nameGenerator(hash);
if (StyleSheet.instance.alreadyInjected(hash, name)) return name;
var generatedCSS = stringifyRules(rules, name, '@keyframes');
StyleSheet.instance.inject('sc-keyframes-' + name, true, generatedCSS, hash, name);
return name;
};
});
//
var _injectGlobal = (function (stringifyRules, css) {
var injectGlobal = function injectGlobal(strings) {
for (var _len = arguments.length, interpolations = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
interpolations[_key - 1] = arguments[_key];
}
var rules = css.apply(undefined, [strings].concat(interpolations));
var hash = doHash(JSON.stringify(rules));
var componentId = 'sc-global-' + hash;
if (StyleSheet.instance.hasInjectedComponent(componentId)) return;
StyleSheet.instance.inject(componentId, false, stringifyRules(rules));
};
return injectGlobal;
});
//
var _constructWithOptions = (function (css) {
var constructWithOptions = function constructWithOptions(componentConstructor, tag) {
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
if (typeof tag !== 'string' && typeof tag !== 'function') {
// $FlowInvalidInputTest
throw new Error('Cannot create styled-component for component: ' + tag);
}
/* This is callable directly as a template function */
var templateFunction = function templateFunction(strings) {
for (var _len = arguments.length, interpolations = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
interpolations[_key - 1] = arguments[_key];
}
return componentConstructor(tag, options, css.apply(undefined, [strings].concat(interpolations)));
};
/* If config methods are called, wrap up a new template function and merge options */
templateFunction.withConfig = function (config) {
return constructWithOptions(componentConstructor, tag, _extends({}, options, config));
};
templateFunction.attrs = function (attrs) {
return constructWithOptions(componentConstructor, tag, _extends({}, options, {
attrs: _extends({}, options.attrs || {}, attrs) }));
};
return templateFunction;
};
return constructWithOptions;
});
/**
* Copyright 2015, Yahoo! Inc.
* Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
*/
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';
var index$5 = 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;
};
//
/* globals ReactClass */
var wrapWithTheme = function wrapWithTheme(Component$$1) {
var _WithTheme$contextTyp;
var componentName = Component$$1.displayName || Component$$1.name || 'Component';
var isStyledComponent$$1 = isStyledComponent(Component$$1);
var WithTheme = function (_React$Component) {
inherits(WithTheme, _React$Component);
function WithTheme() {
var _temp, _this, _ret;
classCallCheck(this, WithTheme);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = {}, _temp), possibleConstructorReturn(_this, _ret);
}
// NOTE: This is so that isStyledComponent passes for the innerRef unwrapping
WithTheme.prototype.componentWillMount = function componentWillMount() {
var _this2 = this;
if (!this.context[CHANNEL]) {
throw new Error('[withTheme] Please use ThemeProvider to be able to use withTheme');
}
var subscribe = this.context[CHANNEL];
this.unsubscribe = subscribe(function (theme) {
_this2.setState({ theme: theme });
});
};
WithTheme.prototype.componentWillUnmount = function componentWillUnmount() {
if (typeof this.unsubscribe === 'function') this.unsubscribe();
};
WithTheme.prototype.render = function render() {
// eslint-disable-next-line react/prop-types
var innerRef = this.props.innerRef;
var theme = this.state.theme;
return __WEBPACK_IMPORTED_MODULE_1_react___default.a.createElement(Component$$1, _extends({
theme: theme
}, this.props, {
innerRef: isStyledComponent$$1 ? innerRef : undefined,
ref: isStyledComponent$$1 ? undefined : innerRef
}));
};
return WithTheme;
}(__WEBPACK_IMPORTED_MODULE_1_react___default.a.Component);
WithTheme.displayName = 'WithTheme(' + componentName + ')';
WithTheme.styledComponentId = 'withTheme';
WithTheme.contextTypes = (_WithTheme$contextTyp = {}, _WithTheme$contextTyp[CHANNEL] = index$3.func, _WithTheme$contextTyp);
return index$5(WithTheme, Component$$1);
};
//
/* Import singletons */
/* Import singleton constructors */
/* Import components */
/* Import Higher Order Components */
/* Instantiate singletons */
var ComponentStyle = _ComponentStyle(generateAlphabeticName, flatten, stringifyRules);
var constructWithOptions = _constructWithOptions(css);
var StyledComponent = _StyledComponent(ComponentStyle, constructWithOptions);
/* Instantiate exported singletons */
var keyframes = _keyframes(generateAlphabeticName, stringifyRules, css);
var injectGlobal = _injectGlobal(stringifyRules, css);
var styled = _styled(StyledComponent, constructWithOptions);
/* harmony default export */ __webpack_exports__["a"] = (styled);
/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(45)))
/***/ }),
/* 4 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_unitcalc__ = __webpack_require__(193);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_unitcalc___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_unitcalc__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_styled_components__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_camel_case__ = __webpack_require__(418);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_camel_case___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_camel_case__);
var _templateObject = _taggedTemplateLiteral(['', ''], ['', '']);
function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
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 sides = ['top', 'right', 'bottom', 'left'];
var unitProps = function () {
var sided = function sided(rule) {
return sides.map(function (side) {
return rule + '-' + side;
});
};
var measures = ['margin', 'padding'].reduce(function (props, rule) {
return [].concat(_toConsumableArray(props), [rule], _toConsumableArray(sided(rule)));
}, []);
return sides.reduce(function (acc, side) {
return [].concat(_toConsumableArray(acc), ['border-' + side + '-width']);
}, ['border'].concat(_toConsumableArray(measures)));
}();
var unitsFromProps = function unitsFromProps(props) {
return unitProps.filter(function (measure) {
return props[__WEBPACK_IMPORTED_MODULE_2_camel_case___default()(measure)];
}).map(function (measure) {
return '\n ' + measure + ': ' + __WEBPACK_IMPORTED_MODULE_0_unitcalc___default()(props[__WEBPACK_IMPORTED_MODULE_2_camel_case___default()(measure)]) + ';\n ';
}).join(';\n');
};
/* harmony default export */ __webpack_exports__["a"] = (function (Component) {
return Component.extend ? Component.extend(_templateObject, unitsFromProps) : __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1_styled_components__["a" /* default */])(Component).withConfig({
displayName: 'baseline'
})(['', ''], unitsFromProps);
});
/***/ }),
/* 5 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var emptyFunction = __webpack_require__(17);
/**
* 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 (false) {
(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;
/***/ }),
/* 6 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__splice__ = __webpack_require__(963);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getIn__ = __webpack_require__(960);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__setIn__ = __webpack_require__(962);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__deepEqual__ = __webpack_require__(958);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__deleteIn__ = __webpack_require__(959);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__keys__ = __webpack_require__(961);
var structure = {
allowsArrayErrors: true,
empty: {},
emptyList: [],
getIn: __WEBPACK_IMPORTED_MODULE_1__getIn__["a" /* default */],
setIn: __WEBPACK_IMPORTED_MODULE_2__setIn__["a" /* default */],
deepEqual: __WEBPACK_IMPORTED_MODULE_3__deepEqual__["a" /* default */],
deleteIn: __WEBPACK_IMPORTED_MODULE_4__deleteIn__["a" /* default */],
fromJS: function fromJS(value) {
return value;
},
keys: __WEBPACK_IMPORTED_MODULE_5__keys__["a" /* default */],
size: function size(array) {
return array ? array.length : 0;
},
splice: __WEBPACK_IMPORTED_MODULE_0__splice__["a" /* default */],
toJS: function toJS(value) {
return value;
}
};
/* harmony default export */ __webpack_exports__["a"] = (structure);
/***/ }),
/* 7 */
/***/ (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.
*
*
*/
/**
* 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;
/***/ }),
/* 8 */
/***/ (function(module, exports, __webpack_require__) {
const flatten = __webpack_require__(354);
const BASE = 16;
const calc = (base, ...values) =>
flatten(values.map(value => String(value).split(/\s/gim)))
.map(value => `${Number(value.replace('px', '')) / base}rem`)
.join(' ');
module.exports = (...values) => calc(BASE, ...values);
module.exports.withBase = calc;
/***/ }),
/* 9 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
/* eslint-disable no-unused-vars */
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
var hasOwnProperty = Object.prototype.hasOwnProperty;
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
function toObject(val) {
if (val === null || val === undefined) {
throw new TypeError('Object.assign cannot be called with null or undefined');
}
return Object(val);
}
function shouldUseNative() {
try {
if (!Object.assign) {
return false;
}
// Detect buggy property enumeration order in older V8 versions.
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
test1[5] = 'de';
if (Object.getOwnPropertyNames(test1)[0] === '5') {
return false;
}
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
var test2 = {};
for (var i = 0; i < 10; i++) {
test2['_' + String.fromCharCode(i)] = i;
}
var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
return test2[n];
});
if (order2.join('') !== '0123456789') {
return false;
}
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
var test3 = {};
'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
test3[letter] = letter;
});
if (Object.keys(Object.assign({}, test3)).join('') !==
'abcdefghijklmnopqrst') {
return false;
}
return true;
} catch (err) {
// We don't expect any of the above to throw, but better to be safe.
return false;
}
}
module.exports = shouldUseNative() ? Object.assign : function (target, source) {
var from;
var to = toObject(target);
var symbols;
for (var s = 1; s < arguments.length; s++) {
from = Object(arguments[s]);
for (var key in from) {
if (hasOwnProperty.call(from, key)) {
to[key] = from[key];
}
}
if (getOwnPropertySymbols) {
symbols = getOwnPropertySymbols(from);
for (var i = 0; i < symbols.length; i++) {
if (propIsEnumerable.call(from, symbols[i])) {
to[symbols[i]] = from[symbols[i]];
}
}
}
}
return to;
};
/***/ }),
/* 10 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _Styled = __webpack_require__(849);
Object.defineProperty(exports, 'default', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Styled).default;
}
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/***/ }),
/* 11 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var _prodInvariant = __webpack_require__(7);
var DOMProperty = __webpack_require__(57);
var ReactDOMComponentFlags = __webpack_require__(272);
var invariant = __webpack_require__(2);
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 ? false ? 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) ? false ? 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 ? false ? 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;
/***/ }),
/* 12 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return isNot; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return isOr; });
/* unused harmony export isSomeNot */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_styled_components__ = __webpack_require__(381);
var index = ((...names) => (...args) => props => names.every(name => props[name]) ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* css */])(...args) : __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* css */]``);
const isNot = (...names) => (...args) => props => names.every(name => !props[name]) ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* css */])(...args) : __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* css */]``;
const isOr = (...names) => (...args) => props => names.some(name => props[name]) ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* css */])(...args) : __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* css */]``;
const isSomeNot = (...names) => (...args) => props => names.some(name => !props[name]) ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* css */])(...args) : __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* css */]``;
/* harmony default export */ __webpack_exports__["a"] = (index);
/***/ }),
/* 13 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* unused harmony export fontFamily */
/* unused harmony export semibold */
/* unused harmony export medium */
/* unused harmony export normal */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_styled_components__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__fonts__ = __webpack_require__(413);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_1__fonts__["a"]; });
var fontFamily = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_styled_components__["b" /* css */])(['font-family:"Libre Franklin",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica,sans-serif;']);
var semibold = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_styled_components__["b" /* css */])(['font-weight: 600;']);
var medium = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_styled_components__["b" /* css */])(['font-weight: 500;']);
var normal = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_styled_components__["b" /* css */])(['font-weight: 400;']);
/* harmony default export */ __webpack_exports__["a"] = ({
fontFamily: fontFamily,
semibold: semibold,
medium: medium,
normal: normal
});
/***/ }),
/* 14 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
exports.Subscriber = exports.Broadcast = undefined;
var _Broadcast2 = __webpack_require__(714);
var _Broadcast3 = _interopRequireDefault(_Broadcast2);
var _Subscriber2 = __webpack_require__(715);
var _Subscriber3 = _interopRequireDefault(_Subscriber2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.Broadcast = _Broadcast3.default;
exports.Subscriber = _Subscriber3.default;
/***/ }),
/* 15 */
/***/ (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 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;
/***/ }),
/* 16 */
/***/ (function(module, exports) {
var g;
// This works in non-strict mode
g = (function() {
return this;
})();
try {
// This works if eval is allowed (see CSP)
g = g || Function("return this")() || (1,eval)("this");
} catch(e) {
// This works if the window reference is available
if(typeof window === "object")
g = window;
}
// g can still be undefined, but nothing to do about it...
// We return undefined, instead of nothing here, so it's
// easier to handle this case. if(!global) { ...}
module.exports = g;
/***/ }),
/* 17 */
/***/ (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.
*
*
*/
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;
/***/ }),
/* 18 */
/***/ (function(module, exports, __webpack_require__) {
var freeGlobal = __webpack_require__(256);
/** 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;
/***/ }),
/* 19 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__MemoryRouter__ = __webpack_require__(800);
/* unused harmony reexport MemoryRouter */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Prompt__ = __webpack_require__(801);
/* unused harmony reexport Prompt */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Redirect__ = __webpack_require__(802);
/* unused harmony reexport Redirect */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Route__ = __webpack_require__(296);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_3__Route__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__Router__ = __webpack_require__(178);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_4__Router__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__StaticRouter__ = __webpack_require__(803);
/* unused harmony reexport StaticRouter */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__Switch__ = __webpack_require__(804);
/* unused harmony reexport Switch */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__matchPath__ = __webpack_require__(179);
/* unused harmony reexport matchPath */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__withRouter__ = __webpack_require__(805);
/* unused harmony reexport withRouter */
/***/ }),
/* 20 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// WARNING: This functions source is returned by a loader without transpilation.
// Do not use any unsupported by IE11+ features.
/**
* Eval example code in a custom context:
* - `require()` that allows you to require modules from Markdown examples (wont work dinamically becasue we need
* to know all required modules in advance to be able to bundle them with the code).
* - `state` variable, `setState` and `__setInitialState` functions that will be binded to a React component
* that manages examples state on the frontend.
*
* Also prepends a given `code` with a `header` (maps required context modules to local variables).
*
* @param {string} header
* @param {Function} require
* @param {string} code
* @return {Function}
*/
module.exports = function evalInContext(header, require, code) {
var func = new Function( // eslint-disable-line no-new-func
'require',
'state',
'setState',
'__setInitialState',
header + code
);
// Bind the `require` function, other context arguments will be passed from the frontend
return func.bind(null, require);
};
/***/ }),
/* 21 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// WARNING: This functions source is returned by a loader without transpilation.
// Do not use any unsupported by IE11+ features.
/**
* Return module from a given map (like {react: require('react')}) or throw.
* We alllow to require modules only from Markdown examples (wont work dinamically becasue we need to know all required
* modules in advance to be able to bundle them with the code).
*
* @param {object} requireMap
* @param {string} filepath
* @return {object}
*/
module.exports = function requireInRuntime(requireMap, filepath) {
if (!(filepath in requireMap)) {
throw new Error(
'require() statements can be added only by editing a Markdown example file: require("' + filepath + '")'
);
}
return requireMap[filepath];
};
/***/ }),
/* 22 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* Copyright 2014-2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
/**
* Similar to invariant but only logs a warning if the condition is not met.
* This can be used to log issues in development environments in critical
* paths. Removing the logging code for production environments will keep the
* same logic and follow the same code paths.
*/
var warning = function() {};
if (false) {
warning = function(condition, format, args) {
var len = arguments.length;
args = new Array(len > 2 ? len - 2 : 0);
for (var key = 2; key < len; key++) {
args[key - 2] = arguments[key];
}
if (format === undefined) {
throw new Error(
'`warning(condition, format, ...args)` requires a warning ' +
'message argument'
);
}
if (format.length < 10 || (/^[s\W]*$/).test(format)) {
throw new Error(
'The warning format should be able to uniquely identify this ' +
'warning. Please, use a more descriptive format than: ' + format
);
}
if (!condition) {
var argIndex = 0;
var message = 'Warning: ' +
format.replace(/%s/g, function() {
return args[argIndex++];
});
if (typeof console !== 'undefined') {
console.error(message);
}
try {
// This error was thrown as a convenience so that you can use this stack
// to find the callsite that caused this warning to fire.
throw new Error(message);
} catch(x) {}
}
};
}
module.exports = warning;
/***/ }),
/* 23 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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 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 (false) {
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;
/***/ }),
/* 24 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2016 Titus Wormer
* @license MIT
* @module is-whitespace-character
* @fileoverview Check if a character is a whitespace character.
*/
/* eslint-env commonjs */
/* Expose. */
module.exports = whitespace;
/* Methods. */
var fromCode = String.fromCharCode;
/* Constants. */
var re = /\s/;
/**
* Check whether the given character code, or the character
* code at the first character, is a whitespace character.
*
* @param {string|number} character
* @return {boolean} - Whether `character` is a whitespaces character.
*/
function whitespace(character) {
return re.test(
typeof character === 'number' ? fromCode(character) : character.charAt(0)
);
}
/***/ }),
/* 25 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*
*/
// Trust the developer to only use ReactInstrumentation with a __DEV__ check
var debugTool = null;
if (false) {
var ReactDebugTool = require('./ReactDebugTool');
debugTool = ReactDebugTool;
}
module.exports = { debugTool: debugTool };
/***/ }),
/* 26 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* unused harmony export Article */
/* unused harmony export Aside */
/* unused harmony export Footer */
/* unused harmony export Header */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return Nav; });
/* unused harmony export Section */
/* unused harmony export FigCaption */
/* unused harmony export Figure */
/* unused harmony export Main */
/* unused harmony export H1 */
/* unused harmony export Hr */
/* unused harmony export Pre */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return A; });
/* unused harmony export Abbr */
/* unused harmony export B */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return Strong; });
/* unused harmony export Code */
/* unused harmony export Kbd */
/* unused harmony export Samp */
/* unused harmony export Dfn */
/* unused harmony export Mark */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return Small; });
/* unused harmony export Sub */
/* unused harmony export Sup */
/* unused harmony export Audio */
/* unused harmony export Video */
/* unused harmony export Img */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Svg; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return Button; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return Input; });
/* unused harmony export Optgroup */
/* unused harmony export Select */
/* unused harmony export Textarea */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return Fieldset; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return Legend; });
/* unused harmony export Progress */
/* unused harmony export Details */
/* unused harmony export Menu */
/* unused harmony export Summary */
/* unused harmony export Canvas */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_styled_components__ = __webpack_require__(352);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_remcalc__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_remcalc___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_remcalc__);
const Article = __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* default */].article.withConfig({
displayName: 'src__Article'
})(['display: block;']);
const Aside = __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* default */].aside.withConfig({
displayName: 'src__Aside'
})(['display: block;']);
const Footer = __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* default */].footer.withConfig({
displayName: 'src__Footer'
})(['display: block;']);
const Header = __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* default */].header.withConfig({
displayName: 'src__Header'
})(['display: block;']);
const Nav = __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* default */].nav.withConfig({
displayName: 'src__Nav'
})(['display: block;']);
const Section = __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* default */].section.withConfig({
displayName: 'src__Section'
})(['display: block;']);
const FigCaption = __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* default */].figcaption.withConfig({
displayName: 'src__FigCaption'
})(['display: block;']);
const Figure = __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* default */].figure.withConfig({
displayName: 'src__Figure'
})(['display: block;margin: ', ' ', ';'], __WEBPACK_IMPORTED_MODULE_1_remcalc___default()(16), __WEBPACK_IMPORTED_MODULE_1_remcalc___default()(40));
const Main = __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* default */].main.withConfig({
displayName: 'src__Main'
})(['display: block;']);
const H1 = __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* default */].h1.withConfig({
displayName: 'src__H1'
})(['font-size: ', ';margin: ', ' 0;'], __WEBPACK_IMPORTED_MODULE_1_remcalc___default()(32), __WEBPACK_IMPORTED_MODULE_1_remcalc___default()(10));
const Hr = __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* default */].hr.withConfig({
displayName: 'src__Hr'
})(['box-sizing: content-box;height: 0;overflow: visible;']);
const Pre = __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* default */].pre.withConfig({
displayName: 'src__Pre'
})(['font-family: monospace, monospace;font-size: ', ';'], __WEBPACK_IMPORTED_MODULE_1_remcalc___default()(16));
const A = __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* default */].a.withConfig({
displayName: 'src__A'
})(['background-color: transparent;text-decoration-skip: objects;']);
const Abbr = __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* default */].abbr.withConfig({
displayName: 'src__Abbr'
})(['&[title] {border-bottom: none;text-decoration: underline;text-decoration: underline dotted;}']);
const B = __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* default */].b.withConfig({
displayName: 'src__B'
})(['font-weight: bolder;']);
const Strong = __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* default */].strong.withConfig({
displayName: 'src__Strong'
})(['font-weight: bolder;']);
const Code = __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* default */].code.withConfig({
displayName: 'src__Code'
})(['font-family: monospace, monospace;font-size: ', ';'], __WEBPACK_IMPORTED_MODULE_1_remcalc___default()(16));
const Kbd = __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* default */].kbd.withConfig({
displayName: 'src__Kbd'
})(['font-family: monospace, monospace;font-size: ', ';'], __WEBPACK_IMPORTED_MODULE_1_remcalc___default()(16));
const Samp = __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* default */].samp.withConfig({
displayName: 'src__Samp'
})(['font-family: monospace, monospace;font-size: ', ';'], __WEBPACK_IMPORTED_MODULE_1_remcalc___default()(16));
const Dfn = __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* default */].dfn.withConfig({
displayName: 'src__Dfn'
})(['font-style: italic;']);
const Mark = __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* default */].mark.withConfig({
displayName: 'src__Mark'
})(['background-color: #ff0;color: #000;']);
const Small = __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* default */].small.withConfig({
displayName: 'src__Small'
})(['font-size: 80%;']);
const Sub = __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* default */].sub.withConfig({
displayName: 'src__Sub'
})(['font-size: 75%;line-height: 0;position: relative;vertical-align: baseline;bottom: -0.25em;']);
const Sup = __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* default */].sup.withConfig({
displayName: 'src__Sup'
})(['font-size: 75%;line-height: 0;position: relative;vertical-align: baseline;top: -0.5em;']);
const Audio = __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* default */].audio.withConfig({
displayName: 'src__Audio'
})(['display: inline-block;&:not([controls]) {display: none;height: 0;}']);
const Video = __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* default */].video.withConfig({
displayName: 'src__Video'
})(['display: inline-block;']);
const Img = __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* default */].img.withConfig({
displayName: 'src__Img'
})(['border-style: none;']);
const Svg = __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* default */].svg.withConfig({
displayName: 'src__Svg'
})(['&:not(:root) {overflow: hidden;}']);
const Button = __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* default */].button.withConfig({
displayName: 'src__Button'
})(['font-family: sans-serif;font-size: 100%;line-height: 1.15;margin: 0;overflow: visible;text-transform: none;appearance: button;&::-moz-focus-inner,&[type="button"]::-moz-focus-inner,&[type="reset"]::-moz-focus-inner,&[type="submit"]::-moz-focus-inner {border-style: none;padding: 0;}&:-moz-focusring,&[type="button"]:-moz-focusring,&[type="reset"]:-moz-focusring,&[type="submit"]:-moz-focusring {outline: ', ' dotted ButtonText;}'], __WEBPACK_IMPORTED_MODULE_1_remcalc___default()(1));
const Input = __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* default */].input.withConfig({
displayName: 'src__Input'
})(['font-family: sans-serif;font-size: 100%;line-height: 1.15;margin: 0;overflow: visible;&[type="checkbox"],&[type="radio"] {box-sizing: border-box;padding: 0;}&[type="number"]::-webkit-inner-spin-button,&[type="number"]::-webkit-outer-spin-button {height: auto;}&[type="search"] {appearance: textfield;outline-offset: ', ';}&[type="search"]::-webkit-search-cancel-button,&[type="search"]::-webkit-search-decoration {appearance: none;}&::-webkit-file-upload-button {appearance: button;font: inherit;}'], __WEBPACK_IMPORTED_MODULE_1_remcalc___default()(-2));
const Optgroup = __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* default */].optgroup.withConfig({
displayName: 'src__Optgroup'
})(['font-family: sans-serif;font-size: 100%;line-height: 1.15;margin: 0;']);
const Select = __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* default */].select.withConfig({
displayName: 'src__Select'
})(['font-family: sans-serif;font-size: 100%;line-height: 1.15;margin: 0;text-transform: none;']);
const Textarea = __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* default */].textarea.withConfig({
displayName: 'src__Textarea'
})(['font-family: sans-serif;font-size: 100%;line-height: 1.15;margin: 0;overflow: auto;']);
const Fieldset = __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* default */].fieldset.withConfig({
displayName: 'src__Fieldset'
})(['padding: 0.35em 0.75em 0.625em;']);
const Legend = __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* default */].legend.withConfig({
displayName: 'src__Legend'
})(['box-sizing: border-box;color: inherit;display: table;max-width: 100%;padding: 0;white-space: normal;']);
const Progress = __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* default */].progress.withConfig({
displayName: 'src__Progress'
})(['display: inline-block;vertical-align: baseline;']);
const Details = __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* default */].details.withConfig({
displayName: 'src__Details'
})(['display: block;']);
const Menu = __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* default */].menu.withConfig({
displayName: 'src__Menu'
})(['display: block;']);
const Summary = __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* default */].summary.withConfig({
displayName: 'src__Summary'
})(['display: list-item;']);
const Canvas = __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* default */].canvas.withConfig({
displayName: 'src__Canvas'
})(['display: inline-block;']);
/***/ }),
/* 27 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__freeGlobal_js__ = __webpack_require__(233);
/** Detect free variable `self`. */
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
/** Used as a reference to the global object. */
var root = __WEBPACK_IMPORTED_MODULE_0__freeGlobal_js__["a" /* default */] || freeSelf || Function('return this')();
/* harmony default export */ __webpack_exports__["a"] = (root);
/***/ }),
/* 28 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/**
* 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;
/* harmony default export */ __webpack_exports__["a"] = (isArray);
/***/ }),
/* 29 */
/***/ (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;
/***/ }),
/* 30 */
/***/ (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;
/***/ }),
/* 31 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var _prodInvariant = __webpack_require__(7),
_assign = __webpack_require__(9);
var CallbackQueue = __webpack_require__(270);
var PooledClass = __webpack_require__(46);
var ReactFeatureFlags = __webpack_require__(275);
var ReactReconciler = __webpack_require__(58);
var Transaction = __webpack_require__(106);
var invariant = __webpack_require__(2);
var dirtyComponents = [];
var updateBatchNumber = 0;
var asapCallbackQueue = CallbackQueue.getPooled();
var asapEnqueued = false;
var batchingStrategy = null;
function ensureInjected() {
!(ReactUpdates.ReactReconcileTransaction && batchingStrategy) ? false ? 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) ? false ? 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 ? false ? 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 ? false ? invariant(false, 'ReactUpdates: must provide a reconcile transaction class') : _prodInvariant('126') : void 0;
ReactUpdates.ReactReconcileTransaction = ReconcileTransaction;
},
injectBatchingStrategy: function (_batchingStrategy) {
!_batchingStrategy ? false ? invariant(false, 'ReactUpdates: must provide a batching strategy') : _prodInvariant('127') : void 0;
!(typeof _batchingStrategy.batchedUpdates === 'function') ? false ? invariant(false, 'ReactUpdates: must provide a batchedUpdates() function') : _prodInvariant('128') : void 0;
!(typeof _batchingStrategy.isBatchingUpdates === 'boolean') ? false ? 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;
/***/ }),
/* 32 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var _assign = __webpack_require__(9);
var PooledClass = __webpack_require__(46);
var emptyFunction = __webpack_require__(17);
var warning = __webpack_require__(5);
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 (false) {
// 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 (false) {
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 (false) {
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 (false) {
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 (false) {
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;
false ? 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;
}
}
/***/ }),
/* 33 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*
*/
/**
* 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;
/***/ }),
/* 34 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/**
* 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');
}
/* harmony default export */ __webpack_exports__["a"] = (isObject);
/***/ }),
/* 35 */
/***/ (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;
/***/ }),
/* 36 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _Markdown = __webpack_require__(824);
Object.defineProperty(exports, 'default', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Markdown).default;
}
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/***/ }),
/* 37 */
/***/ (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;
}
}());
/***/ }),
/* 38 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var emptyFunction = __webpack_require__(112);
/**
* 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 (false) {
(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;
/***/ }),
/* 39 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var emptyFunction = __webpack_require__(117);
/**
* 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 (false) {
(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;
/***/ }),
/* 40 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
var Lengths = {
paddingLeft: 18,
nodeWidth: 180
};
var Sizes = {
buttonSize: {
width: 40,
height: 48
},
contentSize: {
width: Lengths.nodeWidth,
height: 101 // This is the height w/o info comp
},
nodeSize: {
width: Lengths.nodeWidth,
height: 156
},
nodeSizeWithChildren: {
width: Lengths.nodeWidth,
height: 276
}
};
var Points = {
buttonPosition: {
x: Lengths.nodeWidth - Sizes.buttonSize.width,
y: 0
},
contentPosition: {
x: 0,
y: Sizes.buttonSize.height
},
infoPosition: {
x: Lengths.paddingLeft,
y: 11
},
metricsPosition: {
x: Lengths.paddingLeft,
y: 41
},
subtitlePosition: {
x: Lengths.paddingLeft,
y: 23
}
};
var Rects = {
// X, y, width, height
buttonRect: Object.assign({}, Sizes.buttonSize, Points.buttonPosition),
contentRect: Object.assign({}, Sizes.contentSize, Points.contentPosition),
// Top, bottom, left, right - from 'centre'
nodeRect: {
left: -Sizes.nodeSize.width / 2,
right: Sizes.nodeSize.width / 2,
top: -Sizes.nodeSize.height / 2,
bottom: Sizes.nodeSize.height / 2
},
nodeRectWithChildren: {
left: -Sizes.nodeSizeWithChildren.width / 2,
right: Sizes.nodeSizeWithChildren.width / 2,
top: -Sizes.nodeSizeWithChildren.height / 2 + Sizes.contentSize.height / 3,
bottom: Sizes.nodeSizeWithChildren.height / 2 + Sizes.contentSize.height / 3
}
};
var Constants = Object.assign({}, Lengths, Sizes, Points, Rects);
/* harmony default export */ __webpack_exports__["a"] = (Constants);
/***/ }),
/* 41 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__baseIsNative_js__ = __webpack_require__(512);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getValue_js__ = __webpack_require__(543);
/**
* 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 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__getValue_js__["a" /* default */])(object, key);
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__baseIsNative_js__["a" /* default */])(value) ? value : undefined;
}
/* harmony default export */ __webpack_exports__["a"] = (getNative);
/***/ }),
/* 42 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/**
* 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';
}
/* harmony default export */ __webpack_exports__["a"] = (isObjectLike);
/***/ }),
/* 43 */
/***/ (function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__(97),
getRawTag = __webpack_require__(641),
objectToString = __webpack_require__(670);
/** `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;
/***/ }),
/* 44 */
/***/ (function(module, exports, __webpack_require__) {
var baseIsNative = __webpack_require__(611),
getValue = __webpack_require__(644);
/**
* 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;
/***/ }),
/* 45 */
/***/ (function(module, exports) {
// shim for using process in browser
var process = module.exports = {};
// cached from whatever global is present so that test runners that stub it
// don't break things. But we need to wrap it in a try catch in case it is
// wrapped in strict mode code which doesn't define any globals. It's inside a
// function because try/catches deoptimize in certain engines.
var cachedSetTimeout;
var cachedClearTimeout;
function defaultSetTimout() {
throw new Error('setTimeout has not been defined');
}
function defaultClearTimeout () {
throw new Error('clearTimeout has not been defined');
}
(function () {
try {
if (typeof setTimeout === 'function') {
cachedSetTimeout = setTimeout;
} else {
cachedSetTimeout = defaultSetTimout;
}
} catch (e) {
cachedSetTimeout = defaultSetTimout;
}
try {
if (typeof clearTimeout === 'function') {
cachedClearTimeout = clearTimeout;
} else {
cachedClearTimeout = defaultClearTimeout;
}
} catch (e) {
cachedClearTimeout = defaultClearTimeout;
}
} ())
function runTimeout(fun) {
if (cachedSetTimeout === setTimeout) {
//normal enviroments in sane situations
return setTimeout(fun, 0);
}
// if setTimeout wasn't available but was latter defined
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
cachedSetTimeout = setTimeout;
return setTimeout(fun, 0);
}
try {
// when when somebody has screwed with setTimeout but no I.E. maddness
return cachedSetTimeout(fun, 0);
} catch(e){
try {
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
return cachedSetTimeout.call(null, fun, 0);
} catch(e){
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
return cachedSetTimeout.call(this, fun, 0);
}
}
}
function runClearTimeout(marker) {
if (cachedClearTimeout === clearTimeout) {
//normal enviroments in sane situations
return clearTimeout(marker);
}
// if clearTimeout wasn't available but was latter defined
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
cachedClearTimeout = clearTimeout;
return clearTimeout(marker);
}
try {
// when when somebody has screwed with setTimeout but no I.E. maddness
return cachedClearTimeout(marker);
} catch (e){
try {
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
return cachedClearTimeout.call(null, marker);
} catch (e){
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
// Some versions of I.E. have different rules for clearTimeout vs setTimeout
return cachedClearTimeout.call(this, marker);
}
}
}
var queue = [];
var draining = false;
var currentQueue;
var queueIndex = -1;
function cleanUpNextTick() {
if (!draining || !currentQueue) {
return;
}
draining = false;
if (currentQueue.length) {
queue = currentQueue.concat(queue);
} else {
queueIndex = -1;
}
if (queue.length) {
drainQueue();
}
}
function drainQueue() {
if (draining) {
return;
}
var timeout = runTimeout(cleanUpNextTick);
draining = true;
var len = queue.length;
while(len) {
currentQueue = queue;
queue = [];
while (++queueIndex < len) {
if (currentQueue) {
currentQueue[queueIndex].run();
}
}
queueIndex = -1;
len = queue.length;
}
currentQueue = null;
draining = false;
runClearTimeout(timeout);
}
process.nextTick = function (fun) {
var args = new Array(arguments.length - 1);
if (arguments.length > 1) {
for (var i = 1; i < arguments.length; i++) {
args[i - 1] = arguments[i];
}
}
queue.push(new Item(fun, args));
if (queue.length === 1 && !draining) {
runTimeout(drainQueue);
}
};
// v8 likes predictible objects
function Item(fun, array) {
this.fun = fun;
this.array = array;
}
Item.prototype.run = function () {
this.fun.apply(null, this.array);
};
process.title = 'browser';
process.browser = true;
process.env = {};
process.argv = [];
process.version = ''; // empty string to avoid regexp issues
process.versions = {};
function noop() {}
process.on = noop;
process.addListener = noop;
process.once = noop;
process.off = noop;
process.removeListener = noop;
process.removeAllListeners = noop;
process.emit = noop;
process.prependListener = noop;
process.prependOnceListener = noop;
process.listeners = function (name) { return [] }
process.binding = function (name) {
throw new Error('process.binding is not supported');
};
process.cwd = function () { return '/' };
process.chdir = function (dir) {
throw new Error('process.chdir is not supported');
};
process.umask = function() { return 0; };
/***/ }),
/* 46 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*
*/
var _prodInvariant = __webpack_require__(7);
var invariant = __webpack_require__(2);
/**
* 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) ? false ? 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;
/***/ }),
/* 47 */
/***/ (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.
*
*/
/**
* 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 (false) {
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;
/***/ }),
/* 48 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var _assign = __webpack_require__(79);
var ReactCurrentOwner = __webpack_require__(195);
var warning = __webpack_require__(38);
var canDefineProperty = __webpack_require__(197);
var hasOwnProperty = Object.prototype.hasOwnProperty;
var REACT_ELEMENT_TYPE = __webpack_require__(196);
var RESERVED_PROPS = {
key: true,
ref: true,
__self: true,
__source: true
};
var specialPropKeyWarningShown, specialPropRefWarningShown;
function hasValidRef(config) {
if (false) {
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 (false) {
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;
false ? 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;
false ? 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 (false) {
// 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 (false) {
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 (false) {
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;
/***/ }),
/* 49 */
/***/ (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.
*
*/
/**
* 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 (false) {
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;
/***/ }),
/* 50 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var _assign = __webpack_require__(80);
var ReactCurrentOwner = __webpack_require__(199);
var warning = __webpack_require__(39);
var canDefineProperty = __webpack_require__(201);
var hasOwnProperty = Object.prototype.hasOwnProperty;
var REACT_ELEMENT_TYPE = __webpack_require__(200);
var RESERVED_PROPS = {
key: true,
ref: true,
__self: true,
__source: true
};
var specialPropKeyWarningShown, specialPropRefWarningShown;
function hasValidRef(config) {
if (false) {
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 (false) {
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;
false ? 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;
false ? 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 (false) {
// 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 (false) {
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 (false) {
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;
/***/ }),
/* 51 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return borderRadius; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return bottomShaddow; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return bottomShaddowDarker; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return insetShaddow; });
/* unused harmony export tooltipShadow */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return border; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_styled_components__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_remcalc__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_remcalc___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_remcalc__);
var borderRadius = __WEBPACK_IMPORTED_MODULE_1_remcalc___default()(4);
var bottomShaddow = '0 ' + __WEBPACK_IMPORTED_MODULE_1_remcalc___default()(2) + ' 0 0 rgba(0, 0, 0, 0.05)';
var bottomShaddowDarker = '0 ' + __WEBPACK_IMPORTED_MODULE_1_remcalc___default()(2) + ' 0 0 rgba(0, 0, 0, 0.1)';
var insetShaddow = 'inset 0 ' + __WEBPACK_IMPORTED_MODULE_1_remcalc___default()(3) + ' 0 0 rgba(0, 0, 0, 0.05)';
var tooltipShadow = '0 ' + __WEBPACK_IMPORTED_MODULE_1_remcalc___default()(2) + ' ' + __WEBPACK_IMPORTED_MODULE_1_remcalc___default()(6) + ' ' + __WEBPACK_IMPORTED_MODULE_1_remcalc___default()(1) + ' rgba(0, 0, 0, 0.1)';
var border = {
checked: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_styled_components__["b" /* css */])(['', ' solid ', ''], __WEBPACK_IMPORTED_MODULE_1_remcalc___default()(1), function (props) {
return props.theme.primary;
}),
unchecked: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_styled_components__["b" /* css */])(['', ' solid ', ''], __WEBPACK_IMPORTED_MODULE_1_remcalc___default()(1), function (props) {
return props.theme.grey;
}),
confirmed: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_styled_components__["b" /* css */])(['', ' solid ', ''], __WEBPACK_IMPORTED_MODULE_1_remcalc___default()(1), function (props) {
return props.theme.grey;
}),
error: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_styled_components__["b" /* css */])(['', ' solid ', ''], __WEBPACK_IMPORTED_MODULE_1_remcalc___default()(1), function (props) {
return props.theme.red;
})
};
/***/ }),
/* 52 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return Stylable; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__typography__ = __webpack_require__(13);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__boxes__ = __webpack_require__(51);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_react_broadcast__ = __webpack_require__(14);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_react_broadcast___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_react_broadcast__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_styled_components__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_remcalc__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_remcalc___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_remcalc__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_prop_types__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_prop_types__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_styled_is__ = __webpack_require__(12);
var _templateObject = _taggedTemplateLiteral(['\n border-color: ', '\n '], ['\n border-color: ', '\n ']),
_templateObject2 = _taggedTemplateLiteral(['\n ', '\n '], ['\n ', '\n ']);
function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
var colorWithDisabled = function colorWithDisabled(props) {
return props.disabled ? props.theme.disabled : props.theme.text;
};
var colorWithDefaultValue = function colorWithDefaultValue(props) {
return props.value === props.defaultValue ? props.theme.disabled : colorWithDisabled(props);
};
var color = function color(props) {
return props.defaultValue ? colorWithDefaultValue(props) : colorWithDisabled(props);
};
var height = function height(props) {
return props.multiple ? 'auto' : __WEBPACK_IMPORTED_MODULE_5_remcalc___default()(48);
};
var paddingTop = function paddingTop(props) {
return props.multiple ? __WEBPACK_IMPORTED_MODULE_5_remcalc___default()(20) : __WEBPACK_IMPORTED_MODULE_5_remcalc___default()(13);
};
var style = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4_styled_components__["b" /* css */])(['box-sizing: border-box;width: 100%;height: ', ';margin-bottom: ', ';margin-top: ', ';padding: ', ' ', ';border-radius: ', ';background-color: ', ';box-shadow: ', ';border: ', ';', ';', ';', ';font-size: ', ';line-height: normal !important;', ';font-style: normal;font-stretch: normal;color: ', ';appearance: none;outline: 0;&:focus {border-color: ', ';outline: 0;}'], height, __WEBPACK_IMPORTED_MODULE_5_remcalc___default()(8), __WEBPACK_IMPORTED_MODULE_5_remcalc___default()(8), paddingTop, __WEBPACK_IMPORTED_MODULE_5_remcalc___default()(18), __WEBPACK_IMPORTED_MODULE_2__boxes__["c" /* borderRadius */], function (props) {
return props.theme.white;
}, __WEBPACK_IMPORTED_MODULE_2__boxes__["d" /* insetShaddow */], __WEBPACK_IMPORTED_MODULE_2__boxes__["b" /* border */].unchecked, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7_styled_is__["a" /* default */])('error')(_templateObject, function (props) {
return props.theme.red;
}), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7_styled_is__["a" /* default */])('warning')(_templateObject, function (props) {
return props.theme.orange;
}), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7_styled_is__["a" /* default */])('success')(_templateObject, function (props) {
return props.theme.green;
}), __WEBPACK_IMPORTED_MODULE_5_remcalc___default()(15), __WEBPACK_IMPORTED_MODULE_1__typography__["a" /* default */].normal, color, function (props) {
return props.theme.primary;
});
var BaseInput = function BaseInput(Component) {
return function (props) {
var render = function render(value) {
var _value = value || {};
var _value$input = _value.input,
input = _value$input === undefined ? {} : _value$input,
_value$meta = _value.meta,
meta = _value$meta === undefined ? {} : _value$meta,
_value$id = _value.id,
id = _value$id === undefined ? '' : _value$id;
var hasError = Boolean(props.error || _value.error || meta.error);
var hasWarning = Boolean(props.warning || _value.warning || meta.warning);
var hasSuccess = Boolean(props.success || _value.success || meta.success);
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Component, Object.assign({}, props, input, {
id: id,
error: hasError,
warning: hasWarning,
success: hasSuccess
}));
};
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
__WEBPACK_IMPORTED_MODULE_3_react_broadcast__["Subscriber"],
{ channel: 'input-group' },
render
);
};
};
BaseInput.propTypes = {
error: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.bool,
warning: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.bool
};
/* harmony default export */ __webpack_exports__["a"] = (BaseInput);
var Stylable = function Stylable(Component) {
var stylable = typeof Component === 'string' ? __WEBPACK_IMPORTED_MODULE_4_styled_components__["a" /* default */][Component] : __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4_styled_components__["a" /* default */])(Component);
return stylable(_templateObject2, style);
};
/***/ }),
/* 53 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return GraphLine; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return GraphNodeRect; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return GraphShadowRect; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return GraphTitle; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return GraphSubtitle; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return GraphText; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return GraphButtonRect; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return GraphButtonCircle; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return GraphHealthyCircle; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_styled_components__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_styled_is__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__typography__ = __webpack_require__(13);
var _templateObject = _taggedTemplateLiteral(['\n stroke: ', ';\n '], ['\n stroke: ', ';\n ']),
_templateObject2 = _taggedTemplateLiteral(['\n stroke: ', ';\n fill: ', ';\n '], ['\n stroke: ', ';\n fill: ', ';\n ']),
_templateObject3 = _taggedTemplateLiteral(['\n fill: ', ';\n '], ['\n fill: ', ';\n ']);
function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
var GraphLine = __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* default */].line.withConfig({
displayName: 'shapes__GraphLine'
})(['stroke: ', ';stroke-width: 1.5;', ';'], function (props) {
return props.theme.grey;
}, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1_styled_is__["a" /* default */])('connected')(_templateObject, function (props) {
return props.theme.secondaryActive;
}));
var GraphNodeRect = __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* default */].rect.withConfig({
displayName: 'shapes__GraphNodeRect'
})(['stroke: ', ';fill: ', ';stroke-width: 1.5;rx: 4;ry: 4;', ';'], function (props) {
return props.theme.grey;
}, function (props) {
return props.theme.white;
}, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1_styled_is__["a" /* default */])('connected')(_templateObject2, function (props) {
return props.theme.secondaryActive;
}, function (props) {
return props.theme.secondary;
}));
var GraphShadowRect = __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* default */].rect.withConfig({
displayName: 'shapes__GraphShadowRect'
})(['fill: ', ';opacity: 0.33;rx: 4;ry: 4;', ';'], function (props) {
return props.theme.grey;
}, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1_styled_is__["a" /* default */])('connected')(_templateObject3, function (props) {
return props.theme.secondary;
}));
var GraphTitle = __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* default */].text.withConfig({
displayName: 'shapes__GraphTitle'
})(['', ';', ';fill: ', ';font-size: 16px;font-weight: 600;', ';'], __WEBPACK_IMPORTED_MODULE_2__typography__["a" /* default */].fontFamily, __WEBPACK_IMPORTED_MODULE_2__typography__["a" /* default */].normal, function (props) {
return props.theme.secondary;
}, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1_styled_is__["a" /* default */])('connected')(_templateObject3, function (props) {
return props.theme.white;
}));
var GraphSubtitle = __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* default */].text.withConfig({
displayName: 'shapes__GraphSubtitle'
})(['', ';', ';fill: ', ';font-size: 12px;font-weight: 600;', ';'], __WEBPACK_IMPORTED_MODULE_2__typography__["a" /* default */].fontFamily, __WEBPACK_IMPORTED_MODULE_2__typography__["a" /* default */].normal, function (props) {
return props.theme.secondary;
}, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1_styled_is__["a" /* default */])('connected')(_templateObject3, function (props) {
return props.theme.white;
}));
var GraphText = __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* default */].text.withConfig({
displayName: 'shapes__GraphText'
})(['', ';', ';fill: ', ';font-size: 12px;opacity: 0.8;', ';'], __WEBPACK_IMPORTED_MODULE_2__typography__["a" /* default */].fontFamily, __WEBPACK_IMPORTED_MODULE_2__typography__["a" /* default */].normal, function (props) {
return props.theme.secondary;
}, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1_styled_is__["a" /* default */])('connected')(_templateObject3, function (props) {
return props.theme.white;
}));
var GraphButtonRect = __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* default */].rect.withConfig({
displayName: 'shapes__GraphButtonRect'
})(['opacity: 0;cursor: pointer;']);
var GraphButtonCircle = __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* default */].circle.withConfig({
displayName: 'shapes__GraphButtonCircle'
})(['fill: ', ';', ';'], function (props) {
return props.theme.secondary;
}, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1_styled_is__["a" /* default */])('connected')(_templateObject3, function (props) {
return props.theme.white;
}));
var GraphHealthyCircle = __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* default */].circle.withConfig({
displayName: 'shapes__GraphHealthyCircle'
})(['fill: ', ';'], function (props) {
return props.theme.green;
});
/***/ }),
/* 54 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Symbol_js__ = __webpack_require__(87);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getRawTag_js__ = __webpack_require__(540);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__objectToString_js__ = __webpack_require__(569);
/** `Object#toString` result references. */
var nullTag = '[object Null]',
undefinedTag = '[object Undefined]';
/** Built-in value references. */
var symToStringTag = __WEBPACK_IMPORTED_MODULE_0__Symbol_js__["a" /* default */] ? __WEBPACK_IMPORTED_MODULE_0__Symbol_js__["a" /* default */].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))
? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__getRawTag_js__["a" /* default */])(value)
: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__objectToString_js__["a" /* default */])(value);
}
/* harmony default export */ __webpack_exports__["a"] = (baseGetTag);
/***/ }),
/* 55 */
/***/ (function(module, exports, __webpack_require__) {
var isFunction = __webpack_require__(156),
isLength = __webpack_require__(157);
/**
* 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;
/***/ }),
/* 56 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var DOMNamespaces = __webpack_require__(162);
var setInnerHTML = __webpack_require__(108);
var createMicrosoftUnsafeLocalFunction = __webpack_require__(170);
var setTextContent = __webpack_require__(287);
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;
/***/ }),
/* 57 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var _prodInvariant = __webpack_require__(7);
var invariant = __webpack_require__(2);
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) ? false ? 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) ? false ? 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 (false) {
DOMProperty.getPossibleStandardName[lowerCased] = propName;
}
if (DOMAttributeNames.hasOwnProperty(propName)) {
var attributeName = DOMAttributeNames[propName];
propertyInfo.attributeName = attributeName;
if (false) {
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: false ? { 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;
/***/ }),
/* 58 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var ReactRef = __webpack_require__(752);
var ReactInstrumentation = __webpack_require__(25);
var warning = __webpack_require__(5);
/**
* 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 (false) {
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 (false) {
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 (false) {
if (internalInstance._debugID !== 0) {
ReactInstrumentation.debugTool.onBeforeUnmountComponent(internalInstance._debugID);
}
}
ReactRef.detachRefs(internalInstance, internalInstance._currentElement);
internalInstance.unmountComponent(safely);
if (false) {
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 (false) {
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 (false) {
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.
false ? warning(internalInstance._updateBatchNumber == null || internalInstance._updateBatchNumber === updateBatchNumber + 1, 'performUpdateIfNecessary: Unexpected batch number (current %s, ' + 'pending %s)', updateBatchNumber, internalInstance._updateBatchNumber) : void 0;
return;
}
if (false) {
if (internalInstance._debugID !== 0) {
ReactInstrumentation.debugTool.onBeforeUpdateComponent(internalInstance._debugID, internalInstance._currentElement);
}
}
internalInstance.performUpdateIfNecessary(transaction);
if (false) {
if (internalInstance._debugID !== 0) {
ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID);
}
}
}
};
module.exports = ReactReconciler;
/***/ }),
/* 59 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Grid", function() { return Grid$1; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Row", function() { return Row$1; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Col", function() { return Col$1; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BASE_CONF", function() { return BASE_CONF; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_styled_components__ = __webpack_require__(3);
function createCommonjsModule(fn, module) {
return module = { exports: {} }, fn(module, module.exports), 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.
*
*
*/
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;
};
var emptyFunction_1 = emptyFunction;
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in 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 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 (false) {
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;
}
}
var invariant_1 = invariant;
/**
* 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_1;
if (false) {
(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));
}
};
})();
}
var warning_1 = warning;
/**
* 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.
*/
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
var ReactPropTypesSecret_1 = ReactPropTypesSecret;
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 taggedTemplateLiteral = function (strings, raw) {
return Object.freeze(Object.defineProperties(strings, {
raw: {
value: Object.freeze(raw)
}
}));
};
if (false) {
var invariant$1 = invariant_1;
var warning$1 = warning_1;
var ReactPropTypesSecret$1 = ReactPropTypesSecret_1;
var loggedTypeFailures = {};
}
/**
* Assert that the values match with the type specs.
* Error messages are memorized and will only be shown once.
*
* @param {object} typeSpecs Map of name to a ReactPropType
* @param {object} values Runtime values that need to be type-checked
* @param {string} location e.g. "prop", "context", "child context"
* @param {string} componentName Name of the component for error messages.
* @param {?Function} getStack Returns the component stack.
* @private
*/
function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
if (false) {
for (var typeSpecName in typeSpecs) {
if (typeSpecs.hasOwnProperty(typeSpecName)) {
var error;
// Prop type validation may throw. In case they do, we don't want to
// fail the render phase where it didn't fail before. So we log it.
// After these have been cleaned up, we'll let them throw.
try {
// This is intentionally an invariant that gets caught. It's the same
// behavior as without this statement except with a better message.
invariant$1(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', componentName || 'React class', location, typeSpecName);
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret$1);
} catch (ex) {
error = ex;
}
warning$1(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error === 'undefined' ? 'undefined' : _typeof(error));
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
// Only monitor this failure once because there tends to be a lot of the
// same error.
loggedTypeFailures[error.message] = true;
var stack = getStack ? getStack() : '';
warning$1(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '');
}
}
}
}
}
var checkPropTypes_1 = checkPropTypes;
var factoryWithTypeCheckers = function factoryWithTypeCheckers(isValidElement, throwOnDirectAccess) {
/* global Symbol */
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
/**
* Returns the iterator method function contained on the iterable object.
*
* Be sure to invoke the function with the iterable as context:
*
* var iteratorFn = getIteratorFn(myIterable);
* if (iteratorFn) {
* var iterator = iteratorFn.call(myIterable);
* ...
* }
*
* @param {?object} maybeIterable
* @return {?function}
*/
function getIteratorFn(maybeIterable) {
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
if (typeof iteratorFn === 'function') {
return iteratorFn;
}
}
/**
* Collection of methods that allow declaration and validation of props that are
* supplied to React components. Example usage:
*
* var Props = require('ReactPropTypes');
* var MyArticle = React.createClass({
* propTypes: {
* // An optional string prop named "description".
* description: Props.string,
*
* // A required enum prop named "category".
* category: Props.oneOf(['News','Photos']).isRequired,
*
* // A prop named "dialog" that requires an instance of Dialog.
* dialog: Props.instanceOf(Dialog).isRequired
* },
* render: function() { ... }
* });
*
* A more formal specification of how these methods are used:
*
* type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
* decl := ReactPropTypes.{type}(.isRequired)?
*
* Each and every declaration produces a function with the same signature. This
* allows the creation of custom validation functions. For example:
*
* var MyLink = React.createClass({
* propTypes: {
* // An optional string or URI prop named "href".
* href: function(props, propName, componentName) {
* var propValue = props[propName];
* if (propValue != null && typeof propValue !== 'string' &&
* !(propValue instanceof URI)) {
* return new Error(
* 'Expected a string or an URI for ' + propName + ' in ' +
* componentName
* );
* }
* }
* },
* render: function() {...}
* });
*
* @internal
*/
var ANONYMOUS = '<<anonymous>>';
// Important!
// Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
var ReactPropTypes = {
array: createPrimitiveTypeChecker('array'),
bool: createPrimitiveTypeChecker('boolean'),
func: createPrimitiveTypeChecker('function'),
number: createPrimitiveTypeChecker('number'),
object: createPrimitiveTypeChecker('object'),
string: createPrimitiveTypeChecker('string'),
symbol: createPrimitiveTypeChecker('symbol'),
any: createAnyTypeChecker(),
arrayOf: createArrayOfTypeChecker,
element: createElementTypeChecker(),
instanceOf: createInstanceTypeChecker,
node: createNodeChecker(),
objectOf: createObjectOfTypeChecker,
oneOf: createEnumTypeChecker,
oneOfType: createUnionTypeChecker,
shape: createShapeTypeChecker
};
/**
* 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 (false) {
var manualPropTypeCallCache = {};
var manualPropTypeWarningCount = 0;
}
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
componentName = componentName || ANONYMOUS;
propFullName = propFullName || propName;
if (secret !== ReactPropTypesSecret_1) {
if (throwOnDirectAccess) {
// New behavior only for users of `prop-types` package
invariant_1(false, 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use `PropTypes.checkPropTypes()` to call them. ' + 'Read more at http://fb.me/use-check-prop-types');
} else if (false) {
// Old behavior for people using React.PropTypes
var cacheKey = componentName + ':' + propName;
if (!manualPropTypeCallCache[cacheKey] &&
// Avoid spamming the console because they are often not actionable except for lib authors
manualPropTypeWarningCount < 3) {
warning_1(false, 'You are manually calling a React.PropTypes validation ' + 'function for the `%s` prop on `%s`. This is deprecated ' + 'and will throw in the standalone `prop-types` package. ' + 'You may be seeing this warning due to a third-party PropTypes ' + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.', propFullName, componentName);
manualPropTypeCallCache[cacheKey] = true;
manualPropTypeWarningCount++;
}
}
}
if (props[propName] == null) {
if (isRequired) {
if (props[propName] === null) {
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
}
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
}
return null;
} else {
return validate(props, propName, componentName, location, propFullName);
}
}
var chainedCheckType = checkType.bind(null, false);
chainedCheckType.isRequired = checkType.bind(null, true);
return chainedCheckType;
}
function createPrimitiveTypeChecker(expectedType) {
function validate(props, propName, componentName, location, propFullName, secret) {
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== expectedType) {
// `propValue` being instance of, say, date/regexp, pass the 'object'
// check, but we can offer a more precise error message here rather than
// 'of type `object`'.
var preciseType = getPreciseType(propValue);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createAnyTypeChecker() {
return createChainableTypeChecker(emptyFunction_1.thatReturnsNull);
}
function createArrayOfTypeChecker(typeChecker) {
function validate(props, propName, componentName, location, propFullName) {
if (typeof typeChecker !== 'function') {
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
}
var propValue = props[propName];
if (!Array.isArray(propValue)) {
var propType = getPropType(propValue);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
}
for (var i = 0; i < propValue.length; i++) {
var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret_1);
if (error instanceof Error) {
return error;
}
}
return null;
}
return createChainableTypeChecker(validate);
}
function createElementTypeChecker() {
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
if (!isValidElement(propValue)) {
var propType = getPropType(propValue);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createInstanceTypeChecker(expectedClass) {
function validate(props, propName, componentName, location, propFullName) {
if (!(props[propName] instanceof expectedClass)) {
var expectedClassName = expectedClass.name || ANONYMOUS;
var actualClassName = getClassName(props[propName]);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createEnumTypeChecker(expectedValues) {
if (!Array.isArray(expectedValues)) {
false ? warning_1(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0;
return emptyFunction_1.thatReturnsNull;
}
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
for (var i = 0; i < expectedValues.length; i++) {
if (is(propValue, expectedValues[i])) {
return null;
}
}
var valuesString = JSON.stringify(expectedValues);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
}
return createChainableTypeChecker(validate);
}
function createObjectOfTypeChecker(typeChecker) {
function validate(props, propName, componentName, location, propFullName) {
if (typeof typeChecker !== 'function') {
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
}
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== 'object') {
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
}
for (var key in propValue) {
if (propValue.hasOwnProperty(key)) {
var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1);
if (error instanceof Error) {
return error;
}
}
}
return null;
}
return createChainableTypeChecker(validate);
}
function createUnionTypeChecker(arrayOfTypeCheckers) {
if (!Array.isArray(arrayOfTypeCheckers)) {
false ? warning_1(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
return emptyFunction_1.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_1) == null) {
return null;
}
}
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
}
return createChainableTypeChecker(validate);
}
function createNodeChecker() {
function validate(props, propName, componentName, location, propFullName) {
if (!isNode(props[propName])) {
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createShapeTypeChecker(shapeTypes) {
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== 'object') {
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
}
for (var key in shapeTypes) {
var checker = shapeTypes[key];
if (!checker) {
continue;
}
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1);
if (error) {
return error;
}
}
return null;
}
return createChainableTypeChecker(validate);
}
function isNode(propValue) {
switch (typeof propValue === 'undefined' ? 'undefined' : _typeof(propValue)) {
case 'number':
case 'string':
case 'undefined':
return true;
case 'boolean':
return !propValue;
case 'object':
if (Array.isArray(propValue)) {
return propValue.every(isNode);
}
if (propValue === null || isValidElement(propValue)) {
return true;
}
var iteratorFn = getIteratorFn(propValue);
if (iteratorFn) {
var iterator = iteratorFn.call(propValue);
var step;
if (iteratorFn !== propValue.entries) {
while (!(step = iterator.next()).done) {
if (!isNode(step.value)) {
return false;
}
}
} else {
// Iterator will provide entry [k,v] tuples rather than values.
while (!(step = iterator.next()).done) {
var entry = step.value;
if (entry) {
if (!isNode(entry[1])) {
return false;
}
}
}
}
} else {
return false;
}
return true;
default:
return false;
}
}
function isSymbol(propType, propValue) {
// Native Symbol.
if (propType === 'symbol') {
return true;
}
// 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
if (propValue['@@toStringTag'] === 'Symbol') {
return true;
}
// Fallback for non-spec compliant Symbols which are polyfilled.
if (typeof Symbol === 'function' && propValue instanceof Symbol) {
return true;
}
return false;
}
// Equivalent of `typeof` but with special handling for array and regexp.
function getPropType(propValue) {
var propType = typeof propValue === 'undefined' ? 'undefined' : _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;
}
ReactPropTypes.checkPropTypes = checkPropTypes_1;
ReactPropTypes.PropTypes = ReactPropTypes;
return ReactPropTypes;
};
var factoryWithThrowingShims = function factoryWithThrowingShims() {
// Important!
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
function shim() {
invariant_1(false, 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use PropTypes.checkPropTypes() to call them. ' + 'Read more at http://fb.me/use-check-prop-types');
}
shim.isRequired = shim;
function getShim() {
return shim;
}
var ReactPropTypes = {
array: shim,
bool: shim,
func: shim,
number: shim,
object: shim,
string: shim,
symbol: shim,
any: shim,
arrayOf: getShim,
element: shim,
instanceOf: getShim,
node: shim,
objectOf: getShim,
oneOf: getShim,
oneOfType: getShim,
shape: getShim
};
ReactPropTypes.checkPropTypes = emptyFunction_1;
ReactPropTypes.PropTypes = ReactPropTypes;
return ReactPropTypes;
};
var index = createCommonjsModule(function (module) {
/**
* 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.
*/
if (false) {
var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol.for && Symbol.for('react.element') || 0xeac7;
var isValidElement = function isValidElement(object) {
return (typeof object === 'undefined' ? 'undefined' : _typeof(object)) === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
};
// By explicitly using `prop-types` you are opting into new development behavior.
// http://fb.me/prop-types-in-prod
var throwOnDirectAccess = true;
module.exports = factoryWithTypeCheckers(isValidElement, throwOnDirectAccess);
} else {
// By explicitly using `prop-types` you are opting into new production behavior.
// http://fb.me/prop-types-in-prod
module.exports = factoryWithThrowingShims();
}
});
function createProps(propTypes, props) {
var newProps = {};
Object.keys(props).filter(function (key) {
return ~['children'].indexOf(key) || !propTypes[key];
}).forEach(function (key) {
return newProps[key] = props[key];
});
return newProps;
}
var _templateObject$1 = taggedTemplateLiteral(['\n @media ', ' {\n ', '\n }\n '], ['\n @media ', ' {\n ', '\n }\n ']);
var THEME_CONF = 'flexboxgrid';
var BASE_CONF = {
gridSize: 12,
gutterWidth: 1,
outerMargin: 2,
container: {
sm: 46,
md: 61,
lg: 76
},
breakpoints: {
xs: 0,
sm: 48,
md: 64,
lg: 75
}
};
var configCache = [];
var makeCacheId = function makeCacheId(props) {
return JSON.stringify(props.theme && props.theme[THEME_CONF] || {});
};
var resolveConfig = function resolveConfig(props) {
var themeConf = props.theme && props.theme[THEME_CONF] || {};
var conf = _extends({}, BASE_CONF, themeConf, {
container: _extends({}, BASE_CONF.container, themeConf.container),
breakpoints: _extends({}, BASE_CONF.breakpoints, themeConf.breakpoints)
});
conf.media = Object.keys(conf.breakpoints).reduce(function (media, breakpoint) {
var breakpointWidth = conf.breakpoints[breakpoint];
media[breakpoint] = makeMedia('only screen' + (breakpoint === 0 ? '' : ' and (min-width: ' + breakpointWidth + 'em)'));
return media;
}, {});
return conf;
};
var DIMENSION_NAMES = ['xs', 'sm', 'md', 'lg'];
function config(props) {
var cacheId = makeCacheId(props);
if (configCache[0] === cacheId) {
return configCache[1];
}
var conf = resolveConfig(props);
configCache[0] = cacheId;
configCache[1] = conf;
return conf;
}
function makeMedia(media) {
return function () {
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1_styled_components__["b" /* css */])(_templateObject$1, media, __WEBPACK_IMPORTED_MODULE_1_styled_components__["b" /* css */].apply(undefined, arguments));
};
}
var _templateObject = taggedTemplateLiteral(['\n margin-right: auto;\n margin-left: auto;\n\n ', '\n\n ', '\n'], ['\n margin-right: auto;\n margin-left: auto;\n\n ', '\n\n ', '\n']);
var _templateObject2 = taggedTemplateLiteral(['\n padding-right: ', ';\n padding-left: ', ';\n '], ['\n padding-right: ', ';\n padding-left: ', ';\n ']);
var _templateObject3 = taggedTemplateLiteral(['\n ', '\n '], ['\n ', '\n ']);
var _templateObject4 = taggedTemplateLiteral(['\n width: ', 'rem;\n '], ['\n width: ', 'rem;\n ']);
var Grid = function Grid(props) {
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(props.tagName || 'div', createProps(Grid.propTypes, props));
};
Grid.displayName = 'Grid';
Grid.propTypes = {
fluid: index.bool,
tagName: index.string,
children: index.node
};
var Grid$1 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1_styled_components__["a" /* default */])(Grid)(_templateObject, function (p) {
return p.fluid && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1_styled_components__["b" /* css */])(_templateObject2, function (p) {
return config(p).outerMargin + 'rem';
}, function (p) {
return config(p).outerMargin + 'rem';
});
}, function (p) {
return !p.fluid && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1_styled_components__["b" /* css */])(_templateObject3, DIMENSION_NAMES.map(function (t) {
return config(p).container[t] && config(p).media[t](_templateObject4, function (p) {
return config(p).container[t];
});
}));
});
var _templateObject$2 = taggedTemplateLiteral(['\n box-sizing: border-box;\n display: flex;\n flex: 0 1 auto;\n flex-direction: row;\n flex-wrap: wrap;\n margin-right: ', 'rem;\n margin-left: ', 'rem;\n\n ', '\n\n ', '\n\n ', '\n\n ', '\n\n ', '\n\n ', '\n\n ', '\n\n ', '\n\n ', '\n\n ', '\n\n ', '\n'], ['\n box-sizing: border-box;\n display: flex;\n flex: 0 1 auto;\n flex-direction: row;\n flex-wrap: wrap;\n margin-right: ', 'rem;\n margin-left: ', 'rem;\n\n ', '\n\n ', '\n\n ', '\n\n ', '\n\n ', '\n\n ', '\n\n ', '\n\n ', '\n\n ', '\n\n ', '\n\n ', '\n']);
var _templateObject2$1 = taggedTemplateLiteral(['\n justify-content: flex-start;\n text-align: start;\n '], ['\n justify-content: flex-start;\n text-align: start;\n ']);
var _templateObject3$1 = taggedTemplateLiteral(['\n justify-content: center;\n text-align: center;\n '], ['\n justify-content: center;\n text-align: center;\n ']);
var _templateObject4$1 = taggedTemplateLiteral(['\n justify-content: flex-end;\n text-align: end;\n '], ['\n justify-content: flex-end;\n text-align: end;\n ']);
var _templateObject5 = taggedTemplateLiteral(['\n align-items: flex-start;\n '], ['\n align-items: flex-start;\n ']);
var _templateObject6 = taggedTemplateLiteral(['\n align-items: center;\n '], ['\n align-items: center;\n ']);
var _templateObject7 = taggedTemplateLiteral(['\n align-items: flex-end;\n '], ['\n align-items: flex-end;\n ']);
var _templateObject8 = taggedTemplateLiteral(['\n justify-content: space-around;\n '], ['\n justify-content: space-around;\n ']);
var _templateObject9 = taggedTemplateLiteral(['\n justify-content: space-between;\n '], ['\n justify-content: space-between;\n ']);
var _templateObject10 = taggedTemplateLiteral(['\n order: -1;\n '], ['\n order: -1;\n ']);
var _templateObject11 = taggedTemplateLiteral(['\n order: 1;\n '], ['\n order: 1;\n ']);
var ModificatorType = index.oneOf(DIMENSION_NAMES);
var Row = function Row(props) {
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(props.tagName || 'div', createProps(Row.propTypes, props));
};
Row.displayName = 'Row';
Row.propTypes = {
reverse: index.bool,
start: ModificatorType,
center: ModificatorType,
end: ModificatorType,
top: ModificatorType,
middle: ModificatorType,
bottom: ModificatorType,
around: ModificatorType,
between: ModificatorType,
first: ModificatorType,
last: ModificatorType,
tagName: index.string,
children: index.node
};
var Row$1 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1_styled_components__["a" /* default */])(Row)(_templateObject$2, function (p) {
return config(p).gutterWidth / 2 * -1;
}, function (p) {
return config(p).gutterWidth / 2 * -1;
}, function (p) {
return p.reverse && '\n flex-direction: row-reverse;\n ';
}, function (p) {
return p.start && config(p).media[p.start](_templateObject2$1);
}, function (p) {
return p.center && config(p).media[p.center](_templateObject3$1);
}, function (p) {
return p.end && config(p).media[p.end](_templateObject4$1);
}, function (p) {
return p.top && config(p).media[p.top](_templateObject5);
}, function (p) {
return p.middle && config(p).media[p.middle](_templateObject6);
}, function (p) {
return p.bottom && config(p).media[p.bottom](_templateObject7);
}, function (p) {
return p.around && config(p).media[p.around](_templateObject8);
}, function (p) {
return p.between && config(p).media[p.between](_templateObject9);
}, function (p) {
return p.first && config(p).media[p.first](_templateObject10);
}, function (p) {
return p.last && config(p).media[p.last](_templateObject11);
});
var _templateObject$3 = taggedTemplateLiteral(['\n box-sizing: border-box;\n flex: 0 0 auto;\n padding-right: ', 'rem;\n padding-left: ', 'rem;\n\n ', '\n\n ', '\n\n ', '\n'], ['\n box-sizing: border-box;\n flex: 0 0 auto;\n padding-right: ', 'rem;\n padding-left: ', 'rem;\n\n ', '\n\n ', '\n\n ', '\n']);
var _templateObject2$2 = taggedTemplateLiteral(['', ''], ['', '']);
var _templateObject3$2 = taggedTemplateLiteral(['\n margin-left: ', '%;\n '], ['\n margin-left: ', '%;\n ']);
var ModificatorType$1 = index.oneOfType([index.number, index.bool]);
var offsetProps = DIMENSION_NAMES.map(function (d) {
return d + 'Offset';
});
var DimensionPropTypes = DIMENSION_NAMES.reduce(function (propTypes, dimension) {
propTypes[dimension] = ModificatorType$1;
propTypes[dimension + 'Offset'] = index.number;
return propTypes;
}, {});
var Col = function Col(props) {
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(props.tagName || 'div', createProps(Col.propTypes, props));
};
Col.propTypes = _extends({}, DimensionPropTypes, {
reverse: index.bool,
tagName: index.string,
children: index.node
});
Col.displayName = 'Col';
var Col$1 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1_styled_components__["a" /* default */])(Col)(_templateObject$3, function (p) {
return config(p).gutterWidth / 2;
}, function (p) {
return config(p).gutterWidth / 2;
}, function (p) {
return p.reverse && '\n flex-direction: column-reverse;\n ';
}, function (p) {
return Object.keys(p).filter(function (k) {
return ~DIMENSION_NAMES.indexOf(k);
}).map(function (k) {
return config(p).media[k](_templateObject2$2, Number.isInteger(p[k])
// Integer value
? '\n flex-basis: ' + 100 / config(p).gridSize * p[k] + '%;\n max-width: ' + 100 / config(p).gridSize * p[k] + '%;\n display: block;\n '
// Boolean
: p[k]
// Auto-width
? '\n flex-grow: 1;\n flex-basis: 0;\n max-width: 100%;\n display: block;\n '
// Hide element
: 'display: none;');
});
}, function (p) {
return Object.keys(p).filter(function (k) {
return ~offsetProps.indexOf(k);
}).map(function (k) {
return config(p).media[k.replace(/Offset$/, '')](_templateObject3$2, 100 / config(p).gridSize * p[k]);
});
});
/***/ }),
/* 60 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var _assign = __webpack_require__(9);
var ReactChildren = __webpack_require__(890);
var ReactComponent = __webpack_require__(183);
var ReactPureComponent = __webpack_require__(895);
var ReactClass = __webpack_require__(891);
var ReactDOMFactories = __webpack_require__(892);
var ReactElement = __webpack_require__(61);
var ReactPropTypes = __webpack_require__(894);
var ReactVersion = __webpack_require__(896);
var onlyChild = __webpack_require__(899);
var warning = __webpack_require__(5);
var createElement = ReactElement.createElement;
var createFactory = ReactElement.createFactory;
var cloneElement = ReactElement.cloneElement;
if (false) {
var canDefineProperty = require('./canDefineProperty');
var ReactElementValidator = require('./ReactElementValidator');
var didWarnPropTypesDeprecated = false;
createElement = ReactElementValidator.createElement;
createFactory = ReactElementValidator.createFactory;
cloneElement = ReactElementValidator.cloneElement;
}
var __spread = _assign;
if (false) {
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
};
// TODO: Fix tests so that this deprecation warning doesn't cause failures.
if (false) {
if (canDefineProperty) {
Object.defineProperty(React, 'PropTypes', {
get: function () {
process.env.NODE_ENV !== 'production' ? warning(didWarnPropTypesDeprecated, 'Accessing PropTypes via the main React package is deprecated. Use ' + 'the prop-types package from npm instead.') : void 0;
didWarnPropTypesDeprecated = true;
return ReactPropTypes;
}
});
}
}
module.exports = React;
/***/ }),
/* 61 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var _assign = __webpack_require__(9);
var ReactCurrentOwner = __webpack_require__(33);
var warning = __webpack_require__(5);
var canDefineProperty = __webpack_require__(308);
var hasOwnProperty = Object.prototype.hasOwnProperty;
var REACT_ELEMENT_TYPE = __webpack_require__(307);
var RESERVED_PROPS = {
key: true,
ref: true,
__self: true,
__source: true
};
var specialPropKeyWarningShown, specialPropRefWarningShown;
function hasValidRef(config) {
if (false) {
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 (false) {
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;
false ? 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;
false ? 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 (false) {
// 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 (false) {
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 (false) {
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;
/***/ }),
/* 62 */
/***/ (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.
*
*
*/
/**
* 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;
/***/ }),
/* 63 */
/***/ (function(module, exports) {
exports = module.exports = trim;
function trim(str){
return str.replace(/^\s*|\s*$/g, '');
}
exports.left = function(str){
return str.replace(/^\s*/, '');
};
exports.right = function(str){
return str.replace(/\s*$/, '');
};
/***/ }),
/* 64 */
/***/ (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.
*
*
*/
/**
* 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;
/***/ }),
/* 65 */
/***/ (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.
*
*
*/
/**
* 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;
/***/ }),
/* 66 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react_broadcast__ = __webpack_require__(14);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react_broadcast___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_react_broadcast__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_redux_form__ = __webpack_require__(935);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__fieldset__ = __webpack_require__(396);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__baseline__ = __webpack_require__(4);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_prop_types__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_prop_types__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_rnd_id__ = __webpack_require__(116);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_rnd_id___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_rnd_id__);
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; }; }();
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 FormGroup = function (_Component) {
_inherits(FormGroup, _Component);
function FormGroup(props) {
_classCallCheck(this, FormGroup);
var _this = _possibleConstructorReturn(this, (FormGroup.__proto__ || Object.getPrototypeOf(FormGroup)).call(this, props));
_this.renderGroup = _this.renderGroup.bind(_this);
return _this;
}
_createClass(FormGroup, [{
key: 'renderGroup',
value: function renderGroup(inputProps) {
var _props = this.props,
className = _props.className,
style = _props.style,
children = _props.children,
rest = _objectWithoutProperties(_props, ['className', 'style', 'children']);
var value = Object.assign({
id: __WEBPACK_IMPORTED_MODULE_6_rnd_id___default()()
}, rest, inputProps);
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
__WEBPACK_IMPORTED_MODULE_3__fieldset__["a" /* default */],
{ className: className, style: style },
__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
__WEBPACK_IMPORTED_MODULE_1_react_broadcast__["Broadcast"],
{ channel: 'input-group', value: value },
__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
'div',
null,
children
)
)
);
}
}, {
key: 'render',
value: function render() {
var _props2 = this.props,
_props2$name = _props2.name,
name = _props2$name === undefined ? __WEBPACK_IMPORTED_MODULE_6_rnd_id___default()() : _props2$name,
defaultValue = _props2.defaultValue,
normalize = _props2.normalize,
_props2$reduxForm = _props2.reduxForm,
reduxForm = _props2$reduxForm === undefined ? false : _props2$reduxForm;
if (!reduxForm) {
return this.renderGroup({});
}
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_2_redux_form__["a" /* Field */], {
name: name,
defaultValue: defaultValue,
component: this.renderGroup,
normalize: normalize
});
}
}]);
return FormGroup;
}(__WEBPACK_IMPORTED_MODULE_0_react__["Component"]);
FormGroup.propTypes = {
children: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.node,
className: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.string,
defaultValue: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.string,
name: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.string,
normalize: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.func,
reduxForm: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.bool,
style: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.object
};
/* harmony default export */ __webpack_exports__["default"] = (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__baseline__["a" /* default */])(FormGroup));
/***/ }),
/* 67 */
/***/ (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 emptyObject = {};
if (false) {
Object.freeze(emptyObject);
}
module.exports = emptyObject;
/***/ }),
/* 68 */
/***/ (function(module, exports, __webpack_require__) {
var bind = __webpack_require__(456);
module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty);
/***/ }),
/* 69 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
var addLeadingSlash = exports.addLeadingSlash = function addLeadingSlash(path) {
return path.charAt(0) === '/' ? path : '/' + path;
};
var stripLeadingSlash = exports.stripLeadingSlash = function stripLeadingSlash(path) {
return path.charAt(0) === '/' ? path.substr(1) : path;
};
var stripPrefix = exports.stripPrefix = function stripPrefix(path, prefix) {
return path.indexOf(prefix) === 0 ? path.substr(prefix.length) : path;
};
var stripTrailingSlash = exports.stripTrailingSlash = function stripTrailingSlash(path) {
return path.charAt(path.length - 1) === '/' ? path.slice(0, -1) : path;
};
var parsePath = exports.parsePath = function parsePath(path) {
var pathname = path || '/';
var search = '';
var hash = '';
var hashIndex = pathname.indexOf('#');
if (hashIndex !== -1) {
hash = pathname.substr(hashIndex);
pathname = pathname.substr(0, hashIndex);
}
var searchIndex = pathname.indexOf('?');
if (searchIndex !== -1) {
search = pathname.substr(searchIndex);
pathname = pathname.substr(0, searchIndex);
}
pathname = decodeURI(pathname);
return {
pathname: pathname,
search: search === '?' ? '' : search,
hash: hash === '#' ? '' : hash
};
};
var createPath = exports.createPath = function createPath(location) {
var pathname = location.pathname,
search = location.search,
hash = location.hash;
var path = encodeURI(pathname || '/');
if (search && search !== '?') path += search.charAt(0) === '?' ? search : '?' + search;
if (hash && hash !== '#') path += hash.charAt(0) === '#' ? hash : '#' + hash;
return path;
};
/***/ }),
/* 70 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isSymbol_js__ = __webpack_require__(94);
/** 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' || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__isSymbol_js__["a" /* default */])(value)) {
return value;
}
var result = (value + '');
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
}
/* harmony default export */ __webpack_exports__["a"] = (toKey);
/***/ }),
/* 71 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/**
* 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);
}
/* harmony default export */ __webpack_exports__["a"] = (eq);
/***/ }),
/* 72 */
/***/ (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;
/***/ }),
/* 73 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var _prodInvariant = __webpack_require__(7);
var EventPluginRegistry = __webpack_require__(163);
var EventPluginUtils = __webpack_require__(164);
var ReactErrorUtils = __webpack_require__(168);
var accumulateInto = __webpack_require__(281);
var forEachAccumulated = __webpack_require__(282);
var invariant = __webpack_require__(2);
/**
* 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') ? false ? 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 ? false ? 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;
/***/ }),
/* 74 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var EventPluginHub = __webpack_require__(73);
var EventPluginUtils = __webpack_require__(164);
var accumulateInto = __webpack_require__(281);
var forEachAccumulated = __webpack_require__(282);
var warning = __webpack_require__(5);
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 (false) {
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;
/***/ }),
/* 75 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
/**
* `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;
/***/ }),
/* 76 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var SyntheticEvent = __webpack_require__(32);
var getEventTarget = __webpack_require__(173);
/**
* @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 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__components_Provider__ = __webpack_require__(779);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__components_connectAdvanced__ = __webpack_require__(290);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__connect_connect__ = __webpack_require__(780);
/* unused harmony reexport Provider */
/* unused harmony reexport createProvider */
/* unused harmony reexport connectAdvanced */
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_2__connect_connect__["a"]; });
/***/ }),
/* 78 */
/***/ (function(module, exports) {
module.exports = extend
var hasOwnProperty = Object.prototype.hasOwnProperty;
function extend() {
var target = {}
for (var i = 0; i < arguments.length; i++) {
var source = arguments[i]
for (var key in source) {
if (hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
}
return target
}
/***/ }),
/* 79 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
/* eslint-disable no-unused-vars */
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
var hasOwnProperty = Object.prototype.hasOwnProperty;
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
function toObject(val) {
if (val === null || val === undefined) {
throw new TypeError('Object.assign cannot be called with null or undefined');
}
return Object(val);
}
function shouldUseNative() {
try {
if (!Object.assign) {
return false;
}
// Detect buggy property enumeration order in older V8 versions.
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
test1[5] = 'de';
if (Object.getOwnPropertyNames(test1)[0] === '5') {
return false;
}
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
var test2 = {};
for (var i = 0; i < 10; i++) {
test2['_' + String.fromCharCode(i)] = i;
}
var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
return test2[n];
});
if (order2.join('') !== '0123456789') {
return false;
}
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
var test3 = {};
'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
test3[letter] = letter;
});
if (Object.keys(Object.assign({}, test3)).join('') !==
'abcdefghijklmnopqrst') {
return false;
}
return true;
} catch (err) {
// We don't expect any of the above to throw, but better to be safe.
return false;
}
}
module.exports = shouldUseNative() ? Object.assign : function (target, source) {
var from;
var to = toObject(target);
var symbols;
for (var s = 1; s < arguments.length; s++) {
from = Object(arguments[s]);
for (var key in from) {
if (hasOwnProperty.call(from, key)) {
to[key] = from[key];
}
}
if (getOwnPropertySymbols) {
symbols = getOwnPropertySymbols(from);
for (var i = 0; i < symbols.length; i++) {
if (propIsEnumerable.call(from, symbols[i])) {
to[symbols[i]] = from[symbols[i]];
}
}
}
}
return to;
};
/***/ }),
/* 80 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
/* eslint-disable no-unused-vars */
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
var hasOwnProperty = Object.prototype.hasOwnProperty;
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
function toObject(val) {
if (val === null || val === undefined) {
throw new TypeError('Object.assign cannot be called with null or undefined');
}
return Object(val);
}
function shouldUseNative() {
try {
if (!Object.assign) {
return false;
}
// Detect buggy property enumeration order in older V8 versions.
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
test1[5] = 'de';
if (Object.getOwnPropertyNames(test1)[0] === '5') {
return false;
}
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
var test2 = {};
for (var i = 0; i < 10; i++) {
test2['_' + String.fromCharCode(i)] = i;
}
var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
return test2[n];
});
if (order2.join('') !== '0123456789') {
return false;
}
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
var test3 = {};
'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
test3[letter] = letter;
});
if (Object.keys(Object.assign({}, test3)).join('') !==
'abcdefghijklmnopqrst') {
return false;
}
return true;
} catch (err) {
// We don't expect any of the above to throw, but better to be safe.
return false;
}
}
module.exports = shouldUseNative() ? Object.assign : function (target, source) {
var from;
var to = toObject(target);
var symbols;
for (var s = 1; s < arguments.length; s++) {
from = Object(arguments[s]);
for (var key in from) {
if (hasOwnProperty.call(from, key)) {
to[key] = from[key];
}
}
if (getOwnPropertySymbols) {
symbols = getOwnPropertySymbols(from);
for (var i = 0; i < symbols.length; i++) {
if (propIsEnumerable.call(from, symbols[i])) {
to[symbols[i]] = from[symbols[i]];
}
}
}
}
return to;
};
/***/ }),
/* 81 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react_broadcast__ = __webpack_require__(14);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react_broadcast___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_react_broadcast__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_styled_components__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_remcalc__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_remcalc___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_remcalc__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__label__ = __webpack_require__(206);
var _templateObject = _taggedTemplateLiteral(['\n margin-right: ', ';\n'], ['\n margin-right: ', ';\n']);
function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
var StyledLabel = __WEBPACK_IMPORTED_MODULE_4__label__["a" /* default */].extend(_templateObject, __WEBPACK_IMPORTED_MODULE_3_remcalc___default()(12));
/* harmony default export */ __webpack_exports__["default"] = (function (props) {
var render = function render(value) {
var _ref = value || {},
_ref$id = _ref.id,
id = _ref$id === undefined ? '' : _ref$id;
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(StyledLabel, Object.assign({}, props, { htmlFor: id }));
};
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
__WEBPACK_IMPORTED_MODULE_1_react_broadcast__["Subscriber"],
{ channel: 'input-group' },
render
);
});
/***/ }),
/* 82 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_broadcast__ = __webpack_require__(14);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_broadcast___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react_broadcast__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_styled_is__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__baseline__ = __webpack_require__(4);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__breakpoints__ = __webpack_require__(386);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_styled_components__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__label__ = __webpack_require__(206);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_prop_types__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_prop_types__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_react__);
var _templateObject = _taggedTemplateLiteral(['\n ', ';\n\n ', ';\n\n ', ';\n\n ', ';\n\n ', ';\n'], ['\n ', ';\n\n ', ';\n\n ', ';\n\n ', ';\n\n ', ';\n']),
_templateObject2 = _taggedTemplateLiteral(['\n text-align: right;\n '], ['\n text-align: right;\n ']),
_templateObject3 = _taggedTemplateLiteral(['\n float: right;\n '], ['\n float: right;\n ']),
_templateObject4 = _taggedTemplateLiteral(['\n color: ', ';\n '], ['\n color: ', ';\n ']);
function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
var StyledLabel = __WEBPACK_IMPORTED_MODULE_5__label__["a" /* default */].extend(_templateObject, __WEBPACK_IMPORTED_MODULE_3__breakpoints__["a" /* default */].medium(_templateObject2), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1_styled_is__["a" /* default */])('right')(_templateObject3), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1_styled_is__["a" /* default */])('error')(_templateObject4, function (props) {
return props.theme.red;
}), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1_styled_is__["a" /* default */])('warning')(_templateObject4, function (props) {
return props.theme.orange;
}), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1_styled_is__["a" /* default */])('success')(_templateObject4, function (props) {
return props.theme.green;
}));
var Meta = function Meta(props) {
var render = function render(value) {
var _value$meta = value.meta,
meta = _value$meta === undefined ? {} : _value$meta;
var msg = props.children || props.error || props.warning || props.success || meta.error || meta.warning || meta.success || value.error || value.warning || value.success;
var hasError = Boolean(props.error || meta.error || value.error);
var hasWarning = Boolean(props.warning || meta.warning || value.warning);
var hasSuccess = Boolean(props.success || meta.success || value.success);
var isRight = !props.left;
return __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement(
StyledLabel,
Object.assign({}, meta, props, {
error: hasError,
warning: hasWarning,
success: hasSuccess,
right: isRight
}),
msg
);
};
return __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement(
__WEBPACK_IMPORTED_MODULE_0_react_broadcast__["Subscriber"],
{ channel: 'input-group' },
render
);
};
Meta.propTypes = {
children: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.node,
error: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.bool]),
left: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.bool,
success: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.bool]),
warning: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.bool])
};
/* harmony default export */ __webpack_exports__["default"] = (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__baseline__["a" /* default */])(Meta));
/***/ }),
/* 83 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2016 Titus Wormer
* @license MIT
* @module is-decimal
* @fileoverview Check if a character is decimal.
*/
/* eslint-env commonjs */
/* Expose. */
module.exports = decimal;
/**
* Check whether the given character code, or the character
* code at the first character, is decimal.
*
* @param {string|number} character
* @return {boolean} - Whether `character` is decimal.
*/
function decimal(character) {
var code = typeof character === 'string' ?
character.charCodeAt(0) : character;
return code >= 48 && code <= 57; /* 0-9 */
}
/***/ }),
/* 84 */
/***/ (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 _createRule = __webpack_require__(220);
var _createRule2 = _interopRequireDefault(_createRule);
var _updateRule = __webpack_require__(493);
var _updateRule2 = _interopRequireDefault(_updateRule);
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"); } }
/**
* Contains rules objects and allows adding/removing etc.
* Is used for e.g. by `StyleSheet` or `ConditionalRule`.
*/
var RulesContainer = function () {
// Original styles object.
function RulesContainer(options) {
_classCallCheck(this, RulesContainer);
this.map = Object.create(null);
this.raw = Object.create(null);
this.index = [];
this.options = options;
this.classes = options.classes;
}
/**
* Create and register rule.
*
* Will not render after Style Sheet was rendered the first time.
*/
// Used to ensure correct rules order.
// Rules registry for access by .get() method.
// It contains the same rule registered by name and by selector.
_createClass(RulesContainer, [{
key: 'add',
value: function add(name, decl, options) {
var _options = this.options,
parent = _options.parent,
sheet = _options.sheet,
jss = _options.jss,
Renderer = _options.Renderer,
generateClassName = _options.generateClassName;
options = _extends({
classes: this.classes,
parent: parent,
sheet: sheet,
jss: jss,
Renderer: Renderer,
generateClassName: generateClassName
}, options);
if (!options.className) options.className = this.classes[name];
this.raw[name] = decl;
var rule = (0, _createRule2['default'])(name, decl, options);
this.register(rule);
var index = options.index === undefined ? this.index.length : options.index;
this.index.splice(index, 0, rule);
return rule;
}
/**
* Get a rule.
*/
}, {
key: 'get',
value: function get(name) {
return this.map[name];
}
/**
* Delete a rule.
*/
}, {
key: 'remove',
value: function remove(rule) {
this.unregister(rule);
this.index.splice(this.indexOf(rule), 1);
}
/**
* Get index of a rule.
*/
}, {
key: 'indexOf',
value: function indexOf(rule) {
return this.index.indexOf(rule);
}
/**
* Run `onProcessRule()` plugins on every rule.
*/
}, {
key: 'process',
value: function process() {
var plugins = this.options.jss.plugins;
// We need to clone array because if we modify the index somewhere else during a loop
// we end up with very hard-to-track-down side effects.
this.index.slice(0).forEach(plugins.onProcessRule, plugins);
}
/**
* Register a rule in `.map` and `.classes` maps.
*/
}, {
key: 'register',
value: function register(rule) {
if (rule.name) this.map[rule.name] = rule;
if (rule.className && rule.name) this.classes[rule.name] = rule.className;
if (rule.selector) this.map[rule.selector] = rule;
}
/**
* Unregister a rule.
*/
}, {
key: 'unregister',
value: function unregister(rule) {
if (rule.name) {
delete this.map[rule.name];
delete this.classes[rule.name];
}
delete this.map[rule.selector];
}
/**
* Update the function values with a new data.
*/
}, {
key: 'update',
value: function update(name, data) {
if (typeof name === 'string') {
(0, _updateRule2['default'])(this.get(name), data, RulesContainer);
return;
}
for (var index = 0; index < this.index.length; index++) {
(0, _updateRule2['default'])(this.index[index], name, RulesContainer);
}
}
/**
* Convert rules to a CSS string.
*/
}, {
key: 'toString',
value: function toString(options) {
var str = '';
for (var index = 0; index < this.index.length; index++) {
var rule = this.index[index];
var css = rule.toString(options);
// No need to render an empty rule.
if (!css) continue;
if (str) str += '\n';
str += css;
}
return str;
}
}]);
return RulesContainer;
}();
exports['default'] = RulesContainer;
/***/ }),
/* 85 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.create = exports.sheets = exports.RulesContainer = exports.SheetsRegistry = exports.getDynamicStyles = undefined;
var _Jss = __webpack_require__(477);
var _Jss2 = _interopRequireDefault(_Jss);
var _SheetsRegistry = __webpack_require__(219);
var _SheetsRegistry2 = _interopRequireDefault(_SheetsRegistry);
var _RulesContainer = __webpack_require__(84);
var _RulesContainer2 = _interopRequireDefault(_RulesContainer);
var _sheets = __webpack_require__(131);
var _sheets2 = _interopRequireDefault(_sheets);
var _getDynamicStyles = __webpack_require__(492);
var _getDynamicStyles2 = _interopRequireDefault(_getDynamicStyles);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
/**
* Extracts a styles object with only rules that contain function values.
*/
exports.getDynamicStyles = _getDynamicStyles2['default'];
/**
* SheetsRegistry for SSR.
*/
/**
* A better abstraction over CSS.
*
* @copyright Oleg Slobodskoi 2014-present
* @website https://github.com/cssinjs/jss
* @license MIT
*/
exports.SheetsRegistry = _SheetsRegistry2['default'];
/**
* RulesContainer for plugins.
*/
exports.RulesContainer = _RulesContainer2['default'];
/**
* Default global SheetsRegistry instance.
*/
exports.sheets = _sheets2['default'];
/**
* Creates a new instance of Jss.
*/
var create = exports.create = function create(options) {
return new _Jss2['default'](options);
};
/**
* A global Jss instance.
*/
exports['default'] = create();
/***/ }),
/* 86 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__listCacheClear_js__ = __webpack_require__(554);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__listCacheDelete_js__ = __webpack_require__(555);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__listCacheGet_js__ = __webpack_require__(556);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__listCacheHas_js__ = __webpack_require__(557);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__listCacheSet_js__ = __webpack_require__(558);
/**
* 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 = __WEBPACK_IMPORTED_MODULE_0__listCacheClear_js__["a" /* default */];
ListCache.prototype['delete'] = __WEBPACK_IMPORTED_MODULE_1__listCacheDelete_js__["a" /* default */];
ListCache.prototype.get = __WEBPACK_IMPORTED_MODULE_2__listCacheGet_js__["a" /* default */];
ListCache.prototype.has = __WEBPACK_IMPORTED_MODULE_3__listCacheHas_js__["a" /* default */];
ListCache.prototype.set = __WEBPACK_IMPORTED_MODULE_4__listCacheSet_js__["a" /* default */];
/* harmony default export */ __webpack_exports__["a"] = (ListCache);
/***/ }),
/* 87 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__root_js__ = __webpack_require__(27);
/** Built-in value references. */
var Symbol = __WEBPACK_IMPORTED_MODULE_0__root_js__["a" /* default */].Symbol;
/* harmony default export */ __webpack_exports__["a"] = (Symbol);
/***/ }),
/* 88 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__eq_js__ = __webpack_require__(71);
/**
* 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 (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__eq_js__["a" /* default */])(array[length][0], key)) {
return length;
}
}
return -1;
}
/* harmony default export */ __webpack_exports__["a"] = (assocIndexOf);
/***/ }),
/* 89 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__defineProperty_js__ = __webpack_require__(231);
/**
* 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__' && __WEBPACK_IMPORTED_MODULE_0__defineProperty_js__["a" /* default */]) {
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__defineProperty_js__["a" /* default */])(object, key, {
'configurable': true,
'enumerable': true,
'value': value,
'writable': true
});
} else {
object[key] = value;
}
}
/* harmony default export */ __webpack_exports__["a"] = (baseAssignValue);
/***/ }),
/* 90 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isKeyable_js__ = __webpack_require__(552);
/**
* 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 __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__isKeyable_js__["a" /* default */])(key)
? data[typeof key == 'string' ? 'string' : 'hash']
: data.map;
}
/* harmony default export */ __webpack_exports__["a"] = (getMapData);
/***/ }),
/* 91 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getNative_js__ = __webpack_require__(41);
/* Built-in method references that are verified to be native. */
var nativeCreate = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__getNative_js__["a" /* default */])(Object, 'create');
/* harmony default export */ __webpack_exports__["a"] = (nativeCreate);
/***/ }),
/* 92 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isFunction_js__ = __webpack_require__(143);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isLength_js__ = __webpack_require__(144);
/**
* 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 && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__isLength_js__["a" /* default */])(value.length) && !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__isFunction_js__["a" /* default */])(value);
}
/* harmony default export */ __webpack_exports__["a"] = (isArrayLike);
/***/ }),
/* 93 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__baseGetTag_js__ = __webpack_require__(54);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getPrototype_js__ = __webpack_require__(234);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isObjectLike_js__ = __webpack_require__(42);
/** `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 (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__isObjectLike_js__["a" /* default */])(value) || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__baseGetTag_js__["a" /* default */])(value) != objectTag) {
return false;
}
var proto = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__getPrototype_js__["a" /* default */])(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;
}
/* harmony default export */ __webpack_exports__["a"] = (isPlainObject);
/***/ }),
/* 94 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__baseGetTag_js__ = __webpack_require__(54);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isObjectLike_js__ = __webpack_require__(42);
/** `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' ||
(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__isObjectLike_js__["a" /* default */])(value) && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__baseGetTag_js__["a" /* default */])(value) == symbolTag);
}
/* harmony default export */ __webpack_exports__["a"] = (isSymbol);
/***/ }),
/* 95 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__arrayMap_js__ = __webpack_require__(225);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__copyArray_js__ = __webpack_require__(230);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isArray_js__ = __webpack_require__(28);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__isSymbol_js__ = __webpack_require__(94);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__stringToPath_js__ = __webpack_require__(238);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__toKey_js__ = __webpack_require__(70);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__toString_js__ = __webpack_require__(243);
/**
* 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 (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__isArray_js__["a" /* default */])(value)) {
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__arrayMap_js__["a" /* default */])(value, __WEBPACK_IMPORTED_MODULE_5__toKey_js__["a" /* default */]);
}
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__isSymbol_js__["a" /* default */])(value) ? [value] : __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__copyArray_js__["a" /* default */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__stringToPath_js__["a" /* default */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__toString_js__["a" /* default */])(value)));
}
/* harmony default export */ __webpack_exports__["a"] = (toPath);
/***/ }),
/* 96 */
/***/ (function(module, exports, __webpack_require__) {
var listCacheClear = __webpack_require__(655),
listCacheDelete = __webpack_require__(656),
listCacheGet = __webpack_require__(657),
listCacheHas = __webpack_require__(658),
listCacheSet = __webpack_require__(659);
/**
* 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;
/***/ }),
/* 97 */
/***/ (function(module, exports, __webpack_require__) {
var root = __webpack_require__(18);
/** Built-in value references. */
var Symbol = root.Symbol;
module.exports = Symbol;
/***/ }),
/* 98 */
/***/ (function(module, exports, __webpack_require__) {
var eq = __webpack_require__(72);
/**
* 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;
/***/ }),
/* 99 */
/***/ (function(module, exports, __webpack_require__) {
var defineProperty = __webpack_require__(254);
/**
* 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;
/***/ }),
/* 100 */
/***/ (function(module, exports, __webpack_require__) {
var isKeyable = __webpack_require__(653);
/**
* 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;
/***/ }),
/* 101 */
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(44);
/* Built-in method references that are verified to be native. */
var nativeCreate = getNative(Object, 'create');
module.exports = nativeCreate;
/***/ }),
/* 102 */
/***/ (function(module, exports, __webpack_require__) {
var isSymbol = __webpack_require__(103);
/** 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;
/***/ }),
/* 103 */
/***/ (function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(43),
isObjectLike = __webpack_require__(35);
/** `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;
/***/ }),
/* 104 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var _assign = __webpack_require__(9);
var EventPluginRegistry = __webpack_require__(163);
var ReactEventEmitterMixin = __webpack_require__(744);
var ViewportMetrics = __webpack_require__(280);
var getVendorPrefixedEventName = __webpack_require__(776);
var isEventSupported = __webpack_require__(174);
/**
* 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;
/***/ }),
/* 105 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var SyntheticUIEvent = __webpack_require__(76);
var ViewportMetrics = __webpack_require__(280);
var getEventModifierState = __webpack_require__(172);
/**
* @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;
/***/ }),
/* 106 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*
*/
var _prodInvariant = __webpack_require__(7);
var invariant = __webpack_require__(2);
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() ? false ? 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() ? false ? 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;
/***/ }),
/* 107 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
// 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 = '&quot;';
break;
case 38:
// &
escape = '&amp;';
break;
case 39:
// '
escape = '&#x27;'; // modified from escape-html; used to be '&#39'
break;
case 60:
// <
escape = '&lt;';
break;
case 62:
// >
escape = '&gt;';
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;
/***/ }),
/* 108 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var ExecutionEnvironment = __webpack_require__(15);
var DOMNamespaces = __webpack_require__(162);
var WHITESPACE_TEST = /^[ \r\n\t\f]/;
var NONVISIBLE_TEST = /<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/;
var createMicrosoftUnsafeLocalFunction = __webpack_require__(170);
// 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;
/***/ }),
/* 109 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _LinkRenderer = __webpack_require__(821);
Object.defineProperty(exports, 'default', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_LinkRenderer).default;
}
});
Object.defineProperty(exports, 'styles', {
enumerable: true,
get: function get() {
return _LinkRenderer.styles;
}
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/***/ }),
/* 110 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = formatName;
function formatName(context, name) {
var sectionPrefix = context._reduxForm.sectionPrefix;
return !sectionPrefix ? name : sectionPrefix + "." + name;
}
/***/ }),
/* 111 */
/***/ (function(module, exports) {
module.exports = function(module) {
if(!module.webpackPolyfill) {
module.deprecate = function() {};
module.paths = [];
// module.parent = undefined by default
if(!module.children) module.children = [];
Object.defineProperty(module, "loaded", {
enumerable: true,
get: function() {
return module.l;
}
});
Object.defineProperty(module, "id", {
enumerable: true,
get: function() {
return module.i;
}
});
module.webpackPolyfill = 1;
}
return module;
};
/***/ }),
/* 112 */
/***/ (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.
*
*
*/
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;
/***/ }),
/* 113 */
/***/ (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 emptyObject = {};
if (false) {
Object.freeze(emptyObject);
}
module.exports = emptyObject;
/***/ }),
/* 114 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var _prodInvariant = __webpack_require__(64);
var ReactNoopUpdateQueue = __webpack_require__(115);
var canDefineProperty = __webpack_require__(197);
var emptyObject = __webpack_require__(113);
var invariant = __webpack_require__(47);
var warning = __webpack_require__(38);
/**
* 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) ? false ? 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 (false) {
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;
/***/ }),
/* 115 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var warning = __webpack_require__(38);
function warnNoop(publicInstance, callerName) {
if (false) {
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;
/***/ }),
/* 116 */
/***/ (function(module, exports, __webpack_require__) {
const randomNatural = __webpack_require__(361);
// From https://github.com/styled-components/styled-components/blob/065001c725744629c7870240e4a955b924ef5337/src/utils/generateAlphabeticName.js
const chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('');
const rndId = _code => {
const code = _code ? _code : randomNatural({ min: 1000000000 });
const lastDigit = chars[code % chars.length];
return code > chars.length
? `${rndId(Math.floor(code / chars.length))}${lastDigit}`
: lastDigit;
};
module.exports = rndId;
/***/ }),
/* 117 */
/***/ (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.
*
*
*/
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;
/***/ }),
/* 118 */
/***/ (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 emptyObject = {};
if (false) {
Object.freeze(emptyObject);
}
module.exports = emptyObject;
/***/ }),
/* 119 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var _prodInvariant = __webpack_require__(65);
var ReactNoopUpdateQueue = __webpack_require__(120);
var canDefineProperty = __webpack_require__(201);
var emptyObject = __webpack_require__(118);
var invariant = __webpack_require__(49);
var warning = __webpack_require__(39);
/**
* 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) ? false ? 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 (false) {
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;
/***/ }),
/* 120 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var warning = __webpack_require__(39);
function warnNoop(publicInstance, callerName) {
if (false) {
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;
/***/ }),
/* 121 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_remcalc__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_remcalc___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_remcalc__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_prop_types__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_prop_types__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_styled_is__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_styled_components__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_normalized_styled_components__ = __webpack_require__(26);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react_router_dom__ = __webpack_require__(295);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__boxes__ = __webpack_require__(51);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__paper_effect__ = __webpack_require__(209);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__typography__ = __webpack_require__(13);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__baseline__ = __webpack_require__(4);
var _templateObject = _taggedTemplateLiteral(['\n color: ', ';\n background-color: ', ';\n border-color: ', ';\n\n &:focus {\n background-color: ', ';\n border-color: ', ';\n }\n\n &:hover {\n background-color: ', ';\n border-color: ', ';\n }\n\n &:active,\n &:active:hover,\n &:active:focus {\n background-color: ', ';\n border-color: ', ';\n }\n '], ['\n color: ', ';\n background-color: ', ';\n border-color: ', ';\n\n &:focus {\n background-color: ', ';\n border-color: ', ';\n }\n\n &:hover {\n background-color: ', ';\n border-color: ', ';\n }\n\n &:active,\n &:active:hover,\n &:active:focus {\n background-color: ', ';\n border-color: ', ';\n }\n ']),
_templateObject2 = _taggedTemplateLiteral(['\n color: ', ';\n background-color: ', ';\n border-color: ', ';\n box-shadow: ', ';\n\n &:focus {\n background-color: ', ';\n border-color: ', ';\n }\n\n &:hover {\n background-color: ', ';\n border-color: ', ';\n }\n\n &:active,\n &:active:hover,\n &:active:focus {\n background-color: ', ';\n border-color: ', ';\n box-shadow: ', ';\n }\n '], ['\n color: ', ';\n background-color: ', ';\n border-color: ', ';\n box-shadow: ', ';\n\n &:focus {\n background-color: ', ';\n border-color: ', ';\n }\n\n &:hover {\n background-color: ', ';\n border-color: ', ';\n }\n\n &:active,\n &:active:hover,\n &:active:focus {\n background-color: ', ';\n border-color: ', ';\n box-shadow: ', ';\n }\n ']),
_templateObject3 = _taggedTemplateLiteral(['\n color: ', ';\n background-color: ', ';\n border-color: ', ';\n box-shadow: ', ';\n\n &:focus {\n background-color: ', ';\n border-color: ', ';\n }\n\n &:hover {\n background-color: ', ';\n border-color: ', ';\n }\n\n &:active,\n &:active:hover,\n &:active:focus {\n background-color: ', ';\n border-color: ', ';\n }\n '], ['\n color: ', ';\n background-color: ', ';\n border-color: ', ';\n box-shadow: ', ';\n\n &:focus {\n background-color: ', ';\n border-color: ', ';\n }\n\n &:hover {\n background-color: ', ';\n border-color: ', ';\n }\n\n &:active,\n &:active:hover,\n &:active:focus {\n background-color: ', ';\n border-color: ', ';\n }\n ']),
_templateObject4 = _taggedTemplateLiteral(['\n border-radius: 0;\n '], ['\n border-radius: 0;\n ']),
_templateObject5 = _taggedTemplateLiteral(['\n min-width: ', ';\n ', '\n\n & + button {\n margin-left: ', ';\n }\n'], ['\n min-width: ', ';\n ', '\n\n & + button {\n margin-left: ', ';\n }\n']),
_templateObject6 = _taggedTemplateLiteral(['\n display: inline-block;\n ', '\n'], ['\n display: inline-block;\n ', '\n']);
function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
// Based on bootstrap 4
var style = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4_styled_components__["b" /* css */])(['box-sizing: border-box;display: inline-block;justify-content: center;align-items: center;margin: 0;padding: ', ' ', ';position: relative;', ';', ';font-size: ', ';text-align: center;font-style: normal;font-stretch: normal;line-height: normal;letter-spacing: normal;text-decoration: none;white-space: nowrap;vertical-align: middle;touch-action: manipulation;cursor: pointer;color: ', ';background-image: none;background-color: ', ';border-radius: ', ';border: solid ', ' ', ';box-shadow: ', ';&:focus {outline: 0;text-decoration: none;background-color: ', ';border-color: ', ';}&:hover {background-color: ', ';border: solid ', ' ', ';}&:active,&:active:hover,&:active:focus {background-image: none;outline: 0;background-color: ', ';border-color: ', ';}&[disabled] {cursor: not-allowed;box-shadow: none;pointer-events: none;}', '', '', '', ''], __WEBPACK_IMPORTED_MODULE_1_remcalc___default()(15), __WEBPACK_IMPORTED_MODULE_1_remcalc___default()(18), __WEBPACK_IMPORTED_MODULE_9__typography__["a" /* default */].fontFamily, __WEBPACK_IMPORTED_MODULE_9__typography__["a" /* default */].normal, __WEBPACK_IMPORTED_MODULE_1_remcalc___default()(15), function (props) {
return props.theme.white;
}, function (props) {
return props.theme.primary;
}, __WEBPACK_IMPORTED_MODULE_7__boxes__["c" /* borderRadius */], __WEBPACK_IMPORTED_MODULE_1_remcalc___default()(1), function (props) {
return props.theme.primaryDesaturated;
}, __WEBPACK_IMPORTED_MODULE_7__boxes__["a" /* bottomShaddow */], function (props) {
return props.theme.primary;
}, function (props) {
return props.theme.primaryDesaturated;
}, function (props) {
return props.theme.primaryHover;
}, __WEBPACK_IMPORTED_MODULE_1_remcalc___default()(1), function (props) {
return props.theme.primaryDark;
}, function (props) {
return props.theme.primaryActive;
}, function (props) {
return props.theme.primaryDesaturatedActive;
}, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3_styled_is__["a" /* default */])('secondary')(_templateObject, function (props) {
return props.theme.secondary;
}, function (props) {
return props.theme.white;
}, function (props) {
return props.theme.grey;
}, function (props) {
return props.theme.white;
}, function (props) {
return props.theme.grey;
}, function (props) {
return props.theme.whiteHover;
}, function (props) {
return props.theme.grey;
}, function (props) {
return props.theme.whiteActive;
}, function (props) {
return props.theme.grey;
}), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3_styled_is__["a" /* default */])('tertiary')(_templateObject2, function (props) {
return props.theme.secondary;
}, function (props) {
return props.theme.white;
}, function (props) {
return props.theme.grey;
}, __WEBPACK_IMPORTED_MODULE_8__paper_effect__["a" /* default */], function (props) {
return props.theme.white;
}, function (props) {
return props.theme.grey;
}, function (props) {
return props.theme.whiteHover;
}, function (props) {
return props.theme.grey;
}, function (props) {
return props.theme.whiteActive;
}, function (props) {
return props.theme.grey;
}, __WEBPACK_IMPORTED_MODULE_7__boxes__["a" /* bottomShaddow */]), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3_styled_is__["a" /* default */])('disabled')(_templateObject3, function (props) {
return props.theme.grey;
}, function (props) {
return props.theme.disabled;
}, function (props) {
return props.theme.grey;
}, __WEBPACK_IMPORTED_MODULE_7__boxes__["a" /* bottomShaddow */], function (props) {
return props.theme.disabled;
}, function (props) {
return props.theme.grey;
}, function (props) {
return props.theme.disabled;
}, function (props) {
return props.theme.disabled;
}, function (props) {
return props.theme.disabled;
}, function (props) {
return props.theme.disabled;
}), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3_styled_is__["c" /* isOr */])('rect', 'tertiary')(_templateObject4));
var StyledButton = __WEBPACK_IMPORTED_MODULE_5_normalized_styled_components__["g" /* Button */].extend(_templateObject5, __WEBPACK_IMPORTED_MODULE_1_remcalc___default()(120), style, __WEBPACK_IMPORTED_MODULE_1_remcalc___default()(20));
var StyledAnchor = __WEBPACK_IMPORTED_MODULE_5_normalized_styled_components__["h" /* A */].extend(_templateObject6, style);
var StyledLink = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4_styled_components__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_6_react_router_dom__["a" /* Link */]).withConfig({
displayName: 'button__StyledLink'
})(['display: inline-block;', ''], style);
/**
* @example ./usage.md
*/
var Button = function Button(props) {
var _props$href = props.href,
href = _props$href === undefined ? '' : _props$href,
_props$to = props.to,
to = _props$to === undefined ? '' : _props$to;
var Views = [function () {
return to ? StyledLink : null;
}, function () {
return href ? StyledAnchor : null;
}, function () {
return StyledButton;
}];
var View = Views.reduce(function (sel, view) {
return sel ? sel : view();
}, null);
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
View,
props,
props.children
);
};
Button.propTypes = {
/**
* The `<button>`/`<a>`/`<Link>` text
*/
children: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.node,
/**
* When used, it will render an `<a>` with the givern href
*/
href: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.string,
/**
* When used, it will render a `<Link>` with the givern to
*/
to: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.string,
primary: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.bool,
secondary: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.bool,
tertiary: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.bool
};
Button.defaultProps = {
primary: true
};
/* harmony default export */ __webpack_exports__["default"] = (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_10__baseline__["a" /* default */])(Button));
/***/ }),
/* 122 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_styled_components__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react_broadcast__ = __webpack_require__(14);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react_broadcast___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_react_broadcast__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__baseline__ = __webpack_require__(4);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__paper_effect__ = __webpack_require__(209);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__boxes__ = __webpack_require__(51);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_remcalc__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_remcalc___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_remcalc__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_styled_is__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_react_styled_flexboxgrid__ = __webpack_require__(59);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_prop_types__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_prop_types__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_9_react__);
var _templateObject = _taggedTemplateLiteral(['\n position: relative;\n height: auto;\n min-height: ', ';\n margin-bottom: ', ';\n border: ', ' solid ', ';\n background-color: ', ';\n box-shadow: ', ';\n\n ', ';\n\n ', ';\n\n ', ';\n\n ', ';\n'], ['\n position: relative;\n height: auto;\n min-height: ', ';\n margin-bottom: ', ';\n border: ', ' solid ', ';\n background-color: ', ';\n box-shadow: ', ';\n\n ', ';\n\n ', ';\n\n ', ';\n\n ', ';\n']),
_templateObject2 = _taggedTemplateLiteral(['\n min-height: auto;\n height: ', ';\n margin-bottom: ', ';\n '], ['\n min-height: auto;\n height: ', ';\n margin-bottom: ', ';\n ']),
_templateObject3 = _taggedTemplateLiteral(['\n box-shadow: ', ';\n '], ['\n box-shadow: ', ';\n ']),
_templateObject4 = _taggedTemplateLiteral(['\n box-shadow: none;\n '], ['\n box-shadow: none;\n ']),
_templateObject5 = _taggedTemplateLiteral(['\n ', '\n '], ['\n ', '\n ']);
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 _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
var StyledCard = __WEBPACK_IMPORTED_MODULE_7_react_styled_flexboxgrid__["Row"].extend(_templateObject, __WEBPACK_IMPORTED_MODULE_5_remcalc___default()(126), __WEBPACK_IMPORTED_MODULE_5_remcalc___default()(10), __WEBPACK_IMPORTED_MODULE_5_remcalc___default()(1), function (props) {
return props.theme.grey;
}, function (props) {
return props.theme.white;
}, __WEBPACK_IMPORTED_MODULE_4__boxes__["a" /* bottomShaddow */], __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6_styled_is__["a" /* default */])('collapsed')(_templateObject2, __WEBPACK_IMPORTED_MODULE_5_remcalc___default()(48), __WEBPACK_IMPORTED_MODULE_5_remcalc___default()(16)), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6_styled_is__["a" /* default */])('collapsed', 'headed')(_templateObject3, __WEBPACK_IMPORTED_MODULE_4__boxes__["e" /* bottomShaddowDarker */]), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6_styled_is__["a" /* default */])('flat')(_templateObject4), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6_styled_is__["a" /* default */])('stacked')(_templateObject5, __WEBPACK_IMPORTED_MODULE_3__paper_effect__["a" /* default */]));
/**
* @example ./usage.md
*/
var Card = function Card(_ref) {
var children = _ref.children,
_ref$collapsed = _ref.collapsed,
collapsed = _ref$collapsed === undefined ? false : _ref$collapsed,
_ref$headed = _ref.headed,
headed = _ref$headed === undefined ? false : _ref$headed,
rest = _objectWithoutProperties(_ref, ['children', 'collapsed', 'headed']);
var render = function render(value) {
var newValue = {
fromHeader: (value || {}).fromHeader,
headed: headed,
collapsed: collapsed
};
return __WEBPACK_IMPORTED_MODULE_9_react___default.a.createElement(
__WEBPACK_IMPORTED_MODULE_1_react_broadcast__["Broadcast"],
{ channel: 'card', value: newValue },
__WEBPACK_IMPORTED_MODULE_9_react___default.a.createElement(
StyledCard,
Object.assign({ name: 'card', collapsed: collapsed, headed: headed }, rest),
children
)
);
};
return __WEBPACK_IMPORTED_MODULE_9_react___default.a.createElement(
__WEBPACK_IMPORTED_MODULE_1_react_broadcast__["Subscriber"],
{ channel: 'card' },
render
);
};
Card.propTypes = {
children: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.node,
collapsed: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.bool,
headed: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.bool,
flat: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.bool,
stacked: __WEBPACK_IMPORTED_MODULE_8_prop_types___default.a.bool
};
/* harmony default export */ __webpack_exports__["default"] = (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__baseline__["a" /* default */])(Card));
/***/ }),
/* 123 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_broadcast__ = __webpack_require__(14);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_broadcast___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react_broadcast__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash_isstring__ = __webpack_require__(592);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash_isstring___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash_isstring__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__typography__ = __webpack_require__(13);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__baseline__ = __webpack_require__(4);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_remcalc__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_remcalc___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_remcalc__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_styled_is__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_styled_components__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_prop_types__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_prop_types__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_react__);
var _templateObject = _taggedTemplateLiteral(['\n color: ', ';\n '], ['\n color: ', ';\n ']),
_templateObject2 = _taggedTemplateLiteral(['\n flex-grow: 0;\n flex-direction: column;\n width: auto;\n justify-content: center;\n padding: 0 ', ';\n '], ['\n flex-grow: 0;\n flex-direction: column;\n width: auto;\n justify-content: center;\n padding: 0 ', ';\n ']),
_templateObject3 = _taggedTemplateLiteral(['\n display: flex;\n '], ['\n display: flex;\n ']);
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 _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
var Container = __WEBPACK_IMPORTED_MODULE_6_styled_components__["a" /* default */].div.withConfig({
displayName: 'title__Container'
})(['font-size: ', ';line-height: 1.5;color: ', ';', ';', ';display: flex;flex-direction: row;justify-content: flex-start;flex-grow: 2;width: 100%;padding: ', ' ', ' 0 ', ';', ';', ';'], __WEBPACK_IMPORTED_MODULE_4_remcalc___default()(15), function (props) {
return props.theme.secondary;
}, __WEBPACK_IMPORTED_MODULE_2__typography__["a" /* default */].fontFamily, __WEBPACK_IMPORTED_MODULE_2__typography__["a" /* default */].semibold, __WEBPACK_IMPORTED_MODULE_4_remcalc___default()(12), __WEBPACK_IMPORTED_MODULE_4_remcalc___default()(18), __WEBPACK_IMPORTED_MODULE_4_remcalc___default()(18), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5_styled_is__["a" /* default */])('fromHeader')(_templateObject, function (props) {
return props.theme.white;
}), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5_styled_is__["a" /* default */])('collapsed')(_templateObject2, __WEBPACK_IMPORTED_MODULE_4_remcalc___default()(18)));
var Span = __WEBPACK_IMPORTED_MODULE_6_styled_components__["a" /* default */].span.withConfig({
displayName: 'title__Span'
})(['display: inline-block;flex-direction: column;justify-content: center;', ';'], __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5_styled_is__["a" /* default */])('collapsed')(_templateObject3));
var Title = function Title(_ref) {
var children = _ref.children,
rest = _objectWithoutProperties(_ref, ['children']);
var _children = __WEBPACK_IMPORTED_MODULE_1_lodash_isstring___default()(children) ? __WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement(
Span,
null,
children
) : children;
var render = function render(_ref2) {
var _ref2$collapsed = _ref2.collapsed,
collapsed = _ref2$collapsed === undefined ? false : _ref2$collapsed,
_ref2$fromHeader = _ref2.fromHeader,
fromHeader = _ref2$fromHeader === undefined ? false : _ref2$fromHeader;
return __WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement(
Container,
Object.assign({
collapsed: collapsed,
fromHeader: fromHeader,
name: 'card-title',
xs: collapsed ? 6 : 12
}, rest),
_children
);
};
return __WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement(
__WEBPACK_IMPORTED_MODULE_0_react_broadcast__["Subscriber"],
{ channel: 'card' },
render
);
};
Title.propTypes = {
children: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.node,
/**
* @ignore
*/
collapsed: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.bool,
/**
* @ignore
*/
fromHeader: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.bool
};
/* harmony default export */ __webpack_exports__["a"] = (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__baseline__["a" /* default */])(Title));
/***/ }),
/* 124 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_broadcast__ = __webpack_require__(14);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_broadcast___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react_broadcast__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_styled_components__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__baseline__ = __webpack_require__(4);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_remcalc__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_remcalc___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_remcalc__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_styled_is__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_react_styled_flexboxgrid__ = __webpack_require__(59);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_prop_types__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_prop_types__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_react__);
var _templateObject = _taggedTemplateLiteral(['\n flex: 1;\n margin: 0;\n height: auto;\n padding-top: 0;\n min-width: auto;\n\n ', ';\n\n ', ';\n\n ', ';\n'], ['\n flex: 1;\n margin: 0;\n height: auto;\n padding-top: 0;\n min-width: auto;\n\n ', ';\n\n ', ';\n\n ', ';\n']),
_templateObject2 = _taggedTemplateLiteral(['\n padding-top: ', ';\n '], ['\n padding-top: ', ';\n ']),
_templateObject3 = _taggedTemplateLiteral(['\n height: ', ';\n '], ['\n height: ', ';\n ']),
_templateObject4 = _taggedTemplateLiteral(['\n padding-top: 0;\n '], ['\n padding-top: 0;\n ']);
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 _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
var StyledView = __WEBPACK_IMPORTED_MODULE_5_react_styled_flexboxgrid__["Row"].extend(_templateObject, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4_styled_is__["a" /* default */])('headed')(_templateObject2, __WEBPACK_IMPORTED_MODULE_3_remcalc___default()(47)), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4_styled_is__["a" /* default */])('collapsed')(_templateObject3, __WEBPACK_IMPORTED_MODULE_3_remcalc___default()(47)), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4_styled_is__["a" /* default */])('fromHeader')(_templateObject4));
var View = function View(_ref) {
var children = _ref.children,
rest = _objectWithoutProperties(_ref, ['children']);
var render = function render(value) {
var newValue = Object.assign({}, value, rest);
var hide = newValue.headed && !newValue.fromHeader && newValue.collapsed;
return hide ? null : __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement(
StyledView,
Object.assign({ name: 'card-view' }, newValue),
children
);
};
return __WEBPACK_IMPORTED_MODULE_7_react___default.a.createElement(
__WEBPACK_IMPORTED_MODULE_0_react_broadcast__["Subscriber"],
{ channel: 'card' },
render
);
};
View.propTypes = {
children: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.node,
collapsed: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.bool,
fromHeader: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.bool,
headed: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.bool
};
/* harmony default export */ __webpack_exports__["a"] = (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__baseline__["a" /* default */])(View));
/***/ }),
/* 125 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* unused harmony export base */
/* unused harmony export fonts */
/* unused harmony export inactive */
/* unused harmony export notifications */
/* unused harmony export inputError */
/* unused harmony export inputWarning */
/* unused harmony export miniBackground */
/* unused harmony export seperator */
/* unused harmony export topologyBackground */
/*
* There should be no string value to keys outside the `base` object.
* If a new colors needs to be used, check it doesn't already exist, or
* anything that is similar, and if it doesn't, add a key-value and reference from
* there. Lets try and keep different color variations down ot a minimum.
*
---
Color Object example
const color_name = {
color_name: '#FFFFFF',
color_name_style1: '#FFF000',
color_name_style2: '#FFF333',
};
*/
var primary = {
primary: '#3B47CC',
primaryHover: '#1838C0',
primaryActive: '#12279F',
primaryDesaturated: '#3B4AAF',
primaryDesaturatedHover: '#34429D',
primaryDesaturatedActive: '#2D3884',
primaryDark: '#2D3884',
primaryDarkHover: '#34429D',
primaryDarkActive: '#2D3884',
primaryDarkBrand: '#1E313B'
};
var secondary = {
secondary: '#464646',
secondaryHover: '#3F3F3F',
secondaryActive: '#343434'
};
var white = {
white: '#FFFFFF',
whiteHover: '#F8F8F8',
whiteActive: '#E9E9E9'
};
/** ********************************** BASE *********************************** */
var base = Object.assign({}, primary, secondary, white, {
text: '#646464',
grey: '#D8D8D8',
disabled: '#FAFAFA',
background: '#FAFAFA',
green: '#00AF66',
greenDark: '#009858',
orange: '#E38200',
orangeDark: '#CB7400',
red: '#DA4B42',
redDark: '#CD251B'
});
/** ********************************** FONTS ********************************** */
var fonts = {
semibold: base.secondary,
regular: base.text,
abbrBorderColor: base.secondary,
textMuted: base.secondary
};
/** ******************************** INACTIVE ********************************* */
var inactive = {
default: base.disabled,
border: base.grey,
text: base.grey
};
/** ***************************** NOTIFICATIONS ******************************* */
var notifications = {
alert: base.red,
confirmation: base.green,
warning: base.orange
};
/** ********************************* FORMS *********************************** */
var inputError = base.red;
var inputWarning = base.orange;
/** ******************************** METRICS ********************************* */
var miniBackground = '#F3F4F9';
var seperator = '#D9DEF3';
/** ******************************** TOPOLOGY ********************************* */
var topologyBackground = base.secondaryActive;
/* harmony default export */ __webpack_exports__["a"] = (Object.assign({}, base, {
fonts: fonts,
inactive: inactive,
notifications: notifications,
inputError: inputError,
inputWarning: inputWarning,
miniBackground: miniBackground,
seperator: seperator,
topologyBackground: topologyBackground
}));
/***/ }),
/* 126 */
/***/ (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
*
*/
/*eslint-disable no-self-compare */
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;
/***/ }),
/* 127 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
exports.locationsAreEqual = exports.createLocation = undefined;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _resolvePathname = __webpack_require__(1013);
var _resolvePathname2 = _interopRequireDefault(_resolvePathname);
var _valueEqual = __webpack_require__(1028);
var _valueEqual2 = _interopRequireDefault(_valueEqual);
var _PathUtils = __webpack_require__(69);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var createLocation = exports.createLocation = function createLocation(path, state, key, currentLocation) {
var location = void 0;
if (typeof path === 'string') {
// Two-arg form: push(path, state)
location = (0, _PathUtils.parsePath)(path);
location.state = state;
} else {
// One-arg form: push(location)
location = _extends({}, path);
if (location.pathname === undefined) location.pathname = '';
if (location.search) {
if (location.search.charAt(0) !== '?') location.search = '?' + location.search;
} else {
location.search = '';
}
if (location.hash) {
if (location.hash.charAt(0) !== '#') location.hash = '#' + location.hash;
} else {
location.hash = '';
}
if (state !== undefined && location.state === undefined) location.state = state;
}
location.key = key;
if (currentLocation) {
// Resolve incomplete/relative pathname relative to current location.
if (!location.pathname) {
location.pathname = currentLocation.pathname;
} else if (location.pathname.charAt(0) !== '/') {
location.pathname = (0, _resolvePathname2.default)(location.pathname, currentLocation.pathname);
}
}
return location;
};
var locationsAreEqual = exports.locationsAreEqual = function locationsAreEqual(a, b) {
return a.pathname === b.pathname && a.search === b.search && a.hash === b.hash && a.key === b.key && (0, _valueEqual2.default)(a.state, b.state);
};
/***/ }),
/* 128 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
var _warning = __webpack_require__(22);
var _warning2 = _interopRequireDefault(_warning);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var createTransitionManager = function createTransitionManager() {
var prompt = null;
var setPrompt = function setPrompt(nextPrompt) {
(0, _warning2.default)(prompt == null, 'A history supports only one prompt at a time');
prompt = nextPrompt;
return function () {
if (prompt === nextPrompt) prompt = null;
};
};
var confirmTransitionTo = function confirmTransitionTo(location, action, getUserConfirmation, callback) {
// TODO: If another transition starts while we're still confirming
// the previous one, we may end up in a weird state. Figure out the
// best way to handle this.
if (prompt != null) {
var result = typeof prompt === 'function' ? prompt(location, action) : prompt;
if (typeof result === 'string') {
if (typeof getUserConfirmation === 'function') {
getUserConfirmation(result, callback);
} else {
(0, _warning2.default)(false, 'A history needs a getUserConfirmation function in order to use a prompt message');
callback(true);
}
} else {
// Return false from a transition hook to cancel the transition.
callback(result !== false);
}
} else {
callback(true);
}
};
var listeners = [];
var appendListener = function appendListener(fn) {
var isActive = true;
var listener = function listener() {
if (isActive) fn.apply(undefined, arguments);
};
listeners.push(listener);
return function () {
isActive = false;
listeners = listeners.filter(function (item) {
return item !== listener;
});
};
};
var notifyListeners = function notifyListeners() {
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
listeners.forEach(function (listener) {
return listener.apply(undefined, args);
});
};
return {
setPrompt: setPrompt,
confirmTransitionTo: confirmTransitionTo,
appendListener: appendListener,
notifyListeners: notifyListeners
};
};
exports.default = createTransitionManager;
/***/ }),
/* 129 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* Copyright 2015, Yahoo! Inc.
* Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
*/
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;
};
/***/ }),
/* 130 */
/***/ (function(module, exports) {
module.exports = isPromise;
function isPromise(obj) {
return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
}
/***/ }),
/* 131 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _SheetsRegistry = __webpack_require__(219);
var _SheetsRegistry2 = _interopRequireDefault(_SheetsRegistry);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
/**
* This is a global sheets registry. Only DomRenderer will add sheets to it.
* On the server one should use an own SheetsRegistry instance and add the
* sheets to it, because you need to make sure to create a new registry for
* each request in order to not leak sheets across requests.
*/
exports['default'] = new _SheetsRegistry2['default']();
/***/ }),
/* 132 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = toCss;
var _toCssValue = __webpack_require__(222);
var _toCssValue2 = _interopRequireDefault(_toCssValue);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
/**
* Indent a string.
* http://jsperf.com/array-join-vs-for
*/
function indentStr(str, indent) {
var result = '';
for (var index = 0; index < indent; index++) {
result += ' ';
}return result + str;
}
/**
* Converts a Rule to CSS string.
*/
function toCss(selector, style) {
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
var _options$indent = options.indent,
indent = _options$indent === undefined ? 0 : _options$indent;
var fallbacks = style.fallbacks;
var result = '';
indent++;
// Apply fallbacks first.
if (fallbacks) {
// Array syntax {fallbacks: [{prop: value}]}
if (Array.isArray(fallbacks)) {
for (var index = 0; index < fallbacks.length; index++) {
var fallback = fallbacks[index];
for (var prop in fallback) {
var value = fallback[prop];
if (value != null) {
result += '\n' + indentStr(prop + ': ' + (0, _toCssValue2['default'])(value) + ';', indent);
}
}
}
}
// Object syntax {fallbacks: {prop: value}}
else {
for (var _prop in fallbacks) {
var _value = fallbacks[_prop];
if (_value != null) {
result += '\n' + indentStr(_prop + ': ' + (0, _toCssValue2['default'])(_value) + ';', indent);
}
}
}
}
var hasFunctionValue = false;
for (var _prop2 in style) {
var _value2 = style[_prop2];
if (typeof _value2 === 'function') {
_value2 = style['$' + _prop2];
hasFunctionValue = true;
}
if (_value2 != null && _prop2 !== 'fallbacks') {
result += '\n' + indentStr(_prop2 + ': ' + (0, _toCssValue2['default'])(_value2) + ';', indent);
}
}
if (!result && !hasFunctionValue) return result;
indent--;
result = indentStr(selector + ' {' + result + '\n', indent) + indentStr('}', indent);
return result;
}
/***/ }),
/* 133 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getNative_js__ = __webpack_require__(41);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__root_js__ = __webpack_require__(27);
/* Built-in method references that are verified to be native. */
var Map = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__getNative_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__root_js__["a" /* default */], 'Map');
/* harmony default export */ __webpack_exports__["a"] = (Map);
/***/ }),
/* 134 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__mapCacheClear_js__ = __webpack_require__(559);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__mapCacheDelete_js__ = __webpack_require__(560);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__mapCacheGet_js__ = __webpack_require__(561);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__mapCacheHas_js__ = __webpack_require__(562);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__mapCacheSet_js__ = __webpack_require__(563);
/**
* 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 = __WEBPACK_IMPORTED_MODULE_0__mapCacheClear_js__["a" /* default */];
MapCache.prototype['delete'] = __WEBPACK_IMPORTED_MODULE_1__mapCacheDelete_js__["a" /* default */];
MapCache.prototype.get = __WEBPACK_IMPORTED_MODULE_2__mapCacheGet_js__["a" /* default */];
MapCache.prototype.has = __WEBPACK_IMPORTED_MODULE_3__mapCacheHas_js__["a" /* default */];
MapCache.prototype.set = __WEBPACK_IMPORTED_MODULE_4__mapCacheSet_js__["a" /* default */];
/* harmony default export */ __webpack_exports__["a"] = (MapCache);
/***/ }),
/* 135 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__ListCache_js__ = __webpack_require__(86);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__stackClear_js__ = __webpack_require__(576);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__stackDelete_js__ = __webpack_require__(577);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__stackGet_js__ = __webpack_require__(578);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__stackHas_js__ = __webpack_require__(579);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__stackSet_js__ = __webpack_require__(580);
/**
* 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 __WEBPACK_IMPORTED_MODULE_0__ListCache_js__["a" /* default */](entries);
this.size = data.size;
}
// Add methods to `Stack`.
Stack.prototype.clear = __WEBPACK_IMPORTED_MODULE_1__stackClear_js__["a" /* default */];
Stack.prototype['delete'] = __WEBPACK_IMPORTED_MODULE_2__stackDelete_js__["a" /* default */];
Stack.prototype.get = __WEBPACK_IMPORTED_MODULE_3__stackGet_js__["a" /* default */];
Stack.prototype.has = __WEBPACK_IMPORTED_MODULE_4__stackHas_js__["a" /* default */];
Stack.prototype.set = __WEBPACK_IMPORTED_MODULE_5__stackSet_js__["a" /* default */];
/* harmony default export */ __webpack_exports__["a"] = (Stack);
/***/ }),
/* 136 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__baseIsEqualDeep_js__ = __webpack_require__(510);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isObjectLike_js__ = __webpack_require__(42);
/**
* 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 || (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__isObjectLike_js__["a" /* default */])(value) && !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__isObjectLike_js__["a" /* default */])(other))) {
return value !== value && other !== other;
}
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__baseIsEqualDeep_js__["a" /* default */])(value, other, bitmask, customizer, baseIsEqual, stack);
}
/* harmony default export */ __webpack_exports__["a"] = (baseIsEqual);
/***/ }),
/* 137 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/** 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);
}
/* harmony default export */ __webpack_exports__["a"] = (isIndex);
/***/ }),
/* 138 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArray_js__ = __webpack_require__(28);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isSymbol_js__ = __webpack_require__(94);
/** 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 (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__isArray_js__["a" /* default */])(value)) {
return false;
}
var type = typeof value;
if (type == 'number' || type == 'symbol' || type == 'boolean' ||
value == null || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__isSymbol_js__["a" /* default */])(value)) {
return true;
}
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
(object != null && value in Object(object));
}
/* harmony default export */ __webpack_exports__["a"] = (isKey);
/***/ }),
/* 139 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/** 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;
}
/* harmony default export */ __webpack_exports__["a"] = (isPrototype);
/***/ }),
/* 140 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/**
* 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;
}
/* harmony default export */ __webpack_exports__["a"] = (identity);
/***/ }),
/* 141 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__baseIsArguments_js__ = __webpack_require__(509);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isObjectLike_js__ = __webpack_require__(42);
/** 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 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__baseIsArguments_js__["a" /* default */])(function() { return arguments; }()) ? __WEBPACK_IMPORTED_MODULE_0__baseIsArguments_js__["a" /* default */] : function(value) {
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__isObjectLike_js__["a" /* default */])(value) && hasOwnProperty.call(value, 'callee') &&
!propertyIsEnumerable.call(value, 'callee');
};
/* harmony default export */ __webpack_exports__["a"] = (isArguments);
/***/ }),
/* 142 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(module) {/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__root_js__ = __webpack_require__(27);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__stubFalse_js__ = __webpack_require__(589);
/** 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 ? __WEBPACK_IMPORTED_MODULE_0__root_js__["a" /* default */].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 || __WEBPACK_IMPORTED_MODULE_1__stubFalse_js__["a" /* default */];
/* harmony default export */ __webpack_exports__["a"] = (isBuffer);
/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(192)(module)))
/***/ }),
/* 143 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__baseGetTag_js__ = __webpack_require__(54);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isObject_js__ = __webpack_require__(34);
/** `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 (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__isObject_js__["a" /* default */])(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 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__baseGetTag_js__["a" /* default */])(value);
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
}
/* harmony default export */ __webpack_exports__["a"] = (isFunction);
/***/ }),
/* 144 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/** 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;
}
/* harmony default export */ __webpack_exports__["a"] = (isLength);
/***/ }),
/* 145 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__baseIsTypedArray_js__ = __webpack_require__(513);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__baseUnary_js__ = __webpack_require__(527);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__nodeUtil_js__ = __webpack_require__(568);
/* Node.js helper references. */
var nodeIsTypedArray = __WEBPACK_IMPORTED_MODULE_2__nodeUtil_js__["a" /* default */] && __WEBPACK_IMPORTED_MODULE_2__nodeUtil_js__["a" /* default */].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 ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__baseUnary_js__["a" /* default */])(nodeIsTypedArray) : __WEBPACK_IMPORTED_MODULE_0__baseIsTypedArray_js__["a" /* default */];
/* harmony default export */ __webpack_exports__["a"] = (isTypedArray);
/***/ }),
/* 146 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__arrayLikeKeys_js__ = __webpack_require__(224);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__baseKeys_js__ = __webpack_require__(515);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isArrayLike_js__ = __webpack_require__(92);
/**
* 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 __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__isArrayLike_js__["a" /* default */])(object) ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__arrayLikeKeys_js__["a" /* default */])(object) : __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__baseKeys_js__["a" /* default */])(object);
}
/* harmony default export */ __webpack_exports__["a"] = (keys);
/***/ }),
/* 147 */
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(44),
root = __webpack_require__(18);
/* Built-in method references that are verified to be native. */
var Map = getNative(root, 'Map');
module.exports = Map;
/***/ }),
/* 148 */
/***/ (function(module, exports, __webpack_require__) {
var mapCacheClear = __webpack_require__(660),
mapCacheDelete = __webpack_require__(661),
mapCacheGet = __webpack_require__(662),
mapCacheHas = __webpack_require__(663),
mapCacheSet = __webpack_require__(664);
/**
* 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;
/***/ }),
/* 149 */
/***/ (function(module, exports, __webpack_require__) {
var ListCache = __webpack_require__(96),
stackClear = __webpack_require__(677),
stackDelete = __webpack_require__(678),
stackGet = __webpack_require__(679),
stackHas = __webpack_require__(680),
stackSet = __webpack_require__(681);
/**
* 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;
/***/ }),
/* 150 */
/***/ (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;
/***/ }),
/* 151 */
/***/ (function(module, exports, __webpack_require__) {
var isArray = __webpack_require__(29),
isSymbol = __webpack_require__(103);
/** 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;
/***/ }),
/* 152 */
/***/ (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;
/***/ }),
/* 153 */
/***/ (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;
/***/ }),
/* 154 */
/***/ (function(module, exports, __webpack_require__) {
var baseIsArguments = __webpack_require__(608),
isObjectLike = __webpack_require__(35);
/** 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;
/***/ }),
/* 155 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__(18),
stubFalse = __webpack_require__(697);
/** 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__(111)(module)))
/***/ }),
/* 156 */
/***/ (function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(43),
isObject = __webpack_require__(30);
/** `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;
/***/ }),
/* 157 */
/***/ (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;
/***/ }),
/* 158 */
/***/ (function(module, exports, __webpack_require__) {
var baseIsTypedArray = __webpack_require__(612),
baseUnary = __webpack_require__(626),
nodeUtil = __webpack_require__(669);
/* 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;
/***/ }),
/* 159 */
/***/ (function(module, exports, __webpack_require__) {
var arrayLikeKeys = __webpack_require__(245),
baseKeys = __webpack_require__(613),
isArrayLike = __webpack_require__(55);
/**
* 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;
/***/ }),
/* 160 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module parse-entities
* @fileoverview Parse HTML character references: fast, spec-compliant,
* positional information.
*/
/* Dependencies. */
var has = __webpack_require__(68);
var characterEntities = __webpack_require__(420);
var legacy = __webpack_require__(419);
var invalid = __webpack_require__(421);
var decimal = __webpack_require__(83);
var hexadecimal = __webpack_require__(466);
var alphanumerical = __webpack_require__(464);
/* Expose. */
module.exports = wrapper;
/* Methods. */
var fromCharCode = String.fromCharCode;
var noop = Function.prototype;
/* Characters. */
var REPLACEMENT = '\uFFFD';
var FORM_FEED = '\f';
var AMPERSAND = '&';
var OCTOTHORP = '#';
var SEMICOLON = ';';
var NEWLINE = '\n';
var X_LOWER = 'x';
var X_UPPER = 'X';
var SPACE = ' ';
var LESS_THAN = '<';
var EQUAL = '=';
var EMPTY = '';
var TAB = '\t';
/* Default settings. */
var defaults = {
warning: null,
reference: null,
text: null,
warningContext: null,
referenceContext: null,
textContext: null,
position: {},
additional: null,
attribute: false,
nonTerminated: true
};
/* Reference types. */
var NAMED = 'named';
var HEXADECIMAL = 'hexadecimal';
var DECIMAL = 'decimal';
/* Map of bases. */
var BASE = {};
BASE[HEXADECIMAL] = 16;
BASE[DECIMAL] = 10;
/* Map of types to tests. Each type of character reference
* accepts different characters. This test is used to
* detect whether a reference has ended (as the semicolon
* is not strictly needed). */
var TESTS = {};
TESTS[NAMED] = alphanumerical;
TESTS[DECIMAL] = decimal;
TESTS[HEXADECIMAL] = hexadecimal;
/* Warning messages. */
var NAMED_NOT_TERMINATED = 1;
var NUMERIC_NOT_TERMINATED = 2;
var NAMED_EMPTY = 3;
var NUMERIC_EMPTY = 4;
var NAMED_UNKNOWN = 5;
var NUMERIC_DISALLOWED = 6;
var NUMERIC_PROHIBITED = 7;
var NUMERIC_REFERENCE = 'Numeric character references';
var NAMED_REFERENCE = 'Named character references';
var TERMINATED = ' must be terminated by a semicolon';
var VOID = ' cannot be empty';
var MESSAGES = {};
MESSAGES[NAMED_NOT_TERMINATED] = NAMED_REFERENCE + TERMINATED;
MESSAGES[NUMERIC_NOT_TERMINATED] = NUMERIC_REFERENCE + TERMINATED;
MESSAGES[NAMED_EMPTY] = NAMED_REFERENCE + VOID;
MESSAGES[NUMERIC_EMPTY] = NUMERIC_REFERENCE + VOID;
MESSAGES[NAMED_UNKNOWN] = NAMED_REFERENCE + ' must be known';
MESSAGES[NUMERIC_DISALLOWED] = NUMERIC_REFERENCE + ' cannot be disallowed';
MESSAGES[NUMERIC_PROHIBITED] = NUMERIC_REFERENCE + ' cannot be outside the ' +
'permissible Unicode range';
/**
* Wrap to ensure clean parameters are given to `parse`.
*
* @param {string} value - Value with entities.
* @param {Object?} [options] - Configuration.
*/
function wrapper(value, options) {
var settings = {};
var key;
if (!options) {
options = {};
}
for (key in defaults) {
settings[key] = options[key] == null ? defaults[key] : options[key];
}
if (settings.position.indent || settings.position.start) {
settings.indent = settings.position.indent || [];
settings.position = settings.position.start;
}
return parse(value, settings);
}
/**
* Parse entities.
*
* @param {string} value - Value to tokenise.
* @param {Object?} [settings] - Configuration.
*/
function parse(value, settings) {
var additional = settings.additional;
var nonTerminated = settings.nonTerminated;
var handleText = settings.text;
var handleReference = settings.reference;
var handleWarning = settings.warning;
var textContext = settings.textContext;
var referenceContext = settings.referenceContext;
var warningContext = settings.warningContext;
var pos = settings.position;
var indent = settings.indent || [];
var length = value.length;
var index = 0;
var lines = -1;
var column = pos.column || 1;
var line = pos.line || 1;
var queue = EMPTY;
var result = [];
var entityCharacters;
var terminated;
var characters;
var character;
var reference;
var following;
var warning;
var reason;
var output;
var entity;
var begin;
var start;
var type;
var test;
var prev;
var next;
var diff;
var end;
/* Cache the current point. */
prev = now();
/* Wrap `handleWarning`. */
warning = handleWarning ? parseError : noop;
/* Ensure the algorithm walks over the first character
* and the end (inclusive). */
index--;
length++;
while (++index < length) {
/* If the previous character was a newline. */
if (character === NEWLINE) {
column = indent[lines] || 1;
}
character = at(index);
/* Handle anything other than an ampersand,
* including newlines and EOF. */
if (character !== AMPERSAND) {
if (character === NEWLINE) {
line++;
lines++;
column = 0;
}
if (character) {
queue += character;
column++;
} else {
flush();
}
} else {
following = at(index + 1);
/* The behaviour depends on the identity of the next
* character. */
if (
following === TAB ||
following === NEWLINE ||
following === FORM_FEED ||
following === SPACE ||
following === LESS_THAN ||
following === AMPERSAND ||
following === EMPTY ||
(additional && following === additional)
) {
/* Not a character reference. No characters
* are consumed, and nothing is returned.
* This is not an error, either. */
queue += character;
column++;
continue;
}
start = begin = end = index + 1;
/* Numerical entity. */
if (following !== OCTOTHORP) {
type = NAMED;
} else {
end = ++begin;
/* The behaviour further depends on the
* character after the U+0023 NUMBER SIGN. */
following = at(end);
if (following === X_LOWER || following === X_UPPER) {
/* ASCII hex digits. */
type = HEXADECIMAL;
end = ++begin;
} else {
/* ASCII digits. */
type = DECIMAL;
}
}
entityCharacters = entity = characters = EMPTY;
test = TESTS[type];
end--;
while (++end < length) {
following = at(end);
if (!test(following)) {
break;
}
characters += following;
/* Check if we can match a legacy named
* reference. If so, we cache that as the
* last viable named reference. This
* ensures we do not need to walk backwards
* later. */
if (type === NAMED && has(legacy, characters)) {
entityCharacters = characters;
entity = legacy[characters];
}
}
terminated = at(end) === SEMICOLON;
if (terminated) {
end++;
if (type === NAMED && has(characterEntities, characters)) {
entityCharacters = characters;
entity = characterEntities[characters];
}
}
diff = 1 + end - start;
if (!terminated && !nonTerminated) {
/* Empty. */
} else if (!characters) {
/* An empty (possible) entity is valid, unless
* its numeric (thus an ampersand followed by
* an octothorp). */
if (type !== NAMED) {
warning(NUMERIC_EMPTY, diff);
}
} else if (type === NAMED) {
/* An ampersand followed by anything
* unknown, and not terminated, is invalid. */
if (terminated && !entity) {
warning(NAMED_UNKNOWN, 1);
} else {
/* If theres something after an entity
* name which is not known, cap the
* reference. */
if (entityCharacters !== characters) {
end = begin + entityCharacters.length;
diff = 1 + end - begin;
terminated = false;
}
/* If the reference is not terminated,
* warn. */
if (!terminated) {
reason = entityCharacters ?
NAMED_NOT_TERMINATED :
NAMED_EMPTY;
if (!settings.attribute) {
warning(reason, diff);
} else {
following = at(end);
if (following === EQUAL) {
warning(reason, diff);
entity = null;
} else if (alphanumerical(following)) {
entity = null;
} else {
warning(reason, diff);
}
}
}
}
reference = entity;
} else {
if (!terminated) {
/* All non-terminated numeric entities are
* not rendered, and trigger a warning. */
warning(NUMERIC_NOT_TERMINATED, diff);
}
/* When terminated and number, parse as
* either hexadecimal or decimal. */
reference = parseInt(characters, BASE[type]);
/* Trigger a warning when the parsed number
* is prohibited, and replace with
* replacement character. */
if (isProhibited(reference)) {
warning(NUMERIC_PROHIBITED, diff);
reference = REPLACEMENT;
} else if (reference in invalid) {
/* Trigger a warning when the parsed number
* is disallowed, and replace by an
* alternative. */
warning(NUMERIC_DISALLOWED, diff);
reference = invalid[reference];
} else {
/* Parse the number. */
output = EMPTY;
/* Trigger a warning when the parsed
* number should not be used. */
if (isWarning(reference)) {
warning(NUMERIC_DISALLOWED, diff);
}
/* Stringify the number. */
if (reference > 0xFFFF) {
reference -= 0x10000;
output += fromCharCode((reference >>> (10 & 0x3FF)) | 0xD800);
reference = 0xDC00 | (reference & 0x3FF);
}
reference = output + fromCharCode(reference);
}
}
/* If we could not find a reference, queue the
* checked characters (as normal characters),
* and move the pointer to their end. This is
* possible because we can be certain neither
* newlines nor ampersands are included. */
if (!reference) {
characters = value.slice(start - 1, end);
queue += characters;
column += characters.length;
index = end - 1;
} else {
/* Found it! First eat the queued
* characters as normal text, then eat
* an entity. */
flush();
prev = now();
index = end - 1;
column += end - start + 1;
result.push(reference);
next = now();
next.offset++;
if (handleReference) {
handleReference.call(referenceContext, reference, {
start: prev,
end: next
}, value.slice(start - 1, end));
}
prev = next;
}
}
}
/* Return the reduced nodes, and any possible warnings. */
return result.join(EMPTY);
/**
* Get current position.
*
* @return {Object} - Positional information of a
* single point.
*/
function now() {
return {
line: line,
column: column,
offset: index + (pos.offset || 0)
};
}
/**
* “Throw” a parse-error: a warning.
*
* @param {number} code - Identifier of reason for
* failing.
* @param {number} offset - Offset in characters from
* the current position point at which the
* parse-error ocurred, cannot point past newlines.
*/
function parseError(code, offset) {
var position = now();
position.column += offset;
position.offset += offset;
handleWarning.call(warningContext, MESSAGES[code], position, code);
}
/**
* Get character at position.
*
* @param {number} position - Indice of character in `value`.
* @return {string} - Character at `position` in
* `value`.
*/
function at(position) {
return value.charAt(position);
}
/**
* Flush `queue` (normal text). Macro invoked before
* each entity and at the end of `value`.
*
* Does nothing when `queue` is empty.
*/
function flush() {
if (queue) {
result.push(queue);
if (handleText) {
handleText.call(textContext, queue, {
start: prev,
end: now()
});
}
queue = EMPTY;
}
}
}
/**
* Check whether `character` is outside the permissible
* unicode range.
*
* @param {number} code - Value.
* @return {boolean} - Whether `character` is an
* outside the permissible unicode range.
*/
function isProhibited(code) {
return (code >= 0xD800 && code <= 0xDFFF) || (code > 0x10FFFF);
}
/**
* Check whether `character` is disallowed.
*
* @param {number} code - Value.
* @return {boolean} - Whether `character` is disallowed.
*/
function isWarning(code) {
if (
(code >= 0x0001 && code <= 0x0008) ||
code === 0x000B ||
(code >= 0x000D && code <= 0x001F) ||
(code >= 0x007F && code <= 0x009F) ||
(code >= 0xFDD0 && code <= 0xFDEF) ||
(code & 0xFFFF) === 0xFFFF ||
(code & 0xFFFF) === 0xFFFE
) {
return true;
}
return false;
}
/***/ }),
/* 161 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var DOMLazyTree = __webpack_require__(56);
var Danger = __webpack_require__(721);
var ReactDOMComponentTree = __webpack_require__(11);
var ReactInstrumentation = __webpack_require__(25);
var createMicrosoftUnsafeLocalFunction = __webpack_require__(170);
var setInnerHTML = __webpack_require__(108);
var setTextContent = __webpack_require__(287);
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 (false) {
ReactInstrumentation.debugTool.onHostOperation({
instanceID: ReactDOMComponentTree.getInstanceFromNode(openingComment)._debugID,
type: 'replace text',
payload: stringText
});
}
}
var dangerouslyReplaceNodeWithMarkup = Danger.dangerouslyReplaceNodeWithMarkup;
if (false) {
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 (false) {
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 (false) {
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 (false) {
ReactInstrumentation.debugTool.onHostOperation({
instanceID: parentNodeDebugID,
type: 'move child',
payload: { fromIndex: update.fromIndex, toIndex: update.toIndex }
});
}
break;
case 'SET_MARKUP':
setInnerHTML(parentNode, update.content);
if (false) {
ReactInstrumentation.debugTool.onHostOperation({
instanceID: parentNodeDebugID,
type: 'replace children',
payload: update.content.toString()
});
}
break;
case 'TEXT_CONTENT':
setTextContent(parentNode, update.content);
if (false) {
ReactInstrumentation.debugTool.onHostOperation({
instanceID: parentNodeDebugID,
type: 'replace text',
payload: update.content.toString()
});
}
break;
case 'REMOVE_NODE':
removeChild(parentNode, update.fromNode);
if (false) {
ReactInstrumentation.debugTool.onHostOperation({
instanceID: parentNodeDebugID,
type: 'remove child',
payload: { fromIndex: update.fromIndex }
});
}
break;
}
}
}
};
module.exports = DOMChildrenOperations;
/***/ }),
/* 162 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
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;
/***/ }),
/* 163 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*
*/
var _prodInvariant = __webpack_require__(7);
var invariant = __webpack_require__(2);
/**
* 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) ? false ? 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 ? false ? 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) ? false ? 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) ? false ? 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] ? false ? 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 (false) {
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: false ? {} : 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 ? false ? 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] ? false ? 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 (false) {
var possibleRegistrationNames = EventPluginRegistry.possibleRegistrationNames;
for (var lowerCasedName in possibleRegistrationNames) {
if (possibleRegistrationNames.hasOwnProperty(lowerCasedName)) {
delete possibleRegistrationNames[lowerCasedName];
}
}
}
}
};
module.exports = EventPluginRegistry;
/***/ }),
/* 164 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var _prodInvariant = __webpack_require__(7);
var ReactErrorUtils = __webpack_require__(168);
var invariant = __webpack_require__(2);
var warning = __webpack_require__(5);
/**
* 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 (false) {
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 (false) {
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 (false) {
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 (false) {
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 (false) {
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 (false) {
validateEventDispatches(event);
}
var dispatchListener = event._dispatchListeners;
var dispatchInstance = event._dispatchInstances;
!!Array.isArray(dispatchListener) ? false ? 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;
/***/ }),
/* 165 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*
*/
/**
* 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;
/***/ }),
/* 166 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var _prodInvariant = __webpack_require__(7);
var ReactPropTypesSecret = __webpack_require__(750);
var propTypesFactory = __webpack_require__(267);
var React = __webpack_require__(60);
var PropTypes = propTypesFactory(React.isValidElement);
var invariant = __webpack_require__(2);
var warning = __webpack_require__(5);
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) ? false ? 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) ? false ? 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) ? false ? 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: 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);
false ? 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;
/***/ }),
/* 167 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*
*/
var _prodInvariant = __webpack_require__(7);
var invariant = __webpack_require__(2);
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 ? false ? 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;
/***/ }),
/* 168 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*
*/
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 (false) {
/**
* 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');
evt.initEvent(evtType, false, false);
fakeNode.dispatchEvent(evt);
fakeNode.removeEventListener(evtType, boundFunc, false);
};
}
}
module.exports = ReactErrorUtils;
/***/ }),
/* 169 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var _prodInvariant = __webpack_require__(7);
var ReactCurrentOwner = __webpack_require__(33);
var ReactInstanceMap = __webpack_require__(75);
var ReactInstrumentation = __webpack_require__(25);
var ReactUpdates = __webpack_require__(31);
var invariant = __webpack_require__(2);
var warning = __webpack_require__(5);
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 (false) {
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 (false) {
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 (false) {
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, callback) {
var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'replaceState');
if (!internalInstance) {
return;
}
internalInstance._pendingStateQueue = [completeState];
internalInstance._pendingReplaceState = true;
// Future-proof 15.5
if (callback !== undefined && callback !== null) {
ReactUpdateQueue.validateCallback(callback, 'replaceState');
if (internalInstance._pendingCallbacks) {
internalInstance._pendingCallbacks.push(callback);
} else {
internalInstance._pendingCallbacks = [callback];
}
}
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 (false) {
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') ? false ? 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;
/***/ }),
/* 170 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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 */
/**
* 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;
/***/ }),
/* 171 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
/**
* `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;
/***/ }),
/* 172 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
/**
* 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;
/***/ }),
/* 173 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
/**
* 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;
/***/ }),
/* 174 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var ExecutionEnvironment = __webpack_require__(15);
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;
/***/ }),
/* 175 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
/**
* 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;
/***/ }),
/* 176 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var _assign = __webpack_require__(9);
var emptyFunction = __webpack_require__(17);
var warning = __webpack_require__(5);
var validateDOMNesting = emptyFunction;
if (false) {
// 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;
/***/ }),
/* 177 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = 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 */
}
/***/ }),
/* 178 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_warning__ = __webpack_require__(22);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_warning___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_warning__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_invariant__ = __webpack_require__(23);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_invariant___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_invariant__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_prop_types__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_prop_types__);
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
/**
* The public API for putting history on context.
*/
var Router = function (_React$Component) {
_inherits(Router, _React$Component);
function Router() {
var _temp, _this, _ret;
_classCallCheck(this, Router);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = {
match: _this.computeMatch(_this.props.history.location.pathname)
}, _temp), _possibleConstructorReturn(_this, _ret);
}
Router.prototype.getChildContext = function getChildContext() {
return {
router: _extends({}, this.context.router, {
history: this.props.history,
route: {
location: this.props.history.location,
match: this.state.match
}
})
};
};
Router.prototype.computeMatch = function computeMatch(pathname) {
return {
path: '/',
url: '/',
params: {},
isExact: pathname === '/'
};
};
Router.prototype.componentWillMount = function componentWillMount() {
var _this2 = this;
var _props = this.props,
children = _props.children,
history = _props.history;
__WEBPACK_IMPORTED_MODULE_1_invariant___default()(children == null || __WEBPACK_IMPORTED_MODULE_2_react___default.a.Children.count(children) === 1, 'A <Router> may have only one child element');
// Do this here so we can setState when a <Redirect> changes the
// location in componentWillMount. This happens e.g. when doing
// server rendering using a <StaticRouter>.
this.unlisten = history.listen(function () {
_this2.setState({
match: _this2.computeMatch(history.location.pathname)
});
});
};
Router.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
__WEBPACK_IMPORTED_MODULE_0_warning___default()(this.props.history === nextProps.history, 'You cannot change <Router history>');
};
Router.prototype.componentWillUnmount = function componentWillUnmount() {
this.unlisten();
};
Router.prototype.render = function render() {
var children = this.props.children;
return children ? __WEBPACK_IMPORTED_MODULE_2_react___default.a.Children.only(children) : null;
};
return Router;
}(__WEBPACK_IMPORTED_MODULE_2_react___default.a.Component);
Router.propTypes = {
history: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object.isRequired,
children: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.node
};
Router.contextTypes = {
router: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object
};
Router.childContextTypes = {
router: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object.isRequired
};
/* harmony default export */ __webpack_exports__["a"] = (Router);
/***/ }),
/* 179 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_path_to_regexp__ = __webpack_require__(709);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_path_to_regexp___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_path_to_regexp__);
var patternCache = {};
var cacheLimit = 10000;
var cacheCount = 0;
var compilePath = function compilePath(pattern, options) {
var cacheKey = '' + options.end + options.strict;
var cache = patternCache[cacheKey] || (patternCache[cacheKey] = {});
if (cache[pattern]) return cache[pattern];
var keys = [];
var re = __WEBPACK_IMPORTED_MODULE_0_path_to_regexp___default()(pattern, keys, options);
var compiledPattern = { re: re, keys: keys };
if (cacheCount < cacheLimit) {
cache[pattern] = compiledPattern;
cacheCount++;
}
return compiledPattern;
};
/**
* Public API for matching a URL pathname to a path pattern.
*/
var matchPath = function matchPath(pathname) {
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
if (typeof options === 'string') options = { path: options };
var _options = options,
_options$path = _options.path,
path = _options$path === undefined ? '/' : _options$path,
_options$exact = _options.exact,
exact = _options$exact === undefined ? false : _options$exact,
_options$strict = _options.strict,
strict = _options$strict === undefined ? false : _options$strict;
var _compilePath = compilePath(path, { end: exact, strict: strict }),
re = _compilePath.re,
keys = _compilePath.keys;
var match = re.exec(pathname);
if (!match) return null;
var url = match[0],
values = match.slice(1);
var isExact = pathname === url;
if (exact && !isExact) return null;
return {
path: path, // the path pattern used to match
url: path === '/' && url === '' ? '/' : url, // the matched portion of the URL
isExact: isExact, // whether or not we matched exactly
params: keys.reduce(function (memo, key, index) {
memo[key.name] = values[index];
return memo;
}, {})
};
};
/* harmony default export */ __webpack_exports__["a"] = (matchPath);
/***/ }),
/* 180 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _CodeRenderer = __webpack_require__(808);
Object.defineProperty(exports, 'default', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_CodeRenderer).default;
}
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/***/ }),
/* 181 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _JsDoc = __webpack_require__(820);
Object.defineProperty(exports, 'default', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_JsDoc).default;
}
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/***/ }),
/* 182 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _NameRenderer = __webpack_require__(827);
Object.defineProperty(exports, 'default', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_NameRenderer).default;
}
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/***/ }),
/* 183 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var _prodInvariant = __webpack_require__(62);
var ReactNoopUpdateQueue = __webpack_require__(184);
var canDefineProperty = __webpack_require__(308);
var emptyObject = __webpack_require__(67);
var invariant = __webpack_require__(2);
var warning = __webpack_require__(5);
/**
* 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) ? false ? 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 (false) {
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;
/***/ }),
/* 184 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var warning = __webpack_require__(5);
function warnNoop(publicInstance, callerName) {
if (false) {
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;
/***/ }),
/* 185 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "prefix", function() { return prefix; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ARRAY_INSERT", function() { return ARRAY_INSERT; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ARRAY_MOVE", function() { return ARRAY_MOVE; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ARRAY_POP", function() { return ARRAY_POP; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ARRAY_PUSH", function() { return ARRAY_PUSH; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ARRAY_REMOVE", function() { return ARRAY_REMOVE; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ARRAY_REMOVE_ALL", function() { return ARRAY_REMOVE_ALL; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ARRAY_SHIFT", function() { return ARRAY_SHIFT; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ARRAY_SPLICE", function() { return ARRAY_SPLICE; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ARRAY_UNSHIFT", function() { return ARRAY_UNSHIFT; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ARRAY_SWAP", function() { return ARRAY_SWAP; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AUTOFILL", function() { return AUTOFILL; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BLUR", function() { return BLUR; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CHANGE", function() { return CHANGE; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CLEAR_SUBMIT", function() { return CLEAR_SUBMIT; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CLEAR_SUBMIT_ERRORS", function() { return CLEAR_SUBMIT_ERRORS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CLEAR_ASYNC_ERROR", function() { return CLEAR_ASYNC_ERROR; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DESTROY", function() { return DESTROY; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FOCUS", function() { return FOCUS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "INITIALIZE", function() { return INITIALIZE; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "REGISTER_FIELD", function() { return REGISTER_FIELD; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RESET", function() { return RESET; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SET_SUBMIT_FAILED", function() { return SET_SUBMIT_FAILED; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SET_SUBMIT_SUCCEEDED", function() { return SET_SUBMIT_SUCCEEDED; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "START_ASYNC_VALIDATION", function() { return START_ASYNC_VALIDATION; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "START_SUBMIT", function() { return START_SUBMIT; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "STOP_ASYNC_VALIDATION", function() { return STOP_ASYNC_VALIDATION; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "STOP_SUBMIT", function() { return STOP_SUBMIT; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SUBMIT", function() { return SUBMIT; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TOUCH", function() { return TOUCH; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UNREGISTER_FIELD", function() { return UNREGISTER_FIELD; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UNTOUCH", function() { return UNTOUCH; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UPDATE_SYNC_ERRORS", function() { return UPDATE_SYNC_ERRORS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UPDATE_SYNC_WARNINGS", function() { return UPDATE_SYNC_WARNINGS; });
var prefix = '@@redux-form/';
var ARRAY_INSERT = prefix + 'ARRAY_INSERT';
var ARRAY_MOVE = prefix + 'ARRAY_MOVE';
var ARRAY_POP = prefix + 'ARRAY_POP';
var ARRAY_PUSH = prefix + 'ARRAY_PUSH';
var ARRAY_REMOVE = prefix + 'ARRAY_REMOVE';
var ARRAY_REMOVE_ALL = prefix + 'ARRAY_REMOVE_ALL';
var ARRAY_SHIFT = prefix + 'ARRAY_SHIFT';
var ARRAY_SPLICE = prefix + 'ARRAY_SPLICE';
var ARRAY_UNSHIFT = prefix + 'ARRAY_UNSHIFT';
var ARRAY_SWAP = prefix + 'ARRAY_SWAP';
var AUTOFILL = prefix + 'AUTOFILL';
var BLUR = prefix + 'BLUR';
var CHANGE = prefix + 'CHANGE';
var CLEAR_SUBMIT = prefix + 'CLEAR_SUBMIT';
var CLEAR_SUBMIT_ERRORS = prefix + 'CLEAR_SUBMIT_ERRORS';
var CLEAR_ASYNC_ERROR = prefix + 'CLEAR_ASYNC_ERROR';
var DESTROY = prefix + 'DESTROY';
var FOCUS = prefix + 'FOCUS';
var INITIALIZE = prefix + 'INITIALIZE';
var REGISTER_FIELD = prefix + 'REGISTER_FIELD';
var RESET = prefix + 'RESET';
var SET_SUBMIT_FAILED = prefix + 'SET_SUBMIT_FAILED';
var SET_SUBMIT_SUCCEEDED = prefix + 'SET_SUBMIT_SUCCEEDED';
var START_ASYNC_VALIDATION = prefix + 'START_ASYNC_VALIDATION';
var START_SUBMIT = prefix + 'START_SUBMIT';
var STOP_ASYNC_VALIDATION = prefix + 'STOP_ASYNC_VALIDATION';
var STOP_SUBMIT = prefix + 'STOP_SUBMIT';
var SUBMIT = prefix + 'SUBMIT';
var TOUCH = prefix + 'TOUCH';
var UNREGISTER_FIELD = prefix + 'UNREGISTER_FIELD';
var UNTOUCH = prefix + 'UNTOUCH';
var UPDATE_SYNC_ERRORS = prefix + 'UPDATE_SYNC_ERRORS';
var UPDATE_SYNC_WARNINGS = prefix + 'UPDATE_SYNC_WARNINGS';
/***/ }),
/* 186 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__hasError__ = __webpack_require__(932);
var createIsValid = function createIsValid(structure) {
var getIn = structure.getIn,
keys = structure.keys;
var hasError = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__hasError__["a" /* default */])(structure);
return function (form) {
var getFormState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (state) {
return getIn(state, 'form');
};
var ignoreSubmitErrors = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
return function (state) {
var formState = getFormState(state);
var syncError = getIn(formState, form + '.syncError');
if (syncError) {
return false;
}
if (!ignoreSubmitErrors) {
var error = getIn(formState, form + '.error');
if (error) {
return false;
}
}
var syncErrors = getIn(formState, form + '.syncErrors');
var asyncErrors = getIn(formState, form + '.asyncErrors');
var submitErrors = ignoreSubmitErrors ? undefined : getIn(formState, form + '.submitErrors');
if (!syncErrors && !asyncErrors && !submitErrors) {
return true;
}
var registeredFields = getIn(formState, form + '.registeredFields');
if (!registeredFields) {
return true;
}
return !keys(registeredFields).filter(function (name) {
return getIn(registeredFields, '[\'' + name + '\'].count') > 0;
}).some(function (name) {
return hasError(getIn(registeredFields, '[\'' + name + '\']'), syncErrors, asyncErrors, submitErrors);
});
};
};
};
/* harmony default export */ __webpack_exports__["a"] = (createIsValid);
/***/ }),
/* 187 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createStore__ = __webpack_require__(320);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__combineReducers__ = __webpack_require__(969);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__bindActionCreators__ = __webpack_require__(968);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__applyMiddleware__ = __webpack_require__(967);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__compose__ = __webpack_require__(319);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__utils_warning__ = __webpack_require__(321);
/* unused harmony reexport createStore */
/* unused harmony reexport combineReducers */
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_2__bindActionCreators__["a"]; });
/* unused harmony reexport applyMiddleware */
/* unused harmony reexport compose */
/*
* 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 (false) {
warning('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.');
}
/***/ }),
/* 188 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module remark:parse:util:get-indentation
* @fileoverview Get indentation.
*/
module.exports = interrupt;
function interrupt(interruptors, tokenizers, ctx, params) {
var bools = ['pedantic', 'commonmark'];
var count = bools.length;
var length = interruptors.length;
var index = -1;
var interruptor;
var config;
var fn;
var offset;
var bool;
var ignore;
while (++index < length) {
interruptor = interruptors[index];
config = interruptor[1] || {};
fn = interruptor[0];
offset = -1;
ignore = false;
while (++offset < count) {
bool = bools[offset];
if (config[bool] !== undefined && config[bool] !== ctx.options[bool]) {
ignore = true;
break;
}
}
if (ignore) {
continue;
}
if (tokenizers[fn].apply(ctx, params)) {
return true;
}
}
return false;
}
/***/ }),
/* 189 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module remark:parse:util:normalize
* @fileoverview Normalize an identifier.
*/
/* Dependencies. */
var collapseWhiteSpace = __webpack_require__(422);
/* Expose. */
module.exports = normalize;
/**
* Normalize an identifier. Collapses multiple white space
* characters into a single space, and removes casing.
*
* @example
* normalizeIdentifier('FOO\t bar'); // 'foo bar'
*
* @param {string} value - Content to normalize.
* @return {string} - Normalized content.
*/
function normalize(value) {
return collapseWhiteSpace(value).toLowerCase();
}
/***/ }),
/* 190 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/*!
* repeat-string <https://github.com/jonschlinkert/repeat-string>
*
* Copyright (c) 2014-2015, Jon Schlinkert.
* Licensed under the MIT License.
*/
/**
* Results cache
*/
var res = '';
var cache;
/**
* Expose `repeat`
*/
module.exports = repeat;
/**
* Repeat the given `string` the specified `number`
* of times.
*
* **Example:**
*
* ```js
* var repeat = require('repeat-string');
* repeat('A', 5);
* //=> AAAAA
* ```
*
* @param {String} `string` The string to repeat
* @param {Number} `number` The number of times to repeat the string
* @return {String} Repeated string
* @api public
*/
function repeat(str, num) {
if (typeof str !== 'string') {
throw new TypeError('expected a string');
}
// cover common, quick use cases
if (num === 1) return str;
if (num === 2) return str + str;
var max = str.length * num;
if (cache !== str || typeof cache === 'undefined') {
cache = str;
res = '';
} else if (res.length >= max) {
return res.substr(0, max);
}
while (max > res.length && num > 1) {
if (num & 1) {
res += str;
}
num >>= 1;
str += str;
}
res += str;
res = res.substr(0, max);
return res;
}
/***/ }),
/* 191 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
module.exports = trimTrailingLines;
var line = '\n';
/* Remove final newline characters from `value`. */
function trimTrailingLines(value) {
var val = String(value);
var index = val.length;
while (val.charAt(--index) === line) { /* empty */ }
return val.slice(0, index + 1);
}
/***/ }),
/* 192 */
/***/ (function(module, exports) {
module.exports = function(originalModule) {
if(!originalModule.webpackPolyfill) {
var module = Object.create(originalModule);
// module.parent = undefined by default
if(!module.children) module.children = [];
Object.defineProperty(module, "loaded", {
enumerable: true,
get: function() {
return module.l;
}
});
Object.defineProperty(module, "id", {
enumerable: true,
get: function() {
return module.i;
}
});
Object.defineProperty(module, "exports", {
enumerable: true,
});
module.webpackPolyfill = 1;
}
return module;
};
/***/ }),
/* 193 */
/***/ (function(module, exports, __webpack_require__) {
const flatten = __webpack_require__(1034);
const remcalc = __webpack_require__(8);
const BASE = 6;
const calc = (base, ...values) =>
flatten(values.map(value => String(value).split(/\s/gim)))
.map(value => remcalc(Number(value) * base))
.join(' ');
module.exports = (...values) => calc(BASE, ...values);
module.exports.withBase = calc;
/***/ }),
/* 194 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
module.exports = __webpack_require__(729);
/***/ }),
/* 195 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*
*/
/**
* 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;
/***/ }),
/* 196 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*
*/
// 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;
/***/ }),
/* 197 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*
*/
var canDefineProperty = false;
if (false) {
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;
/***/ }),
/* 198 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
module.exports = 9007199254740991;
/***/ }),
/* 199 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*
*/
/**
* 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;
/***/ }),
/* 200 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*
*/
// 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;
/***/ }),
/* 201 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*
*/
var canDefineProperty = false;
if (false) {
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;
/***/ }),
/* 202 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_styled_components__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_normalized_styled_components__ = __webpack_require__(26);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_react_broadcast__ = __webpack_require__(14);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_react_broadcast___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_react_broadcast__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__boxes__ = __webpack_require__(51);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__input__ = __webpack_require__(52);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_remcalc__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_remcalc___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_remcalc__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_unitcalc__ = __webpack_require__(193);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_unitcalc___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_unitcalc__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_styled_is__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_rnd_id__ = __webpack_require__(116);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_rnd_id___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_9_rnd_id__);
var _templateObject = _taggedTemplateLiteral(['\n display: none;\n\n &:checked + label::after {\n opacity: 1;\n }\n\n &:selected + label::after {\n opacity: 1;\n }\n\n &:disabled + label {\n background-color: rgb(249, 249, 249);\n }\n\n &:disabled + label::after {\n opacity: 0.3;\n }\n'], ['\n display: none;\n\n &:checked + label::after {\n opacity: 1;\n }\n\n &:selected + label::after {\n opacity: 1;\n }\n\n &:disabled + label {\n background-color: rgb(249, 249, 249);\n }\n\n &:disabled + label::after {\n opacity: 0.3;\n }\n']),
_templateObject2 = _taggedTemplateLiteral(['\n border-radius: ', ';\n '], ['\n border-radius: ', ';\n ']),
_templateObject3 = _taggedTemplateLiteral(['\n border-color: ', '\n '], ['\n border-color: ', '\n ']),
_templateObject4 = _taggedTemplateLiteral(['\n &::after {\n opacity: 0;\n content: \'\';\n position: absolute;\n width: ', ';\n height: ', ';\n border-radius: ', ';\n background-color: ', ';\n top: ', ';\n left: ', ';\n }\n '], ['\n &::after {\n opacity: 0;\n content: \'\';\n position: absolute;\n width: ', ';\n height: ', ';\n border-radius: ', ';\n background-color: ', ';\n top: ', ';\n left: ', ';\n }\n ']),
_templateObject5 = _taggedTemplateLiteral(['\n &::after {\n opacity: 0;\n content: \'\';\n position: absolute;\n width: ', ';\n height: ', ';\n background: transparent;\n top: ', ';\n left: ', ';\n border: ', ' solid ', ';\n border-top: none;\n border-right: none;\n transform: rotate(-45deg);\n }\n '], ['\n &::after {\n opacity: 0;\n content: \'\';\n position: absolute;\n width: ', ';\n height: ', ';\n background: transparent;\n top: ', ';\n left: ', ';\n border: ', ' solid ', ';\n border-top: none;\n border-right: none;\n transform: rotate(-45deg);\n }\n ']);
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
var StyledInput = __WEBPACK_IMPORTED_MODULE_2_normalized_styled_components__["d" /* Input */].extend(_templateObject);
var Label = __WEBPACK_IMPORTED_MODULE_1_styled_components__["a" /* default */].label.withConfig({
displayName: 'toggle__Label'
})(['color: rgb(100, 100, 100);position: absolute;width: ', ';height: ', ';top: 0;background-color: rgb(255, 255, 255);box-shadow: ', ';border: ', ';', ';', ';', ';', ';', ';', ';', ';&:hover {&::after {opacity: 0.3;}}'], __WEBPACK_IMPORTED_MODULE_6_remcalc___default()(22), __WEBPACK_IMPORTED_MODULE_6_remcalc___default()(22), __WEBPACK_IMPORTED_MODULE_4__boxes__["d" /* insetShaddow */], __WEBPACK_IMPORTED_MODULE_4__boxes__["b" /* border */].unchecked, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8_styled_is__["a" /* default */])('checkbox')(_templateObject2, __WEBPACK_IMPORTED_MODULE_4__boxes__["c" /* borderRadius */]), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8_styled_is__["a" /* default */])('radio')(_templateObject2, __WEBPACK_IMPORTED_MODULE_6_remcalc___default()(11)), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8_styled_is__["a" /* default */])('error')(_templateObject3, function (props) {
return props.theme.red;
}), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8_styled_is__["a" /* default */])('warning')(_templateObject3, function (props) {
return props.theme.orange;
}), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8_styled_is__["a" /* default */])('success')(_templateObject3, function (props) {
return props.theme.green;
}), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8_styled_is__["a" /* default */])('radio')(_templateObject4, __WEBPACK_IMPORTED_MODULE_6_remcalc___default()(10), __WEBPACK_IMPORTED_MODULE_6_remcalc___default()(10), __WEBPACK_IMPORTED_MODULE_6_remcalc___default()(5), function (props) {
return props.theme.secondaryActive;
}, __WEBPACK_IMPORTED_MODULE_6_remcalc___default()(6), __WEBPACK_IMPORTED_MODULE_6_remcalc___default()(6)), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8_styled_is__["a" /* default */])('checkbox')(_templateObject5, __WEBPACK_IMPORTED_MODULE_7_unitcalc___default()(1.5), __WEBPACK_IMPORTED_MODULE_6_remcalc___default()(4), __WEBPACK_IMPORTED_MODULE_6_remcalc___default()(7), __WEBPACK_IMPORTED_MODULE_6_remcalc___default()(7), __WEBPACK_IMPORTED_MODULE_7_unitcalc___default()(0.5), function (props) {
return props.theme.secondaryActive;
}));
var InnerContainer = __WEBPACK_IMPORTED_MODULE_1_styled_components__["a" /* default */].div.withConfig({
displayName: 'toggle__InnerContainer'
})(['display: inline-block;vertical-align: text-bottom;margin-right: ', ';width: ', ';height: ', ';position: relative;'], __WEBPACK_IMPORTED_MODULE_7_unitcalc___default()(2), __WEBPACK_IMPORTED_MODULE_7_unitcalc___default()(4), __WEBPACK_IMPORTED_MODULE_7_unitcalc___default()(4));
var ToggleBase = function ToggleBase(_ref) {
var _ref$container = _ref.container,
container = _ref$container === undefined ? null : _ref$container,
_ref$type = _ref.type,
type = _ref$type === undefined ? 'radio' : _ref$type;
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__input__["a" /* default */])(function (_ref2) {
var children = _ref2.children,
rest = _objectWithoutProperties(_ref2, ['children']);
var OuterContainer = container ? container : null;
var types = _defineProperty({}, type, true);
var render = function render(_ref3) {
var id = _ref3.id,
oldValue = _objectWithoutProperties(_ref3, ['id']);
var newValue = Object.assign({}, oldValue, {
id: __WEBPACK_IMPORTED_MODULE_9_rnd_id___default()()
});
var toggle = __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
InnerContainer,
Object.assign({}, types, { type: type }),
__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(StyledInput, Object.assign({}, rest, oldValue, { id: newValue.id, type: type })),
__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Label, Object.assign({}, types, {
htmlFor: newValue.id,
error: rest.error,
warning: rest.warning,
success: rest.success
}))
);
var el = OuterContainer ? __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
OuterContainer,
null,
toggle,
children
) : toggle;
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
__WEBPACK_IMPORTED_MODULE_3_react_broadcast__["Broadcast"],
{ channel: 'input-group', value: newValue },
el
);
};
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
__WEBPACK_IMPORTED_MODULE_3_react_broadcast__["Subscriber"],
{ channel: 'input-group' },
render
);
});
};
/* harmony default export */ __webpack_exports__["a"] = (ToggleBase);
/***/ }),
/* 203 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_styled_components__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_normalized_styled_components__ = __webpack_require__(26);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__baseline__ = __webpack_require__(4);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__typography__ = __webpack_require__(13);
var _templateObject = _taggedTemplateLiteral(['\n ', ';\n ', ';\n'], ['\n ', ';\n ', ';\n']);
function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
var StyledLegend = __WEBPACK_IMPORTED_MODULE_1_normalized_styled_components__["b" /* Legend */].extend(_templateObject, __WEBPACK_IMPORTED_MODULE_3__typography__["a" /* default */].fontFamily, __WEBPACK_IMPORTED_MODULE_3__typography__["a" /* default */].semibold);
/* harmony default export */ __webpack_exports__["default"] = (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__baseline__["a" /* default */])(StyledLegend));
/***/ }),
/* 204 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RadioList", function() { return RadioList; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_styled_components__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__base_toggle__ = __webpack_require__(202);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__baseline__ = __webpack_require__(4);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__base_input__ = __webpack_require__(52);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__typography__ = __webpack_require__(13);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_react__);
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 Li = __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* default */].li.withConfig({
displayName: 'radio__Li'
})(['list-style-type: none;', ';', ';'], __WEBPACK_IMPORTED_MODULE_4__typography__["a" /* default */].fontFamily, __WEBPACK_IMPORTED_MODULE_4__typography__["a" /* default */].normal);
var Ul = __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* default */].ul.withConfig({
displayName: 'radio__Ul'
})(['margin: 0;padding: 0;']);
var RadioItem = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__base_input__["a" /* default */])(function (_ref) {
var children = _ref.children,
id = _ref.id,
rest = _objectWithoutProperties(_ref, ['children', 'id']);
return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(
Li,
rest,
children
);
});
var Radio = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__baseline__["a" /* default */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__base_toggle__["a" /* default */])({
container: RadioItem,
type: 'radio'
}));
/**
* @example ./usage-radio.md
*/
/* harmony default export */ __webpack_exports__["default"] = (function (_ref2) {
var children = _ref2.children,
rest = _objectWithoutProperties(_ref2, ['children']);
return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(
Radio,
rest,
children
);
});
var RadioList = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__baseline__["a" /* default */])(Ul);
/***/ }),
/* 205 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ToggleList", function() { return ToggleList; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_styled_components__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_normalized_styled_components__ = __webpack_require__(26);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_remcalc__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_remcalc___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_remcalc__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_unitcalc__ = __webpack_require__(193);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_unitcalc___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_unitcalc__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_rnd_id__ = __webpack_require__(116);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_rnd_id___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_rnd_id__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_styled_is__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_react_broadcast__ = __webpack_require__(14);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_react_broadcast___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_react_broadcast__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__boxes__ = __webpack_require__(51);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__baseline__ = __webpack_require__(4);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__base_input__ = __webpack_require__(52);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__typography__ = __webpack_require__(13);
var _templateObject = _taggedTemplateLiteral(['\n display: none;\n\n &:checked + label {\n border-radius: ', ';\n background-color: ', ';\n box-shadow: ', ';\n color: ', ';\n }\n\n &:selected + label {\n border-radius: ', ';\n background-color: ', ';\n box-shadow: ', ';\n color: ', ';\n }\n\n &:disabled + label {\n color: ', ';\n }\n'], ['\n display: none;\n\n &:checked + label {\n border-radius: ', ';\n background-color: ', ';\n box-shadow: ', ';\n color: ', ';\n }\n\n &:selected + label {\n border-radius: ', ';\n background-color: ', ';\n box-shadow: ', ';\n color: ', ';\n }\n\n &:disabled + label {\n color: ', ';\n }\n']),
_templateObject2 = _taggedTemplateLiteral(['\n border-color: ', '\n '], ['\n border-color: ', '\n ']);
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 _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
var StyledInput = __WEBPACK_IMPORTED_MODULE_2_normalized_styled_components__["d" /* Input */].extend(_templateObject, __WEBPACK_IMPORTED_MODULE_3_remcalc___default()(4), function (props) {
return props.theme.white;
}, __WEBPACK_IMPORTED_MODULE_8__boxes__["a" /* bottomShaddow */], function (props) {
return props.theme.secondary;
}, __WEBPACK_IMPORTED_MODULE_3_remcalc___default()(4), function (props) {
return props.theme.white;
}, __WEBPACK_IMPORTED_MODULE_8__boxes__["a" /* bottomShaddow */], function (props) {
return props.theme.secondary;
}, function (props) {
return props.theme.grey;
});
var Label = __WEBPACK_IMPORTED_MODULE_1_styled_components__["a" /* default */].label.withConfig({
displayName: 'toggle__Label'
})(['', ';', ';position: absolute;box-sizing: border-box;width: ', ';height: ', ';top: 0;left: 0;text-align: center;padding-top: ', ';color: ', ';', ';', ';', ';&:hover {color: ', ';}'], __WEBPACK_IMPORTED_MODULE_11__typography__["a" /* default */].fontFamily, __WEBPACK_IMPORTED_MODULE_11__typography__["a" /* default */].normal, __WEBPACK_IMPORTED_MODULE_4_unitcalc___default()(20), __WEBPACK_IMPORTED_MODULE_4_unitcalc___default()(8), __WEBPACK_IMPORTED_MODULE_4_unitcalc___default()(2), function (props) {
return props.theme.text;
}, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6_styled_is__["a" /* default */])('error')(_templateObject2, function (props) {
return props.theme.red;
}), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6_styled_is__["a" /* default */])('warning')(_templateObject2, function (props) {
return props.theme.orange;
}), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6_styled_is__["a" /* default */])('success')(_templateObject2, function (props) {
return props.theme.green;
}), function (props) {
return props.theme.secondaryHover;
});
var InputContainer = __WEBPACK_IMPORTED_MODULE_1_styled_components__["a" /* default */].div.withConfig({
displayName: 'toggle__InputContainer'
})(['position: relative;vertical-align: text-bottom;width: ', ';height: ', ';'], __WEBPACK_IMPORTED_MODULE_4_unitcalc___default()(20), __WEBPACK_IMPORTED_MODULE_4_unitcalc___default()(8));
var Li = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_10__base_input__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1_styled_components__["a" /* default */].li.withConfig({
displayName: 'toggle__Li'
})(['display: inline-block;list-style-type: none;vertical-align: text-bottom;border-top: ', ';border-bottom: ', ';border-left: ', ';&:first-of-type {border-radius: ', ' 0 0 ', ';}&:last-of-type {border-radius: 0 ', ' ', ' 0;border-right: ', ';}'], __WEBPACK_IMPORTED_MODULE_8__boxes__["b" /* border */].unchecked, __WEBPACK_IMPORTED_MODULE_8__boxes__["b" /* border */].unchecked, __WEBPACK_IMPORTED_MODULE_8__boxes__["b" /* border */].unchecked, __WEBPACK_IMPORTED_MODULE_8__boxes__["c" /* borderRadius */], __WEBPACK_IMPORTED_MODULE_8__boxes__["c" /* borderRadius */], __WEBPACK_IMPORTED_MODULE_8__boxes__["c" /* borderRadius */], __WEBPACK_IMPORTED_MODULE_8__boxes__["c" /* borderRadius */], __WEBPACK_IMPORTED_MODULE_8__boxes__["b" /* border */].unchecked));
var Ul = __WEBPACK_IMPORTED_MODULE_1_styled_components__["a" /* default */].ul.withConfig({
displayName: 'toggle__Ul'
})(['display: inline-block;margin: 0;padding: 0;box-shadow: ', ';'], __WEBPACK_IMPORTED_MODULE_8__boxes__["a" /* bottomShaddow */]);
var BaseToggle = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_10__base_input__["a" /* default */])(function (_ref) {
var children = _ref.children,
rest = _objectWithoutProperties(_ref, ['children']);
var render = function render(value) {
var id = __WEBPACK_IMPORTED_MODULE_5_rnd_id___default()();
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
Li,
null,
__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
InputContainer,
null,
__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(StyledInput, Object.assign({
checked: value.value === rest.value
}, value, rest, {
id: id,
type: 'radio'
})),
__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
Label,
{
htmlFor: id,
error: rest.error,
warning: rest.warning,
success: rest.success
},
children
)
)
);
};
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
__WEBPACK_IMPORTED_MODULE_7_react_broadcast__["Subscriber"],
{ channel: 'input-group' },
render
);
});
/**
* @example ./usage-toggle.md
*/
var Toggle = function Toggle(_ref2) {
var children = _ref2.children,
rest = _objectWithoutProperties(_ref2, ['children']);
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
BaseToggle,
rest,
children
);
};
/* harmony default export */ __webpack_exports__["default"] = (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_9__baseline__["a" /* default */])(Toggle));
var ToggleList = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_9__baseline__["a" /* default */])(Ul);
/***/ }),
/* 206 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_styled_components__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__baseline__ = __webpack_require__(4);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__typography__ = __webpack_require__(13);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_remcalc__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_remcalc___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_remcalc__);
var Label = __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* default */].label.withConfig({
displayName: 'label__Label'
})(['', ';', ';font-size: ', ';font-style: normal;font-stretch: normal;color: ', ';'], __WEBPACK_IMPORTED_MODULE_2__typography__["a" /* default */].fontFamily, __WEBPACK_IMPORTED_MODULE_2__typography__["a" /* default */].normal, __WEBPACK_IMPORTED_MODULE_3_remcalc___default()(15), function (props) {
return props.theme.secondary;
});
/* harmony default export */ __webpack_exports__["a"] = (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__baseline__["a" /* default */])(Label));
/***/ }),
/* 207 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_styled_components__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_remcalc__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_remcalc___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_remcalc__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__baseline__ = __webpack_require__(4);
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 StyledLi = __WEBPACK_IMPORTED_MODULE_1_styled_components__["a" /* default */].li.withConfig({
displayName: 'li__StyledLi'
})(['display: inline-block;& + & {margin-left: ', ';}& a {color: ', ';text-decoration: none;padding-bottom: ', ';&.active {cursor: default;color: ', ';border-bottom: ', ' solid ', ';}}'], __WEBPACK_IMPORTED_MODULE_2_remcalc___default()(24), function (props) {
return props.theme.text;
}, __WEBPACK_IMPORTED_MODULE_2_remcalc___default()(6), function (props) {
return props.theme.primary;
}, __WEBPACK_IMPORTED_MODULE_2_remcalc___default()(2), function (props) {
return props.theme.primary;
});
/**
* @example ./usage.md
*/
var Li = function Li(_ref) {
var children = _ref.children,
rest = _objectWithoutProperties(_ref, ['children']);
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
StyledLi,
rest,
children
);
};
/* harmony default export */ __webpack_exports__["default"] = (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__baseline__["a" /* default */])(Li));
/***/ }),
/* 208 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_styled_components__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_remcalc__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_remcalc___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_remcalc__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__baseline__ = __webpack_require__(4);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__typography__ = __webpack_require__(13);
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 StyledUl = __WEBPACK_IMPORTED_MODULE_1_styled_components__["a" /* default */].ul.withConfig({
displayName: 'ul__StyledUl'
})(['', ';', ';list-style-type: none;margin-bottom: ', ';'], __WEBPACK_IMPORTED_MODULE_4__typography__["a" /* default */].fontFamily, __WEBPACK_IMPORTED_MODULE_4__typography__["a" /* default */].semibold, __WEBPACK_IMPORTED_MODULE_2_remcalc___default()(33));
/**
* @example ./usage.md
*/
var Ul = function Ul(_ref) {
var children = _ref.children,
rest = _objectWithoutProperties(_ref, ['children']);
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
StyledUl,
rest,
children
);
};
/* harmony default export */ __webpack_exports__["default"] = (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__baseline__["a" /* default */])(Ul));
/***/ }),
/* 209 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_styled_components__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_remcalc__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_remcalc___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_remcalc__);
/* harmony default export */ __webpack_exports__["a"] = (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_styled_components__["b" /* css */])(['margin-bottom: ', ';box-shadow:0 ', ' 0 ', ' ', ',0 ', ' ', ' ', ' ', ',0 ', ' 0 ', ' ', ',0 ', ' ', ' ', ' ', ';'], __WEBPACK_IMPORTED_MODULE_1_remcalc___default()(16), __WEBPACK_IMPORTED_MODULE_1_remcalc___default()(8), __WEBPACK_IMPORTED_MODULE_1_remcalc___default()(-5), function (props) {
return props.theme.background;
}, __WEBPACK_IMPORTED_MODULE_1_remcalc___default()(8), __WEBPACK_IMPORTED_MODULE_1_remcalc___default()(1), __WEBPACK_IMPORTED_MODULE_1_remcalc___default()(-4), function (props) {
return props.theme.grey;
}, __WEBPACK_IMPORTED_MODULE_1_remcalc___default()(16), __WEBPACK_IMPORTED_MODULE_1_remcalc___default()(-10), function (props) {
return props.theme.background;
}, __WEBPACK_IMPORTED_MODULE_1_remcalc___default()(16), __WEBPACK_IMPORTED_MODULE_1_remcalc___default()(1), __WEBPACK_IMPORTED_MODULE_1_remcalc___default()(-9), function (props) {
return props.theme.grey;
}));
/***/ }),
/* 210 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__shapes__ = __webpack_require__(211);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__baseline__ = __webpack_require__(4);
var GraphLink = function GraphLink(_ref) {
var data = _ref.data,
index = _ref.index;
var sourcePosition = data.sourcePosition,
targetPosition = data.targetPosition;
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_2__shapes__["c" /* GraphLinkLine */], {
x1: sourcePosition.x,
x2: targetPosition.x,
y1: sourcePosition.y,
y2: targetPosition.y
});
};
GraphLink.propTypes = {
data: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object.isRequired,
index: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.number
};
/* harmony default export */ __webpack_exports__["a"] = (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__baseline__["a" /* default */])(GraphLink));
/***/ }),
/* 211 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return GraphLinkLine; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return GraphLinkCircle; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return GraphLinkArrowLine; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_styled_components__ = __webpack_require__(3);
var GraphLinkLine = __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* default */].line.withConfig({
displayName: 'shapes__GraphLinkLine'
})(['stroke: ', ';stroke-width: 1.5;'], function (props) {
return props.theme.secondaryActive;
});
var GraphLinkCircle = __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* default */].circle.withConfig({
displayName: 'shapes__GraphLinkCircle'
})(['stroke: ', ';fill: ', ';stroke-width: 1.5;'], function (props) {
return props.theme.secondaryActive;
}, function (props) {
return props.theme.secondary;
});
var GraphLinkArrowLine = __WEBPACK_IMPORTED_MODULE_0_styled_components__["a" /* default */].line.withConfig({
displayName: 'shapes__GraphLinkArrowLine'
})(['stroke: ', ';stroke-width: 2;stroke-linecap: round;'], function (props) {
return props.theme.white;
});
/***/ }),
/* 212 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(40);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__title__ = __webpack_require__(411);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__button__ = __webpack_require__(407);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__content__ = __webpack_require__(408);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__shapes__ = __webpack_require__(53);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__baseline__ = __webpack_require__(4);
var GraphNode = function GraphNode(_ref) {
var connected = _ref.connected,
data = _ref.data,
index = _ref.index,
onDragStart = _ref.onDragStart,
onNodeTitleClick = _ref.onNodeTitleClick,
onQuickActions = _ref.onQuickActions;
var _ref2 = data.children ? __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* default */].nodeSizeWithChildren : __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* default */].nodeSize,
width = _ref2.width,
height = _ref2.height;
var _ref3 = data.children ? __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* default */].nodeRectWithChildren : __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* default */].nodeRect,
left = _ref3.left,
top = _ref3.top;
var x = data.x;
var y = data.y;
if (connected) {
x = data.x + left;
y = data.y + top;
}
var onButtonClick = function onButtonClick(evt) {
var tooltipPosition = {
x: data.x + __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* default */].buttonRect.x + __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* default */].buttonRect.width / 2,
y: data.y + __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* default */].buttonRect.y + __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* default */].buttonRect.height
};
if (connected) {
tooltipPosition.x += left;
tooltipPosition.y += top;
}
var d = {
service: data.uuid,
position: {
left: tooltipPosition.x,
top: tooltipPosition.y
}
};
onQuickActions(evt, d);
};
var onTitleClick = function onTitleClick() {
return onNodeTitleClick(data.uuid);
};
var onStart = function onStart(evt) {
evt.preventDefault();
onDragStart(evt, data.uuid);
};
var nodeRectEvents = connected ? {
onMouseDown: onStart,
onTouchStart: onStart
} : {};
var nodeContent = data.children ? data.children.map(function (d, i) {
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_5__content__["a" /* default */], {
key: i,
child: true,
connected: connected,
data: d,
index: i
});
}) : __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_5__content__["a" /* default */], { connected: connected, data: data });
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
'g',
{ transform: 'translate(' + x + ', ' + y + ')' },
__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_6__shapes__["a" /* GraphShadowRect */], {
x: 0,
y: 3,
width: width,
height: height,
connected: connected
}),
__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_6__shapes__["b" /* GraphNodeRect */], Object.assign({
x: 0,
y: 0,
width: width,
height: height,
connected: connected
}, nodeRectEvents)),
__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_3__title__["a" /* default */], {
connected: connected,
data: data,
onNodeTitleClick: onTitleClick
}),
__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_4__button__["a" /* default */], {
connected: connected,
index: index,
onButtonClick: onButtonClick
}),
nodeContent
);
};
GraphNode.propTypes = {
connected: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool,
data: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object.isRequired,
index: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.number.isRequired,
onDragStart: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func,
onNodeTitleClick: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func,
onQuickActions: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func
};
/* harmony default export */ __webpack_exports__["a"] = (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__baseline__["a" /* default */])(GraphNode));
/***/ }),
/* 213 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Point; });
/* unused harmony export Rect */
/* unused harmony export Size */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_prop_types__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_prop_types__);
var p = {
x: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.number.isRequired,
y: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.number.isRequired
};
var s = {
width: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.number,
height: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.number
};
var Point = __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.shape(Object.assign({}, p));
var Size = __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.shape(Object.assign({}, s));
var Rect = __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.shape(Object.assign({}, p, s));
/***/ }),
/* 214 */
/***/ (function(module, exports, __webpack_require__) {
"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__(17);
/**
* 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 (false) {
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;
/***/ }),
/* 215 */
/***/ (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.
*
*/
/**
* @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;
/***/ }),
/* 216 */
/***/ (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
*/
/* 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.
*
* @param {?DOMDocument} doc Defaults to current document.
* @return {?DOMElement}
*/
function getActiveElement(doc) /*?DOMElement*/{
doc = doc || (typeof document !== 'undefined' ? document : undefined);
if (typeof doc === 'undefined') {
return null;
}
try {
return doc.activeElement || doc.body;
} catch (e) {
return doc.body;
}
}
module.exports = getActiveElement;
/***/ }),
/* 217 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
var canUseDOM = exports.canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
var addEventListener = exports.addEventListener = function addEventListener(node, event, listener) {
return node.addEventListener ? node.addEventListener(event, listener, false) : node.attachEvent('on' + event, listener);
};
var removeEventListener = exports.removeEventListener = function removeEventListener(node, event, listener) {
return node.removeEventListener ? node.removeEventListener(event, listener, false) : node.detachEvent('on' + event, listener);
};
var getConfirmation = exports.getConfirmation = function getConfirmation(message, callback) {
return callback(window.confirm(message));
}; // eslint-disable-line no-alert
/**
* Returns true if the HTML5 history API is supported. Taken from Modernizr.
*
* https://github.com/Modernizr/Modernizr/blob/master/LICENSE
* https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js
* changed to avoid false negatives for Windows Phones: https://github.com/reactjs/react-router/issues/586
*/
var supportsHistory = exports.supportsHistory = function supportsHistory() {
var ua = window.navigator.userAgent;
if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) return false;
return window.history && 'pushState' in window.history;
};
/**
* Returns true if browser fires popstate on hash change.
* IE10 and IE11 do not.
*/
var supportsPopStateOnHashChange = exports.supportsPopStateOnHashChange = function supportsPopStateOnHashChange() {
return window.navigator.userAgent.indexOf('Trident') === -1;
};
/**
* Returns false if using go(n) with hash history causes a full page reload.
*/
var supportsGoWithoutReloadUsingHash = exports.supportsGoWithoutReloadUsingHash = function supportsGoWithoutReloadUsingHash() {
return window.navigator.userAgent.indexOf('Firefox') === -1;
};
/**
* Returns true if a given popstate event is an extraneous WebKit event.
* Accounts for the fact that Chrome on iOS fires real popstate events
* containing undefined state when pressing the back button.
*/
var isExtraneousPopstateEvent = exports.isExtraneousPopstateEvent = function isExtraneousPopstateEvent(event) {
return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;
};
/***/ }),
/* 218 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2016 Titus Wormer
* @license MIT
* @module is-alphabetical
* @fileoverview Check if a character is alphabetical.
*/
/* eslint-env commonjs */
/* Expose. */
module.exports = alphabetical;
/**
* Check whether the given character code, or the character
* code at the first character, is alphabetical.
*
* @param {string|number} character
* @return {boolean} - Whether `character` is alphabetical.
*/
function alphabetical(character) {
var code = typeof character === 'string' ?
character.charCodeAt(0) : character;
return (code >= 97 && code <= 122) || /* a-z */
(code >= 65 && code <= 90); /* A-Z */
}
/***/ }),
/* 219 */
/***/ (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; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
/**
* Sheets registry to access them all at one place.
*/
var SheetsRegistry = function () {
function SheetsRegistry() {
_classCallCheck(this, SheetsRegistry);
this.registry = [];
}
_createClass(SheetsRegistry, [{
key: 'add',
/**
* Register a Style Sheet.
*/
value: function add(sheet) {
var registry = this.registry;
var index = sheet.options.index;
if (!registry.length || index >= registry[registry.length - 1].options.index) {
registry.push(sheet);
return;
}
for (var i = 0; i < registry.length; i++) {
var options = registry[i].options;
if (options.index > index) {
registry.splice(i, 0, sheet);
return;
}
}
}
/**
* Reset the registry.
*/
}, {
key: 'reset',
value: function reset() {
this.registry = [];
}
/**
* Remove a Style Sheet.
*/
}, {
key: 'remove',
value: function remove(sheet) {
var index = this.registry.indexOf(sheet);
this.registry.splice(index, 1);
}
/**
* Convert all attached sheets to a CSS string.
*/
}, {
key: 'toString',
value: function toString(options) {
return this.registry.filter(function (sheet) {
return sheet.attached;
}).map(function (sheet) {
return sheet.toString(options);
}).join('\n');
}
}]);
return SheetsRegistry;
}();
exports['default'] = SheetsRegistry;
/***/ }),
/* 220 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = createRule;
var _warning = __webpack_require__(22);
var _warning2 = _interopRequireDefault(_warning);
var _RegularRule = __webpack_require__(485);
var _RegularRule2 = _interopRequireDefault(_RegularRule);
var _cloneStyle = __webpack_require__(489);
var _cloneStyle2 = _interopRequireDefault(_cloneStyle);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
/**
* Create a rule instance.
*/
function createRule(name, decl, options) {
var jss = options.jss;
var declCopy = (0, _cloneStyle2['default'])(decl);
if (jss) {
var rule = jss.plugins.onCreateRule(name, declCopy, options);
if (rule) return rule;
}
// It is an at-rule and it has no instance.
if (name && name[0] === '@') {
(0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);
}
return new _RegularRule2['default'](name, declCopy, options);
}
/***/ }),
/* 221 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = findRenderer;
var _isInBrowser = __webpack_require__(467);
var _isInBrowser2 = _interopRequireDefault(_isInBrowser);
var _DomRenderer = __webpack_require__(480);
var _DomRenderer2 = _interopRequireDefault(_DomRenderer);
var _VirtualRenderer = __webpack_require__(481);
var _VirtualRenderer2 = _interopRequireDefault(_VirtualRenderer);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
/**
* Find proper renderer.
* Option `virtual` is used to force use of VirtualRenderer even if DOM is
* detected, used for testing only.
*/
function findRenderer() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
if (options.Renderer) return options.Renderer;
var useVirtual = options.virtual || !_isInBrowser2['default'];
return useVirtual ? _VirtualRenderer2['default'] : _DomRenderer2['default'];
}
/***/ }),
/* 222 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = toCssValue;
var joinWithSpace = function joinWithSpace(value) {
return value.join(' ');
};
/**
* Converts array values to string.
*
* `margin: [['5px', '10px']]` > `margin: 5px 10px;`
* `border: ['1px', '2px']` > `border: 1px, 2px;`
*/
function toCssValue(value) {
if (!Array.isArray(value)) return value;
// Support space separated values.
if (Array.isArray(value[0])) {
return toCssValue(value.map(joinWithSpace));
}
return value.join(', ');
}
/***/ }),
/* 223 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__root_js__ = __webpack_require__(27);
/** Built-in value references. */
var Uint8Array = __WEBPACK_IMPORTED_MODULE_0__root_js__["a" /* default */].Uint8Array;
/* harmony default export */ __webpack_exports__["a"] = (Uint8Array);
/***/ }),
/* 224 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__baseTimes_js__ = __webpack_require__(525);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArguments_js__ = __webpack_require__(141);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isArray_js__ = __webpack_require__(28);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__isBuffer_js__ = __webpack_require__(142);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__isIndex_js__ = __webpack_require__(137);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__isTypedArray_js__ = __webpack_require__(145);
/** 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 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__isArray_js__["a" /* default */])(value),
isArg = !isArr && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__isArguments_js__["a" /* default */])(value),
isBuff = !isArr && !isArg && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__isBuffer_js__["a" /* default */])(value),
isType = !isArr && !isArg && !isBuff && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__isTypedArray_js__["a" /* default */])(value),
skipIndexes = isArr || isArg || isBuff || isType,
result = skipIndexes ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__baseTimes_js__["a" /* default */])(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.
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__isIndex_js__["a" /* default */])(key, length)
))) {
result.push(key);
}
}
return result;
}
/* harmony default export */ __webpack_exports__["a"] = (arrayLikeKeys);
/***/ }),
/* 225 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/**
* 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;
}
/* harmony default export */ __webpack_exports__["a"] = (arrayMap);
/***/ }),
/* 226 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__baseAssignValue_js__ = __webpack_require__(89);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__eq_js__ = __webpack_require__(71);
/**
* This function is like `assignValue` except that it doesn't assign
* `undefined` values.
*
* @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 assignMergeValue(object, key, value) {
if ((value !== undefined && !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__eq_js__["a" /* default */])(object[key], value)) ||
(value === undefined && !(key in object))) {
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__baseAssignValue_js__["a" /* default */])(object, key, value);
}
}
/* harmony default export */ __webpack_exports__["a"] = (assignMergeValue);
/***/ }),
/* 227 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createBaseFor_js__ = __webpack_require__(535);
/**
* 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 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__createBaseFor_js__["a" /* default */])();
/* harmony default export */ __webpack_exports__["a"] = (baseFor);
/***/ }),
/* 228 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__castPath_js__ = __webpack_require__(229);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__toKey_js__ = __webpack_require__(70);
/**
* 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 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__castPath_js__["a" /* default */])(path, object);
var index = 0,
length = path.length;
while (object != null && index < length) {
object = object[__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__toKey_js__["a" /* default */])(path[index++])];
}
return (index && index == length) ? object : undefined;
}
/* harmony default export */ __webpack_exports__["a"] = (baseGet);
/***/ }),
/* 229 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArray_js__ = __webpack_require__(28);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isKey_js__ = __webpack_require__(138);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__stringToPath_js__ = __webpack_require__(238);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__toString_js__ = __webpack_require__(243);
/**
* 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 (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__isArray_js__["a" /* default */])(value)) {
return value;
}
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__isKey_js__["a" /* default */])(value, object) ? [value] : __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__stringToPath_js__["a" /* default */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__toString_js__["a" /* default */])(value));
}
/* harmony default export */ __webpack_exports__["a"] = (castPath);
/***/ }),
/* 230 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/**
* 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;
}
/* harmony default export */ __webpack_exports__["a"] = (copyArray);
/***/ }),
/* 231 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getNative_js__ = __webpack_require__(41);
var defineProperty = (function() {
try {
var func = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__getNative_js__["a" /* default */])(Object, 'defineProperty');
func({}, '', {});
return func;
} catch (e) {}
}());
/* harmony default export */ __webpack_exports__["a"] = (defineProperty);
/***/ }),
/* 232 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__SetCache_js__ = __webpack_require__(498);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__arraySome_js__ = __webpack_require__(503);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__cacheHas_js__ = __webpack_require__(528);
/** 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 __WEBPACK_IMPORTED_MODULE_0__SetCache_js__["a" /* default */] : 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 (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__arraySome_js__["a" /* default */])(other, function(othValue, othIndex) {
if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__cacheHas_js__["a" /* default */])(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;
}
/* harmony default export */ __webpack_exports__["a"] = (equalArrays);
/***/ }),
/* 233 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
/* harmony default export */ __webpack_exports__["a"] = (freeGlobal);
/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(16)))
/***/ }),
/* 234 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__overArg_js__ = __webpack_require__(237);
/** Built-in value references. */
var getPrototype = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__overArg_js__["a" /* default */])(Object.getPrototypeOf, Object);
/* harmony default export */ __webpack_exports__["a"] = (getPrototype);
/***/ }),
/* 235 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isObject_js__ = __webpack_require__(34);
/**
* 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 && !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__isObject_js__["a" /* default */])(value);
}
/* harmony default export */ __webpack_exports__["a"] = (isStrictComparable);
/***/ }),
/* 236 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/**
* 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)));
};
}
/* harmony default export */ __webpack_exports__["a"] = (matchesStrictComparable);
/***/ }),
/* 237 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/**
* 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));
};
}
/* harmony default export */ __webpack_exports__["a"] = (overArg);
/***/ }),
/* 238 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__memoizeCapped_js__ = __webpack_require__(565);
/** 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 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__memoizeCapped_js__["a" /* default */])(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;
});
/* harmony default export */ __webpack_exports__["a"] = (stringToPath);
/***/ }),
/* 239 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/** 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 '';
}
/* harmony default export */ __webpack_exports__["a"] = (toSource);
/***/ }),
/* 240 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__baseIsEqual_js__ = __webpack_require__(136);
/**
* This method is like `_.isEqual` except that it accepts `customizer` which
* is invoked to compare values. If `customizer` returns `undefined`, comparisons
* are handled by the method instead. The `customizer` is invoked with up to
* six arguments: (objValue, othValue [, index|key, object, other, stack]).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @param {Function} [customizer] The function to customize comparisons.
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
* @example
*
* function isGreeting(value) {
* return /^h(?:i|ello)$/.test(value);
* }
*
* function customizer(objValue, othValue) {
* if (isGreeting(objValue) && isGreeting(othValue)) {
* return true;
* }
* }
*
* var array = ['hello', 'goodbye'];
* var other = ['hi', 'goodbye'];
*
* _.isEqualWith(array, other, customizer);
* // => true
*/
function isEqualWith(value, other, customizer) {
customizer = typeof customizer == 'function' ? customizer : undefined;
var result = customizer ? customizer(value, other) : undefined;
return result === undefined ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__baseIsEqual_js__["a" /* default */])(value, other, undefined, customizer) : !!result;
}
/* harmony default export */ __webpack_exports__["a"] = (isEqualWith);
/***/ }),
/* 241 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__arrayLikeKeys_js__ = __webpack_require__(224);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__baseKeysIn_js__ = __webpack_require__(516);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isArrayLike_js__ = __webpack_require__(92);
/**
* 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 __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__isArrayLike_js__["a" /* default */])(object) ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__arrayLikeKeys_js__["a" /* default */])(object, true) : __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__baseKeysIn_js__["a" /* default */])(object);
}
/* harmony default export */ __webpack_exports__["a"] = (keysIn);
/***/ }),
/* 242 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__baseAssignValue_js__ = __webpack_require__(89);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__baseForOwn_js__ = __webpack_require__(506);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__baseIteratee_js__ = __webpack_require__(514);
/**
* 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 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__baseIteratee_js__["a" /* default */])(iteratee, 3);
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__baseForOwn_js__["a" /* default */])(object, function(value, key, object) {
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__baseAssignValue_js__["a" /* default */])(result, key, iteratee(value, key, object));
});
return result;
}
/* harmony default export */ __webpack_exports__["a"] = (mapValues);
/***/ }),
/* 243 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__baseToString_js__ = __webpack_require__(526);
/**
* 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 ? '' : __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__baseToString_js__["a" /* default */])(value);
}
/* harmony default export */ __webpack_exports__["a"] = (toString);
/***/ }),
/* 244 */
/***/ (function(module, exports, __webpack_require__) {
var root = __webpack_require__(18);
/** Built-in value references. */
var Uint8Array = root.Uint8Array;
module.exports = Uint8Array;
/***/ }),
/* 245 */
/***/ (function(module, exports, __webpack_require__) {
var baseTimes = __webpack_require__(624),
isArguments = __webpack_require__(154),
isArray = __webpack_require__(29),
isBuffer = __webpack_require__(155),
isIndex = __webpack_require__(150),
isTypedArray = __webpack_require__(158);
/** 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;
/***/ }),
/* 246 */
/***/ (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;
/***/ }),
/* 247 */
/***/ (function(module, exports, __webpack_require__) {
var baseAssignValue = __webpack_require__(99),
eq = __webpack_require__(72);
/**
* This function is like `assignValue` except that it doesn't assign
* `undefined` values.
*
* @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 assignMergeValue(object, key, value) {
if ((value !== undefined && !eq(object[key], value)) ||
(value === undefined && !(key in object))) {
baseAssignValue(object, key, value);
}
}
module.exports = assignMergeValue;
/***/ }),
/* 248 */
/***/ (function(module, exports, __webpack_require__) {
var createBaseFor = __webpack_require__(636);
/**
* 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;
/***/ }),
/* 249 */
/***/ (function(module, exports, __webpack_require__) {
var baseFor = __webpack_require__(248),
keys = __webpack_require__(159);
/**
* 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;
/***/ }),
/* 250 */
/***/ (function(module, exports, __webpack_require__) {
var castPath = __webpack_require__(253),
toKey = __webpack_require__(102);
/**
* 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;
/***/ }),
/* 251 */
/***/ (function(module, exports, __webpack_require__) {
var baseIsEqualDeep = __webpack_require__(609),
isObjectLike = __webpack_require__(35);
/**
* 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;
/***/ }),
/* 252 */
/***/ (function(module, exports, __webpack_require__) {
var baseMatches = __webpack_require__(616),
baseMatchesProperty = __webpack_require__(617),
identity = __webpack_require__(153),
isArray = __webpack_require__(29),
property = __webpack_require__(695);
/**
* 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;
/***/ }),
/* 253 */
/***/ (function(module, exports, __webpack_require__) {
var isArray = __webpack_require__(29),
isKey = __webpack_require__(151),
stringToPath = __webpack_require__(682),
toString = __webpack_require__(700);
/**
* 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;
/***/ }),
/* 254 */
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(44);
var defineProperty = (function() {
try {
var func = getNative(Object, 'defineProperty');
func({}, '', {});
return func;
} catch (e) {}
}());
module.exports = defineProperty;
/***/ }),
/* 255 */
/***/ (function(module, exports, __webpack_require__) {
var SetCache = __webpack_require__(597),
arraySome = __webpack_require__(602),
cacheHas = __webpack_require__(627);
/** 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;
/***/ }),
/* 256 */
/***/ (function(module, exports, __webpack_require__) {
/* 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, __webpack_require__(16)))
/***/ }),
/* 257 */
/***/ (function(module, exports, __webpack_require__) {
var overArg = __webpack_require__(260);
/** Built-in value references. */
var getPrototype = overArg(Object.getPrototypeOf, Object);
module.exports = getPrototype;
/***/ }),
/* 258 */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(30);
/**
* 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;
/***/ }),
/* 259 */
/***/ (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;
/***/ }),
/* 260 */
/***/ (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;
/***/ }),
/* 261 */
/***/ (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;
/***/ }),
/* 262 */
/***/ (function(module, exports, __webpack_require__) {
var arrayLikeKeys = __webpack_require__(245),
baseKeysIn = __webpack_require__(614),
isArrayLike = __webpack_require__(55);
/**
* 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;
/***/ }),
/* 263 */
/***/ (function(module, exports, __webpack_require__) {
var arrayMap = __webpack_require__(246),
baseIteratee = __webpack_require__(252),
baseMap = __webpack_require__(615),
isArray = __webpack_require__(29);
/**
* 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;
/***/ }),
/* 264 */
/***/ (function(module, exports, __webpack_require__) {
var MapCache = __webpack_require__(148);
/** 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;
/***/ }),
/* 265 */
/***/ (function(module, exports, __webpack_require__) {
var lowerCase = __webpack_require__(701)
var NON_WORD_REGEXP = __webpack_require__(707)
var CAMEL_CASE_REGEXP = __webpack_require__(705)
var CAMEL_CASE_UPPER_REGEXP = __webpack_require__(706)
/**
* Sentence case a string.
*
* @param {string} str
* @param {string} locale
* @param {string} replacement
* @return {string}
*/
module.exports = function (str, locale, replacement) {
if (str == null) {
return ''
}
replacement = typeof replacement !== 'string' ? ' ' : replacement
function replace (match, index, value) {
if (index === 0 || index === (value.length - match.length)) {
return ''
}
return replacement
}
str = String(str)
// Support camel case ("camelCase" -> "camel Case").
.replace(CAMEL_CASE_REGEXP, '$1 $2')
// Support odd camel case ("CAMELCase" -> "CAMEL Case").
.replace(CAMEL_CASE_UPPER_REGEXP, '$1 $2')
// Remove all non-word characters and replace with a single space.
.replace(NON_WORD_REGEXP, replace)
// Lower case the entire string.
return lowerCase(str, locale)
}
/***/ }),
/* 266 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {// 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.
// resolves . and .. elements in a path array with directory names there
// must be no slashes, empty elements, or device names (c:\) in the array
// (so also no leading and trailing slashes - it does not distinguish
// relative and absolute paths)
function normalizeArray(parts, allowAboveRoot) {
// if the path tries to go above the root, `up` ends up > 0
var up = 0;
for (var i = parts.length - 1; i >= 0; i--) {
var last = parts[i];
if (last === '.') {
parts.splice(i, 1);
} else if (last === '..') {
parts.splice(i, 1);
up++;
} else if (up) {
parts.splice(i, 1);
up--;
}
}
// if the path is allowed to go above the root, restore leading ..s
if (allowAboveRoot) {
for (; up--; up) {
parts.unshift('..');
}
}
return parts;
}
// Split a filename into [root, dir, basename, ext], unix version
// 'root' is just a slash, or nothing.
var splitPathRe =
/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;
var splitPath = function(filename) {
return splitPathRe.exec(filename).slice(1);
};
// path.resolve([from ...], to)
// posix version
exports.resolve = function() {
var resolvedPath = '',
resolvedAbsolute = false;
for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
var path = (i >= 0) ? arguments[i] : process.cwd();
// Skip empty and invalid entries
if (typeof path !== 'string') {
throw new TypeError('Arguments to path.resolve must be strings');
} else if (!path) {
continue;
}
resolvedPath = path + '/' + resolvedPath;
resolvedAbsolute = path.charAt(0) === '/';
}
// At this point the path should be resolved to a full absolute path, but
// handle relative paths to be safe (might happen when process.cwd() fails)
// Normalize the path
resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {
return !!p;
}), !resolvedAbsolute).join('/');
return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
};
// path.normalize(path)
// posix version
exports.normalize = function(path) {
var isAbsolute = exports.isAbsolute(path),
trailingSlash = substr(path, -1) === '/';
// Normalize the path
path = normalizeArray(filter(path.split('/'), function(p) {
return !!p;
}), !isAbsolute).join('/');
if (!path && !isAbsolute) {
path = '.';
}
if (path && trailingSlash) {
path += '/';
}
return (isAbsolute ? '/' : '') + path;
};
// posix version
exports.isAbsolute = function(path) {
return path.charAt(0) === '/';
};
// posix version
exports.join = function() {
var paths = Array.prototype.slice.call(arguments, 0);
return exports.normalize(filter(paths, function(p, index) {
if (typeof p !== 'string') {
throw new TypeError('Arguments to path.join must be strings');
}
return p;
}).join('/'));
};
// path.relative(from, to)
// posix version
exports.relative = function(from, to) {
from = exports.resolve(from).substr(1);
to = exports.resolve(to).substr(1);
function trim(arr) {
var start = 0;
for (; start < arr.length; start++) {
if (arr[start] !== '') break;
}
var end = arr.length - 1;
for (; end >= 0; end--) {
if (arr[end] !== '') break;
}
if (start > end) return [];
return arr.slice(start, end - start + 1);
}
var fromParts = trim(from.split('/'));
var toParts = trim(to.split('/'));
var length = Math.min(fromParts.length, toParts.length);
var samePartsLength = length;
for (var i = 0; i < length; i++) {
if (fromParts[i] !== toParts[i]) {
samePartsLength = i;
break;
}
}
var outputParts = [];
for (var i = samePartsLength; i < fromParts.length; i++) {
outputParts.push('..');
}
outputParts = outputParts.concat(toParts.slice(samePartsLength));
return outputParts.join('/');
};
exports.sep = '/';
exports.delimiter = ':';
exports.dirname = function(path) {
var result = splitPath(path),
root = result[0],
dir = result[1];
if (!root && !dir) {
// No dirname whatsoever
return '.';
}
if (dir) {
// It has a dirname, strip trailing slash
dir = dir.substr(0, dir.length - 1);
}
return root + dir;
};
exports.basename = function(path, ext) {
var f = splitPath(path)[2];
// TODO: make this comparison case-insensitive on windows?
if (ext && f.substr(-1 * ext.length) === ext) {
f = f.substr(0, f.length - ext.length);
}
return f;
};
exports.extname = function(path) {
return splitPath(path)[3];
};
function filter (xs, f) {
if (xs.filter) return xs.filter(f);
var res = [];
for (var i = 0; i < xs.length; i++) {
if (f(xs[i], i, xs)) res.push(xs[i]);
}
return res;
}
// String.prototype.substr - negative index don't work in IE8
var substr = 'ab'.substr(-1) === 'b'
? function (str, start, len) { return str.substr(start, len) }
: function (str, start, len) {
if (start < 0) start = str.length + start;
return str.substr(start, len);
}
;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(45)))
/***/ }),
/* 267 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*/
// React 15.5 references this module, and assumes PropTypes are still callable in production.
// Therefore we re-export development-only version with all the PropTypes checks here.
// However if one is migrating to the `prop-types` npm library, they will go through the
// `index.js` entry point, and it will branch depending on the environment.
var factory = __webpack_require__(713);
module.exports = function(isValidElement) {
// It is still allowed in 15.5.
var throwOnDirectAccess = false;
return factory(isValidElement, throwOnDirectAccess);
};
/***/ }),
/* 268 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*/
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
module.exports = ReactPropTypesSecret;
/***/ }),
/* 269 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
/**
* 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;
/***/ }),
/* 270 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*
*/
var _prodInvariant = __webpack_require__(7);
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var PooledClass = __webpack_require__(46);
var invariant = __webpack_require__(2);
/**
* 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) ? false ? 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);
/***/ }),
/* 271 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var DOMProperty = __webpack_require__(57);
var ReactDOMComponentTree = __webpack_require__(11);
var ReactInstrumentation = __webpack_require__(25);
var quoteAttributeValueForBrowser = __webpack_require__(777);
var warning = __webpack_require__(5);
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;
false ? 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 (false) {
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 (false) {
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 (false) {
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 (false) {
ReactInstrumentation.debugTool.onHostOperation({
instanceID: ReactDOMComponentTree.getInstanceFromNode(node)._debugID,
type: 'remove attribute',
payload: name
});
}
}
};
module.exports = DOMPropertyOperations;
/***/ }),
/* 272 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var ReactDOMComponentFlags = {
hasCachedChildNodes: 1 << 0
};
module.exports = ReactDOMComponentFlags;
/***/ }),
/* 273 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var _assign = __webpack_require__(9);
var LinkedValueUtils = __webpack_require__(166);
var ReactDOMComponentTree = __webpack_require__(11);
var ReactUpdates = __webpack_require__(31);
var warning = __webpack_require__(5);
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) {
false ? 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) {
false ? 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) {
false ? 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 (false) {
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) {
false ? 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;
/***/ }),
/* 274 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var emptyComponentFactory;
var ReactEmptyComponentInjection = {
injectEmptyComponentFactory: function (factory) {
emptyComponentFactory = factory;
}
};
var ReactEmptyComponent = {
create: function (instantiate) {
return emptyComponentFactory(instantiate);
}
};
ReactEmptyComponent.injection = ReactEmptyComponentInjection;
module.exports = ReactEmptyComponent;
/***/ }),
/* 275 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*
*/
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;
/***/ }),
/* 276 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var _prodInvariant = __webpack_require__(7);
var invariant = __webpack_require__(2);
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 ? false ? 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;
/***/ }),
/* 277 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var ReactDOMSelection = __webpack_require__(737);
var containsNode = __webpack_require__(430);
var focusNode = __webpack_require__(215);
var getActiveElement = __webpack_require__(216);
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;
/***/ }),
/* 278 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var _prodInvariant = __webpack_require__(7);
var DOMLazyTree = __webpack_require__(56);
var DOMProperty = __webpack_require__(57);
var React = __webpack_require__(60);
var ReactBrowserEventEmitter = __webpack_require__(104);
var ReactCurrentOwner = __webpack_require__(33);
var ReactDOMComponentTree = __webpack_require__(11);
var ReactDOMContainerInfo = __webpack_require__(731);
var ReactDOMFeatureFlags = __webpack_require__(733);
var ReactFeatureFlags = __webpack_require__(275);
var ReactInstanceMap = __webpack_require__(75);
var ReactInstrumentation = __webpack_require__(25);
var ReactMarkupChecksum = __webpack_require__(747);
var ReactReconciler = __webpack_require__(58);
var ReactUpdateQueue = __webpack_require__(169);
var ReactUpdates = __webpack_require__(31);
var emptyObject = __webpack_require__(67);
var instantiateReactComponent = __webpack_require__(285);
var invariant = __webpack_require__(2);
var setInnerHTML = __webpack_require__(108);
var shouldUpdateReactComponent = __webpack_require__(175);
var warning = __webpack_require__(5);
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 (false) {
ReactInstrumentation.debugTool.onBeginFlush();
}
ReactReconciler.unmountComponent(instance, safely);
if (false) {
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 (false) {
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.
false ? 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) ? false ? 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)) ? false ? 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) ? false ? 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;
false ? 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 (false) {
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.)
false ? 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) ? false ? invariant(false, 'unmountComponentAtNode(...): Target container is not a DOM element.') : _prodInvariant('40') : void 0;
if (false) {
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 (false) {
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) ? false ? 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 (false) {
// 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) ? false ? 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 (false) {
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) ? false ? 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 (false) {
var hostNode = ReactDOMComponentTree.getInstanceFromNode(container.firstChild);
if (hostNode._debugID !== 0) {
ReactInstrumentation.debugTool.onHostOperation({
instanceID: hostNode._debugID,
type: 'mount',
payload: markup.toString()
});
}
}
}
};
module.exports = ReactMount;
/***/ }),
/* 279 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*
*/
var _prodInvariant = __webpack_require__(7);
var React = __webpack_require__(60);
var invariant = __webpack_require__(2);
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 ? false ? invariant(false, 'Unexpected node: %s', node) : _prodInvariant('26', node) : void 0;
}
};
module.exports = ReactNodeTypes;
/***/ }),
/* 280 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var ViewportMetrics = {
currentScrollLeft: 0,
currentScrollTop: 0,
refreshScrollValues: function (scrollPosition) {
ViewportMetrics.currentScrollLeft = scrollPosition.x;
ViewportMetrics.currentScrollTop = scrollPosition.y;
}
};
module.exports = ViewportMetrics;
/***/ }),
/* 281 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*
*/
var _prodInvariant = __webpack_require__(7);
var invariant = __webpack_require__(2);
/**
* 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) ? false ? 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;
/***/ }),
/* 282 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*
*/
/**
* @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;
/***/ }),
/* 283 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var ReactNodeTypes = __webpack_require__(279);
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;
/***/ }),
/* 284 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var ExecutionEnvironment = __webpack_require__(15);
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;
/***/ }),
/* 285 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var _prodInvariant = __webpack_require__(7),
_assign = __webpack_require__(9);
var ReactCompositeComponent = __webpack_require__(728);
var ReactEmptyComponent = __webpack_require__(274);
var ReactHostComponent = __webpack_require__(276);
var getNextDebugID = __webpack_require__(898);
var invariant = __webpack_require__(2);
var warning = __webpack_require__(5);
// To avoid a cyclic dependency, we create the final class in this module
var ReactCompositeComponentWrapper = function (element) {
this.construct(element);
};
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 (false) {
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 ? false ? 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 ? false ? invariant(false, 'Encountered invalid React node of type %s', typeof node) : _prodInvariant('131', typeof node) : void 0;
}
if (false) {
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 (false) {
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 (false) {
if (Object.preventExtensions) {
Object.preventExtensions(instance);
}
}
return instance;
}
_assign(ReactCompositeComponentWrapper.prototype, ReactCompositeComponent, {
_instantiateReactComponent: instantiateReactComponent
});
module.exports = instantiateReactComponent;
/***/ }),
/* 286 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*
*/
/**
* @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;
/***/ }),
/* 287 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var ExecutionEnvironment = __webpack_require__(15);
var escapeTextContentForBrowser = __webpack_require__(107);
var setInnerHTML = __webpack_require__(108);
/**
* 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;
/***/ }),
/* 288 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var _prodInvariant = __webpack_require__(7);
var ReactCurrentOwner = __webpack_require__(33);
var REACT_ELEMENT_TYPE = __webpack_require__(743);
var getIteratorFn = __webpack_require__(774);
var invariant = __webpack_require__(2);
var KeyEscapeUtils = __webpack_require__(165);
var warning = __webpack_require__(5);
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 (false) {
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 (false) {
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 ? false ? 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;
/***/ }),
/* 289 */
/***/ (function(module, exports, __webpack_require__) {
var React = __webpack_require__(0);
var PropTypes = __webpack_require__(1);
/**
* React component to render collection of items separated by space or other separator.
*/
function Group(props) {
// Accept multiple children, one child or none
var children = props.children ?
(Array.isArray(props.children) ? props.children : [props.children])
: []
;
// Skip falsy children
children = children.filter(function(child) {
return !!child;
});
// Insert separators
var items = children;
var separator = props.separator;
var separatorIsElement = React.isValidElement(separator);
if (children.length > 1) {
items = [children.shift()];
children.forEach(function(item, index) {
if (separatorIsElement) {
var key = 'separator-' + (item.key || index);
separator = React.cloneElement(separator, { key: key });
}
return items.push(separator, item);
});
}
return React.createElement(props.inline ? 'span' : 'div', { className: props.className }, items);
};
Group.propTypes = {
/** Items. */
children: PropTypes.node,
/** Wrap in `<span>` instead of `<div>`. */
inline: PropTypes.bool,
/** Custom separator (space by default). */
separator: PropTypes.node,
/** Custom class name. */
className: PropTypes.string,
};
Group.defaultProps = {
separator: ' ',
};
module.exports = Group;
/***/ }),
/* 290 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = connectAdvanced;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_hoist_non_react_statics__ = __webpack_require__(129);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_hoist_non_react_statics___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_hoist_non_react_statics__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_invariant__ = __webpack_require__(23);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_invariant___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_invariant__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__utils_Subscription__ = __webpack_require__(786);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__utils_PropTypes__ = __webpack_require__(292);
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
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;
var dummyState = {};
function noop() {}
function makeSelectorStateful(sourceSelector, store) {
// wrap the selector in an object that tracks its results between runs.
var selector = {
run: function runComponentSelector(props) {
try {
var nextProps = sourceSelector(store.getState(), props);
if (nextProps !== selector.props || selector.error) {
selector.shouldComponentUpdate = true;
selector.props = nextProps;
selector.error = null;
}
} catch (error) {
selector.shouldComponentUpdate = true;
selector.error = error;
}
}
};
return selector;
}
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] = __WEBPACK_IMPORTED_MODULE_4__utils_PropTypes__["a" /* storeShape */], _contextTypes[subscriptionKey] = __WEBPACK_IMPORTED_MODULE_4__utils_PropTypes__["b" /* subscriptionShape */], _contextTypes);
var childContextTypes = (_childContextTypes = {}, _childContextTypes[subscriptionKey] = __WEBPACK_IMPORTED_MODULE_4__utils_PropTypes__["b" /* subscriptionShape */], _childContextTypes);
return function wrapWithConnect(WrappedComponent) {
__WEBPACK_IMPORTED_MODULE_1_invariant___default()(typeof WrappedComponent == 'function', 'You must pass a component to the function returned by ' + ('connect. Instead received ' + JSON.stringify(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 = props[storeKey] || context[storeKey];
_this.propsMode = Boolean(props[storeKey]);
_this.setWrappedInstance = _this.setWrappedInstance.bind(_this);
__WEBPACK_IMPORTED_MODULE_1_invariant___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 + '".'));
_this.initSelector();
_this.initSubscription();
return _this;
}
Connect.prototype.getChildContext = function getChildContext() {
var _ref2;
// If this component received store from props, its subscription should be transparent
// to any descendants receiving store+subscription from context; it passes along
// subscription passed to it. Otherwise, it shadows the parent subscription, which allows
// Connect to control ordering of notifications to flow top-down.
var subscription = this.propsMode ? null : this.subscription;
return _ref2 = {}, _ref2[subscriptionKey] = subscription || this.context[subscriptionKey], _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();
this.subscription = null;
this.notifyNestedSubs = noop;
this.store = null;
this.selector.run = noop;
this.selector.shouldComponentUpdate = false;
};
Connect.prototype.getWrappedInstance = function getWrappedInstance() {
__WEBPACK_IMPORTED_MODULE_1_invariant___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 sourceSelector = selectorFactory(this.store.dispatch, selectorFactoryOptions);
this.selector = makeSelectorStateful(sourceSelector, this.store);
this.selector.run(this.props);
};
Connect.prototype.initSubscription = function initSubscription() {
if (!shouldHandleStateChanges) return;
// parentSub's source should match where store came from: props vs. context. A component
// connected to the store via props shouldn't use subscription from context, or vice versa.
var parentSub = (this.propsMode ? this.props : this.context)[subscriptionKey];
this.subscription = new __WEBPACK_IMPORTED_MODULE_3__utils_Subscription__["a" /* default */](this.store, parentSub, this.onStateChange.bind(this));
// `notifyNestedSubs` is duplicated to handle the case where the component is unmounted in
// the middle of the notification loop, where `this.subscription` will then be null. An
// extra null check every change can be avoided by copying the method onto `this` and then
// replacing it with a no-op on unmount. This can probably be avoided if Subscription's
// listeners logic is changed to not call listeners that have been unsubscribed in the
// middle of the notification loop.
this.notifyNestedSubs = this.subscription.notifyNestedSubs.bind(this.subscription);
};
Connect.prototype.onStateChange = function onStateChange() {
this.selector.run(this.props);
if (!this.selector.shouldComponentUpdate) {
this.notifyNestedSubs();
} else {
this.componentDidUpdate = this.notifyNestedSubsOnComponentDidUpdate;
this.setState(dummyState);
}
};
Connect.prototype.notifyNestedSubsOnComponentDidUpdate = function notifyNestedSubsOnComponentDidUpdate() {
// `componentDidUpdate` is conditionally implemented when `onStateChange` determines it
// needs to notify nested subs. Once called, it unimplements itself until further state
// changes occur. Doing it this way vs having a permanent `componentDidMount` that does
// a boolean check every time avoids an extra method call most of the time, resulting
// in some perf boost.
this.componentDidUpdate = undefined;
this.notifyNestedSubs();
};
Connect.prototype.isSubscribed = function isSubscribed() {
return Boolean(this.subscription) && this.subscription.isSubscribed();
};
Connect.prototype.addExtraProps = function addExtraProps(props) {
if (!withRef && !renderCountProp && !(this.propsMode && this.subscription)) 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++;
if (this.propsMode && this.subscription) withExtras[subscriptionKey] = this.subscription;
return withExtras;
};
Connect.prototype.render = function render() {
var selector = this.selector;
selector.shouldComponentUpdate = false;
if (selector.error) {
throw selector.error;
} else {
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2_react__["createElement"])(WrappedComponent, this.addExtraProps(selector.props));
}
};
return Connect;
}(__WEBPACK_IMPORTED_MODULE_2_react__["Component"]);
Connect.WrappedComponent = WrappedComponent;
Connect.displayName = displayName;
Connect.childContextTypes = childContextTypes;
Connect.contextTypes = contextTypes;
Connect.propTypes = contextTypes;
if (false) {
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 __WEBPACK_IMPORTED_MODULE_0_hoist_non_react_statics___default()(Connect, WrappedComponent);
};
}
/***/ }),
/* 291 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (immutable) */ __webpack_exports__["b"] = wrapMapToPropsConstant;
/* unused harmony export getDependsOnOwnProps */
/* harmony export (immutable) */ __webpack_exports__["a"] = wrapMapToPropsFunc;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils_verifyPlainObject__ = __webpack_require__(293);
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);
};
// allow detectFactoryAndVerify to get ownProps
proxy.dependsOnOwnProps = true;
proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {
proxy.mapToProps = mapToProps;
proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);
var props = proxy(stateOrDispatch, ownProps);
if (typeof props === 'function') {
proxy.mapToProps = props;
proxy.dependsOnOwnProps = getDependsOnOwnProps(props);
props = proxy(stateOrDispatch, ownProps);
}
if (false) verifyPlainObject(props, displayName, methodName);
return props;
};
return proxy;
};
}
/***/ }),
/* 292 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return subscriptionShape; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return storeShape; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_prop_types__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_prop_types__);
var subscriptionShape = __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.shape({
trySubscribe: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.func.isRequired,
tryUnsubscribe: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.func.isRequired,
notifyNestedSubs: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.func.isRequired,
isSubscribed: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.func.isRequired
});
var storeShape = __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.shape({
subscribe: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.func.isRequired,
dispatch: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.func.isRequired,
getState: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.func.isRequired
});
/***/ }),
/* 293 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* unused harmony export default */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_es_isPlainObject__ = __webpack_require__(93);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__warning__ = __webpack_require__(177);
function verifyPlainObject(value, displayName, methodName) {
if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_lodash_es_isPlainObject__["a" /* default */])(value)) {
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__warning__["a" /* default */])(methodName + '() in ' + displayName + ' must return a plain object. Instead received ' + value + '.');
}
}
/***/ }),
/* 294 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__);
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var isModifiedEvent = function isModifiedEvent(event) {
return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);
};
/**
* The public API for rendering a history-aware <a>.
*/
var Link = function (_React$Component) {
_inherits(Link, _React$Component);
function Link() {
var _temp, _this, _ret;
_classCallCheck(this, Link);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.handleClick = function (event) {
if (_this.props.onClick) _this.props.onClick(event);
if (!event.defaultPrevented && // onClick prevented default
event.button === 0 && // ignore right clicks
!_this.props.target && // let browser handle "target=_blank" etc.
!isModifiedEvent(event) // ignore clicks with modifier keys
) {
event.preventDefault();
var history = _this.context.router.history;
var _this$props = _this.props,
replace = _this$props.replace,
to = _this$props.to;
if (replace) {
history.replace(to);
} else {
history.push(to);
}
}
}, _temp), _possibleConstructorReturn(_this, _ret);
}
Link.prototype.render = function render() {
var _props = this.props,
replace = _props.replace,
to = _props.to,
props = _objectWithoutProperties(_props, ['replace', 'to']); // eslint-disable-line no-unused-vars
var href = this.context.router.history.createHref(typeof to === 'string' ? { pathname: to } : to);
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement('a', _extends({}, props, { onClick: this.handleClick, href: href }));
};
return Link;
}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component);
Link.propTypes = {
onClick: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func,
target: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string,
replace: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool,
to: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object]).isRequired
};
Link.defaultProps = {
replace: false
};
Link.contextTypes = {
router: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({
history: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({
push: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired,
replace: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired,
createHref: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired
}).isRequired
}).isRequired
};
/* harmony default export */ __webpack_exports__["a"] = (Link);
/***/ }),
/* 295 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__BrowserRouter__ = __webpack_require__(788);
/* unused harmony reexport BrowserRouter */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__HashRouter__ = __webpack_require__(789);
/* unused harmony reexport HashRouter */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Link__ = __webpack_require__(294);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_2__Link__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__MemoryRouter__ = __webpack_require__(790);
/* unused harmony reexport MemoryRouter */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__NavLink__ = __webpack_require__(791);
/* unused harmony reexport NavLink */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__Prompt__ = __webpack_require__(792);
/* unused harmony reexport Prompt */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__Redirect__ = __webpack_require__(793);
/* unused harmony reexport Redirect */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__Route__ = __webpack_require__(794);
/* unused harmony reexport Route */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__Router__ = __webpack_require__(795);
/* unused harmony reexport Router */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__StaticRouter__ = __webpack_require__(796);
/* unused harmony reexport StaticRouter */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__Switch__ = __webpack_require__(797);
/* unused harmony reexport Switch */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__matchPath__ = __webpack_require__(798);
/* unused harmony reexport matchPath */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__withRouter__ = __webpack_require__(799);
/* unused harmony reexport withRouter */
/***/ }),
/* 296 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_warning__ = __webpack_require__(22);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_warning___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_warning__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_prop_types__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_prop_types__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__matchPath__ = __webpack_require__(179);
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
/**
* The public API for matching a single path and rendering.
*/
var Route = function (_React$Component) {
_inherits(Route, _React$Component);
function Route() {
var _temp, _this, _ret;
_classCallCheck(this, Route);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = {
match: _this.computeMatch(_this.props, _this.context.router)
}, _temp), _possibleConstructorReturn(_this, _ret);
}
Route.prototype.getChildContext = function getChildContext() {
return {
router: _extends({}, this.context.router, {
route: {
location: this.props.location || this.context.router.route.location,
match: this.state.match
}
})
};
};
Route.prototype.computeMatch = function computeMatch(_ref, _ref2) {
var computedMatch = _ref.computedMatch,
location = _ref.location,
path = _ref.path,
strict = _ref.strict,
exact = _ref.exact;
var route = _ref2.route;
if (computedMatch) return computedMatch; // <Switch> already computed the match for us
var pathname = (location || route.location).pathname;
return path ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__matchPath__["a" /* default */])(pathname, { path: path, strict: strict, exact: exact }) : route.match;
};
Route.prototype.componentWillMount = function componentWillMount() {
var _props = this.props,
component = _props.component,
render = _props.render,
children = _props.children;
__WEBPACK_IMPORTED_MODULE_0_warning___default()(!(component && render), 'You should not use <Route component> and <Route render> in the same route; <Route render> will be ignored');
__WEBPACK_IMPORTED_MODULE_0_warning___default()(!(component && children), 'You should not use <Route component> and <Route children> in the same route; <Route children> will be ignored');
__WEBPACK_IMPORTED_MODULE_0_warning___default()(!(render && children), 'You should not use <Route render> and <Route children> in the same route; <Route children> will be ignored');
};
Route.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps, nextContext) {
__WEBPACK_IMPORTED_MODULE_0_warning___default()(!(nextProps.location && !this.props.location), '<Route> elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.');
__WEBPACK_IMPORTED_MODULE_0_warning___default()(!(!nextProps.location && this.props.location), '<Route> elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.');
this.setState({
match: this.computeMatch(nextProps, nextContext.router)
});
};
Route.prototype.render = function render() {
var match = this.state.match;
var _props2 = this.props,
children = _props2.children,
component = _props2.component,
render = _props2.render;
var _context$router = this.context.router,
history = _context$router.history,
route = _context$router.route,
staticContext = _context$router.staticContext;
var location = this.props.location || route.location;
var props = { match: match, location: location, history: history, staticContext: staticContext };
return component ? // component prop gets first priority, only called if there's a match
match ? __WEBPACK_IMPORTED_MODULE_1_react___default.a.createElement(component, props) : null : render ? // render prop is next, only called if there's a match
match ? render(props) : null : children ? // children come last, always called
typeof children === 'function' ? children(props) : !Array.isArray(children) || children.length ? // Preact defaults to empty children array
__WEBPACK_IMPORTED_MODULE_1_react___default.a.Children.only(children) : null : null;
};
return Route;
}(__WEBPACK_IMPORTED_MODULE_1_react___default.a.Component);
Route.propTypes = {
computedMatch: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.object, // private, from <Switch>
path: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.string,
exact: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.bool,
strict: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.bool,
component: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.func,
render: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.func,
children: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.node]),
location: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.object
};
Route.contextTypes = {
router: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.shape({
history: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.object.isRequired,
route: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.object.isRequired,
staticContext: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.object
})
};
Route.childContextTypes = {
router: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.object.isRequired
};
/* harmony default export */ __webpack_exports__["a"] = (Route);
/***/ }),
/* 297 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _ArgumentRenderer = __webpack_require__(806);
Object.defineProperty(exports, 'default', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_ArgumentRenderer).default;
}
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/***/ }),
/* 298 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _ArgumentsRenderer = __webpack_require__(807);
Object.defineProperty(exports, 'default', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_ArgumentsRenderer).default;
}
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/***/ }),
/* 299 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _Examples = __webpack_require__(817);
Object.defineProperty(exports, 'default', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Examples).default;
}
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/***/ }),
/* 300 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _HeadingRenderer = __webpack_require__(819);
Object.defineProperty(exports, 'default', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_HeadingRenderer).default;
}
});
Object.defineProperty(exports, 'styles', {
enumerable: true,
get: function get() {
return _HeadingRenderer.styles;
}
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/***/ }),
/* 301 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _Sections = __webpack_require__(844);
Object.defineProperty(exports, 'default', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Sections).default;
}
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/***/ }),
/* 302 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
/* eslint-disable */
/**
* List of non-inheritable properties.
*
* Borrowed from https://github.com/suitcss/preprocessor/blob/master/lib/encapsulation.js
*/
exports.default = {
'animation': 'none 0s ease 0s 1 normal none running',
'backface-visibility': 'visible',
'background': 'transparent none repeat 0 0 / auto auto padding-box border-box scroll',
'border': 'medium none currentColor',
'border-image': 'none',
'border-radius': '0',
'bottom': 'auto',
'box-shadow': 'none',
'clear': 'none',
'clip': 'auto',
'columns': 'auto',
'column-count': 'auto',
'column-fill': 'balance',
'column-gap': 'normal',
'column-rule': 'medium none currentColor',
'column-span': '1',
'column-width': 'auto',
'content': 'normal',
'counter-increment': 'none',
'counter-reset': 'none',
'float': 'none',
'height': 'auto',
'hyphens': 'none',
'left': 'auto',
'margin': '0',
'max-height': 'none',
'max-width': 'none',
'min-height': '0',
'min-width': '0',
'opacity': '1',
'outline': 'medium none invert',
'overflow': 'visible',
'overflow-x': 'visible',
'overflow-y': 'visible',
'padding': '0',
'page-break-after': 'auto',
'page-break-before': 'auto',
'page-break-inside': 'auto',
'perspective': 'none',
'perspective-origin': '50% 50%',
'position': 'static',
'right': 'auto',
'table-layout': 'auto',
'text-decoration': 'none',
'top': 'auto',
'transform': 'none',
'transform-origin': '50% 50% 0',
'transform-style': 'flat',
'transition': 'none 0s ease 0s',
'unicode-bidi': 'normal',
'vertical-align': 'baseline',
'width': 'auto',
'z-index': 'auto'
};
/***/ }),
/* 303 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(global) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.slugger = undefined;
exports.setSlugs = setSlugs;
exports.globalizeComponent = globalizeComponent;
exports.processComponents = processComponents;
exports.processSections = processSections;
exports.getFilterRegExp = getFilterRegExp;
exports.filterComponentsByName = filterComponentsByName;
exports.filterSectionsByName = filterSectionsByName;
exports.filterComponentsByExactName = filterComponentsByExactName;
exports.filterComponentsInSectionsByExactName = filterComponentsInSectionsByExactName;
exports.getComponentNameFromHash = getComponentNameFromHash;
exports.filterComponentExamples = filterComponentExamples;
var _isNaN = __webpack_require__(688);
var _isNaN2 = _interopRequireDefault(_isNaN);
var _githubSlugger = __webpack_require__(458);
var _githubSlugger2 = _interopRequireDefault(_githubSlugger);
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); } }
// Export the singleton instance of GithubSlugger
var slugger = exports.slugger = new _githubSlugger2.default();
function setSlugs(sections) {
return sections.map(function (section) {
var name = section.name,
components = section.components,
sections = section.sections;
if (name) {
section.slug = slugger.slug(section.name);
}
if (components && components.length) {
section.components = setSlugs(components);
}
if (sections && sections.length) {
section.sections = setSlugs(sections);
}
return section;
});
}
/**
* Expose component as global variables.
*
* @param {Object} component
*/
function globalizeComponent(component) {
if (!component.name) {
return;
}
global[component.name] = !component.props.path || component.props.path === 'default' ? component.module.default || component.module : component.module[component.props.path];
}
/**
* Do things that are hard or impossible to do in a loader.
*
* @param {Array} components
* @return {Array}
*/
function processComponents(components) {
return components.map(function (component) {
// Add .name shortcuts for names instead of .props.displayName.
component.name = component.props.displayName;
// Append @example doclet to all examples
if (component.props.example) {
component.props.examples = [].concat(_toConsumableArray(component.props.examples), _toConsumableArray(component.props.example));
delete component.props.example;
}
globalizeComponent(component);
return component;
});
}
/**
* Recursively process each component in all sections.
*
* @param {Array} sections
* @return {Array}
*/
function processSections(sections) {
return sections.map(function (section) {
section.components = processComponents(section.components || []);
section.sections = processSections(section.sections || []);
return section;
});
}
/**
* Fuzzy filters components list by component name.
*
* @param {string} query
* @return {RegExp}
*/
function getFilterRegExp(query) {
query = query.replace(/[^a-z0-9]/gi, '').split('').join('.*');
return new RegExp(query, 'i');
}
/**
* Fuzzy filters components list by component name.
*
* @param {array} components
* @param {string} query
* @return {array}
*/
function filterComponentsByName(components, query) {
var regExp = getFilterRegExp(query);
return components.filter(function (_ref) {
var name = _ref.name;
return regExp.test(name);
});
}
/**
* Fuzzy filters sections by section or component name.
*
* @param {Array} sections
* @param {string} query
* @return {Array}
*/
function filterSectionsByName(sections, query) {
var regExp = getFilterRegExp(query);
return sections.map(function (section) {
return Object.assign({}, section, {
sections: section.sections ? filterSectionsByName(section.sections, query) : [],
components: section.components ? filterComponentsByName(section.components, query) : []
});
}).filter(function (section) {
return section.components.length > 0 || section.sections.length > 0 || regExp.test(section.name);
});
}
/**
* Filters list of components by component name.
*
* @param {Array} components
* @param {string} name
* @return {Array}
*/
function filterComponentsByExactName(components, name) {
return components.filter(function (component) {
return component.name === name;
});
}
/**
* Recursively filters all components in all sections by component name.
*
* @param {object} sections
* @param {string} name
* @return {Array}
*/
function filterComponentsInSectionsByExactName(sections, name) {
var components = [];
sections.forEach(function (section) {
if (section.components) {
components.push.apply(components, _toConsumableArray(filterComponentsByExactName(section.components, name)));
}
if (section.sections) {
components.push.apply(components, _toConsumableArray(filterComponentsInSectionsByExactName(section.sections, name)));
}
});
return components;
}
/**
* Returns an object containing component name and, optionally, an example index
* from hash part or page URL:
* http://localhost:6060/#!/Button → { targetComponentName: 'Button' }
* http://localhost:6060/#!/Button/1 → { targetComponentName: 'Button', targetComponentIndex: 1 }
*
* @param {string} [hash]
* @returns {object}
*/
function getComponentNameFromHash() {
var hash = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window.location.hash;
if (hash.substr(0, 3) === '#!/') {
var tokens = hash.substr(3).split('/');
var index = parseInt(tokens[1], 10);
return {
targetComponentName: tokens[0],
targetComponentIndex: (0, _isNaN2.default)(index) ? null : index
};
}
return {};
}
/**
* Return a shallow copy of the given component with the examples array filtered
* to contain only the specified index:
* filterComponentExamples({ examples: [1,2,3], ...other }, 2) → { examples: [3], ...other }
*
* @param {object} component
* @param {number} index
* @returns {object}
*/
function filterComponentExamples(component, index) {
var newComponent = Object.assign({}, component);
newComponent.props.examples = [component.props.examples[index]];
return newComponent;
}
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(16)))
/***/ }),
/* 304 */
/***/ (function(module, exports, __webpack_require__) {
if (false) {
module.hot.accept([])
}
var requireMap = {
'./ul': __webpack_require__(208),
'./li': __webpack_require__(207),
'react': __webpack_require__(0)
};
var requireInRuntimeBase = __webpack_require__(21);
var requireInRuntime = requireInRuntimeBase.bind(null, requireMap);
var evalInContextBase = __webpack_require__(20);
var evalInContext = evalInContextBase.bind(null, "var React = require('react');", requireInRuntime);
module.exports = [{
'type': 'code',
'content': 'const Ul = require(\'./ul\').default;\nconst Li = require(\'./li\').default;\n\n<Ul>\n <Li>\n <a className=\'active\' href=\'#ul\'>\n <span>\n Ul\n </span>\n </a>\n </Li>\n <Li>\n <a href=\'#ul\'>\n <span>\n Ul\n </span>\n </a>\n </Li>\n <Li>\n <a href=\'#li\'>\n <span>\n Li\n </span>\n </a>\n </Li>\n</Ul>',
'evalInContext': evalInContext
}]
/***/ }),
/* 305 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
module.exports = {
HOMEPAGE: 'https://github.com/styleguidist/react-styleguidist',
BUGS: 'https://github.com/styleguidist/react-styleguidist/issues',
DOCS_CONFIG: 'https://github.com/styleguidist/react-styleguidist/blob/master/docs/Configuration.md',
DOCS_COMPONENTS: 'https://github.com/styleguidist/react-styleguidist/blob/master/docs/Components.md',
DOCS_WEBPACK: 'https://github.com/styleguidist/react-styleguidist/blob/master/docs/Webpack.md',
DOCS_DOCUMENTING: 'https://github.com/styleguidist/react-styleguidist/blob/master/docs/Documenting.md',
};
/***/ }),
/* 306 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*
*/
var _prodInvariant = __webpack_require__(62);
var ReactCurrentOwner = __webpack_require__(33);
var invariant = __webpack_require__(2);
var warning = __webpack_require__(5);
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);
}
false ? 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 ? false ? 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 ? false ? 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) ? false ? invariant(false, 'Expected onSetChildren() to fire for a container child before its parent includes it in onSetChildren().') : _prodInvariant('141') : void 0;
!nextChild.isMounted ? false ? 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) ? false ? 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 ? false ? 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;
/***/ }),
/* 307 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*
*/
// 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;
/***/ }),
/* 308 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*
*/
var canDefineProperty = false;
if (false) {
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;
/***/ }),
/* 309 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_es6_error__ = __webpack_require__(425);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_es6_error___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_es6_error__);
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 SubmissionError = function (_ExtendableError) {
_inherits(SubmissionError, _ExtendableError);
function SubmissionError(errors) {
_classCallCheck(this, SubmissionError);
var _this = _possibleConstructorReturn(this, (SubmissionError.__proto__ || Object.getPrototypeOf(SubmissionError)).call(this, 'Submit Validation Failed'));
_this.errors = errors;
return _this;
}
return SubmissionError;
}(__WEBPACK_IMPORTED_MODULE_0_es6_error___default.a);
/* harmony default export */ __webpack_exports__["a"] = (SubmissionError);
/***/ }),
/* 310 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "arrayInsert", function() { return arrayInsert; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "arrayMove", function() { return arrayMove; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "arrayPop", function() { return arrayPop; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "arrayPush", function() { return arrayPush; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "arrayRemove", function() { return arrayRemove; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "arrayRemoveAll", function() { return arrayRemoveAll; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "arrayShift", function() { return arrayShift; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "arraySplice", function() { return arraySplice; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "arraySwap", function() { return arraySwap; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "arrayUnshift", function() { return arrayUnshift; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "autofill", function() { return autofill; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "blur", function() { return blur; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "change", function() { return change; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clearSubmit", function() { return clearSubmit; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clearSubmitErrors", function() { return clearSubmitErrors; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clearAsyncError", function() { return clearAsyncError; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "destroy", function() { return destroy; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "focus", function() { return focus; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "initialize", function() { return initialize; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerField", function() { return registerField; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "reset", function() { return reset; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "startAsyncValidation", function() { return startAsyncValidation; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "startSubmit", function() { return startSubmit; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stopAsyncValidation", function() { return stopAsyncValidation; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stopSubmit", function() { return stopSubmit; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "submit", function() { return submit; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setSubmitFailed", function() { return setSubmitFailed; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setSubmitSucceeded", function() { return setSubmitSucceeded; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "touch", function() { return touch; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "unregisterField", function() { return unregisterField; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "untouch", function() { return untouch; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "updateSyncErrors", function() { return updateSyncErrors; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "updateSyncWarnings", function() { return updateSyncWarnings; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__actionTypes__ = __webpack_require__(185);
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 arrayInsert = function arrayInsert(form, field, index, value) {
return {
type: __WEBPACK_IMPORTED_MODULE_0__actionTypes__["ARRAY_INSERT"],
meta: { form: form, field: field, index: index },
payload: value
};
};
var arrayMove = function arrayMove(form, field, from, to) {
return {
type: __WEBPACK_IMPORTED_MODULE_0__actionTypes__["ARRAY_MOVE"],
meta: { form: form, field: field, from: from, to: to }
};
};
var arrayPop = function arrayPop(form, field) {
return {
type: __WEBPACK_IMPORTED_MODULE_0__actionTypes__["ARRAY_POP"],
meta: { form: form, field: field }
};
};
var arrayPush = function arrayPush(form, field, value) {
return {
type: __WEBPACK_IMPORTED_MODULE_0__actionTypes__["ARRAY_PUSH"],
meta: { form: form, field: field },
payload: value
};
};
var arrayRemove = function arrayRemove(form, field, index) {
return {
type: __WEBPACK_IMPORTED_MODULE_0__actionTypes__["ARRAY_REMOVE"],
meta: { form: form, field: field, index: index }
};
};
var arrayRemoveAll = function arrayRemoveAll(form, field) {
return {
type: __WEBPACK_IMPORTED_MODULE_0__actionTypes__["ARRAY_REMOVE_ALL"],
meta: { form: form, field: field }
};
};
var arrayShift = function arrayShift(form, field) {
return {
type: __WEBPACK_IMPORTED_MODULE_0__actionTypes__["ARRAY_SHIFT"],
meta: { form: form, field: field }
};
};
var arraySplice = function arraySplice(form, field, index, removeNum, value) {
var action = {
type: __WEBPACK_IMPORTED_MODULE_0__actionTypes__["ARRAY_SPLICE"],
meta: { form: form, field: field, index: index, removeNum: removeNum }
};
if (value !== undefined) {
action.payload = value;
}
return action;
};
var arraySwap = function arraySwap(form, field, indexA, indexB) {
if (indexA === indexB) {
throw new Error('Swap indices cannot be equal');
}
if (indexA < 0 || indexB < 0) {
throw new Error('Swap indices cannot be negative');
}
return { type: __WEBPACK_IMPORTED_MODULE_0__actionTypes__["ARRAY_SWAP"], meta: { form: form, field: field, indexA: indexA, indexB: indexB } };
};
var arrayUnshift = function arrayUnshift(form, field, value) {
return {
type: __WEBPACK_IMPORTED_MODULE_0__actionTypes__["ARRAY_UNSHIFT"],
meta: { form: form, field: field },
payload: value
};
};
var autofill = function autofill(form, field, value) {
return {
type: __WEBPACK_IMPORTED_MODULE_0__actionTypes__["AUTOFILL"],
meta: { form: form, field: field },
payload: value
};
};
var blur = function blur(form, field, value, touch) {
return {
type: __WEBPACK_IMPORTED_MODULE_0__actionTypes__["BLUR"],
meta: { form: form, field: field, touch: touch },
payload: value
};
};
var change = function change(form, field, value, touch, persistentSubmitErrors) {
return {
type: __WEBPACK_IMPORTED_MODULE_0__actionTypes__["CHANGE"],
meta: { form: form, field: field, touch: touch, persistentSubmitErrors: persistentSubmitErrors },
payload: value
};
};
var clearSubmit = function clearSubmit(form) {
return { type: __WEBPACK_IMPORTED_MODULE_0__actionTypes__["CLEAR_SUBMIT"], meta: { form: form } };
};
var clearSubmitErrors = function clearSubmitErrors(form) {
return {
type: __WEBPACK_IMPORTED_MODULE_0__actionTypes__["CLEAR_SUBMIT_ERRORS"],
meta: { form: form }
};
};
var clearAsyncError = function clearAsyncError(form, field) {
return {
type: __WEBPACK_IMPORTED_MODULE_0__actionTypes__["CLEAR_ASYNC_ERROR"],
meta: { form: form, field: field }
};
};
var destroy = function destroy() {
for (var _len = arguments.length, form = Array(_len), _key = 0; _key < _len; _key++) {
form[_key] = arguments[_key];
}
return { type: __WEBPACK_IMPORTED_MODULE_0__actionTypes__["DESTROY"], meta: { form: form } };
};
var focus = function focus(form, field) {
return { type: __WEBPACK_IMPORTED_MODULE_0__actionTypes__["FOCUS"], meta: { form: form, field: field } };
};
var initialize = function initialize(form, values, keepDirty) {
var otherMeta = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
if (keepDirty instanceof Object) {
otherMeta = keepDirty;
keepDirty = false;
}
return {
type: __WEBPACK_IMPORTED_MODULE_0__actionTypes__["INITIALIZE"],
meta: _extends({ form: form, keepDirty: keepDirty }, otherMeta),
payload: values
};
};
var registerField = function registerField(form, name, type) {
return {
type: __WEBPACK_IMPORTED_MODULE_0__actionTypes__["REGISTER_FIELD"],
meta: { form: form },
payload: { name: name, type: type }
};
};
var reset = function reset(form) {
return { type: __WEBPACK_IMPORTED_MODULE_0__actionTypes__["RESET"], meta: { form: form } };
};
var startAsyncValidation = function startAsyncValidation(form, field) {
return {
type: __WEBPACK_IMPORTED_MODULE_0__actionTypes__["START_ASYNC_VALIDATION"],
meta: { form: form, field: field }
};
};
var startSubmit = function startSubmit(form) {
return { type: __WEBPACK_IMPORTED_MODULE_0__actionTypes__["START_SUBMIT"], meta: { form: form } };
};
var stopAsyncValidation = function stopAsyncValidation(form, errors) {
var action = {
type: __WEBPACK_IMPORTED_MODULE_0__actionTypes__["STOP_ASYNC_VALIDATION"],
meta: { form: form },
payload: errors
};
if (errors && Object.keys(errors).length) {
action.error = true;
}
return action;
};
var stopSubmit = function stopSubmit(form, errors) {
var action = {
type: __WEBPACK_IMPORTED_MODULE_0__actionTypes__["STOP_SUBMIT"],
meta: { form: form },
payload: errors
};
if (errors && Object.keys(errors).length) {
action.error = true;
}
return action;
};
var submit = function submit(form) {
return { type: __WEBPACK_IMPORTED_MODULE_0__actionTypes__["SUBMIT"], meta: { form: form } };
};
var setSubmitFailed = function setSubmitFailed(form) {
for (var _len2 = arguments.length, fields = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
fields[_key2 - 1] = arguments[_key2];
}
return {
type: __WEBPACK_IMPORTED_MODULE_0__actionTypes__["SET_SUBMIT_FAILED"],
meta: { form: form, fields: fields },
error: true
};
};
var setSubmitSucceeded = function setSubmitSucceeded(form) {
for (var _len3 = arguments.length, fields = Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
fields[_key3 - 1] = arguments[_key3];
}
return {
type: __WEBPACK_IMPORTED_MODULE_0__actionTypes__["SET_SUBMIT_SUCCEEDED"],
meta: { form: form, fields: fields },
error: false
};
};
var touch = function touch(form) {
for (var _len4 = arguments.length, fields = Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
fields[_key4 - 1] = arguments[_key4];
}
return {
type: __WEBPACK_IMPORTED_MODULE_0__actionTypes__["TOUCH"],
meta: { form: form, fields: fields }
};
};
var unregisterField = function unregisterField(form, name) {
var destroyOnUnmount = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
return {
type: __WEBPACK_IMPORTED_MODULE_0__actionTypes__["UNREGISTER_FIELD"],
meta: { form: form },
payload: { name: name, destroyOnUnmount: destroyOnUnmount }
};
};
var untouch = function untouch(form) {
for (var _len5 = arguments.length, fields = Array(_len5 > 1 ? _len5 - 1 : 0), _key5 = 1; _key5 < _len5; _key5++) {
fields[_key5 - 1] = arguments[_key5];
}
return {
type: __WEBPACK_IMPORTED_MODULE_0__actionTypes__["UNTOUCH"],
meta: { form: form, fields: fields }
};
};
var updateSyncErrors = function updateSyncErrors(form) {
var syncErrors = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var error = arguments[2];
return {
type: __WEBPACK_IMPORTED_MODULE_0__actionTypes__["UPDATE_SYNC_ERRORS"],
meta: { form: form },
payload: { syncErrors: syncErrors, error: error }
};
};
var updateSyncWarnings = function updateSyncWarnings(form) {
var syncWarnings = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var warning = arguments[2];
return {
type: __WEBPACK_IMPORTED_MODULE_0__actionTypes__["UPDATE_SYNC_WARNINGS"],
meta: { form: form },
payload: { syncWarnings: syncWarnings, warning: warning }
};
};
/***/ }),
/* 311 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
var processProps = function processProps(type, props, _value) {
var value = props.value;
if (type === 'checkbox') {
return _extends({}, props, {
checked: !!value
});
}
if (type === 'radio') {
return _extends({}, props, {
checked: value === _value,
value: _value
});
}
if (type === 'select-multiple') {
return _extends({}, props, {
value: value || []
});
}
if (type === 'file') {
return _extends({}, props, {
value: value || undefined
});
}
return props;
};
var createFieldProps = function createFieldProps(_ref2, name, _ref) {
var getIn = _ref2.getIn,
toJS = _ref2.toJS;
var asyncError = _ref.asyncError,
asyncValidating = _ref.asyncValidating,
onBlur = _ref.onBlur,
onChange = _ref.onChange,
onDrop = _ref.onDrop,
onDragStart = _ref.onDragStart,
dirty = _ref.dirty,
dispatch = _ref.dispatch,
onFocus = _ref.onFocus,
form = _ref.form,
format = _ref.format,
initial = _ref.initial,
parse = _ref.parse,
pristine = _ref.pristine,
props = _ref.props,
state = _ref.state,
submitError = _ref.submitError,
submitFailed = _ref.submitFailed,
submitting = _ref.submitting,
syncError = _ref.syncError,
syncWarning = _ref.syncWarning,
validate = _ref.validate,
value = _ref.value,
_value = _ref._value,
warn = _ref.warn,
custom = _objectWithoutProperties(_ref, ['asyncError', 'asyncValidating', 'onBlur', 'onChange', 'onDrop', 'onDragStart', 'dirty', 'dispatch', 'onFocus', 'form', 'format', 'initial', 'parse', 'pristine', 'props', 'state', 'submitError', 'submitFailed', 'submitting', 'syncError', 'syncWarning', 'validate', 'value', '_value', 'warn']);
var error = syncError || asyncError || submitError;
var warning = syncWarning;
var formatFieldValue = function formatFieldValue(value, format) {
if (format === null) {
return value;
}
var defaultFormattedValue = value == null ? '' : value;
return format ? format(value, name) : defaultFormattedValue;
};
var formattedFieldValue = formatFieldValue(value, format);
return {
input: processProps(custom.type, {
name: name,
onBlur: onBlur,
onChange: onChange,
onDragStart: onDragStart,
onDrop: onDrop,
onFocus: onFocus,
value: formattedFieldValue
}, _value),
meta: _extends({}, toJS(state), {
active: !!(state && getIn(state, 'active')),
asyncValidating: asyncValidating,
autofilled: !!(state && getIn(state, 'autofilled')),
dirty: dirty,
dispatch: dispatch,
error: error,
form: form,
initial: initial,
warning: warning,
invalid: !!error,
pristine: pristine,
submitting: !!submitting,
submitFailed: !!submitFailed,
touched: !!(state && getIn(state, 'touched')),
valid: !error,
visited: !!(state && getIn(state, 'visited'))
}),
custom: _extends({}, custom, props)
};
};
/* harmony default export */ __webpack_exports__["a"] = (createFieldProps);
/***/ }),
/* 312 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
var defaultShouldAsyncValidate = function defaultShouldAsyncValidate(_ref) {
var initialized = _ref.initialized,
trigger = _ref.trigger,
pristine = _ref.pristine,
syncValidationPasses = _ref.syncValidationPasses;
if (!syncValidationPasses) {
return false;
}
switch (trigger) {
case 'blur':
// blurring
return true;
case 'submit':
// submitting, so only async validate if form is dirty or was never initialized
// conversely, DON'T async validate if the form is pristine just as it was initialized
return !pristine || !initialized;
default:
return false;
}
};
/* harmony default export */ __webpack_exports__["a"] = (defaultShouldAsyncValidate);
/***/ }),
/* 313 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
var defaultShouldValidate = function defaultShouldValidate(_ref) {
var values = _ref.values,
nextProps = _ref.nextProps,
initialRender = _ref.initialRender,
lastFieldValidatorKeys = _ref.lastFieldValidatorKeys,
fieldValidatorKeys = _ref.fieldValidatorKeys,
structure = _ref.structure;
if (initialRender) {
return true;
}
return !structure.deepEqual(values, nextProps.values) || !structure.deepEqual(lastFieldValidatorKeys, fieldValidatorKeys);
};
/* harmony default export */ __webpack_exports__["a"] = (defaultShouldValidate);
/***/ }),
/* 314 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
var isEvent = function isEvent(candidate) {
return !!(candidate && candidate.stopPropagation && candidate.preventDefault);
};
/* harmony default export */ __webpack_exports__["a"] = (isEvent);
/***/ }),
/* 315 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getValue__ = __webpack_require__(919);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isReactNative__ = __webpack_require__(939);
var onChangeValue = function onChangeValue(event, _ref) {
var name = _ref.name,
parse = _ref.parse,
normalize = _ref.normalize;
// read value from input
var value = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__getValue__["a" /* default */])(event, __WEBPACK_IMPORTED_MODULE_1__isReactNative__["a" /* default */]);
// parse value if we have a parser
if (parse) {
value = parse(value, name);
}
// normalize value
if (normalize) {
value = normalize(name, value);
}
return value;
};
/* harmony default export */ __webpack_exports__["a"] = (onChangeValue);
/***/ }),
/* 316 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isEvent__ = __webpack_require__(314);
var silenceEvent = function silenceEvent(event) {
var is = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__isEvent__["a" /* default */])(event);
if (is) {
event.preventDefault();
}
return is;
};
/* harmony default export */ __webpack_exports__["a"] = (silenceEvent);
/***/ }),
/* 317 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
var createIsPristine = function createIsPristine(_ref) {
var deepEqual = _ref.deepEqual,
empty = _ref.empty,
getIn = _ref.getIn;
return function (form) {
var getFormState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (state) {
return getIn(state, 'form');
};
return function (state) {
var formState = getFormState(state);
var initial = getIn(formState, form + '.initial') || empty;
var values = getIn(formState, form + '.values') || initial;
return deepEqual(initial, values);
};
};
};
/* harmony default export */ __webpack_exports__["a"] = (createIsPristine);
/***/ }),
/* 318 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_es_isEqualWith__ = __webpack_require__(240);
var customizer = function customizer(objectValue, otherValue, indexOrkey, object, other, stack) {
// https://lodash.com/docs/4.17.4#isEqualWith
if (stack) {
// Shallow compares
// For 1st level, stack === undefined.
// -> Do nothing (and implicitly return undefined so that it goes to compare 2nd level)
// For 2nd level and up, stack !== undefined.
// -> Compare by === operator
return objectValue === otherValue;
}
};
var shallowCompare = function shallowCompare(instance, nextProps, nextState) {
return !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_lodash_es_isEqualWith__["a" /* default */])(instance.props, nextProps, customizer) || !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_lodash_es_isEqualWith__["a" /* default */])(instance.state, nextState, customizer);
};
/* harmony default export */ __webpack_exports__["a"] = (shallowCompare);
/***/ }),
/* 319 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = 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));
};
}
/***/ }),
/* 320 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ActionTypes; });
/* unused harmony export default */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_es_isPlainObject__ = __webpack_require__(93);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_symbol_observable__ = __webpack_require__(1017);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_symbol_observable___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_symbol_observable__);
/**
* 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 = {
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 (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_lodash_es_isPlainObject__["a" /* 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[__WEBPACK_IMPORTED_MODULE_1_symbol_observable___default.a] = 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[__WEBPACK_IMPORTED_MODULE_1_symbol_observable___default.a] = observable, _ref2;
}
/***/ }),
/* 321 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* unused harmony export default */
/**
* 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 */
}
/***/ }),
/* 322 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module remark:parse:defaults
* @fileoverview Default options for `parse`.
*/
/* Expose. */
module.exports = {
position: true,
gfm: true,
yaml: true,
commonmark: false,
footnotes: false,
pedantic: false,
blocks: __webpack_require__(971),
breaks: false
};
/***/ }),
/* 323 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module remark:parse:locate:link
* @fileoverview Locate a link.
*/
module.exports = locate;
function locate(value, fromIndex) {
var link = value.indexOf('[', fromIndex);
var image = value.indexOf('![', fromIndex);
if (image === -1) {
return link;
}
/* Link can never be `-1` if an image is found, so we dont need
* to check for that :) */
return link < image ? link : image;
}
/***/ }),
/* 324 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module remark:parse:locate:tag
* @fileoverview Locate a tag.
*/
module.exports = locate;
function locate(value, fromIndex) {
return value.indexOf('<', fromIndex);
}
/***/ }),
/* 325 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module remark:parse:util:get-indentation
* @fileoverview Get indentation.
*/
/* Expose. */
module.exports = indentation;
/* Map of characters, and their column length,
* which can be used as indentation. */
var characters = {' ': 1, '\t': 4};
/**
* Gets indentation information for a line.
*
* @param {string} value - Indented line.
* @return {Object} - Indetation information.
*/
function indentation(value) {
var index = 0;
var indent = 0;
var character = value.charAt(index);
var stops = {};
var size;
while (character in characters) {
size = characters[character];
indent += size;
if (size > 1) {
indent = Math.floor(indent / size) * size;
}
stops[indent] = index;
character = value.charAt(++index);
}
return {indent: indent, stops: stops};
}
/***/ }),
/* 326 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module remark:parse:util:html
* @fileoverview HTML regexes.
*/
var attributeName = '[a-zA-Z_:][a-zA-Z0-9:._-]*';
var unquoted = '[^"\'=<>`\\u0000-\\u0020]+';
var singleQuoted = '\'[^\']*\'';
var doubleQuoted = '"[^"]*"';
var attributeValue = '(?:' + unquoted + '|' + singleQuoted + '|' + doubleQuoted + ')';
var attribute = '(?:\\s+' + attributeName + '(?:\\s*=\\s*' + attributeValue + ')?)';
var openTag = '<[A-Za-z][A-Za-z0-9\\-]*' + attribute + '*\\s*\\/?>';
var closeTag = '<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>';
var comment = '<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->';
var processing = '<[?].*?[?]>';
var declaration = '<![A-Za-z]+\\s+[^>]*>';
var cdata = '<!\\[CDATA\\[[\\s\\S]*?\\]\\]>';
exports.openCloseTag = new RegExp('^(?:' + openTag + '|' + closeTag + ')');
exports.tag = new RegExp('^(?:' +
openTag + '|' +
closeTag + '|' +
comment + '|' +
processing + '|' +
declaration + '|' +
cdata +
')');
/***/ }),
/* 327 */
/***/ (function(module, exports) {
/**
* Special language-specific overrides.
*
* Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt
*
* @type {Object}
*/
var LANGUAGES = {
tr: {
regexp: /[\u0069]/g,
map: {
'\u0069': '\u0130'
}
},
az: {
regexp: /[\u0069]/g,
map: {
'\u0069': '\u0130'
}
},
lt: {
regexp: /[\u0069\u006A\u012F]\u0307|\u0069\u0307[\u0300\u0301\u0303]/g,
map: {
'\u0069\u0307': '\u0049',
'\u006A\u0307': '\u004A',
'\u012F\u0307': '\u012E',
'\u0069\u0307\u0300': '\u00CC',
'\u0069\u0307\u0301': '\u00CD',
'\u0069\u0307\u0303': '\u0128'
}
}
}
/**
* Upper case a string.
*
* @param {String} str
* @return {String}
*/
module.exports = function (str, locale) {
var lang = LANGUAGES[locale]
str = str == null ? '' : String(str)
if (lang) {
str = str.replace(lang.regexp, function (m) { return lang.map[m] })
}
return str.toUpperCase()
}
/***/ }),
/* 328 */
/***/ (function(module, exports) {
var toString = Object.prototype.toString
module.exports = isString
function isString(obj) {
return toString.call(obj) === "[object String]"
}
/***/ }),
/* 329 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
__webpack_require__(856);
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _reactDom = __webpack_require__(194);
var _reactDom2 = _interopRequireDefault(_reactDom);
var _isFinite = __webpack_require__(687);
var _isFinite2 = _interopRequireDefault(_isFinite);
var _utils = __webpack_require__(303);
var _StyleGuide = __webpack_require__(848);
var _StyleGuide2 = _interopRequireDefault(_StyleGuide);
__webpack_require__(457);
var _es6ObjectAssign = __webpack_require__(426);
var _es6ObjectAssign2 = _interopRequireDefault(_es6ObjectAssign);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// Polyfills
_es6ObjectAssign2.default.polyfill();
// Examples code revision to rerender only code examples (not the whole page) when code changes
var codeKey = 0;
function renderStyleguide() {
var styleguide = __webpack_require__(887);
var sections = (0, _utils.processSections)(styleguide.sections);
// Parse URL hash to check if the components list must be filtered
var _getComponentNameFrom = (0, _utils.getComponentNameFromHash)(),
targetComponentName = _getComponentNameFrom.targetComponentName,
targetComponentIndex = _getComponentNameFrom.targetComponentIndex;
var isolatedComponent = false;
var isolatedExample = false;
// Filter the requested component id required
if (targetComponentName) {
var filteredComponents = (0, _utils.filterComponentsInSectionsByExactName)(sections, targetComponentName);
sections = [{ components: filteredComponents }];
isolatedComponent = true;
// If a single component is filtered and a fenced block index is specified hide the other examples
if (filteredComponents.length === 1 && (0, _isFinite2.default)(targetComponentIndex)) {
filteredComponents[0] = (0, _utils.filterComponentExamples)(filteredComponents[0], targetComponentIndex);
isolatedExample = true;
}
}
// Reset slugger for each render to be deterministic
_utils.slugger.reset();
sections = (0, _utils.setSlugs)(sections);
_reactDom2.default.render(_react2.default.createElement(_StyleGuide2.default, {
codeKey: codeKey,
config: styleguide.config,
welcomeScreen: styleguide.welcomeScreen,
patterns: styleguide.patterns,
sections: sections,
isolatedComponent: isolatedComponent,
isolatedExample: isolatedExample
}), document.getElementById('app'));
}
window.addEventListener('hashchange', renderStyleguide);
/* istanbul ignore if */
if (false) {
module.hot.accept('!!../loaders/styleguide-loader!./index.js', function () {
codeKey += 1;
renderStyleguide();
});
}
renderStyleguide();
/***/ }),
/* 330 */
/***/ (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(useSourceMap) {
var list = [];
// return the list of modules as css string
list.toString = function toString() {
return this.map(function (item) {
var content = cssWithMappingToString(item, useSourceMap);
if(item[2]) {
return "@media " + item[2] + "{" + content + "}";
} else {
return content;
}
}).join("");
};
// import a list of modules into the list
list.i = function(modules, mediaQuery) {
if(typeof modules === "string")
modules = [[null, modules, ""]];
var alreadyImportedModules = {};
for(var i = 0; i < this.length; i++) {
var id = this[i][0];
if(typeof id === "number")
alreadyImportedModules[id] = true;
}
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)
if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) {
if(mediaQuery && !item[2]) {
item[2] = mediaQuery;
} else if(mediaQuery) {
item[2] = "(" + item[2] + ") and (" + mediaQuery + ")";
}
list.push(item);
}
}
};
return list;
};
function cssWithMappingToString(item, useSourceMap) {
var content = item[1] || '';
var cssMapping = item[3];
if (!cssMapping) {
return content;
}
if (useSourceMap && typeof btoa === 'function') {
var sourceMapping = toComment(cssMapping);
var sourceURLs = cssMapping.sources.map(function (source) {
return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'
});
return [content].concat(sourceURLs).concat([sourceMapping]).join('\n');
}
return [content].join('\n');
}
// Adapted from convert-source-map (MIT)
function toComment(sourceMap) {
// eslint-disable-next-line no-undef
var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));
var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;
return '/*# ' + data + ' */';
}
/***/ }),
/* 331 */
/***/ (function(module, exports, __webpack_require__) {
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
var stylesInDom = {},
memoize = function(fn) {
var memo;
return function () {
if (typeof memo === "undefined") memo = fn.apply(this, arguments);
return memo;
};
},
isOldIE = memoize(function() {
// Test for IE <= 9 as proposed by Browserhacks
// @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805
// Tests for existence of standard globals is to allow style-loader
// to operate correctly into non-standard environments
// @see https://github.com/webpack-contrib/style-loader/issues/177
return window && document && document.all && !window.atob;
}),
getElement = (function(fn) {
var memo = {};
return function(selector) {
if (typeof memo[selector] === "undefined") {
memo[selector] = fn.call(this, selector);
}
return memo[selector]
};
})(function (styleTarget) {
return document.querySelector(styleTarget)
}),
singletonElement = null,
singletonCounter = 0,
styleElementsInsertedAtTop = [],
fixUrls = __webpack_require__(1015);
module.exports = function(list, options) {
if(typeof DEBUG !== "undefined" && DEBUG) {
if(typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment");
}
options = options || {};
options.attrs = typeof options.attrs === "object" ? options.attrs : {};
// Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
// tags it will allow on a page
if (typeof options.singleton === "undefined") options.singleton = isOldIE();
// By default, add <style> tags to the <head> element
if (typeof options.insertInto === "undefined") options.insertInto = "head";
// By default, add <style> tags to the bottom of the target
if (typeof options.insertAt === "undefined") options.insertAt = "bottom";
var styles = listToStyles(list, options);
addStylesToDom(styles, options);
return function update(newList) {
var mayRemove = [];
for(var i = 0; i < styles.length; i++) {
var item = styles[i];
var domStyle = stylesInDom[item.id];
domStyle.refs--;
mayRemove.push(domStyle);
}
if(newList) {
var newStyles = listToStyles(newList, options);
addStylesToDom(newStyles, options);
}
for(var i = 0; i < mayRemove.length; i++) {
var domStyle = mayRemove[i];
if(domStyle.refs === 0) {
for(var j = 0; j < domStyle.parts.length; j++)
domStyle.parts[j]();
delete stylesInDom[domStyle.id];
}
}
};
};
function addStylesToDom(styles, options) {
for(var i = 0; i < styles.length; i++) {
var item = styles[i];
var 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 {
var parts = [];
for(var 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, options) {
var styles = [];
var newStyles = {};
for(var i = 0; i < list.length; i++) {
var item = list[i];
var id = options.base ? item[0] + options.base : item[0];
var css = item[1];
var media = item[2];
var sourceMap = item[3];
var part = {css: css, media: media, sourceMap: sourceMap};
if(!newStyles[id])
styles.push(newStyles[id] = {id: id, parts: [part]});
else
newStyles[id].parts.push(part);
}
return styles;
}
function insertStyleElement(options, styleElement) {
var styleTarget = getElement(options.insertInto)
if (!styleTarget) {
throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");
}
var lastStyleElementInsertedAtTop = styleElementsInsertedAtTop[styleElementsInsertedAtTop.length - 1];
if (options.insertAt === "top") {
if(!lastStyleElementInsertedAtTop) {
styleTarget.insertBefore(styleElement, styleTarget.firstChild);
} else if(lastStyleElementInsertedAtTop.nextSibling) {
styleTarget.insertBefore(styleElement, lastStyleElementInsertedAtTop.nextSibling);
} else {
styleTarget.appendChild(styleElement);
}
styleElementsInsertedAtTop.push(styleElement);
} else if (options.insertAt === "bottom") {
styleTarget.appendChild(styleElement);
} else {
throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");
}
}
function removeStyleElement(styleElement) {
styleElement.parentNode.removeChild(styleElement);
var idx = styleElementsInsertedAtTop.indexOf(styleElement);
if(idx >= 0) {
styleElementsInsertedAtTop.splice(idx, 1);
}
}
function createStyleElement(options) {
var styleElement = document.createElement("style");
options.attrs.type = "text/css";
attachTagAttrs(styleElement, options.attrs);
insertStyleElement(options, styleElement);
return styleElement;
}
function createLinkElement(options) {
var linkElement = document.createElement("link");
options.attrs.type = "text/css";
options.attrs.rel = "stylesheet";
attachTagAttrs(linkElement, options.attrs);
insertStyleElement(options, linkElement);
return linkElement;
}
function attachTagAttrs(element, attrs) {
Object.keys(attrs).forEach(function (key) {
element.setAttribute(key, attrs[key]);
});
}
function addStyle(obj, options) {
var styleElement, update, remove, transformResult;
// If a transform function was defined, run it on the css
if (options.transform && obj.css) {
transformResult = options.transform(obj.css);
if (transformResult) {
// If transform returns a value, use that instead of the original css.
// This allows running runtime transformations on the css.
obj.css = transformResult;
} else {
// If the transform function returns a falsy value, don't add this css.
// This allows conditional loading of css
return function() {
// noop
};
}
}
if (options.singleton) {
var styleIndex = singletonCounter++;
styleElement = singletonElement || (singletonElement = createStyleElement(options));
update = applyToSingletonTag.bind(null, styleElement, styleIndex, false);
remove = applyToSingletonTag.bind(null, styleElement, styleIndex, true);
} else if(obj.sourceMap &&
typeof URL === "function" &&
typeof URL.createObjectURL === "function" &&
typeof URL.revokeObjectURL === "function" &&
typeof Blob === "function" &&
typeof btoa === "function") {
styleElement = createLinkElement(options);
update = updateLink.bind(null, styleElement, options);
remove = function() {
removeStyleElement(styleElement);
if(styleElement.href)
URL.revokeObjectURL(styleElement.href);
};
} else {
styleElement = createStyleElement(options);
update = applyToTag.bind(null, styleElement);
remove = function() {
removeStyleElement(styleElement);
};
}
update(obj);
return function updateStyle(newObj) {
if(newObj) {
if(newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap)
return;
update(obj = newObj);
} else {
remove();
}
};
}
var replaceText = (function () {
var textStore = [];
return function (index, replacement) {
textStore[index] = replacement;
return textStore.filter(Boolean).join('\n');
};
})();
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);
var childNodes = styleElement.childNodes;
if (childNodes[index]) styleElement.removeChild(childNodes[index]);
if (childNodes.length) {
styleElement.insertBefore(cssNode, childNodes[index]);
} else {
styleElement.appendChild(cssNode);
}
}
}
function applyToTag(styleElement, obj) {
var css = obj.css;
var media = obj.media;
if(media) {
styleElement.setAttribute("media", media)
}
if(styleElement.styleSheet) {
styleElement.styleSheet.cssText = css;
} else {
while(styleElement.firstChild) {
styleElement.removeChild(styleElement.firstChild);
}
styleElement.appendChild(document.createTextNode(css));
}
}
function updateLink(linkElement, options, obj) {
var css = obj.css;
var sourceMap = obj.sourceMap;
/* If convertToAbsoluteUrls isn't defined, but sourcemaps are enabled
and there is no publicPath defined then lets turn convertToAbsoluteUrls
on by default. Otherwise default to the convertToAbsoluteUrls option
directly
*/
var autoFixUrls = options.convertToAbsoluteUrls === undefined && sourceMap;
if (options.convertToAbsoluteUrls || autoFixUrls){
css = fixUrls(css);
}
if(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" });
var oldSrc = linkElement.href;
linkElement.href = URL.createObjectURL(blob);
if(oldSrc)
URL.revokeObjectURL(oldSrc);
}
/***/ }),
/* 332 */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(30),
now = __webpack_require__(694),
toNumber = __webpack_require__(698);
/** Error message constants. */
var FUNC_ERROR_TEXT = 'Expected a function';
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max,
nativeMin = Math.min;
/**
* Creates a debounced function that delays invoking `func` until after `wait`
* milliseconds have elapsed since the last time the debounced function was
* invoked. The debounced function comes with a `cancel` method to cancel
* delayed `func` invocations and a `flush` method to immediately invoke them.
* Provide `options` to indicate whether `func` should be invoked on the
* leading and/or trailing edge of the `wait` timeout. The `func` is invoked
* with the last arguments provided to the debounced function. Subsequent
* calls to the debounced function return the result of the last `func`
* invocation.
*
* **Note:** If `leading` and `trailing` options are `true`, `func` is
* invoked on the trailing edge of the timeout only if the debounced function
* is invoked more than once during the `wait` timeout.
*
* If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
* until to the next tick, similar to `setTimeout` with a timeout of `0`.
*
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
* for details over the differences between `_.debounce` and `_.throttle`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {Function} func The function to debounce.
* @param {number} [wait=0] The number of milliseconds to delay.
* @param {Object} [options={}] The options object.
* @param {boolean} [options.leading=false]
* Specify invoking on the leading edge of the timeout.
* @param {number} [options.maxWait]
* The maximum time `func` is allowed to be delayed before it's invoked.
* @param {boolean} [options.trailing=true]
* Specify invoking on the trailing edge of the timeout.
* @returns {Function} Returns the new debounced function.
* @example
*
* // Avoid costly calculations while the window size is in flux.
* jQuery(window).on('resize', _.debounce(calculateLayout, 150));
*
* // Invoke `sendMail` when clicked, debouncing subsequent calls.
* jQuery(element).on('click', _.debounce(sendMail, 300, {
* 'leading': true,
* 'trailing': false
* }));
*
* // Ensure `batchLog` is invoked once after 1 second of debounced calls.
* var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
* var source = new EventSource('/stream');
* jQuery(source).on('message', debounced);
*
* // Cancel the trailing debounced invocation.
* jQuery(window).on('popstate', debounced.cancel);
*/
function debounce(func, wait, options) {
var lastArgs,
lastThis,
maxWait,
result,
timerId,
lastCallTime,
lastInvokeTime = 0,
leading = false,
maxing = false,
trailing = true;
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
wait = toNumber(wait) || 0;
if (isObject(options)) {
leading = !!options.leading;
maxing = 'maxWait' in options;
maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
trailing = 'trailing' in options ? !!options.trailing : trailing;
}
function invokeFunc(time) {
var args = lastArgs,
thisArg = lastThis;
lastArgs = lastThis = undefined;
lastInvokeTime = time;
result = func.apply(thisArg, args);
return result;
}
function leadingEdge(time) {
// Reset any `maxWait` timer.
lastInvokeTime = time;
// Start the timer for the trailing edge.
timerId = setTimeout(timerExpired, wait);
// Invoke the leading edge.
return leading ? invokeFunc(time) : result;
}
function remainingWait(time) {
var timeSinceLastCall = time - lastCallTime,
timeSinceLastInvoke = time - lastInvokeTime,
result = wait - timeSinceLastCall;
return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;
}
function shouldInvoke(time) {
var timeSinceLastCall = time - lastCallTime,
timeSinceLastInvoke = time - lastInvokeTime;
// Either this is the first call, activity has stopped and we're at the
// trailing edge, the system time has gone backwards and we're treating
// it as the trailing edge, or we've hit the `maxWait` limit.
return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
(timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
}
function timerExpired() {
var time = now();
if (shouldInvoke(time)) {
return trailingEdge(time);
}
// Restart the timer.
timerId = setTimeout(timerExpired, remainingWait(time));
}
function trailingEdge(time) {
timerId = undefined;
// Only invoke if we have `lastArgs` which means `func` has been
// debounced at least once.
if (trailing && lastArgs) {
return invokeFunc(time);
}
lastArgs = lastThis = undefined;
return result;
}
function cancel() {
if (timerId !== undefined) {
clearTimeout(timerId);
}
lastInvokeTime = 0;
lastArgs = lastCallTime = lastThis = timerId = undefined;
}
function flush() {
return timerId === undefined ? result : trailingEdge(now());
}
function debounced() {
var time = now(),
isInvoking = shouldInvoke(time);
lastArgs = arguments;
lastThis = this;
lastCallTime = time;
if (isInvoking) {
if (timerId === undefined) {
return leadingEdge(lastCallTime);
}
if (maxing) {
// Handle invocations in a tight loop.
timerId = setTimeout(timerExpired, wait);
return invokeFunc(lastCallTime);
}
}
if (timerId === undefined) {
timerId = setTimeout(timerExpired, wait);
}
return result;
}
debounced.cancel = cancel;
debounced.flush = flush;
return debounced;
}
module.exports = debounce;
/***/ }),
/* 333 */,
/* 334 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*/
if (false) {
var invariant = require('fbjs/lib/invariant');
var warning = require('fbjs/lib/warning');
var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');
var loggedTypeFailures = {};
}
/**
* Assert that the values match with the type specs.
* Error messages are memorized and will only be shown once.
*
* @param {object} typeSpecs Map of name to a ReactPropType
* @param {object} values Runtime values that need to be type-checked
* @param {string} location e.g. "prop", "context", "child context"
* @param {string} componentName Name of the component for error messages.
* @param {?Function} getStack Returns the component stack.
* @private
*/
function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
if (false) {
for (var typeSpecName in typeSpecs) {
if (typeSpecs.hasOwnProperty(typeSpecName)) {
var error;
// Prop type validation may throw. In case they do, we don't want to
// fail the render phase where it didn't fail before. So we log it.
// After these have been cleaned up, we'll let them throw.
try {
// This is intentionally an invariant that gets caught. It's the same
// behavior as without this statement except with a better message.
invariant(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', componentName || 'React class', location, typeSpecName);
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
} catch (ex) {
error = ex;
}
warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error);
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
// Only monitor this failure once because there tends to be a lot of the
// same error.
loggedTypeFailures[error.message] = true;
var stack = getStack ? getStack() : '';
warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '');
}
}
}
}
}
module.exports = checkPropTypes;
/***/ }),
/* 335 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*/
// React 15.5 references this module, and assumes PropTypes are still callable in production.
// Therefore we re-export development-only version with all the PropTypes checks here.
// However if one is migrating to the `prop-types` npm library, they will go through the
// `index.js` entry point, and it will branch depending on the environment.
var factory = __webpack_require__(336);
module.exports = function(isValidElement) {
// It is still allowed in 15.5.
var throwOnDirectAccess = false;
return factory(isValidElement, throwOnDirectAccess);
};
/***/ }),
/* 336 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*/
var emptyFunction = __webpack_require__(112);
var invariant = __webpack_require__(47);
var warning = __webpack_require__(38);
var ReactPropTypesSecret = __webpack_require__(337);
var checkPropTypes = __webpack_require__(334);
module.exports = function(isValidElement, throwOnDirectAccess) {
/* global Symbol */
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
/**
* Returns the iterator method function contained on the iterable object.
*
* Be sure to invoke the function with the iterable as context:
*
* var iteratorFn = getIteratorFn(myIterable);
* if (iteratorFn) {
* var iterator = iteratorFn.call(myIterable);
* ...
* }
*
* @param {?object} maybeIterable
* @return {?function}
*/
function getIteratorFn(maybeIterable) {
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
if (typeof iteratorFn === 'function') {
return iteratorFn;
}
}
/**
* Collection of methods that allow declaration and validation of props that are
* supplied to React components. Example usage:
*
* var Props = require('ReactPropTypes');
* var MyArticle = React.createClass({
* propTypes: {
* // An optional string prop named "description".
* description: Props.string,
*
* // A required enum prop named "category".
* category: Props.oneOf(['News','Photos']).isRequired,
*
* // A prop named "dialog" that requires an instance of Dialog.
* dialog: Props.instanceOf(Dialog).isRequired
* },
* render: function() { ... }
* });
*
* A more formal specification of how these methods are used:
*
* type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
* decl := ReactPropTypes.{type}(.isRequired)?
*
* Each and every declaration produces a function with the same signature. This
* allows the creation of custom validation functions. For example:
*
* var MyLink = React.createClass({
* propTypes: {
* // An optional string or URI prop named "href".
* href: function(props, propName, componentName) {
* var propValue = props[propName];
* if (propValue != null && typeof propValue !== 'string' &&
* !(propValue instanceof URI)) {
* return new Error(
* 'Expected a string or an URI for ' + propName + ' in ' +
* componentName
* );
* }
* }
* },
* render: function() {...}
* });
*
* @internal
*/
var ANONYMOUS = '<<anonymous>>';
// Important!
// Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
var ReactPropTypes = {
array: createPrimitiveTypeChecker('array'),
bool: createPrimitiveTypeChecker('boolean'),
func: createPrimitiveTypeChecker('function'),
number: createPrimitiveTypeChecker('number'),
object: createPrimitiveTypeChecker('object'),
string: createPrimitiveTypeChecker('string'),
symbol: createPrimitiveTypeChecker('symbol'),
any: createAnyTypeChecker(),
arrayOf: createArrayOfTypeChecker,
element: createElementTypeChecker(),
instanceOf: createInstanceTypeChecker,
node: createNodeChecker(),
objectOf: createObjectOfTypeChecker,
oneOf: createEnumTypeChecker,
oneOfType: createUnionTypeChecker,
shape: createShapeTypeChecker
};
/**
* 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 (false) {
var manualPropTypeCallCache = {};
var manualPropTypeWarningCount = 0;
}
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
componentName = componentName || ANONYMOUS;
propFullName = propFullName || propName;
if (secret !== ReactPropTypesSecret) {
if (throwOnDirectAccess) {
// New behavior only for users of `prop-types` package
invariant(
false,
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
'Use `PropTypes.checkPropTypes()` to call them. ' +
'Read more at http://fb.me/use-check-prop-types'
);
} else if (false) {
// Old behavior for people using React.PropTypes
var cacheKey = componentName + ':' + propName;
if (
!manualPropTypeCallCache[cacheKey] &&
// Avoid spamming the console because they are often not actionable except for lib authors
manualPropTypeWarningCount < 3
) {
warning(
false,
'You are manually calling a React.PropTypes validation ' +
'function for the `%s` prop on `%s`. This is deprecated ' +
'and will throw in the standalone `prop-types` package. ' +
'You may be seeing this warning due to a third-party PropTypes ' +
'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.',
propFullName,
componentName
);
manualPropTypeCallCache[cacheKey] = true;
manualPropTypeWarningCount++;
}
}
}
if (props[propName] == null) {
if (isRequired) {
if (props[propName] === null) {
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
}
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
}
return null;
} else {
return validate(props, propName, componentName, location, propFullName);
}
}
var chainedCheckType = checkType.bind(null, false);
chainedCheckType.isRequired = checkType.bind(null, true);
return chainedCheckType;
}
function createPrimitiveTypeChecker(expectedType) {
function validate(props, propName, componentName, location, propFullName, secret) {
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== expectedType) {
// `propValue` being instance of, say, date/regexp, pass the 'object'
// check, but we can offer a more precise error message here rather than
// 'of type `object`'.
var preciseType = getPreciseType(propValue);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createAnyTypeChecker() {
return createChainableTypeChecker(emptyFunction.thatReturnsNull);
}
function createArrayOfTypeChecker(typeChecker) {
function validate(props, propName, componentName, location, propFullName) {
if (typeof typeChecker !== 'function') {
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
}
var propValue = props[propName];
if (!Array.isArray(propValue)) {
var propType = getPropType(propValue);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
}
for (var i = 0; i < propValue.length; i++) {
var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
if (error instanceof Error) {
return error;
}
}
return null;
}
return createChainableTypeChecker(validate);
}
function createElementTypeChecker() {
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
if (!isValidElement(propValue)) {
var propType = getPropType(propValue);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createInstanceTypeChecker(expectedClass) {
function validate(props, propName, componentName, location, propFullName) {
if (!(props[propName] instanceof expectedClass)) {
var expectedClassName = expectedClass.name || ANONYMOUS;
var actualClassName = getClassName(props[propName]);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createEnumTypeChecker(expectedValues) {
if (!Array.isArray(expectedValues)) {
false ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0;
return emptyFunction.thatReturnsNull;
}
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
for (var i = 0; i < expectedValues.length; i++) {
if (is(propValue, expectedValues[i])) {
return null;
}
}
var valuesString = JSON.stringify(expectedValues);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
}
return createChainableTypeChecker(validate);
}
function createObjectOfTypeChecker(typeChecker) {
function validate(props, propName, componentName, location, propFullName) {
if (typeof typeChecker !== 'function') {
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
}
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== 'object') {
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
}
for (var key in propValue) {
if (propValue.hasOwnProperty(key)) {
var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
if (error instanceof Error) {
return error;
}
}
}
return null;
}
return createChainableTypeChecker(validate);
}
function createUnionTypeChecker(arrayOfTypeCheckers) {
if (!Array.isArray(arrayOfTypeCheckers)) {
false ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
return emptyFunction.thatReturnsNull;
}
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
var checker = arrayOfTypeCheckers[i];
if (typeof checker !== 'function') {
warning(
false,
'Invalid argument supplid to oneOfType. Expected an array of check functions, but ' +
'received %s at index %s.',
getPostfixForTypeWarning(checker),
i
);
return emptyFunction.thatReturnsNull;
}
}
function validate(props, propName, componentName, location, propFullName) {
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
var checker = arrayOfTypeCheckers[i];
if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {
return null;
}
}
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
}
return createChainableTypeChecker(validate);
}
function createNodeChecker() {
function validate(props, propName, componentName, location, propFullName) {
if (!isNode(props[propName])) {
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createShapeTypeChecker(shapeTypes) {
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== 'object') {
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
}
for (var key in shapeTypes) {
var checker = shapeTypes[key];
if (!checker) {
continue;
}
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
if (error) {
return error;
}
}
return null;
}
return createChainableTypeChecker(validate);
}
function isNode(propValue) {
switch (typeof propValue) {
case 'number':
case 'string':
case 'undefined':
return true;
case 'boolean':
return !propValue;
case 'object':
if (Array.isArray(propValue)) {
return propValue.every(isNode);
}
if (propValue === null || isValidElement(propValue)) {
return true;
}
var iteratorFn = getIteratorFn(propValue);
if (iteratorFn) {
var iterator = iteratorFn.call(propValue);
var step;
if (iteratorFn !== propValue.entries) {
while (!(step = iterator.next()).done) {
if (!isNode(step.value)) {
return false;
}
}
} else {
// Iterator will provide entry [k,v] tuples rather than values.
while (!(step = iterator.next()).done) {
var entry = step.value;
if (entry) {
if (!isNode(entry[1])) {
return false;
}
}
}
}
} else {
return false;
}
return true;
default:
return false;
}
}
function isSymbol(propType, propValue) {
// Native Symbol.
if (propType === 'symbol') {
return true;
}
// 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
if (propValue['@@toStringTag'] === 'Symbol') {
return true;
}
// Fallback for non-spec compliant Symbols which are polyfilled.
if (typeof Symbol === 'function' && propValue instanceof Symbol) {
return true;
}
return false;
}
// Equivalent of `typeof` but with special handling for array and regexp.
function getPropType(propValue) {
var propType = typeof propValue;
if (Array.isArray(propValue)) {
return 'array';
}
if (propValue instanceof RegExp) {
// Old webkits (at least until Android 4.0) return 'function' rather than
// 'object' for typeof a RegExp. We'll normalize this here so that /bla/
// passes PropTypes.object.
return 'object';
}
if (isSymbol(propType, propValue)) {
return 'symbol';
}
return propType;
}
// This handles more types than `getPropType`. Only used for error messages.
// See `createPrimitiveTypeChecker`.
function getPreciseType(propValue) {
if (typeof propValue === 'undefined' || propValue === null) {
return '' + propValue;
}
var propType = getPropType(propValue);
if (propType === 'object') {
if (propValue instanceof Date) {
return 'date';
} else if (propValue instanceof RegExp) {
return 'regexp';
}
}
return propType;
}
// Returns a string that is postfixed to a warning about an invalid type.
// For example, "undefined" or "of type array"
function getPostfixForTypeWarning(value) {
var type = getPreciseType(value);
switch (type) {
case 'array':
case 'object':
return 'an ' + type;
case 'boolean':
case 'date':
case 'regexp':
return 'a ' + type;
default:
return type;
}
}
// Returns class name of the object, if any.
function getClassName(propValue) {
if (!propValue.constructor || !propValue.constructor.name) {
return ANONYMOUS;
}
return propValue.constructor.name;
}
ReactPropTypes.checkPropTypes = checkPropTypes;
ReactPropTypes.PropTypes = ReactPropTypes;
return ReactPropTypes;
};
/***/ }),
/* 337 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*/
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
module.exports = ReactPropTypesSecret;
/***/ }),
/* 338 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*
*/
/**
* 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;
/***/ }),
/* 339 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*
*/
var _prodInvariant = __webpack_require__(64);
var invariant = __webpack_require__(47);
/**
* 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) ? false ? 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;
/***/ }),
/* 340 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var _assign = __webpack_require__(79);
var ReactChildren = __webpack_require__(341);
var ReactComponent = __webpack_require__(114);
var ReactPureComponent = __webpack_require__(346);
var ReactClass = __webpack_require__(342);
var ReactDOMFactories = __webpack_require__(343);
var ReactElement = __webpack_require__(48);
var ReactPropTypes = __webpack_require__(345);
var ReactVersion = __webpack_require__(347);
var onlyChild = __webpack_require__(349);
var warning = __webpack_require__(38);
var createElement = ReactElement.createElement;
var createFactory = ReactElement.createFactory;
var cloneElement = ReactElement.cloneElement;
if (false) {
var canDefineProperty = require('./canDefineProperty');
var ReactElementValidator = require('./ReactElementValidator');
var didWarnPropTypesDeprecated = false;
createElement = ReactElementValidator.createElement;
createFactory = ReactElementValidator.createFactory;
cloneElement = ReactElementValidator.cloneElement;
}
var __spread = _assign;
if (false) {
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
};
// TODO: Fix tests so that this deprecation warning doesn't cause failures.
if (false) {
if (canDefineProperty) {
Object.defineProperty(React, 'PropTypes', {
get: function () {
process.env.NODE_ENV !== 'production' ? warning(didWarnPropTypesDeprecated, 'Accessing PropTypes via the main React package is deprecated. Use ' + 'the prop-types package from npm instead.') : void 0;
didWarnPropTypesDeprecated = true;
return ReactPropTypes;
}
});
}
}
module.exports = React;
/***/ }),
/* 341 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var PooledClass = __webpack_require__(339);
var ReactElement = __webpack_require__(48);
var emptyFunction = __webpack_require__(112);
var traverseAllChildren = __webpack_require__(350);
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;
/***/ }),
/* 342 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var _prodInvariant = __webpack_require__(64),
_assign = __webpack_require__(79);
var ReactComponent = __webpack_require__(114);
var ReactElement = __webpack_require__(48);
var ReactPropTypeLocationNames = __webpack_require__(344);
var ReactNoopUpdateQueue = __webpack_require__(115);
var emptyObject = __webpack_require__(113);
var invariant = __webpack_require__(47);
var warning = __webpack_require__(38);
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}
* @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 (false) {
validateTypeDef(Constructor, childContextTypes, 'childContext');
}
Constructor.childContextTypes = _assign({}, Constructor.childContextTypes, childContextTypes);
},
contextTypes: function (Constructor, contextTypes) {
if (false) {
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 (false) {
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__
false ? 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') ? false ? 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') ? false ? 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 (false) {
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') ? false ? 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) ? false ? 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')) ? false ? 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 (false) {
// 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 ? false ? 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 ? false ? 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') ? false ? invariant(false, 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.') : _prodInvariant('80') : void 0;
for (var key in two) {
if (two.hasOwnProperty(key)) {
!(one[key] === undefined) ? false ? 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 (false) {
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);
var didWarnDeprecated = false;
/**
* 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) {
if (false) {
process.env.NODE_ENV !== 'production' ? warning(didWarnDeprecated, '%s: React.createClass is deprecated and will be removed in version 16. ' + 'Use plain JavaScript classes instead. If you\'re not yet ready to ' + 'migrate, create-react-class is available on npm as a ' + 'drop-in replacement.', spec && spec.displayName || 'A Component') : void 0;
didWarnDeprecated = true;
}
// 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 (false) {
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 (false) {
// 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)) ? false ? 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 (false) {
// 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 ? false ? invariant(false, 'createClass(...): Class specification must implement a `render` method.') : _prodInvariant('83') : void 0;
if (false) {
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;
/***/ }),
/* 343 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var ReactElement = __webpack_require__(48);
/**
* Create a factory that creates HTML tag elements.
*
* @private
*/
var createDOMFactory = ReactElement.createFactory;
if (false) {
var ReactElementValidator = require('./ReactElementValidator');
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;
/***/ }),
/* 344 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*
*/
var ReactPropTypeLocationNames = {};
if (false) {
ReactPropTypeLocationNames = {
prop: 'prop',
context: 'context',
childContext: 'child context'
};
}
module.exports = ReactPropTypeLocationNames;
/***/ }),
/* 345 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var _require = __webpack_require__(48),
isValidElement = _require.isValidElement;
var factory = __webpack_require__(335);
module.exports = factory(isValidElement);
/***/ }),
/* 346 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var _assign = __webpack_require__(79);
var ReactComponent = __webpack_require__(114);
var ReactNoopUpdateQueue = __webpack_require__(115);
var emptyObject = __webpack_require__(113);
/**
* 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;
/***/ }),
/* 347 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
module.exports = '15.5.4';
/***/ }),
/* 348 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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 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;
/***/ }),
/* 349 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var _prodInvariant = __webpack_require__(64);
var ReactElement = __webpack_require__(48);
var invariant = __webpack_require__(47);
/**
* 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) ? false ? invariant(false, 'React.Children.only expected to receive a single React element child.') : _prodInvariant('143') : void 0;
return children;
}
module.exports = onlyChild;
/***/ }),
/* 350 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var _prodInvariant = __webpack_require__(64);
var ReactCurrentOwner = __webpack_require__(195);
var REACT_ELEMENT_TYPE = __webpack_require__(196);
var getIteratorFn = __webpack_require__(348);
var invariant = __webpack_require__(47);
var KeyEscapeUtils = __webpack_require__(338);
var warning = __webpack_require__(38);
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 (false) {
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 (false) {
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 ? false ? 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;
/***/ }),
/* 351 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
module.exports = __webpack_require__(340);
/***/ }),
/* 352 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(process) {/* unused harmony export css */
/* unused harmony export keyframes */
/* unused harmony export injectGlobal */
/* unused harmony export ThemeProvider */
/* unused harmony export withTheme */
/* unused harmony export ServerStyleSheet */
/* unused harmony export StyleSheetManager */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_stylis__ = __webpack_require__(353);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_stylis___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_stylis__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react__ = __webpack_require__(351);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_react__);
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in 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$2(string) {
return string.replace(_uppercasePattern, '-$1').toLowerCase();
}
var hyphenate_1 = hyphenate$2;
var hyphenate = hyphenate_1;
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-');
}
var hyphenateStyleName_1 = hyphenateStyleName;
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
return typeof obj;
} : function (obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};
var classCallCheck = function (instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
};
var createClass = function () {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function (Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
var _extends = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
var inherits = function (subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
};
var objectWithoutProperties = function (obj, keys) {
var target = {};
for (var i in obj) {
if (keys.indexOf(i) >= 0) continue;
if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;
target[i] = obj[i];
}
return target;
};
var possibleConstructorReturn = function (self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && (typeof call === "object" || typeof call === "function") ? call : self;
};
/*!
* isobject <https://github.com/jonschlinkert/isobject>
*
* Copyright (c) 2014-2015, Jon Schlinkert.
* Licensed under the MIT License.
*/
var index$1 = function isObject(val) {
return val != null && (typeof val === 'undefined' ? 'undefined' : _typeof(val)) === 'object' && !Array.isArray(val);
};
var isObject$1 = index$1;
function isObjectObject(o) {
return isObject$1(o) === true && Object.prototype.toString.call(o) === '[object Object]';
}
var index = function isPlainObject(o) {
var ctor, prot;
if (isObjectObject(o) === false) return false;
// If has modified constructor
ctor = o.constructor;
if (typeof ctor !== 'function') return false;
// If has modified prototype
prot = ctor.prototype;
if (isObjectObject(prot) === false) return false;
// If constructor does not have an Object-specific method
if (prot.hasOwnProperty('isPrototypeOf') === false) {
return false;
}
// Most likely a plain Object
return true;
};
//
var objToCss = function objToCss(obj, prevKey) {
var css = Object.keys(obj).map(function (key) {
if (index(obj[key])) return objToCss(obj[key], key);
return hyphenateStyleName_1(key) + ': ' + obj[key] + ';';
}).join(' ');
return prevKey ? prevKey + ' {\n ' + css + '\n}' : css;
};
var flatten = function flatten(chunks, executionContext) {
return chunks.reduce(function (ruleSet, chunk) {
/* Remove falsey values */
if (chunk === undefined || chunk === null || chunk === false || chunk === '') return ruleSet;
/* Flatten ruleSet */
if (Array.isArray(chunk)) return [].concat(ruleSet, flatten(chunk, executionContext));
/* Handle other components */
// $FlowFixMe not sure how to make this pass
if (chunk.hasOwnProperty('styledComponentId')) return [].concat(ruleSet, ['.' + chunk.styledComponentId]);
/* Either execute or defer the function */
if (typeof chunk === 'function') {
return executionContext ? ruleSet.concat.apply(ruleSet, flatten([chunk(executionContext)], executionContext)) : ruleSet.concat(chunk);
}
/* Handle objects */
// $FlowFixMe have to add %checks somehow to isPlainObject
return ruleSet.concat(index(chunk) ? objToCss(chunk) : chunk.toString());
}, []);
};
//
var stringifyRules = function stringifyRules(rules, selector, prefix) {
var flatCSS = rules.join('').replace(/^\s*\/\/.*$/gm, ''); // replace JS comments
var cssStr = selector && prefix ? prefix + ' ' + selector + ' { ' + flatCSS + ' }' : flatCSS;
var css = __WEBPACK_IMPORTED_MODULE_0_stylis___default()(prefix || !selector ? '' : selector, cssStr, false, false);
return css;
};
//
var chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('');
var charsLength = chars.length;
/* Some high number, usually 9-digit base-10. Map it to base-😎 */
var generateAlphabeticName = function generateAlphabeticName(code) {
var name = '';
var x = void 0;
for (x = code; x > charsLength; x = Math.floor(x / chars.length)) {
name = chars[x % charsLength] + name;
}
return chars[x % charsLength] + name;
};
//
var interleave = (function (strings, interpolations) {
return interpolations.reduce(function (array, interp, i) {
return array.concat(interp, strings[i + 1]);
}, [strings[0]]);
});
//
var css = (function (strings) {
for (var _len = arguments.length, interpolations = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
interpolations[_key - 1] = arguments[_key];
}
return flatten(interleave(strings, interpolations));
});
//
var SC_COMPONENT_ID = /^[^\S\n]*?\/\* sc-component-id:\s+(\S+)\s+\*\//mg;
var extractCompsFromCSS = (function (maybeCSS) {
var css = '' + (maybeCSS || ''); // Definitely a string, and a clone
var existingComponents = [];
css.replace(SC_COMPONENT_ID, function (match, componentId, matchIndex) {
existingComponents.push({ componentId: componentId, matchIndex: matchIndex });
return match;
});
return existingComponents.map(function (_ref, i) {
var componentId = _ref.componentId,
matchIndex = _ref.matchIndex;
var nextComp = existingComponents[i + 1];
var cssFromDOM = nextComp ? css.slice(matchIndex, nextComp.matchIndex) : css.slice(matchIndex);
return { componentId: componentId, cssFromDOM: cssFromDOM };
});
});
//
/*
* Browser Style Sheet with Rehydration
*
* <style data-styled-components="x y z"
* data-styled-components-is-local="true">
* /· sc-component-id: a ·/
* .sc-a { ... }
* .x { ... }
* /· sc-component-id: b ·/
* .sc-b { ... }
* .y { ... }
* .z { ... }
* </style>
*
* Note: replace · with * in the above snippet.
* */
var COMPONENTS_PER_TAG = 40;
var BrowserTag = function () {
function BrowserTag(el, isLocal) {
var existingSource = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
classCallCheck(this, BrowserTag);
this.el = el;
this.isLocal = isLocal;
this.ready = false;
var extractedComps = extractCompsFromCSS(existingSource);
this.size = extractedComps.length;
this.components = extractedComps.reduce(function (acc, obj) {
acc[obj.componentId] = obj; // eslint-disable-line no-param-reassign
return acc;
}, {});
}
BrowserTag.prototype.isFull = function isFull() {
return this.size >= COMPONENTS_PER_TAG;
};
BrowserTag.prototype.addComponent = function addComponent(componentId) {
if (!this.ready) this.replaceElement();
if (this.components[componentId]) throw new Error('Trying to add Component \'' + componentId + '\' twice!');
var comp = { componentId: componentId, textNode: document.createTextNode('') };
this.el.appendChild(comp.textNode);
this.size += 1;
this.components[componentId] = comp;
};
BrowserTag.prototype.inject = function inject(componentId, css, name) {
if (!this.ready) this.replaceElement();
var comp = this.components[componentId];
if (!comp) throw new Error('Must add a new component before you can inject css into it');
if (comp.textNode.data === '') comp.textNode.appendData('\n/* sc-component-id: ' + componentId + ' */\n');
comp.textNode.appendData(css);
if (name) {
var existingNames = this.el.getAttribute(SC_ATTR);
this.el.setAttribute(SC_ATTR, existingNames ? existingNames + ' ' + name : name);
}
};
BrowserTag.prototype.toHTML = function toHTML() {
return this.el.outerHTML;
};
BrowserTag.prototype.toReactElement = function toReactElement() {
throw new Error('BrowserTag doesn\'t implement toReactElement!');
};
BrowserTag.prototype.clone = function clone() {
throw new Error('BrowserTag cannot be cloned!');
};
/* Because we care about source order, before we can inject anything we need to
* create a text node for each component and replace the existing CSS. */
BrowserTag.prototype.replaceElement = function replaceElement() {
var _this = this;
this.ready = true;
// We have nothing to inject. Use the current el.
if (this.size === 0) return;
// Build up our replacement style tag
var newEl = this.el.cloneNode();
newEl.appendChild(document.createTextNode('\n'));
Object.keys(this.components).forEach(function (key) {
var comp = _this.components[key];
// eslint-disable-next-line no-param-reassign
comp.textNode = document.createTextNode(comp.cssFromDOM);
newEl.appendChild(comp.textNode);
});
if (!this.el.parentNode) throw new Error("Trying to replace an element that wasn't mounted!");
// The ol' switcheroo
this.el.parentNode.replaceChild(newEl, this.el);
this.el = newEl;
};
return BrowserTag;
}();
/* Factory function to separate DOM operations from logical ones*/
var BrowserStyleSheet = {
create: function create() {
var tags = [];
var names = {};
/* Construct existing state from DOM */
var nodes = document.querySelectorAll('[' + SC_ATTR + ']');
var nodesLength = nodes.length;
for (var i = 0; i < nodesLength; i += 1) {
var el = nodes[i];
tags.push(new BrowserTag(el, el.getAttribute(LOCAL_ATTR) === 'true', el.innerHTML));
var attr = el.getAttribute(SC_ATTR);
if (attr) {
attr.trim().split(/\s+/).forEach(function (name) {
names[name] = true;
});
}
}
/* Factory for making more tags */
var tagConstructor = function tagConstructor(isLocal) {
var el = document.createElement('style');
el.type = 'text/css';
el.setAttribute(SC_ATTR, '');
el.setAttribute(LOCAL_ATTR, isLocal ? 'true' : 'false');
if (!document.head) throw new Error('Missing document <head>');
document.head.appendChild(el);
return new BrowserTag(el, isLocal);
};
return new StyleSheet(tagConstructor, tags, names);
}
};
//
var SC_ATTR = 'data-styled-components';
var LOCAL_ATTR = 'data-styled-components-is-local';
var CONTEXT_KEY = '__styled-components-stylesheet__';
var instance = null;
// eslint-disable-next-line no-use-before-define
var clones = [];
var StyleSheet = function () {
function StyleSheet(tagConstructor) {
var tags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
var names = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
classCallCheck(this, StyleSheet);
this.hashes = {};
this.deferredInjections = {};
this.tagConstructor = tagConstructor;
this.tags = tags;
this.names = names;
this.constructComponentTagMap();
}
StyleSheet.prototype.constructComponentTagMap = function constructComponentTagMap() {
var _this = this;
this.componentTags = {};
this.tags.forEach(function (tag) {
Object.keys(tag.components).forEach(function (componentId) {
_this.componentTags[componentId] = tag;
});
});
};
/* Best level of caching—get the name from the hash straight away. */
StyleSheet.prototype.getName = function getName(hash) {
return this.hashes[hash.toString()];
};
/* Second level of caching—if the name is already in the dom, don't
* inject anything and record the hash for getName next time. */
StyleSheet.prototype.alreadyInjected = function alreadyInjected(hash, name) {
if (!this.names[name]) return false;
this.hashes[hash.toString()] = name;
return true;
};
/* Third type of caching—don't inject components' componentId twice. */
StyleSheet.prototype.hasInjectedComponent = function hasInjectedComponent(componentId) {
return !!this.componentTags[componentId];
};
StyleSheet.prototype.deferredInject = function deferredInject(componentId, isLocal, css) {
if (this === instance) {
clones.forEach(function (clone) {
clone.deferredInject(componentId, isLocal, css);
});
}
this.getOrCreateTag(componentId, isLocal);
this.deferredInjections[componentId] = css;
};
StyleSheet.prototype.inject = function inject(componentId, isLocal, css, hash, name) {
if (this === instance) {
clones.forEach(function (clone) {
clone.inject(componentId, isLocal, css);
});
}
var tag = this.getOrCreateTag(componentId, isLocal);
var deferredInjection = this.deferredInjections[componentId];
if (deferredInjection) {
tag.inject(componentId, deferredInjection);
delete this.deferredInjections[componentId];
}
tag.inject(componentId, css, name);
if (hash && name) {
this.hashes[hash.toString()] = name;
}
};
StyleSheet.prototype.toHTML = function toHTML() {
return this.tags.map(function (tag) {
return tag.toHTML();
}).join('');
};
StyleSheet.prototype.toReactElements = function toReactElements() {
return this.tags.map(function (tag, i) {
return tag.toReactElement('sc-' + i);
});
};
StyleSheet.prototype.getOrCreateTag = function getOrCreateTag(componentId, isLocal) {
var existingTag = this.componentTags[componentId];
if (existingTag) {
return existingTag;
}
var lastTag = this.tags[this.tags.length - 1];
var componentTag = !lastTag || lastTag.isFull() || lastTag.isLocal !== isLocal ? this.createNewTag(isLocal) : lastTag;
this.componentTags[componentId] = componentTag;
componentTag.addComponent(componentId);
return componentTag;
};
StyleSheet.prototype.createNewTag = function createNewTag(isLocal) {
var newTag = this.tagConstructor(isLocal);
this.tags.push(newTag);
return newTag;
};
StyleSheet.reset = function reset(isServer) {
instance = StyleSheet.create(isServer);
};
/* We can make isServer totally implicit once Jest 20 drops and we
* can change environment on a per-test basis. */
StyleSheet.create = function create() {
var isServer = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : typeof document === 'undefined';
return (isServer ? ServerStyleSheet : BrowserStyleSheet).create();
};
StyleSheet.clone = function clone(oldSheet) {
var newSheet = new StyleSheet(oldSheet.tagConstructor, oldSheet.tags.map(function (tag) {
return tag.clone();
}), _extends({}, oldSheet.names));
newSheet.hashes = _extends({}, oldSheet.hashes);
newSheet.deferredInjections = _extends({}, oldSheet.deferredInjections);
clones.push(newSheet);
return newSheet;
};
createClass(StyleSheet, null, [{
key: 'instance',
get: function get() {
return instance || (instance = StyleSheet.create());
}
}]);
return StyleSheet;
}();
function createCommonjsModule(fn, module) {
return module = { exports: {} }, fn(module, module.exports), 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.
*
*
*/
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$1 = function emptyFunction$1() {};
emptyFunction$1.thatReturns = makeEmptyFunction;
emptyFunction$1.thatReturnsFalse = makeEmptyFunction(false);
emptyFunction$1.thatReturnsTrue = makeEmptyFunction(true);
emptyFunction$1.thatReturnsNull = makeEmptyFunction(null);
emptyFunction$1.thatReturnsThis = function () {
return this;
};
emptyFunction$1.thatReturnsArgument = function (arg) {
return arg;
};
var emptyFunction_1 = emptyFunction$1;
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in 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 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) {};
{
validateFormat = function validateFormat(format) {
if (format === undefined) {
throw new Error('invariant requires an error message argument');
}
};
}
function invariant$1(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;
}
}
var invariant_1 = invariant$1;
var emptyFunction$2 = emptyFunction_1;
/**
* 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$1 = emptyFunction$2;
{
(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$1 = function warning$1(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));
}
};
})();
}
var warning_1 = warning$1;
/**
* 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.
*/
var ReactPropTypesSecret$1 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
var ReactPropTypesSecret_1 = ReactPropTypesSecret$1;
{
var invariant$2 = invariant_1;
var warning$2 = warning_1;
var ReactPropTypesSecret$2 = ReactPropTypesSecret_1;
var loggedTypeFailures = {};
}
/**
* Assert that the values match with the type specs.
* Error messages are memorized and will only be shown once.
*
* @param {object} typeSpecs Map of name to a ReactPropType
* @param {object} values Runtime values that need to be type-checked
* @param {string} location e.g. "prop", "context", "child context"
* @param {string} componentName Name of the component for error messages.
* @param {?Function} getStack Returns the component stack.
* @private
*/
function checkPropTypes$1(typeSpecs, values, location, componentName, getStack) {
{
for (var typeSpecName in typeSpecs) {
if (typeSpecs.hasOwnProperty(typeSpecName)) {
var error;
// Prop type validation may throw. In case they do, we don't want to
// fail the render phase where it didn't fail before. So we log it.
// After these have been cleaned up, we'll let them throw.
try {
// This is intentionally an invariant that gets caught. It's the same
// behavior as without this statement except with a better message.
invariant$2(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', componentName || 'React class', location, typeSpecName);
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret$2);
} catch (ex) {
error = ex;
}
warning$2(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error === 'undefined' ? 'undefined' : _typeof(error));
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
// Only monitor this failure once because there tends to be a lot of the
// same error.
loggedTypeFailures[error.message] = true;
var stack = getStack ? getStack() : '';
warning$2(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '');
}
}
}
}
}
var checkPropTypes_1 = checkPropTypes$1;
var emptyFunction = emptyFunction_1;
var invariant = invariant_1;
var warning = warning_1;
var ReactPropTypesSecret = ReactPropTypesSecret_1;
var checkPropTypes = checkPropTypes_1;
var factoryWithTypeCheckers = function factoryWithTypeCheckers(isValidElement, throwOnDirectAccess) {
/* global Symbol */
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
/**
* Returns the iterator method function contained on the iterable object.
*
* Be sure to invoke the function with the iterable as context:
*
* var iteratorFn = getIteratorFn(myIterable);
* if (iteratorFn) {
* var iterator = iteratorFn.call(myIterable);
* ...
* }
*
* @param {?object} maybeIterable
* @return {?function}
*/
function getIteratorFn(maybeIterable) {
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
if (typeof iteratorFn === 'function') {
return iteratorFn;
}
}
/**
* Collection of methods that allow declaration and validation of props that are
* supplied to React components. Example usage:
*
* var Props = require('ReactPropTypes');
* var MyArticle = React.createClass({
* propTypes: {
* // An optional string prop named "description".
* description: Props.string,
*
* // A required enum prop named "category".
* category: Props.oneOf(['News','Photos']).isRequired,
*
* // A prop named "dialog" that requires an instance of Dialog.
* dialog: Props.instanceOf(Dialog).isRequired
* },
* render: function() { ... }
* });
*
* A more formal specification of how these methods are used:
*
* type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
* decl := ReactPropTypes.{type}(.isRequired)?
*
* Each and every declaration produces a function with the same signature. This
* allows the creation of custom validation functions. For example:
*
* var MyLink = React.createClass({
* propTypes: {
* // An optional string or URI prop named "href".
* href: function(props, propName, componentName) {
* var propValue = props[propName];
* if (propValue != null && typeof propValue !== 'string' &&
* !(propValue instanceof URI)) {
* return new Error(
* 'Expected a string or an URI for ' + propName + ' in ' +
* componentName
* );
* }
* }
* },
* render: function() {...}
* });
*
* @internal
*/
var ANONYMOUS = '<<anonymous>>';
// Important!
// Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
var ReactPropTypes = {
array: createPrimitiveTypeChecker('array'),
bool: createPrimitiveTypeChecker('boolean'),
func: createPrimitiveTypeChecker('function'),
number: createPrimitiveTypeChecker('number'),
object: createPrimitiveTypeChecker('object'),
string: createPrimitiveTypeChecker('string'),
symbol: createPrimitiveTypeChecker('symbol'),
any: createAnyTypeChecker(),
arrayOf: createArrayOfTypeChecker,
element: createElementTypeChecker(),
instanceOf: createInstanceTypeChecker,
node: createNodeChecker(),
objectOf: createObjectOfTypeChecker,
oneOf: createEnumTypeChecker,
oneOfType: createUnionTypeChecker,
shape: createShapeTypeChecker
};
/**
* 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) {
{
var manualPropTypeCallCache = {};
var manualPropTypeWarningCount = 0;
}
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
componentName = componentName || ANONYMOUS;
propFullName = propFullName || propName;
if (secret !== ReactPropTypesSecret) {
if (throwOnDirectAccess) {
// New behavior only for users of `prop-types` package
invariant(false, 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use `PropTypes.checkPropTypes()` to call them. ' + 'Read more at http://fb.me/use-check-prop-types');
} else if ("development" !== 'production' && typeof console !== 'undefined') {
// Old behavior for people using React.PropTypes
var cacheKey = componentName + ':' + propName;
if (!manualPropTypeCallCache[cacheKey] &&
// Avoid spamming the console because they are often not actionable except for lib authors
manualPropTypeWarningCount < 3) {
warning(false, 'You are manually calling a React.PropTypes validation ' + 'function for the `%s` prop on `%s`. This is deprecated ' + 'and will throw in the standalone `prop-types` package. ' + 'You may be seeing this warning due to a third-party PropTypes ' + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.', propFullName, componentName);
manualPropTypeCallCache[cacheKey] = true;
manualPropTypeWarningCount++;
}
}
}
if (props[propName] == null) {
if (isRequired) {
if (props[propName] === null) {
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
}
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
}
return null;
} else {
return validate(props, propName, componentName, location, propFullName);
}
}
var chainedCheckType = checkType.bind(null, false);
chainedCheckType.isRequired = checkType.bind(null, true);
return chainedCheckType;
}
function createPrimitiveTypeChecker(expectedType) {
function validate(props, propName, componentName, location, propFullName, secret) {
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== expectedType) {
// `propValue` being instance of, say, date/regexp, pass the 'object'
// check, but we can offer a more precise error message here rather than
// 'of type `object`'.
var preciseType = getPreciseType(propValue);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createAnyTypeChecker() {
return createChainableTypeChecker(emptyFunction.thatReturnsNull);
}
function createArrayOfTypeChecker(typeChecker) {
function validate(props, propName, componentName, location, propFullName) {
if (typeof typeChecker !== 'function') {
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
}
var propValue = props[propName];
if (!Array.isArray(propValue)) {
var propType = getPropType(propValue);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
}
for (var i = 0; i < propValue.length; i++) {
var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
if (error instanceof Error) {
return error;
}
}
return null;
}
return createChainableTypeChecker(validate);
}
function createElementTypeChecker() {
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
if (!isValidElement(propValue)) {
var propType = getPropType(propValue);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createInstanceTypeChecker(expectedClass) {
function validate(props, propName, componentName, location, propFullName) {
if (!(props[propName] instanceof expectedClass)) {
var expectedClassName = expectedClass.name || ANONYMOUS;
var actualClassName = getClassName(props[propName]);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createEnumTypeChecker(expectedValues) {
if (!Array.isArray(expectedValues)) {
warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.');
return emptyFunction.thatReturnsNull;
}
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
for (var i = 0; i < expectedValues.length; i++) {
if (is(propValue, expectedValues[i])) {
return null;
}
}
var valuesString = JSON.stringify(expectedValues);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
}
return createChainableTypeChecker(validate);
}
function createObjectOfTypeChecker(typeChecker) {
function validate(props, propName, componentName, location, propFullName) {
if (typeof typeChecker !== 'function') {
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
}
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== 'object') {
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
}
for (var key in propValue) {
if (propValue.hasOwnProperty(key)) {
var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
if (error instanceof Error) {
return error;
}
}
}
return null;
}
return createChainableTypeChecker(validate);
}
function createUnionTypeChecker(arrayOfTypeCheckers) {
if (!Array.isArray(arrayOfTypeCheckers)) {
warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.');
return emptyFunction.thatReturnsNull;
}
function validate(props, propName, componentName, location, propFullName) {
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
var checker = arrayOfTypeCheckers[i];
if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {
return null;
}
}
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
}
return createChainableTypeChecker(validate);
}
function createNodeChecker() {
function validate(props, propName, componentName, location, propFullName) {
if (!isNode(props[propName])) {
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createShapeTypeChecker(shapeTypes) {
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== 'object') {
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
}
for (var key in shapeTypes) {
var checker = shapeTypes[key];
if (!checker) {
continue;
}
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
if (error) {
return error;
}
}
return null;
}
return createChainableTypeChecker(validate);
}
function isNode(propValue) {
switch (typeof propValue === 'undefined' ? 'undefined' : _typeof(propValue)) {
case 'number':
case 'string':
case 'undefined':
return true;
case 'boolean':
return !propValue;
case 'object':
if (Array.isArray(propValue)) {
return propValue.every(isNode);
}
if (propValue === null || isValidElement(propValue)) {
return true;
}
var iteratorFn = getIteratorFn(propValue);
if (iteratorFn) {
var iterator = iteratorFn.call(propValue);
var step;
if (iteratorFn !== propValue.entries) {
while (!(step = iterator.next()).done) {
if (!isNode(step.value)) {
return false;
}
}
} else {
// Iterator will provide entry [k,v] tuples rather than values.
while (!(step = iterator.next()).done) {
var entry = step.value;
if (entry) {
if (!isNode(entry[1])) {
return false;
}
}
}
}
} else {
return false;
}
return true;
default:
return false;
}
}
function isSymbol(propType, propValue) {
// Native Symbol.
if (propType === 'symbol') {
return true;
}
// 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
if (propValue['@@toStringTag'] === 'Symbol') {
return true;
}
// Fallback for non-spec compliant Symbols which are polyfilled.
if (typeof Symbol === 'function' && propValue instanceof Symbol) {
return true;
}
return false;
}
// Equivalent of `typeof` but with special handling for array and regexp.
function getPropType(propValue) {
var propType = typeof propValue === 'undefined' ? 'undefined' : _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;
}
ReactPropTypes.checkPropTypes = checkPropTypes;
ReactPropTypes.PropTypes = ReactPropTypes;
return ReactPropTypes;
};
var index$3 = createCommonjsModule(function (module) {
/**
* 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.
*/
{
var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol.for && Symbol.for('react.element') || 0xeac7;
var isValidElement = function isValidElement(object) {
return (typeof object === 'undefined' ? 'undefined' : _typeof(object)) === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
};
// By explicitly using `prop-types` you are opting into new development behavior.
// http://fb.me/prop-types-in-prod
var throwOnDirectAccess = true;
module.exports = factoryWithTypeCheckers(isValidElement, throwOnDirectAccess);
}
});
var _StyleSheetManager$ch;
//
var StyleSheetManager = function (_Component) {
inherits(StyleSheetManager, _Component);
function StyleSheetManager() {
classCallCheck(this, StyleSheetManager);
return possibleConstructorReturn(this, _Component.apply(this, arguments));
}
StyleSheetManager.prototype.getChildContext = function getChildContext() {
var _ref;
return _ref = {}, _ref[CONTEXT_KEY] = this.props.sheet, _ref;
};
StyleSheetManager.prototype.render = function render() {
/* eslint-disable react/prop-types */
// $FlowFixMe
return __WEBPACK_IMPORTED_MODULE_1_react___default.a.Children.only(this.props.children);
};
return StyleSheetManager;
}(__WEBPACK_IMPORTED_MODULE_1_react__["Component"]);
StyleSheetManager.childContextTypes = (_StyleSheetManager$ch = {}, _StyleSheetManager$ch[CONTEXT_KEY] = index$3.instanceOf(StyleSheet).isRequired, _StyleSheetManager$ch);
StyleSheetManager.propTypes = {
sheet: index$3.instanceOf(StyleSheet).isRequired
};
//
var ServerTag = function () {
function ServerTag(isLocal) {
classCallCheck(this, ServerTag);
this.isLocal = isLocal;
this.components = {};
this.size = 0;
this.names = [];
}
ServerTag.prototype.isFull = function isFull() {
return false;
};
ServerTag.prototype.addComponent = function addComponent(componentId) {
if (this.components[componentId]) throw new Error('Trying to add Component \'' + componentId + '\' twice!');
this.components[componentId] = { componentId: componentId, css: '' };
this.size += 1;
};
ServerTag.prototype.inject = function inject(componentId, css, name) {
var comp = this.components[componentId];
if (!comp) throw new Error('Must add a new component before you can inject css into it');
if (comp.css === '') comp.css = '/* sc-component-id: ' + componentId + ' */\n';
comp.css += css.replace(/\n*$/, '\n');
if (name) this.names.push(name);
};
ServerTag.prototype.toHTML = function toHTML() {
var _this = this;
var namesAttr = SC_ATTR + '="' + this.names.join(' ') + '"';
var localAttr = LOCAL_ATTR + '="' + (this.isLocal ? 'true' : 'false') + '"';
var css = Object.keys(this.components).map(function (key) {
return _this.components[key].css;
}).join('');
return '<style type="text/css" ' + namesAttr + ' ' + localAttr + '>\n' + css + '\n</style>';
};
ServerTag.prototype.toReactElement = function toReactElement(key) {
var _attributes,
_this2 = this;
var attributes = (_attributes = {}, _attributes[SC_ATTR] = this.names.join(' '), _attributes[LOCAL_ATTR] = this.isLocal.toString(), _attributes);
var css = Object.keys(this.components).map(function (k) {
return _this2.components[k].css;
}).join('');
return __WEBPACK_IMPORTED_MODULE_1_react___default.a.createElement('style', _extends({
key: key, type: 'text/css' }, attributes, {
dangerouslySetInnerHTML: { __html: css }
}));
};
ServerTag.prototype.clone = function clone() {
var _this3 = this;
var copy = new ServerTag(this.isLocal);
copy.names = [].concat(this.names);
copy.size = this.size;
copy.components = Object.keys(this.components).reduce(function (acc, key) {
acc[key] = _extends({}, _this3.components[key]); // eslint-disable-line no-param-reassign
return acc;
}, {});
return copy;
};
return ServerTag;
}();
var ServerStyleSheet = function () {
function ServerStyleSheet() {
classCallCheck(this, ServerStyleSheet);
this.instance = StyleSheet.clone(StyleSheet.instance);
}
ServerStyleSheet.prototype.collectStyles = function collectStyles(children) {
if (this.closed) throw new Error("Can't collect styles once you've called getStyleTags!");
return __WEBPACK_IMPORTED_MODULE_1_react___default.a.createElement(
StyleSheetManager,
{ sheet: this.instance },
children
);
};
ServerStyleSheet.prototype.getStyleTags = function getStyleTags() {
if (!this.closed) {
clones.splice(clones.indexOf(this.instance), 1);
this.closed = true;
}
return this.instance.toHTML();
};
ServerStyleSheet.prototype.getStyleElement = function getStyleElement() {
if (!this.closed) {
clones.splice(clones.indexOf(this.instance), 1);
this.closed = true;
}
return this.instance.toReactElements();
};
ServerStyleSheet.create = function create() {
return new StyleSheet(function (isLocal) {
return new ServerTag(isLocal);
});
};
return ServerStyleSheet;
}();
//
var LIMIT = 200;
var createWarnTooManyClasses = (function (displayName) {
var generatedClasses = {};
var warningSeen = false;
return function (className) {
if (!warningSeen) {
generatedClasses[className] = true;
if (Object.keys(generatedClasses).length >= LIMIT) {
// Unable to find latestRule in test environment.
/* eslint-disable no-console, prefer-template */
console.warn('Over ' + LIMIT + ' classes were generated for component ' + displayName + '. ' + 'Consider using style property for frequently changed styles.\n' + 'Example:\n' + ' const StyledComp = styled.div`width: 100%;`\n' + ' <StyledComp style={{ background: background }} />');
warningSeen = true;
generatedClasses = {};
}
}
};
});
//
/* Trying to avoid the unknown-prop errors on styled components
by filtering by React's attribute whitelist.
*/
/* Logic copied from ReactDOMUnknownPropertyHook */
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,
className: true,
/* List copied from https://facebook.github.io/react/docs/events.html */
onCopy: true,
onCut: true,
onPaste: true,
onCompositionEnd: true,
onCompositionStart: true,
onCompositionUpdate: true,
onKeyDown: true,
onKeyPress: true,
onKeyUp: true,
onFocus: true,
onBlur: true,
onChange: true,
onInput: true,
onSubmit: true,
onClick: true,
onContextMenu: true,
onDoubleClick: true,
onDrag: true,
onDragEnd: true,
onDragEnter: true,
onDragExit: true,
onDragLeave: true,
onDragOver: true,
onDragStart: true,
onDrop: true,
onMouseDown: true,
onMouseEnter: true,
onMouseLeave: true,
onMouseMove: true,
onMouseOut: true,
onMouseOver: true,
onMouseUp: true,
onSelect: true,
onTouchCancel: true,
onTouchEnd: true,
onTouchMove: true,
onTouchStart: true,
onScroll: true,
onWheel: true,
onAbort: true,
onCanPlay: true,
onCanPlayThrough: true,
onDurationChange: true,
onEmptied: true,
onEncrypted: true,
onEnded: true,
onError: true,
onLoadedData: true,
onLoadedMetadata: true,
onLoadStart: true,
onPause: true,
onPlay: true,
onPlaying: true,
onProgress: true,
onRateChange: true,
onSeeked: true,
onSeeking: true,
onStalled: true,
onSuspend: true,
onTimeUpdate: true,
onVolumeChange: true,
onWaiting: true,
onLoad: true,
onAnimationStart: true,
onAnimationEnd: true,
onAnimationIteration: true,
onTransitionEnd: true,
onCopyCapture: true,
onCutCapture: true,
onPasteCapture: true,
onCompositionEndCapture: true,
onCompositionStartCapture: true,
onCompositionUpdateCapture: true,
onKeyDownCapture: true,
onKeyPressCapture: true,
onKeyUpCapture: true,
onFocusCapture: true,
onBlurCapture: true,
onChangeCapture: true,
onInputCapture: true,
onSubmitCapture: true,
onClickCapture: true,
onContextMenuCapture: true,
onDoubleClickCapture: true,
onDragCapture: true,
onDragEndCapture: true,
onDragEnterCapture: true,
onDragExitCapture: true,
onDragLeaveCapture: true,
onDragOverCapture: true,
onDragStartCapture: true,
onDropCapture: true,
onMouseDownCapture: true,
onMouseEnterCapture: true,
onMouseLeaveCapture: true,
onMouseMoveCapture: true,
onMouseOutCapture: true,
onMouseOverCapture: true,
onMouseUpCapture: true,
onSelectCapture: true,
onTouchCancelCapture: true,
onTouchEndCapture: true,
onTouchMoveCapture: true,
onTouchStartCapture: true,
onScrollCapture: true,
onWheelCapture: true,
onAbortCapture: true,
onCanPlayCapture: true,
onCanPlayThroughCapture: true,
onDurationChangeCapture: true,
onEmptiedCapture: true,
onEncryptedCapture: true,
onEndedCapture: true,
onErrorCapture: true,
onLoadedDataCapture: true,
onLoadedMetadataCapture: true,
onLoadStartCapture: true,
onPauseCapture: true,
onPlayCapture: true,
onPlayingCapture: true,
onProgressCapture: true,
onRateChangeCapture: true,
onSeekedCapture: true,
onSeekingCapture: true,
onStalledCapture: true,
onSuspendCapture: true,
onTimeUpdateCapture: true,
onVolumeChangeCapture: true,
onWaitingCapture: true,
onLoadCapture: true,
onAnimationStartCapture: true,
onAnimationEndCapture: true,
onAnimationIterationCapture: true,
onTransitionEndCapture: true
};
/* From HTMLDOMPropertyConfig */
var htmlProps = {
/**
* Standard Properties
*/
accept: true,
acceptCharset: true,
accessKey: true,
action: true,
allowFullScreen: true,
allowTransparency: true,
alt: true,
// specifies target context for links with `preload` type
as: true,
async: true,
autoComplete: true,
// autoFocus is polyfilled/normalized by AutoFocusUtils
// autoFocus: true,
autoPlay: true,
capture: true,
cellPadding: true,
cellSpacing: true,
charSet: true,
challenge: true,
checked: true,
cite: true,
classID: true,
className: true,
cols: true,
colSpan: true,
content: true,
contentEditable: true,
contextMenu: true,
controls: true,
coords: true,
crossOrigin: true,
data: true, // For `<object />` acts as `src`.
dateTime: true,
default: true,
defer: true,
dir: true,
disabled: true,
download: true,
draggable: true,
encType: true,
form: true,
formAction: true,
formEncType: true,
formMethod: true,
formNoValidate: true,
formTarget: true,
frameBorder: true,
headers: true,
height: true,
hidden: true,
high: true,
href: true,
hrefLang: true,
htmlFor: true,
httpEquiv: true,
icon: true,
id: true,
inputMode: true,
integrity: true,
is: true,
keyParams: true,
keyType: true,
kind: true,
label: true,
lang: true,
list: true,
loop: true,
low: true,
manifest: true,
marginHeight: true,
marginWidth: true,
max: true,
maxLength: true,
media: true,
mediaGroup: true,
method: true,
min: true,
minLength: true,
// Caution; `option.selected` is not updated if `select.multiple` is
// disabled with `removeAttribute`.
multiple: true,
muted: true,
name: true,
nonce: true,
noValidate: true,
open: true,
optimum: true,
pattern: true,
placeholder: true,
playsInline: true,
poster: true,
preload: true,
profile: true,
radioGroup: true,
readOnly: true,
referrerPolicy: true,
rel: true,
required: true,
reversed: true,
role: true,
rows: true,
rowSpan: true,
sandbox: true,
scope: true,
scoped: true,
scrolling: true,
seamless: true,
selected: true,
shape: true,
size: true,
sizes: true,
span: true,
spellCheck: true,
src: true,
srcDoc: true,
srcLang: true,
srcSet: true,
start: true,
step: true,
style: true,
summary: true,
tabIndex: true,
target: true,
title: true,
// Setting .type throws on non-<input> tags
type: true,
useMap: true,
value: true,
width: true,
wmode: true,
wrap: true,
/**
* RDFa Properties
*/
about: true,
datatype: true,
inlist: true,
prefix: true,
// property is also supported for OpenGraph in meta tags.
property: true,
resource: true,
typeof: true,
vocab: true,
/**
* Non-standard Properties
*/
// autoCapitalize and autoCorrect are supported in Mobile Safari for
// keyboard hints.
autoCapitalize: true,
autoCorrect: true,
// autoSave allows WebKit/Blink to persist values of input fields on page reloads
autoSave: true,
// color is for Safari mask-icon link
color: true,
// itemProp, itemScope, itemType are for
// Microdata support. See http://schema.org/docs/gs.html
itemProp: true,
itemScope: true,
itemType: true,
// 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: true,
itemRef: true,
// results show looking glass icon and recent searches on input
// search fields in WebKit/Blink
results: true,
// IE-only attribute that specifies security restrictions on an iframe
// as an alternative to the sandbox attribute on IE<10
security: true,
// IE-only attribute that controls focus behavior
unselectable: 0
};
var svgProps = {
accentHeight: true,
accumulate: true,
additive: true,
alignmentBaseline: true,
allowReorder: true,
alphabetic: true,
amplitude: true,
arabicForm: true,
ascent: true,
attributeName: true,
attributeType: true,
autoReverse: true,
azimuth: true,
baseFrequency: true,
baseProfile: true,
baselineShift: true,
bbox: true,
begin: true,
bias: true,
by: true,
calcMode: true,
capHeight: true,
clip: true,
clipPath: true,
clipRule: true,
clipPathUnits: true,
colorInterpolation: true,
colorInterpolationFilters: true,
colorProfile: true,
colorRendering: true,
contentScriptType: true,
contentStyleType: true,
cursor: true,
cx: true,
cy: true,
d: true,
decelerate: true,
descent: true,
diffuseConstant: true,
direction: true,
display: true,
divisor: true,
dominantBaseline: true,
dur: true,
dx: true,
dy: true,
edgeMode: true,
elevation: true,
enableBackground: true,
end: true,
exponent: true,
externalResourcesRequired: true,
fill: true,
fillOpacity: true,
fillRule: true,
filter: true,
filterRes: true,
filterUnits: true,
floodColor: true,
floodOpacity: true,
focusable: true,
fontFamily: true,
fontSize: true,
fontSizeAdjust: true,
fontStretch: true,
fontStyle: true,
fontVariant: true,
fontWeight: true,
format: true,
from: true,
fx: true,
fy: true,
g1: true,
g2: true,
glyphName: true,
glyphOrientationHorizontal: true,
glyphOrientationVertical: true,
glyphRef: true,
gradientTransform: true,
gradientUnits: true,
hanging: true,
horizAdvX: true,
horizOriginX: true,
ideographic: true,
imageRendering: true,
in: true,
in2: true,
intercept: true,
k: true,
k1: true,
k2: true,
k3: true,
k4: true,
kernelMatrix: true,
kernelUnitLength: true,
kerning: true,
keyPoints: true,
keySplines: true,
keyTimes: true,
lengthAdjust: true,
letterSpacing: true,
lightingColor: true,
limitingConeAngle: true,
local: true,
markerEnd: true,
markerMid: true,
markerStart: true,
markerHeight: true,
markerUnits: true,
markerWidth: true,
mask: true,
maskContentUnits: true,
maskUnits: true,
mathematical: true,
mode: true,
numOctaves: true,
offset: true,
opacity: true,
operator: true,
order: true,
orient: true,
orientation: true,
origin: true,
overflow: true,
overlinePosition: true,
overlineThickness: true,
paintOrder: true,
panose1: true,
pathLength: true,
patternContentUnits: true,
patternTransform: true,
patternUnits: true,
pointerEvents: true,
points: true,
pointsAtX: true,
pointsAtY: true,
pointsAtZ: true,
preserveAlpha: true,
preserveAspectRatio: true,
primitiveUnits: true,
r: true,
radius: true,
refX: true,
refY: true,
renderingIntent: true,
repeatCount: true,
repeatDur: true,
requiredExtensions: true,
requiredFeatures: true,
restart: true,
result: true,
rotate: true,
rx: true,
ry: true,
scale: true,
seed: true,
shapeRendering: true,
slope: true,
spacing: true,
specularConstant: true,
specularExponent: true,
speed: true,
spreadMethod: true,
startOffset: true,
stdDeviation: true,
stemh: true,
stemv: true,
stitchTiles: true,
stopColor: true,
stopOpacity: true,
strikethroughPosition: true,
strikethroughThickness: true,
string: true,
stroke: true,
strokeDasharray: true,
strokeDashoffset: true,
strokeLinecap: true,
strokeLinejoin: true,
strokeMiterlimit: true,
strokeOpacity: true,
strokeWidth: true,
surfaceScale: true,
systemLanguage: true,
tableValues: true,
targetX: true,
targetY: true,
textAnchor: true,
textDecoration: true,
textRendering: true,
textLength: true,
to: true,
transform: true,
u1: true,
u2: true,
underlinePosition: true,
underlineThickness: true,
unicode: true,
unicodeBidi: true,
unicodeRange: true,
unitsPerEm: true,
vAlphabetic: true,
vHanging: true,
vIdeographic: true,
vMathematical: true,
values: true,
vectorEffect: true,
version: true,
vertAdvY: true,
vertOriginX: true,
vertOriginY: true,
viewBox: true,
viewTarget: true,
visibility: true,
widths: true,
wordSpacing: true,
writingMode: true,
x: true,
xHeight: true,
x1: true,
x2: true,
xChannelSelector: true,
xlinkActuate: true,
xlinkArcrole: true,
xlinkHref: true,
xlinkRole: true,
xlinkShow: true,
xlinkTitle: true,
xlinkType: true,
xmlBase: true,
xmlns: true,
xmlnsXlink: true,
xmlLang: true,
xmlSpace: true,
y: true,
y1: true,
y2: true,
yChannelSelector: true,
z: true,
zoomAndPan: true
};
/* From DOMProperty */
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';
var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + '\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040';
var isCustomAttribute = RegExp.prototype.test.bind(new RegExp('^(data|aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$'));
var hasOwnProperty = {}.hasOwnProperty;
var validAttr = (function (name) {
return hasOwnProperty.call(htmlProps, name) || hasOwnProperty.call(svgProps, name) || isCustomAttribute(name.toLowerCase()) || hasOwnProperty.call(reactProps, name);
});
//
function isTag(target) /* : %checks */{
return typeof target === 'string';
}
//
function isStyledComponent(target) /* : %checks */{
return typeof target === 'function' && typeof target.styledComponentId === 'string';
}
//
/* eslint-disable no-undef */
function getComponentName(target) {
return target.displayName || target.name || 'Component';
}
var index$4 = isFunction;
var toString = Object.prototype.toString;
function isFunction(fn) {
var string = toString.call(fn);
return string === '[object Function]' || typeof fn === 'function' && string !== '[object RegExp]' || typeof window !== 'undefined' && (
// IE8 and below
fn === window.setTimeout || fn === window.alert || fn === window.confirm || fn === window.prompt);
}
//
/**
* Creates a broadcast that can be listened to, i.e. simple event emitter
*
* @see https://github.com/ReactTraining/react-broadcast
*/
var createBroadcast = function createBroadcast(initialValue) {
var listeners = [];
var currentValue = initialValue;
return {
publish: function publish(value) {
currentValue = value;
listeners.forEach(function (listener) {
return listener(currentValue);
});
},
subscribe: function subscribe(listener) {
listeners.push(listener);
// Publish to this subscriber once immediately.
listener(currentValue);
return function () {
listeners = listeners.filter(function (item) {
return item !== listener;
});
};
}
};
};
var _ThemeProvider$childC;
var _ThemeProvider$contex;
//
/* globals React$Element */
// NOTE: DO NOT CHANGE, changing this is a semver major change!
var CHANNEL = '__styled-components__';
/**
* Provide a theme to an entire react component tree via context and event listeners (have to do
* both context and event emitter as pure components block context updates)
*/
var ThemeProvider = function (_Component) {
inherits(ThemeProvider, _Component);
function ThemeProvider() {
classCallCheck(this, ThemeProvider);
var _this = possibleConstructorReturn(this, _Component.call(this));
_this.getTheme = _this.getTheme.bind(_this);
return _this;
}
ThemeProvider.prototype.componentWillMount = function componentWillMount() {
var _this2 = this;
// If there is a ThemeProvider wrapper anywhere around this theme provider, merge this theme
// with the outer theme
if (this.context[CHANNEL]) {
var subscribe = this.context[CHANNEL];
this.unsubscribeToOuter = subscribe(function (theme) {
_this2.outerTheme = theme;
});
}
this.broadcast = createBroadcast(this.getTheme());
};
ThemeProvider.prototype.getChildContext = function getChildContext() {
var _babelHelpers$extends;
return _extends({}, this.context, (_babelHelpers$extends = {}, _babelHelpers$extends[CHANNEL] = this.broadcast.subscribe, _babelHelpers$extends));
};
ThemeProvider.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
if (this.props.theme !== nextProps.theme) this.broadcast.publish(this.getTheme(nextProps.theme));
};
ThemeProvider.prototype.componentWillUnmount = function componentWillUnmount() {
if (this.context[CHANNEL]) {
this.unsubscribeToOuter();
}
};
// Get the theme from the props, supporting both (outerTheme) => {} as well as object notation
ThemeProvider.prototype.getTheme = function getTheme(passedTheme) {
var theme = passedTheme || this.props.theme;
if (index$4(theme)) {
var mergedTheme = theme(this.outerTheme);
if (!index(mergedTheme)) {
throw new Error('[ThemeProvider] Please return an object from your theme function, i.e. theme={() => ({})}!');
}
return mergedTheme;
}
if (!index(theme)) {
throw new Error('[ThemeProvider] Please make your theme prop a plain object');
}
return _extends({}, this.outerTheme, theme);
};
ThemeProvider.prototype.render = function render() {
if (!this.props.children) {
return null;
}
return __WEBPACK_IMPORTED_MODULE_1_react___default.a.Children.only(this.props.children);
};
return ThemeProvider;
}(__WEBPACK_IMPORTED_MODULE_1_react__["Component"]);
ThemeProvider.childContextTypes = (_ThemeProvider$childC = {}, _ThemeProvider$childC[CHANNEL] = index$3.func.isRequired, _ThemeProvider$childC);
ThemeProvider.contextTypes = (_ThemeProvider$contex = {}, _ThemeProvider$contex[CHANNEL] = index$3.func, _ThemeProvider$contex);
var _AbstractStyledCompon;
//
var AbstractStyledComponent = function (_Component) {
inherits(AbstractStyledComponent, _Component);
function AbstractStyledComponent() {
classCallCheck(this, AbstractStyledComponent);
return possibleConstructorReturn(this, _Component.apply(this, arguments));
}
return AbstractStyledComponent;
}(__WEBPACK_IMPORTED_MODULE_1_react__["Component"]);
AbstractStyledComponent.contextTypes = (_AbstractStyledCompon = {}, _AbstractStyledCompon[CHANNEL] = index$3.func, _AbstractStyledCompon[CONTEXT_KEY] = index$3.instanceOf(StyleSheet), _AbstractStyledCompon);
//
var escapeRegex = /[[\].#*$><+~=|^:(),"'`]/g;
var multiDashRegex = /--+/g;
var _StyledComponent = (function (ComponentStyle, constructWithOptions) {
/* We depend on components having unique IDs */
var identifiers = {};
var generateId = function generateId(_displayName) {
var displayName = typeof _displayName !== 'string' ? 'sc' : _displayName.replace(escapeRegex, '-') // Replace all possible CSS selectors
.replace(multiDashRegex, '-'); // Replace multiple -- with single -
var nr = (identifiers[displayName] || 0) + 1;
identifiers[displayName] = nr;
var hash = ComponentStyle.generateName(displayName + nr);
return displayName + '-' + hash;
};
var BaseStyledComponent = function (_AbstractStyledCompon) {
inherits(BaseStyledComponent, _AbstractStyledCompon);
function BaseStyledComponent() {
var _temp, _this, _ret;
classCallCheck(this, BaseStyledComponent);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = possibleConstructorReturn(this, _AbstractStyledCompon.call.apply(_AbstractStyledCompon, [this].concat(args))), _this), _this.attrs = {}, _this.state = {
theme: null,
generatedClassName: ''
}, _temp), possibleConstructorReturn(_this, _ret);
}
BaseStyledComponent.prototype.buildExecutionContext = function buildExecutionContext(theme, props) {
var attrs = this.constructor.attrs;
var context = _extends({}, props, { theme: theme });
if (attrs === undefined) {
return context;
}
this.attrs = Object.keys(attrs).reduce(function (acc, key) {
var attr = attrs[key];
// eslint-disable-next-line no-param-reassign
acc[key] = typeof attr === 'function' ? attr(context) : attr;
return acc;
}, {});
return _extends({}, context, this.attrs);
};
BaseStyledComponent.prototype.generateAndInjectStyles = function generateAndInjectStyles(theme, props) {
var _constructor = this.constructor,
componentStyle = _constructor.componentStyle,
warnTooManyClasses = _constructor.warnTooManyClasses;
var executionContext = this.buildExecutionContext(theme, props);
var styleSheet = this.context[CONTEXT_KEY] || StyleSheet.instance;
var className = componentStyle.generateAndInjectStyles(executionContext, styleSheet);
if (warnTooManyClasses !== undefined) warnTooManyClasses(className);
return className;
};
BaseStyledComponent.prototype.componentWillMount = function componentWillMount() {
var _this2 = this;
// If there is a theme in the context, subscribe to the event emitter. This
// is necessary due to pure components blocking context updates, this circumvents
// that by updating when an event is emitted
if (this.context[CHANNEL]) {
var subscribe = this.context[CHANNEL];
this.unsubscribe = subscribe(function (nextTheme) {
// This will be called once immediately
// Props should take precedence over ThemeProvider, which should take precedence over
// defaultProps, but React automatically puts defaultProps on props.
var defaultProps = _this2.constructor.defaultProps;
var isDefaultTheme = defaultProps && _this2.props.theme === defaultProps.theme;
var theme = _this2.props.theme && !isDefaultTheme ? _this2.props.theme : nextTheme;
var generatedClassName = _this2.generateAndInjectStyles(theme, _this2.props);
_this2.setState({ theme: theme, generatedClassName: generatedClassName });
});
} else {
var theme = this.props.theme || {};
var generatedClassName = this.generateAndInjectStyles(theme, this.props);
this.setState({ theme: theme, generatedClassName: generatedClassName });
}
};
BaseStyledComponent.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
var _this3 = this;
this.setState(function (oldState) {
// Props should take precedence over ThemeProvider, which should take precedence over
// defaultProps, but React automatically puts defaultProps on props.
var defaultProps = _this3.constructor.defaultProps;
var isDefaultTheme = defaultProps && nextProps.theme === defaultProps.theme;
var theme = nextProps.theme && !isDefaultTheme ? nextProps.theme : oldState.theme;
var generatedClassName = _this3.generateAndInjectStyles(theme, nextProps);
return { theme: theme, generatedClassName: generatedClassName };
});
};
BaseStyledComponent.prototype.componentWillUnmount = function componentWillUnmount() {
if (this.unsubscribe) {
this.unsubscribe();
}
};
BaseStyledComponent.prototype.render = function render() {
var _this4 = this;
var innerRef = this.props.innerRef;
var generatedClassName = this.state.generatedClassName;
var _constructor2 = this.constructor,
styledComponentId = _constructor2.styledComponentId,
target = _constructor2.target;
var isTargetTag = isTag(target);
var className = [this.props.className, styledComponentId, this.attrs.className, generatedClassName].filter(Boolean).join(' ');
var baseProps = _extends({}, this.attrs, {
className: className
});
if (isStyledComponent(target)) {
baseProps.innerRef = innerRef;
} else {
baseProps.ref = innerRef;
}
var propsForElement = Object.keys(this.props).reduce(function (acc, propName) {
// Don't pass through non HTML tags through to HTML elements
// always omit innerRef
if (propName !== 'innerRef' && propName !== 'className' && (!isTargetTag || validAttr(propName))) {
// eslint-disable-next-line no-param-reassign
acc[propName] = _this4.props[propName];
}
return acc;
}, baseProps);
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1_react__["createElement"])(target, propsForElement);
};
return BaseStyledComponent;
}(AbstractStyledComponent);
var createStyledComponent = function createStyledComponent(target, options, rules) {
var _StyledComponent$cont;
var _options$displayName = options.displayName,
displayName = _options$displayName === undefined ? isTag(target) ? 'styled.' + target : 'Styled(' + getComponentName(target) + ')' : _options$displayName,
_options$componentId = options.componentId,
componentId = _options$componentId === undefined ? generateId(options.displayName) : _options$componentId,
_options$ParentCompon = options.ParentComponent,
ParentComponent = _options$ParentCompon === undefined ? BaseStyledComponent : _options$ParentCompon,
extendingRules = options.rules,
attrs = options.attrs;
var styledComponentId = options.displayName && options.componentId ? options.displayName + '-' + options.componentId : componentId;
var warnTooManyClasses = void 0;
if (typeof process !== 'undefined' && "development" !== 'production') {
warnTooManyClasses = createWarnTooManyClasses(displayName);
}
var componentStyle = new ComponentStyle(extendingRules === undefined ? rules : extendingRules.concat(rules), styledComponentId);
var StyledComponent = function (_ParentComponent) {
inherits(StyledComponent, _ParentComponent);
function StyledComponent() {
classCallCheck(this, StyledComponent);
return possibleConstructorReturn(this, _ParentComponent.apply(this, arguments));
}
StyledComponent.withComponent = function withComponent(tag) {
var _ = options.displayName,
__ = options.componentId,
optionsToCopy = objectWithoutProperties(options, ['displayName', 'componentId']);
var newOptions = _extends({}, optionsToCopy, { ParentComponent: StyledComponent });
return createStyledComponent(tag, newOptions, rules);
};
createClass(StyledComponent, null, [{
key: 'extend',
get: function get() {
var _ = options.displayName,
__ = options.componentId,
optionsToCopy = objectWithoutProperties(options, ['displayName', 'componentId']);
var newOptions = _extends({}, optionsToCopy, { rules: rules, ParentComponent: StyledComponent });
return constructWithOptions(createStyledComponent, target, newOptions);
}
}]);
return StyledComponent;
}(ParentComponent);
StyledComponent.contextTypes = (_StyledComponent$cont = {}, _StyledComponent$cont[CHANNEL] = index$3.func, _StyledComponent$cont[CONTEXT_KEY] = index$3.instanceOf(StyleSheet), _StyledComponent$cont);
StyledComponent.displayName = displayName;
StyledComponent.styledComponentId = styledComponentId;
StyledComponent.attrs = attrs;
StyledComponent.componentStyle = componentStyle;
StyledComponent.warnTooManyClasses = warnTooManyClasses;
StyledComponent.target = target;
return StyledComponent;
};
return createStyledComponent;
});
// murmurhash2 via https://gist.github.com/raycmorgan/588423
function doHash(str, seed) {
var m = 0x5bd1e995;
var r = 24;
var h = seed ^ str.length;
var length = str.length;
var currentIndex = 0;
while (length >= 4) {
var k = UInt32(str, currentIndex);
k = Umul32(k, m);
k ^= k >>> r;
k = Umul32(k, m);
h = Umul32(h, m);
h ^= k;
currentIndex += 4;
length -= 4;
}
switch (length) {
case 3:
h ^= UInt16(str, currentIndex);
h ^= str.charCodeAt(currentIndex + 2) << 16;
h = Umul32(h, m);
break;
case 2:
h ^= UInt16(str, currentIndex);
h = Umul32(h, m);
break;
case 1:
h ^= str.charCodeAt(currentIndex);
h = Umul32(h, m);
break;
}
h ^= h >>> 13;
h = Umul32(h, m);
h ^= h >>> 15;
return h >>> 0;
}
function UInt32(str, pos) {
return str.charCodeAt(pos++) + (str.charCodeAt(pos++) << 8) + (str.charCodeAt(pos++) << 16) + (str.charCodeAt(pos) << 24);
}
function UInt16(str, pos) {
return str.charCodeAt(pos++) + (str.charCodeAt(pos++) << 8);
}
function Umul32(n, m) {
n = n | 0;
m = m | 0;
var nlo = n & 0xffff;
var nhi = n >>> 16;
var res = nlo * m + ((nhi * m & 0xffff) << 16) | 0;
return res;
}
//
/*
ComponentStyle is all the CSS-specific stuff, not
the React-specific stuff.
*/
var _ComponentStyle = (function (nameGenerator, flatten, stringifyRules) {
var ComponentStyle = function () {
function ComponentStyle(rules, componentId) {
classCallCheck(this, ComponentStyle);
this.rules = rules;
this.componentId = componentId;
if (!StyleSheet.instance.hasInjectedComponent(this.componentId)) {
var placeholder = '.' + componentId + ' {}';
StyleSheet.instance.deferredInject(componentId, true, placeholder);
}
}
/*
* Flattens a rule set into valid CSS
* Hashes it, wraps the whole chunk in a .hash1234 {}
* Returns the hash to be injected on render()
* */
ComponentStyle.prototype.generateAndInjectStyles = function generateAndInjectStyles(executionContext, styleSheet) {
var flatCSS = flatten(this.rules, executionContext);
var hash = doHash(this.componentId + flatCSS.join(''));
var existingName = styleSheet.getName(hash);
if (existingName) return existingName;
var name = nameGenerator(hash);
if (styleSheet.alreadyInjected(hash, name)) return name;
var css = '\n' + stringifyRules(flatCSS, '.' + name);
styleSheet.inject(this.componentId, true, css, hash, name);
return name;
};
ComponentStyle.generateName = function generateName(str) {
return nameGenerator(doHash(str));
};
return ComponentStyle;
}();
return ComponentStyle;
});
//
// Thanks to ReactDOMFactories for this handy list!
var domElements = ['a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'main', 'map', 'mark', 'menu', 'menuitem', 'meta', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'u', 'ul', 'var', 'video', 'wbr',
// SVG
'circle', 'clipPath', 'defs', 'ellipse', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'svg', 'text', 'tspan'];
//
var _styled = (function (styledComponent, constructWithOptions) {
var styled = function styled(tag) {
return constructWithOptions(styledComponent, tag);
};
// Shorthands for all valid HTML Elements
domElements.forEach(function (domElement) {
styled[domElement] = styled(domElement);
});
return styled;
});
//
var replaceWhitespace = function replaceWhitespace(str) {
return str.replace(/\s|\\n/g, '');
};
var _keyframes = (function (nameGenerator, stringifyRules, css) {
return function (strings) {
for (var _len = arguments.length, interpolations = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
interpolations[_key - 1] = arguments[_key];
}
var rules = css.apply(undefined, [strings].concat(interpolations));
var hash = doHash(replaceWhitespace(JSON.stringify(rules)));
var existingName = StyleSheet.instance.getName(hash);
if (existingName) return existingName;
var name = nameGenerator(hash);
if (StyleSheet.instance.alreadyInjected(hash, name)) return name;
var generatedCSS = stringifyRules(rules, name, '@keyframes');
StyleSheet.instance.inject('sc-keyframes-' + name, true, generatedCSS, hash, name);
return name;
};
});
//
var _injectGlobal = (function (stringifyRules, css) {
var injectGlobal = function injectGlobal(strings) {
for (var _len = arguments.length, interpolations = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
interpolations[_key - 1] = arguments[_key];
}
var rules = css.apply(undefined, [strings].concat(interpolations));
var hash = doHash(JSON.stringify(rules));
var componentId = 'sc-global-' + hash;
if (StyleSheet.instance.hasInjectedComponent(componentId)) return;
StyleSheet.instance.inject(componentId, false, stringifyRules(rules));
};
return injectGlobal;
});
//
var _constructWithOptions = (function (css) {
var constructWithOptions = function constructWithOptions(componentConstructor, tag) {
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
if (typeof tag !== 'string' && typeof tag !== 'function') {
// $FlowInvalidInputTest
throw new Error('Cannot create styled-component for component: ' + tag);
}
/* This is callable directly as a template function */
var templateFunction = function templateFunction(strings) {
for (var _len = arguments.length, interpolations = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
interpolations[_key - 1] = arguments[_key];
}
return componentConstructor(tag, options, css.apply(undefined, [strings].concat(interpolations)));
};
/* If config methods are called, wrap up a new template function and merge options */
templateFunction.withConfig = function (config) {
return constructWithOptions(componentConstructor, tag, _extends({}, options, config));
};
templateFunction.attrs = function (attrs) {
return constructWithOptions(componentConstructor, tag, _extends({}, options, {
attrs: _extends({}, options.attrs || {}, attrs) }));
};
return templateFunction;
};
return constructWithOptions;
});
/**
* Copyright 2015, Yahoo! Inc.
* Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
*/
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';
var index$5 = 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;
};
//
/* globals ReactClass */
var wrapWithTheme = function wrapWithTheme(Component$$1) {
var _WithTheme$contextTyp;
var componentName = Component$$1.displayName || Component$$1.name || 'Component';
var isStyledComponent$$1 = isStyledComponent(Component$$1);
var WithTheme = function (_React$Component) {
inherits(WithTheme, _React$Component);
function WithTheme() {
var _temp, _this, _ret;
classCallCheck(this, WithTheme);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = {}, _temp), possibleConstructorReturn(_this, _ret);
}
// NOTE: This is so that isStyledComponent passes for the innerRef unwrapping
WithTheme.prototype.componentWillMount = function componentWillMount() {
var _this2 = this;
if (!this.context[CHANNEL]) {
throw new Error('[withTheme] Please use ThemeProvider to be able to use withTheme');
}
var subscribe = this.context[CHANNEL];
this.unsubscribe = subscribe(function (theme) {
_this2.setState({ theme: theme });
});
};
WithTheme.prototype.componentWillUnmount = function componentWillUnmount() {
if (typeof this.unsubscribe === 'function') this.unsubscribe();
};
WithTheme.prototype.render = function render() {
// eslint-disable-next-line react/prop-types
var innerRef = this.props.innerRef;
var theme = this.state.theme;
return __WEBPACK_IMPORTED_MODULE_1_react___default.a.createElement(Component$$1, _extends({
theme: theme
}, this.props, {
innerRef: isStyledComponent$$1 ? innerRef : undefined,
ref: isStyledComponent$$1 ? undefined : innerRef
}));
};
return WithTheme;
}(__WEBPACK_IMPORTED_MODULE_1_react___default.a.Component);
WithTheme.displayName = 'WithTheme(' + componentName + ')';
WithTheme.styledComponentId = 'withTheme';
WithTheme.contextTypes = (_WithTheme$contextTyp = {}, _WithTheme$contextTyp[CHANNEL] = index$3.func, _WithTheme$contextTyp);
return index$5(WithTheme, Component$$1);
};
//
/* Import singletons */
/* Import singleton constructors */
/* Import components */
/* Import Higher Order Components */
/* Instantiate singletons */
var ComponentStyle = _ComponentStyle(generateAlphabeticName, flatten, stringifyRules);
var constructWithOptions = _constructWithOptions(css);
var StyledComponent = _StyledComponent(ComponentStyle, constructWithOptions);
/* Instantiate exported singletons */
var keyframes = _keyframes(generateAlphabeticName, stringifyRules, css);
var injectGlobal = _injectGlobal(stringifyRules, css);
var styled = _styled(StyledComponent, constructWithOptions);
/* harmony default export */ __webpack_exports__["a"] = (styled);
/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(45)))
/***/ }),
/* 353 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {/*
* __ ___
* _____/ /___ __/ (_)____
* / ___/ __/ / / / / / ___/
* (__ ) /_/ /_/ / / (__ )
* /____/\__/\__, /_/_/____/
* /____/
*
* stylis is a feature-rich css preprocessor
*
* @licence MIT
*/
(function (factory) {
if (true) {
module.exports = factory(global);
}
else if (typeof define === 'function' && define.amd) {
define(factory(window));
}
else {
window.stylis = factory(window);
}
}(function (window) {
'use strict';
// plugins
var plugins = [];
// regular expressions
var andPattern = /&/g;
var splitPattern = /,\f/g;
var globalPattern = /:global\(%?((?:[^\(\)\[\]]*|\[.*\]|\([^\(\)]*\))*)\)/g;
var globalsPattern = /(?:&| ):global\(%?((?:[^\(\)\[\]]*|\[.*\]|\([^\(\)]*\))*)\)/g;
// prefixes
var moz = '-moz-';
var ms = '-ms-';
var webkit = '-webkit-';
/**
* css preprocessor
*
* @param {String} selector - i.e `.class` or `#id` or `[attr=id]`
* @param {String} styles - css string
* @param {Boolean=} animations - prefix animations and keyframes, true by default
* @param {Boolean=} compact - enable additional shadow dom features(:host, :host-context)
* @param {Function} middleware
* @return {string}
*/
function stylis (selector, styles, animations, compact, middleware) {
selector += '';
var prefix = '';
var namespace = '';
var type = selector.charCodeAt(0);
var char;
var character;
var attr;
var animns;
// [ attr selector
if (type === 91) {
// `[data-id=namespace]` -> ['data-id', 'namespace']
attr = selector.substring(1, selector.length - 1).split('=');
char = (namespace = attr[1]).charCodeAt(0);
// [data-id="namespace"]/[data-id='namespace']
// --> "namespace"/'namspace' --> namespace
if (char === 34 || char === 39) {
namespace = namespace.substring(1, namespace.length - 1);
}
prefix = '['+ attr[0] + '="' + namespace +'"]';
}
// `#` `.` `>` id class and descendant selectors
else if (type === 35 || type === 46 || type === 62) {
namespace = (prefix = selector).substring(1);
}
// element selector
else {
namespace = prefix = selector;
}
// reset type signature
type = 0;
// animation and keyframe namespace
if (animations == undefined || animations === true) {
animations = true;
animns = namespace;
}
else {
animns = '';
animations = false;
}
// middleware
var has;
var uses = middleware != null;
var length = plugins.length;
if (uses === true) {
has = (typeof middleware).charCodeAt(0);
// o, object/array
if (has === 111) {
use(middleware);
}
// f, function
else if (has === 102) {
plugins[length++] = middleware;
}
else {
uses = false;
}
}
if (length !== 0) {
middleware = length === 1 ? plugins[0] : function (ctx, str, line, col, prefix, length) {
var output = str;
for (var i = 0, l = plugins.length; i < l; i++) {
output = plugins[i](ctx, output, line, col, prefix, length) || output;
}
if (output !== str) {
return output;
}
};
uses = true;
}
// declare
var colon;
var inner;
var selectors;
var build;
var media;
var temp;
var prev;
var indexOf;
var first;
var second;
var third;
var sel;
var blob;
var nest;
var query;
var str;
var regex;
// buffers
var buff = '';
var blck = '';
var flat = '';
// character code
var code = 0;
var nextcode;
// context signatures
var special = 0;
var close = 0;
var closed = 0;
var nested = 0;
var func = 0;
var medias = 0;
var strings = 0;
var globs = 0;
var isplace = 0;
// context(flat) signatures
var levels = 0;
var level = 0;
// comments
var comment = 0;
var comblck = 0;
var comline = 0;
// pre-process
if (uses === true) {
temp = middleware(0, styles, line, column, prefix, 0);
if (temp != null) {
styles = temp;
}
str = '';
}
// positions
var caret = 0;
var depth = 0;
var column = 0;
var line = 1;
var eof = styles.length;
// compiled output
var output = '';
// parse + compile
while (caret < eof) {
code = styles.charCodeAt(caret);
// {, }, ; characters, parse line by line
if (strings === 0 && func === 0 && comment === 0 &&
(
// {, }, ;
(code === 123 || code === 125 || code === 59)
||
// eof buffer
(
(caret === eof - 1) && buff.length !== 0
)
)
) {
buff += styles.charAt(caret);
// middleware, selector/property context, }
if (uses === true && code !== 125) {
// { pre-processed selector context
if (code === 123) {
temp = middleware(
1,
buff.substring(0, buff.length - 1).trim(),
line,
column,
prefix,
output.length
);
}
// ; property context
else {
temp = middleware(2, buff, line, column, prefix, output.length);
}
if (temp != null) {
buff = code === 123 ? temp + ' {' : temp;
}
}
first = buff.charCodeAt(0);
// only trim when the first character is a space ` `
if (first === 32) {
first = (buff = buff.trim()).charCodeAt(0);
}
second = buff.charCodeAt(1);
third = buff.charCodeAt(2);
// @, special block
if (first === 64) {
// push flat css
if (levels === 1 && flat.length !== 0) {
levels = 0;
flat = prefix + ' {' + flat + '}';
// middleware, flat context
if (uses === true) {
temp = middleware(4, flat, line, column, prefix, output.length);
if (temp != null) {
flat = temp;
}
}
output += flat;
flat = '';
}
// ;
if (code !== 59) {
// @keyframe, `k`
if (second === 107) {
blob = buff.substring(1, 11) + animns + buff.substring(11);
buff = '@' + webkit + blob;
type = 1;
}
// @media `m` character, @global `g` character
else if ((second === 109 && third === 101) || (second === 103)) {
// nested
if (depth !== 0) {
// discard first character {
caret++;
column++;
if (media === undefined) {
media = '';
}
temp = '';
inner = '';
selectors = prev.split(splitPattern);
// keep track of opening `{` and `}` occurrences
closed = 1;
// travel to the end of the block
while (caret < eof) {
char = styles.charCodeAt(caret);
// {, }, nested blocks may have nested blocks
if (char === 123) {
closed++;
}
else if (char === 125) {
closed--;
}
// break when the nested block has ended
if (closed === 0) {
break;
}
// build content of nested block
inner += styles.charAt(caret++);
// move column and line position
column = (char === 13 || char === 10) ? (line++, 0) : column + 1;
}
length = selectors.length;
for (var i = 0; i < length; i++) {
selector = selectors[i];
// build media block
temp += stylis(
// remove { on last selector
(i === length - 1 ? selector.substring(0, selector.length - 1) : selector).trim(),
inner,
animations,
compact,
middleware
);
}
media += buff + temp + '}';
buff = '';
medias = 1;
type = 4;
}
// top-level
else {
type = 2;
query = buff;
buff = '';
}
}
// unknown
else {
type = 6;
}
}
// flag special, i.e @keyframes, @font-face ...
if (type !== 4 && code !== 59 && second !== 105) {
// k, m
if (second !== 107 && second !== 109 && second !== 103) {
type = 5;
}
close = -1;
special++;
}
}
// property/selector
else {
// { character, selector declaration
if (code === 123) {
depth++;
// push flat css
if (levels === 1 && flat.length !== 0) {
levels = 0;
flat = prefix + ' {' + flat + '}';
// middleware, flat context
if (uses === true) {
temp = middleware(4, flat, line, column, prefix, output.length);
if (temp != null) {
flat = temp;
}
}
output += flat;
flat = '';
}
// nested selector
if (depth === 2) {
// discard first character {
caret++;
column++;
// inner content of block
inner = '';
var nestSelector = buff.substring(0, buff.length - 1).split(splitPattern);
var prevSelector = prev.substring(0, prev.length - 1).split(splitPattern);
// keep track of opening `{` and `}` occurrences
closed = 1;
// travel to the end of the block
while (caret < eof) {
char = styles.charCodeAt(caret);
// {, nested blocks may have nested blocks
if (char === 123) {
closed++;
}
// },
else if (char === 125) {
closed--;
}
// break when the nested block has ended
if (closed === 0) {
break;
}
// build content of nested block
inner += styles.charAt(caret++);
// move column and line position
column = (char === 13 || char === 10) ? (line++, 0) : column + 1;
}
// handle multiple selectors: h1, h2 { div, h4 {} } should generate
// -> h1 div, h2 div, h2 h4, h2 div {}
length = prevSelector.length;
for (var j = 0; j < length; j++) {
// extract value, prep index for reuse
temp = prevSelector[j];
indexOf = temp.indexOf(prefix);
prevSelector[j] = '';
// since there could also be multiple nested selectors
for (var k = 0, l = nestSelector.length; k < l; k++) {
if (indexOf > 0) {
selector = ':global(%)' + temp.trim();
}
else {
selector = temp.replace(prefix, '&').trim();
}
sel = nestSelector[k].trim();
if (sel.indexOf(' &') > 0) {
selector = sel.replace('&', '').trim() + ' ' + selector;
}
else if (globalPattern.exec(sel) !== null) {
selector = sel;
}
else {
selector = selector + ' ' + sel;
}
prevSelector[j] += selector.replace(/ +&/, '').trim() + (k === l - 1 ? '' : ',');
}
}
if (nest === undefined) {
nest = '';
}
// concat nest
nest += (
'\n' +
prevSelector.join(',').replace(globalsPattern, ' $1') +
' {'+inner+'}'
);
// signature
nested = 1;
// clear current line, to avoid adding nested blocks to the normal flow
buff = '';
// decreament depth
depth--;
}
// top-level selector
else if (special === 0 || type === 2) {
selectors = buff.split(splitPattern);
// current selector
build = '';
// previous selector
prev = '';
length = selectors.length;
// prefix multiple selectors with namesapces
// @example h1, h2, h3 --> [namespace] h1, [namespace] h1, ....
for (var j = 0; j < length; j++) {
char = (selector = selectors[j]).charCodeAt(0);
// ` `, trim if first character is a space
if (char === 32) {
char = (selector = selector.trim()).charCodeAt(0);
}
// &
if (char === 38) {
// before: & { / &&... {
selector = prefix + selector.substring(1).replace(andPattern, prefix);
// after: ${prefix} { / ${prefix}${prefix}...
}
else {
// register block with placeholder selector
if (selector.indexOf('::place') !== -1) {
isplace = 1;
}
// default to :global if & exists outside of the first non-space character
if ((indexOf = selector.indexOf(' &')) > 0) {
// before: html & {
selector = selector.replace(andPattern, prefix).trim();
// after: html ${prefix} {
}
// :
else if (char === 58) {
nextcode = selector.charCodeAt(1);
// h, t, :host
if (compact === true && nextcode === 104 && selector.charCodeAt(4) === 116) {
nextcode = selector.charCodeAt(5);
// (, :host(selector)
if (nextcode === 40) {
// before: `(selector)`
selector = (
prefix + (
selector
.replace(/:host\((.*)\)/g, '$1')
.replace(andPattern, prefix)
)
);
// after: ${prefx} selector {
}
// -, :host-context(selector)
else if (nextcode === 45) {
// before: `-context(selector)`
selector = selector
.replace(/:host-context\((.*)\)/g, '$1 ' + prefix)
.replace(andPattern, prefix)
// after: selector ${prefix} {
}
// :host
else {
selector = prefix + selector.substring(5);
}
}
// g, :global(selector)
else if (
nextcode === 103 &&
(
compact === true
||
((nextcode = selector.charCodeAt(8)) === 37)
)
) {
globs = 1;
// before: `:global(selector)`
selector = (
selector
.replace(globalPattern, '$1')
.replace(andPattern, prefix).trim()
);
// after: selector
}
// :hover, :active, :focus, etc...
else {
selector = prefix + selector;
}
}
// non-pseudo selectors
else if (globs === 0) {
selector = prefix + ' ' + selector;
}
}
// middleware, post-processed selector context
if (uses === true) {
temp = middleware(
1.5,
j === length - 1 ? selector.substring(0, selector.length - 1).trim() : selector,
line,
column,
prefix,
output.length
);
if (temp != null) {
selector = j === length - 1 ? temp + ' {' : temp;
}
}
// if first selector do not prefix with `,`
prev += (j !== 0 ? ',\f' : '') + (globs !== 1 ? selector : ':global(%)' + selector);
build += j !== 0 ? ',' + selector : selector;
// reset :global flag
globs = 0;
}
buff = build;
}
else {
prev = buff;
}
}
// not single `}`
else if ((code === 125 && buff.length === 1) === false) {
// ;
if (code !== 59) {
buff = (code === 125 ? buff.substring(0, buff.length - 1) : buff.trim()) + ';';
}
// animation: a, n, i characters
if (first === 97 && second === 110 && third === 105) {
// removes ;
buff = buff.substring(0, buff.length - 1);
// position of :
colon = buff.indexOf(':')+1;
// left hand side everything before `:`
build = buff.substring(0, colon);
// short hand animation syntax
if (animations === true && buff.charCodeAt(9) !== 45) {
var anims = buff.substring(colon).trim().split(',');
length = anims.length;
// because we can have multiple animations `animation: slide 4s, slideOut 2s`
for (var j = 0; j < length; j++) {
var anim = anims[j];
var props = anim.split(' ');
// since we can't be sure of the position of the name of the animation we have to find it
for (var k = 0, l = props.length; k < l; k++) {
var prop = props[k].trim();
var frst = prop.charCodeAt(0);
var thrd = prop.charCodeAt(2);
var len = prop.length;
var last = prop.charCodeAt(len - 1);
// animation name parser
if (
// first character
(
// letters
(frst > 64 && frst < 90) ||
(frst > 96 && frst < 122) ||
// the exception `underscores or dashes`
frst === 45 ||
// but two dashes at the beginning are forbidden
(frst === 95 && prop.charCodeAt(1) !== 95)
) &&
// cubic-bezier()/steps(), )
last !== 41 && len !== 0 &&
!(
frst === 105 &&
(
// infinite, i, f, e
(thrd === 102 && last === 101 && len === 8) ||
// initial
(thrd === 105 && last === 108 && len === 7) ||
// inherit
(thrd === 104 && last === 116 && len === 7)
)
) &&
// unset
!(frst === 117 && thrd === 115 && last === 116 && len === 5) &&
// linear, l, n, r
!(frst === 108 && thrd === 110 && last === 114 && len === 6) &&
// alternate/alternate-reverse, a, t, e
!(frst === 97 && thrd === 116 && last === 101 && (len === 9 || len === 17)) &&
// normal, n, r, l
!(frst === 110 && thrd === 114 && last === 108 && len === 6) &&
// backwards, b, c, s
!(frst === 98 && thrd === 99 && last === 115 && len === 9) &&
// forwards, f, r, s
!(frst === 102 && thrd === 114 && last === 115 && len === 8) &&
// both, b, t, h
!(frst === 98 && thrd === 116 && last === 104 && len === 4) &&
// none, n, n, e
!(frst === 110 && thrd === 110 && last === 101 && len === 4)&&
// running, r, n, g
!(frst === 114 && thrd === 110 && last === 103 && len === 7) &&
// paused, p, u, d
!(frst === 112 && thrd === 117 && last === 100 && len === 6) &&
// reversed, r, v, d
!(frst === 114 && thrd === 118 && last === 100 && len === 8) &&
// step-start/step-end, s, e, (t/d)
!(
frst === 115 && thrd === 101 &&
((last === 116 && len === 10) || (last === 100 && len === 8))
) &&
// ease/ease-in/ease-out/ease-in-out, e, s, e
!(
frst === 101 && thrd === 115 &&
(
(last === 101 && len === 4) ||
(len === 11 || len === 7 || len === 8) && prop.charCodeAt(4) === 45
)
) &&
// durations, 0.4ms, .4s, 400ms ...
isNaN(parseFloat(prop)) &&
// handle spaces in cubic-bezier()/steps() functions
prop.indexOf('(') === -1
) {
props[k] = animns + prop;
}
}
build += (j === 0 ? '' : ',') + props.join(' ').trim();
}
}
// explicit syntax, anims array should have only one element
else {
build += (
(buff.charCodeAt(10) !== 110 ? '' : animns) +
buff.substring(colon).trim().trim()
);
}
// vendor prefix
buff = webkit + build + ';' + build + (code === 125 ? ';}' : ';');
}
// appearance: a, p, p
else if (first === 97 && second === 112 && third === 112) {
// vendor prefix -webkit- and -moz-
buff = (
webkit + buff +
moz + buff +
buff
);
}
// display: d, i, s
else if (first === 100 && second === 105 && third === 115) {
// flex/inline-flex
if ((indexOf = buff.indexOf('flex')) !== -1) {
// e, inline-flex
temp = buff.charCodeAt(indexOf-2) === 101 ? 'inline-' : '';
buff = buff.indexOf(' !important') !== -1 ? ' !important' : '';
// vendor prefix
buff = (
'display: ' + webkit + temp + 'box' + buff + ';' +
'display: ' + webkit + temp + 'flex' + buff + ';' +
'display: ' + ms + 'flexbox' + buff + ';' +
'display: ' + temp + 'flex' + buff + ';'
);
}
}
// transforms & transitions: t, r, a
else if (first === 116 && second === 114 && third === 97) {
// vendor prefix -webkit- and -ms- if transform
buff = (
webkit + buff +
(buff.charCodeAt(5) === 102 ? ms + buff : '') +
buff
);
}
// hyphens: h, y, p
// user-select: u, s, e
else if (
(first === 104 && second === 121 && third === 112) ||
(first === 117 && second === 115 && third === 101)
) {
// vendor prefix all
buff = (
webkit + buff +
moz + buff +
ms + buff +
buff
);
}
// flex: f, l, e
else if (first === 102 && second === 108 && third === 101) {
// vendor prefix all but moz
buff = (
webkit + buff +
ms + buff +
buff
);
}
// order: o, r, d
else if (first === 111 && second === 114 && third === 100) {
// vendor prefix all but moz
buff = (
webkit + buff +
ms + 'flex-' + buff +
buff
);
}
// align-items, align-center, align-self: a, l, i, -
else if (first === 97 && second === 108 && third === 105 && buff.charCodeAt(5) === 45) {
switch (buff.charCodeAt(6)) {
// align-items, i
case 105: {
temp = buff.replace('-items', '');
buff = (
webkit + buff +
webkit + 'box-' + temp +
ms + 'flex-'+ temp +
buff
);
break;
}
// align-self, s
case 115: {
buff = (
ms + 'flex-item-' + buff.replace('-self', '') +
buff
);
break;
}
// align-content
default: {
buff = (
ms + 'flex-line-pack' + buff.replace('align-content', '') +
buff
);
break;
}
}
}
// justify-content, j, u, s
else if (first === 106 && second === 117 && third === 115) {
colon = buff.indexOf(':');
temp = buff.substring(colon).replace('flex-', '')
buff = (
webkit + 'box-pack' + temp +
webkit + buff +
ms + 'flex-pack' + temp +
buff
);
}
// cursor, c, u, r
else if (first === 99 && second === 117 && third === 114 && /zoo|gra/.exec(buff) !== null) {
buff = (
buff.replace(/: +/g, ': ' + webkit) +
buff.replace(/: +/g, ': ' + moz) +
buff
);
}
// width: min-content / width: max-content
else if (first === 119 && second === 105 && third === 100 && (indexOf = buff.indexOf('-content')) !== -1) {
temp = buff.substring(indexOf - 3);
// vendor prefix
buff = (
'width: ' + webkit + temp +
'width: ' + moz + temp +
'width: ' + temp
);
}
if (code !== 59) {
buff = buff.substring(0, buff.length - 1);
// }
if (code === 125) {
buff += '}';
}
}
}
// } character
if (code === 125) {
if (depth !== 0) {
depth--;
}
// concat nested css
if (depth === 0 && nested === 1) {
styles = styles.substring(0, caret + 1) + nest + styles.substring(caret + 1);
eof += nest.length;
nest = '';
nested = 0;
close++;
}
// }, ` ` whitespace
if (first !== 125 && buff.charCodeAt(buff.length - 2) === 32) {
buff = buff.substring(0, buff.length-1).trim() + '}';
}
}
// @@keyframes
if (special !== 0) {
// }, find closing tag
if (code === 125) {
close++;
}
// {
else if (code === 123 && close !== 0) {
close--;
}
// append flat @media css
if (level === 1 && (code === 123 || close === 0) && flat.length !== 0) {
level = 0;
buff = prefix + ' {'+flat+'}' + buff;
flat = '';
}
// closing tag
if (close === 0) {
// @keyframes
if (type === 1) {
// vendor prefix
buff = '}@'+blob+'}';
// reset
blob = '';
}
// reset signatures
type = 0;
close--;
special--;
}
// @keyframes
else if (type === 1) {
blob += buff;
}
// @media flat context
else if (type === 2 && depth === 0) {
if (code !== 125) {
if (level === 0) {
flat = '';
}
flat += buff;
buff = '';
}
level = 1;
}
}
// flat context
else if (depth === 0 && code !== 125) {
levels = 1;
flat = flat === undefined ? buff : flat + buff;
buff = '';
}
}
// append line to blck buffer
blck += buff;
// add blck buffer to output
if (code === 125 && (type === 0 || type === 2 || type === 4)) {
char = blck.charCodeAt(blck.length - 2);
if (type === 4) {
type = 0;
}
if (media !== undefined && media.length !== 0) {
blck = char === 123 ? media : blck + media;
media = '';
char = blck.charCodeAt(blck.length - 2);
}
// {, @
if (char !== 123) {
// middleware, block context
if (uses === true) {
temp = middleware(3, blck, line, column, prefix, output.length);
if (temp != null) {
blck = temp;
}
}
if (isplace === 1) {
regex = /::place/g;
isplace = 0;
temp = 'input-place';
blck = (
blck.replace(regex, '::'+webkit+temp) +
blck.replace(regex, '::'+moz+'place') +
blck.replace(regex, ':'+ms+temp) +
blck
);
}
if (query !== undefined) {
query += blck;
// }
if (query.charCodeAt(query.length - 2) === 125) {
output += query;
query = undefined;
}
}
else {
// append blck buffer
output += blck;
}
}
// reset blck buffer
blck = '';
}
// reset line buffer
buff = '';
}
// build line by line
else {
// \r, \n, new lines
if (code === 13 || code === 10) {
if (comline === 1) {
comment = comline = 0;
buff = buff.substring(0, buff.indexOf('//')).trim();
}
// /
else if (uses === true && comment === 0 && (length = (str = str.trim()).length) !== 0 && str.charCodeAt(0) !== 47) {
if (buff.length !== 0) {
temp = middleware(7, str, line, column, prefix, output.length);
if (temp != null) {
buff = buff.replace(new RegExp(str+'$'), temp).trim();
}
}
str = '';
}
column = 0;
line++;
}
else {
// not `\t` tab character
if (code !== 9) {
character = styles.charAt(caret);
// build line buffer
if (uses === true && comment === 0) {
str += character;
}
// build character buffer
buff += character;
switch (code) {
// ,
case 44: {
if (strings === 0 && comment === 0 && func === 0) {
buff += '\f';
}
break;
}
// " character
case 34: {
if (comment === 0) {
// exit string " context / enter string context
strings = strings === 34 ? 0 : (strings === 39 ? 39 : 34);
}
break;
}
// ' character
case 39: {
if (comment === 0) {
// exit string ' context / enter string context
strings = strings === 39 ? 0 : (strings === 34 ? 34 : 39);
}
break;
}
// ( character
case 40: {
if (strings === 0 && comment === 0) {
func = 1;
}
break;
}
// ) character
case 41: {
if (strings === 0 && comment === 0) {
func = 0;
}
break;
}
// / character
case 47: {
if (strings === 0 && func === 0) {
char = styles.charCodeAt(caret - 1);
// /, begin line comment
if (comblck === 0 && char === 47) {
comment = comline = 1;
}
// *, end block comment
else if (char === 42) {
comment = comblck = 0;
buff = buff.substring(0, buff.indexOf('/*')).trim();
}
}
break;
}
// * character
case 42: {
if (strings === 0 && func === 0 && comline === 0 && comblck === 0) {
// /, begin block comment
if (styles.charCodeAt(caret - 1) === 47) {
comment = comblck = 1;
}
}
break;
}
}
}
// move column position
column++;
}
}
// move caret position
caret++;
}
// trailing flat css
if (flat !== undefined && flat.length !== 0) {
flat = prefix + ' {' + flat + '}';
// middleware, flat context
if (uses === true) {
temp = middleware(4, flat, line, column, prefix, output.length);
if (temp != null) {
flat = temp;
}
}
// append flat css
output += flat;
}
// middleware, output context
if (uses === true) {
temp = middleware(6, output, line, column, prefix, output.length);
if (temp != null) {
output = temp;
}
}
return output;
}
/**
* use plugin
*
* @param {string|function|function[]} key
* @param {function?} plugin
* @return {Object} {plugins}
*/
function use (plugin) {
var length = plugins.length;
if (plugin != null) {
// array of plugins
if (plugin.constructor === Array) {
for (var i = 0, l = plugin.length; i < l; i++) {
plugins[length++] = plugin[i];
}
}
// single un-keyed plugin
else {
plugins[length] = plugin;
}
}
return stylis;
};
stylis.use = use;
/**
* plugin store
*
* @type {Function[]}
*/
stylis.p = plugins;
/**
* regular expresions
*
* @type {Object<string, RegExp>}
*/
stylis.r = {
a: andPattern,
s: splitPattern,
g: globalPattern,
n: globalsPattern
};
return stylis;
}));
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(16)))
/***/ }),
/* 354 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {/**
* lodash (Custom Build) <https://lodash.com/>
* Build: `lodash modularize exports="npm" -o ./`
* Copyright jQuery Foundation and other contributors <https://jquery.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/
/** Used as references for various `Number` constants. */
var MAX_SAFE_INTEGER = 9007199254740991;
/** `Object#toString` result references. */
var argsTag = '[object Arguments]',
funcTag = '[object Function]',
genTag = '[object GeneratorFunction]';
/** Detect free variable `global` from Node.js. */
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
/** Detect free variable `self`. */
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
/** Used as a reference to the global object. */
var root = freeGlobal || freeSelf || Function('return this')();
/**
* 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;
}
/** 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 objectToString = objectProto.toString;
/** Built-in value references. */
var Symbol = root.Symbol,
propertyIsEnumerable = objectProto.propertyIsEnumerable,
spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;
/**
* 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;
}
/**
* 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]);
}
/**
* 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 ? array.length : 0;
return length ? baseFlatten(array, 1) : [];
}
/**
* 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
*/
function isArguments(value) {
// Safari 8.1 makes `arguments.callee` enumerable in strict mode.
return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
(!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
}
/**
* 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;
/**
* 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);
}
/**
* 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);
}
/**
* 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) {
// The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 8-9 which returns 'object' for typed array and other constructors.
var tag = isObject(value) ? objectToString.call(value) : '';
return tag == funcTag || tag == genTag;
}
/**
* 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;
}
/**
* Checks if `value` is the
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
* @example
*
* _.isObject({});
* // => true
*
* _.isObject([1, 2, 3]);
* // => true
*
* _.isObject(_.noop);
* // => true
*
* _.isObject(null);
* // => false
*/
function isObject(value) {
var type = typeof value;
return !!value && (type == 'object' || type == 'function');
}
/**
* Checks if `value` is object-like. A value is object-like if it's not `null`
* and has a `typeof` result of "object".
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
* @example
*
* _.isObjectLike({});
* // => true
*
* _.isObjectLike([1, 2, 3]);
* // => true
*
* _.isObjectLike(_.noop);
* // => false
*
* _.isObjectLike(null);
* // => false
*/
function isObjectLike(value) {
return !!value && typeof value == 'object';
}
module.exports = flatten;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(16)))
/***/ }),
/* 355 */
/***/ (function(module, exports) {
module.exports = clamp
function clamp(value, min, max) {
return min < max
? (value < min ? min : value > max ? max : value)
: (value < max ? max : value > min ? min : value)
}
/***/ }),
/* 356 */
/***/ (function(module, exports) {
module.exports = isFunction
var toString = Object.prototype.toString
function isFunction (fn) {
var string = toString.call(fn)
return string === '[object Function]' ||
(typeof fn === 'function' && string !== '[object RegExp]') ||
(typeof window !== 'undefined' &&
// IE8 and below
(fn === window.setTimeout ||
fn === window.alert ||
fn === window.confirm ||
fn === window.prompt))
};
/***/ }),
/* 357 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
module.exports = function (obj) {
return obj == null;
};
/***/ }),
/* 358 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
module.exports = function isObject(x) {
return typeof x === "object" && x !== null;
};
/***/ }),
/* 359 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var toStr = Object.prototype.toString;
var hasSymbols = typeof Symbol === 'function' && typeof Symbol() === 'symbol';
if (hasSymbols) {
var symToStr = Symbol.prototype.toString;
var symStringRegex = /^Symbol\(.*\)$/;
var isSymbolObject = function isSymbolObject(value) {
if (typeof value.valueOf() !== 'symbol') { return false; }
return symStringRegex.test(symToStr.call(value));
};
module.exports = function isSymbol(value) {
if (typeof value === 'symbol') { return true; }
if (toStr.call(value) !== '[object Symbol]') { return false; }
try {
return isSymbolObject(value);
} catch (e) {
return false;
}
};
} else {
module.exports = function isSymbol(value) {
// this environment does not support Symbols.
return false;
};
}
/***/ }),
/* 360 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var clamp = __webpack_require__(355);
var toInteger = __webpack_require__(362);
var MAX_SAFE_INT = __webpack_require__(198);
var MIN_SAFE_INT = -MAX_SAFE_INT;
function fixme(val, min, max, isMin) {
if (typeof val !== 'number') {
val = toInteger(val);
}
if (isNaN(val) || !isFinite(val)) {
return isMin ? min : max;
}
return clamp(val, min, max);
}
module.exports = function (options) {
if (options) {
// for speed up
if (!options.inspected) {
options.min = fixme(options.min, MIN_SAFE_INT, MAX_SAFE_INT, true);
options.max = fixme(options.max, MIN_SAFE_INT, MAX_SAFE_INT, false);
}
} else {
options = {
min: MIN_SAFE_INT,
max: MAX_SAFE_INT
};
}
var min = options.min;
var max = options.max;
// swap to variables
// ref: http://stackoverflow.com/a/16201688
if (min > max) {
min = min ^ max;
max = min ^ max;
min = min ^ max;
}
return Math.round(Math.random() * (max - min)) + min;
};
module.exports.fixme = fixme;
/***/ }),
/* 361 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var randomInt = __webpack_require__(360);
var MAX_SAFE_INT = __webpack_require__(198);
module.exports = function (options) {
if (options) {
if (!options.inspected) {
options.min = randomInt.fixme(options.min, 0, MAX_SAFE_INT, true);
options.max = randomInt.fixme(options.max, 0, MAX_SAFE_INT, false);
}
} else {
options = {
min: 0,
max: MAX_SAFE_INT
};
}
options.inspected = true;
return randomInt(options);
};
module.exports.fixme = randomInt.fixme;
/***/ }),
/* 362 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var isNil = __webpack_require__(357);
var isSymbol = __webpack_require__(359);
var isObject = __webpack_require__(358);
var isFunction = __webpack_require__(356);
var NAN = 0 / 0;
module.exports = function (value) {
if (isNil(value)) {
return 0;
}
var type = typeof value;
if (type === 'number') {
return value;
} else if (type === 'boolean') {
return value ? 1 : 0;
}
if (isSymbol(value)) {
return NAN;
}
if (isObject(value)) {
var raw = isFunction(value.valueOf) ? value.valueOf() : value;
value = isObject(raw) ? (raw + '') : raw;
}
type = typeof value;
if (type !== 'string') {
return type === 'number' ? value : parseInt(value, 10);
}
// trim
value = value.replace(/^\s+|\s+$/g, '');
if (/^0b[01]+$/i.test(value)) {
return parseInt(value.slice(2), 2);
} else if (/^0o[0-7]+$/i.test(value)) {
return parseInt(value.slice(2), 8);
} else if (/^0x[0-9a-f]+$/i.test(value)) {
return parseInt(value.slice(2), 16);
}
if(/^0b/i.test(value)||/^0o/i.test(value)||/^[\+\-]?0x/i.test(value)){
return NAN;
}
return parseInt(value, 10);
};
/***/ }),
/* 363 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*/
if (false) {
var invariant = require('fbjs/lib/invariant');
var warning = require('fbjs/lib/warning');
var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');
var loggedTypeFailures = {};
}
/**
* Assert that the values match with the type specs.
* Error messages are memorized and will only be shown once.
*
* @param {object} typeSpecs Map of name to a ReactPropType
* @param {object} values Runtime values that need to be type-checked
* @param {string} location e.g. "prop", "context", "child context"
* @param {string} componentName Name of the component for error messages.
* @param {?Function} getStack Returns the component stack.
* @private
*/
function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
if (false) {
for (var typeSpecName in typeSpecs) {
if (typeSpecs.hasOwnProperty(typeSpecName)) {
var error;
// Prop type validation may throw. In case they do, we don't want to
// fail the render phase where it didn't fail before. So we log it.
// After these have been cleaned up, we'll let them throw.
try {
// This is intentionally an invariant that gets caught. It's the same
// behavior as without this statement except with a better message.
invariant(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', componentName || 'React class', location, typeSpecName);
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
} catch (ex) {
error = ex;
}
warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error);
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
// Only monitor this failure once because there tends to be a lot of the
// same error.
loggedTypeFailures[error.message] = true;
var stack = getStack ? getStack() : '';
warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '');
}
}
}
}
}
module.exports = checkPropTypes;
/***/ }),
/* 364 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*/
// React 15.5 references this module, and assumes PropTypes are still callable in production.
// Therefore we re-export development-only version with all the PropTypes checks here.
// However if one is migrating to the `prop-types` npm library, they will go through the
// `index.js` entry point, and it will branch depending on the environment.
var factory = __webpack_require__(365);
module.exports = function(isValidElement) {
// It is still allowed in 15.5.
var throwOnDirectAccess = false;
return factory(isValidElement, throwOnDirectAccess);
};
/***/ }),
/* 365 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*/
var emptyFunction = __webpack_require__(117);
var invariant = __webpack_require__(49);
var warning = __webpack_require__(39);
var ReactPropTypesSecret = __webpack_require__(366);
var checkPropTypes = __webpack_require__(363);
module.exports = function(isValidElement, throwOnDirectAccess) {
/* global Symbol */
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
/**
* Returns the iterator method function contained on the iterable object.
*
* Be sure to invoke the function with the iterable as context:
*
* var iteratorFn = getIteratorFn(myIterable);
* if (iteratorFn) {
* var iterator = iteratorFn.call(myIterable);
* ...
* }
*
* @param {?object} maybeIterable
* @return {?function}
*/
function getIteratorFn(maybeIterable) {
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
if (typeof iteratorFn === 'function') {
return iteratorFn;
}
}
/**
* Collection of methods that allow declaration and validation of props that are
* supplied to React components. Example usage:
*
* var Props = require('ReactPropTypes');
* var MyArticle = React.createClass({
* propTypes: {
* // An optional string prop named "description".
* description: Props.string,
*
* // A required enum prop named "category".
* category: Props.oneOf(['News','Photos']).isRequired,
*
* // A prop named "dialog" that requires an instance of Dialog.
* dialog: Props.instanceOf(Dialog).isRequired
* },
* render: function() { ... }
* });
*
* A more formal specification of how these methods are used:
*
* type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
* decl := ReactPropTypes.{type}(.isRequired)?
*
* Each and every declaration produces a function with the same signature. This
* allows the creation of custom validation functions. For example:
*
* var MyLink = React.createClass({
* propTypes: {
* // An optional string or URI prop named "href".
* href: function(props, propName, componentName) {
* var propValue = props[propName];
* if (propValue != null && typeof propValue !== 'string' &&
* !(propValue instanceof URI)) {
* return new Error(
* 'Expected a string or an URI for ' + propName + ' in ' +
* componentName
* );
* }
* }
* },
* render: function() {...}
* });
*
* @internal
*/
var ANONYMOUS = '<<anonymous>>';
// Important!
// Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
var ReactPropTypes = {
array: createPrimitiveTypeChecker('array'),
bool: createPrimitiveTypeChecker('boolean'),
func: createPrimitiveTypeChecker('function'),
number: createPrimitiveTypeChecker('number'),
object: createPrimitiveTypeChecker('object'),
string: createPrimitiveTypeChecker('string'),
symbol: createPrimitiveTypeChecker('symbol'),
any: createAnyTypeChecker(),
arrayOf: createArrayOfTypeChecker,
element: createElementTypeChecker(),
instanceOf: createInstanceTypeChecker,
node: createNodeChecker(),
objectOf: createObjectOfTypeChecker,
oneOf: createEnumTypeChecker,
oneOfType: createUnionTypeChecker,
shape: createShapeTypeChecker
};
/**
* 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 (false) {
var manualPropTypeCallCache = {};
var manualPropTypeWarningCount = 0;
}
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
componentName = componentName || ANONYMOUS;
propFullName = propFullName || propName;
if (secret !== ReactPropTypesSecret) {
if (throwOnDirectAccess) {
// New behavior only for users of `prop-types` package
invariant(
false,
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
'Use `PropTypes.checkPropTypes()` to call them. ' +
'Read more at http://fb.me/use-check-prop-types'
);
} else if (false) {
// Old behavior for people using React.PropTypes
var cacheKey = componentName + ':' + propName;
if (
!manualPropTypeCallCache[cacheKey] &&
// Avoid spamming the console because they are often not actionable except for lib authors
manualPropTypeWarningCount < 3
) {
warning(
false,
'You are manually calling a React.PropTypes validation ' +
'function for the `%s` prop on `%s`. This is deprecated ' +
'and will throw in the standalone `prop-types` package. ' +
'You may be seeing this warning due to a third-party PropTypes ' +
'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.',
propFullName,
componentName
);
manualPropTypeCallCache[cacheKey] = true;
manualPropTypeWarningCount++;
}
}
}
if (props[propName] == null) {
if (isRequired) {
if (props[propName] === null) {
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
}
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
}
return null;
} else {
return validate(props, propName, componentName, location, propFullName);
}
}
var chainedCheckType = checkType.bind(null, false);
chainedCheckType.isRequired = checkType.bind(null, true);
return chainedCheckType;
}
function createPrimitiveTypeChecker(expectedType) {
function validate(props, propName, componentName, location, propFullName, secret) {
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== expectedType) {
// `propValue` being instance of, say, date/regexp, pass the 'object'
// check, but we can offer a more precise error message here rather than
// 'of type `object`'.
var preciseType = getPreciseType(propValue);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createAnyTypeChecker() {
return createChainableTypeChecker(emptyFunction.thatReturnsNull);
}
function createArrayOfTypeChecker(typeChecker) {
function validate(props, propName, componentName, location, propFullName) {
if (typeof typeChecker !== 'function') {
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
}
var propValue = props[propName];
if (!Array.isArray(propValue)) {
var propType = getPropType(propValue);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
}
for (var i = 0; i < propValue.length; i++) {
var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
if (error instanceof Error) {
return error;
}
}
return null;
}
return createChainableTypeChecker(validate);
}
function createElementTypeChecker() {
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
if (!isValidElement(propValue)) {
var propType = getPropType(propValue);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createInstanceTypeChecker(expectedClass) {
function validate(props, propName, componentName, location, propFullName) {
if (!(props[propName] instanceof expectedClass)) {
var expectedClassName = expectedClass.name || ANONYMOUS;
var actualClassName = getClassName(props[propName]);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createEnumTypeChecker(expectedValues) {
if (!Array.isArray(expectedValues)) {
false ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0;
return emptyFunction.thatReturnsNull;
}
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
for (var i = 0; i < expectedValues.length; i++) {
if (is(propValue, expectedValues[i])) {
return null;
}
}
var valuesString = JSON.stringify(expectedValues);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
}
return createChainableTypeChecker(validate);
}
function createObjectOfTypeChecker(typeChecker) {
function validate(props, propName, componentName, location, propFullName) {
if (typeof typeChecker !== 'function') {
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
}
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== 'object') {
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
}
for (var key in propValue) {
if (propValue.hasOwnProperty(key)) {
var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
if (error instanceof Error) {
return error;
}
}
}
return null;
}
return createChainableTypeChecker(validate);
}
function createUnionTypeChecker(arrayOfTypeCheckers) {
if (!Array.isArray(arrayOfTypeCheckers)) {
false ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
return emptyFunction.thatReturnsNull;
}
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
var checker = arrayOfTypeCheckers[i];
if (typeof checker !== 'function') {
warning(
false,
'Invalid argument supplid to oneOfType. Expected an array of check functions, but ' +
'received %s at index %s.',
getPostfixForTypeWarning(checker),
i
);
return emptyFunction.thatReturnsNull;
}
}
function validate(props, propName, componentName, location, propFullName) {
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
var checker = arrayOfTypeCheckers[i];
if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {
return null;
}
}
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
}
return createChainableTypeChecker(validate);
}
function createNodeChecker() {
function validate(props, propName, componentName, location, propFullName) {
if (!isNode(props[propName])) {
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createShapeTypeChecker(shapeTypes) {
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== 'object') {
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
}
for (var key in shapeTypes) {
var checker = shapeTypes[key];
if (!checker) {
continue;
}
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
if (error) {
return error;
}
}
return null;
}
return createChainableTypeChecker(validate);
}
function isNode(propValue) {
switch (typeof propValue) {
case 'number':
case 'string':
case 'undefined':
return true;
case 'boolean':
return !propValue;
case 'object':
if (Array.isArray(propValue)) {
return propValue.every(isNode);
}
if (propValue === null || isValidElement(propValue)) {
return true;
}
var iteratorFn = getIteratorFn(propValue);
if (iteratorFn) {
var iterator = iteratorFn.call(propValue);
var step;
if (iteratorFn !== propValue.entries) {
while (!(step = iterator.next()).done) {
if (!isNode(step.value)) {
return false;
}
}
} else {
// Iterator will provide entry [k,v] tuples rather than values.
while (!(step = iterator.next()).done) {
var entry = step.value;
if (entry) {
if (!isNode(entry[1])) {
return false;
}
}
}
}
} else {
return false;
}
return true;
default:
return false;
}
}
function isSymbol(propType, propValue) {
// Native Symbol.
if (propType === 'symbol') {
return true;
}
// 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
if (propValue['@@toStringTag'] === 'Symbol') {
return true;
}
// Fallback for non-spec compliant Symbols which are polyfilled.
if (typeof Symbol === 'function' && propValue instanceof Symbol) {
return true;
}
return false;
}
// Equivalent of `typeof` but with special handling for array and regexp.
function getPropType(propValue) {
var propType = typeof propValue;
if (Array.isArray(propValue)) {
return 'array';
}
if (propValue instanceof RegExp) {
// Old webkits (at least until Android 4.0) return 'function' rather than
// 'object' for typeof a RegExp. We'll normalize this here so that /bla/
// passes PropTypes.object.
return 'object';
}
if (isSymbol(propType, propValue)) {
return 'symbol';
}
return propType;
}
// This handles more types than `getPropType`. Only used for error messages.
// See `createPrimitiveTypeChecker`.
function getPreciseType(propValue) {
if (typeof propValue === 'undefined' || propValue === null) {
return '' + propValue;
}
var propType = getPropType(propValue);
if (propType === 'object') {
if (propValue instanceof Date) {
return 'date';
} else if (propValue instanceof RegExp) {
return 'regexp';
}
}
return propType;
}
// Returns a string that is postfixed to a warning about an invalid type.
// For example, "undefined" or "of type array"
function getPostfixForTypeWarning(value) {
var type = getPreciseType(value);
switch (type) {
case 'array':
case 'object':
return 'an ' + type;
case 'boolean':
case 'date':
case 'regexp':
return 'a ' + type;
default:
return type;
}
}
// Returns class name of the object, if any.
function getClassName(propValue) {
if (!propValue.constructor || !propValue.constructor.name) {
return ANONYMOUS;
}
return propValue.constructor.name;
}
ReactPropTypes.checkPropTypes = checkPropTypes;
ReactPropTypes.PropTypes = ReactPropTypes;
return ReactPropTypes;
};
/***/ }),
/* 366 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*/
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
module.exports = ReactPropTypesSecret;
/***/ }),
/* 367 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*
*/
/**
* 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;
/***/ }),
/* 368 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*
*/
var _prodInvariant = __webpack_require__(65);
var invariant = __webpack_require__(49);
/**
* 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) ? false ? 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;
/***/ }),
/* 369 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var _assign = __webpack_require__(80);
var ReactChildren = __webpack_require__(370);
var ReactComponent = __webpack_require__(119);
var ReactPureComponent = __webpack_require__(375);
var ReactClass = __webpack_require__(371);
var ReactDOMFactories = __webpack_require__(372);
var ReactElement = __webpack_require__(50);
var ReactPropTypes = __webpack_require__(374);
var ReactVersion = __webpack_require__(376);
var onlyChild = __webpack_require__(378);
var warning = __webpack_require__(39);
var createElement = ReactElement.createElement;
var createFactory = ReactElement.createFactory;
var cloneElement = ReactElement.cloneElement;
if (false) {
var canDefineProperty = require('./canDefineProperty');
var ReactElementValidator = require('./ReactElementValidator');
var didWarnPropTypesDeprecated = false;
createElement = ReactElementValidator.createElement;
createFactory = ReactElementValidator.createFactory;
cloneElement = ReactElementValidator.cloneElement;
}
var __spread = _assign;
if (false) {
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
};
// TODO: Fix tests so that this deprecation warning doesn't cause failures.
if (false) {
if (canDefineProperty) {
Object.defineProperty(React, 'PropTypes', {
get: function () {
process.env.NODE_ENV !== 'production' ? warning(didWarnPropTypesDeprecated, 'Accessing PropTypes via the main React package is deprecated. Use ' + 'the prop-types package from npm instead.') : void 0;
didWarnPropTypesDeprecated = true;
return ReactPropTypes;
}
});
}
}
module.exports = React;
/***/ }),
/* 370 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var PooledClass = __webpack_require__(368);
var ReactElement = __webpack_require__(50);
var emptyFunction = __webpack_require__(117);
var traverseAllChildren = __webpack_require__(379);
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;
/***/ }),
/* 371 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var _prodInvariant = __webpack_require__(65),
_assign = __webpack_require__(80);
var ReactComponent = __webpack_require__(119);
var ReactElement = __webpack_require__(50);
var ReactPropTypeLocationNames = __webpack_require__(373);
var ReactNoopUpdateQueue = __webpack_require__(120);
var emptyObject = __webpack_require__(118);
var invariant = __webpack_require__(49);
var warning = __webpack_require__(39);
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}
* @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 (false) {
validateTypeDef(Constructor, childContextTypes, 'childContext');
}
Constructor.childContextTypes = _assign({}, Constructor.childContextTypes, childContextTypes);
},
contextTypes: function (Constructor, contextTypes) {
if (false) {
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 (false) {
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__
false ? 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') ? false ? 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') ? false ? 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 (false) {
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') ? false ? 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) ? false ? 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')) ? false ? 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 (false) {
// 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 ? false ? 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 ? false ? 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') ? false ? invariant(false, 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.') : _prodInvariant('80') : void 0;
for (var key in two) {
if (two.hasOwnProperty(key)) {
!(one[key] === undefined) ? false ? 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 (false) {
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);
var didWarnDeprecated = false;
/**
* 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) {
if (false) {
process.env.NODE_ENV !== 'production' ? warning(didWarnDeprecated, '%s: React.createClass is deprecated and will be removed in version 16. ' + 'Use plain JavaScript classes instead. If you\'re not yet ready to ' + 'migrate, create-react-class is available on npm as a ' + 'drop-in replacement.', spec && spec.displayName || 'A Component') : void 0;
didWarnDeprecated = true;
}
// 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 (false) {
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 (false) {
// 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)) ? false ? 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 (false) {
// 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 ? false ? invariant(false, 'createClass(...): Class specification must implement a `render` method.') : _prodInvariant('83') : void 0;
if (false) {
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;
/***/ }),
/* 372 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var ReactElement = __webpack_require__(50);
/**
* Create a factory that creates HTML tag elements.
*
* @private
*/
var createDOMFactory = ReactElement.createFactory;
if (false) {
var ReactElementValidator = require('./ReactElementValidator');
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;
/***/ }),
/* 373 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*
*/
var ReactPropTypeLocationNames = {};
if (false) {
ReactPropTypeLocationNames = {
prop: 'prop',
context: 'context',
childContext: 'child context'
};
}
module.exports = ReactPropTypeLocationNames;
/***/ }),
/* 374 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var _require = __webpack_require__(50),
isValidElement = _require.isValidElement;
var factory = __webpack_require__(364);
module.exports = factory(isValidElement);
/***/ }),
/* 375 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var _assign = __webpack_require__(80);
var ReactComponent = __webpack_require__(119);
var ReactNoopUpdateQueue = __webpack_require__(120);
var emptyObject = __webpack_require__(118);
/**
* 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;
/***/ }),
/* 376 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
module.exports = '15.5.4';
/***/ }),
/* 377 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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 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;
/***/ }),
/* 378 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var _prodInvariant = __webpack_require__(65);
var ReactElement = __webpack_require__(50);
var invariant = __webpack_require__(49);
/**
* 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) ? false ? invariant(false, 'React.Children.only expected to receive a single React element child.') : _prodInvariant('143') : void 0;
return children;
}
module.exports = onlyChild;
/***/ }),
/* 379 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var _prodInvariant = __webpack_require__(65);
var ReactCurrentOwner = __webpack_require__(199);
var REACT_ELEMENT_TYPE = __webpack_require__(200);
var getIteratorFn = __webpack_require__(377);
var invariant = __webpack_require__(49);
var KeyEscapeUtils = __webpack_require__(367);
var warning = __webpack_require__(39);
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 (false) {
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 (false) {
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 ? false ? 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;
/***/ }),
/* 380 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
module.exports = __webpack_require__(369);
/***/ }),
/* 381 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(process) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return css; });
/* unused harmony export keyframes */
/* unused harmony export injectGlobal */
/* unused harmony export ThemeProvider */
/* unused harmony export withTheme */
/* unused harmony export ServerStyleSheet */
/* unused harmony export StyleSheetManager */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_stylis__ = __webpack_require__(382);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_stylis___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_stylis__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react__ = __webpack_require__(380);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_react__);
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in 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$2(string) {
return string.replace(_uppercasePattern, '-$1').toLowerCase();
}
var hyphenate_1 = hyphenate$2;
var hyphenate = hyphenate_1;
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-');
}
var hyphenateStyleName_1 = hyphenateStyleName;
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
return typeof obj;
} : function (obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};
var classCallCheck = function (instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
};
var createClass = function () {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function (Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
var _extends = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
var inherits = function (subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
};
var objectWithoutProperties = function (obj, keys) {
var target = {};
for (var i in obj) {
if (keys.indexOf(i) >= 0) continue;
if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;
target[i] = obj[i];
}
return target;
};
var possibleConstructorReturn = function (self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && (typeof call === "object" || typeof call === "function") ? call : self;
};
/*!
* isobject <https://github.com/jonschlinkert/isobject>
*
* Copyright (c) 2014-2015, Jon Schlinkert.
* Licensed under the MIT License.
*/
var index$1 = function isObject(val) {
return val != null && (typeof val === 'undefined' ? 'undefined' : _typeof(val)) === 'object' && !Array.isArray(val);
};
var isObject$1 = index$1;
function isObjectObject(o) {
return isObject$1(o) === true && Object.prototype.toString.call(o) === '[object Object]';
}
var index = function isPlainObject(o) {
var ctor, prot;
if (isObjectObject(o) === false) return false;
// If has modified constructor
ctor = o.constructor;
if (typeof ctor !== 'function') return false;
// If has modified prototype
prot = ctor.prototype;
if (isObjectObject(prot) === false) return false;
// If constructor does not have an Object-specific method
if (prot.hasOwnProperty('isPrototypeOf') === false) {
return false;
}
// Most likely a plain Object
return true;
};
//
var objToCss = function objToCss(obj, prevKey) {
var css = Object.keys(obj).map(function (key) {
if (index(obj[key])) return objToCss(obj[key], key);
return hyphenateStyleName_1(key) + ': ' + obj[key] + ';';
}).join(' ');
return prevKey ? prevKey + ' {\n ' + css + '\n}' : css;
};
var flatten = function flatten(chunks, executionContext) {
return chunks.reduce(function (ruleSet, chunk) {
/* Remove falsey values */
if (chunk === undefined || chunk === null || chunk === false || chunk === '') return ruleSet;
/* Flatten ruleSet */
if (Array.isArray(chunk)) return [].concat(ruleSet, flatten(chunk, executionContext));
/* Handle other components */
// $FlowFixMe not sure how to make this pass
if (chunk.hasOwnProperty('styledComponentId')) return [].concat(ruleSet, ['.' + chunk.styledComponentId]);
/* Either execute or defer the function */
if (typeof chunk === 'function') {
return executionContext ? ruleSet.concat.apply(ruleSet, flatten([chunk(executionContext)], executionContext)) : ruleSet.concat(chunk);
}
/* Handle objects */
// $FlowFixMe have to add %checks somehow to isPlainObject
return ruleSet.concat(index(chunk) ? objToCss(chunk) : chunk.toString());
}, []);
};
//
var stringifyRules = function stringifyRules(rules, selector, prefix) {
var flatCSS = rules.join('').replace(/^\s*\/\/.*$/gm, ''); // replace JS comments
var cssStr = selector && prefix ? prefix + ' ' + selector + ' { ' + flatCSS + ' }' : flatCSS;
var css = __WEBPACK_IMPORTED_MODULE_0_stylis___default()(prefix || !selector ? '' : selector, cssStr, false, false);
return css;
};
//
var chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('');
var charsLength = chars.length;
/* Some high number, usually 9-digit base-10. Map it to base-😎 */
var generateAlphabeticName = function generateAlphabeticName(code) {
var name = '';
var x = void 0;
for (x = code; x > charsLength; x = Math.floor(x / chars.length)) {
name = chars[x % charsLength] + name;
}
return chars[x % charsLength] + name;
};
//
var interleave = (function (strings, interpolations) {
return interpolations.reduce(function (array, interp, i) {
return array.concat(interp, strings[i + 1]);
}, [strings[0]]);
});
//
var css = (function (strings) {
for (var _len = arguments.length, interpolations = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
interpolations[_key - 1] = arguments[_key];
}
return flatten(interleave(strings, interpolations));
});
//
var SC_COMPONENT_ID = /^[^\S\n]*?\/\* sc-component-id:\s+(\S+)\s+\*\//mg;
var extractCompsFromCSS = (function (maybeCSS) {
var css = '' + (maybeCSS || ''); // Definitely a string, and a clone
var existingComponents = [];
css.replace(SC_COMPONENT_ID, function (match, componentId, matchIndex) {
existingComponents.push({ componentId: componentId, matchIndex: matchIndex });
return match;
});
return existingComponents.map(function (_ref, i) {
var componentId = _ref.componentId,
matchIndex = _ref.matchIndex;
var nextComp = existingComponents[i + 1];
var cssFromDOM = nextComp ? css.slice(matchIndex, nextComp.matchIndex) : css.slice(matchIndex);
return { componentId: componentId, cssFromDOM: cssFromDOM };
});
});
//
/*
* Browser Style Sheet with Rehydration
*
* <style data-styled-components="x y z"
* data-styled-components-is-local="true">
* /· sc-component-id: a ·/
* .sc-a { ... }
* .x { ... }
* /· sc-component-id: b ·/
* .sc-b { ... }
* .y { ... }
* .z { ... }
* </style>
*
* Note: replace · with * in the above snippet.
* */
var COMPONENTS_PER_TAG = 40;
var BrowserTag = function () {
function BrowserTag(el, isLocal) {
var existingSource = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
classCallCheck(this, BrowserTag);
this.el = el;
this.isLocal = isLocal;
this.ready = false;
var extractedComps = extractCompsFromCSS(existingSource);
this.size = extractedComps.length;
this.components = extractedComps.reduce(function (acc, obj) {
acc[obj.componentId] = obj; // eslint-disable-line no-param-reassign
return acc;
}, {});
}
BrowserTag.prototype.isFull = function isFull() {
return this.size >= COMPONENTS_PER_TAG;
};
BrowserTag.prototype.addComponent = function addComponent(componentId) {
if (!this.ready) this.replaceElement();
if (this.components[componentId]) throw new Error('Trying to add Component \'' + componentId + '\' twice!');
var comp = { componentId: componentId, textNode: document.createTextNode('') };
this.el.appendChild(comp.textNode);
this.size += 1;
this.components[componentId] = comp;
};
BrowserTag.prototype.inject = function inject(componentId, css, name) {
if (!this.ready) this.replaceElement();
var comp = this.components[componentId];
if (!comp) throw new Error('Must add a new component before you can inject css into it');
if (comp.textNode.data === '') comp.textNode.appendData('\n/* sc-component-id: ' + componentId + ' */\n');
comp.textNode.appendData(css);
if (name) {
var existingNames = this.el.getAttribute(SC_ATTR);
this.el.setAttribute(SC_ATTR, existingNames ? existingNames + ' ' + name : name);
}
};
BrowserTag.prototype.toHTML = function toHTML() {
return this.el.outerHTML;
};
BrowserTag.prototype.toReactElement = function toReactElement() {
throw new Error('BrowserTag doesn\'t implement toReactElement!');
};
BrowserTag.prototype.clone = function clone() {
throw new Error('BrowserTag cannot be cloned!');
};
/* Because we care about source order, before we can inject anything we need to
* create a text node for each component and replace the existing CSS. */
BrowserTag.prototype.replaceElement = function replaceElement() {
var _this = this;
this.ready = true;
// We have nothing to inject. Use the current el.
if (this.size === 0) return;
// Build up our replacement style tag
var newEl = this.el.cloneNode();
newEl.appendChild(document.createTextNode('\n'));
Object.keys(this.components).forEach(function (key) {
var comp = _this.components[key];
// eslint-disable-next-line no-param-reassign
comp.textNode = document.createTextNode(comp.cssFromDOM);
newEl.appendChild(comp.textNode);
});
if (!this.el.parentNode) throw new Error("Trying to replace an element that wasn't mounted!");
// The ol' switcheroo
this.el.parentNode.replaceChild(newEl, this.el);
this.el = newEl;
};
return BrowserTag;
}();
/* Factory function to separate DOM operations from logical ones*/
var BrowserStyleSheet = {
create: function create() {
var tags = [];
var names = {};
/* Construct existing state from DOM */
var nodes = document.querySelectorAll('[' + SC_ATTR + ']');
var nodesLength = nodes.length;
for (var i = 0; i < nodesLength; i += 1) {
var el = nodes[i];
tags.push(new BrowserTag(el, el.getAttribute(LOCAL_ATTR) === 'true', el.innerHTML));
var attr = el.getAttribute(SC_ATTR);
if (attr) {
attr.trim().split(/\s+/).forEach(function (name) {
names[name] = true;
});
}
}
/* Factory for making more tags */
var tagConstructor = function tagConstructor(isLocal) {
var el = document.createElement('style');
el.type = 'text/css';
el.setAttribute(SC_ATTR, '');
el.setAttribute(LOCAL_ATTR, isLocal ? 'true' : 'false');
if (!document.head) throw new Error('Missing document <head>');
document.head.appendChild(el);
return new BrowserTag(el, isLocal);
};
return new StyleSheet(tagConstructor, tags, names);
}
};
//
var SC_ATTR = 'data-styled-components';
var LOCAL_ATTR = 'data-styled-components-is-local';
var CONTEXT_KEY = '__styled-components-stylesheet__';
var instance = null;
// eslint-disable-next-line no-use-before-define
var clones = [];
var StyleSheet = function () {
function StyleSheet(tagConstructor) {
var tags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
var names = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
classCallCheck(this, StyleSheet);
this.hashes = {};
this.deferredInjections = {};
this.tagConstructor = tagConstructor;
this.tags = tags;
this.names = names;
this.constructComponentTagMap();
}
StyleSheet.prototype.constructComponentTagMap = function constructComponentTagMap() {
var _this = this;
this.componentTags = {};
this.tags.forEach(function (tag) {
Object.keys(tag.components).forEach(function (componentId) {
_this.componentTags[componentId] = tag;
});
});
};
/* Best level of caching—get the name from the hash straight away. */
StyleSheet.prototype.getName = function getName(hash) {
return this.hashes[hash.toString()];
};
/* Second level of caching—if the name is already in the dom, don't
* inject anything and record the hash for getName next time. */
StyleSheet.prototype.alreadyInjected = function alreadyInjected(hash, name) {
if (!this.names[name]) return false;
this.hashes[hash.toString()] = name;
return true;
};
/* Third type of caching—don't inject components' componentId twice. */
StyleSheet.prototype.hasInjectedComponent = function hasInjectedComponent(componentId) {
return !!this.componentTags[componentId];
};
StyleSheet.prototype.deferredInject = function deferredInject(componentId, isLocal, css) {
if (this === instance) {
clones.forEach(function (clone) {
clone.deferredInject(componentId, isLocal, css);
});
}
this.getOrCreateTag(componentId, isLocal);
this.deferredInjections[componentId] = css;
};
StyleSheet.prototype.inject = function inject(componentId, isLocal, css, hash, name) {
if (this === instance) {
clones.forEach(function (clone) {
clone.inject(componentId, isLocal, css);
});
}
var tag = this.getOrCreateTag(componentId, isLocal);
var deferredInjection = this.deferredInjections[componentId];
if (deferredInjection) {
tag.inject(componentId, deferredInjection);
delete this.deferredInjections[componentId];
}
tag.inject(componentId, css, name);
if (hash && name) {
this.hashes[hash.toString()] = name;
}
};
StyleSheet.prototype.toHTML = function toHTML() {
return this.tags.map(function (tag) {
return tag.toHTML();
}).join('');
};
StyleSheet.prototype.toReactElements = function toReactElements() {
return this.tags.map(function (tag, i) {
return tag.toReactElement('sc-' + i);
});
};
StyleSheet.prototype.getOrCreateTag = function getOrCreateTag(componentId, isLocal) {
var existingTag = this.componentTags[componentId];
if (existingTag) {
return existingTag;
}
var lastTag = this.tags[this.tags.length - 1];
var componentTag = !lastTag || lastTag.isFull() || lastTag.isLocal !== isLocal ? this.createNewTag(isLocal) : lastTag;
this.componentTags[componentId] = componentTag;
componentTag.addComponent(componentId);
return componentTag;
};
StyleSheet.prototype.createNewTag = function createNewTag(isLocal) {
var newTag = this.tagConstructor(isLocal);
this.tags.push(newTag);
return newTag;
};
StyleSheet.reset = function reset(isServer) {
instance = StyleSheet.create(isServer);
};
/* We can make isServer totally implicit once Jest 20 drops and we
* can change environment on a per-test basis. */
StyleSheet.create = function create() {
var isServer = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : typeof document === 'undefined';
return (isServer ? ServerStyleSheet : BrowserStyleSheet).create();
};
StyleSheet.clone = function clone(oldSheet) {
var newSheet = new StyleSheet(oldSheet.tagConstructor, oldSheet.tags.map(function (tag) {
return tag.clone();
}), _extends({}, oldSheet.names));
newSheet.hashes = _extends({}, oldSheet.hashes);
newSheet.deferredInjections = _extends({}, oldSheet.deferredInjections);
clones.push(newSheet);
return newSheet;
};
createClass(StyleSheet, null, [{
key: 'instance',
get: function get() {
return instance || (instance = StyleSheet.create());
}
}]);
return StyleSheet;
}();
function createCommonjsModule(fn, module) {
return module = { exports: {} }, fn(module, module.exports), 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.
*
*
*/
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$1 = function emptyFunction$1() {};
emptyFunction$1.thatReturns = makeEmptyFunction;
emptyFunction$1.thatReturnsFalse = makeEmptyFunction(false);
emptyFunction$1.thatReturnsTrue = makeEmptyFunction(true);
emptyFunction$1.thatReturnsNull = makeEmptyFunction(null);
emptyFunction$1.thatReturnsThis = function () {
return this;
};
emptyFunction$1.thatReturnsArgument = function (arg) {
return arg;
};
var emptyFunction_1 = emptyFunction$1;
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in 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 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) {};
{
validateFormat = function validateFormat(format) {
if (format === undefined) {
throw new Error('invariant requires an error message argument');
}
};
}
function invariant$1(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;
}
}
var invariant_1 = invariant$1;
var emptyFunction$2 = emptyFunction_1;
/**
* 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$1 = emptyFunction$2;
{
(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$1 = function warning$1(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));
}
};
})();
}
var warning_1 = warning$1;
/**
* 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.
*/
var ReactPropTypesSecret$1 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
var ReactPropTypesSecret_1 = ReactPropTypesSecret$1;
{
var invariant$2 = invariant_1;
var warning$2 = warning_1;
var ReactPropTypesSecret$2 = ReactPropTypesSecret_1;
var loggedTypeFailures = {};
}
/**
* Assert that the values match with the type specs.
* Error messages are memorized and will only be shown once.
*
* @param {object} typeSpecs Map of name to a ReactPropType
* @param {object} values Runtime values that need to be type-checked
* @param {string} location e.g. "prop", "context", "child context"
* @param {string} componentName Name of the component for error messages.
* @param {?Function} getStack Returns the component stack.
* @private
*/
function checkPropTypes$1(typeSpecs, values, location, componentName, getStack) {
{
for (var typeSpecName in typeSpecs) {
if (typeSpecs.hasOwnProperty(typeSpecName)) {
var error;
// Prop type validation may throw. In case they do, we don't want to
// fail the render phase where it didn't fail before. So we log it.
// After these have been cleaned up, we'll let them throw.
try {
// This is intentionally an invariant that gets caught. It's the same
// behavior as without this statement except with a better message.
invariant$2(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', componentName || 'React class', location, typeSpecName);
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret$2);
} catch (ex) {
error = ex;
}
warning$2(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error === 'undefined' ? 'undefined' : _typeof(error));
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
// Only monitor this failure once because there tends to be a lot of the
// same error.
loggedTypeFailures[error.message] = true;
var stack = getStack ? getStack() : '';
warning$2(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '');
}
}
}
}
}
var checkPropTypes_1 = checkPropTypes$1;
var emptyFunction = emptyFunction_1;
var invariant = invariant_1;
var warning = warning_1;
var ReactPropTypesSecret = ReactPropTypesSecret_1;
var checkPropTypes = checkPropTypes_1;
var factoryWithTypeCheckers = function factoryWithTypeCheckers(isValidElement, throwOnDirectAccess) {
/* global Symbol */
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
/**
* Returns the iterator method function contained on the iterable object.
*
* Be sure to invoke the function with the iterable as context:
*
* var iteratorFn = getIteratorFn(myIterable);
* if (iteratorFn) {
* var iterator = iteratorFn.call(myIterable);
* ...
* }
*
* @param {?object} maybeIterable
* @return {?function}
*/
function getIteratorFn(maybeIterable) {
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
if (typeof iteratorFn === 'function') {
return iteratorFn;
}
}
/**
* Collection of methods that allow declaration and validation of props that are
* supplied to React components. Example usage:
*
* var Props = require('ReactPropTypes');
* var MyArticle = React.createClass({
* propTypes: {
* // An optional string prop named "description".
* description: Props.string,
*
* // A required enum prop named "category".
* category: Props.oneOf(['News','Photos']).isRequired,
*
* // A prop named "dialog" that requires an instance of Dialog.
* dialog: Props.instanceOf(Dialog).isRequired
* },
* render: function() { ... }
* });
*
* A more formal specification of how these methods are used:
*
* type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
* decl := ReactPropTypes.{type}(.isRequired)?
*
* Each and every declaration produces a function with the same signature. This
* allows the creation of custom validation functions. For example:
*
* var MyLink = React.createClass({
* propTypes: {
* // An optional string or URI prop named "href".
* href: function(props, propName, componentName) {
* var propValue = props[propName];
* if (propValue != null && typeof propValue !== 'string' &&
* !(propValue instanceof URI)) {
* return new Error(
* 'Expected a string or an URI for ' + propName + ' in ' +
* componentName
* );
* }
* }
* },
* render: function() {...}
* });
*
* @internal
*/
var ANONYMOUS = '<<anonymous>>';
// Important!
// Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
var ReactPropTypes = {
array: createPrimitiveTypeChecker('array'),
bool: createPrimitiveTypeChecker('boolean'),
func: createPrimitiveTypeChecker('function'),
number: createPrimitiveTypeChecker('number'),
object: createPrimitiveTypeChecker('object'),
string: createPrimitiveTypeChecker('string'),
symbol: createPrimitiveTypeChecker('symbol'),
any: createAnyTypeChecker(),
arrayOf: createArrayOfTypeChecker,
element: createElementTypeChecker(),
instanceOf: createInstanceTypeChecker,
node: createNodeChecker(),
objectOf: createObjectOfTypeChecker,
oneOf: createEnumTypeChecker,
oneOfType: createUnionTypeChecker,
shape: createShapeTypeChecker
};
/**
* 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) {
{
var manualPropTypeCallCache = {};
var manualPropTypeWarningCount = 0;
}
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
componentName = componentName || ANONYMOUS;
propFullName = propFullName || propName;
if (secret !== ReactPropTypesSecret) {
if (throwOnDirectAccess) {
// New behavior only for users of `prop-types` package
invariant(false, 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use `PropTypes.checkPropTypes()` to call them. ' + 'Read more at http://fb.me/use-check-prop-types');
} else if ("development" !== 'production' && typeof console !== 'undefined') {
// Old behavior for people using React.PropTypes
var cacheKey = componentName + ':' + propName;
if (!manualPropTypeCallCache[cacheKey] &&
// Avoid spamming the console because they are often not actionable except for lib authors
manualPropTypeWarningCount < 3) {
warning(false, 'You are manually calling a React.PropTypes validation ' + 'function for the `%s` prop on `%s`. This is deprecated ' + 'and will throw in the standalone `prop-types` package. ' + 'You may be seeing this warning due to a third-party PropTypes ' + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.', propFullName, componentName);
manualPropTypeCallCache[cacheKey] = true;
manualPropTypeWarningCount++;
}
}
}
if (props[propName] == null) {
if (isRequired) {
if (props[propName] === null) {
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
}
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
}
return null;
} else {
return validate(props, propName, componentName, location, propFullName);
}
}
var chainedCheckType = checkType.bind(null, false);
chainedCheckType.isRequired = checkType.bind(null, true);
return chainedCheckType;
}
function createPrimitiveTypeChecker(expectedType) {
function validate(props, propName, componentName, location, propFullName, secret) {
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== expectedType) {
// `propValue` being instance of, say, date/regexp, pass the 'object'
// check, but we can offer a more precise error message here rather than
// 'of type `object`'.
var preciseType = getPreciseType(propValue);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createAnyTypeChecker() {
return createChainableTypeChecker(emptyFunction.thatReturnsNull);
}
function createArrayOfTypeChecker(typeChecker) {
function validate(props, propName, componentName, location, propFullName) {
if (typeof typeChecker !== 'function') {
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
}
var propValue = props[propName];
if (!Array.isArray(propValue)) {
var propType = getPropType(propValue);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
}
for (var i = 0; i < propValue.length; i++) {
var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
if (error instanceof Error) {
return error;
}
}
return null;
}
return createChainableTypeChecker(validate);
}
function createElementTypeChecker() {
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
if (!isValidElement(propValue)) {
var propType = getPropType(propValue);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createInstanceTypeChecker(expectedClass) {
function validate(props, propName, componentName, location, propFullName) {
if (!(props[propName] instanceof expectedClass)) {
var expectedClassName = expectedClass.name || ANONYMOUS;
var actualClassName = getClassName(props[propName]);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createEnumTypeChecker(expectedValues) {
if (!Array.isArray(expectedValues)) {
warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.');
return emptyFunction.thatReturnsNull;
}
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
for (var i = 0; i < expectedValues.length; i++) {
if (is(propValue, expectedValues[i])) {
return null;
}
}
var valuesString = JSON.stringify(expectedValues);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
}
return createChainableTypeChecker(validate);
}
function createObjectOfTypeChecker(typeChecker) {
function validate(props, propName, componentName, location, propFullName) {
if (typeof typeChecker !== 'function') {
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
}
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== 'object') {
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
}
for (var key in propValue) {
if (propValue.hasOwnProperty(key)) {
var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
if (error instanceof Error) {
return error;
}
}
}
return null;
}
return createChainableTypeChecker(validate);
}
function createUnionTypeChecker(arrayOfTypeCheckers) {
if (!Array.isArray(arrayOfTypeCheckers)) {
warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.');
return emptyFunction.thatReturnsNull;
}
function validate(props, propName, componentName, location, propFullName) {
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
var checker = arrayOfTypeCheckers[i];
if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {
return null;
}
}
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
}
return createChainableTypeChecker(validate);
}
function createNodeChecker() {
function validate(props, propName, componentName, location, propFullName) {
if (!isNode(props[propName])) {
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createShapeTypeChecker(shapeTypes) {
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== 'object') {
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
}
for (var key in shapeTypes) {
var checker = shapeTypes[key];
if (!checker) {
continue;
}
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
if (error) {
return error;
}
}
return null;
}
return createChainableTypeChecker(validate);
}
function isNode(propValue) {
switch (typeof propValue === 'undefined' ? 'undefined' : _typeof(propValue)) {
case 'number':
case 'string':
case 'undefined':
return true;
case 'boolean':
return !propValue;
case 'object':
if (Array.isArray(propValue)) {
return propValue.every(isNode);
}
if (propValue === null || isValidElement(propValue)) {
return true;
}
var iteratorFn = getIteratorFn(propValue);
if (iteratorFn) {
var iterator = iteratorFn.call(propValue);
var step;
if (iteratorFn !== propValue.entries) {
while (!(step = iterator.next()).done) {
if (!isNode(step.value)) {
return false;
}
}
} else {
// Iterator will provide entry [k,v] tuples rather than values.
while (!(step = iterator.next()).done) {
var entry = step.value;
if (entry) {
if (!isNode(entry[1])) {
return false;
}
}
}
}
} else {
return false;
}
return true;
default:
return false;
}
}
function isSymbol(propType, propValue) {
// Native Symbol.
if (propType === 'symbol') {
return true;
}
// 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
if (propValue['@@toStringTag'] === 'Symbol') {
return true;
}
// Fallback for non-spec compliant Symbols which are polyfilled.
if (typeof Symbol === 'function' && propValue instanceof Symbol) {
return true;
}
return false;
}
// Equivalent of `typeof` but with special handling for array and regexp.
function getPropType(propValue) {
var propType = typeof propValue === 'undefined' ? 'undefined' : _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;
}
ReactPropTypes.checkPropTypes = checkPropTypes;
ReactPropTypes.PropTypes = ReactPropTypes;
return ReactPropTypes;
};
var index$3 = createCommonjsModule(function (module) {
/**
* 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.
*/
{
var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol.for && Symbol.for('react.element') || 0xeac7;
var isValidElement = function isValidElement(object) {
return (typeof object === 'undefined' ? 'undefined' : _typeof(object)) === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
};
// By explicitly using `prop-types` you are opting into new development behavior.
// http://fb.me/prop-types-in-prod
var throwOnDirectAccess = true;
module.exports = factoryWithTypeCheckers(isValidElement, throwOnDirectAccess);
}
});
var _StyleSheetManager$ch;
//
var StyleSheetManager = function (_Component) {
inherits(StyleSheetManager, _Component);
function StyleSheetManager() {
classCallCheck(this, StyleSheetManager);
return possibleConstructorReturn(this, _Component.apply(this, arguments));
}
StyleSheetManager.prototype.getChildContext = function getChildContext() {
var _ref;
return _ref = {}, _ref[CONTEXT_KEY] = this.props.sheet, _ref;
};
StyleSheetManager.prototype.render = function render() {
/* eslint-disable react/prop-types */
// $FlowFixMe
return __WEBPACK_IMPORTED_MODULE_1_react___default.a.Children.only(this.props.children);
};
return StyleSheetManager;
}(__WEBPACK_IMPORTED_MODULE_1_react__["Component"]);
StyleSheetManager.childContextTypes = (_StyleSheetManager$ch = {}, _StyleSheetManager$ch[CONTEXT_KEY] = index$3.instanceOf(StyleSheet).isRequired, _StyleSheetManager$ch);
StyleSheetManager.propTypes = {
sheet: index$3.instanceOf(StyleSheet).isRequired
};
//
var ServerTag = function () {
function ServerTag(isLocal) {
classCallCheck(this, ServerTag);
this.isLocal = isLocal;
this.components = {};
this.size = 0;
this.names = [];
}
ServerTag.prototype.isFull = function isFull() {
return false;
};
ServerTag.prototype.addComponent = function addComponent(componentId) {
if (this.components[componentId]) throw new Error('Trying to add Component \'' + componentId + '\' twice!');
this.components[componentId] = { componentId: componentId, css: '' };
this.size += 1;
};
ServerTag.prototype.inject = function inject(componentId, css, name) {
var comp = this.components[componentId];
if (!comp) throw new Error('Must add a new component before you can inject css into it');
if (comp.css === '') comp.css = '/* sc-component-id: ' + componentId + ' */\n';
comp.css += css.replace(/\n*$/, '\n');
if (name) this.names.push(name);
};
ServerTag.prototype.toHTML = function toHTML() {
var _this = this;
var namesAttr = SC_ATTR + '="' + this.names.join(' ') + '"';
var localAttr = LOCAL_ATTR + '="' + (this.isLocal ? 'true' : 'false') + '"';
var css = Object.keys(this.components).map(function (key) {
return _this.components[key].css;
}).join('');
return '<style type="text/css" ' + namesAttr + ' ' + localAttr + '>\n' + css + '\n</style>';
};
ServerTag.prototype.toReactElement = function toReactElement(key) {
var _attributes,
_this2 = this;
var attributes = (_attributes = {}, _attributes[SC_ATTR] = this.names.join(' '), _attributes[LOCAL_ATTR] = this.isLocal.toString(), _attributes);
var css = Object.keys(this.components).map(function (k) {
return _this2.components[k].css;
}).join('');
return __WEBPACK_IMPORTED_MODULE_1_react___default.a.createElement('style', _extends({
key: key, type: 'text/css' }, attributes, {
dangerouslySetInnerHTML: { __html: css }
}));
};
ServerTag.prototype.clone = function clone() {
var _this3 = this;
var copy = new ServerTag(this.isLocal);
copy.names = [].concat(this.names);
copy.size = this.size;
copy.components = Object.keys(this.components).reduce(function (acc, key) {
acc[key] = _extends({}, _this3.components[key]); // eslint-disable-line no-param-reassign
return acc;
}, {});
return copy;
};
return ServerTag;
}();
var ServerStyleSheet = function () {
function ServerStyleSheet() {
classCallCheck(this, ServerStyleSheet);
this.instance = StyleSheet.clone(StyleSheet.instance);
}
ServerStyleSheet.prototype.collectStyles = function collectStyles(children) {
if (this.closed) throw new Error("Can't collect styles once you've called getStyleTags!");
return __WEBPACK_IMPORTED_MODULE_1_react___default.a.createElement(
StyleSheetManager,
{ sheet: this.instance },
children
);
};
ServerStyleSheet.prototype.getStyleTags = function getStyleTags() {
if (!this.closed) {
clones.splice(clones.indexOf(this.instance), 1);
this.closed = true;
}
return this.instance.toHTML();
};
ServerStyleSheet.prototype.getStyleElement = function getStyleElement() {
if (!this.closed) {
clones.splice(clones.indexOf(this.instance), 1);
this.closed = true;
}
return this.instance.toReactElements();
};
ServerStyleSheet.create = function create() {
return new StyleSheet(function (isLocal) {
return new ServerTag(isLocal);
});
};
return ServerStyleSheet;
}();
//
var LIMIT = 200;
var createWarnTooManyClasses = (function (displayName) {
var generatedClasses = {};
var warningSeen = false;
return function (className) {
if (!warningSeen) {
generatedClasses[className] = true;
if (Object.keys(generatedClasses).length >= LIMIT) {
// Unable to find latestRule in test environment.
/* eslint-disable no-console, prefer-template */
console.warn('Over ' + LIMIT + ' classes were generated for component ' + displayName + '. ' + 'Consider using style property for frequently changed styles.\n' + 'Example:\n' + ' const StyledComp = styled.div`width: 100%;`\n' + ' <StyledComp style={{ background: background }} />');
warningSeen = true;
generatedClasses = {};
}
}
};
});
//
/* Trying to avoid the unknown-prop errors on styled components
by filtering by React's attribute whitelist.
*/
/* Logic copied from ReactDOMUnknownPropertyHook */
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,
className: true,
/* List copied from https://facebook.github.io/react/docs/events.html */
onCopy: true,
onCut: true,
onPaste: true,
onCompositionEnd: true,
onCompositionStart: true,
onCompositionUpdate: true,
onKeyDown: true,
onKeyPress: true,
onKeyUp: true,
onFocus: true,
onBlur: true,
onChange: true,
onInput: true,
onSubmit: true,
onClick: true,
onContextMenu: true,
onDoubleClick: true,
onDrag: true,
onDragEnd: true,
onDragEnter: true,
onDragExit: true,
onDragLeave: true,
onDragOver: true,
onDragStart: true,
onDrop: true,
onMouseDown: true,
onMouseEnter: true,
onMouseLeave: true,
onMouseMove: true,
onMouseOut: true,
onMouseOver: true,
onMouseUp: true,
onSelect: true,
onTouchCancel: true,
onTouchEnd: true,
onTouchMove: true,
onTouchStart: true,
onScroll: true,
onWheel: true,
onAbort: true,
onCanPlay: true,
onCanPlayThrough: true,
onDurationChange: true,
onEmptied: true,
onEncrypted: true,
onEnded: true,
onError: true,
onLoadedData: true,
onLoadedMetadata: true,
onLoadStart: true,
onPause: true,
onPlay: true,
onPlaying: true,
onProgress: true,
onRateChange: true,
onSeeked: true,
onSeeking: true,
onStalled: true,
onSuspend: true,
onTimeUpdate: true,
onVolumeChange: true,
onWaiting: true,
onLoad: true,
onAnimationStart: true,
onAnimationEnd: true,
onAnimationIteration: true,
onTransitionEnd: true,
onCopyCapture: true,
onCutCapture: true,
onPasteCapture: true,
onCompositionEndCapture: true,
onCompositionStartCapture: true,
onCompositionUpdateCapture: true,
onKeyDownCapture: true,
onKeyPressCapture: true,
onKeyUpCapture: true,
onFocusCapture: true,
onBlurCapture: true,
onChangeCapture: true,
onInputCapture: true,
onSubmitCapture: true,
onClickCapture: true,
onContextMenuCapture: true,
onDoubleClickCapture: true,
onDragCapture: true,
onDragEndCapture: true,
onDragEnterCapture: true,
onDragExitCapture: true,
onDragLeaveCapture: true,
onDragOverCapture: true,
onDragStartCapture: true,
onDropCapture: true,
onMouseDownCapture: true,
onMouseEnterCapture: true,
onMouseLeaveCapture: true,
onMouseMoveCapture: true,
onMouseOutCapture: true,
onMouseOverCapture: true,
onMouseUpCapture: true,
onSelectCapture: true,
onTouchCancelCapture: true,
onTouchEndCapture: true,
onTouchMoveCapture: true,
onTouchStartCapture: true,
onScrollCapture: true,
onWheelCapture: true,
onAbortCapture: true,
onCanPlayCapture: true,
onCanPlayThroughCapture: true,
onDurationChangeCapture: true,
onEmptiedCapture: true,
onEncryptedCapture: true,
onEndedCapture: true,
onErrorCapture: true,
onLoadedDataCapture: true,
onLoadedMetadataCapture: true,
onLoadStartCapture: true,
onPauseCapture: true,
onPlayCapture: true,
onPlayingCapture: true,
onProgressCapture: true,
onRateChangeCapture: true,
onSeekedCapture: true,
onSeekingCapture: true,
onStalledCapture: true,
onSuspendCapture: true,
onTimeUpdateCapture: true,
onVolumeChangeCapture: true,
onWaitingCapture: true,
onLoadCapture: true,
onAnimationStartCapture: true,
onAnimationEndCapture: true,
onAnimationIterationCapture: true,
onTransitionEndCapture: true
};
/* From HTMLDOMPropertyConfig */
var htmlProps = {
/**
* Standard Properties
*/
accept: true,
acceptCharset: true,
accessKey: true,
action: true,
allowFullScreen: true,
allowTransparency: true,
alt: true,
// specifies target context for links with `preload` type
as: true,
async: true,
autoComplete: true,
// autoFocus is polyfilled/normalized by AutoFocusUtils
// autoFocus: true,
autoPlay: true,
capture: true,
cellPadding: true,
cellSpacing: true,
charSet: true,
challenge: true,
checked: true,
cite: true,
classID: true,
className: true,
cols: true,
colSpan: true,
content: true,
contentEditable: true,
contextMenu: true,
controls: true,
coords: true,
crossOrigin: true,
data: true, // For `<object />` acts as `src`.
dateTime: true,
default: true,
defer: true,
dir: true,
disabled: true,
download: true,
draggable: true,
encType: true,
form: true,
formAction: true,
formEncType: true,
formMethod: true,
formNoValidate: true,
formTarget: true,
frameBorder: true,
headers: true,
height: true,
hidden: true,
high: true,
href: true,
hrefLang: true,
htmlFor: true,
httpEquiv: true,
icon: true,
id: true,
inputMode: true,
integrity: true,
is: true,
keyParams: true,
keyType: true,
kind: true,
label: true,
lang: true,
list: true,
loop: true,
low: true,
manifest: true,
marginHeight: true,
marginWidth: true,
max: true,
maxLength: true,
media: true,
mediaGroup: true,
method: true,
min: true,
minLength: true,
// Caution; `option.selected` is not updated if `select.multiple` is
// disabled with `removeAttribute`.
multiple: true,
muted: true,
name: true,
nonce: true,
noValidate: true,
open: true,
optimum: true,
pattern: true,
placeholder: true,
playsInline: true,
poster: true,
preload: true,
profile: true,
radioGroup: true,
readOnly: true,
referrerPolicy: true,
rel: true,
required: true,
reversed: true,
role: true,
rows: true,
rowSpan: true,
sandbox: true,
scope: true,
scoped: true,
scrolling: true,
seamless: true,
selected: true,
shape: true,
size: true,
sizes: true,
span: true,
spellCheck: true,
src: true,
srcDoc: true,
srcLang: true,
srcSet: true,
start: true,
step: true,
style: true,
summary: true,
tabIndex: true,
target: true,
title: true,
// Setting .type throws on non-<input> tags
type: true,
useMap: true,
value: true,
width: true,
wmode: true,
wrap: true,
/**
* RDFa Properties
*/
about: true,
datatype: true,
inlist: true,
prefix: true,
// property is also supported for OpenGraph in meta tags.
property: true,
resource: true,
typeof: true,
vocab: true,
/**
* Non-standard Properties
*/
// autoCapitalize and autoCorrect are supported in Mobile Safari for
// keyboard hints.
autoCapitalize: true,
autoCorrect: true,
// autoSave allows WebKit/Blink to persist values of input fields on page reloads
autoSave: true,
// color is for Safari mask-icon link
color: true,
// itemProp, itemScope, itemType are for
// Microdata support. See http://schema.org/docs/gs.html
itemProp: true,
itemScope: true,
itemType: true,
// 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: true,
itemRef: true,
// results show looking glass icon and recent searches on input
// search fields in WebKit/Blink
results: true,
// IE-only attribute that specifies security restrictions on an iframe
// as an alternative to the sandbox attribute on IE<10
security: true,
// IE-only attribute that controls focus behavior
unselectable: 0
};
var svgProps = {
accentHeight: true,
accumulate: true,
additive: true,
alignmentBaseline: true,
allowReorder: true,
alphabetic: true,
amplitude: true,
arabicForm: true,
ascent: true,
attributeName: true,
attributeType: true,
autoReverse: true,
azimuth: true,
baseFrequency: true,
baseProfile: true,
baselineShift: true,
bbox: true,
begin: true,
bias: true,
by: true,
calcMode: true,
capHeight: true,
clip: true,
clipPath: true,
clipRule: true,
clipPathUnits: true,
colorInterpolation: true,
colorInterpolationFilters: true,
colorProfile: true,
colorRendering: true,
contentScriptType: true,
contentStyleType: true,
cursor: true,
cx: true,
cy: true,
d: true,
decelerate: true,
descent: true,
diffuseConstant: true,
direction: true,
display: true,
divisor: true,
dominantBaseline: true,
dur: true,
dx: true,
dy: true,
edgeMode: true,
elevation: true,
enableBackground: true,
end: true,
exponent: true,
externalResourcesRequired: true,
fill: true,
fillOpacity: true,
fillRule: true,
filter: true,
filterRes: true,
filterUnits: true,
floodColor: true,
floodOpacity: true,
focusable: true,
fontFamily: true,
fontSize: true,
fontSizeAdjust: true,
fontStretch: true,
fontStyle: true,
fontVariant: true,
fontWeight: true,
format: true,
from: true,
fx: true,
fy: true,
g1: true,
g2: true,
glyphName: true,
glyphOrientationHorizontal: true,
glyphOrientationVertical: true,
glyphRef: true,
gradientTransform: true,
gradientUnits: true,
hanging: true,
horizAdvX: true,
horizOriginX: true,
ideographic: true,
imageRendering: true,
in: true,
in2: true,
intercept: true,
k: true,
k1: true,
k2: true,
k3: true,
k4: true,
kernelMatrix: true,
kernelUnitLength: true,
kerning: true,
keyPoints: true,
keySplines: true,
keyTimes: true,
lengthAdjust: true,
letterSpacing: true,
lightingColor: true,
limitingConeAngle: true,
local: true,
markerEnd: true,
markerMid: true,
markerStart: true,
markerHeight: true,
markerUnits: true,
markerWidth: true,
mask: true,
maskContentUnits: true,
maskUnits: true,
mathematical: true,
mode: true,
numOctaves: true,
offset: true,
opacity: true,
operator: true,
order: true,
orient: true,
orientation: true,
origin: true,
overflow: true,
overlinePosition: true,
overlineThickness: true,
paintOrder: true,
panose1: true,
pathLength: true,
patternContentUnits: true,
patternTransform: true,
patternUnits: true,
pointerEvents: true,
points: true,
pointsAtX: true,
pointsAtY: true,
pointsAtZ: true,
preserveAlpha: true,
preserveAspectRatio: true,
primitiveUnits: true,
r: true,
radius: true,
refX: true,
refY: true,
renderingIntent: true,
repeatCount: true,
repeatDur: true,
requiredExtensions: true,
requiredFeatures: true,
restart: true,
result: true,
rotate: true,
rx: true,
ry: true,
scale: true,
seed: true,
shapeRendering: true,
slope: true,
spacing: true,
specularConstant: true,
specularExponent: true,
speed: true,
spreadMethod: true,
startOffset: true,
stdDeviation: true,
stemh: true,
stemv: true,
stitchTiles: true,
stopColor: true,
stopOpacity: true,
strikethroughPosition: true,
strikethroughThickness: true,
string: true,
stroke: true,
strokeDasharray: true,
strokeDashoffset: true,
strokeLinecap: true,
strokeLinejoin: true,
strokeMiterlimit: true,
strokeOpacity: true,
strokeWidth: true,
surfaceScale: true,
systemLanguage: true,
tableValues: true,
targetX: true,
targetY: true,
textAnchor: true,
textDecoration: true,
textRendering: true,
textLength: true,
to: true,
transform: true,
u1: true,
u2: true,
underlinePosition: true,
underlineThickness: true,
unicode: true,
unicodeBidi: true,
unicodeRange: true,
unitsPerEm: true,
vAlphabetic: true,
vHanging: true,
vIdeographic: true,
vMathematical: true,
values: true,
vectorEffect: true,
version: true,
vertAdvY: true,
vertOriginX: true,
vertOriginY: true,
viewBox: true,
viewTarget: true,
visibility: true,
widths: true,
wordSpacing: true,
writingMode: true,
x: true,
xHeight: true,
x1: true,
x2: true,
xChannelSelector: true,
xlinkActuate: true,
xlinkArcrole: true,
xlinkHref: true,
xlinkRole: true,
xlinkShow: true,
xlinkTitle: true,
xlinkType: true,
xmlBase: true,
xmlns: true,
xmlnsXlink: true,
xmlLang: true,
xmlSpace: true,
y: true,
y1: true,
y2: true,
yChannelSelector: true,
z: true,
zoomAndPan: true
};
/* From DOMProperty */
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';
var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + '\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040';
var isCustomAttribute = RegExp.prototype.test.bind(new RegExp('^(data|aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$'));
var hasOwnProperty = {}.hasOwnProperty;
var validAttr = (function (name) {
return hasOwnProperty.call(htmlProps, name) || hasOwnProperty.call(svgProps, name) || isCustomAttribute(name.toLowerCase()) || hasOwnProperty.call(reactProps, name);
});
//
function isTag(target) /* : %checks */{
return typeof target === 'string';
}
//
function isStyledComponent(target) /* : %checks */{
return typeof target === 'function' && typeof target.styledComponentId === 'string';
}
//
/* eslint-disable no-undef */
function getComponentName(target) {
return target.displayName || target.name || 'Component';
}
var index$4 = isFunction;
var toString = Object.prototype.toString;
function isFunction(fn) {
var string = toString.call(fn);
return string === '[object Function]' || typeof fn === 'function' && string !== '[object RegExp]' || typeof window !== 'undefined' && (
// IE8 and below
fn === window.setTimeout || fn === window.alert || fn === window.confirm || fn === window.prompt);
}
//
/**
* Creates a broadcast that can be listened to, i.e. simple event emitter
*
* @see https://github.com/ReactTraining/react-broadcast
*/
var createBroadcast = function createBroadcast(initialValue) {
var listeners = [];
var currentValue = initialValue;
return {
publish: function publish(value) {
currentValue = value;
listeners.forEach(function (listener) {
return listener(currentValue);
});
},
subscribe: function subscribe(listener) {
listeners.push(listener);
// Publish to this subscriber once immediately.
listener(currentValue);
return function () {
listeners = listeners.filter(function (item) {
return item !== listener;
});
};
}
};
};
var _ThemeProvider$childC;
var _ThemeProvider$contex;
//
/* globals React$Element */
// NOTE: DO NOT CHANGE, changing this is a semver major change!
var CHANNEL = '__styled-components__';
/**
* Provide a theme to an entire react component tree via context and event listeners (have to do
* both context and event emitter as pure components block context updates)
*/
var ThemeProvider = function (_Component) {
inherits(ThemeProvider, _Component);
function ThemeProvider() {
classCallCheck(this, ThemeProvider);
var _this = possibleConstructorReturn(this, _Component.call(this));
_this.getTheme = _this.getTheme.bind(_this);
return _this;
}
ThemeProvider.prototype.componentWillMount = function componentWillMount() {
var _this2 = this;
// If there is a ThemeProvider wrapper anywhere around this theme provider, merge this theme
// with the outer theme
if (this.context[CHANNEL]) {
var subscribe = this.context[CHANNEL];
this.unsubscribeToOuter = subscribe(function (theme) {
_this2.outerTheme = theme;
});
}
this.broadcast = createBroadcast(this.getTheme());
};
ThemeProvider.prototype.getChildContext = function getChildContext() {
var _babelHelpers$extends;
return _extends({}, this.context, (_babelHelpers$extends = {}, _babelHelpers$extends[CHANNEL] = this.broadcast.subscribe, _babelHelpers$extends));
};
ThemeProvider.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
if (this.props.theme !== nextProps.theme) this.broadcast.publish(this.getTheme(nextProps.theme));
};
ThemeProvider.prototype.componentWillUnmount = function componentWillUnmount() {
if (this.context[CHANNEL]) {
this.unsubscribeToOuter();
}
};
// Get the theme from the props, supporting both (outerTheme) => {} as well as object notation
ThemeProvider.prototype.getTheme = function getTheme(passedTheme) {
var theme = passedTheme || this.props.theme;
if (index$4(theme)) {
var mergedTheme = theme(this.outerTheme);
if (!index(mergedTheme)) {
throw new Error('[ThemeProvider] Please return an object from your theme function, i.e. theme={() => ({})}!');
}
return mergedTheme;
}
if (!index(theme)) {
throw new Error('[ThemeProvider] Please make your theme prop a plain object');
}
return _extends({}, this.outerTheme, theme);
};
ThemeProvider.prototype.render = function render() {
if (!this.props.children) {
return null;
}
return __WEBPACK_IMPORTED_MODULE_1_react___default.a.Children.only(this.props.children);
};
return ThemeProvider;
}(__WEBPACK_IMPORTED_MODULE_1_react__["Component"]);
ThemeProvider.childContextTypes = (_ThemeProvider$childC = {}, _ThemeProvider$childC[CHANNEL] = index$3.func.isRequired, _ThemeProvider$childC);
ThemeProvider.contextTypes = (_ThemeProvider$contex = {}, _ThemeProvider$contex[CHANNEL] = index$3.func, _ThemeProvider$contex);
var _AbstractStyledCompon;
//
var AbstractStyledComponent = function (_Component) {
inherits(AbstractStyledComponent, _Component);
function AbstractStyledComponent() {
classCallCheck(this, AbstractStyledComponent);
return possibleConstructorReturn(this, _Component.apply(this, arguments));
}
return AbstractStyledComponent;
}(__WEBPACK_IMPORTED_MODULE_1_react__["Component"]);
AbstractStyledComponent.contextTypes = (_AbstractStyledCompon = {}, _AbstractStyledCompon[CHANNEL] = index$3.func, _AbstractStyledCompon[CONTEXT_KEY] = index$3.instanceOf(StyleSheet), _AbstractStyledCompon);
//
var escapeRegex = /[[\].#*$><+~=|^:(),"'`]/g;
var multiDashRegex = /--+/g;
var _StyledComponent = (function (ComponentStyle, constructWithOptions) {
/* We depend on components having unique IDs */
var identifiers = {};
var generateId = function generateId(_displayName) {
var displayName = typeof _displayName !== 'string' ? 'sc' : _displayName.replace(escapeRegex, '-') // Replace all possible CSS selectors
.replace(multiDashRegex, '-'); // Replace multiple -- with single -
var nr = (identifiers[displayName] || 0) + 1;
identifiers[displayName] = nr;
var hash = ComponentStyle.generateName(displayName + nr);
return displayName + '-' + hash;
};
var BaseStyledComponent = function (_AbstractStyledCompon) {
inherits(BaseStyledComponent, _AbstractStyledCompon);
function BaseStyledComponent() {
var _temp, _this, _ret;
classCallCheck(this, BaseStyledComponent);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = possibleConstructorReturn(this, _AbstractStyledCompon.call.apply(_AbstractStyledCompon, [this].concat(args))), _this), _this.attrs = {}, _this.state = {
theme: null,
generatedClassName: ''
}, _temp), possibleConstructorReturn(_this, _ret);
}
BaseStyledComponent.prototype.buildExecutionContext = function buildExecutionContext(theme, props) {
var attrs = this.constructor.attrs;
var context = _extends({}, props, { theme: theme });
if (attrs === undefined) {
return context;
}
this.attrs = Object.keys(attrs).reduce(function (acc, key) {
var attr = attrs[key];
// eslint-disable-next-line no-param-reassign
acc[key] = typeof attr === 'function' ? attr(context) : attr;
return acc;
}, {});
return _extends({}, context, this.attrs);
};
BaseStyledComponent.prototype.generateAndInjectStyles = function generateAndInjectStyles(theme, props) {
var _constructor = this.constructor,
componentStyle = _constructor.componentStyle,
warnTooManyClasses = _constructor.warnTooManyClasses;
var executionContext = this.buildExecutionContext(theme, props);
var styleSheet = this.context[CONTEXT_KEY] || StyleSheet.instance;
var className = componentStyle.generateAndInjectStyles(executionContext, styleSheet);
if (warnTooManyClasses !== undefined) warnTooManyClasses(className);
return className;
};
BaseStyledComponent.prototype.componentWillMount = function componentWillMount() {
var _this2 = this;
// If there is a theme in the context, subscribe to the event emitter. This
// is necessary due to pure components blocking context updates, this circumvents
// that by updating when an event is emitted
if (this.context[CHANNEL]) {
var subscribe = this.context[CHANNEL];
this.unsubscribe = subscribe(function (nextTheme) {
// This will be called once immediately
// Props should take precedence over ThemeProvider, which should take precedence over
// defaultProps, but React automatically puts defaultProps on props.
var defaultProps = _this2.constructor.defaultProps;
var isDefaultTheme = defaultProps && _this2.props.theme === defaultProps.theme;
var theme = _this2.props.theme && !isDefaultTheme ? _this2.props.theme : nextTheme;
var generatedClassName = _this2.generateAndInjectStyles(theme, _this2.props);
_this2.setState({ theme: theme, generatedClassName: generatedClassName });
});
} else {
var theme = this.props.theme || {};
var generatedClassName = this.generateAndInjectStyles(theme, this.props);
this.setState({ theme: theme, generatedClassName: generatedClassName });
}
};
BaseStyledComponent.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
var _this3 = this;
this.setState(function (oldState) {
// Props should take precedence over ThemeProvider, which should take precedence over
// defaultProps, but React automatically puts defaultProps on props.
var defaultProps = _this3.constructor.defaultProps;
var isDefaultTheme = defaultProps && nextProps.theme === defaultProps.theme;
var theme = nextProps.theme && !isDefaultTheme ? nextProps.theme : oldState.theme;
var generatedClassName = _this3.generateAndInjectStyles(theme, nextProps);
return { theme: theme, generatedClassName: generatedClassName };
});
};
BaseStyledComponent.prototype.componentWillUnmount = function componentWillUnmount() {
if (this.unsubscribe) {
this.unsubscribe();
}
};
BaseStyledComponent.prototype.render = function render() {
var _this4 = this;
var innerRef = this.props.innerRef;
var generatedClassName = this.state.generatedClassName;
var _constructor2 = this.constructor,
styledComponentId = _constructor2.styledComponentId,
target = _constructor2.target;
var isTargetTag = isTag(target);
var className = [this.props.className, styledComponentId, this.attrs.className, generatedClassName].filter(Boolean).join(' ');
var baseProps = _extends({}, this.attrs, {
className: className
});
if (isStyledComponent(target)) {
baseProps.innerRef = innerRef;
} else {
baseProps.ref = innerRef;
}
var propsForElement = Object.keys(this.props).reduce(function (acc, propName) {
// Don't pass through non HTML tags through to HTML elements
// always omit innerRef
if (propName !== 'innerRef' && propName !== 'className' && (!isTargetTag || validAttr(propName))) {
// eslint-disable-next-line no-param-reassign
acc[propName] = _this4.props[propName];
}
return acc;
}, baseProps);
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1_react__["createElement"])(target, propsForElement);
};
return BaseStyledComponent;
}(AbstractStyledComponent);
var createStyledComponent = function createStyledComponent(target, options, rules) {
var _StyledComponent$cont;
var _options$displayName = options.displayName,
displayName = _options$displayName === undefined ? isTag(target) ? 'styled.' + target : 'Styled(' + getComponentName(target) + ')' : _options$displayName,
_options$componentId = options.componentId,
componentId = _options$componentId === undefined ? generateId(options.displayName) : _options$componentId,
_options$ParentCompon = options.ParentComponent,
ParentComponent = _options$ParentCompon === undefined ? BaseStyledComponent : _options$ParentCompon,
extendingRules = options.rules,
attrs = options.attrs;
var styledComponentId = options.displayName && options.componentId ? options.displayName + '-' + options.componentId : componentId;
var warnTooManyClasses = void 0;
if (typeof process !== 'undefined' && "development" !== 'production') {
warnTooManyClasses = createWarnTooManyClasses(displayName);
}
var componentStyle = new ComponentStyle(extendingRules === undefined ? rules : extendingRules.concat(rules), styledComponentId);
var StyledComponent = function (_ParentComponent) {
inherits(StyledComponent, _ParentComponent);
function StyledComponent() {
classCallCheck(this, StyledComponent);
return possibleConstructorReturn(this, _ParentComponent.apply(this, arguments));
}
StyledComponent.withComponent = function withComponent(tag) {
var _ = options.displayName,
__ = options.componentId,
optionsToCopy = objectWithoutProperties(options, ['displayName', 'componentId']);
var newOptions = _extends({}, optionsToCopy, { ParentComponent: StyledComponent });
return createStyledComponent(tag, newOptions, rules);
};
createClass(StyledComponent, null, [{
key: 'extend',
get: function get() {
var _ = options.displayName,
__ = options.componentId,
optionsToCopy = objectWithoutProperties(options, ['displayName', 'componentId']);
var newOptions = _extends({}, optionsToCopy, { rules: rules, ParentComponent: StyledComponent });
return constructWithOptions(createStyledComponent, target, newOptions);
}
}]);
return StyledComponent;
}(ParentComponent);
StyledComponent.contextTypes = (_StyledComponent$cont = {}, _StyledComponent$cont[CHANNEL] = index$3.func, _StyledComponent$cont[CONTEXT_KEY] = index$3.instanceOf(StyleSheet), _StyledComponent$cont);
StyledComponent.displayName = displayName;
StyledComponent.styledComponentId = styledComponentId;
StyledComponent.attrs = attrs;
StyledComponent.componentStyle = componentStyle;
StyledComponent.warnTooManyClasses = warnTooManyClasses;
StyledComponent.target = target;
return StyledComponent;
};
return createStyledComponent;
});
// murmurhash2 via https://gist.github.com/raycmorgan/588423
function doHash(str, seed) {
var m = 0x5bd1e995;
var r = 24;
var h = seed ^ str.length;
var length = str.length;
var currentIndex = 0;
while (length >= 4) {
var k = UInt32(str, currentIndex);
k = Umul32(k, m);
k ^= k >>> r;
k = Umul32(k, m);
h = Umul32(h, m);
h ^= k;
currentIndex += 4;
length -= 4;
}
switch (length) {
case 3:
h ^= UInt16(str, currentIndex);
h ^= str.charCodeAt(currentIndex + 2) << 16;
h = Umul32(h, m);
break;
case 2:
h ^= UInt16(str, currentIndex);
h = Umul32(h, m);
break;
case 1:
h ^= str.charCodeAt(currentIndex);
h = Umul32(h, m);
break;
}
h ^= h >>> 13;
h = Umul32(h, m);
h ^= h >>> 15;
return h >>> 0;
}
function UInt32(str, pos) {
return str.charCodeAt(pos++) + (str.charCodeAt(pos++) << 8) + (str.charCodeAt(pos++) << 16) + (str.charCodeAt(pos) << 24);
}
function UInt16(str, pos) {
return str.charCodeAt(pos++) + (str.charCodeAt(pos++) << 8);
}
function Umul32(n, m) {
n = n | 0;
m = m | 0;
var nlo = n & 0xffff;
var nhi = n >>> 16;
var res = nlo * m + ((nhi * m & 0xffff) << 16) | 0;
return res;
}
//
/*
ComponentStyle is all the CSS-specific stuff, not
the React-specific stuff.
*/
var _ComponentStyle = (function (nameGenerator, flatten, stringifyRules) {
var ComponentStyle = function () {
function ComponentStyle(rules, componentId) {
classCallCheck(this, ComponentStyle);
this.rules = rules;
this.componentId = componentId;
if (!StyleSheet.instance.hasInjectedComponent(this.componentId)) {
var placeholder = '.' + componentId + ' {}';
StyleSheet.instance.deferredInject(componentId, true, placeholder);
}
}
/*
* Flattens a rule set into valid CSS
* Hashes it, wraps the whole chunk in a .hash1234 {}
* Returns the hash to be injected on render()
* */
ComponentStyle.prototype.generateAndInjectStyles = function generateAndInjectStyles(executionContext, styleSheet) {
var flatCSS = flatten(this.rules, executionContext);
var hash = doHash(this.componentId + flatCSS.join(''));
var existingName = styleSheet.getName(hash);
if (existingName) return existingName;
var name = nameGenerator(hash);
if (styleSheet.alreadyInjected(hash, name)) return name;
var css = '\n' + stringifyRules(flatCSS, '.' + name);
styleSheet.inject(this.componentId, true, css, hash, name);
return name;
};
ComponentStyle.generateName = function generateName(str) {
return nameGenerator(doHash(str));
};
return ComponentStyle;
}();
return ComponentStyle;
});
//
// Thanks to ReactDOMFactories for this handy list!
var domElements = ['a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'main', 'map', 'mark', 'menu', 'menuitem', 'meta', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'u', 'ul', 'var', 'video', 'wbr',
// SVG
'circle', 'clipPath', 'defs', 'ellipse', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'svg', 'text', 'tspan'];
//
var _styled = (function (styledComponent, constructWithOptions) {
var styled = function styled(tag) {
return constructWithOptions(styledComponent, tag);
};
// Shorthands for all valid HTML Elements
domElements.forEach(function (domElement) {
styled[domElement] = styled(domElement);
});
return styled;
});
//
var replaceWhitespace = function replaceWhitespace(str) {
return str.replace(/\s|\\n/g, '');
};
var _keyframes = (function (nameGenerator, stringifyRules, css) {
return function (strings) {
for (var _len = arguments.length, interpolations = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
interpolations[_key - 1] = arguments[_key];
}
var rules = css.apply(undefined, [strings].concat(interpolations));
var hash = doHash(replaceWhitespace(JSON.stringify(rules)));
var existingName = StyleSheet.instance.getName(hash);
if (existingName) return existingName;
var name = nameGenerator(hash);
if (StyleSheet.instance.alreadyInjected(hash, name)) return name;
var generatedCSS = stringifyRules(rules, name, '@keyframes');
StyleSheet.instance.inject('sc-keyframes-' + name, true, generatedCSS, hash, name);
return name;
};
});
//
var _injectGlobal = (function (stringifyRules, css) {
var injectGlobal = function injectGlobal(strings) {
for (var _len = arguments.length, interpolations = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
interpolations[_key - 1] = arguments[_key];
}
var rules = css.apply(undefined, [strings].concat(interpolations));
var hash = doHash(JSON.stringify(rules));
var componentId = 'sc-global-' + hash;
if (StyleSheet.instance.hasInjectedComponent(componentId)) return;
StyleSheet.instance.inject(componentId, false, stringifyRules(rules));
};
return injectGlobal;
});
//
var _constructWithOptions = (function (css) {
var constructWithOptions = function constructWithOptions(componentConstructor, tag) {
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
if (typeof tag !== 'string' && typeof tag !== 'function') {
// $FlowInvalidInputTest
throw new Error('Cannot create styled-component for component: ' + tag);
}
/* This is callable directly as a template function */
var templateFunction = function templateFunction(strings) {
for (var _len = arguments.length, interpolations = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
interpolations[_key - 1] = arguments[_key];
}
return componentConstructor(tag, options, css.apply(undefined, [strings].concat(interpolations)));
};
/* If config methods are called, wrap up a new template function and merge options */
templateFunction.withConfig = function (config) {
return constructWithOptions(componentConstructor, tag, _extends({}, options, config));
};
templateFunction.attrs = function (attrs) {
return constructWithOptions(componentConstructor, tag, _extends({}, options, {
attrs: _extends({}, options.attrs || {}, attrs) }));
};
return templateFunction;
};
return constructWithOptions;
});
/**
* Copyright 2015, Yahoo! Inc.
* Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
*/
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';
var index$5 = 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;
};
//
/* globals ReactClass */
var wrapWithTheme = function wrapWithTheme(Component$$1) {
var _WithTheme$contextTyp;
var componentName = Component$$1.displayName || Component$$1.name || 'Component';
var isStyledComponent$$1 = isStyledComponent(Component$$1);
var WithTheme = function (_React$Component) {
inherits(WithTheme, _React$Component);
function WithTheme() {
var _temp, _this, _ret;
classCallCheck(this, WithTheme);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = {}, _temp), possibleConstructorReturn(_this, _ret);
}
// NOTE: This is so that isStyledComponent passes for the innerRef unwrapping
WithTheme.prototype.componentWillMount = function componentWillMount() {
var _this2 = this;
if (!this.context[CHANNEL]) {
throw new Error('[withTheme] Please use ThemeProvider to be able to use withTheme');
}
var subscribe = this.context[CHANNEL];
this.unsubscribe = subscribe(function (theme) {
_this2.setState({ theme: theme });
});
};
WithTheme.prototype.componentWillUnmount = function componentWillUnmount() {
if (typeof this.unsubscribe === 'function') this.unsubscribe();
};
WithTheme.prototype.render = function render() {
// eslint-disable-next-line react/prop-types
var innerRef = this.props.innerRef;
var theme = this.state.theme;
return __WEBPACK_IMPORTED_MODULE_1_react___default.a.createElement(Component$$1, _extends({
theme: theme
}, this.props, {
innerRef: isStyledComponent$$1 ? innerRef : undefined,
ref: isStyledComponent$$1 ? undefined : innerRef
}));
};
return WithTheme;
}(__WEBPACK_IMPORTED_MODULE_1_react___default.a.Component);
WithTheme.displayName = 'WithTheme(' + componentName + ')';
WithTheme.styledComponentId = 'withTheme';
WithTheme.contextTypes = (_WithTheme$contextTyp = {}, _WithTheme$contextTyp[CHANNEL] = index$3.func, _WithTheme$contextTyp);
return index$5(WithTheme, Component$$1);
};
//
/* Import singletons */
/* Import singleton constructors */
/* Import components */
/* Import Higher Order Components */
/* Instantiate singletons */
var ComponentStyle = _ComponentStyle(generateAlphabeticName, flatten, stringifyRules);
var constructWithOptions = _constructWithOptions(css);
var StyledComponent = _StyledComponent(ComponentStyle, constructWithOptions);
/* Instantiate exported singletons */
var keyframes = _keyframes(generateAlphabeticName, stringifyRules, css);
var injectGlobal = _injectGlobal(stringifyRules, css);
var styled = _styled(StyledComponent, constructWithOptions);
/* unused harmony default export */ var _unused_webpack_default_export = (styled);
/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(45)))
/***/ }),
/* 382 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {/*
* __ ___
* _____/ /___ __/ (_)____
* / ___/ __/ / / / / / ___/
* (__ ) /_/ /_/ / / (__ )
* /____/\__/\__, /_/_/____/
* /____/
*
* stylis is a feature-rich css preprocessor
*
* @licence MIT
*/
(function (factory) {
if (true) {
module.exports = factory(global);
}
else if (typeof define === 'function' && define.amd) {
define(factory(window));
}
else {
window.stylis = factory(window);
}
}(function (window) {
'use strict';
// plugins
var plugins = [];
// regular expressions
var andPattern = /&/g;
var andSpacePattern = / +&/;
var splitPattern = /,\n/g;
var globalPattern = /:global\(%?((?:[^\(\)\[\]]*|\[.*\]|\([^\(\)]*\))*)\)/g;
var globalsPattern = /(?:&| ):global\(%?((?:[^\(\)\[\]]*|\[.*\]|\([^\(\)]*\))*)\)/g;
var hostPattern = /:host\((.*)\)/g;
var hostContextPattern = /:host-context\((.*)\)/g;
var newLinePattern = /\n/g;
var placeholderPattern = /::place/g;
var colonPattern = /: +/g;
var animationPattern = /[ .#~+><\d]+/g;
var transformPattern = / *(transform)/g;
// prefixes
var moz = '-moz-';
var ms = '-ms-';
var webkit = '-webkit-';
/**
* css preprocessor
*
* @param {String} selector - i.e `.class` or `#id` or `[attr=id]`
* @param {String} styles - css string
* @param {Boolean=} animations - prefix animations and keyframes, true by default
* @param {Boolean=} compact - enable additional shadow dom features(:host, :host-context)
* @param {Function|Array} middlewares
* @return {string}
*/
function stylis (selector, styles, animations, compact, middlewares) {
selector += '';
var middleware = middlewares;
var prefix = '';
var namespace = '';
var char;
var attr;
var animns;
var type = selector.charCodeAt(0);
// ` selector` -> `selector`
if (type < 33) {
type = (selector = selector.trim()).charCodeAt(0);
}
switch (type) {
// `#` `.` id and class selectors
case 35:
case 46: {
namespace = (prefix = selector).substring(1);
break;
}
// [ attr selector
case 91: {
// `[data-id=namespace]` -> ['data-id', 'namespace']
attr = selector.substring(1, selector.length - 1).split('=');
char = (namespace = attr[1] || attr[0]).charCodeAt(0);
// [data-id="namespace"]/[data-id='namespace']
// --> "namespace"/'namspace' --> namespace
if (char === 34 || char === 39) {
namespace = namespace.substring(1, namespace.length - 1);
}
prefix = '['+ attr[0] + (attr.length > 1 ? ('="' + namespace +'"]') : ']')
break;
}
// element selector
default: {
namespace = prefix = selector;
}
}
// reset type signature
type = 0;
// animation and keyframe namespace
if (animations === true || animations === undefined || animations === null) {
animations = true;
animns = namespace.replace(animationPattern, '-');
}
else {
animns = '';
animations = false;
}
// middleware
var has;
var uses = middleware !== void 0 && middleware !== null;
var length = plugins.length;
if (uses === true) {
has = (typeof middleware).charCodeAt(0);
// o, array
if (has === 111) {
use(middleware);
}
// f, function
else if (has === 102) {
plugins[length++] = middleware;
}
else {
uses = false;
}
}
if (length !== 0) {
middleware = length === 1 ? plugins[0] : proxy;
uses = true;
}
// declare
var character;
var colon;
var inner;
var selectors;
var build;
var temp;
var prev;
var indexOf;
var first;
var second;
var third;
var sel;
var blob;
var nest;
var str;
var media;
// buffers
var buff = '';
var blck = '';
var flat = '';
// character code
var code = 0;
var nextcode;
// context signatures
var medias = 0;
var special = 0;
var close = 0;
var closed = 0;
var nested = 0;
var func = 0;
var strings = 0;
var globs = 0;
var isplace = 0;
var join = 0;
// context(flat) signatures
var levels = 0;
// comments
var comment = 0;
var comblck = 0;
var comline = 0;
// pre-process
if (uses === true) {
temp = middleware(0, styles, line, column, prefix, 0);
if (temp != null) {
styles = temp;
}
str = '';
}
// positions
var caret = 0;
var depth = 0;
var column = 0;
var line = 1;
var eof = styles.length;
// compiled output
var output = '';
// parse + compile
while (caret < eof) {
code = styles.charCodeAt(caret);
// {, }, ; characters, parse line by line
if (
(medias === 1 && caret === eof - 1) ||
(
strings === 0 && func === 0 && comment === 0 &&
(
// {, }, ;
(code === 123 || code === 125 || code === 59)
||
// eof buffer
(caret === eof - 1 && buff.length !== 0)
)
)
) {
buff += styles.charAt(caret);
// middleware, selector/property context, }
if (uses === true && code !== 125) {
// { pre-processed selector context
if (code === 123) {
temp = middleware(
1,
buff.substring(0, buff.length - 1).trim(),
line,
column,
prefix,
output.length
);
}
// ; property context
else {
temp = middleware(2, buff, line, column, prefix, output.length);
}
if (temp != null) {
buff = code === 123 ? temp + ' {' : temp;
}
}
first = buff.charCodeAt(0);
// only trim when the first character is a space ` `
if (first === 32) {
first = (buff = buff.trim()).charCodeAt(0);
}
second = buff.charCodeAt(1);
third = buff.charCodeAt(2);
// @, special block
if (first === 64) {
// push flat css
if (levels === 1 && flat.length !== 0) {
levels = 0;
flat = prefix + ' {' + flat + '}';
// middleware, flat context
if (uses === true) {
temp = middleware(4, flat, line, column, prefix, output.length);
if (temp != null) {
flat = temp;
}
}
output += flat;
flat = '';
}
// ;
if (code !== 59) {
// @keyframe, `k`
if (second === 107) {
blob = buff.substring(1, 11) + animns + buff.substring(11);
buff = '@' + webkit + blob;
type = 1;
}
// @media `m`, `e` characters,
// @supports `s` `u` characters,
// @global `g` character
else if (
(second === 109 && third === 101) ||
(second === 115 && third === 117) ||
(second === 103)
) {
caret++;
column++;
if (media === undefined) {
media = '';
}
inner = '';
// keep track of opening `{` and `}` occurrences
closed = 1;
// travel to the end of the block
while (caret < eof) {
char = styles.charCodeAt(caret);
// {, }, nested blocks may have nested blocks
if (char === 123) {
closed++;
}
else if (char === 125) {
closed--;
}
// break when the nested block has ended
if (closed === 0) {
caret++;
break;
}
// build content of nested block
inner += styles.charAt(caret++);
// move column and line position
column = (char === 13 || char === 10) ? (line++, 0) : column + 1;
}
selector = depth === 0 ? prefix : prev.substring(0, prev.length-1).replace(newLinePattern, '').trim();
// build block
media += (buff + stylis(
selector,
inner.trim(),
animations,
compact,
null
).trim() + '}');
// middleware, block context
if (uses === true) {
temp = middleware(3, media, line, column, prefix, output.length);
if (temp != null) {
media = temp;
}
}
buff = '';
medias = 1;
if (caret === eof) {
eof++;
}
continue;
}
// unknown
else {
type = 6;
}
}
// flag special, i.e @keyframes, @font-face ...
if (code !== 59 && second !== 105) {
// k, m
if (second !== 107 && second !== 109 && second !== 115 && second !== 103) {
type = 5;
}
close = -1;
special++;
}
}
// property/selector
else {
// { character, selector declaration
if (code === 123) {
depth++;
// push flat css
if (levels === 1 && flat.length !== 0) {
levels = 0;
flat = prefix + ' {' + flat + '}';
// middleware, flat context
if (uses === true) {
temp = middleware(4, flat, line, column, prefix, output.length);
if (temp != null) {
flat = temp;
}
}
output += flat;
flat = '';
}
// nested selector
if (depth === 2) {
// discard first character {
caret++;
column++;
// inner content of block
inner = '';
var nestSelector = buff.substring(0, buff.length - 1).split(splitPattern);
var prevSelector = prev.substring(0, prev.length - 1).split(splitPattern);
// keep track of opening `{` and `}` occurrences
closed = 1;
// travel to the end of the block
while (caret < eof) {
char = styles.charCodeAt(caret);
// {, nested blocks may have nested blocks
if (char === 123) {
closed++;
}
// },
else if (char === 125) {
closed--;
}
// break when the nested block has ended
if (closed === 0) {
break;
}
// build content of nested block
inner += styles.charAt(caret++);
// move column and line position
column = (char === 13 || char === 10) ? (line++, 0) : column + 1;
}
// handle multiple selectors: h1, h2 { div, h4 {} } should generate
// -> h1 div, h2 div, h2 h4, h2 div {}
length = prevSelector.length;
for (var j = 0; j < length; j++) {
// extract value, prep index for reuse
temp = prevSelector[j];
indexOf = temp.indexOf(prefix);
prevSelector[j] = '';
// since there could also be multiple nested selectors
for (var k = 0, l = nestSelector.length; k < l; k++) {
if (indexOf > 0) {
selector = ':global(%)' + temp.trim();
}
else {
selector = temp.replace(prefix, '&').trim();
}
sel = nestSelector[k].trim();
if (sel.indexOf(' &') > 0) {
selector = sel.replace('&', '').trim() + ' ' + selector;
}
else if (globalPattern.exec(sel) !== null) {
selector = sel;
}
else {
selector = selector + ' ' + sel;
}
prevSelector[j] += selector.replace(andSpacePattern, '').trim() + (k === l - 1 ? '' : ',');
}
}
if (nest === undefined) {
nest = '';
}
// concat nest
nest += (
'\n' +
prevSelector.join(',').replace(globalsPattern, ' $1') +
' {'+inner+'}'
);
// signature
nested = 1;
// clear current line, to avoid adding nested blocks to the normal flow
buff = '';
// decreament depth
depth--;
}
// top-level selector
else if (special === 0 || type === 2) {
// register block with placeholder selector
if (isplace === 0 && buff.indexOf('::place') !== -1) {
isplace = 1;
}
selectors = buff.split(splitPattern);
// current selector
build = '';
// previous selector
prev = '';
length = selectors.length;
// prefix multiple selectors with namesapces
// @example h1, h2, h3 --> [namespace] h1, [namespace] h1, ....
for (var j = 0; j < length; j++) {
char = (selector = selectors[j]).charCodeAt(0);
// ` `, trim if first character is a space
if (char === 32) {
char = (selector = selector.trim()).charCodeAt(0);
}
// &
if (char === 38) {
// before: & { / &&... {
selector = prefix + selector.substring(1).replace(andPattern, prefix);
// after: ${prefix} { / ${prefix}${prefix}...
}
else {
// default to :global if & exists outside of the first non-space character
if ((indexOf = selector.indexOf(' &')) > 0) {
// before: html & {
selector = selector.replace(andPattern, prefix).trim();
// after: html ${prefix} {
}
// :
else if (char === 58) {
nextcode = selector.charCodeAt(1);
// h, t, :host
if (compact === true && nextcode === 104 && selector.charCodeAt(4) === 116) {
nextcode = selector.charCodeAt(5);
// (, :host(selector)
if (nextcode === 40) {
// before: `(selector)`
selector = (
prefix + (
selector
.replace(hostPattern, '$1')
.replace(andPattern, prefix)
)
);
// after: ${prefx} selector {
}
// -, :host-context(selector)
else if (nextcode === 45) {
// before: `-context(selector)`
selector = selector
.replace(hostContextPattern, '$1 ' + prefix)
.replace(andPattern, prefix)
// after: selector ${prefix} {
}
// :host
else {
selector = prefix + selector.substring(5);
}
}
// g, :global(selector)
else if (
nextcode === 103 &&
(
compact === true
||
((nextcode = selector.charCodeAt(8)) === 37)
)
) {
globs = 1;
// before: `:global(selector)`
selector = (
selector
.replace(globalPattern, '$1')
.replace(andPattern, prefix).trim()
);
// after: selector
}
// :hover, :active, :focus, etc...
else {
selector = prefix + selector;
}
}
// non-pseudo selectors
else if (globs === 0) {
selector = prefix + ' ' + selector;
}
}
// middleware, post-processed selector context
if (uses === true) {
temp = middleware(
1.5,
j === length - 1 ? selector.substring(0, selector.length - 1).trim() : selector,
line,
column,
prefix,
output.length
);
if (temp != null) {
selector = j === length - 1 ? temp + ' {' : temp;
}
}
// if first selector do not prefix with `,`
prev += (j !== 0 ? ',\n' : '') + (globs !== 1 ? selector : ':global(%)' + selector);
build += j !== 0 ? ',' + selector : selector;
// reset :global flag
globs = 0;
}
buff = build;
}
else {
prev = buff;
}
}
// not single `}`
else if ((code === 125 && buff.length === 1) === false) {
if (join === 1) {
buff = buff.replace(newLinePattern, '');
}
// ;
if (code !== 59) {
buff = (code === 125 ? buff.substring(0, buff.length - 1) : buff.trim()) + ';';
}
// animation: a, n, i characters
if (first === 97 && second === 110 && third === 105) {
// removes ;
buff = buff.substring(0, buff.length - 1);
// position of :
colon = buff.indexOf(':')+1;
// left hand side everything before `:`
build = buff.substring(0, colon);
// short hand animation syntax
if (animations === true && buff.charCodeAt(9) !== 45) {
var anims = buff.substring(colon).trim().split(',');
length = anims.length;
// because we can have multiple animations `animation: slide 4s, slideOut 2s`
for (var j = 0; j < length; j++) {
var anim = anims[j];
var props = anim.split(' ');
// since we can't be sure of the position of the name of the animation we have to find it
for (var k = 0, l = props.length; k < l; k++) {
var prop = props[k].trim();
var frst = prop.charCodeAt(0);
var thrd = prop.charCodeAt(2);
var len = prop.length;
var last = prop.charCodeAt(len - 1);
// animation name parser
if (
// first character
(
// letters
(frst > 64 && frst < 90) ||
(frst > 96 && frst < 122) ||
// the exception `underscores or dashes`
frst === 45 ||
// but two dashes at the beginning are forbidden
(frst === 95 && prop.charCodeAt(1) !== 95)
) &&
// cubic-bezier()/steps(), )
last !== 41 && len !== 0 &&
!(
frst === 105 &&
(
// infinite, i, f, e
(thrd === 102 && last === 101 && len === 8) ||
// initial
(thrd === 105 && last === 108 && len === 7) ||
// inherit
(thrd === 104 && last === 116 && len === 7)
)
) &&
// unset
!(frst === 117 && thrd === 115 && last === 116 && len === 5) &&
// linear, l, n, r
!(frst === 108 && thrd === 110 && last === 114 && len === 6) &&
// alternate/alternate-reverse, a, t, e
!(frst === 97 && thrd === 116 && last === 101 && (len === 9 || len === 17)) &&
// normal, n, r, l
!(frst === 110 && thrd === 114 && last === 108 && len === 6) &&
// backwards, b, c, s
!(frst === 98 && thrd === 99 && last === 115 && len === 9) &&
// forwards, f, r, s
!(frst === 102 && thrd === 114 && last === 115 && len === 8) &&
// both, b, t, h
!(frst === 98 && thrd === 116 && last === 104 && len === 4) &&
// none, n, n, e
!(frst === 110 && thrd === 110 && last === 101 && len === 4)&&
// running, r, n, g
!(frst === 114 && thrd === 110 && last === 103 && len === 7) &&
// paused, p, u, d
!(frst === 112 && thrd === 117 && last === 100 && len === 6) &&
// reversed, r, v, d
!(frst === 114 && thrd === 118 && last === 100 && len === 8) &&
// step-start/step-end, s, e, (t/d)
!(
frst === 115 && thrd === 101 &&
((last === 116 && len === 10) || (last === 100 && len === 8))
) &&
// ease/ease-in/ease-out/ease-in-out, e, s, e
!(
frst === 101 && thrd === 115 &&
(
(last === 101 && len === 4) ||
(len === 11 || len === 7 || len === 8) && prop.charCodeAt(4) === 45
)
) &&
// durations, 0.4ms, .4s, 400ms ...
isNaN(parseFloat(prop)) &&
// handle spaces in cubic-bezier()/steps() functions
prop.indexOf('(') === -1
) {
props[k] = animns + prop;
}
}
build += (j === 0 ? '' : ',') + props.join(' ').trim();
}
}
// explicit syntax, anims array should have only one element
else {
build += (
(buff.charCodeAt(10) !== 110 ? '' : animns) +
buff.substring(colon).trim().trim()
);
}
// vendor prefix
buff = webkit + build + ';' + build + (code === 125 ? ';}' : ';');
}
// appearance: a, p, p
else if (first === 97 && second === 112 && third === 112) {
// vendor prefix -webkit- and -moz-
buff = (
webkit + buff +
moz + buff +
buff
);
}
// display: d, i, s
else if (first === 100 && second === 105 && third === 115) {
// flex/inline-flex
if ((indexOf = buff.indexOf('flex')) !== -1) {
// e, inline-flex
temp = buff.charCodeAt(indexOf-2) === 101 ? 'inline-' : '';
buff = buff.indexOf(' !important') !== -1 ? ' !important' : '';
// vendor prefix
buff = (
'display: ' + webkit + temp + 'box' + buff + ';' +
'display: ' + webkit + temp + 'flex' + buff + ';' +
'display: ' + ms + 'flexbox' + buff + ';' +
'display: ' + temp + 'flex' + buff + ';'
);
}
}
// transforms & transitions: t, r, a
// text-size-adjust: t, e, x
else if (
first === 116 &&
(
(second === 114 && third === 97) ||
(second === 101 && third === 120)
)
) {
// vendor prefix -webkit- and -ms- if transform
buff = (
webkit + buff +
(buff.charCodeAt(5) === 102 ? ms + buff : '') +
buff
);
if (second + third === 211 && buff.charCodeAt(12) === 115 && buff.indexOf(' transform') > -1) {
buff = buff.substring(0, buff.indexOf(';')+1).replace(transformPattern, ' '+webkit+'$1') + buff;
}
}
// hyphens: h, y, p
// user-select: u, s, e
else if (
(first === 104 && second === 121 && third === 112) ||
(first === 117 && second === 115 && third === 101)
) {
// vendor prefix all
buff = (
webkit + buff +
moz + buff +
ms + buff +
buff
);
}
// flex: f, l, e
else if (first === 102 && second === 108 && third === 101) {
// vendor prefix all but moz
buff = (
webkit + buff +
ms + buff +
buff
);
}
// order: o, r, d
else if (first === 111 && second === 114 && third === 100) {
// vendor prefix all but moz
buff = (
webkit + buff +
ms + 'flex-' + buff +
buff
);
}
// align-items, align-center, align-self: a, l, i, -
else if (first === 97 && second === 108 && third === 105 && buff.charCodeAt(5) === 45) {
switch (buff.charCodeAt(6)) {
// align-items, i
case 105: {
temp = buff.replace('-items', '');
buff = (
webkit + buff +
webkit + 'box-' + temp +
ms + 'flex-'+ temp +
buff
);
break;
}
// align-self, s
case 115: {
buff = (
ms + 'flex-item-' + buff.replace('-self', '') +
buff
);
break;
}
// align-content
default: {
buff = (
ms + 'flex-line-pack' + buff.replace('align-content', '') +
buff
);
break;
}
}
}
// justify-content, j, u, s
else if (first === 106 && second === 117 && third === 115) {
colon = buff.indexOf(':');
temp = buff.substring(colon).replace('flex-', '')
buff = (
webkit + 'box-pack' + temp +
webkit + buff +
ms + 'flex-pack' + temp +
buff
);
}
// cursor, c, u, r
else if (first === 99 && second === 117 && third === 114 && /zoo|gra/.exec(buff) !== null) {
buff = (
buff.replace(colonPattern, ': ' + webkit) +
buff.replace(colonPattern, ': ' + moz) +
buff
);
}
// width: min-content / width: max-content
else if (first === 119 && second === 105 && third === 100 && (indexOf = buff.indexOf('-content')) !== -1) {
temp = buff.substring(indexOf - 3);
// vendor prefix
buff = (
'width: ' + webkit + temp +
'width: ' + moz + temp +
'width: ' + temp
);
}
if (code !== 59) {
buff = buff.substring(0, buff.length - 1);
// }
if (code === 125) {
buff += '}';
}
}
}
// } character
if (code === 125) {
if (depth !== 0) {
depth--;
}
// concat nested css
if (depth === 0 && nested === 1) {
styles = styles.substring(0, caret + 1) + nest + styles.substring(caret + 1);
eof += nest.length;
nest = '';
nested = 0;
close++;
}
// }, ` ` whitespace
if (first !== 125 && buff.charCodeAt(buff.length - 2) === 32) {
buff = buff.substring(0, buff.length-1).trim() + '}';
}
}
// @keyframes
if (special !== 0) {
// }, find closing tag
if (code === 125) {
close++;
}
// {
else if (code === 123 && close !== 0) {
close--;
}
// closing tag
if (close === 0) {
// @keyframes
if (type === 1) {
// vendor prefix
buff = '}@'+blob+'}';
// reset
blob = '';
}
// reset signatures
type = 0;
close--;
special--;
}
// @keyframes
else if (type === 1) {
blob += buff;
}
}
// flat context
else if (depth === 0 && code !== 125) {
levels = 1;
flat = flat === undefined ? buff : flat + buff;
buff = '';
}
}
// append line to blck buffer
blck += buff;
// add blck buffer to output
if (code === 125 && type === 0) {
char = blck.charCodeAt(blck.length - 2);
// {, @
if (char !== 123) {
// middleware, block context
if (uses === true) {
temp = middleware(3, blck, line, column, prefix, output.length);
if (temp != null) {
blck = temp;
}
}
if (isplace === 1) {
isplace = 0;
blck = (
blck.replace(placeholderPattern, '::'+webkit+'input-place') +
blck.replace(placeholderPattern, '::'+moz+'place') +
blck.replace(placeholderPattern, ':'+ms+'input-place') +
blck
);
}
// append blck buffer
output += blck;
}
// reset blck buffer
blck = '';
}
if (medias === 1) {
// middleware, block context
if (uses === true) {
temp = middleware(3, blck, line, column, prefix, output.length);
if (temp != null) {
media = temp;
}
}
output += media;
medias = 0;
media = '';
}
join = 0
// reset line buffer
buff = '';
}
// build line by line
else {
// \r, \n, new lines
if (code === 13 || code === 10) {
if (comline === 1) {
comment = comline = 0;
buff = buff.substring(0, buff.indexOf('//')).trim();
}
// /
else if (uses === true && comment === 0 && (length = (str = str.trim()).length) !== 0 && str.charCodeAt(0) !== 47) {
if (buff.length !== 0) {
temp = middleware(7, str, line, column, prefix, output.length);
if (temp != null) {
buff = buff.replace(new RegExp(str+'$'), temp).trim();
}
}
str = '';
}
column = 0;
line++;
}
else {
// not `\t` tab character
if (code !== 9) {
character = styles.charAt(caret);
// build line buffer
if (uses === true && comment === 0) {
str += character;
}
// build character buffer
buff += character;
switch (code) {
// ,
case 44: {
if (strings === 0 && comment === 0 && func === 0) {
join = 1;
buff += '\n';
}
break;
}
// " character
case 34: {
if (comment === 0) {
// exit string " context / enter string context
strings = strings === 34 ? 0 : (strings === 39 ? 39 : 34);
}
break;
}
// ' character
case 39: {
if (comment === 0) {
// exit string ' context / enter string context
strings = strings === 39 ? 0 : (strings === 34 ? 34 : 39);
}
break;
}
// ( character
case 40: {
if (strings === 0 && comment === 0) {
func = 1;
}
break;
}
// ) character
case 41: {
if (strings === 0 && comment === 0) {
func = 0;
}
break;
}
// / character
case 47: {
if (strings === 0 && func === 0) {
char = styles.charCodeAt(caret - 1);
// /, begin line comment
if (comblck === 0 && char === 47) {
comment = comline = 1;
}
// *, end block comment
else if (char === 42) {
comment = comblck = 0;
buff = buff.substring(0, buff.indexOf('/*')).trim();
}
}
break;
}
// * character
case 42: {
if (strings === 0 && func === 0 && comline === 0 && comblck === 0) {
// /, begin block comment
if (styles.charCodeAt(caret - 1) === 47) {
comment = comblck = 1;
}
}
break;
}
}
}
// move column position
column++;
}
}
// move caret position
caret++;
}
// trailing flat css
if (flat !== undefined && flat.length !== 0) {
flat = prefix + ' {' + flat + '}';
// middleware, flat context
if (uses === true) {
temp = middleware(4, flat, line, column, prefix, output.length);
if (temp != null) {
flat = temp;
}
}
// append flat css
output += flat;
}
// middleware, output context
if (uses === true) {
temp = middleware(6, output, line, column, prefix, output.length);
if (temp != null) {
output = temp;
}
}
return output;
}
/**
* use plugin
*
* @param {string|function|function[]} key
* @param {function?} plugin
* @return {Object} {plugins}
*/
function use (plugin) {
var length = plugins.length;
if (plugin != null) {
// array of plugins
if (plugin.constructor === Array) {
for (var i = 0, l = plugin.length; i < l; i++) {
plugins[length++] = plugin[i];
}
}
// single un-keyed plugin
else {
plugins[length] = plugin;
}
}
return stylis;
};
/**
* Middleware Proxy
*
* @param {Number} ctx
* @param {String} str
* @param {Number} line
* @param {Number} col
* @param {String} prefix
* @param {Number} length
* @return {String?}
*/
function proxy (ctx, str, line, col, prefix, length) {
var output = str;
for (var i = 0, l = plugins.length; i < l; i++) {
output = plugins[i](ctx, output, line, col, prefix, length) || output;
}
if (output !== str) {
return output;
}
}
stylis.use = use;
/**
* plugin store
*
* @type {Function[]}
*/
stylis.p = plugins;
/**
* regular expresions
*
* @type {Object<string, RegExp>}
*/
stylis.r = {
a: andPattern,
s: splitPattern,
g: globalPattern,
n: globalsPattern
};
return stylis;
}));
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(16)))
/***/ }),
/* 383 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_styled_components__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_normalized_styled_components__ = __webpack_require__(26);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_styled_is__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_prop_types__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_prop_types__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_react_router_dom__ = __webpack_require__(295);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__baseline__ = __webpack_require__(4);
var _templateObject = _taggedTemplateLiteral(['\n color: ', ';\n text-decoration: none;\n '], ['\n color: ', ';\n text-decoration: none;\n ']),
_templateObject2 = _taggedTemplateLiteral(['\n ', '\n'], ['\n ', '\n']);
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 _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
var style = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1_styled_components__["b" /* css */])(['color: ', ';', ''], function (props) {
return props.theme.primary;
}, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3_styled_is__["a" /* default */])('secondary')(_templateObject, function (props) {
return props.theme.white;
}));
var StyledAnchor = __WEBPACK_IMPORTED_MODULE_2_normalized_styled_components__["h" /* A */].extend(_templateObject2, style);
var StyledLink = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1_styled_components__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_5_react_router_dom__["a" /* Link */]).withConfig({
displayName: 'anchor__StyledLink'
})(['', ''], style);
/**
* @example ./usage.md
*/
var Anchor = function Anchor(_ref) {
var children = _ref.children,
rest = _objectWithoutProperties(_ref, ['children']);
var _rest$to = rest.to,
to = _rest$to === undefined ? '' : _rest$to;
var Views = [function () {
return to ? StyledLink : null;
}, function () {
return StyledAnchor;
}];
var View = Views.reduce(function (sel, view) {
return sel ? sel : view();
}, null);
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
View,
rest,
children
);
};
Anchor.propTypes = {
/**
* The `<a>` text
*/
children: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.node,
secondary: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.bool
};
Anchor.defaultProps = {
secondary: false
};
/* harmony default export */ __webpack_exports__["default"] = (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__baseline__["a" /* default */])(Anchor));
/***/ }),
/* 384 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_styled_components__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__typography__ = __webpack_require__(13);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__theme__ = __webpack_require__(125);
/* harmony default export */ __webpack_exports__["a"] = (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_styled_components__["b" /* css */])(['', ';', ';', ';[hidden] {display: none;}html {line-height: 1.15;text-size-adjust: 100%;}body {font-size: 15px;margin: 0;padding: 0;background: ', ';font-family: \'Libre Franklin\'}'], __WEBPACK_IMPORTED_MODULE_1__typography__["b" /* fonts */].libreFranklin.normal, __WEBPACK_IMPORTED_MODULE_1__typography__["b" /* fonts */].libreFranklin.medium, __WEBPACK_IMPORTED_MODULE_1__typography__["b" /* fonts */].libreFranklin.semibold, __WEBPACK_IMPORTED_MODULE_2__theme__["a" /* default */].background));
/***/ }),
/* 385 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__typography__ = __webpack_require__(13);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_styled_components__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__global__ = __webpack_require__(384);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_2__global__["a"]; });
/* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_1_styled_components__["a" /* default */].div.withConfig({
displayName: 'base'
})(['', ';', ';font-size: 1rem;line-height: 1.5;background-color: ', ';color: ', ';'], __WEBPACK_IMPORTED_MODULE_0__typography__["a" /* default */].fontFamily, __WEBPACK_IMPORTED_MODULE_0__typography__["a" /* default */].normal, function (props) {
return props.theme.background;
}, function (props) {
return props.theme.text;
}));
/***/ }),
/* 386 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* unused harmony export smallOnly */
/* unused harmony export small */
/* unused harmony export mediumOnly */
/* unused harmony export mediumDown */
/* unused harmony export medium */
/* unused harmony export largeOnly */
/* unused harmony export largeDown */
/* unused harmony export large */
/* unused harmony export xlarge */
/* unused harmony export xlargeUp */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_styled_components__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_remcalc__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_remcalc___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_remcalc__);
var bounds = {
small: {
upper: __WEBPACK_IMPORTED_MODULE_1_remcalc___default()(768)
},
medium: {
upper: __WEBPACK_IMPORTED_MODULE_1_remcalc___default()(1024),
lower: __WEBPACK_IMPORTED_MODULE_1_remcalc___default()(769)
},
large: {
upper: __WEBPACK_IMPORTED_MODULE_1_remcalc___default()(1200),
lower: __WEBPACK_IMPORTED_MODULE_1_remcalc___default()(1025)
},
xlarge: {
lower: __WEBPACK_IMPORTED_MODULE_1_remcalc___default()(1201)
}
};
var screens = {
// >= 768px
smallOnly: 'only screen and (max-width: ' + bounds.small.upper + ')',
small: 'only screen and (min-width: ' + bounds.small.upper + '})',
// >= 1024px
mediumOnly: 'only screen and (min-width: ' + bounds.medium.lower + ')\n and (max-width: ' + bounds.medium.upper + ')',
mediumDown: 'only screen and (max-width: ' + bounds.medium.upper + ')',
medium: 'only screen and (min-width: ' + bounds.medium.lower + ')',
// >= 1200px
largeOnly: 'only screen and (min-width: ' + bounds.large.lower + ')\n and (max-width: ' + bounds.large.upper + ')',
largeDown: 'only screen and (max-width: ' + bounds.large.upper + ')',
large: 'only screen and (min-width: ' + bounds.large.upper + ')',
xlarge: 'only screen and (min-width: ' + bounds.xlarge.lower + ')\n and (max-width: ' + bounds.xlarge.upper + ')',
xlargeUp: 'only screen and (min-width: ' + bounds.xlarge.lower + ')'
};
var breakpoint = function breakpoint(label) {
return function () {
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_styled_components__["b" /* css */])(['@media ', ' {', '}'], screens[label], __WEBPACK_IMPORTED_MODULE_0_styled_components__["b" /* css */].apply(undefined, arguments));
};
};
var smallOnly = breakpoint('smallOnly');
var small = breakpoint('small');
var mediumOnly = breakpoint('mediumOnly');
var mediumDown = breakpoint('mediumDown');
var medium = breakpoint('medium');
var largeOnly = breakpoint('largeOnly');
var largeDown = breakpoint('largeDown');
var large = breakpoint('large');
var xlarge = breakpoint('xlarge');
var xlargeUp = breakpoint('xlargeUp');
/* harmony default export */ __webpack_exports__["a"] = ({
smallOnly: smallOnly,
small: small,
mediumOnly: mediumOnly,
mediumDown: mediumDown,
medium: medium,
largeOnly: largeOnly,
largeDown: largeDown,
large: large,
xlarge: xlarge,
xlargeUp: xlargeUp
});
/***/ }),
/* 387 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_broadcast__ = __webpack_require__(14);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_broadcast___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react_broadcast__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__baseline__ = __webpack_require__(4);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__typography__ = __webpack_require__(13);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_styled_is__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_remcalc__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_remcalc___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_remcalc__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_styled_components__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_prop_types__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_prop_types__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__title__ = __webpack_require__(123);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_react__);
var _templateObject = _taggedTemplateLiteral(['\n ', ';\n ', ';\n\n flex-grow: 2;\n\n ', ';\n'], ['\n ', ';\n ', ';\n\n flex-grow: 2;\n\n ', ';\n']),
_templateObject2 = _taggedTemplateLiteral(['\n position: absolute;\n bottom: 0;\n padding-bottom: ', ';\n padding-top: 0;\n '], ['\n position: absolute;\n bottom: 0;\n padding-bottom: ', ';\n padding-top: 0;\n ']),
_templateObject3 = _taggedTemplateLiteral(['\n justify-content: flex-end;\n margin-left: auto;\n '], ['\n justify-content: flex-end;\n margin-left: auto;\n ']);
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 _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
var StyledTitle = __WEBPACK_IMPORTED_MODULE_7__title__["a" /* default */].extend(_templateObject, __WEBPACK_IMPORTED_MODULE_2__typography__["a" /* default */].fontFamily, __WEBPACK_IMPORTED_MODULE_2__typography__["a" /* default */].normal, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3_styled_is__["b" /* isNot */])('collapsed')(_templateObject2, __WEBPACK_IMPORTED_MODULE_4_remcalc___default()(12)));
var InnerDescription = __WEBPACK_IMPORTED_MODULE_5_styled_components__["a" /* default */].div.withConfig({
displayName: 'description__InnerDescription'
})(['justify-content: flex-start;', ';'], __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3_styled_is__["a" /* default */])('collapsed')(_templateObject3));
var Description = function Description(_ref) {
var children = _ref.children,
rest = _objectWithoutProperties(_ref, ['children']);
var render = function render(_ref2) {
var _ref2$collapsed = _ref2.collapsed,
collapsed = _ref2$collapsed === undefined ? false : _ref2$collapsed;
return __WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement(
StyledTitle,
Object.assign({
collapsed: collapsed,
name: 'card-description',
xs: collapsed ? 6 : 12
}, rest),
__WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement(
InnerDescription,
{ collapsed: collapsed },
children
)
);
};
return __WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement(
__WEBPACK_IMPORTED_MODULE_0_react_broadcast__["Subscriber"],
{ channel: 'card' },
render
);
};
Description.propTypes = {
children: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.node,
/**
* @ignore
*/
collapsed: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.bool
};
/* harmony default export */ __webpack_exports__["a"] = (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__baseline__["a" /* default */])(Description));
/***/ }),
/* 388 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_styled_components__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_remcalc__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_remcalc___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_remcalc__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__baseline__ = __webpack_require__(4);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__view__ = __webpack_require__(124);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_react__);
var _templateObject = _taggedTemplateLiteral(['\n display: block;\n padding: ', ';\n background-color: ', ';\n'], ['\n display: block;\n padding: ', ';\n background-color: ', ';\n']);
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 _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
var StyledView = __WEBPACK_IMPORTED_MODULE_3__view__["a" /* default */].extend(_templateObject, __WEBPACK_IMPORTED_MODULE_1_remcalc___default()(62, 23, 5, 23), function (props) {
return props.grey;
});
var GroupView = function GroupView(_ref) {
var children = _ref.children,
rest = _objectWithoutProperties(_ref, ['children']);
return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(
StyledView,
rest,
children
);
};
/* harmony default export */ __webpack_exports__["a"] = (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__baseline__["a" /* default */])(GroupView));
/***/ }),
/* 389 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_styled_components__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react_broadcast__ = __webpack_require__(14);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react_broadcast___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_react_broadcast__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_remcalc__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_remcalc___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_remcalc__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_prop_types__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_prop_types__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__baseline__ = __webpack_require__(4);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__card__ = __webpack_require__(122);
var _templateObject = _taggedTemplateLiteral(['\n position: absolute;\n\n background-color: ', ';\n border: solid ', ' ', ';\n box-shadow: none;\n\n width: calc(100% + ', ');\n margin: 0;\n\n top: ', ';\n left: ', ';\n right: ', ';\n'], ['\n position: absolute;\n\n background-color: ', ';\n border: solid ', ' ', ';\n box-shadow: none;\n\n width: calc(100% + ', ');\n margin: 0;\n\n top: ', ';\n left: ', ';\n right: ', ';\n']);
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 _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
var StyledCard = __WEBPACK_IMPORTED_MODULE_6__card__["default"].extend(_templateObject, function (props) {
return props.theme.primary;
}, __WEBPACK_IMPORTED_MODULE_3_remcalc___default()(1), function (props) {
return props.theme.primaryDesaturatedActive;
}, __WEBPACK_IMPORTED_MODULE_3_remcalc___default()(2), __WEBPACK_IMPORTED_MODULE_3_remcalc___default()(-1), __WEBPACK_IMPORTED_MODULE_3_remcalc___default()(-1), __WEBPACK_IMPORTED_MODULE_3_remcalc___default()(-1));
var Header = function Header(_ref) {
var children = _ref.children,
rest = _objectWithoutProperties(_ref, ['children']);
var render = function render(value) {
var newValue = Object.assign({}, value, {
fromHeader: true
});
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
__WEBPACK_IMPORTED_MODULE_2_react_broadcast__["Broadcast"],
{ channel: 'card', value: newValue },
__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
StyledCard,
Object.assign({ name: 'card-header', collapsed: true, headed: true }, rest),
children
)
);
};
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
__WEBPACK_IMPORTED_MODULE_2_react_broadcast__["Subscriber"],
{ channel: 'card' },
render
);
};
Header.propTypes = {
children: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.node
};
/* harmony default export */ __webpack_exports__["a"] = (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__baseline__["a" /* default */])(Header));
/***/ }),
/* 390 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__description_js__ = __webpack_require__(387);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "CardDescription", function() { return __WEBPACK_IMPORTED_MODULE_0__description_js__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__header_js__ = __webpack_require__(389);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "CardHeader", function() { return __WEBPACK_IMPORTED_MODULE_1__header_js__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__group_view_js__ = __webpack_require__(388);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "CardGroupView", function() { return __WEBPACK_IMPORTED_MODULE_2__group_view_js__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__card_js__ = __webpack_require__(122);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Card", function() { return __WEBPACK_IMPORTED_MODULE_3__card_js__["default"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__meta_js__ = __webpack_require__(391);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "CardMeta", function() { return __WEBPACK_IMPORTED_MODULE_4__meta_js__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__options_js__ = __webpack_require__(392);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "CardOptions", function() { return __WEBPACK_IMPORTED_MODULE_5__options_js__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__outlet_js__ = __webpack_require__(393);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "CardOutlet", function() { return __WEBPACK_IMPORTED_MODULE_6__outlet_js__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__subtitle_js__ = __webpack_require__(394);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "CardSubTitle", function() { return __WEBPACK_IMPORTED_MODULE_7__subtitle_js__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__title_js__ = __webpack_require__(123);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "CardTitle", function() { return __WEBPACK_IMPORTED_MODULE_8__title_js__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__view_js__ = __webpack_require__(124);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "CardView", function() { return __WEBPACK_IMPORTED_MODULE_9__view_js__["a"]; });
// Export { default as CardInfo } from './info.js';
/***/ }),
/* 391 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_styled_components__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react_styled_flexboxgrid__ = __webpack_require__(59);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react_broadcast__ = __webpack_require__(14);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react_broadcast___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_react_broadcast__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__baseline__ = __webpack_require__(4);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_styled_is__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_remcalc__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_remcalc___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_remcalc__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_prop_types__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_prop_types__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__view__ = __webpack_require__(124);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_react__);
var _templateObject = _taggedTemplateLiteral(['\n display: block;\n height: 100%;\n\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n\n ', ';\n'], ['\n display: block;\n height: 100%;\n\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n\n ', ';\n']),
_templateObject2 = _taggedTemplateLiteral(['\n width: 100%;\n display: flex;\n padding-right: ', ';\n '], ['\n width: 100%;\n display: flex;\n padding-right: ', ';\n ']);
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 _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
var InnerRow = __WEBPACK_IMPORTED_MODULE_1_react_styled_flexboxgrid__["Row"].extend(_templateObject, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4_styled_is__["a" /* default */])('collapsed')(_templateObject2, __WEBPACK_IMPORTED_MODULE_5_remcalc___default()(47)));
var Meta = function Meta(_ref) {
var children = _ref.children,
rest = _objectWithoutProperties(_ref, ['children']);
var render = function render(_ref2) {
var _ref2$collapsed = _ref2.collapsed,
collapsed = _ref2$collapsed === undefined ? false : _ref2$collapsed,
_ref2$fromHeader = _ref2.fromHeader,
fromHeader = _ref2$fromHeader === undefined ? false : _ref2$fromHeader,
_ref2$headed = _ref2.headed,
headed = _ref2$headed === undefined ? false : _ref2$headed;
var meta = __WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement(
__WEBPACK_IMPORTED_MODULE_1_react_styled_flexboxgrid__["Col"],
Object.assign({
name: 'card-meta',
xs: collapsed ? 12 : 6,
collapsed: collapsed,
fromHeader: fromHeader,
headed: headed
}, rest),
__WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement(
InnerRow,
{ collapsed: collapsed },
children
)
);
return fromHeader ? __WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement(
__WEBPACK_IMPORTED_MODULE_7__view__["a" /* default */],
{ collapsed: true, fromHeader: true },
meta
) : meta;
};
return __WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement(
__WEBPACK_IMPORTED_MODULE_2_react_broadcast__["Subscriber"],
{ channel: 'card' },
render
);
};
Meta.propTypes = {
children: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.node,
collapsed: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.bool,
fromHeader: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.bool,
headed: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.bool
};
/* harmony default export */ __webpack_exports__["a"] = (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__baseline__["a" /* default */])(Meta));
/***/ }),
/* 392 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_broadcast__ = __webpack_require__(14);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_broadcast___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react_broadcast__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_styled_components__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_normalized_styled_components__ = __webpack_require__(26);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__baseline__ = __webpack_require__(4);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_remcalc__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_remcalc___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_remcalc__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_styled_is__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_prop_types__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_prop_types__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__button__ = __webpack_require__(121);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_react__);
var _templateObject = _taggedTemplateLiteral(['\n flex: 0 0 ', ';\n border-left: ', ' solid ', ';\n box-sizing: border-box;\n\n ', ';\n'], ['\n flex: 0 0 ', ';\n border-left: ', ' solid ', ';\n box-sizing: border-box;\n\n ', ';\n']),
_templateObject2 = _taggedTemplateLiteral(['\n border-left-color: ', ';\n '], ['\n border-left-color: ', ';\n ']),
_templateObject3 = _taggedTemplateLiteral(['\n position: relative;\n border-width: 0;\n box-shadow: none;\n width: 100%;\n min-width: auto;\n height: ', ';\n\n display: flex;\n justify-content: center;\n align-items: center;\n\n overflow-x: visible;\n overflow-y: visible;\n\n ', ';\n\n &:focus {\n border-width: 0;\n }\n\n &:hover {\n border-width: 0;\n }\n\n &:active,\n &:active:hover,\n &:active:focus {\n border-width: 0;\n }\n'], ['\n position: relative;\n border-width: 0;\n box-shadow: none;\n width: 100%;\n min-width: auto;\n height: ', ';\n\n display: flex;\n justify-content: center;\n align-items: center;\n\n overflow-x: visible;\n overflow-y: visible;\n\n ', ';\n\n &:focus {\n border-width: 0;\n }\n\n &:hover {\n border-width: 0;\n }\n\n &:active,\n &:active:hover,\n &:active:focus {\n border-width: 0;\n }\n']),
_templateObject4 = _taggedTemplateLiteral(['\n height: ', ';\n '], ['\n height: ', ';\n ']),
_templateObject5 = _taggedTemplateLiteral(['\n background-color: ', ';\n '], ['\n background-color: ', ';\n ']);
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 _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
var StyledNav = __WEBPACK_IMPORTED_MODULE_2_normalized_styled_components__["f" /* Nav */].extend(_templateObject, __WEBPACK_IMPORTED_MODULE_4_remcalc___default()(47), __WEBPACK_IMPORTED_MODULE_4_remcalc___default()(1), function (props) {
return props.theme.grey;
}, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5_styled_is__["a" /* default */])('fromHeader')(_templateObject2, function (props) {
return props.theme.primaryDesaturatedActive;
}));
var StyledButton = __WEBPACK_IMPORTED_MODULE_7__button__["default"].extend(_templateObject3, __WEBPACK_IMPORTED_MODULE_4_remcalc___default()(124), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5_styled_is__["a" /* default */])('collapsed')(_templateObject4, __WEBPACK_IMPORTED_MODULE_4_remcalc___default()(46)));
var StyledContainer = __WEBPACK_IMPORTED_MODULE_1_styled_components__["a" /* default */].div.withConfig({
displayName: 'options__StyledContainer'
})(['position: absolute;left: 50%;top: 35%; /* I don\'t know why this doesn\'t center with 50% */']);
var StyledCircle = __WEBPACK_IMPORTED_MODULE_1_styled_components__["a" /* default */].div.withConfig({
displayName: 'options__StyledCircle'
})(['margin: 0 0 ', ' ', ';border-radius: 50%;background-color: ', ';width: ', ';height: ', ';', ';'], __WEBPACK_IMPORTED_MODULE_4_remcalc___default()(2), __WEBPACK_IMPORTED_MODULE_4_remcalc___default()(-2), function (props) {
return props.theme.white;
}, __WEBPACK_IMPORTED_MODULE_4_remcalc___default()(4), __WEBPACK_IMPORTED_MODULE_4_remcalc___default()(4), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5_styled_is__["a" /* default */])('secondary')(_templateObject5, function (props) {
return props.theme.secondary;
}));
var Options = function Options(_ref) {
var children = _ref.children,
rest = _objectWithoutProperties(_ref, ['children']);
var render = function render(_ref2) {
var _ref2$fromHeader = _ref2.fromHeader,
fromHeader = _ref2$fromHeader === undefined ? false : _ref2$fromHeader,
_ref2$collapsed = _ref2.collapsed,
collapsed = _ref2$collapsed === undefined ? false : _ref2$collapsed;
return __WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement(
StyledNav,
{ fromHeader: fromHeader, name: 'card-options' },
__WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement(
StyledButton,
Object.assign({
secondary: !fromHeader,
collapsed: collapsed,
rect: true
}, rest),
__WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement(
StyledContainer,
null,
__WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement(StyledCircle, { secondary: !fromHeader }),
__WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement(StyledCircle, { secondary: !fromHeader }),
__WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement(StyledCircle, { secondary: !fromHeader })
)
)
);
};
return __WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement(
__WEBPACK_IMPORTED_MODULE_0_react_broadcast__["Subscriber"],
{ channel: 'card' },
render
);
};
Options.propTypes = {
collapsed: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.bool,
fromHeader: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.bool
};
/* harmony default export */ __webpack_exports__["a"] = (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__baseline__["a" /* default */])(Options));
/***/ }),
/* 393 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_broadcast__ = __webpack_require__(14);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_broadcast___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react_broadcast__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__typography__ = __webpack_require__(13);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__baseline__ = __webpack_require__(4);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_react_styled_flexboxgrid__ = __webpack_require__(59);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_styled_is__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_remcalc__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_remcalc___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_remcalc__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_styled_components__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_prop_types__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_prop_types__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_react__);
var _templateObject = _taggedTemplateLiteral(['\n ', ';\n ', ';\n\n display: block;\n min-width: auto;\n max-width: ', ';\n margin-left: auto;\n\n ', ';\n'], ['\n ', ';\n ', ';\n\n display: block;\n min-width: auto;\n max-width: ', ';\n margin-left: auto;\n\n ', ';\n']),
_templateObject2 = _taggedTemplateLiteral(['\n display: none;\n '], ['\n display: none;\n ']);
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 _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
var StyledCol = __WEBPACK_IMPORTED_MODULE_3_react_styled_flexboxgrid__["Col"].extend(_templateObject, __WEBPACK_IMPORTED_MODULE_1__typography__["a" /* default */].fontFamily, __WEBPACK_IMPORTED_MODULE_1__typography__["a" /* default */].normal, __WEBPACK_IMPORTED_MODULE_5_remcalc___default()(480), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4_styled_is__["a" /* default */])('collapsed')(_templateObject2));
var Outlet = function Outlet(_ref) {
var children = _ref.children,
rest = _objectWithoutProperties(_ref, ['children']);
var render = function render(_ref2) {
var _ref2$collapsed = _ref2.collapsed,
collapsed = _ref2$collapsed === undefined ? false : _ref2$collapsed;
return __WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement(
StyledCol,
Object.assign({ name: 'card-outlet', collapsed: collapsed, xs: 6 }, rest),
children
);
};
return __WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement(
__WEBPACK_IMPORTED_MODULE_0_react_broadcast__["Subscriber"],
{ channel: 'card' },
render
);
};
Outlet.propTypes = {
children: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.node,
collapsed: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.bool
};
/* harmony default export */ __webpack_exports__["a"] = (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__baseline__["a" /* default */])(Outlet));
/***/ }),
/* 394 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_broadcast__ = __webpack_require__(14);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_broadcast___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react_broadcast__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_styled_components__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__baseline__ = __webpack_require__(4);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__typography__ = __webpack_require__(13);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_remcalc__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_remcalc___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_remcalc__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_styled_is__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_prop_types__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_prop_types__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__title__ = __webpack_require__(123);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_react__);
var _templateObject = _taggedTemplateLiteral(['\n display: flex;\n '], ['\n display: flex;\n ']),
_templateObject2 = _taggedTemplateLiteral(['\n color: ', ';\n '], ['\n color: ', ';\n ']),
_templateObject3 = _taggedTemplateLiteral(['\n display: inline-block;\n padding: 0 ', ';\n\n ', ';\n ', ';\n\n ', ';\n'], ['\n display: inline-block;\n padding: 0 ', ';\n\n ', ';\n ', ';\n\n ', ';\n']),
_templateObject4 = _taggedTemplateLiteral(['\n display: flex;\n padding: 0;\n '], ['\n display: flex;\n padding: 0;\n ']);
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 _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
var Span = __WEBPACK_IMPORTED_MODULE_1_styled_components__["a" /* default */].span.withConfig({
displayName: 'subtitle__Span'
})(['display: inline-block;flex-direction: column;', ';', ';font-style: normal;font-stretch: normal;font-size: ', ';justify-content: flex-end;', ';', ';'], __WEBPACK_IMPORTED_MODULE_3__typography__["a" /* default */].fontFamily, __WEBPACK_IMPORTED_MODULE_3__typography__["a" /* default */].normal, __WEBPACK_IMPORTED_MODULE_4_remcalc___default()(14), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5_styled_is__["a" /* default */])('collapsed')(_templateObject), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5_styled_is__["a" /* default */])('fromHeader')(_templateObject2, function (props) {
return props.theme.white;
}));
var StyledTitle = __WEBPACK_IMPORTED_MODULE_7__title__["a" /* default */].extend(_templateObject3, __WEBPACK_IMPORTED_MODULE_4_remcalc___default()(18), __WEBPACK_IMPORTED_MODULE_3__typography__["a" /* default */].fontFamily, __WEBPACK_IMPORTED_MODULE_3__typography__["a" /* default */].normal, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5_styled_is__["a" /* default */])('collapsed')(_templateObject4));
var Subtitle = function Subtitle(_ref) {
var children = _ref.children,
props = _objectWithoutProperties(_ref, ['children']);
var render = function render(_ref2) {
var _ref2$fromHeader = _ref2.fromHeader,
fromHeader = _ref2$fromHeader === undefined ? false : _ref2$fromHeader,
_ref2$collapsed = _ref2.collapsed,
collapsed = _ref2$collapsed === undefined ? false : _ref2$collapsed;
return __WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement(
StyledTitle,
Object.assign({
name: 'card-subtitle',
fromHeader: fromHeader,
collapsed: collapsed
}, props),
__WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement(
Span,
{ fromHeader: fromHeader, collapsed: collapsed },
children
)
);
};
return __WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement(
__WEBPACK_IMPORTED_MODULE_0_react_broadcast__["Subscriber"],
{ channel: 'card' },
render
);
};
Subtitle.propTypes = {
children: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.node,
collapsed: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.bool,
fromHeader: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.bool
};
/* harmony default export */ __webpack_exports__["a"] = (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__baseline__["a" /* default */])(Subtitle));
/***/ }),
/* 395 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__base_input__ = __webpack_require__(52);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__base_toggle__ = __webpack_require__(202);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__baseline__ = __webpack_require__(4);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_react__);
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 Checkbox = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__baseline__["a" /* default */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__base_input__["a" /* default */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__base_toggle__["a" /* default */])({
type: 'checkbox'
})));
/**
* @example ./usage-checkbox.md
*/
/* harmony default export */ __webpack_exports__["default"] = (function (_ref) {
var children = _ref.children,
rest = _objectWithoutProperties(_ref, ['children']);
return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
Checkbox,
rest,
children
);
});
/***/ }),
/* 396 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_styled_components__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_normalized_styled_components__ = __webpack_require__(26);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__baseline__ = __webpack_require__(4);
var _templateObject = _taggedTemplateLiteral(['\n display: inline-block;\n margin: 0;\n padding: 0;\n border: none;\n overflow: hidden;\n width: 100%;\n height: auto;\n\n -webkit-margin-start: 0;\n -webkit-margin-end: 0;\n -webkit-padding-before: 0;\n -webkit-padding-start: 0;\n -webkit-padding-end: 0;\n -webkit-padding-after: 0;\n'], ['\n display: inline-block;\n margin: 0;\n padding: 0;\n border: none;\n overflow: hidden;\n width: 100%;\n height: auto;\n\n -webkit-margin-start: 0;\n -webkit-margin-end: 0;\n -webkit-padding-before: 0;\n -webkit-padding-start: 0;\n -webkit-padding-end: 0;\n -webkit-padding-after: 0;\n']);
function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
var StyledFieldset = __WEBPACK_IMPORTED_MODULE_1_normalized_styled_components__["c" /* Fieldset */].extend(_templateObject);
/* harmony default export */ __webpack_exports__["a"] = (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__baseline__["a" /* default */])(StyledFieldset));
/***/ }),
/* 397 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__base_input__ = __webpack_require__(52);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__baseline__ = __webpack_require__(4);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_react__);
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 Input = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__baseline__["a" /* default */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__base_input__["a" /* default */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__base_input__["b" /* Stylable */])('input')));
/**
* @example ./usage-input.md
*/
/* harmony default export */ __webpack_exports__["default"] = (function (_ref) {
var children = _ref.children,
rest = _objectWithoutProperties(_ref, ['children']);
return __WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement(
Input,
rest,
children
);
});
/***/ }),
/* 398 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__baseline__ = __webpack_require__(4);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__base_input__ = __webpack_require__(52);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_react__);
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 Select = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__baseline__["a" /* default */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__base_input__["a" /* default */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__base_input__["b" /* Stylable */])('select')));
/**
* @example ./usage-select.md
*/
/* harmony default export */ __webpack_exports__["default"] = (function (_ref) {
var children = _ref.children,
rest = _objectWithoutProperties(_ref, ['children']);
return __WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement(
Select,
rest,
children
);
});
/***/ }),
/* 399 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_styled_components__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__theme__ = __webpack_require__(125);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__base__ = __webpack_require__(385);
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 _templateObject = _taggedTemplateLiteral(['\n background-color: transparent;\n'], ['\n background-color: transparent;\n']),
_templateObject2 = _taggedTemplateLiteral(['\n ', '\n '], ['\n ', '\n ']);
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 _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
var StyledBase = __WEBPACK_IMPORTED_MODULE_3__base__["a" /* default */].extend(_templateObject);
var Wrapper = function (_Component) {
_inherits(Wrapper, _Component);
function Wrapper() {
_classCallCheck(this, Wrapper);
return _possibleConstructorReturn(this, (Wrapper.__proto__ || Object.getPrototypeOf(Wrapper)).apply(this, arguments));
}
_createClass(Wrapper, [{
key: 'componentWillMount',
value: function componentWillMount() {
// eslint-disable-next-line no-unused-expressions
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1_styled_components__["c" /* injectGlobal */])(_templateObject2, __WEBPACK_IMPORTED_MODULE_3__base__["b" /* global */]);
}
}, {
key: 'render',
value: function render() {
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
__WEBPACK_IMPORTED_MODULE_1_styled_components__["d" /* ThemeProvider */],
{ theme: __WEBPACK_IMPORTED_MODULE_2__theme__["a" /* default */] },
__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
StyledBase,
null,
this.props.children
)
);
}
}]);
return Wrapper;
}(__WEBPACK_IMPORTED_MODULE_0_react__["Component"]);
/* harmony default export */ __webpack_exports__["default"] = (Wrapper);
/***/ }),
/* 400 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__typography__ = __webpack_require__(13);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_styled_components__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_remcalc__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_remcalc___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_remcalc__);
/* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_1_styled_components__["a" /* default */].p.withConfig({
displayName: 'p'
})(['', ';', ';line-height: ', ';font-size: ', ';'], __WEBPACK_IMPORTED_MODULE_0__typography__["a" /* default */].fontFamily, __WEBPACK_IMPORTED_MODULE_0__typography__["a" /* default */].normal, __WEBPACK_IMPORTED_MODULE_2_remcalc___default()(24), __WEBPACK_IMPORTED_MODULE_2_remcalc___default()(15)));
/***/ }),
/* 401 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_styled_components__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_normalized_styled_components__ = __webpack_require__(26);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_remcalc__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_remcalc___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_remcalc__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__typography__ = __webpack_require__(13);
var _templateObject = _taggedTemplateLiteral(['\n ', ';\n ', ';\n\n line-height: ', ';\n font-size: ', ';\n'], ['\n ', ';\n ', ';\n\n line-height: ', ';\n font-size: ', ';\n']);
function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
/* harmony default export */ __webpack_exports__["default"] = (__WEBPACK_IMPORTED_MODULE_1_normalized_styled_components__["e" /* Small */].extend(_templateObject, __WEBPACK_IMPORTED_MODULE_3__typography__["a" /* default */].fontFamily, __WEBPACK_IMPORTED_MODULE_3__typography__["a" /* default */].normal, __WEBPACK_IMPORTED_MODULE_2_remcalc___default()(18), __WEBPACK_IMPORTED_MODULE_2_remcalc___default()(14)));
/***/ }),
/* 402 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_styled_components__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_normalized_styled_components__ = __webpack_require__(26);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_react_styled_flexboxgrid__ = __webpack_require__(59);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_remcalc__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_remcalc___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_remcalc__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_title_case__ = __webpack_require__(1021);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_title_case___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_title_case__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_tinycolor2__ = __webpack_require__(1020);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_tinycolor2___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_tinycolor2__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__boxes__ = __webpack_require__(51);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__text_p__ = __webpack_require__(400);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9____ = __webpack_require__(125);
var _templateObject = _taggedTemplateLiteral(['\n margin: 0;\n'], ['\n margin: 0;\n']);
function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
var Box = __WEBPACK_IMPORTED_MODULE_1_styled_components__["a" /* default */].div.withConfig({
displayName: 'colors__Box'
})(['margin-bottom: ', ';box-shadow: ', ';border: solid ', ' ', ';'], __WEBPACK_IMPORTED_MODULE_4_remcalc___default()(10), __WEBPACK_IMPORTED_MODULE_7__boxes__["a" /* bottomShaddow */], __WEBPACK_IMPORTED_MODULE_4_remcalc___default()(1), function (props) {
return props.border;
});
var InnerBox = __WEBPACK_IMPORTED_MODULE_1_styled_components__["a" /* default */].div.withConfig({
displayName: 'colors__InnerBox'
})(['padding: ', ';margin-top: ', ';background: ', ';color: ', ';'], __WEBPACK_IMPORTED_MODULE_4_remcalc___default()(18), __WEBPACK_IMPORTED_MODULE_4_remcalc___default()(-7), function (props) {
return props.background;
}, function (props) {
return props.text;
});
// Border: solid ${remcalc(1)} ${props => props.border};
// border-top-width: 0;
var Preview = __WEBPACK_IMPORTED_MODULE_1_styled_components__["a" /* default */].div.withConfig({
displayName: 'colors__Preview'
})(['display: inline-block;background: ', ';height: ', ';width: 100%;'], function (props) {
return props.hex;
}, __WEBPACK_IMPORTED_MODULE_4_remcalc___default()(100));
var Paragraph = __WEBPACK_IMPORTED_MODULE_8__text_p__["a" /* default */].extend(_templateObject);
var baseColorNames = Object.keys(__WEBPACK_IMPORTED_MODULE_9____["a" /* default */]).filter(function (name) {
return typeof __WEBPACK_IMPORTED_MODULE_9____["a" /* default */][name] === 'string';
});
var mostReadable = function mostReadable(hex) {
return __WEBPACK_IMPORTED_MODULE_6_tinycolor2___default.a.mostReadable(hex, baseColorNames.map(function (name) {
return __WEBPACK_IMPORTED_MODULE_9____["a" /* default */][name];
})).toHexString();
};
var borderColor = function borderColor(hex) {
return __WEBPACK_IMPORTED_MODULE_6_tinycolor2___default.a.mostReadable(hex, [__WEBPACK_IMPORTED_MODULE_9____["a" /* default */].text, __WEBPACK_IMPORTED_MODULE_9____["a" /* default */].topologyBackground, __WEBPACK_IMPORTED_MODULE_9____["a" /* default */].secondaryActive, __WEBPACK_IMPORTED_MODULE_9____["a" /* default */].secondaryHover, __WEBPACK_IMPORTED_MODULE_9____["a" /* default */].secondary]).toHexString();
};
var Color = function Color(_ref) {
var name = _ref.name,
hex = _ref.hex;
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
Box,
{ border: borderColor(hex) },
__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Preview, { hex: hex }),
__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
InnerBox,
{ background: hex, text: mostReadable(hex) },
__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
Paragraph,
null,
__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
__WEBPACK_IMPORTED_MODULE_2_normalized_styled_components__["i" /* Strong */],
null,
'Name'
),
': ',
__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement('br', null),
__WEBPACK_IMPORTED_MODULE_5_title_case___default()(name)
),
__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement('br', null),
__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
Paragraph,
null,
__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
__WEBPACK_IMPORTED_MODULE_2_normalized_styled_components__["i" /* Strong */],
null,
'Property'
),
': ',
__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement('br', null),
__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
'code',
null,
name
)
),
__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement('br', null),
__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
Paragraph,
null,
__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
__WEBPACK_IMPORTED_MODULE_2_normalized_styled_components__["i" /* Strong */],
null,
'Hex'
),
': ',
__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement('br', null),
__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
'code',
null,
hex.toUpperCase()
)
)
)
);
};
/* harmony default export */ __webpack_exports__["default"] = (function () {
var colors = Object.keys(__WEBPACK_IMPORTED_MODULE_9____["a" /* default */]).filter(function (name) {
return typeof __WEBPACK_IMPORTED_MODULE_9____["a" /* default */][name] === 'string';
}).sort(function (a, b) {
var _a = __WEBPACK_IMPORTED_MODULE_6_tinycolor2___default()(__WEBPACK_IMPORTED_MODULE_9____["a" /* default */][a]).toHsl().h;
var _b = __WEBPACK_IMPORTED_MODULE_6_tinycolor2___default()(__WEBPACK_IMPORTED_MODULE_9____["a" /* default */][b]).toHsl().h;
return _a >= _b ? -1 : 1;
}).map(function (name) {
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
__WEBPACK_IMPORTED_MODULE_3_react_styled_flexboxgrid__["Col"],
{ key: name, xs: 4 },
__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Color, { name: name, hex: __WEBPACK_IMPORTED_MODULE_9____["a" /* default */][name] })
);
});
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
__WEBPACK_IMPORTED_MODULE_3_react_styled_flexboxgrid__["Row"],
null,
colors
);
});
/***/ }),
/* 403 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__);
function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure undefined"); }
var Tooltip = function Tooltip(_ref) {
_objectDestructuringEmpty(_ref);
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
'p',
null,
'Tooltip'
);
};
/* harmony default export */ __webpack_exports__["default"] = (Tooltip);
/***/ }),
/* 404 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_styled_components__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_normalized_styled_components__ = __webpack_require__(26);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_prop_types__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_prop_types__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__baseline__ = __webpack_require__(4);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__constants__ = __webpack_require__(40);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__simulation__ = __webpack_require__(412);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__node__ = __webpack_require__(212);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__link__ = __webpack_require__(210);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__link_arrow__ = __webpack_require__(405);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__link_functions__ = __webpack_require__(406);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "TopologyNode", function() { return __WEBPACK_IMPORTED_MODULE_7__node__["a"]; });
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "TopologyLink", function() { return __WEBPACK_IMPORTED_MODULE_8__link__["a"]; });
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 _templateObject = _taggedTemplateLiteral(['\n width: 100%;\n height: 1400px;\n'], ['\n width: 100%;\n height: 1400px;\n']);
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 _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
var StyledSvg = __WEBPACK_IMPORTED_MODULE_2_normalized_styled_components__["a" /* Svg */].extend(_templateObject);
/**
* @example ./usage.md
*/
var Topology = function (_React$Component) {
_inherits(Topology, _React$Component);
function Topology() {
_classCallCheck(this, Topology);
return _possibleConstructorReturn(this, (Topology.__proto__ || Object.getPrototypeOf(Topology)).apply(this, arguments));
}
_createClass(Topology, [{
key: 'componentWillMount',
value: function componentWillMount() {
var services = this.getServicesWithoutConsul();
var svgSize = this.getSvgSize();
var _createSimulation = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__simulation__["a" /* createSimulation */])(services, svgSize),
nodes = _createSimulation.nodes,
links = _createSimulation.links,
simulation = _createSimulation.simulation;
this.setState({
nodes: nodes,
links: links,
simulation: simulation
});
}
}, {
key: 'getServicesWithoutConsul',
value: function getServicesWithoutConsul() {
return this.props.services.reduce(function (acc, service, index) {
if (service.id !== 'consul') acc.push(service);
return acc;
}, []);
}
}, {
key: 'getSvgSize',
value: function getSvgSize() {
if (document.getElementById('topology-svg')) {
return document.getElementById('topology-svg').getBoundingClientRect();
}
var windowWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
return {
width: windowWidth - 2 * 24,
height: 1400
};
}
}, {
key: 'constrainNodePosition',
value: function constrainNodePosition(x, y) {
var children = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
var svgSize = this.getSvgSize();
var nodeRect = children ? __WEBPACK_IMPORTED_MODULE_5__constants__["a" /* default */].nodeRectWithChildren : __WEBPACK_IMPORTED_MODULE_5__constants__["a" /* default */].nodeRect;
if (x < nodeRect.right + 2) {
x = nodeRect.right + 2;
} else if (x > svgSize.width + nodeRect.left - 2) {
x = svgSize.width + nodeRect.left - 2;
}
if (y < -nodeRect.top + 2) {
y = -nodeRect.top + 2;
} else if (y > svgSize.height - nodeRect.bottom - 2) {
y = svgSize.height - nodeRect.bottom - 2;
}
return {
x: x,
y: y
};
}
}, {
key: 'findNode',
value: function findNode(nodeUuid) {
return this.state.nodes.reduce(function (acc, simNode, index) {
return simNode.uuid === nodeUuid ? simNode : acc;
}, {});
}
}, {
key: 'getConsulNodePosition',
value: function getConsulNodePosition() {
var svgSize = this.getSvgSize();
var x = svgSize.width - __WEBPACK_IMPORTED_MODULE_5__constants__["a" /* default */].nodeSize.width;
return {
x: x,
y: 0
};
}
}, {
key: 'getConstrainedNodePosition',
value: function getConstrainedNodePosition(nodeUuid) {
var children = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
var node = this.findNode(nodeUuid);
return this.constrainNodePosition(node.x, node.y, children);
}
}, {
key: 'findNodeData',
value: function findNodeData(nodesData, nodeUuid) {
return nodesData.reduce(function (acc, nodeData, index) {
return nodeData.uuid === nodeUuid ? nodeData : acc;
}, {});
}
}, {
key: 'setDragInfo',
value: function setDragInfo(dragging) {
var nodeUuid = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
var position = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
this.dragInfo = {
dragging: dragging,
nodeUuid: nodeUuid,
position: position
};
}
}, {
key: 'render',
value: function render() {
var _this2 = this;
var _props = this.props,
onQuickActions = _props.onQuickActions,
services = _props.services;
var _state = this.state,
nodes = _state.nodes,
links = _state.links;
var nodesData = services.map(function (service, index) {
var nodePosition = service.id === 'consul' ? _this2.getConsulNodePosition() : _this2.getConstrainedNodePosition(service.uuid, service.children);
return Object.assign({}, service, nodePosition);
});
// TODO links will need to know whether a service has children
// if it does, the height of it will be different
var linksData = links.map(function (link, index) {
return {
source: _this2.findNodeData(nodesData, link.source.uuid),
target: _this2.findNodeData(nodesData, link.target.uuid)
};
}).map(function (linkData, index) {
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_10__link_functions__["a" /* calculateLineLayout */])(linkData, index);
});
var onDragStart = function onDragStart(evt, nodeId) {
// It's this node's position that we'll need to update
var x = evt.changedTouches ? evt.changedTouches[0].pageX : evt.clientX;
var y = evt.changedTouches ? evt.changedTouches[0].pageY : evt.clientY;
_this2.setDragInfo(true, nodeId, {
x: x,
y: y
});
};
var onDragMove = function onDragMove(evt) {
if (_this2.dragInfo && _this2.dragInfo.dragging) {
var x = evt.changedTouches ? evt.changedTouches[0].pageX : evt.clientX;
var y = evt.changedTouches ? evt.changedTouches[0].pageY : evt.clientY;
var offset = {
x: x - _this2.dragInfo.position.x,
y: y - _this2.dragInfo.position.y
};
var dragNodes = nodes.map(function (simNode, index) {
if (simNode.uuid === _this2.dragInfo.nodeUuid) {
return Object.assign({}, simNode, {
x: simNode.x + offset.x,
y: simNode.y + offset.y
});
}
return Object.assign({}, simNode);
});
_this2.setState({
nodes: dragNodes
});
_this2.setDragInfo(true, _this2.dragInfo.nodeUuid, {
x: x,
y: y
});
}
};
var onDragEnd = function onDragEnd(evt) {
_this2.setDragInfo(false);
};
var onTitleClick = function onTitleClick(serviceUUID) {
return _this2.props.onNodeTitleClick(serviceUUID);
};
var renderedNode = function renderedNode(n, index) {
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_7__node__["a" /* default */], {
key: index,
data: n,
index: index,
onDragStart: onDragStart,
onNodeTitleClick: onTitleClick,
onQuickActions: onQuickActions,
connected: n.id !== 'consul'
});
};
var renderedLink = function renderedLink(l, index) {
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_8__link__["a" /* default */], { key: index, data: l, index: index });
};
var renderedLinkArrow = function renderedLinkArrow(l, index) {
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_9__link_arrow__["a" /* default */], { key: index, data: l, index: index });
};
var renderedNodes = this.dragInfo && this.dragInfo.dragging ? nodesData.filter(function (n, index) {
return n.uuid !== _this2.dragInfo.nodeUuid;
}).map(function (n, index) {
return renderedNode(n, index);
}) : nodesData.map(function (n, index) {
return renderedNode(n, index);
});
var renderedLinks = linksData.map(function (l, index) {
return renderedLink(l, index);
});
var renderedLinkArrows = this.dragInfo && this.dragInfo.dragging ? linksData.filter(function (l, index) {
return l.target.uuid !== _this2.dragInfo.nodeUuid;
}).map(function (l, index) {
return renderedLinkArrow(l, index);
}) : linksData.map(function (l, index) {
return renderedLinkArrow(l, index);
});
var dragNode = !this.dragInfo || !this.dragInfo.dragging ? null : renderedNode(nodesData.reduce(function (dragNode, n, index) {
if (n.uuid === _this2.dragInfo.nodeUuid) {
return n;
}
return dragNode;
}, {}));
var dragLinkArrow = !this.dragInfo || !this.dragInfo.dragging || renderedLinkArrows.length === renderedLinks.length ? null : renderedLinkArrow(linksData.reduce(function (dragLinkArrow, l, index) {
if (l.target.uuid === _this2.dragInfo.nodeUuid) {
return l;
}
return dragLinkArrow;
}, {}));
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
StyledSvg,
{
onMouseMove: onDragMove,
onTouchMove: onDragMove,
onMouseUp: onDragEnd,
onTouchEnd: onDragEnd,
onTouchCancel: onDragEnd,
id: 'topology-svg'
},
__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
'g',
null,
renderedNodes
),
__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
'g',
null,
renderedLinks
),
__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
'g',
null,
renderedLinkArrows
),
__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
'g',
null,
dragNode
),
__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
'g',
null,
dragLinkArrow
)
);
}
}]);
return Topology;
}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component);
Topology.propTypes = {
onQuickActions: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.func,
onNodeTitleClick: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.func,
services: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.array
};
/* harmony default export */ __webpack_exports__["default"] = (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__baseline__["a" /* default */])(Topology));
/***/ }),
/* 405 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__shapes__ = __webpack_require__(211);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__baseline__ = __webpack_require__(4);
var GraphLinkArrow = function GraphLinkArrow(_ref) {
var data = _ref.data,
index = _ref.index;
var targetPosition = data.targetPosition,
arrowAngle = data.arrowAngle;
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
'g',
{
transform: // eslint-disable-next-line max-len
'translate(' + targetPosition.x + ', ' + targetPosition.y + ') rotate(' + arrowAngle + ')'
},
__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_2__shapes__["a" /* GraphLinkCircle */], { cx: 0, cy: 0, r: 9 }),
__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_2__shapes__["b" /* GraphLinkArrowLine */], { x1: -1, x2: 2, y1: -3, y2: 0 }),
__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_2__shapes__["b" /* GraphLinkArrowLine */], { x1: -1, x2: 2, y1: 3, y2: 0 })
);
};
GraphLinkArrow.propTypes = {
data: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object.isRequired,
index: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.number
};
/* harmony default export */ __webpack_exports__["a"] = (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__baseline__["a" /* default */])(GraphLinkArrow));
/***/ }),
/* 406 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return calculateLineLayout; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__constants__ = __webpack_require__(40);
var getAngleFromPoints = function getAngleFromPoints(source, target) {
var lineAngle = Math.atan2(target.y - source.y, target.x - source.x);
var lineAngleDeg = lineAngle * 180 / Math.PI;
var zeroToThreeSixty = lineAngleDeg < 0 ? 360 + lineAngleDeg : lineAngleDeg;
return zeroToThreeSixty;
};
var getPosition = function getPosition(angle, positions, position) {
var noCorners = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
var positionIndex = noCorners ? Math.round(angle / 90) * 2 : Math.round(angle / 45);
var offsetPosition = positions[positionIndex];
return {
id: offsetPosition.id,
x: position.x + offsetPosition.x,
y: position.y + offsetPosition.y
};
};
var getPositions = function getPositions(rect) {
var halfCorner = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
return [{
id: 'r',
x: rect.right,
y: 0
}, {
id: 'br',
x: rect.right - halfCorner,
y: rect.bottom - halfCorner
}, {
id: 'b',
x: 0,
y: rect.bottom
}, {
id: 'bl',
x: rect.left + halfCorner,
y: rect.bottom - halfCorner
}, {
id: 'l',
x: rect.left,
y: 0
}, {
id: 'tl',
x: rect.left + halfCorner,
y: rect.top + halfCorner
}, {
id: 't',
x: 0,
y: rect.top
}, {
id: 'tr',
x: rect.right - halfCorner,
y: rect.top + halfCorner
}, {
id: 'r',
x: rect.right,
y: 0
}];
};
var getRect = function getRect(data) {
return data.children ? __WEBPACK_IMPORTED_MODULE_0__constants__["a" /* default */].nodeRectWithChildren : __WEBPACK_IMPORTED_MODULE_0__constants__["a" /* default */].nodeRect;
};
var calculateLineLayout = function calculateLineLayout(_ref) {
var source = _ref.source,
target = _ref.target;
// Actually, this will need to be got dynamically, in case them things are different sizes
// yeah right, now you'll get to do exactly that
var sourceRect = getRect(source);
var targetRect = getRect(target);
var halfCorner = 2;
var sourcePositions = getPositions(sourceRect, halfCorner);
var sourceAngle = getAngleFromPoints(source, target);
var sourcePosition = getPosition(sourceAngle, sourcePositions, source);
var targetPositions = getPositions(targetRect, halfCorner);
var targetAngle = getAngleFromPoints(target, sourcePosition);
var targetPosition = getPosition(targetAngle, targetPositions, target); // , true);
var arrowAngle = getAngleFromPoints(sourcePosition, targetPosition);
return {
source: source,
target: target,
sourcePosition: sourcePosition,
targetPosition: targetPosition,
arrowAngle: arrowAngle
};
};
/***/ }),
/* 407 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__baseline__ = __webpack_require__(4);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__constants__ = __webpack_require__(40);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__shapes__ = __webpack_require__(53);
var NodeButton = function NodeButton(_ref) {
var connected = _ref.connected,
onButtonClick = _ref.onButtonClick,
index = _ref.index;
var _Constants$buttonRect = __WEBPACK_IMPORTED_MODULE_3__constants__["a" /* default */].buttonRect,
x = _Constants$buttonRect.x,
y = _Constants$buttonRect.y,
width = _Constants$buttonRect.width,
height = _Constants$buttonRect.height;
var buttonCircleRadius = 2;
var buttonCircleSpacing = 2;
var buttonCircleY = (height - buttonCircleRadius * 4 - buttonCircleSpacing * 2) / 2;
var buttonCircles = [1, 2, 3].map(function (item, index) {
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_4__shapes__["c" /* GraphButtonCircle */], {
cx: width / 2,
cy: buttonCircleY + (buttonCircleRadius * 2 + buttonCircleSpacing) * index,
key: index,
r: 2,
connected: connected
});
});
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
'g',
{ transform: 'translate(' + x + ', ' + y + ')' },
__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_4__shapes__["d" /* GraphLine */], { x1: 0, y1: 0, x2: 0, y2: height, connected: connected }),
__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_4__shapes__["e" /* GraphButtonRect */], {
height: height,
onClick: onButtonClick,
onKeyDown: onButtonClick,
width: width,
role: 'button',
tabIndex: 100 + index
}),
buttonCircles
);
};
NodeButton.propTypes = {
connected: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool,
index: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.number.isRequired,
onButtonClick: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired
};
/* harmony default export */ __webpack_exports__["a"] = (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__baseline__["a" /* default */])(NodeButton));
/***/ }),
/* 408 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__baseline__ = __webpack_require__(4);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__constants__ = __webpack_require__(40);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__shapes__ = __webpack_require__(53);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__info__ = __webpack_require__(409);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__metrics__ = __webpack_require__(410);
var GraphNodeContent = function GraphNodeContent(_ref) {
var connected = _ref.connected,
_ref$child = _ref.child,
child = _ref$child === undefined ? false : _ref$child,
data = _ref.data,
_ref$index = _ref.index,
index = _ref$index === undefined ? 0 : _ref$index;
var _Constants$contentRec = __WEBPACK_IMPORTED_MODULE_3__constants__["a" /* default */].contentRect,
x = _Constants$contentRec.x,
y = _Constants$contentRec.y,
width = _Constants$contentRec.width,
height = _Constants$contentRec.height;
var contentY = y + height * index;
var offset = index ? 18 : -6;
var nodeInfoPos = child ? {
x: __WEBPACK_IMPORTED_MODULE_3__constants__["a" /* default */].infoPosition.x,
y: __WEBPACK_IMPORTED_MODULE_3__constants__["a" /* default */].infoPosition.y + offset
} : __WEBPACK_IMPORTED_MODULE_3__constants__["a" /* default */].infoPosition;
var nodeMetricsPos = child ? {
x: __WEBPACK_IMPORTED_MODULE_3__constants__["a" /* default */].metricsPosition.x,
y: __WEBPACK_IMPORTED_MODULE_3__constants__["a" /* default */].metricsPosition.y + offset
} : __WEBPACK_IMPORTED_MODULE_3__constants__["a" /* default */].metricsPosition;
var nodeSubtitle = child ? __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
__WEBPACK_IMPORTED_MODULE_4__shapes__["h" /* GraphSubtitle */],
Object.assign({}, __WEBPACK_IMPORTED_MODULE_3__constants__["a" /* default */].subtitlePosition, { connected: connected }),
data.name
) : null;
var nodeInfo = !child || index ? __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_5__info__["a" /* default */], {
datacenter: data.datacenter,
instances: data.instances,
healthy: true,
connected: connected,
pos: nodeInfoPos
}) : null;
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
'g',
{ transform: 'translate(' + x + ', ' + contentY + ')' },
__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_4__shapes__["d" /* GraphLine */], { x1: 0, y1: 0, x2: width, y2: 0, connected: connected }),
nodeSubtitle,
nodeInfo,
__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_6__metrics__["a" /* default */], {
metrics: data.metrics,
connected: connected,
pos: nodeMetricsPos
})
);
};
GraphNodeContent.propTypes = {
child: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool,
connected: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool,
data: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object.isRequired,
index: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.number
};
/* harmony default export */ __webpack_exports__["a"] = (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__baseline__["a" /* default */])(GraphNodeContent));
/***/ }),
/* 409 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_styled_components__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_styled_is__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_prop_types__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_prop_types__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__baseline__ = __webpack_require__(4);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__prop_types__ = __webpack_require__(213);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__shapes__ = __webpack_require__(53);
var _templateObject = _taggedTemplateLiteral(['\n fill: ', ';\n '], ['\n fill: ', ';\n ']);
function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
var DataCentresIcon = function DataCentresIcon(props) {
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
'svg',
Object.assign({
width: '9',
height: '13',
viewBox: '0 0 9 13',
xmlns: 'http://www.w3.org/2000/svg'
}, props),
__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
'title',
null,
'icon: data center'
),
__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement('path', {
d: 'M0 13h9V0H0v13zm2-2h5V2H2v9zm1-7h3.001V3H3v1zm0 2h3.001V5H3v1zm0 2h3.001V7H3v1z',
fillRule: 'evenodd'
})
);
};
var InstancesIcon = function InstancesIcon(props) {
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
'svg',
Object.assign({
width: '18',
height: '9',
viewBox: '0 0 18 9',
xmlns: 'http://www.w3.org/2000/svg'
}, props),
__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
'title',
null,
'icon: instances'
),
__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement('path', {
d: 'M4.5 0a4.5 4.5 0 1 0 0 9 4.5 4.5 0 0 0 0-9m8.59 0c-.375 0-.739.047-1.09.12 2.184.456 3.818 2.239 3.818 4.38S14.184 8.424 12 8.88c.351.073.715.12 1.09.12C15.803 9 18 6.985 18 4.5S15.802 0 13.09 0M14 4.5C14 6.985 11.802 9 9.09 9c-.375 0-.739-.047-1.09-.12 2.184-.456 3.818-2.239 3.818-4.38S10.184.576 8 .12C8.351.047 8.715 0 9.09 0 11.803 0 14 2.015 14 4.5',
fillRule: 'evenodd'
})
);
};
var StyledInstancesIcon = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1_styled_components__["a" /* default */])(InstancesIcon).withConfig({
displayName: 'info__StyledInstancesIcon'
})(['fill: ', ';', ';'], function (props) {
return props.theme.secondary;
}, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2_styled_is__["a" /* default */])('connected')(_templateObject, function (props) {
return props.theme.white;
}));
var StyledDataCentresIcon = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1_styled_components__["a" /* default */])(DataCentresIcon).withConfig({
displayName: 'info__StyledDataCentresIcon'
})(['fill: ', ';', ';'], function (props) {
return props.theme.secondary;
}, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2_styled_is__["a" /* default */])('connected')(_templateObject, function (props) {
return props.theme.white;
}));
var GraphNodeInfo = function GraphNodeInfo(_ref) {
var connected = _ref.connected,
datacenter = _ref.datacenter,
instances = _ref.instances,
healthy = _ref.healthy,
pos = _ref.pos;
var x = pos.x,
y = pos.y;
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
'g',
{ transform: 'translate(' + x + ', ' + y + ')' },
__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
'g',
{ transform: 'translate(0, 2)' },
__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(StyledInstancesIcon, { connected: connected })
),
__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
__WEBPACK_IMPORTED_MODULE_6__shapes__["i" /* GraphText */],
{ x: 23, y: 12, connected: connected },
instances + ' inst.'
),
__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
'g',
{ transform: 'translate(82, 0)' },
__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(StyledDataCentresIcon, { connected: connected })
),
__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
__WEBPACK_IMPORTED_MODULE_6__shapes__["i" /* GraphText */],
{ x: 96, y: 12, connected: connected },
datacenter
)
);
};
GraphNodeInfo.propTypes = {
connected: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.bool,
datacenter: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.string,
healthy: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.bool,
instances: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.number,
pos: __WEBPACK_IMPORTED_MODULE_5__prop_types__["a" /* Point */].isRequired
};
/* harmony default export */ __webpack_exports__["a"] = (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__baseline__["a" /* default */])(GraphNodeInfo));
/***/ }),
/* 410 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__baseline__ = __webpack_require__(4);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__prop_types__ = __webpack_require__(213);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__shapes__ = __webpack_require__(53);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_prop_types__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_prop_types__);
var GraphNodeMetrics = function GraphNodeMetrics(_ref) {
var connected = _ref.connected,
metrics = _ref.metrics,
pos = _ref.pos;
var x = pos.x,
y = pos.y;
var metricSpacing = 18;
var metricsText = metrics.map(function (metric, index) {
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
__WEBPACK_IMPORTED_MODULE_3__shapes__["i" /* GraphText */],
{
key: index,
x: 0,
y: 12 + metricSpacing * index,
connected: connected
},
metric.name + ': ' + metric.value
);
});
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
'g',
{ transform: 'translate(' + x + ', ' + y + ')' },
metricsText
);
};
GraphNodeMetrics.propTypes = {
connected: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.bool,
metrics: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.arrayOf(__WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.shape({
name: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.string.isRequired,
value: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.string.isRequired
})),
pos: __WEBPACK_IMPORTED_MODULE_2__prop_types__["a" /* Point */].isRequired
};
/* harmony default export */ __webpack_exports__["a"] = (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__baseline__["a" /* default */])(GraphNodeMetrics));
/***/ }),
/* 411 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__baseline__ = __webpack_require__(4);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__constants__ = __webpack_require__(40);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__shapes__ = __webpack_require__(53);
var HeartIcon = function HeartIcon(props) {
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
'svg',
Object.assign({
width: '80',
height: '70',
viewBox: '0 0 80 70',
xmlns: 'http://www.w3.org/2000/svg'
}, props),
__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
'title',
null,
'icon: health'
),
__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement('path', {
d: 'M9.477 6.603l-.522.443-.444-.443a2.056 2.056 0 1 0-2.908 2.909l3.352 3.352 3.412-3.352c.803-.804.863-2.106.06-2.91a2.105 2.105 0 0 0-2.95 0z',
fill: '#FFF',
fillRule: 'evenodd'
})
);
};
var GraphNodeTitle = function GraphNodeTitle(_ref) {
var connected = _ref.connected,
data = _ref.data,
onNodeTitleClick = _ref.onNodeTitleClick;
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
'g',
null,
__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
__WEBPACK_IMPORTED_MODULE_4__shapes__["f" /* GraphTitle */],
{
x: __WEBPACK_IMPORTED_MODULE_3__constants__["a" /* default */].paddingLeft,
y: 30,
connected: connected,
onClick: onNodeTitleClick,
onKeyDown: onNodeTitleClick
},
data.name
),
__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
'g',
{ transform: 'translate(' + 115 + ', ' + 15 + ')' },
__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_4__shapes__["g" /* GraphHealthyCircle */], { cx: 9, cy: 9, r: 9 }),
__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(HeartIcon, null)
)
);
};
GraphNodeTitle.propTypes = {
connected: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool,
data: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object.isRequired,
onNodeTitleClick: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func
};
/* harmony default export */ __webpack_exports__["a"] = (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__baseline__["a" /* default */])(GraphNodeTitle));
/***/ }),
/* 412 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return createSimulation; });
/* unused harmony export updateSimulation */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_d3__ = __webpack_require__(423);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_d3___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_d3__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(40);
var hypotenuse = function hypotenuse(a, b) {
return Math.sqrt(a * a + b * b);
};
var rectRadius = function rectRadius(_ref) {
var width = _ref.width,
height = _ref.height;
return Math.round(hypotenuse(width, height) / 2);
};
var forcePlayAnimation = function forcePlayAnimation(simulation, animationTicks) {
var n = Math.ceil(Math.log(simulation.alphaMin()) / Math.log(1 - simulation.alphaDecay())) - animationTicks;
for (var i = 0; i < n; ++i) {
simulation.tick();
}
};
var createLinks = function createLinks(services) {
return services.reduce(function (acc, service, index) {
return service.connections ? acc.concat(service.connections.map(function (connection, index) {
return {
source: service.uuid,
target: connection
};
})) : acc;
}, []);
};
var createSimulation = function createSimulation(services, svgSize) {
var animationTicks = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
// This is not going to work given that as well as the d3 layout stuff, other things might be at play too
// We should pass two objects to the components - one for positioning and one for data
var nodes = services.map(function (service, index) {
return {
uuid: service.uuid,
index: index
};
});
var links = createLinks(services);
var width = svgSize.width,
height = svgSize.height;
var nodeRadius = rectRadius(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* default */].nodeSizeWithChildren);
var simulation = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_d3__["forceSimulation"])(nodes).force('link', __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_d3__["forceLink"])(links).id(function (d) {
return d.uuid;
})).force('collide', __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_d3__["forceCollide"])(nodeRadius)).force('center', __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_d3__["forceCenter"])(width / 2, height / 2));
forcePlayAnimation(simulation, animationTicks);
return {
nodes: nodes,
links: links,
simulation: simulation
};
};
// TODO we need to kill the previous simulation
var updateSimulation = function updateSimulation(simulation, services, simNodes, simLinks, svgSize, onTick, onEnd) {
var nodes = services.map(function (service, index) {
var simNode = simNodes.reduce(function (acc, n, i) {
return service.uuid === n.id ? n : acc;
}, null);
return simNode ? {
id: simNode.id,
// Fx: simNode.x,
// fy: simNode.y,
index: index
} : {
id: service.uuid,
index: index
};
});
var links = createLinks(services);
var width = svgSize.width,
height = svgSize.height;
var nodeRadius = rectRadius(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* default */].nodeSizeWithChildren);
return {
simulation: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_d3__["forceSimulation"])(nodes).force('link', __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_d3__["forceLink"])(links).id(function (d) {
return d.id;
})).force('collide', __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_d3__["forceCollide"])(nodeRadius)).force('center', __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_d3__["forceCenter"])(width / 2, height / 2)).on('tick', onTick).on('end', onEnd),
nodes: nodes,
links: links
};
};
/*
Const simulation = forceSimulation(dataNodes)
// .alpha(1).alphaDecay(0.1)
// .force('charge', forceManyBody())
.force('link', forceLink(dataLinks)
//.distance(() => linkDistance)
.id(d => d.id))
.force('collide', forceCollide(nodeRadius))
.force('center', forceCenter(1024/2, 860/2))
.on('tick', () => {
console.log('SIMULATION TICK');
console.log('tickCounter = ', tickCounter);
tickCounter++;
this.forceUpdate();
})
.on('end', () => {
console.log('SIMULATION END');
console.log('tickCounter = ', tickCounter);
// this.forceUpdate();
})
*/
/***/ }),
/* 413 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* unused harmony export libreFranklin */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_styled_components__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__libre_franklin_regular_eot__ = __webpack_require__(445);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__libre_franklin_regular_eot___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__libre_franklin_regular_eot__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__libre_franklin_regular_woff__ = __webpack_require__(448);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__libre_franklin_regular_woff___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2__libre_franklin_regular_woff__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__libre_franklin_regular_woff2__ = __webpack_require__(449);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__libre_franklin_regular_woff2___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3__libre_franklin_regular_woff2__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__libre_franklin_regular_ttf__ = __webpack_require__(447);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__libre_franklin_regular_ttf___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4__libre_franklin_regular_ttf__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__libre_franklin_regular_svg__ = __webpack_require__(446);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__libre_franklin_regular_svg___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5__libre_franklin_regular_svg__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__libre_franklin_medium_eot__ = __webpack_require__(440);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__libre_franklin_medium_eot___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6__libre_franklin_medium_eot__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__libre_franklin_medium_woff__ = __webpack_require__(443);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__libre_franklin_medium_woff___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7__libre_franklin_medium_woff__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__libre_franklin_medium_woff2__ = __webpack_require__(444);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__libre_franklin_medium_woff2___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8__libre_franklin_medium_woff2__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__libre_franklin_medium_ttf__ = __webpack_require__(442);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__libre_franklin_medium_ttf___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_9__libre_franklin_medium_ttf__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__libre_franklin_medium_svg__ = __webpack_require__(441);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__libre_franklin_medium_svg___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_10__libre_franklin_medium_svg__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__libre_franklin_semibold_eot__ = __webpack_require__(450);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__libre_franklin_semibold_eot___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_11__libre_franklin_semibold_eot__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__libre_franklin_semibold_woff__ = __webpack_require__(453);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__libre_franklin_semibold_woff___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_12__libre_franklin_semibold_woff__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__libre_franklin_semibold_woff2__ = __webpack_require__(454);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__libre_franklin_semibold_woff2___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_13__libre_franklin_semibold_woff2__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__libre_franklin_semibold_ttf__ = __webpack_require__(452);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__libre_franklin_semibold_ttf___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_14__libre_franklin_semibold_ttf__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__libre_franklin_semibold_svg__ = __webpack_require__(451);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__libre_franklin_semibold_svg___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_15__libre_franklin_semibold_svg__);
var fontFaces = {
normal: {
family: 'Libre Franklin',
style: 'normal',
weight: 400,
filenames: {
eot: __WEBPACK_IMPORTED_MODULE_1__libre_franklin_regular_eot___default.a,
woff: __WEBPACK_IMPORTED_MODULE_2__libre_franklin_regular_woff___default.a,
woff2: __WEBPACK_IMPORTED_MODULE_3__libre_franklin_regular_woff2___default.a,
ttf: __WEBPACK_IMPORTED_MODULE_4__libre_franklin_regular_ttf___default.a,
svg: __WEBPACK_IMPORTED_MODULE_5__libre_franklin_regular_svg___default.a
}
},
medium: {
family: 'Libre Franklin',
style: 'normal',
weight: 500,
filenames: {
eot: __WEBPACK_IMPORTED_MODULE_6__libre_franklin_medium_eot___default.a,
woff: __WEBPACK_IMPORTED_MODULE_7__libre_franklin_medium_woff___default.a,
woff2: __WEBPACK_IMPORTED_MODULE_8__libre_franklin_medium_woff2___default.a,
ttf: __WEBPACK_IMPORTED_MODULE_9__libre_franklin_medium_ttf___default.a,
svg: __WEBPACK_IMPORTED_MODULE_10__libre_franklin_medium_svg___default.a
}
},
semibold: {
family: 'Libre Franklin',
style: 'normal',
weight: 600,
filenames: {
eot: __WEBPACK_IMPORTED_MODULE_11__libre_franklin_semibold_eot___default.a,
woff: __WEBPACK_IMPORTED_MODULE_12__libre_franklin_semibold_woff___default.a,
woff2: __WEBPACK_IMPORTED_MODULE_13__libre_franklin_semibold_woff2___default.a,
ttf: __WEBPACK_IMPORTED_MODULE_14__libre_franklin_semibold_ttf___default.a,
svg: __WEBPACK_IMPORTED_MODULE_15__libre_franklin_semibold_svg___default.a
}
}
};
var generate = function generate(name) {
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_styled_components__["b" /* css */])(['@font-face {font-family: \'', '\';font-style: ', ';font-weight: ', ';src: url(\'', '\');src: url(\'', '?#iefix\')format(\'embedded-opentype\'),url(\'', '\')format(\'woff\'),url(\'', '\')format(\'woff2\'),url(\'', '\')format(\'truetype\'),url(\'', '#', '\')format(\'svg\');}'], fontFaces[name].family, fontFaces[name].style, fontFaces[name].weight, fontFaces[name].filenames.eot, fontFaces[name].filenames.eot, fontFaces[name].filenames.woff, fontFaces[name].filenames.woff2, fontFaces[name].filenames.ttf, fontFaces[name].filenames.svg, fontFaces[name].family);
};
var libreFranklin = {
normal: generate('normal'),
medium: generate('medium'),
semibold: generate('semibold')
};
/* harmony default export */ __webpack_exports__["a"] = ({
libreFranklin: libreFranklin
});
/***/ }),
/* 414 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module bail
* @fileoverview Throw a given error.
*/
/* Expose. */
module.exports = bail;
/**
* Throw a given error.
*
* @example
* bail();
*
* @example
* bail(new Error('failure'));
* // Error: failure
* // at repl:1:6
* // at REPLServer.defaultEval (repl.js:154:27)
* // ...
*
* @param {Error?} [err] - Optional error.
* @throws {Error} - `err`, when given.
*/
function bail(err) {
if (err) {
throw err;
}
}
/***/ }),
/* 415 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.byteLength = byteLength
exports.toByteArray = toByteArray
exports.fromByteArray = fromByteArray
var lookup = []
var revLookup = []
var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
for (var i = 0, len = code.length; i < len; ++i) {
lookup[i] = code[i]
revLookup[code.charCodeAt(i)] = i
}
revLookup['-'.charCodeAt(0)] = 62
revLookup['_'.charCodeAt(0)] = 63
function placeHoldersCount (b64) {
var len = b64.length
if (len % 4 > 0) {
throw new Error('Invalid string. Length must be a multiple of 4')
}
// the number of equal signs (place holders)
// if there are two placeholders, than the two characters before it
// represent one byte
// if there is only one, then the three characters before it represent 2 bytes
// this is just a cheap hack to not do indexOf twice
return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0
}
function byteLength (b64) {
// base64 is 4/3 + up to two characters of the original data
return b64.length * 3 / 4 - placeHoldersCount(b64)
}
function toByteArray (b64) {
var i, j, l, tmp, placeHolders, arr
var len = b64.length
placeHolders = placeHoldersCount(b64)
arr = new Arr(len * 3 / 4 - placeHolders)
// if there are placeholders, only get up to the last complete 4 chars
l = placeHolders > 0 ? len - 4 : len
var L = 0
for (i = 0, j = 0; i < l; i += 4, j += 3) {
tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)]
arr[L++] = (tmp >> 16) & 0xFF
arr[L++] = (tmp >> 8) & 0xFF
arr[L++] = tmp & 0xFF
}
if (placeHolders === 2) {
tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4)
arr[L++] = tmp & 0xFF
} else if (placeHolders === 1) {
tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2)
arr[L++] = (tmp >> 8) & 0xFF
arr[L++] = tmp & 0xFF
}
return arr
}
function tripletToBase64 (num) {
return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]
}
function encodeChunk (uint8, start, end) {
var tmp
var output = []
for (var i = start; i < end; i += 3) {
tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2])
output.push(tripletToBase64(tmp))
}
return output.join('')
}
function fromByteArray (uint8) {
var tmp
var len = uint8.length
var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
var output = ''
var parts = []
var maxChunkLength = 16383 // must be multiple of 3
// go through the array every three bytes, we'll deal with trailing stuff later
for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))
}
// pad the end with zeros, but make sure to not forget the extra bytes
if (extraBytes === 1) {
tmp = uint8[len - 1]
output += lookup[tmp >> 2]
output += lookup[(tmp << 4) & 0x3F]
output += '=='
} else if (extraBytes === 2) {
tmp = (uint8[len - 2] << 8) + (uint8[len - 1])
output += lookup[tmp >> 10]
output += lookup[(tmp >> 4) & 0x3F]
output += lookup[(tmp << 2) & 0x3F]
output += '='
}
parts.push(output)
return parts.join('')
}
/***/ }),
/* 416 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {var __WEBPACK_AMD_DEFINE_RESULT__;var __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) {
true ? factory(exports, __webpack_require__(417), __webpack_require__(702)) :
typeof define === 'function' && define.amd ? define(['exports', 'acorn/dist/acorn.js', 'magic-string'], factory) :
(factory((global.buble = global.buble || {}),global.acorn,global.MagicString));
}(this, function (exports,acorn,MagicString) { 'use strict';
acorn = 'default' in acorn ? acorn['default'] : acorn;
MagicString = 'default' in MagicString ? MagicString['default'] : MagicString;
var __commonjs_global = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : this;
function __commonjs(fn, module) { return module = { exports: {} }, fn(module, module.exports, __commonjs_global), module.exports; }
var xhtml = __commonjs(function (module) {
module.exports = {
quot: '\u0022',
amp: '&',
apos: '\u0027',
lt: '<',
gt: '>',
nbsp: '\u00A0',
iexcl: '\u00A1',
cent: '\u00A2',
pound: '\u00A3',
curren: '\u00A4',
yen: '\u00A5',
brvbar: '\u00A6',
sect: '\u00A7',
uml: '\u00A8',
copy: '\u00A9',
ordf: '\u00AA',
laquo: '\u00AB',
not: '\u00AC',
shy: '\u00AD',
reg: '\u00AE',
macr: '\u00AF',
deg: '\u00B0',
plusmn: '\u00B1',
sup2: '\u00B2',
sup3: '\u00B3',
acute: '\u00B4',
micro: '\u00B5',
para: '\u00B6',
middot: '\u00B7',
cedil: '\u00B8',
sup1: '\u00B9',
ordm: '\u00BA',
raquo: '\u00BB',
frac14: '\u00BC',
frac12: '\u00BD',
frac34: '\u00BE',
iquest: '\u00BF',
Agrave: '\u00C0',
Aacute: '\u00C1',
Acirc: '\u00C2',
Atilde: '\u00C3',
Auml: '\u00C4',
Aring: '\u00C5',
AElig: '\u00C6',
Ccedil: '\u00C7',
Egrave: '\u00C8',
Eacute: '\u00C9',
Ecirc: '\u00CA',
Euml: '\u00CB',
Igrave: '\u00CC',
Iacute: '\u00CD',
Icirc: '\u00CE',
Iuml: '\u00CF',
ETH: '\u00D0',
Ntilde: '\u00D1',
Ograve: '\u00D2',
Oacute: '\u00D3',
Ocirc: '\u00D4',
Otilde: '\u00D5',
Ouml: '\u00D6',
times: '\u00D7',
Oslash: '\u00D8',
Ugrave: '\u00D9',
Uacute: '\u00DA',
Ucirc: '\u00DB',
Uuml: '\u00DC',
Yacute: '\u00DD',
THORN: '\u00DE',
szlig: '\u00DF',
agrave: '\u00E0',
aacute: '\u00E1',
acirc: '\u00E2',
atilde: '\u00E3',
auml: '\u00E4',
aring: '\u00E5',
aelig: '\u00E6',
ccedil: '\u00E7',
egrave: '\u00E8',
eacute: '\u00E9',
ecirc: '\u00EA',
euml: '\u00EB',
igrave: '\u00EC',
iacute: '\u00ED',
icirc: '\u00EE',
iuml: '\u00EF',
eth: '\u00F0',
ntilde: '\u00F1',
ograve: '\u00F2',
oacute: '\u00F3',
ocirc: '\u00F4',
otilde: '\u00F5',
ouml: '\u00F6',
divide: '\u00F7',
oslash: '\u00F8',
ugrave: '\u00F9',
uacute: '\u00FA',
ucirc: '\u00FB',
uuml: '\u00FC',
yacute: '\u00FD',
thorn: '\u00FE',
yuml: '\u00FF',
OElig: '\u0152',
oelig: '\u0153',
Scaron: '\u0160',
scaron: '\u0161',
Yuml: '\u0178',
fnof: '\u0192',
circ: '\u02C6',
tilde: '\u02DC',
Alpha: '\u0391',
Beta: '\u0392',
Gamma: '\u0393',
Delta: '\u0394',
Epsilon: '\u0395',
Zeta: '\u0396',
Eta: '\u0397',
Theta: '\u0398',
Iota: '\u0399',
Kappa: '\u039A',
Lambda: '\u039B',
Mu: '\u039C',
Nu: '\u039D',
Xi: '\u039E',
Omicron: '\u039F',
Pi: '\u03A0',
Rho: '\u03A1',
Sigma: '\u03A3',
Tau: '\u03A4',
Upsilon: '\u03A5',
Phi: '\u03A6',
Chi: '\u03A7',
Psi: '\u03A8',
Omega: '\u03A9',
alpha: '\u03B1',
beta: '\u03B2',
gamma: '\u03B3',
delta: '\u03B4',
epsilon: '\u03B5',
zeta: '\u03B6',
eta: '\u03B7',
theta: '\u03B8',
iota: '\u03B9',
kappa: '\u03BA',
lambda: '\u03BB',
mu: '\u03BC',
nu: '\u03BD',
xi: '\u03BE',
omicron: '\u03BF',
pi: '\u03C0',
rho: '\u03C1',
sigmaf: '\u03C2',
sigma: '\u03C3',
tau: '\u03C4',
upsilon: '\u03C5',
phi: '\u03C6',
chi: '\u03C7',
psi: '\u03C8',
omega: '\u03C9',
thetasym: '\u03D1',
upsih: '\u03D2',
piv: '\u03D6',
ensp: '\u2002',
emsp: '\u2003',
thinsp: '\u2009',
zwnj: '\u200C',
zwj: '\u200D',
lrm: '\u200E',
rlm: '\u200F',
ndash: '\u2013',
mdash: '\u2014',
lsquo: '\u2018',
rsquo: '\u2019',
sbquo: '\u201A',
ldquo: '\u201C',
rdquo: '\u201D',
bdquo: '\u201E',
dagger: '\u2020',
Dagger: '\u2021',
bull: '\u2022',
hellip: '\u2026',
permil: '\u2030',
prime: '\u2032',
Prime: '\u2033',
lsaquo: '\u2039',
rsaquo: '\u203A',
oline: '\u203E',
frasl: '\u2044',
euro: '\u20AC',
image: '\u2111',
weierp: '\u2118',
real: '\u211C',
trade: '\u2122',
alefsym: '\u2135',
larr: '\u2190',
uarr: '\u2191',
rarr: '\u2192',
darr: '\u2193',
harr: '\u2194',
crarr: '\u21B5',
lArr: '\u21D0',
uArr: '\u21D1',
rArr: '\u21D2',
dArr: '\u21D3',
hArr: '\u21D4',
forall: '\u2200',
part: '\u2202',
exist: '\u2203',
empty: '\u2205',
nabla: '\u2207',
isin: '\u2208',
notin: '\u2209',
ni: '\u220B',
prod: '\u220F',
sum: '\u2211',
minus: '\u2212',
lowast: '\u2217',
radic: '\u221A',
prop: '\u221D',
infin: '\u221E',
ang: '\u2220',
and: '\u2227',
or: '\u2228',
cap: '\u2229',
cup: '\u222A',
'int': '\u222B',
there4: '\u2234',
sim: '\u223C',
cong: '\u2245',
asymp: '\u2248',
ne: '\u2260',
equiv: '\u2261',
le: '\u2264',
ge: '\u2265',
sub: '\u2282',
sup: '\u2283',
nsub: '\u2284',
sube: '\u2286',
supe: '\u2287',
oplus: '\u2295',
otimes: '\u2297',
perp: '\u22A5',
sdot: '\u22C5',
lceil: '\u2308',
rceil: '\u2309',
lfloor: '\u230A',
rfloor: '\u230B',
lang: '\u2329',
rang: '\u232A',
loz: '\u25CA',
spades: '\u2660',
clubs: '\u2663',
hearts: '\u2665',
diams: '\u2666'
};
});
var require$$0 = (xhtml && typeof xhtml === 'object' && 'default' in xhtml ? xhtml['default'] : xhtml);
var inject = __commonjs(function (module) {
'use strict';
var XHTMLEntities = require$$0;
var hexNumber = /^[\da-fA-F]+$/;
var decimalNumber = /^\d+$/;
module.exports = function(acorn) {
var tt = acorn.tokTypes;
var tc = acorn.tokContexts;
tc.j_oTag = new acorn.TokContext('<tag', false);
tc.j_cTag = new acorn.TokContext('</tag', false);
tc.j_expr = new acorn.TokContext('<tag>...</tag>', true, true);
tt.jsxName = new acorn.TokenType('jsxName');
tt.jsxText = new acorn.TokenType('jsxText', {beforeExpr: true});
tt.jsxTagStart = new acorn.TokenType('jsxTagStart');
tt.jsxTagEnd = new acorn.TokenType('jsxTagEnd');
tt.jsxTagStart.updateContext = function() {
this.context.push(tc.j_expr); // treat as beginning of JSX expression
this.context.push(tc.j_oTag); // start opening tag context
this.exprAllowed = false;
};
tt.jsxTagEnd.updateContext = function(prevType) {
var out = this.context.pop();
if (out === tc.j_oTag && prevType === tt.slash || out === tc.j_cTag) {
this.context.pop();
this.exprAllowed = this.curContext() === tc.j_expr;
} else {
this.exprAllowed = true;
}
};
var pp = acorn.Parser.prototype;
// Reads inline JSX contents token.
pp.jsx_readToken = function() {
var out = '', chunkStart = this.pos;
for (;;) {
if (this.pos >= this.input.length)
this.raise(this.start, 'Unterminated JSX contents');
var ch = this.input.charCodeAt(this.pos);
switch (ch) {
case 60: // '<'
case 123: // '{'
if (this.pos === this.start) {
if (ch === 60 && this.exprAllowed) {
++this.pos;
return this.finishToken(tt.jsxTagStart);
}
return this.getTokenFromCode(ch);
}
out += this.input.slice(chunkStart, this.pos);
return this.finishToken(tt.jsxText, out);
case 38: // '&'
out += this.input.slice(chunkStart, this.pos);
out += this.jsx_readEntity();
chunkStart = this.pos;
break;
default:
if (acorn.isNewLine(ch)) {
out += this.input.slice(chunkStart, this.pos);
out += this.jsx_readNewLine(true);
chunkStart = this.pos;
} else {
++this.pos;
}
}
}
};
pp.jsx_readNewLine = function(normalizeCRLF) {
var ch = this.input.charCodeAt(this.pos);
var out;
++this.pos;
if (ch === 13 && this.input.charCodeAt(this.pos) === 10) {
++this.pos;
out = normalizeCRLF ? '\n' : '\r\n';
} else {
out = String.fromCharCode(ch);
}
if (this.options.locations) {
++this.curLine;
this.lineStart = this.pos;
}
return out;
};
pp.jsx_readString = function(quote) {
var out = '', chunkStart = ++this.pos;
for (;;) {
if (this.pos >= this.input.length)
this.raise(this.start, 'Unterminated string constant');
var ch = this.input.charCodeAt(this.pos);
if (ch === quote) break;
if (ch === 38) { // '&'
out += this.input.slice(chunkStart, this.pos);
out += this.jsx_readEntity();
chunkStart = this.pos;
} else if (acorn.isNewLine(ch)) {
out += this.input.slice(chunkStart, this.pos);
out += this.jsx_readNewLine(false);
chunkStart = this.pos;
} else {
++this.pos;
}
}
out += this.input.slice(chunkStart, this.pos++);
return this.finishToken(tt.string, out);
};
pp.jsx_readEntity = function() {
var str = '', count = 0, entity;
var ch = this.input[this.pos];
if (ch !== '&')
this.raise(this.pos, 'Entity must start with an ampersand');
var startPos = ++this.pos;
while (this.pos < this.input.length && count++ < 10) {
ch = this.input[this.pos++];
if (ch === ';') {
if (str[0] === '#') {
if (str[1] === 'x') {
str = str.substr(2);
if (hexNumber.test(str))
entity = String.fromCharCode(parseInt(str, 16));
} else {
str = str.substr(1);
if (decimalNumber.test(str))
entity = String.fromCharCode(parseInt(str, 10));
}
} else {
entity = XHTMLEntities[str];
}
break;
}
str += ch;
}
if (!entity) {
this.pos = startPos;
return '&';
}
return entity;
};
// Read a JSX identifier (valid tag or attribute name).
//
// Optimized version since JSX identifiers can't contain
// escape characters and so can be read as single slice.
// Also assumes that first character was already checked
// by isIdentifierStart in readToken.
pp.jsx_readWord = function() {
var ch, start = this.pos;
do {
ch = this.input.charCodeAt(++this.pos);
} while (acorn.isIdentifierChar(ch) || ch === 45); // '-'
return this.finishToken(tt.jsxName, this.input.slice(start, this.pos));
};
// Transforms JSX element name to string.
function getQualifiedJSXName(object) {
if (object.type === 'JSXIdentifier')
return object.name;
if (object.type === 'JSXNamespacedName')
return object.namespace.name + ':' + object.name.name;
if (object.type === 'JSXMemberExpression')
return getQualifiedJSXName(object.object) + '.' +
getQualifiedJSXName(object.property);
}
// Parse next token as JSX identifier
pp.jsx_parseIdentifier = function() {
var node = this.startNode();
if (this.type === tt.jsxName)
node.name = this.value;
else if (this.type.keyword)
node.name = this.type.keyword;
else
this.unexpected();
this.next();
return this.finishNode(node, 'JSXIdentifier');
};
// Parse namespaced identifier.
pp.jsx_parseNamespacedName = function() {
var startPos = this.start, startLoc = this.startLoc;
var name = this.jsx_parseIdentifier();
if (!this.options.plugins.jsx.allowNamespaces || !this.eat(tt.colon)) return name;
var node = this.startNodeAt(startPos, startLoc);
node.namespace = name;
node.name = this.jsx_parseIdentifier();
return this.finishNode(node, 'JSXNamespacedName');
};
// Parses element name in any form - namespaced, member
// or single identifier.
pp.jsx_parseElementName = function() {
var startPos = this.start, startLoc = this.startLoc;
var node = this.jsx_parseNamespacedName();
if (this.type === tt.dot && node.type === 'JSXNamespacedName' && !this.options.plugins.jsx.allowNamespacedObjects) {
this.unexpected();
}
while (this.eat(tt.dot)) {
var newNode = this.startNodeAt(startPos, startLoc);
newNode.object = node;
newNode.property = this.jsx_parseIdentifier();
node = this.finishNode(newNode, 'JSXMemberExpression');
}
return node;
};
// Parses any type of JSX attribute value.
pp.jsx_parseAttributeValue = function() {
switch (this.type) {
case tt.braceL:
var node = this.jsx_parseExpressionContainer();
if (node.expression.type === 'JSXEmptyExpression')
this.raise(node.start, 'JSX attributes must only be assigned a non-empty expression');
return node;
case tt.jsxTagStart:
case tt.string:
return this.parseExprAtom();
default:
this.raise(this.start, 'JSX value should be either an expression or a quoted JSX text');
}
};
// JSXEmptyExpression is unique type since it doesn't actually parse anything,
// and so it should start at the end of last read token (left brace) and finish
// at the beginning of the next one (right brace).
pp.jsx_parseEmptyExpression = function() {
var node = this.startNodeAt(this.lastTokEnd, this.lastTokEndLoc);
return this.finishNodeAt(node, 'JSXEmptyExpression', this.start, this.startLoc);
};
// Parses JSX expression enclosed into curly brackets.
pp.jsx_parseExpressionContainer = function() {
var node = this.startNode();
this.next();
node.expression = this.type === tt.braceR
? this.jsx_parseEmptyExpression()
: this.parseExpression();
this.expect(tt.braceR);
return this.finishNode(node, 'JSXExpressionContainer');
};
// Parses following JSX attribute name-value pair.
pp.jsx_parseAttribute = function() {
var node = this.startNode();
if (this.eat(tt.braceL)) {
this.expect(tt.ellipsis);
node.argument = this.parseMaybeAssign();
this.expect(tt.braceR);
return this.finishNode(node, 'JSXSpreadAttribute');
}
node.name = this.jsx_parseNamespacedName();
node.value = this.eat(tt.eq) ? this.jsx_parseAttributeValue() : null;
return this.finishNode(node, 'JSXAttribute');
};
// Parses JSX opening tag starting after '<'.
pp.jsx_parseOpeningElementAt = function(startPos, startLoc) {
var node = this.startNodeAt(startPos, startLoc);
node.attributes = [];
node.name = this.jsx_parseElementName();
while (this.type !== tt.slash && this.type !== tt.jsxTagEnd)
node.attributes.push(this.jsx_parseAttribute());
node.selfClosing = this.eat(tt.slash);
this.expect(tt.jsxTagEnd);
return this.finishNode(node, 'JSXOpeningElement');
};
// Parses JSX closing tag starting after '</'.
pp.jsx_parseClosingElementAt = function(startPos, startLoc) {
var node = this.startNodeAt(startPos, startLoc);
node.name = this.jsx_parseElementName();
this.expect(tt.jsxTagEnd);
return this.finishNode(node, 'JSXClosingElement');
};
// Parses entire JSX element, including it's opening tag
// (starting after '<'), attributes, contents and closing tag.
pp.jsx_parseElementAt = function(startPos, startLoc) {
var node = this.startNodeAt(startPos, startLoc);
var children = [];
var openingElement = this.jsx_parseOpeningElementAt(startPos, startLoc);
var closingElement = null;
if (!openingElement.selfClosing) {
contents: for (;;) {
switch (this.type) {
case tt.jsxTagStart:
startPos = this.start; startLoc = this.startLoc;
this.next();
if (this.eat(tt.slash)) {
closingElement = this.jsx_parseClosingElementAt(startPos, startLoc);
break contents;
}
children.push(this.jsx_parseElementAt(startPos, startLoc));
break;
case tt.jsxText:
children.push(this.parseExprAtom());
break;
case tt.braceL:
children.push(this.jsx_parseExpressionContainer());
break;
default:
this.unexpected();
}
}
if (getQualifiedJSXName(closingElement.name) !== getQualifiedJSXName(openingElement.name)) {
this.raise(
closingElement.start,
'Expected corresponding JSX closing tag for <' + getQualifiedJSXName(openingElement.name) + '>');
}
}
node.openingElement = openingElement;
node.closingElement = closingElement;
node.children = children;
if (this.type === tt.relational && this.value === "<") {
this.raise(this.start, "Adjacent JSX elements must be wrapped in an enclosing tag");
}
return this.finishNode(node, 'JSXElement');
};
// Parses entire JSX element from current position.
pp.jsx_parseElement = function() {
var startPos = this.start, startLoc = this.startLoc;
this.next();
return this.jsx_parseElementAt(startPos, startLoc);
};
acorn.plugins.jsx = function(instance, opts) {
if (!opts) {
return;
}
if (typeof opts !== 'object') {
opts = {};
}
instance.options.plugins.jsx = {
allowNamespaces: opts.allowNamespaces !== false,
allowNamespacedObjects: !!opts.allowNamespacedObjects
};
instance.extend('parseExprAtom', function(inner) {
return function(refShortHandDefaultPos) {
if (this.type === tt.jsxText)
return this.parseLiteral(this.value);
else if (this.type === tt.jsxTagStart)
return this.jsx_parseElement();
else
return inner.call(this, refShortHandDefaultPos);
};
});
instance.extend('readToken', function(inner) {
return function(code) {
var context = this.curContext();
if (context === tc.j_expr) return this.jsx_readToken();
if (context === tc.j_oTag || context === tc.j_cTag) {
if (acorn.isIdentifierStart(code)) return this.jsx_readWord();
if (code == 62) {
++this.pos;
return this.finishToken(tt.jsxTagEnd);
}
if ((code === 34 || code === 39) && context == tc.j_oTag)
return this.jsx_readString(code);
}
if (code === 60 && this.exprAllowed) {
++this.pos;
return this.finishToken(tt.jsxTagStart);
}
return inner.call(this, code);
};
});
instance.extend('updateContext', function(inner) {
return function(prevType) {
if (this.type == tt.braceL) {
var curContext = this.curContext();
if (curContext == tc.j_oTag) this.context.push(tc.b_expr);
else if (curContext == tc.j_expr) this.context.push(tc.b_tmpl);
else inner.call(this, prevType);
this.exprAllowed = true;
} else if (this.type === tt.slash && prevType === tt.jsxTagStart) {
this.context.length -= 2; // do not consider JSX expr -> JSX open tag -> ... anymore
this.context.push(tc.j_cTag); // reconsider as closing tag context
this.exprAllowed = false;
} else {
return inner.call(this, prevType);
}
};
});
};
return acorn;
};
});
var acornJsx = (inject && typeof inject === 'object' && 'default' in inject ? inject['default'] : inject);
var inject$1 = __commonjs(function (module) {
'use strict';
module.exports = function(acorn) {
var tt = acorn.tokTypes;
var pp = acorn.Parser.prototype;
// this is the same parseObj that acorn has with...
function parseObj(isPattern, refDestructuringErrors) {
var this$1 = this;
var node = this.startNode(), first = true, propHash = {}
node.properties = []
this.next()
while (!this$1.eat(tt.braceR)) {
if (!first) {
this$1.expect(tt.comma)
if (this$1.afterTrailingComma(tt.braceR)) break
} else first = false
var prop = this$1.startNode(), isGenerator, startPos, startLoc
if (this$1.options.ecmaVersion >= 6) {
// ...the spread logic borrowed from babylon :)
if (this$1.type === tt.ellipsis) {
prop = this$1.parseSpread()
prop.type = isPattern ? "RestProperty" : "SpreadProperty"
node.properties.push(prop)
continue
}
prop.method = false
prop.shorthand = false
if (isPattern || refDestructuringErrors) {
startPos = this$1.start
startLoc = this$1.startLoc
}
if (!isPattern)
isGenerator = this$1.eat(tt.star)
}
this$1.parsePropertyName(prop)
this$1.parsePropertyValue(prop, isPattern, isGenerator, startPos, startLoc, refDestructuringErrors)
this$1.checkPropClash(prop, propHash)
node.properties.push(this$1.finishNode(prop, "Property"))
}
return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression")
}
acorn.plugins.objectSpread = function objectSpreadPlugin(instance) {
pp.parseObj = parseObj;
};
return acorn;
};
});
var acornObjectSpread = (inject$1 && typeof inject$1 === 'object' && 'default' in inject$1 ? inject$1['default'] : inject$1);
var keys = {
Program: [ 'body' ],
Literal: []
};
// used for debugging, without the noise created by
// circular references
function toJSON ( node ) {
var obj = {};
Object.keys( node ).forEach( function ( key ) {
if ( key === 'parent' || key === 'program' || key === 'keys' || key === '__wrapped' ) return;
if ( Array.isArray( node[ key ] ) ) {
obj[ key ] = node[ key ].map( toJSON );
} else if ( node[ key ] && node[ key ].toJSON ) {
obj[ key ] = node[ key ].toJSON();
} else {
obj[ key ] = node[ key ];
}
});
return obj;
}
var Node = function Node ( raw, parent ) {
raw.parent = parent;
raw.program = parent.program || parent;
raw.depth = parent.depth + 1;
raw.keys = keys[ raw.type ];
raw.indentation = undefined;
for ( var i = 0, list = keys[ raw.type ]; i < list.length; i += 1 ) {
var key = list[i];
wrap( raw[ key ], raw );
}
raw.program.magicString.addSourcemapLocation( raw.start );
raw.program.magicString.addSourcemapLocation( raw.end );
};
Node.prototype.ancestor = function ancestor ( level ) {
var node = this;
while ( level-- ) {
node = node.parent;
if ( !node ) return null;
}
return node;
};
Node.prototype.contains = function contains ( node ) {
var this$1 = this;
while ( node ) {
if ( node === this$1 ) return true;
node = node.parent;
}
return false;
};
Node.prototype.findLexicalBoundary = function findLexicalBoundary () {
return this.parent.findLexicalBoundary();
};
Node.prototype.findNearest = function findNearest ( type ) {
if ( typeof type === 'string' ) type = new RegExp( ("^" + type + "$") );
if ( type.test( this.type ) ) return this;
return this.parent.findNearest( type );
};
Node.prototype.unparenthesizedParent = function unparenthesizedParent () {
var node = this.parent;
while ( node && node.type === 'ParenthesizedExpression' ) {
node = node.parent;
}
return node;
};
Node.prototype.unparenthesize = function unparenthesize () {
var node = this;
while ( node.type === 'ParenthesizedExpression' ) {
node = node.expression;
}
return node;
};
Node.prototype.findScope = function findScope ( functionScope ) {
return this.parent.findScope( functionScope );
};
Node.prototype.getIndentation = function getIndentation () {
return this.parent.getIndentation();
};
Node.prototype.initialise = function initialise ( transforms ) {
for ( var i = 0, list = this.keys; i < list.length; i += 1 ) {
var key = list[i];
var value = this[ key ];
if ( Array.isArray( value ) ) {
value.forEach( function ( node ) { return node && node.initialise( transforms ); } );
} else if ( value && typeof value === 'object' ) {
value.initialise( transforms );
}
}
};
Node.prototype.toJSON = function toJSON$1 () {
return toJSON( this );
};
Node.prototype.toString = function toString () {
return this.program.magicString.original.slice( this.start, this.end );
};
Node.prototype.transpile = function transpile ( code, transforms ) {
for ( var i = 0, list = this.keys; i < list.length; i += 1 ) {
var key = list[i];
var value = this[ key ];
if ( Array.isArray( value ) ) {
value.forEach( function ( node ) { return node && node.transpile( code, transforms ); } );
} else if ( value && typeof value === 'object' ) {
value.transpile( code, transforms );
}
}
};
function isArguments ( node ) {
return node.type === 'Identifier' && node.name === 'arguments';
}
function spread ( code, elements, start, argumentsArrayAlias, isNew ) {
var i = elements.length;
var firstSpreadIndex = -1;
while ( i-- ) {
var element$1 = elements[i];
if ( element$1 && element$1.type === 'SpreadElement' ) {
if ( isArguments( element$1.argument ) ) {
code.overwrite( element$1.argument.start, element$1.argument.end, argumentsArrayAlias );
}
firstSpreadIndex = i;
}
}
if ( firstSpreadIndex === -1 ) return false; // false indicates no spread elements
if (isNew) {
for ( i = 0; i < elements.length; i += 1 ) {
var element$2 = elements[i];
if ( element$2.type === 'SpreadElement' ) {
code.remove( element$2.start, element$2.argument.start );
} else {
code.insertRight( element$2.start, '[' );
code.insertRight( element$2.end, ']' );
}
}
return true; // true indicates some spread elements
}
var element = elements[ firstSpreadIndex ];
var previousElement = elements[ firstSpreadIndex - 1 ];
if ( !previousElement ) {
code.remove( start, element.start );
code.overwrite( element.end, elements[1].start, '.concat( ' );
} else {
code.overwrite( previousElement.end, element.start, ' ].concat( ' );
}
for ( i = firstSpreadIndex; i < elements.length; i += 1 ) {
element = elements[i];
if ( element ) {
if ( element.type === 'SpreadElement' ) {
code.remove( element.start, element.argument.start );
} else {
code.insertLeft( element.start, '[' );
code.insertLeft( element.end, ']' );
}
}
}
return true; // true indicates some spread elements
}
var ArrayExpression = (function (Node) {
function ArrayExpression () {
Node.apply(this, arguments);
}
if ( Node ) ArrayExpression.__proto__ = Node;
ArrayExpression.prototype = Object.create( Node && Node.prototype );
ArrayExpression.prototype.constructor = ArrayExpression;
ArrayExpression.prototype.initialise = function initialise ( transforms ) {
var this$1 = this;
if ( transforms.spreadRest && this.elements.length ) {
var lexicalBoundary = this.findLexicalBoundary();
var i = this.elements.length;
while ( i-- ) {
var element = this$1.elements[i];
if ( element && element.type === 'SpreadElement' && isArguments( element.argument ) ) {
this$1.argumentsArrayAlias = lexicalBoundary.getArgumentsArrayAlias();
}
}
}
Node.prototype.initialise.call( this, transforms );
};
ArrayExpression.prototype.transpile = function transpile ( code, transforms ) {
if ( transforms.spreadRest ) {
// erase trailing comma after last array element if not an array hole
if ( this.elements.length ) {
var lastElement = this.elements[ this.elements.length - 1 ];
if ( lastElement && /\s*,/.test( code.original.slice( lastElement.end, this.end ) ) ) {
code.overwrite( lastElement.end, this.end - 1, ' ' );
}
}
if ( this.elements.length === 1 ) {
var element = this.elements[0];
if ( element && element.type === 'SpreadElement' ) {
// special case [ ...arguments ]
if ( isArguments( element.argument ) ) {
code.overwrite( this.start, this.end, ("[].concat( " + (this.argumentsArrayAlias) + " )") ); // TODO if this is the only use of argsArray, don't bother concating
} else {
code.overwrite( this.start, element.argument.start, '[].concat( ' );
code.overwrite( element.end, this.end, ' )' );
}
}
}
else {
var hasSpreadElements = spread( code, this.elements, this.start, this.argumentsArrayAlias );
if ( hasSpreadElements ) {
code.overwrite( this.end - 1, this.end, ')' );
}
}
}
Node.prototype.transpile.call( this, code, transforms );
};
return ArrayExpression;
}(Node));
var ArrowFunctionExpression = (function (Node) {
function ArrowFunctionExpression () {
Node.apply(this, arguments);
}
if ( Node ) ArrowFunctionExpression.__proto__ = Node;
ArrowFunctionExpression.prototype = Object.create( Node && Node.prototype );
ArrowFunctionExpression.prototype.constructor = ArrowFunctionExpression;
ArrowFunctionExpression.prototype.initialise = function initialise ( transforms ) {
this.body.createScope();
Node.prototype.initialise.call( this, transforms );
};
ArrowFunctionExpression.prototype.transpile = function transpile ( code, transforms ) {
if ( transforms.arrow ) {
// remove arrow
var charIndex = this.body.start;
while ( code.original[ charIndex ] !== '=' ) {
charIndex -= 1;
}
code.remove( charIndex, this.body.start );
// wrap naked parameter
if ( this.params.length === 1 && this.start === this.params[0].start ) {
code.insertRight( this.params[0].start, '(' );
code.insertLeft( this.params[0].end, ')' );
}
// add function
if ( this.parent && this.parent.type === 'ExpressionStatement' ) {
// standalone expression statement
code.insertRight( this.start, '(function' );
code.insertRight( this.end, ')' );
} else {
code.insertRight( this.start, 'function ' );
}
}
Node.prototype.transpile.call( this, code, transforms );
};
return ArrowFunctionExpression;
}(Node));
function locate ( source, index ) {
var lines = source.split( '\n' );
var len = lines.length;
var lineStart = 0;
var i;
for ( i = 0; i < len; i += 1 ) {
var line = lines[i];
var lineEnd = lineStart + line.length + 1; // +1 for newline
if ( lineEnd > index ) {
return { line: i + 1, column: index - lineStart, char: i };
}
lineStart = lineEnd;
}
throw new Error( 'Could not determine location of character' );
}
function pad ( num, len ) {
var result = String( num );
return result + repeat( ' ', len - result.length );
}
function repeat ( str, times ) {
var result = '';
while ( times-- ) result += str;
return result;
}
function getSnippet ( source, loc, length ) {
if ( length === void 0 ) length = 1;
var first = Math.max( loc.line - 5, 0 );
var last = loc.line;
var numDigits = String( last ).length;
var lines = source.split( '\n' ).slice( first, last );
var lastLine = lines[ lines.length - 1 ];
var offset = lastLine.slice( 0, loc.column ).replace( /\t/g, ' ' ).length;
var snippet = lines
.map( function ( line, i ) { return ((pad( i + first + 1, numDigits )) + " : " + (line.replace( /\t/g, ' '))); } )
.join( '\n' );
snippet += '\n' + repeat( ' ', numDigits + 3 + offset ) + repeat( '^', length );
return snippet;
}
var CompileError = (function (Error) {
function CompileError ( node, message ) {
Error.call(this);
var source = node.program.magicString.original;
var loc = locate( source, node.start );
this.name = 'CompileError';
this.message = message + " (" + (loc.line) + ":" + (loc.column) + ")";
this.stack = new Error().stack.replace( new RegExp( (".+new " + (this.name) + ".+\\n"), 'm' ), '' );
this.loc = loc;
this.snippet = getSnippet( source, loc, node.end - node.start );
}
if ( Error ) CompileError.__proto__ = Error;
CompileError.prototype = Object.create( Error && Error.prototype );
CompileError.prototype.constructor = CompileError;
CompileError.prototype.toString = function toString () {
return ((this.name) + ": " + (this.message) + "\n" + (this.snippet));
};
return CompileError;
}(Error));
var AssignmentExpression = (function (Node) {
function AssignmentExpression () {
Node.apply(this, arguments);
}
if ( Node ) AssignmentExpression.__proto__ = Node;
AssignmentExpression.prototype = Object.create( Node && Node.prototype );
AssignmentExpression.prototype.constructor = AssignmentExpression;
AssignmentExpression.prototype.initialise = function initialise ( transforms ) {
if ( this.left.type === 'Identifier' ) {
var declaration = this.findScope( false ).findDeclaration( this.left.name );
if ( declaration && declaration.kind === 'const' ) {
throw new CompileError( this.left, ((this.left.name) + " is read-only") );
}
// special case https://gitlab.com/Rich-Harris/buble/issues/11
var statement = declaration && declaration.node.ancestor( 3 );
if ( statement && statement.type === 'ForStatement' && statement.body.contains( this ) ) {
statement.reassigned[ this.left.name ] = true;
}
}
Node.prototype.initialise.call( this, transforms );
};
AssignmentExpression.prototype.transpile = function transpile ( code, transforms ) {
if ( this.operator === '**=' && transforms.exponentiation ) {
this.transpileExponentiation( code, transforms );
}
else if ( /Pattern/.test( this.left.type ) && transforms.destructuring ) {
this.transpileDestructuring( code, transforms );
}
Node.prototype.transpile.call( this, code, transforms );
};
AssignmentExpression.prototype.transpileDestructuring = function transpileDestructuring ( code ) {
var scope = this.findScope( true );
var assign = scope.createIdentifier( 'assign' );
var temporaries = [ assign ];
var start = this.start;
// We need to pick out some elements from the original code,
// interleaved with generated code. These helpers are used to
// easily do that while keeping the order of the output
// predictable.
var text = '';
function use ( node ) {
code.insertRight( node.start, text );
code.move( node.start, node.end, start );
text = '';
}
function write ( string ) {
text += string;
}
write( ("(" + assign + " = ") );
use( this.right );
// Walk `pattern`, generating code that assigns the value in
// `ref` to it. When `mayDuplicate` is false, the function
// must take care to only output `ref` once.
function destructure ( pattern, ref, mayDuplicate ) {
if ( pattern.type === 'Identifier' || pattern.type === 'MemberExpression' ) {
write( ', ' );
use( pattern );
write( (" = " + ref) );
}
else if ( pattern.type === 'AssignmentPattern' ) {
if ( pattern.left.type === 'Identifier' ) {
var target = pattern.left.name;
var source = ref;
if ( !mayDuplicate ) {
write( (", " + target + " = " + ref) );
source = target;
}
write( (", " + target + " = " + source + " === void 0 ? ") );
use( pattern.right );
write( (" : " + source) );
}
else {
var target$1 = scope.createIdentifier( 'temp' );
var source$1 = ref;
temporaries.push( target$1 );
if ( !mayDuplicate ) {
write( (", " + target$1 + " = " + ref) );
source$1 = target$1;
}
write( (", " + target$1 + " = " + source$1 + " === void 0 ? ") );
use( pattern.right );
write( (" : " + source$1) );
destructure( pattern.left, target$1, true );
}
}
else if ( pattern.type === 'ArrayPattern' ) {
var elements = pattern.elements;
if ( elements.length === 1 ) {
destructure( elements[0], (ref + "[0]"), false );
}
else {
if ( !mayDuplicate ) {
var temp = scope.createIdentifier( 'array' );
temporaries.push( temp );
write( (", " + temp + " = " + ref) );
ref = temp;
}
elements.forEach( function ( element, i ) {
if ( element ) {
if ( element.type === 'RestElement' ) {
destructure( element.argument, (ref + ".slice(" + i + ")"), false );
} else {
destructure( element, (ref + "[" + i + "]"), false );
}
}
} );
}
}
else if ( pattern.type === 'ObjectPattern' ) {
var props = pattern.properties;
if ( props.length == 1 ) {
var prop = props[0];
var value = prop.computed || prop.key.type !== 'Identifier' ? (ref + "[" + (code.slice(prop.key.start, prop.key.end)) + "]") : (ref + "." + (prop.key.name));
destructure( prop.value, value, false );
}
else {
if ( !mayDuplicate ) {
var temp$1 = scope.createIdentifier( 'obj' );
temporaries.push( temp$1 );
write( (", " + temp$1 + " = " + ref) );
ref = temp$1;
}
props.forEach( function ( prop ) {
var value = prop.computed || prop.key.type !== 'Identifier' ? (ref + "[" + (code.slice(prop.key.start, prop.key.end)) + "]") : (ref + "." + (prop.key.name));
destructure( prop.value, value, false );
} );
}
}
else {
throw new Error( ("Unexpected node type in destructuring assignment (" + (pattern.type) + ")") );
}
}
destructure( this.left, assign, true );
if ( this.unparenthesizedParent().type === 'ExpressionStatement' ) {
// no rvalue needed for expression statement
code.insertRight( start, (text + ")") );
} else {
// destructuring is part of an expression - need an rvalue
code.insertRight( start, (text + ", " + assign + ")") );
}
code.remove( start, this.right.start );
var statement = this.findNearest( /(?:Statement|Declaration)$/ );
code.insertLeft( statement.start, ("var " + (temporaries.join( ', ' )) + ";\n" + (statement.getIndentation())) );
};
AssignmentExpression.prototype.transpileExponentiation = function transpileExponentiation ( code ) {
var scope = this.findScope( false );
var getAlias = function ( name ) {
var declaration = scope.findDeclaration( name );
return declaration ? declaration.name : name;
};
// first, the easy part `**=` -> `=`
var charIndex = this.left.end;
while ( code.original[ charIndex ] !== '*' ) charIndex += 1;
code.remove( charIndex, charIndex + 2 );
// how we do the next part depends on a number of factors whether
// this is a top-level statement, and whether we're updating a
// simple or complex reference
var base;
var left = this.left.unparenthesize();
if ( left.type === 'Identifier' ) {
base = getAlias( left.name );
} else if ( left.type === 'MemberExpression' ) {
var object;
var needsObjectVar = false;
var property;
var needsPropertyVar = false;
var statement = this.findNearest( /(?:Statement|Declaration)$/ );
var i0 = statement.getIndentation();
if ( left.property.type === 'Identifier' ) {
property = left.computed ? getAlias( left.property.name ) : left.property.name;
} else {
property = scope.createIdentifier( 'property' );
needsPropertyVar = true;
}
if ( left.object.type === 'Identifier' ) {
object = getAlias( left.object.name );
} else {
object = scope.createIdentifier( 'object' );
needsObjectVar = true;
}
if ( left.start === statement.start ) {
if ( needsObjectVar && needsPropertyVar ) {
code.insertRight( statement.start, ("var " + object + " = ") );
code.overwrite( left.object.end, left.property.start, (";\n" + i0 + "var " + property + " = ") );
code.overwrite( left.property.end, left.end, (";\n" + i0 + object + "[" + property + "]") );
}
else if ( needsObjectVar ) {
code.insertRight( statement.start, ("var " + object + " = ") );
code.insertLeft( left.object.end, (";\n" + i0) );
code.insertLeft( left.object.end, object );
}
else if ( needsPropertyVar ) {
code.insertRight( left.property.start, ("var " + property + " = ") );
code.insertLeft( left.property.end, (";\n" + i0) );
code.move( left.property.start, left.property.end, this.start );
code.insertLeft( left.object.end, ("[" + property + "]") );
code.remove( left.object.end, left.property.start );
code.remove( left.property.end, left.end );
}
}
else {
var declarators = [];
if ( needsObjectVar ) declarators.push( object );
if ( needsPropertyVar ) declarators.push( property );
if ( declarators.length ) {
code.insertRight( statement.start, ("var " + (declarators.join( ', ' )) + ";\n" + i0) );
}
if ( needsObjectVar && needsPropertyVar ) {
code.insertRight( left.start, ("( " + object + " = ") );
code.overwrite( left.object.end, left.property.start, (", " + property + " = ") );
code.overwrite( left.property.end, left.end, (", " + object + "[" + property + "]") );
}
else if ( needsObjectVar ) {
code.insertRight( left.start, ("( " + object + " = ") );
code.insertLeft( left.object.end, (", " + object) );
}
else if ( needsPropertyVar ) {
code.insertRight( left.property.start, ("( " + property + " = ") );
code.insertLeft( left.property.end, ", " );
code.move( left.property.start, left.property.end, left.start );
code.overwrite( left.object.end, left.property.start, ("[" + property + "]") );
code.remove( left.property.end, left.end );
}
if ( needsPropertyVar ) {
code.insertLeft( this.end, " )" );
}
}
base = object + ( left.computed || needsPropertyVar ? ("[" + property + "]") : ("." + property) );
}
code.insertRight( this.right.start, ("Math.pow( " + base + ", ") );
code.insertLeft( this.right.end, " )" );
};
return AssignmentExpression;
}(Node));
var BinaryExpression = (function (Node) {
function BinaryExpression () {
Node.apply(this, arguments);
}
if ( Node ) BinaryExpression.__proto__ = Node;
BinaryExpression.prototype = Object.create( Node && Node.prototype );
BinaryExpression.prototype.constructor = BinaryExpression;
BinaryExpression.prototype.transpile = function transpile ( code, transforms ) {
if ( this.operator === '**' && transforms.exponentiation ) {
code.insertRight( this.start, "Math.pow( " );
code.overwrite( this.left.end, this.right.start, ", " );
code.insertLeft( this.end, " )" );
}
Node.prototype.transpile.call( this, code, transforms );
};
return BinaryExpression;
}(Node));
var loopStatement = /(?:For(?:In|Of)?|While)Statement/;
var BreakStatement = (function (Node) {
function BreakStatement () {
Node.apply(this, arguments);
}
if ( Node ) BreakStatement.__proto__ = Node;
BreakStatement.prototype = Object.create( Node && Node.prototype );
BreakStatement.prototype.constructor = BreakStatement;
BreakStatement.prototype.initialise = function initialise () {
var loop = this.findNearest( loopStatement );
var switchCase = this.findNearest( 'SwitchCase' );
if ( loop && ( !switchCase || loop.depth > switchCase.depth ) ) {
loop.canBreak = true;
this.loop = loop;
}
};
BreakStatement.prototype.transpile = function transpile ( code ) {
if ( this.loop && this.loop.shouldRewriteAsFunction ) {
if ( this.label ) throw new CompileError( this, 'Labels are not currently supported in a loop with locally-scoped variables' );
code.overwrite( this.start, this.start + 5, "return 'break'" );
}
};
return BreakStatement;
}(Node));
var CallExpression = (function (Node) {
function CallExpression () {
Node.apply(this, arguments);
}
if ( Node ) CallExpression.__proto__ = Node;
CallExpression.prototype = Object.create( Node && Node.prototype );
CallExpression.prototype.constructor = CallExpression;
CallExpression.prototype.initialise = function initialise ( transforms ) {
var this$1 = this;
if ( transforms.spreadRest && this.arguments.length > 1 ) {
var lexicalBoundary = this.findLexicalBoundary();
var i = this.arguments.length;
while ( i-- ) {
var arg = this$1.arguments[i];
if ( arg.type === 'SpreadElement' && isArguments( arg.argument ) ) {
this$1.argumentsArrayAlias = lexicalBoundary.getArgumentsArrayAlias();
}
}
}
Node.prototype.initialise.call( this, transforms );
};
CallExpression.prototype.transpile = function transpile ( code, transforms ) {
if ( transforms.spreadRest && this.arguments.length ) {
var hasSpreadElements = false;
var context;
var firstArgument = this.arguments[0];
if ( this.arguments.length === 1 ) {
if ( firstArgument.type === 'SpreadElement' ) {
code.remove( firstArgument.start, firstArgument.argument.start );
hasSpreadElements = true;
}
} else {
hasSpreadElements = spread( code, this.arguments, firstArgument.start, this.argumentsArrayAlias );
}
if ( hasSpreadElements ) {
// we need to handle super() and super.method() differently
// due to its instance
var _super = null;
if ( this.callee.type === 'Super' ) {
_super = this.callee;
}
else if ( this.callee.type === 'MemberExpression' && this.callee.object.type === 'Super' ) {
_super = this.callee.object;
}
if ( !_super && this.callee.type === 'MemberExpression' ) {
if ( this.callee.object.type === 'Identifier' ) {
context = this.callee.object.name;
} else {
context = this.findScope( true ).createIdentifier( 'ref' );
var callExpression = this.callee.object;
var enclosure = callExpression.findNearest( /Function/ );
var block = enclosure ? enclosure.body.body
: callExpression.findNearest( /^Program$/ ).body;
var lastStatementInBlock = block[ block.length - 1 ];
var i0 = lastStatementInBlock.getIndentation();
code.insertRight( callExpression.start, ("(" + context + " = ") );
code.insertLeft( callExpression.end, ")" );
code.insertLeft( lastStatementInBlock.end, ("\n" + i0 + "var " + context + ";") );
}
} else {
context = 'void 0';
}
code.insertLeft( this.callee.end, '.apply' );
if ( _super ) {
_super.noCall = true; // bit hacky...
if ( this.arguments.length > 1 ) {
if ( firstArgument.type !== 'SpreadElement' ) {
code.insertRight( firstArgument.start, "[ " );
}
code.insertLeft( this.arguments[ this.arguments.length - 1 ].end, ' )' );
}
}
else if ( this.arguments.length === 1 ) {
code.insertRight( firstArgument.start, (context + ", ") );
} else {
if ( firstArgument.type === 'SpreadElement' ) {
code.insertLeft( firstArgument.start, (context + ", ") );
} else {
code.insertLeft( firstArgument.start, (context + ", [ ") );
}
code.insertLeft( this.arguments[ this.arguments.length - 1 ].end, ' )' );
}
}
}
Node.prototype.transpile.call( this, code, transforms );
};
return CallExpression;
}(Node));
function findIndex ( array, fn ) {
for ( var i = 0; i < array.length; i += 1 ) {
if ( fn( array[i], i ) ) return i;
}
return -1;
}
var reserved = Object.create( null );
'do if in for let new try var case else enum eval null this true void with await break catch class const false super throw while yield delete export import public return static switch typeof default extends finally package private continue debugger function arguments interface protected implements instanceof'.split( ' ' )
.forEach( function ( word ) { return reserved[ word ] = true; } );
// TODO this code is pretty wild, tidy it up
var ClassBody = (function (Node) {
function ClassBody () {
Node.apply(this, arguments);
}
if ( Node ) ClassBody.__proto__ = Node;
ClassBody.prototype = Object.create( Node && Node.prototype );
ClassBody.prototype.constructor = ClassBody;
ClassBody.prototype.transpile = function transpile ( code, transforms, inFunctionExpression, superName ) {
var this$1 = this;
if ( transforms.classes ) {
var name = this.parent.name;
var indentStr = code.getIndentString();
var i0 = this.getIndentation() + ( inFunctionExpression ? indentStr : '' );
var i1 = i0 + indentStr;
var constructorIndex = findIndex( this.body, function ( node ) { return node.kind === 'constructor'; } );
var constructor = this.body[ constructorIndex ];
var introBlock = '';
var outroBlock = '';
if ( this.body.length ) {
code.remove( this.start, this.body[0].start );
code.remove( this.body[ this.body.length - 1 ].end, this.end );
} else {
code.remove( this.start, this.end );
}
if ( constructor ) {
constructor.value.body.isConstructorBody = true;
var previousMethod = this.body[ constructorIndex - 1 ];
var nextMethod = this.body[ constructorIndex + 1 ];
// ensure constructor is first
if ( constructorIndex > 0 ) {
code.remove( previousMethod.end, constructor.start );
code.move( constructor.start, nextMethod ? nextMethod.start : this.end - 1, this.body[0].start );
}
if ( !inFunctionExpression ) code.insertLeft( constructor.end, ';' );
}
var namedFunctions = this.program.options.namedFunctionExpressions !== false;
var namedConstructor = namedFunctions || this.parent.superClass || this.parent.type !== 'ClassDeclaration';
if ( this.parent.superClass ) {
var inheritanceBlock = "if ( " + superName + " ) " + name + ".__proto__ = " + superName + ";\n" + i0 + name + ".prototype = Object.create( " + superName + " && " + superName + ".prototype );\n" + i0 + name + ".prototype.constructor = " + name + ";";
if ( constructor ) {
introBlock += "\n\n" + i0 + inheritanceBlock;
} else {
var fn = "function " + name + " () {" + ( superName ?
("\n" + i1 + superName + ".apply(this, arguments);\n" + i0 + "}") :
"}" ) + ( inFunctionExpression ? '' : ';' ) + ( this.body.length ? ("\n\n" + i0) : '' );
inheritanceBlock = fn + inheritanceBlock;
introBlock += inheritanceBlock + "\n\n" + i0;
}
} else if ( !constructor ) {
var fn$1 = 'function ' + (namedConstructor ? name + ' ' : '') + '() {}';
if ( this.parent.type === 'ClassDeclaration' ) fn$1 += ';';
if ( this.body.length ) fn$1 += "\n\n" + i0;
introBlock += fn$1;
}
var scope = this.findScope( false );
var prototypeGettersAndSetters = [];
var staticGettersAndSetters = [];
var prototypeAccessors;
var staticAccessors;
this.body.forEach( function ( method, i ) {
if ( method.kind === 'constructor' ) {
var constructorName = namedConstructor ? ' ' + name : '';
code.overwrite( method.key.start, method.key.end, ("function" + constructorName) );
return;
}
if ( method.static ) {
var len = code.original[ method.start + 6 ] == ' ' ? 7 : 6;
code.remove( method.start, method.start + len );
}
var isAccessor = method.kind !== 'method';
var lhs;
var methodName = method.key.name;
if ( reserved[ methodName ] || method.value.body.scope.references[methodName] ) {
methodName = scope.createIdentifier( methodName );
}
// when method name is a string or a number let's pretend it's a computed method
var fake_computed = false;
if ( ! method.computed && method.key.type === 'Literal' ) {
fake_computed = true;
method.computed = true;
}
if ( isAccessor ) {
if ( method.computed ) {
throw new Error( 'Computed accessor properties are not currently supported' );
}
code.remove( method.start, method.key.start );
if ( method.static ) {
if ( !~staticGettersAndSetters.indexOf( method.key.name ) ) staticGettersAndSetters.push( method.key.name );
if ( !staticAccessors ) staticAccessors = scope.createIdentifier( 'staticAccessors' );
lhs = "" + staticAccessors;
} else {
if ( !~prototypeGettersAndSetters.indexOf( method.key.name ) ) prototypeGettersAndSetters.push( method.key.name );
if ( !prototypeAccessors ) prototypeAccessors = scope.createIdentifier( 'prototypeAccessors' );
lhs = "" + prototypeAccessors;
}
} else {
lhs = method.static ?
("" + name) :
(name + ".prototype");
}
if ( !method.computed ) lhs += '.';
var insertNewlines = ( constructorIndex > 0 && i === constructorIndex + 1 ) ||
( i === 0 && constructorIndex === this$1.body.length - 1 );
if ( insertNewlines ) lhs = "\n\n" + i0 + lhs;
var c = method.key.end;
if ( method.computed ) {
if ( fake_computed ) {
code.insertRight( method.key.start, '[' );
code.insertLeft( method.key.end, ']' );
} else {
while ( code.original[c] !== ']' ) c += 1;
c += 1;
}
}
code.insertRight( method.start, lhs );
var funcName = method.computed || isAccessor || !namedFunctions ? '' : (methodName + " ");
var rhs = ( isAccessor ? ("." + (method.kind)) : '' ) + " = function" + ( method.value.generator ? '* ' : ' ' ) + funcName;
code.remove( c, method.value.start );
code.insertRight( method.value.start, rhs );
code.insertLeft( method.end, ';' );
if ( method.value.generator ) code.remove( method.start, method.key.start );
});
if ( prototypeGettersAndSetters.length || staticGettersAndSetters.length ) {
var intro = [];
var outro = [];
if ( prototypeGettersAndSetters.length ) {
intro.push( ("var " + prototypeAccessors + " = { " + (prototypeGettersAndSetters.map( function ( name ) { return (name + ": {}"); } ).join( ',' )) + " };") );
outro.push( ("Object.defineProperties( " + name + ".prototype, " + prototypeAccessors + " );") );
}
if ( staticGettersAndSetters.length ) {
intro.push( ("var " + staticAccessors + " = { " + (staticGettersAndSetters.map( function ( name ) { return (name + ": {}"); } ).join( ',' )) + " };") );
outro.push( ("Object.defineProperties( " + name + ", " + staticAccessors + " );") );
}
if ( constructor ) introBlock += "\n\n" + i0;
introBlock += intro.join( ("\n" + i0) );
if ( !constructor ) introBlock += "\n\n" + i0;
outroBlock += "\n\n" + i0 + outro.join( ("\n" + i0) );
}
if ( constructor ) {
code.insertLeft( constructor.end, introBlock );
} else {
code.insertRight( this.start, introBlock );
}
code.insertLeft( this.end, outroBlock );
}
Node.prototype.transpile.call( this, code, transforms );
};
return ClassBody;
}(Node));
// TODO this function is slightly flawed it works on the original string,
// not its current edited state.
// That's not a problem for the way that it's currently used, but it could
// be in future...
function deindent ( node, code ) {
var start = node.start;
var end = node.end;
var indentStr = code.getIndentString();
var indentStrLen = indentStr.length;
var indentStart = start - indentStrLen;
if ( !node.program.indentExclusions[ indentStart ]
&& code.original.slice( indentStart, start ) === indentStr ) {
code.remove( indentStart, start );
}
var pattern = new RegExp( indentStr + '\\S', 'g' );
var slice = code.original.slice( start, end );
var match;
while ( match = pattern.exec( slice ) ) {
var removeStart = start + match.index;
if ( !node.program.indentExclusions[ removeStart ] ) {
code.remove( removeStart, removeStart + indentStrLen );
}
}
}
var ClassDeclaration = (function (Node) {
function ClassDeclaration () {
Node.apply(this, arguments);
}
if ( Node ) ClassDeclaration.__proto__ = Node;
ClassDeclaration.prototype = Object.create( Node && Node.prototype );
ClassDeclaration.prototype.constructor = ClassDeclaration;
ClassDeclaration.prototype.initialise = function initialise ( transforms ) {
this.name = this.id.name;
this.findScope( true ).addDeclaration( this.id, 'class' );
Node.prototype.initialise.call( this, transforms );
};
ClassDeclaration.prototype.transpile = function transpile ( code, transforms ) {
if ( transforms.classes ) {
if ( !this.superClass ) deindent( this.body, code );
var superName = this.superClass && ( this.superClass.name || 'superclass' );
var i0 = this.getIndentation();
var i1 = i0 + code.getIndentString();
// if this is an export default statement, we have to move the export to
// after the declaration, because `export default var Foo = ...` is illegal
var syntheticDefaultExport = this.parent.type === 'ExportDefaultDeclaration' ?
("\n\n" + i0 + "export default " + (this.id.name) + ";") :
'';
if ( syntheticDefaultExport ) code.remove( this.parent.start, this.start );
code.overwrite( this.start, this.id.start, 'var ' );
if ( this.superClass ) {
if ( this.superClass.end === this.body.start ) {
code.remove( this.id.end, this.superClass.start );
code.insertLeft( this.id.end, (" = (function (" + superName + ") {\n" + i1) );
} else {
code.overwrite( this.id.end, this.superClass.start, ' = ' );
code.overwrite( this.superClass.end, this.body.start, ("(function (" + superName + ") {\n" + i1) );
}
} else {
if ( this.id.end === this.body.start ) {
code.insertLeft( this.id.end, ' = ' );
} else {
code.overwrite( this.id.end, this.body.start, ' = ' );
}
}
this.body.transpile( code, transforms, !!this.superClass, superName );
if ( this.superClass ) {
code.insertLeft( this.end, ("\n\n" + i1 + "return " + (this.name) + ";\n" + i0 + "}(") );
code.move( this.superClass.start, this.superClass.end, this.end );
code.insertRight( this.end, ("));" + syntheticDefaultExport) );
} else if ( syntheticDefaultExport ) {
code.insertRight( this.end, syntheticDefaultExport );
}
}
else {
this.body.transpile( code, transforms, false, null );
}
};
return ClassDeclaration;
}(Node));
var ClassExpression = (function (Node) {
function ClassExpression () {
Node.apply(this, arguments);
}
if ( Node ) ClassExpression.__proto__ = Node;
ClassExpression.prototype = Object.create( Node && Node.prototype );
ClassExpression.prototype.constructor = ClassExpression;
ClassExpression.prototype.initialise = function initialise ( transforms ) {
this.name = this.id ? this.id.name :
this.parent.type === 'VariableDeclarator' ? this.parent.id.name :
this.parent.type === 'AssignmentExpression' ? this.parent.left.name :
this.findScope( true ).createIdentifier( 'anonymous' );
Node.prototype.initialise.call( this, transforms );
};
ClassExpression.prototype.transpile = function transpile ( code, transforms ) {
if ( transforms.classes ) {
var superName = this.superClass && ( this.superClass.name || 'superclass' );
var i0 = this.getIndentation();
var i1 = i0 + code.getIndentString();
if ( this.superClass ) {
code.remove( this.start, this.superClass.start );
code.remove( this.superClass.end, this.body.start );
code.insertLeft( this.start, ("(function (" + superName + ") {\n" + i1) );
} else {
code.overwrite( this.start, this.body.start, ("(function () {\n" + i1) );
}
this.body.transpile( code, transforms, true, superName );
var outro = "\n\n" + i1 + "return " + (this.name) + ";\n" + i0 + "}(";
if ( this.superClass ) {
code.insertLeft( this.end, outro );
code.move( this.superClass.start, this.superClass.end, this.end );
code.insertRight( this.end, '))' );
} else {
code.insertLeft( this.end, ("\n\n" + i1 + "return " + (this.name) + ";\n" + i0 + "}())") );
}
}
else {
this.body.transpile( code, transforms, false );
}
};
return ClassExpression;
}(Node));
var ContinueStatement = (function (Node) {
function ContinueStatement () {
Node.apply(this, arguments);
}
if ( Node ) ContinueStatement.__proto__ = Node;
ContinueStatement.prototype = Object.create( Node && Node.prototype );
ContinueStatement.prototype.constructor = ContinueStatement;
ContinueStatement.prototype.transpile = function transpile ( code ) {
var loop = this.findNearest( loopStatement );
if ( loop.shouldRewriteAsFunction ) {
if ( this.label ) throw new CompileError( this, 'Labels are not currently supported in a loop with locally-scoped variables' );
code.overwrite( this.start, this.start + 8, 'return' );
}
};
return ContinueStatement;
}(Node));
var ExportDefaultDeclaration = (function (Node) {
function ExportDefaultDeclaration () {
Node.apply(this, arguments);
}
if ( Node ) ExportDefaultDeclaration.__proto__ = Node;
ExportDefaultDeclaration.prototype = Object.create( Node && Node.prototype );
ExportDefaultDeclaration.prototype.constructor = ExportDefaultDeclaration;
ExportDefaultDeclaration.prototype.initialise = function initialise ( transforms ) {
if ( transforms.moduleExport ) throw new CompileError( this, 'export is not supported' );
Node.prototype.initialise.call( this, transforms );
};
return ExportDefaultDeclaration;
}(Node));
var ExportNamedDeclaration = (function (Node) {
function ExportNamedDeclaration () {
Node.apply(this, arguments);
}
if ( Node ) ExportNamedDeclaration.__proto__ = Node;
ExportNamedDeclaration.prototype = Object.create( Node && Node.prototype );
ExportNamedDeclaration.prototype.constructor = ExportNamedDeclaration;
ExportNamedDeclaration.prototype.initialise = function initialise ( transforms ) {
if ( transforms.moduleExport ) throw new CompileError( this, 'export is not supported' );
Node.prototype.initialise.call( this, transforms );
};
return ExportNamedDeclaration;
}(Node));
var LoopStatement = (function (Node) {
function LoopStatement () {
Node.apply(this, arguments);
}
if ( Node ) LoopStatement.__proto__ = Node;
LoopStatement.prototype = Object.create( Node && Node.prototype );
LoopStatement.prototype.constructor = LoopStatement;
LoopStatement.prototype.findScope = function findScope ( functionScope ) {
return functionScope || !this.createdScope ? this.parent.findScope( functionScope ) : this.body.scope;
};
LoopStatement.prototype.initialise = function initialise ( transforms ) {
var this$1 = this;
this.body.createScope();
this.createdScope = true;
// this is populated as and when reassignments occur
this.reassigned = Object.create( null );
this.aliases = Object.create( null );
Node.prototype.initialise.call( this, transforms );
if ( transforms.letConst ) {
// see if any block-scoped declarations are referenced
// inside function expressions
var names = Object.keys( this.body.scope.declarations );
var i = names.length;
while ( i-- ) {
var name = names[i];
var declaration = this$1.body.scope.declarations[ name ];
var j = declaration.instances.length;
while ( j-- ) {
var instance = declaration.instances[j];
var nearestFunctionExpression = instance.findNearest( /Function/ );
if ( nearestFunctionExpression && nearestFunctionExpression.depth > this$1.depth ) {
this$1.shouldRewriteAsFunction = true;
break;
}
}
if ( this$1.shouldRewriteAsFunction ) break;
}
}
};
LoopStatement.prototype.transpile = function transpile ( code, transforms ) {
var needsBlock = this.type != 'ForOfStatement' && (
this.body.type !== 'BlockStatement'
|| this.body.type === 'BlockStatement' && this.body.synthetic );
if ( this.shouldRewriteAsFunction ) {
var i0 = this.getIndentation();
var i1 = i0 + code.getIndentString();
var argString = this.args ? (" " + (this.args.join( ', ' )) + " ") : '';
var paramString = this.params ? (" " + (this.params.join( ', ' )) + " ") : '';
var functionScope = this.findScope( true );
var loop = functionScope.createIdentifier( 'loop' );
var before = "var " + loop + " = function (" + paramString + ") " + ( this.body.synthetic ? ("{\n" + i0 + (code.getIndentString())) : '' );
var after = ( this.body.synthetic ? ("\n" + i0 + "}") : '' ) + ";\n\n" + i0;
code.insertRight( this.body.start, before );
code.insertLeft( this.body.end, after );
code.move( this.start, this.body.start, this.body.end );
if ( this.canBreak || this.canReturn ) {
var returned = functionScope.createIdentifier( 'returned' );
var insert = "{\n" + i1 + "var " + returned + " = " + loop + "(" + argString + ");\n";
if ( this.canBreak ) insert += "\n" + i1 + "if ( " + returned + " === 'break' ) break;";
if ( this.canReturn ) insert += "\n" + i1 + "if ( " + returned + " ) return " + returned + ".v;";
insert += "\n" + i0 + "}";
code.insertRight( this.body.end, insert );
} else {
var callExpression = loop + "(" + argString + ");";
if ( this.type === 'DoWhileStatement' ) {
code.overwrite( this.start, this.body.start, ("do {\n" + i1 + callExpression + "\n" + i0 + "}") );
} else {
code.insertRight( this.body.end, callExpression );
}
}
} else if ( needsBlock ) {
code.insertLeft( this.body.start, '{ ' );
code.insertRight( this.body.end, ' }' );
}
Node.prototype.transpile.call( this, code, transforms );
};
return LoopStatement;
}(Node));
function extractNames ( node ) {
var names = [];
extractors[ node.type ]( names, node );
return names;
}
var extractors = {
Identifier: function Identifier ( names, node ) {
names.push( node );
},
ObjectPattern: function ObjectPattern ( names, node ) {
for ( var i = 0, list = node.properties; i < list.length; i += 1 ) {
var prop = list[i];
extractors[ prop.value.type ]( names, prop.value );
}
},
ArrayPattern: function ArrayPattern ( names, node ) {
for ( var i = 0, list = node.elements; i < list.length; i += 1 ) {
var element = list[i];
if ( element ) extractors[ element.type ]( names, element );
}
},
RestElement: function RestElement ( names, node ) {
extractors[ node.argument.type ]( names, node.argument );
},
AssignmentPattern: function AssignmentPattern ( names, node ) {
extractors[ node.left.type ]( names, node.left );
}
};
var ForStatement = (function (LoopStatement) {
function ForStatement () {
LoopStatement.apply(this, arguments);
}
if ( LoopStatement ) ForStatement.__proto__ = LoopStatement;
ForStatement.prototype = Object.create( LoopStatement && LoopStatement.prototype );
ForStatement.prototype.constructor = ForStatement;
ForStatement.prototype.findScope = function findScope ( functionScope ) {
return functionScope || !this.createdScope ? this.parent.findScope( functionScope ) : this.body.scope;
};
ForStatement.prototype.transpile = function transpile ( code, transforms ) {
var this$1 = this;
var i1 = this.getIndentation() + code.getIndentString();
if ( this.shouldRewriteAsFunction ) {
// which variables are declared in the init statement?
var names = this.init.type === 'VariableDeclaration' ?
[].concat.apply( [], this.init.declarations.map( function ( declarator ) { return extractNames( declarator.id ); } ) ) :
[];
var aliases = this.aliases;
this.args = names.map( function ( name ) { return name in this$1.aliases ? this$1.aliases[ name ].outer : name; } );
this.params = names.map( function ( name ) { return name in this$1.aliases ? this$1.aliases[ name ].inner : name; } );
var updates = Object.keys( this.reassigned )
.map( function ( name ) { return ((aliases[ name ].outer) + " = " + (aliases[ name ].inner) + ";"); } );
if ( updates.length ) {
if ( this.body.synthetic ) {
code.insertLeft( this.body.body[0].end, ("; " + (updates.join(" "))) );
} else {
var lastStatement = this.body.body[ this.body.body.length - 1 ];
code.insertLeft( lastStatement.end, ("\n\n" + i1 + (updates.join(("\n" + i1)))) );
}
}
}
LoopStatement.prototype.transpile.call( this, code, transforms );
};
return ForStatement;
}(LoopStatement));
var ForInStatement = (function (LoopStatement) {
function ForInStatement () {
LoopStatement.apply(this, arguments);
}
if ( LoopStatement ) ForInStatement.__proto__ = LoopStatement;
ForInStatement.prototype = Object.create( LoopStatement && LoopStatement.prototype );
ForInStatement.prototype.constructor = ForInStatement;
ForInStatement.prototype.findScope = function findScope ( functionScope ) {
return functionScope || !this.createdScope ? this.parent.findScope( functionScope ) : this.body.scope;
};
ForInStatement.prototype.transpile = function transpile ( code, transforms ) {
var this$1 = this;
if ( this.shouldRewriteAsFunction ) {
// which variables are declared in the init statement?
var names = this.left.type === 'VariableDeclaration' ?
[].concat.apply( [], this.left.declarations.map( function ( declarator ) { return extractNames( declarator.id ); } ) ) :
[];
this.args = names.map( function ( name ) { return name in this$1.aliases ? this$1.aliases[ name ].outer : name; } );
this.params = names.map( function ( name ) { return name in this$1.aliases ? this$1.aliases[ name ].inner : name; } );
}
LoopStatement.prototype.transpile.call( this, code, transforms );
};
return ForInStatement;
}(LoopStatement));
var handlers = {
Identifier: destructureIdentifier,
AssignmentPattern: destructureAssignmentPattern,
ArrayPattern: destructureArrayPattern,
ObjectPattern: destructureObjectPattern
};
function destructure ( code, scope, node, ref, inline, statementGenerators ) {
handlers[ node.type ]( code, scope, node, ref, inline, statementGenerators );
}
function destructureIdentifier ( code, scope, node, ref, inline, statementGenerators ) {
statementGenerators.push( function ( start, prefix, suffix ) {
code.insertRight( node.start, inline ? prefix : (prefix + "var ") );
code.insertLeft( node.end, (" = " + ref + suffix) );
code.move( node.start, node.end, start );
});
}
function destructureAssignmentPattern ( code, scope, node, ref, inline, statementGenerators ) {
var isIdentifier = node.left.type === 'Identifier';
var name = isIdentifier ? node.left.name : ref;
if ( !inline ) {
statementGenerators.push( function ( start, prefix, suffix ) {
code.insertRight( node.left.end, (prefix + "if ( " + name + " === void 0 ) " + name) );
code.move( node.left.end, node.right.end, start );
code.insertLeft( node.right.end, suffix );
});
}
if ( !isIdentifier ) {
destructure( code, scope, node.left, ref, inline, statementGenerators );
}
}
function destructureArrayPattern ( code, scope, node, ref, inline, statementGenerators ) {
var c = node.start;
node.elements.forEach( function ( element, i ) {
if ( !element ) return;
if ( element.type === 'RestElement' ) {
handleProperty( code, scope, c, element.argument, (ref + ".slice(" + i + ")"), inline, statementGenerators );
} else {
handleProperty( code, scope, c, element, (ref + "[" + i + "]"), inline, statementGenerators );
}
c = element.end;
});
code.remove( c, node.end );
}
function destructureObjectPattern ( code, scope, node, ref, inline, statementGenerators ) {
var c = node.start;
node.properties.forEach( function ( prop ) {
var value = prop.computed || prop.key.type !== 'Identifier' ? (ref + "[" + (code.slice(prop.key.start, prop.key.end)) + "]") : (ref + "." + (prop.key.name));
handleProperty( code, scope, c, prop.value, value, inline, statementGenerators );
c = prop.end;
});
code.remove( c, node.end );
}
function handleProperty ( code, scope, c, node, value, inline, statementGenerators ) {
switch ( node.type ) {
case 'Identifier': {
code.remove( c, node.start );
destructureIdentifier( code, scope, node, value, inline, statementGenerators );
break;
}
case 'AssignmentPattern': {
var name;
var isIdentifier = node.left.type === 'Identifier';
if ( isIdentifier ) {
name = node.left.name;
var declaration = scope.findDeclaration( name );
if ( declaration ) name = declaration.name;
} else {
name = scope.createIdentifier( value );
}
statementGenerators.push( function ( start, prefix, suffix ) {
if ( inline ) {
code.insertRight( node.right.start, (name + " = " + value + " === undefined ? ") );
code.insertLeft( node.right.end, (" : " + value) );
} else {
code.insertRight( node.right.start, (prefix + "var " + name + " = " + value + "; if ( " + name + " === void 0 ) " + name + " = ") );
code.insertLeft( node.right.end, suffix );
}
code.move( node.right.start, node.right.end, start );
});
if ( isIdentifier ) {
code.remove( c, node.right.start );
} else {
code.remove( c, node.left.start );
code.remove( node.left.end, node.right.start );
handleProperty( code, scope, c, node.left, name, inline, statementGenerators );
}
break;
}
case 'ObjectPattern': {
code.remove( c, c = node.start );
if ( node.properties.length > 1 ) {
var ref = scope.createIdentifier( value );
statementGenerators.push( function ( start, prefix, suffix ) {
// this feels a tiny bit hacky, but we can't do a
// straightforward insertLeft and keep correct order...
code.insertRight( node.start, (prefix + "var " + ref + " = ") );
code.overwrite( node.start, c = node.start + 1, value );
code.insertLeft( c, suffix );
code.move( node.start, c, start );
});
node.properties.forEach( function ( prop ) {
var value = prop.computed || prop.key.type !== 'Identifier' ? (ref + "[" + (code.slice(prop.key.start, prop.key.end)) + "]") : (ref + "." + (prop.key.name));
handleProperty( code, scope, c, prop.value, value, inline, statementGenerators );
c = prop.end;
});
} else {
var prop = node.properties[0];
var value_suffix = prop.computed || prop.key.type !== 'Identifier' ? ("[" + (code.slice(prop.key.start, prop.key.end)) + "]") : ("." + (prop.key.name));
handleProperty( code, scope, c, prop.value, ("" + value + value_suffix), inline, statementGenerators );
c = prop.end;
}
code.remove( c, node.end );
break;
}
case 'ArrayPattern': {
code.remove( c, c = node.start );
if ( node.elements.filter( Boolean ).length > 1 ) {
var ref$1 = scope.createIdentifier( value );
statementGenerators.push( function ( start, prefix, suffix ) {
code.insertRight( node.start, (prefix + "var " + ref$1 + " = ") );
code.overwrite( node.start, c = node.start + 1, value );
code.insertLeft( c, suffix );
code.move( node.start, c, start );
});
node.elements.forEach( function ( element, i ) {
if ( !element ) return;
if ( element.type === 'RestElement' ) {
handleProperty( code, scope, c, element.argument, (ref$1 + ".slice(" + i + ")"), inline, statementGenerators );
} else {
handleProperty( code, scope, c, element, (ref$1 + "[" + i + "]"), inline, statementGenerators );
}
c = element.end;
});
} else {
var index = findIndex( node.elements, Boolean );
var element = node.elements[ index ];
if ( element.type === 'RestElement' ) {
handleProperty( code, scope, c, element.argument, (value + ".slice(" + index + ")"), inline, statementGenerators );
} else {
handleProperty( code, scope, c, element, (value + "[" + index + "]"), inline, statementGenerators );
}
c = element.end;
}
code.remove( c, node.end );
break;
}
default: {
throw new Error( ("Unexpected node type in destructuring (" + (node.type) + ")") );
}
}
}
var ForOfStatement = (function (LoopStatement) {
function ForOfStatement () {
LoopStatement.apply(this, arguments);
}
if ( LoopStatement ) ForOfStatement.__proto__ = LoopStatement;
ForOfStatement.prototype = Object.create( LoopStatement && LoopStatement.prototype );
ForOfStatement.prototype.constructor = ForOfStatement;
ForOfStatement.prototype.initialise = function initialise ( transforms ) {
if ( transforms.forOf && !transforms.dangerousForOf ) throw new CompileError( this, 'for...of statements are not supported. Use `transforms: { forOf: false }` to skip transformation and disable this error, or `transforms: { dangerousForOf: true }` if you know what you\'re doing' );
LoopStatement.prototype.initialise.call( this, transforms );
};
ForOfStatement.prototype.transpile = function transpile ( code, transforms ) {
if ( !transforms.dangerousForOf ) {
LoopStatement.prototype.transpile.call( this, code, transforms );
return;
}
// edge case (#80)
if ( !this.body.body[0] ) {
if ( this.left.type === 'VariableDeclaration' && this.left.kind === 'var' ) {
code.remove( this.start, this.left.start );
code.insertLeft( this.left.end, ';' );
code.remove( this.left.end, this.end );
} else {
code.remove( this.start, this.end );
}
return;
}
var scope = this.findScope( true );
var i0 = this.getIndentation();
var i1 = i0 + code.getIndentString();
var key = scope.createIdentifier( 'i' );
var list = scope.createIdentifier( 'list' );
if ( this.body.synthetic ) {
code.insertRight( this.left.start, ("{\n" + i1) );
code.insertLeft( this.body.body[0].end, ("\n" + i0 + "}") );
}
var bodyStart = this.body.body[0].start;
code.remove( this.left.end, this.right.start );
code.move( this.left.start, this.left.end, bodyStart );
code.insertRight( this.right.start, ("var " + key + " = 0, " + list + " = ") );
code.insertLeft( this.right.end, ("; " + key + " < " + list + ".length; " + key + " += 1") );
// destructuring. TODO non declaration destructuring
var declarator = this.left.type === 'VariableDeclaration' && this.left.declarations[0];
if ( declarator && declarator.id.type !== 'Identifier' ) {
var statementGenerators = [];
var ref = scope.createIdentifier( 'ref' );
destructure( code, scope, declarator.id, ref, false, statementGenerators );
var suffix = ";\n" + i1;
statementGenerators.forEach( function ( fn, i ) {
if ( i === statementGenerators.length - 1 ) {
suffix = ";\n\n" + i1;
}
fn( bodyStart, '', suffix );
});
code.insertLeft( this.left.start + this.left.kind.length + 1, ref );
code.insertLeft( this.left.end, (" = " + list + "[" + key + "];\n" + i1) );
} else {
code.insertLeft( this.left.end, (" = " + list + "[" + key + "];\n\n" + i1) );
}
LoopStatement.prototype.transpile.call( this, code, transforms );
};
return ForOfStatement;
}(LoopStatement));
var FunctionDeclaration = (function (Node) {
function FunctionDeclaration () {
Node.apply(this, arguments);
}
if ( Node ) FunctionDeclaration.__proto__ = Node;
FunctionDeclaration.prototype = Object.create( Node && Node.prototype );
FunctionDeclaration.prototype.constructor = FunctionDeclaration;
FunctionDeclaration.prototype.initialise = function initialise ( transforms ) {
if ( this.generator && transforms.generator ) {
throw new CompileError( this, 'Generators are not supported' );
}
this.body.createScope();
this.findScope( true ).addDeclaration( this.id, 'function' );
Node.prototype.initialise.call( this, transforms );
};
return FunctionDeclaration;
}(Node));
var FunctionExpression = (function (Node) {
function FunctionExpression () {
Node.apply(this, arguments);
}
if ( Node ) FunctionExpression.__proto__ = Node;
FunctionExpression.prototype = Object.create( Node && Node.prototype );
FunctionExpression.prototype.constructor = FunctionExpression;
FunctionExpression.prototype.initialise = function initialise ( transforms ) {
if ( this.generator && transforms.generator ) {
throw new CompileError( this, 'Generators are not supported' );
}
this.body.createScope();
if ( this.id ) {
// function expression IDs belong to the child scope...
this.body.scope.addDeclaration( this.id, 'function' );
}
Node.prototype.initialise.call( this, transforms );
var parent = this.parent;
var methodName;
if ( transforms.conciseMethodProperty
&& parent.type === 'Property'
&& parent.kind === 'init'
&& parent.method
&& parent.key.type === 'Identifier' ) {
// object literal concise method
methodName = parent.key.name;
}
else if ( transforms.classes
&& parent.type === 'MethodDefinition'
&& parent.kind === 'method'
&& parent.key.type === 'Identifier' ) {
// method definition in a class
methodName = parent.key.name;
}
else if ( this.id && this.id.type === 'Identifier' ) {
// naked function expression
methodName = this.id.alias || this.id.name;
}
if ( methodName ) {
for ( var i = 0, list = this.params; i < list.length; i += 1 ) {
var param = list[i];
if ( param.type === 'Identifier' && methodName === param.name ) {
// workaround for Safari 9/WebKit bug:
// https://gitlab.com/Rich-Harris/buble/issues/154
// change parameter name when same as method name
var scope = this.body.scope;
var declaration = scope.declarations[ methodName ];
var alias = scope.createIdentifier( methodName );
param.alias = alias;
for ( var i$1 = 0, list$1 = declaration.instances; i$1 < list$1.length; i$1 += 1 ) {
var identifier = list$1[i$1];
identifier.alias = alias;
}
break;
}
}
}
};
return FunctionExpression;
}(Node));
function isReference ( node, parent ) {
if ( node.type === 'MemberExpression' ) {
return !node.computed && isReference( node.object, node );
}
if ( node.type === 'Identifier' ) {
// the only time we could have an identifier node without a parent is
// if it's the entire body of a function without a block statement
// i.e. an arrow function expression like `a => a`
if ( !parent ) return true;
if ( /(Function|Class)Expression/.test( parent.type ) ) return false;
if ( parent.type === 'VariableDeclarator' ) return node === parent.init;
// TODO is this right?
if ( parent.type === 'MemberExpression' || parent.type === 'MethodDefinition' ) {
return parent.computed || node === parent.object;
}
if ( parent.type === 'ArrayPattern' ) return false;
// disregard the `bar` in `{ bar: foo }`, but keep it in `{ [bar]: foo }`
if ( parent.type === 'Property' ) {
if ( parent.parent.type === 'ObjectPattern' ) return false;
return parent.computed || node === parent.value;
}
// disregard the `bar` in `class Foo { bar () {...} }`
if ( parent.type === 'MethodDefinition' ) return false;
// disregard the `bar` in `export { foo as bar }`
if ( parent.type === 'ExportSpecifier' && node !== parent.local ) return false;
return true;
}
}
var Identifier = (function (Node) {
function Identifier () {
Node.apply(this, arguments);
}
if ( Node ) Identifier.__proto__ = Node;
Identifier.prototype = Object.create( Node && Node.prototype );
Identifier.prototype.constructor = Identifier;
Identifier.prototype.findScope = function findScope ( functionScope ) {
if ( this.parent.params && ~this.parent.params.indexOf( this ) ) {
return this.parent.body.scope;
}
if ( this.parent.type === 'FunctionExpression' && this === this.parent.id ) {
return this.parent.body.scope;
}
return this.parent.findScope( functionScope );
};
Identifier.prototype.initialise = function initialise ( transforms ) {
if ( transforms.arrow && isReference( this, this.parent ) ) {
if ( this.name === 'arguments' && !this.findScope( false ).contains( this.name ) ) {
var lexicalBoundary = this.findLexicalBoundary();
var arrowFunction = this.findNearest( 'ArrowFunctionExpression' );
var loop = this.findNearest( loopStatement );
if ( arrowFunction && arrowFunction.depth > lexicalBoundary.depth ) {
this.alias = lexicalBoundary.getArgumentsAlias();
}
if ( loop && loop.body.contains( this ) && loop.depth > lexicalBoundary.depth ) {
this.alias = lexicalBoundary.getArgumentsAlias();
}
}
this.findScope( false ).addReference( this );
}
};
Identifier.prototype.transpile = function transpile ( code ) {
if ( this.alias ) {
code.overwrite( this.start, this.end, this.alias, true );
}
};
return Identifier;
}(Node));
var IfStatement = (function (Node) {
function IfStatement () {
Node.apply(this, arguments);
}
if ( Node ) IfStatement.__proto__ = Node;
IfStatement.prototype = Object.create( Node && Node.prototype );
IfStatement.prototype.constructor = IfStatement;
IfStatement.prototype.initialise = function initialise ( transforms ) {
Node.prototype.initialise.call( this, transforms );
};
IfStatement.prototype.transpile = function transpile ( code, transforms ) {
if ( this.consequent.type !== 'BlockStatement'
|| this.consequent.type === 'BlockStatement' && this.consequent.synthetic ) {
code.insertLeft( this.consequent.start, '{ ' );
code.insertRight( this.consequent.end, ' }' );
}
if ( this.alternate && this.alternate.type !== 'IfStatement' && (
this.alternate.type !== 'BlockStatement'
|| this.alternate.type === 'BlockStatement' && this.alternate.synthetic ) ) {
code.insertLeft( this.alternate.start, '{ ' );
code.insertRight( this.alternate.end, ' }' );
}
Node.prototype.transpile.call( this, code, transforms );
};
return IfStatement;
}(Node));
var ImportDeclaration = (function (Node) {
function ImportDeclaration () {
Node.apply(this, arguments);
}
if ( Node ) ImportDeclaration.__proto__ = Node;
ImportDeclaration.prototype = Object.create( Node && Node.prototype );
ImportDeclaration.prototype.constructor = ImportDeclaration;
ImportDeclaration.prototype.initialise = function initialise ( transforms ) {
if ( transforms.moduleImport ) throw new CompileError( this, 'import is not supported' );
Node.prototype.initialise.call( this, transforms );
};
return ImportDeclaration;
}(Node));
var ImportDefaultSpecifier = (function (Node) {
function ImportDefaultSpecifier () {
Node.apply(this, arguments);
}
if ( Node ) ImportDefaultSpecifier.__proto__ = Node;
ImportDefaultSpecifier.prototype = Object.create( Node && Node.prototype );
ImportDefaultSpecifier.prototype.constructor = ImportDefaultSpecifier;
ImportDefaultSpecifier.prototype.initialise = function initialise ( transforms ) {
this.findScope( true ).addDeclaration( this.local, 'import' );
Node.prototype.initialise.call( this, transforms );
};
return ImportDefaultSpecifier;
}(Node));
var ImportSpecifier = (function (Node) {
function ImportSpecifier () {
Node.apply(this, arguments);
}
if ( Node ) ImportSpecifier.__proto__ = Node;
ImportSpecifier.prototype = Object.create( Node && Node.prototype );
ImportSpecifier.prototype.constructor = ImportSpecifier;
ImportSpecifier.prototype.initialise = function initialise ( transforms ) {
this.findScope( true ).addDeclaration( this.local, 'import' );
Node.prototype.initialise.call( this, transforms );
};
return ImportSpecifier;
}(Node));
var IS_DATA_ATTRIBUTE = /-/;
var JSXAttribute = (function (Node) {
function JSXAttribute () {
Node.apply(this, arguments);
}
if ( Node ) JSXAttribute.__proto__ = Node;
JSXAttribute.prototype = Object.create( Node && Node.prototype );
JSXAttribute.prototype.constructor = JSXAttribute;
JSXAttribute.prototype.transpile = function transpile ( code, transforms ) {
if ( this.value ) {
code.overwrite( this.name.end, this.value.start, ': ' );
} else {
// tag without value
code.overwrite( this.name.start, this.name.end, ((this.name.name) + ": true") );
}
if ( IS_DATA_ATTRIBUTE.test( this.name.name ) ) {
code.overwrite( this.name.start, this.name.end, ("'" + (this.name.name) + "'") );
}
Node.prototype.transpile.call( this, code, transforms );
};
return JSXAttribute;
}(Node));
function containsNewLine ( node ) {
return node.type === 'Literal' && !/\S/.test( node.value ) && /\n/.test( node.value );
}
var JSXClosingElement = (function (Node) {
function JSXClosingElement () {
Node.apply(this, arguments);
}
if ( Node ) JSXClosingElement.__proto__ = Node;
JSXClosingElement.prototype = Object.create( Node && Node.prototype );
JSXClosingElement.prototype.constructor = JSXClosingElement;
JSXClosingElement.prototype.transpile = function transpile ( code ) {
var spaceBeforeParen = true;
var lastChild = this.parent.children[ this.parent.children.length - 1 ];
// omit space before closing paren if
// a) this is on a separate line, or
// b) there are no children but there are attributes
if ( ( lastChild && containsNewLine( lastChild ) ) || ( this.parent.openingElement.attributes.length ) ) {
spaceBeforeParen = false;
}
code.overwrite( this.start, this.end, spaceBeforeParen ? ' )' : ')' );
};
return JSXClosingElement;
}(Node));
function normalise ( str, removeTrailingWhitespace ) {
if ( removeTrailingWhitespace && /\n/.test( str ) ) {
str = str.replace( /\s+$/, '' );
}
str = str
.replace( /^\n\r?\s+/, '' ) // remove leading newline + space
.replace( /\s*\n\r?\s*/gm, ' ' ); // replace newlines with spaces
// TODO prefer single quotes?
return JSON.stringify( str );
}
var JSXElement = (function (Node) {
function JSXElement () {
Node.apply(this, arguments);
}
if ( Node ) JSXElement.__proto__ = Node;
JSXElement.prototype = Object.create( Node && Node.prototype );
JSXElement.prototype.constructor = JSXElement;
JSXElement.prototype.transpile = function transpile ( code, transforms ) {
Node.prototype.transpile.call( this, code, transforms );
var children = this.children.filter( function ( child ) {
if ( child.type !== 'Literal' ) return true;
// remove whitespace-only literals, unless on a single line
return /\S/.test( child.value ) || !/\n/.test( child.value );
});
if ( children.length ) {
var c = this.openingElement.end;
var i;
for ( i = 0; i < children.length; i += 1 ) {
var child = children[i];
if ( child.type === 'JSXExpressionContainer' && child.expression.type === 'JSXEmptyExpression' ) {
// empty block is a no op
} else {
var tail = code.original[ c ] === '\n' && child.type !== 'Literal' ? '' : ' ';
code.insertLeft( c, ("," + tail) );
}
if ( child.type === 'Literal' ) {
var str = normalise( child.value, i === children.length - 1 );
code.overwrite( child.start, child.end, str );
}
c = child.end;
}
}
};
return JSXElement;
}(Node));
var JSXExpressionContainer = (function (Node) {
function JSXExpressionContainer () {
Node.apply(this, arguments);
}
if ( Node ) JSXExpressionContainer.__proto__ = Node;
JSXExpressionContainer.prototype = Object.create( Node && Node.prototype );
JSXExpressionContainer.prototype.constructor = JSXExpressionContainer;
JSXExpressionContainer.prototype.transpile = function transpile ( code, transforms ) {
code.remove( this.start, this.expression.start );
code.remove( this.expression.end, this.end );
Node.prototype.transpile.call( this, code, transforms );
};
return JSXExpressionContainer;
}(Node));
var JSXOpeningElement = (function (Node) {
function JSXOpeningElement () {
Node.apply(this, arguments);
}
if ( Node ) JSXOpeningElement.__proto__ = Node;
JSXOpeningElement.prototype = Object.create( Node && Node.prototype );
JSXOpeningElement.prototype.constructor = JSXOpeningElement;
JSXOpeningElement.prototype.transpile = function transpile ( code, transforms ) {
var this$1 = this;
code.overwrite( this.start, this.name.start, ((this.program.jsx) + "( ") );
var html = this.name.type === 'JSXIdentifier' && this.name.name[0] === this.name.name[0].toLowerCase();
if ( html ) code.insertRight( this.name.start, "'" );
var len = this.attributes.length;
var c = this.name.end;
if ( len ) {
var i;
var hasSpread = false;
for ( i = 0; i < len; i += 1 ) {
if ( this$1.attributes[i].type === 'JSXSpreadAttribute' ) {
hasSpread = true;
break;
}
}
c = this.attributes[0].end;
for ( i = 0; i < len; i += 1 ) {
var attr = this$1.attributes[i];
if ( i > 0 ) {
code.overwrite( c, attr.start, ', ' );
}
if ( hasSpread && attr.type !== 'JSXSpreadAttribute' ) {
var lastAttr = this$1.attributes[ i - 1 ];
var nextAttr = this$1.attributes[ i + 1 ];
if ( !lastAttr || lastAttr.type === 'JSXSpreadAttribute' ) {
code.insertRight( attr.start, '{ ' );
}
if ( !nextAttr || nextAttr.type === 'JSXSpreadAttribute' ) {
code.insertLeft( attr.end, ' }' );
}
}
c = attr.end;
}
var after;
var before;
if ( hasSpread ) {
if ( len === 1 ) {
before = html ? "'," : ',';
} else {
if (!this.program.options.objectAssign) {
throw new CompileError( this, 'Mixed JSX attributes ending in spread requires specified objectAssign option with \'Object.assign\' or polyfill helper.' );
}
before = html ? ("', " + (this.program.options.objectAssign) + "({},") : (", " + (this.program.options.objectAssign) + "({},");
after = ')';
}
} else {
before = html ? "', {" : ', {';
after = ' }';
}
code.insertRight( this.name.end, before );
if ( after ) {
code.insertLeft( this.attributes[ len - 1 ].end, after );
}
} else {
code.insertLeft( this.name.end, html ? "', null" : ", null" );
c = this.name.end;
}
Node.prototype.transpile.call( this, code, transforms );
if ( this.selfClosing ) {
code.overwrite( c, this.end, this.attributes.length ? ")" : " )" );
} else {
code.remove( c, this.end );
}
};
return JSXOpeningElement;
}(Node));
var JSXSpreadAttribute = (function (Node) {
function JSXSpreadAttribute () {
Node.apply(this, arguments);
}
if ( Node ) JSXSpreadAttribute.__proto__ = Node;
JSXSpreadAttribute.prototype = Object.create( Node && Node.prototype );
JSXSpreadAttribute.prototype.constructor = JSXSpreadAttribute;
JSXSpreadAttribute.prototype.transpile = function transpile ( code, transforms ) {
code.remove( this.start, this.argument.start );
code.remove( this.argument.end, this.end );
Node.prototype.transpile.call( this, code, transforms );
};
return JSXSpreadAttribute;
}(Node));
var regenerate = __commonjs(function (module, exports, global) {
/*! https://mths.be/regenerate v1.3.1 by @mathias | MIT license */
;(function(root) {
// Detect free variables `exports`.
var freeExports = typeof exports == 'object' && exports;
// Detect free variable `module`.
var freeModule = typeof module == 'object' && module &&
module.exports == freeExports && module;
// Detect free variable `global`, from Node.js/io.js or Browserified code,
// and use it as `root`.
var freeGlobal = typeof global == 'object' && global;
if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {
root = freeGlobal;
}
/*--------------------------------------------------------------------------*/
var ERRORS = {
'rangeOrder': 'A range\u2019s `stop` value must be greater than or equal ' +
'to the `start` value.',
'codePointRange': 'Invalid code point value. Code points range from ' +
'U+000000 to U+10FFFF.'
};
// https://mathiasbynens.be/notes/javascript-encoding#surrogate-pairs
var HIGH_SURROGATE_MIN = 0xD800;
var HIGH_SURROGATE_MAX = 0xDBFF;
var LOW_SURROGATE_MIN = 0xDC00;
var LOW_SURROGATE_MAX = 0xDFFF;
// In Regenerate output, `\0` is never preceded by `\` because we sort by
// code point value, so lets keep this regular expression simple.
var regexNull = /\\x00([^0123456789]|$)/g;
var object = {};
var hasOwnProperty = object.hasOwnProperty;
var extend = function(destination, source) {
var key;
for (key in source) {
if (hasOwnProperty.call(source, key)) {
destination[key] = source[key];
}
}
return destination;
};
var forEach = function(array, callback) {
var index = -1;
var length = array.length;
while (++index < length) {
callback(array[index], index);
}
};
var toString = object.toString;
var isArray = function(value) {
return toString.call(value) == '[object Array]';
};
var isNumber = function(value) {
return typeof value == 'number' ||
toString.call(value) == '[object Number]';
};
// This assumes that `number` is a positive integer that `toString()`s nicely
// (which is the case for all code point values).
var zeroes = '0000';
var pad = function(number, totalCharacters) {
var string = String(number);
return string.length < totalCharacters
? (zeroes + string).slice(-totalCharacters)
: string;
};
var hex = function(number) {
return Number(number).toString(16).toUpperCase();
};
var slice = [].slice;
/*--------------------------------------------------------------------------*/
var dataFromCodePoints = function(codePoints) {
var index = -1;
var length = codePoints.length;
var max = length - 1;
var result = [];
var isStart = true;
var tmp;
var previous = 0;
while (++index < length) {
tmp = codePoints[index];
if (isStart) {
result.push(tmp);
previous = tmp;
isStart = false;
} else {
if (tmp == previous + 1) {
if (index != max) {
previous = tmp;
continue;
} else {
isStart = true;
result.push(tmp + 1);
}
} else {
// End the previous range and start a new one.
result.push(previous + 1, tmp);
previous = tmp;
}
}
}
if (!isStart) {
result.push(tmp + 1);
}
return result;
};
var dataRemove = function(data, codePoint) {
// Iterate over the data per `(start, end)` pair.
var index = 0;
var start;
var end;
var length = data.length;
while (index < length) {
start = data[index];
end = data[index + 1];
if (codePoint >= start && codePoint < end) {
// Modify this pair.
if (codePoint == start) {
if (end == start + 1) {
// Just remove `start` and `end`.
data.splice(index, 2);
return data;
} else {
// Just replace `start` with a new value.
data[index] = codePoint + 1;
return data;
}
} else if (codePoint == end - 1) {
// Just replace `end` with a new value.
data[index + 1] = codePoint;
return data;
} else {
// Replace `[start, end]` with `[startA, endA, startB, endB]`.
data.splice(index, 2, start, codePoint, codePoint + 1, end);
return data;
}
}
index += 2;
}
return data;
};
var dataRemoveRange = function(data, rangeStart, rangeEnd) {
if (rangeEnd < rangeStart) {
throw Error(ERRORS.rangeOrder);
}
// Iterate over the data per `(start, end)` pair.
var index = 0;
var start;
var end;
while (index < data.length) {
start = data[index];
end = data[index + 1] - 1; // Note: the `- 1` makes `end` inclusive.
// Exit as soon as no more matching pairs can be found.
if (start > rangeEnd) {
return data;
}
// Check if this range pair is equal to, or forms a subset of, the range
// to be removed.
// E.g. we have `[0, 11, 40, 51]` and want to remove 0-10 → `[40, 51]`.
// E.g. we have `[40, 51]` and want to remove 0-100 → `[]`.
if (rangeStart <= start && rangeEnd >= end) {
// Remove this pair.
data.splice(index, 2);
continue;
}
// Check if both `rangeStart` and `rangeEnd` are within the bounds of
// this pair.
// E.g. we have `[0, 11]` and want to remove 4-6 → `[0, 4, 7, 11]`.
if (rangeStart >= start && rangeEnd < end) {
if (rangeStart == start) {
// Replace `[start, end]` with `[startB, endB]`.
data[index] = rangeEnd + 1;
data[index + 1] = end + 1;
return data;
}
// Replace `[start, end]` with `[startA, endA, startB, endB]`.
data.splice(index, 2, start, rangeStart, rangeEnd + 1, end + 1);
return data;
}
// Check if only `rangeStart` is within the bounds of this pair.
// E.g. we have `[0, 11]` and want to remove 4-20 → `[0, 4]`.
if (rangeStart >= start && rangeStart <= end) {
// Replace `end` with `rangeStart`.
data[index + 1] = rangeStart;
// Note: we cannot `return` just yet, in case any following pairs still
// contain matching code points.
// E.g. we have `[0, 11, 14, 31]` and want to remove 4-20
// → `[0, 4, 21, 31]`.
}
// Check if only `rangeEnd` is within the bounds of this pair.
// E.g. we have `[14, 31]` and want to remove 4-20 → `[21, 31]`.
else if (rangeEnd >= start && rangeEnd <= end) {
// Just replace `start`.
data[index] = rangeEnd + 1;
return data;
}
index += 2;
}
return data;
};
var dataAdd = function(data, codePoint) {
// Iterate over the data per `(start, end)` pair.
var index = 0;
var start;
var end;
var lastIndex = null;
var length = data.length;
if (codePoint < 0x0 || codePoint > 0x10FFFF) {
throw RangeError(ERRORS.codePointRange);
}
while (index < length) {
start = data[index];
end = data[index + 1];
// Check if the code point is already in the set.
if (codePoint >= start && codePoint < end) {
return data;
}
if (codePoint == start - 1) {
// Just replace `start` with a new value.
data[index] = codePoint;
return data;
}
// At this point, if `start` is `greater` than `codePoint`, insert a new
// `[start, end]` pair before the current pair, or after the current pair
// if there is a known `lastIndex`.
if (start > codePoint) {
data.splice(
lastIndex != null ? lastIndex + 2 : 0,
0,
codePoint,
codePoint + 1
);
return data;
}
if (codePoint == end) {
// Check if adding this code point causes two separate ranges to become
// a single range, e.g. `dataAdd([0, 4, 5, 10], 4)` → `[0, 10]`.
if (codePoint + 1 == data[index + 2]) {
data.splice(index, 4, start, data[index + 3]);
return data;
}
// Else, just replace `end` with a new value.
data[index + 1] = codePoint + 1;
return data;
}
lastIndex = index;
index += 2;
}
// The loop has finished; add the new pair to the end of the data set.
data.push(codePoint, codePoint + 1);
return data;
};
var dataAddData = function(dataA, dataB) {
// Iterate over the data per `(start, end)` pair.
var index = 0;
var start;
var end;
var data = dataA.slice();
var length = dataB.length;
while (index < length) {
start = dataB[index];
end = dataB[index + 1] - 1;
if (start == end) {
data = dataAdd(data, start);
} else {
data = dataAddRange(data, start, end);
}
index += 2;
}
return data;
};
var dataRemoveData = function(dataA, dataB) {
// Iterate over the data per `(start, end)` pair.
var index = 0;
var start;
var end;
var data = dataA.slice();
var length = dataB.length;
while (index < length) {
start = dataB[index];
end = dataB[index + 1] - 1;
if (start == end) {
data = dataRemove(data, start);
} else {
data = dataRemoveRange(data, start, end);
}
index += 2;
}
return data;
};
var dataAddRange = function(data, rangeStart, rangeEnd) {
if (rangeEnd < rangeStart) {
throw Error(ERRORS.rangeOrder);
}
if (
rangeStart < 0x0 || rangeStart > 0x10FFFF ||
rangeEnd < 0x0 || rangeEnd > 0x10FFFF
) {
throw RangeError(ERRORS.codePointRange);
}
// Iterate over the data per `(start, end)` pair.
var index = 0;
var start;
var end;
var added = false;
var length = data.length;
while (index < length) {
start = data[index];
end = data[index + 1];
if (added) {
// The range has already been added to the set; at this point, we just
// need to get rid of the following ranges in case they overlap.
// Check if this range can be combined with the previous range.
if (start == rangeEnd + 1) {
data.splice(index - 1, 2);
return data;
}
// Exit as soon as no more possibly overlapping pairs can be found.
if (start > rangeEnd) {
return data;
}
// E.g. `[0, 11, 12, 16]` and weve added 5-15, so we now have
// `[0, 16, 12, 16]`. Remove the `12,16` part, as it lies within the
// `0,16` range that was previously added.
if (start >= rangeStart && start <= rangeEnd) {
// `start` lies within the range that was previously added.
if (end > rangeStart && end - 1 <= rangeEnd) {
// `end` lies within the range that was previously added as well,
// so remove this pair.
data.splice(index, 2);
index -= 2;
// Note: we cannot `return` just yet, as there may still be other
// overlapping pairs.
} else {
// `start` lies within the range that was previously added, but
// `end` doesnt. E.g. `[0, 11, 12, 31]` and weve added 5-15, so
// now we have `[0, 16, 12, 31]`. This must be written as `[0, 31]`.
// Remove the previously added `end` and the current `start`.
data.splice(index - 1, 2);
index -= 2;
}
// Note: we cannot return yet.
}
}
else if (start == rangeEnd + 1) {
data[index] = rangeStart;
return data;
}
// Check if a new pair must be inserted *before* the current one.
else if (start > rangeEnd) {
data.splice(index, 0, rangeStart, rangeEnd + 1);
return data;
}
else if (rangeStart >= start && rangeStart < end && rangeEnd + 1 <= end) {
// The new range lies entirely within an existing range pair. No action
// needed.
return data;
}
else if (
// E.g. `[0, 11]` and you add 5-15 → `[0, 16]`.
(rangeStart >= start && rangeStart < end) ||
// E.g. `[0, 3]` and you add 3-6 → `[0, 7]`.
end == rangeStart
) {
// Replace `end` with the new value.
data[index + 1] = rangeEnd + 1;
// Make sure the next range pair doesnt overlap, e.g. `[0, 11, 12, 14]`
// and you add 5-15 → `[0, 16]`, i.e. remove the `12,14` part.
added = true;
// Note: we cannot `return` just yet.
}
else if (rangeStart <= start && rangeEnd + 1 >= end) {
// The new range is a superset of the old range.
data[index] = rangeStart;
data[index + 1] = rangeEnd + 1;
added = true;
}
index += 2;
}
// The loop has finished without doing anything; add the new pair to the end
// of the data set.
if (!added) {
data.push(rangeStart, rangeEnd + 1);
}
return data;
};
var dataContains = function(data, codePoint) {
var index = 0;
var length = data.length;
// Exit early if `codePoint` is not within `data`s overall range.
var start = data[index];
var end = data[length - 1];
if (length >= 2) {
if (codePoint < start || codePoint > end) {
return false;
}
}
// Iterate over the data per `(start, end)` pair.
while (index < length) {
start = data[index];
end = data[index + 1];
if (codePoint >= start && codePoint < end) {
return true;
}
index += 2;
}
return false;
};
var dataIntersection = function(data, codePoints) {
var index = 0;
var length = codePoints.length;
var codePoint;
var result = [];
while (index < length) {
codePoint = codePoints[index];
if (dataContains(data, codePoint)) {
result.push(codePoint);
}
++index;
}
return dataFromCodePoints(result);
};
var dataIsEmpty = function(data) {
return !data.length;
};
var dataIsSingleton = function(data) {
// Check if the set only represents a single code point.
return data.length == 2 && data[0] + 1 == data[1];
};
var dataToArray = function(data) {
// Iterate over the data per `(start, end)` pair.
var index = 0;
var start;
var end;
var result = [];
var length = data.length;
while (index < length) {
start = data[index];
end = data[index + 1];
while (start < end) {
result.push(start);
++start;
}
index += 2;
}
return result;
};
/*--------------------------------------------------------------------------*/
// https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
var floor = Math.floor;
var highSurrogate = function(codePoint) {
return parseInt(
floor((codePoint - 0x10000) / 0x400) + HIGH_SURROGATE_MIN,
10
);
};
var lowSurrogate = function(codePoint) {
return parseInt(
(codePoint - 0x10000) % 0x400 + LOW_SURROGATE_MIN,
10
);
};
var stringFromCharCode = String.fromCharCode;
var codePointToString = function(codePoint) {
var string;
// https://mathiasbynens.be/notes/javascript-escapes#single
// Note: the `\b` escape sequence for U+0008 BACKSPACE in strings has a
// different meaning in regular expressions (word boundary), so it cannot
// be used here.
if (codePoint == 0x09) {
string = '\\t';
}
// Note: IE < 9 treats `'\v'` as `'v'`, so avoid using it.
// else if (codePoint == 0x0B) {
// string = '\\v';
// }
else if (codePoint == 0x0A) {
string = '\\n';
}
else if (codePoint == 0x0C) {
string = '\\f';
}
else if (codePoint == 0x0D) {
string = '\\r';
}
else if (codePoint == 0x5C) {
string = '\\\\';
}
else if (
codePoint == 0x24 ||
(codePoint >= 0x28 && codePoint <= 0x2B) ||
codePoint == 0x2D || codePoint == 0x2E || codePoint == 0x3F ||
(codePoint >= 0x5B && codePoint <= 0x5E) ||
(codePoint >= 0x7B && codePoint <= 0x7D)
) {
// The code point maps to an unsafe printable ASCII character;
// backslash-escape it. Heres the list of those symbols:
//
// $()*+-.?[\]^{|}
//
// See #7 for more info.
string = '\\' + stringFromCharCode(codePoint);
}
else if (codePoint >= 0x20 && codePoint <= 0x7E) {
// The code point maps to one of these printable ASCII symbols
// (including the space character):
//
// !"#%&',/0123456789:;<=>@ABCDEFGHIJKLMNO
// PQRSTUVWXYZ_`abcdefghijklmnopqrstuvwxyz~
//
// These can safely be used directly.
string = stringFromCharCode(codePoint);
}
else if (codePoint <= 0xFF) {
// https://mathiasbynens.be/notes/javascript-escapes#hexadecimal
string = '\\x' + pad(hex(codePoint), 2);
}
else { // `codePoint <= 0xFFFF` holds true.
// https://mathiasbynens.be/notes/javascript-escapes#unicode
string = '\\u' + pad(hex(codePoint), 4);
}
// Theres no need to account for astral symbols / surrogate pairs here,
// since `codePointToString` is private and only used for BMP code points.
// But if thats what you need, just add an `else` block with this code:
//
// string = '\\u' + pad(hex(highSurrogate(codePoint)), 4)
// + '\\u' + pad(hex(lowSurrogate(codePoint)), 4);
return string;
};
var codePointToStringUnicode = function(codePoint) {
if (codePoint <= 0xFFFF) {
return codePointToString(codePoint);
}
return '\\u{' + codePoint.toString(16).toUpperCase() + '}';
};
var symbolToCodePoint = function(symbol) {
var length = symbol.length;
var first = symbol.charCodeAt(0);
var second;
if (
first >= HIGH_SURROGATE_MIN && first <= HIGH_SURROGATE_MAX &&
length > 1 // There is a next code unit.
) {
// `first` is a high surrogate, and there is a next character. Assume
// its a low surrogate (else its invalid usage of Regenerate anyway).
second = symbol.charCodeAt(1);
// https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
return (first - HIGH_SURROGATE_MIN) * 0x400 +
second - LOW_SURROGATE_MIN + 0x10000;
}
return first;
};
var createBMPCharacterClasses = function(data) {
// Iterate over the data per `(start, end)` pair.
var result = '';
var index = 0;
var start;
var end;
var length = data.length;
if (dataIsSingleton(data)) {
return codePointToString(data[0]);
}
while (index < length) {
start = data[index];
end = data[index + 1] - 1; // Note: the `- 1` makes `end` inclusive.
if (start == end) {
result += codePointToString(start);
} else if (start + 1 == end) {
result += codePointToString(start) + codePointToString(end);
} else {
result += codePointToString(start) + '-' + codePointToString(end);
}
index += 2;
}
return '[' + result + ']';
};
var createUnicodeCharacterClasses = function(data) {
// Iterate over the data per `(start, end)` pair.
var result = '';
var index = 0;
var start;
var end;
var length = data.length;
if (dataIsSingleton(data)) {
return codePointToStringUnicode(data[0]);
}
while (index < length) {
start = data[index];
end = data[index + 1] - 1; // Note: the `- 1` makes `end` inclusive.
if (start == end) {
result += codePointToStringUnicode(start);
} else if (start + 1 == end) {
result += codePointToStringUnicode(start) + codePointToStringUnicode(end);
} else {
result += codePointToStringUnicode(start) + '-' + codePointToStringUnicode(end);
}
index += 2;
}
return '[' + result + ']';
};
var splitAtBMP = function(data) {
// Iterate over the data per `(start, end)` pair.
var loneHighSurrogates = [];
var loneLowSurrogates = [];
var bmp = [];
var astral = [];
var index = 0;
var start;
var end;
var length = data.length;
while (index < length) {
start = data[index];
end = data[index + 1] - 1; // Note: the `- 1` makes `end` inclusive.
if (start < HIGH_SURROGATE_MIN) {
// The range starts and ends before the high surrogate range.
// E.g. (0, 0x10).
if (end < HIGH_SURROGATE_MIN) {
bmp.push(start, end + 1);
}
// The range starts before the high surrogate range and ends within it.
// E.g. (0, 0xD855).
if (end >= HIGH_SURROGATE_MIN && end <= HIGH_SURROGATE_MAX) {
bmp.push(start, HIGH_SURROGATE_MIN);
loneHighSurrogates.push(HIGH_SURROGATE_MIN, end + 1);
}
// The range starts before the high surrogate range and ends in the low
// surrogate range. E.g. (0, 0xDCFF).
if (end >= LOW_SURROGATE_MIN && end <= LOW_SURROGATE_MAX) {
bmp.push(start, HIGH_SURROGATE_MIN);
loneHighSurrogates.push(HIGH_SURROGATE_MIN, HIGH_SURROGATE_MAX + 1);
loneLowSurrogates.push(LOW_SURROGATE_MIN, end + 1);
}
// The range starts before the high surrogate range and ends after the
// low surrogate range. E.g. (0, 0x10FFFF).
if (end > LOW_SURROGATE_MAX) {
bmp.push(start, HIGH_SURROGATE_MIN);
loneHighSurrogates.push(HIGH_SURROGATE_MIN, HIGH_SURROGATE_MAX + 1);
loneLowSurrogates.push(LOW_SURROGATE_MIN, LOW_SURROGATE_MAX + 1);
if (end <= 0xFFFF) {
bmp.push(LOW_SURROGATE_MAX + 1, end + 1);
} else {
bmp.push(LOW_SURROGATE_MAX + 1, 0xFFFF + 1);
astral.push(0xFFFF + 1, end + 1);
}
}
} else if (start >= HIGH_SURROGATE_MIN && start <= HIGH_SURROGATE_MAX) {
// The range starts and ends in the high surrogate range.
// E.g. (0xD855, 0xD866).
if (end >= HIGH_SURROGATE_MIN && end <= HIGH_SURROGATE_MAX) {
loneHighSurrogates.push(start, end + 1);
}
// The range starts in the high surrogate range and ends in the low
// surrogate range. E.g. (0xD855, 0xDCFF).
if (end >= LOW_SURROGATE_MIN && end <= LOW_SURROGATE_MAX) {
loneHighSurrogates.push(start, HIGH_SURROGATE_MAX + 1);
loneLowSurrogates.push(LOW_SURROGATE_MIN, end + 1);
}
// The range starts in the high surrogate range and ends after the low
// surrogate range. E.g. (0xD855, 0x10FFFF).
if (end > LOW_SURROGATE_MAX) {
loneHighSurrogates.push(start, HIGH_SURROGATE_MAX + 1);
loneLowSurrogates.push(LOW_SURROGATE_MIN, LOW_SURROGATE_MAX + 1);
if (end <= 0xFFFF) {
bmp.push(LOW_SURROGATE_MAX + 1, end + 1);
} else {
bmp.push(LOW_SURROGATE_MAX + 1, 0xFFFF + 1);
astral.push(0xFFFF + 1, end + 1);
}
}
} else if (start >= LOW_SURROGATE_MIN && start <= LOW_SURROGATE_MAX) {
// The range starts and ends in the low surrogate range.
// E.g. (0xDCFF, 0xDDFF).
if (end >= LOW_SURROGATE_MIN && end <= LOW_SURROGATE_MAX) {
loneLowSurrogates.push(start, end + 1);
}
// The range starts in the low surrogate range and ends after the low
// surrogate range. E.g. (0xDCFF, 0x10FFFF).
if (end > LOW_SURROGATE_MAX) {
loneLowSurrogates.push(start, LOW_SURROGATE_MAX + 1);
if (end <= 0xFFFF) {
bmp.push(LOW_SURROGATE_MAX + 1, end + 1);
} else {
bmp.push(LOW_SURROGATE_MAX + 1, 0xFFFF + 1);
astral.push(0xFFFF + 1, end + 1);
}
}
} else if (start > LOW_SURROGATE_MAX && start <= 0xFFFF) {
// The range starts and ends after the low surrogate range.
// E.g. (0xFFAA, 0x10FFFF).
if (end <= 0xFFFF) {
bmp.push(start, end + 1);
} else {
bmp.push(start, 0xFFFF + 1);
astral.push(0xFFFF + 1, end + 1);
}
} else {
// The range starts and ends in the astral range.
astral.push(start, end + 1);
}
index += 2;
}
return {
'loneHighSurrogates': loneHighSurrogates,
'loneLowSurrogates': loneLowSurrogates,
'bmp': bmp,
'astral': astral
};
};
var optimizeSurrogateMappings = function(surrogateMappings) {
var result = [];
var tmpLow = [];
var addLow = false;
var mapping;
var nextMapping;
var highSurrogates;
var lowSurrogates;
var nextHighSurrogates;
var nextLowSurrogates;
var index = -1;
var length = surrogateMappings.length;
while (++index < length) {
mapping = surrogateMappings[index];
nextMapping = surrogateMappings[index + 1];
if (!nextMapping) {
result.push(mapping);
continue;
}
highSurrogates = mapping[0];
lowSurrogates = mapping[1];
nextHighSurrogates = nextMapping[0];
nextLowSurrogates = nextMapping[1];
// Check for identical high surrogate ranges.
tmpLow = lowSurrogates;
while (
nextHighSurrogates &&
highSurrogates[0] == nextHighSurrogates[0] &&
highSurrogates[1] == nextHighSurrogates[1]
) {
// Merge with the next item.
if (dataIsSingleton(nextLowSurrogates)) {
tmpLow = dataAdd(tmpLow, nextLowSurrogates[0]);
} else {
tmpLow = dataAddRange(
tmpLow,
nextLowSurrogates[0],
nextLowSurrogates[1] - 1
);
}
++index;
mapping = surrogateMappings[index];
highSurrogates = mapping[0];
lowSurrogates = mapping[1];
nextMapping = surrogateMappings[index + 1];
nextHighSurrogates = nextMapping && nextMapping[0];
nextLowSurrogates = nextMapping && nextMapping[1];
addLow = true;
}
result.push([
highSurrogates,
addLow ? tmpLow : lowSurrogates
]);
addLow = false;
}
return optimizeByLowSurrogates(result);
};
var optimizeByLowSurrogates = function(surrogateMappings) {
if (surrogateMappings.length == 1) {
return surrogateMappings;
}
var index = -1;
var innerIndex = -1;
while (++index < surrogateMappings.length) {
var mapping = surrogateMappings[index];
var lowSurrogates = mapping[1];
var lowSurrogateStart = lowSurrogates[0];
var lowSurrogateEnd = lowSurrogates[1];
innerIndex = index; // Note: the loop starts at the next index.
while (++innerIndex < surrogateMappings.length) {
var otherMapping = surrogateMappings[innerIndex];
var otherLowSurrogates = otherMapping[1];
var otherLowSurrogateStart = otherLowSurrogates[0];
var otherLowSurrogateEnd = otherLowSurrogates[1];
if (
lowSurrogateStart == otherLowSurrogateStart &&
lowSurrogateEnd == otherLowSurrogateEnd
) {
// Add the code points in the other item to this one.
if (dataIsSingleton(otherMapping[0])) {
mapping[0] = dataAdd(mapping[0], otherMapping[0][0]);
} else {
mapping[0] = dataAddRange(
mapping[0],
otherMapping[0][0],
otherMapping[0][1] - 1
);
}
// Remove the other, now redundant, item.
surrogateMappings.splice(innerIndex, 1);
--innerIndex;
}
}
}
return surrogateMappings;
};
var surrogateSet = function(data) {
// Exit early if `data` is an empty set.
if (!data.length) {
return [];
}
// Iterate over the data per `(start, end)` pair.
var index = 0;
var start;
var end;
var startHigh;
var startLow;
var prevStartHigh = 0;
var prevEndHigh = 0;
var tmpLow = [];
var endHigh;
var endLow;
var surrogateMappings = [];
var length = data.length;
var dataHigh = [];
while (index < length) {
start = data[index];
end = data[index + 1] - 1;
startHigh = highSurrogate(start);
startLow = lowSurrogate(start);
endHigh = highSurrogate(end);
endLow = lowSurrogate(end);
var startsWithLowestLowSurrogate = startLow == LOW_SURROGATE_MIN;
var endsWithHighestLowSurrogate = endLow == LOW_SURROGATE_MAX;
var complete = false;
// Append the previous high-surrogate-to-low-surrogate mappings.
// Step 1: `(startHigh, startLow)` to `(startHigh, LOW_SURROGATE_MAX)`.
if (
startHigh == endHigh ||
startsWithLowestLowSurrogate && endsWithHighestLowSurrogate
) {
surrogateMappings.push([
[startHigh, endHigh + 1],
[startLow, endLow + 1]
]);
complete = true;
} else {
surrogateMappings.push([
[startHigh, startHigh + 1],
[startLow, LOW_SURROGATE_MAX + 1]
]);
}
// Step 2: `(startHigh + 1, LOW_SURROGATE_MIN)` to
// `(endHigh - 1, LOW_SURROGATE_MAX)`.
if (!complete && startHigh + 1 < endHigh) {
if (endsWithHighestLowSurrogate) {
// Combine step 2 and step 3.
surrogateMappings.push([
[startHigh + 1, endHigh + 1],
[LOW_SURROGATE_MIN, endLow + 1]
]);
complete = true;
} else {
surrogateMappings.push([
[startHigh + 1, endHigh],
[LOW_SURROGATE_MIN, LOW_SURROGATE_MAX + 1]
]);
}
}
// Step 3. `(endHigh, LOW_SURROGATE_MIN)` to `(endHigh, endLow)`.
if (!complete) {
surrogateMappings.push([
[endHigh, endHigh + 1],
[LOW_SURROGATE_MIN, endLow + 1]
]);
}
prevStartHigh = startHigh;
prevEndHigh = endHigh;
index += 2;
}
// The format of `surrogateMappings` is as follows:
//
// [ surrogateMapping1, surrogateMapping2 ]
//
// i.e.:
//
// [
// [ highSurrogates1, lowSurrogates1 ],
// [ highSurrogates2, lowSurrogates2 ]
// ]
return optimizeSurrogateMappings(surrogateMappings);
};
var createSurrogateCharacterClasses = function(surrogateMappings) {
var result = [];
forEach(surrogateMappings, function(surrogateMapping) {
var highSurrogates = surrogateMapping[0];
var lowSurrogates = surrogateMapping[1];
result.push(
createBMPCharacterClasses(highSurrogates) +
createBMPCharacterClasses(lowSurrogates)
);
});
return result.join('|');
};
var createCharacterClassesFromData = function(data, bmpOnly, hasUnicodeFlag) {
if (hasUnicodeFlag) {
return createUnicodeCharacterClasses(data);
}
var result = [];
var parts = splitAtBMP(data);
var loneHighSurrogates = parts.loneHighSurrogates;
var loneLowSurrogates = parts.loneLowSurrogates;
var bmp = parts.bmp;
var astral = parts.astral;
var hasAstral = !dataIsEmpty(parts.astral);
var hasLoneHighSurrogates = !dataIsEmpty(loneHighSurrogates);
var hasLoneLowSurrogates = !dataIsEmpty(loneLowSurrogates);
var surrogateMappings = surrogateSet(astral);
if (bmpOnly) {
bmp = dataAddData(bmp, loneHighSurrogates);
hasLoneHighSurrogates = false;
bmp = dataAddData(bmp, loneLowSurrogates);
hasLoneLowSurrogates = false;
}
if (!dataIsEmpty(bmp)) {
// The data set contains BMP code points that are not high surrogates
// needed for astral code points in the set.
result.push(createBMPCharacterClasses(bmp));
}
if (surrogateMappings.length) {
// The data set contains astral code points; append character classes
// based on their surrogate pairs.
result.push(createSurrogateCharacterClasses(surrogateMappings));
}
// https://gist.github.com/mathiasbynens/bbe7f870208abcfec860
if (hasLoneHighSurrogates) {
result.push(
createBMPCharacterClasses(loneHighSurrogates) +
// Make sure the high surrogates arent part of a surrogate pair.
'(?![\\uDC00-\\uDFFF])'
);
}
if (hasLoneLowSurrogates) {
result.push(
// It is not possible to accurately assert the low surrogates arent
// part of a surrogate pair, since JavaScript regular expressions do
// not support lookbehind.
'(?:[^\\uD800-\\uDBFF]|^)' +
createBMPCharacterClasses(loneLowSurrogates)
);
}
return result.join('|');
};
/*--------------------------------------------------------------------------*/
// `regenerate` can be used as a constructor (and new methods can be added to
// its prototype) but also as a regular function, the latter of which is the
// documented and most common usage. For that reason, its not capitalized.
var regenerate = function(value) {
if (arguments.length > 1) {
value = slice.call(arguments);
}
if (this instanceof regenerate) {
this.data = [];
return value ? this.add(value) : this;
}
return (new regenerate).add(value);
};
regenerate.version = '1.3.1';
var proto = regenerate.prototype;
extend(proto, {
'add': function(value) {
var $this = this;
if (value == null) {
return $this;
}
if (value instanceof regenerate) {
// Allow passing other Regenerate instances.
$this.data = dataAddData($this.data, value.data);
return $this;
}
if (arguments.length > 1) {
value = slice.call(arguments);
}
if (isArray(value)) {
forEach(value, function(item) {
$this.add(item);
});
return $this;
}
$this.data = dataAdd(
$this.data,
isNumber(value) ? value : symbolToCodePoint(value)
);
return $this;
},
'remove': function(value) {
var $this = this;
if (value == null) {
return $this;
}
if (value instanceof regenerate) {
// Allow passing other Regenerate instances.
$this.data = dataRemoveData($this.data, value.data);
return $this;
}
if (arguments.length > 1) {
value = slice.call(arguments);
}
if (isArray(value)) {
forEach(value, function(item) {
$this.remove(item);
});
return $this;
}
$this.data = dataRemove(
$this.data,
isNumber(value) ? value : symbolToCodePoint(value)
);
return $this;
},
'addRange': function(start, end) {
var $this = this;
$this.data = dataAddRange($this.data,
isNumber(start) ? start : symbolToCodePoint(start),
isNumber(end) ? end : symbolToCodePoint(end)
);
return $this;
},
'removeRange': function(start, end) {
var $this = this;
var startCodePoint = isNumber(start) ? start : symbolToCodePoint(start);
var endCodePoint = isNumber(end) ? end : symbolToCodePoint(end);
$this.data = dataRemoveRange(
$this.data,
startCodePoint,
endCodePoint
);
return $this;
},
'intersection': function(argument) {
var $this = this;
// Allow passing other Regenerate instances.
// TODO: Optimize this by writing and using `dataIntersectionData()`.
var array = argument instanceof regenerate ?
dataToArray(argument.data) :
argument;
$this.data = dataIntersection($this.data, array);
return $this;
},
'contains': function(codePoint) {
return dataContains(
this.data,
isNumber(codePoint) ? codePoint : symbolToCodePoint(codePoint)
);
},
'clone': function() {
var set = new regenerate;
set.data = this.data.slice(0);
return set;
},
'toString': function(options) {
var result = createCharacterClassesFromData(
this.data,
options ? options.bmpOnly : false,
options ? options.hasUnicodeFlag : false
);
if (!result) {
// For an empty set, return something that can be inserted `/here/` to
// form a valid regular expression. Avoid `(?:)` since that matches the
// empty string.
return '[]';
}
// Use `\0` instead of `\x00` where possible.
return result.replace(regexNull, '\\0$1');
},
'toRegExp': function(flags) {
var pattern = this.toString(
flags && flags.indexOf('u') != -1 ?
{ 'hasUnicodeFlag': true } :
null
);
return RegExp(pattern, flags || '');
},
'valueOf': function() { // Note: `valueOf` is aliased as `toArray`.
return dataToArray(this.data);
}
});
proto.toArray = proto.valueOf;
// Some AMD build optimizers, like r.js, check for specific condition patterns
// like the following:
if (
true
) {
!(__WEBPACK_AMD_DEFINE_RESULT__ = function() {
return regenerate;
}.call(exports, __webpack_require__, exports, module),
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
} else if (freeExports && !freeExports.nodeType) {
if (freeModule) { // in Node.js, io.js, or RingoJS v0.8.0+
freeModule.exports = regenerate;
} else { // in Narwhal or RingoJS v0.7.0-
freeExports.regenerate = regenerate;
}
} else { // in Rhino or a web browser
root.regenerate = regenerate;
}
}(__commonjs_global));
});
var require$$0$2 = (regenerate && typeof regenerate === 'object' && 'default' in regenerate ? regenerate['default'] : regenerate);
var characterClassEscapeSets = __commonjs(function (module, exports) {
// Generated by `/scripts/character-class-escape-sets.js`. Do not edit.
var regenerate = require$$0$2;
exports.REGULAR = {
'd': regenerate()
.addRange(0x30, 0x39),
'D': regenerate()
.addRange(0x0, 0x2F)
.addRange(0x3A, 0xFFFF),
's': regenerate(0x20, 0xA0, 0x1680, 0x202F, 0x205F, 0x3000, 0xFEFF)
.addRange(0x9, 0xD)
.addRange(0x2000, 0x200A)
.addRange(0x2028, 0x2029),
'S': regenerate()
.addRange(0x0, 0x8)
.addRange(0xE, 0x1F)
.addRange(0x21, 0x9F)
.addRange(0xA1, 0x167F)
.addRange(0x1681, 0x1FFF)
.addRange(0x200B, 0x2027)
.addRange(0x202A, 0x202E)
.addRange(0x2030, 0x205E)
.addRange(0x2060, 0x2FFF)
.addRange(0x3001, 0xFEFE)
.addRange(0xFF00, 0xFFFF),
'w': regenerate(0x5F)
.addRange(0x30, 0x39)
.addRange(0x41, 0x5A)
.addRange(0x61, 0x7A),
'W': regenerate(0x60)
.addRange(0x0, 0x2F)
.addRange(0x3A, 0x40)
.addRange(0x5B, 0x5E)
.addRange(0x7B, 0xFFFF)
};
exports.UNICODE = {
'd': regenerate()
.addRange(0x30, 0x39),
'D': regenerate()
.addRange(0x0, 0x2F)
.addRange(0x3A, 0x10FFFF),
's': regenerate(0x20, 0xA0, 0x1680, 0x202F, 0x205F, 0x3000, 0xFEFF)
.addRange(0x9, 0xD)
.addRange(0x2000, 0x200A)
.addRange(0x2028, 0x2029),
'S': regenerate()
.addRange(0x0, 0x8)
.addRange(0xE, 0x1F)
.addRange(0x21, 0x9F)
.addRange(0xA1, 0x167F)
.addRange(0x1681, 0x1FFF)
.addRange(0x200B, 0x2027)
.addRange(0x202A, 0x202E)
.addRange(0x2030, 0x205E)
.addRange(0x2060, 0x2FFF)
.addRange(0x3001, 0xFEFE)
.addRange(0xFF00, 0x10FFFF),
'w': regenerate(0x5F)
.addRange(0x30, 0x39)
.addRange(0x41, 0x5A)
.addRange(0x61, 0x7A),
'W': regenerate(0x60)
.addRange(0x0, 0x2F)
.addRange(0x3A, 0x40)
.addRange(0x5B, 0x5E)
.addRange(0x7B, 0x10FFFF)
};
exports.UNICODE_IGNORE_CASE = {
'd': regenerate()
.addRange(0x30, 0x39),
'D': regenerate()
.addRange(0x0, 0x2F)
.addRange(0x3A, 0x10FFFF),
's': regenerate(0x20, 0xA0, 0x1680, 0x202F, 0x205F, 0x3000, 0xFEFF)
.addRange(0x9, 0xD)
.addRange(0x2000, 0x200A)
.addRange(0x2028, 0x2029),
'S': regenerate()
.addRange(0x0, 0x8)
.addRange(0xE, 0x1F)
.addRange(0x21, 0x9F)
.addRange(0xA1, 0x167F)
.addRange(0x1681, 0x1FFF)
.addRange(0x200B, 0x2027)
.addRange(0x202A, 0x202E)
.addRange(0x2030, 0x205E)
.addRange(0x2060, 0x2FFF)
.addRange(0x3001, 0xFEFE)
.addRange(0xFF00, 0x10FFFF),
'w': regenerate(0x5F, 0x17F, 0x212A)
.addRange(0x30, 0x39)
.addRange(0x41, 0x5A)
.addRange(0x61, 0x7A),
'W': regenerate(0x4B, 0x53, 0x60)
.addRange(0x0, 0x2F)
.addRange(0x3A, 0x40)
.addRange(0x5B, 0x5E)
.addRange(0x7B, 0x10FFFF)
};
});
var require$$0$1 = (characterClassEscapeSets && typeof characterClassEscapeSets === 'object' && 'default' in characterClassEscapeSets ? characterClassEscapeSets['default'] : characterClassEscapeSets);
var require$$1 = {
"75": 8490,
"83": 383,
"107": 8490,
"115": 383,
"181": 924,
"197": 8491,
"383": 83,
"452": 453,
"453": 452,
"455": 456,
"456": 455,
"458": 459,
"459": 458,
"497": 498,
"498": 497,
"837": 8126,
"914": 976,
"917": 1013,
"920": 1012,
"921": 8126,
"922": 1008,
"924": 181,
"928": 982,
"929": 1009,
"931": 962,
"934": 981,
"937": 8486,
"962": 931,
"976": 914,
"977": 1012,
"981": 934,
"982": 928,
"1008": 922,
"1009": 929,
"1012": [920,977],
"1013": 917,
"7776": 7835,
"7835": 7776,
"8126": [837,921],
"8486": 937,
"8490": 75,
"8491": 197,
"66560": 66600,
"66561": 66601,
"66562": 66602,
"66563": 66603,
"66564": 66604,
"66565": 66605,
"66566": 66606,
"66567": 66607,
"66568": 66608,
"66569": 66609,
"66570": 66610,
"66571": 66611,
"66572": 66612,
"66573": 66613,
"66574": 66614,
"66575": 66615,
"66576": 66616,
"66577": 66617,
"66578": 66618,
"66579": 66619,
"66580": 66620,
"66581": 66621,
"66582": 66622,
"66583": 66623,
"66584": 66624,
"66585": 66625,
"66586": 66626,
"66587": 66627,
"66588": 66628,
"66589": 66629,
"66590": 66630,
"66591": 66631,
"66592": 66632,
"66593": 66633,
"66594": 66634,
"66595": 66635,
"66596": 66636,
"66597": 66637,
"66598": 66638,
"66599": 66639,
"66600": 66560,
"66601": 66561,
"66602": 66562,
"66603": 66563,
"66604": 66564,
"66605": 66565,
"66606": 66566,
"66607": 66567,
"66608": 66568,
"66609": 66569,
"66610": 66570,
"66611": 66571,
"66612": 66572,
"66613": 66573,
"66614": 66574,
"66615": 66575,
"66616": 66576,
"66617": 66577,
"66618": 66578,
"66619": 66579,
"66620": 66580,
"66621": 66581,
"66622": 66582,
"66623": 66583,
"66624": 66584,
"66625": 66585,
"66626": 66586,
"66627": 66587,
"66628": 66588,
"66629": 66589,
"66630": 66590,
"66631": 66591,
"66632": 66592,
"66633": 66593,
"66634": 66594,
"66635": 66595,
"66636": 66596,
"66637": 66597,
"66638": 66598,
"66639": 66599,
"68736": 68800,
"68737": 68801,
"68738": 68802,
"68739": 68803,
"68740": 68804,
"68741": 68805,
"68742": 68806,
"68743": 68807,
"68744": 68808,
"68745": 68809,
"68746": 68810,
"68747": 68811,
"68748": 68812,
"68749": 68813,
"68750": 68814,
"68751": 68815,
"68752": 68816,
"68753": 68817,
"68754": 68818,
"68755": 68819,
"68756": 68820,
"68757": 68821,
"68758": 68822,
"68759": 68823,
"68760": 68824,
"68761": 68825,
"68762": 68826,
"68763": 68827,
"68764": 68828,
"68765": 68829,
"68766": 68830,
"68767": 68831,
"68768": 68832,
"68769": 68833,
"68770": 68834,
"68771": 68835,
"68772": 68836,
"68773": 68837,
"68774": 68838,
"68775": 68839,
"68776": 68840,
"68777": 68841,
"68778": 68842,
"68779": 68843,
"68780": 68844,
"68781": 68845,
"68782": 68846,
"68783": 68847,
"68784": 68848,
"68785": 68849,
"68786": 68850,
"68800": 68736,
"68801": 68737,
"68802": 68738,
"68803": 68739,
"68804": 68740,
"68805": 68741,
"68806": 68742,
"68807": 68743,
"68808": 68744,
"68809": 68745,
"68810": 68746,
"68811": 68747,
"68812": 68748,
"68813": 68749,
"68814": 68750,
"68815": 68751,
"68816": 68752,
"68817": 68753,
"68818": 68754,
"68819": 68755,
"68820": 68756,
"68821": 68757,
"68822": 68758,
"68823": 68759,
"68824": 68760,
"68825": 68761,
"68826": 68762,
"68827": 68763,
"68828": 68764,
"68829": 68765,
"68830": 68766,
"68831": 68767,
"68832": 68768,
"68833": 68769,
"68834": 68770,
"68835": 68771,
"68836": 68772,
"68837": 68773,
"68838": 68774,
"68839": 68775,
"68840": 68776,
"68841": 68777,
"68842": 68778,
"68843": 68779,
"68844": 68780,
"68845": 68781,
"68846": 68782,
"68847": 68783,
"68848": 68784,
"68849": 68785,
"68850": 68786,
"71840": 71872,
"71841": 71873,
"71842": 71874,
"71843": 71875,
"71844": 71876,
"71845": 71877,
"71846": 71878,
"71847": 71879,
"71848": 71880,
"71849": 71881,
"71850": 71882,
"71851": 71883,
"71852": 71884,
"71853": 71885,
"71854": 71886,
"71855": 71887,
"71856": 71888,
"71857": 71889,
"71858": 71890,
"71859": 71891,
"71860": 71892,
"71861": 71893,
"71862": 71894,
"71863": 71895,
"71864": 71896,
"71865": 71897,
"71866": 71898,
"71867": 71899,
"71868": 71900,
"71869": 71901,
"71870": 71902,
"71871": 71903,
"71872": 71840,
"71873": 71841,
"71874": 71842,
"71875": 71843,
"71876": 71844,
"71877": 71845,
"71878": 71846,
"71879": 71847,
"71880": 71848,
"71881": 71849,
"71882": 71850,
"71883": 71851,
"71884": 71852,
"71885": 71853,
"71886": 71854,
"71887": 71855,
"71888": 71856,
"71889": 71857,
"71890": 71858,
"71891": 71859,
"71892": 71860,
"71893": 71861,
"71894": 71862,
"71895": 71863,
"71896": 71864,
"71897": 71865,
"71898": 71866,
"71899": 71867,
"71900": 71868,
"71901": 71869,
"71902": 71870,
"71903": 71871
};
var parser = __commonjs(function (module) {
// regjsparser
//
// ==================================================================
//
// See ECMA-262 Standard: 15.10.1
//
// NOTE: The ECMA-262 standard uses the term "Assertion" for /^/. Here the
// term "Anchor" is used.
//
// Pattern ::
// Disjunction
//
// Disjunction ::
// Alternative
// Alternative | Disjunction
//
// Alternative ::
// [empty]
// Alternative Term
//
// Term ::
// Anchor
// Atom
// Atom Quantifier
//
// Anchor ::
// ^
// $
// \ b
// \ B
// ( ? = Disjunction )
// ( ? ! Disjunction )
//
// Quantifier ::
// QuantifierPrefix
// QuantifierPrefix ?
//
// QuantifierPrefix ::
// *
// +
// ?
// { DecimalDigits }
// { DecimalDigits , }
// { DecimalDigits , DecimalDigits }
//
// Atom ::
// PatternCharacter
// .
// \ AtomEscape
// CharacterClass
// ( Disjunction )
// ( ? : Disjunction )
//
// PatternCharacter ::
// SourceCharacter but not any of: ^ $ \ . * + ? ( ) [ ] { } |
//
// AtomEscape ::
// DecimalEscape
// CharacterEscape
// CharacterClassEscape
//
// CharacterEscape[U] ::
// ControlEscape
// c ControlLetter
// HexEscapeSequence
// RegExpUnicodeEscapeSequence[?U] (ES6)
// IdentityEscape[?U]
//
// ControlEscape ::
// one of f n r t v
// ControlLetter ::
// one of
// a b c d e f g h i j k l m n o p q r s t u v w x y z
// A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
//
// IdentityEscape ::
// SourceCharacter but not IdentifierPart
// <ZWJ>
// <ZWNJ>
//
// DecimalEscape ::
// DecimalIntegerLiteral [lookahead ∉ DecimalDigit]
//
// CharacterClassEscape ::
// one of d D s S w W
//
// CharacterClass ::
// [ [lookahead ∉ {^}] ClassRanges ]
// [ ^ ClassRanges ]
//
// ClassRanges ::
// [empty]
// NonemptyClassRanges
//
// NonemptyClassRanges ::
// ClassAtom
// ClassAtom NonemptyClassRangesNoDash
// ClassAtom - ClassAtom ClassRanges
//
// NonemptyClassRangesNoDash ::
// ClassAtom
// ClassAtomNoDash NonemptyClassRangesNoDash
// ClassAtomNoDash - ClassAtom ClassRanges
//
// ClassAtom ::
// -
// ClassAtomNoDash
//
// ClassAtomNoDash ::
// SourceCharacter but not one of \ or ] or -
// \ ClassEscape
//
// ClassEscape ::
// DecimalEscape
// b
// CharacterEscape
// CharacterClassEscape
(function() {
function parse(str, flags) {
function addRaw(node) {
node.raw = str.substring(node.range[0], node.range[1]);
return node;
}
function updateRawStart(node, start) {
node.range[0] = start;
return addRaw(node);
}
function createAnchor(kind, rawLength) {
return addRaw({
type: 'anchor',
kind: kind,
range: [
pos - rawLength,
pos
]
});
}
function createValue(kind, codePoint, from, to) {
return addRaw({
type: 'value',
kind: kind,
codePoint: codePoint,
range: [from, to]
});
}
function createEscaped(kind, codePoint, value, fromOffset) {
fromOffset = fromOffset || 0;
return createValue(kind, codePoint, pos - (value.length + fromOffset), pos);
}
function createCharacter(matches) {
var _char = matches[0];
var first = _char.charCodeAt(0);
if (hasUnicodeFlag) {
var second;
if (_char.length === 1 && first >= 0xD800 && first <= 0xDBFF) {
second = lookahead().charCodeAt(0);
if (second >= 0xDC00 && second <= 0xDFFF) {
// Unicode surrogate pair
pos++;
return createValue(
'symbol',
(first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000,
pos - 2, pos);
}
}
}
return createValue('symbol', first, pos - 1, pos);
}
function createDisjunction(alternatives, from, to) {
return addRaw({
type: 'disjunction',
body: alternatives,
range: [
from,
to
]
});
}
function createDot() {
return addRaw({
type: 'dot',
range: [
pos - 1,
pos
]
});
}
function createCharacterClassEscape(value) {
return addRaw({
type: 'characterClassEscape',
value: value,
range: [
pos - 2,
pos
]
});
}
function createReference(matchIndex) {
return addRaw({
type: 'reference',
matchIndex: parseInt(matchIndex, 10),
range: [
pos - 1 - matchIndex.length,
pos
]
});
}
function createGroup(behavior, disjunction, from, to) {
return addRaw({
type: 'group',
behavior: behavior,
body: disjunction,
range: [
from,
to
]
});
}
function createQuantifier(min, max, from, to) {
if (to == null) {
from = pos - 1;
to = pos;
}
return addRaw({
type: 'quantifier',
min: min,
max: max,
greedy: true,
body: null, // set later on
range: [
from,
to
]
});
}
function createAlternative(terms, from, to) {
return addRaw({
type: 'alternative',
body: terms,
range: [
from,
to
]
});
}
function createCharacterClass(classRanges, negative, from, to) {
return addRaw({
type: 'characterClass',
body: classRanges,
negative: negative,
range: [
from,
to
]
});
}
function createClassRange(min, max, from, to) {
// See 15.10.2.15:
if (min.codePoint > max.codePoint) {
bail('invalid range in character class', min.raw + '-' + max.raw, from, to);
}
return addRaw({
type: 'characterClassRange',
min: min,
max: max,
range: [
from,
to
]
});
}
function flattenBody(body) {
if (body.type === 'alternative') {
return body.body;
} else {
return [body];
}
}
function isEmpty(obj) {
return obj.type === 'empty';
}
function incr(amount) {
amount = (amount || 1);
var res = str.substring(pos, pos + amount);
pos += (amount || 1);
return res;
}
function skip(value) {
if (!match(value)) {
bail('character', value);
}
}
function match(value) {
if (str.indexOf(value, pos) === pos) {
return incr(value.length);
}
}
function lookahead() {
return str[pos];
}
function current(value) {
return str.indexOf(value, pos) === pos;
}
function next(value) {
return str[pos + 1] === value;
}
function matchReg(regExp) {
var subStr = str.substring(pos);
var res = subStr.match(regExp);
if (res) {
res.range = [];
res.range[0] = pos;
incr(res[0].length);
res.range[1] = pos;
}
return res;
}
function parseDisjunction() {
// Disjunction ::
// Alternative
// Alternative | Disjunction
var res = [], from = pos;
res.push(parseAlternative());
while (match('|')) {
res.push(parseAlternative());
}
if (res.length === 1) {
return res[0];
}
return createDisjunction(res, from, pos);
}
function parseAlternative() {
var res = [], from = pos;
var term;
// Alternative ::
// [empty]
// Alternative Term
while (term = parseTerm()) {
res.push(term);
}
if (res.length === 1) {
return res[0];
}
return createAlternative(res, from, pos);
}
function parseTerm() {
// Term ::
// Anchor
// Atom
// Atom Quantifier
if (pos >= str.length || current('|') || current(')')) {
return null; /* Means: The term is empty */
}
var anchor = parseAnchor();
if (anchor) {
return anchor;
}
var atom = parseAtom();
if (!atom) {
bail('Expected atom');
}
var quantifier = parseQuantifier() || false;
if (quantifier) {
quantifier.body = flattenBody(atom);
// The quantifier contains the atom. Therefore, the beginning of the
// quantifier range is given by the beginning of the atom.
updateRawStart(quantifier, atom.range[0]);
return quantifier;
}
return atom;
}
function parseGroup(matchA, typeA, matchB, typeB) {
var type = null, from = pos;
if (match(matchA)) {
type = typeA;
} else if (match(matchB)) {
type = typeB;
} else {
return false;
}
var body = parseDisjunction();
if (!body) {
bail('Expected disjunction');
}
skip(')');
var group = createGroup(type, flattenBody(body), from, pos);
if (type == 'normal') {
// Keep track of the number of closed groups. This is required for
// parseDecimalEscape(). In case the string is parsed a second time the
// value already holds the total count and no incrementation is required.
if (firstIteration) {
closedCaptureCounter++;
}
}
return group;
}
function parseAnchor() {
// Anchor ::
// ^
// $
// \ b
// \ B
// ( ? = Disjunction )
// ( ? ! Disjunction )
var res, from = pos;
if (match('^')) {
return createAnchor('start', 1 /* rawLength */);
} else if (match('$')) {
return createAnchor('end', 1 /* rawLength */);
} else if (match('\\b')) {
return createAnchor('boundary', 2 /* rawLength */);
} else if (match('\\B')) {
return createAnchor('not-boundary', 2 /* rawLength */);
} else {
return parseGroup('(?=', 'lookahead', '(?!', 'negativeLookahead');
}
}
function parseQuantifier() {
// Quantifier ::
// QuantifierPrefix
// QuantifierPrefix ?
//
// QuantifierPrefix ::
// *
// +
// ?
// { DecimalDigits }
// { DecimalDigits , }
// { DecimalDigits , DecimalDigits }
var res, from = pos;
var quantifier;
var min, max;
if (match('*')) {
quantifier = createQuantifier(0);
}
else if (match('+')) {
quantifier = createQuantifier(1);
}
else if (match('?')) {
quantifier = createQuantifier(0, 1);
}
else if (res = matchReg(/^\{([0-9]+)\}/)) {
min = parseInt(res[1], 10);
quantifier = createQuantifier(min, min, res.range[0], res.range[1]);
}
else if (res = matchReg(/^\{([0-9]+),\}/)) {
min = parseInt(res[1], 10);
quantifier = createQuantifier(min, undefined, res.range[0], res.range[1]);
}
else if (res = matchReg(/^\{([0-9]+),([0-9]+)\}/)) {
min = parseInt(res[1], 10);
max = parseInt(res[2], 10);
if (min > max) {
bail('numbers out of order in {} quantifier', '', from, pos);
}
quantifier = createQuantifier(min, max, res.range[0], res.range[1]);
}
if (quantifier) {
if (match('?')) {
quantifier.greedy = false;
quantifier.range[1] += 1;
}
}
return quantifier;
}
function parseAtom() {
// Atom ::
// PatternCharacter
// .
// \ AtomEscape
// CharacterClass
// ( Disjunction )
// ( ? : Disjunction )
var res;
// jviereck: allow ']', '}' here as well to be compatible with browser's
// implementations: ']'.match(/]/);
// if (res = matchReg(/^[^^$\\.*+?()[\]{}|]/)) {
if (res = matchReg(/^[^^$\\.*+?(){[|]/)) {
// PatternCharacter
return createCharacter(res);
}
else if (match('.')) {
// .
return createDot();
}
else if (match('\\')) {
// \ AtomEscape
res = parseAtomEscape();
if (!res) {
bail('atomEscape');
}
return res;
}
else if (res = parseCharacterClass()) {
return res;
}
else {
// ( Disjunction )
// ( ? : Disjunction )
return parseGroup('(?:', 'ignore', '(', 'normal');
}
}
function parseUnicodeSurrogatePairEscape(firstEscape) {
if (hasUnicodeFlag) {
var first, second;
if (firstEscape.kind == 'unicodeEscape' &&
(first = firstEscape.codePoint) >= 0xD800 && first <= 0xDBFF &&
current('\\') && next('u') ) {
var prevPos = pos;
pos++;
var secondEscape = parseClassEscape();
if (secondEscape.kind == 'unicodeEscape' &&
(second = secondEscape.codePoint) >= 0xDC00 && second <= 0xDFFF) {
// Unicode surrogate pair
firstEscape.range[1] = secondEscape.range[1];
firstEscape.codePoint = (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;
firstEscape.type = 'value';
firstEscape.kind = 'unicodeCodePointEscape';
addRaw(firstEscape);
}
else {
pos = prevPos;
}
}
}
return firstEscape;
}
function parseClassEscape() {
return parseAtomEscape(true);
}
function parseAtomEscape(insideCharacterClass) {
// AtomEscape ::
// DecimalEscape
// CharacterEscape
// CharacterClassEscape
var res, from = pos;
res = parseDecimalEscape();
if (res) {
return res;
}
// For ClassEscape
if (insideCharacterClass) {
if (match('b')) {
// 15.10.2.19
// The production ClassEscape :: b evaluates by returning the
// CharSet containing the one character <BS> (Unicode value 0008).
return createEscaped('singleEscape', 0x0008, '\\b');
} else if (match('B')) {
bail('\\B not possible inside of CharacterClass', '', from);
}
}
res = parseCharacterEscape();
return res;
}
function parseDecimalEscape() {
// DecimalEscape ::
// DecimalIntegerLiteral [lookahead ∉ DecimalDigit]
// CharacterClassEscape :: one of d D s S w W
var res, match;
if (res = matchReg(/^(?!0)\d+/)) {
match = res[0];
var refIdx = parseInt(res[0], 10);
if (refIdx <= closedCaptureCounter) {
// If the number is smaller than the normal-groups found so
// far, then it is a reference...
return createReference(res[0]);
} else {
// ... otherwise it needs to be interpreted as a octal (if the
// number is in an octal format). If it is NOT octal format,
// then the slash is ignored and the number is matched later
// as normal characters.
// Recall the negative decision to decide if the input must be parsed
// a second time with the total normal-groups.
backrefDenied.push(refIdx);
// Reset the position again, as maybe only parts of the previous
// matched numbers are actual octal numbers. E.g. in '019' only
// the '01' should be matched.
incr(-res[0].length);
if (res = matchReg(/^[0-7]{1,3}/)) {
return createEscaped('octal', parseInt(res[0], 8), res[0], 1);
} else {
// If we end up here, we have a case like /\91/. Then the
// first slash is to be ignored and the 9 & 1 to be treated
// like ordinary characters. Create a character for the
// first number only here - other number-characters
// (if available) will be matched later.
res = createCharacter(matchReg(/^[89]/));
return updateRawStart(res, res.range[0] - 1);
}
}
}
// Only allow octal numbers in the following. All matched numbers start
// with a zero (if the do not, the previous if-branch is executed).
// If the number is not octal format and starts with zero (e.g. `091`)
// then only the zeros `0` is treated here and the `91` are ordinary
// characters.
// Example:
// /\091/.exec('\091')[0].length === 3
else if (res = matchReg(/^[0-7]{1,3}/)) {
match = res[0];
if (/^0{1,3}$/.test(match)) {
// If they are all zeros, then only take the first one.
return createEscaped('null', 0x0000, '0', match.length + 1);
} else {
return createEscaped('octal', parseInt(match, 8), match, 1);
}
} else if (res = matchReg(/^[dDsSwW]/)) {
return createCharacterClassEscape(res[0]);
}
return false;
}
function parseCharacterEscape() {
// CharacterEscape ::
// ControlEscape
// c ControlLetter
// HexEscapeSequence
// UnicodeEscapeSequence
// IdentityEscape
var res;
if (res = matchReg(/^[fnrtv]/)) {
// ControlEscape
var codePoint = 0;
switch (res[0]) {
case 't': codePoint = 0x009; break;
case 'n': codePoint = 0x00A; break;
case 'v': codePoint = 0x00B; break;
case 'f': codePoint = 0x00C; break;
case 'r': codePoint = 0x00D; break;
}
return createEscaped('singleEscape', codePoint, '\\' + res[0]);
} else if (res = matchReg(/^c([a-zA-Z])/)) {
// c ControlLetter
return createEscaped('controlLetter', res[1].charCodeAt(0) % 32, res[1], 2);
} else if (res = matchReg(/^x([0-9a-fA-F]{2})/)) {
// HexEscapeSequence
return createEscaped('hexadecimalEscape', parseInt(res[1], 16), res[1], 2);
} else if (res = matchReg(/^u([0-9a-fA-F]{4})/)) {
// UnicodeEscapeSequence
return parseUnicodeSurrogatePairEscape(
createEscaped('unicodeEscape', parseInt(res[1], 16), res[1], 2)
);
} else if (hasUnicodeFlag && (res = matchReg(/^u\{([0-9a-fA-F]+)\}/))) {
// RegExpUnicodeEscapeSequence (ES6 Unicode code point escape)
return createEscaped('unicodeCodePointEscape', parseInt(res[1], 16), res[1], 4);
} else {
// IdentityEscape
return parseIdentityEscape();
}
}
// Taken from the Esprima parser.
function isIdentifierPart(ch) {
// Generated by `tools/generate-identifier-regex.js`.
var NonAsciiIdentifierPart = new RegExp('[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B2\u08E4-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58\u0C59\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D60-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\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\u135D-\u135F\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\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\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA69D\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2D\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]');
return (ch === 36) || (ch === 95) || // $ (dollar) and _ (underscore)
(ch >= 65 && ch <= 90) || // A..Z
(ch >= 97 && ch <= 122) || // a..z
(ch >= 48 && ch <= 57) || // 0..9
(ch === 92) || // \ (backslash)
((ch >= 0x80) && NonAsciiIdentifierPart.test(String.fromCharCode(ch)));
}
function parseIdentityEscape() {
// IdentityEscape ::
// SourceCharacter but not IdentifierPart
// <ZWJ>
// <ZWNJ>
var ZWJ = '\u200C';
var ZWNJ = '\u200D';
var tmp;
if (!isIdentifierPart(lookahead())) {
tmp = incr();
return createEscaped('identifier', tmp.charCodeAt(0), tmp, 1);
}
if (match(ZWJ)) {
// <ZWJ>
return createEscaped('identifier', 0x200C, ZWJ);
} else if (match(ZWNJ)) {
// <ZWNJ>
return createEscaped('identifier', 0x200D, ZWNJ);
}
return null;
}
function parseCharacterClass() {
// CharacterClass ::
// [ [lookahead ∉ {^}] ClassRanges ]
// [ ^ ClassRanges ]
var res, from = pos;
if (res = matchReg(/^\[\^/)) {
res = parseClassRanges();
skip(']');
return createCharacterClass(res, true, from, pos);
} else if (match('[')) {
res = parseClassRanges();
skip(']');
return createCharacterClass(res, false, from, pos);
}
return null;
}
function parseClassRanges() {
// ClassRanges ::
// [empty]
// NonemptyClassRanges
var res;
if (current(']')) {
// Empty array means nothing insinde of the ClassRange.
return [];
} else {
res = parseNonemptyClassRanges();
if (!res) {
bail('nonEmptyClassRanges');
}
return res;
}
}
function parseHelperClassRanges(atom) {
var from, to, res;
if (current('-') && !next(']')) {
// ClassAtom - ClassAtom ClassRanges
skip('-');
res = parseClassAtom();
if (!res) {
bail('classAtom');
}
to = pos;
var classRanges = parseClassRanges();
if (!classRanges) {
bail('classRanges');
}
from = atom.range[0];
if (classRanges.type === 'empty') {
return [createClassRange(atom, res, from, to)];
}
return [createClassRange(atom, res, from, to)].concat(classRanges);
}
res = parseNonemptyClassRangesNoDash();
if (!res) {
bail('nonEmptyClassRangesNoDash');
}
return [atom].concat(res);
}
function parseNonemptyClassRanges() {
// NonemptyClassRanges ::
// ClassAtom
// ClassAtom NonemptyClassRangesNoDash
// ClassAtom - ClassAtom ClassRanges
var atom = parseClassAtom();
if (!atom) {
bail('classAtom');
}
if (current(']')) {
// ClassAtom
return [atom];
}
// ClassAtom NonemptyClassRangesNoDash
// ClassAtom - ClassAtom ClassRanges
return parseHelperClassRanges(atom);
}
function parseNonemptyClassRangesNoDash() {
// NonemptyClassRangesNoDash ::
// ClassAtom
// ClassAtomNoDash NonemptyClassRangesNoDash
// ClassAtomNoDash - ClassAtom ClassRanges
var res = parseClassAtom();
if (!res) {
bail('classAtom');
}
if (current(']')) {
// ClassAtom
return res;
}
// ClassAtomNoDash NonemptyClassRangesNoDash
// ClassAtomNoDash - ClassAtom ClassRanges
return parseHelperClassRanges(res);
}
function parseClassAtom() {
// ClassAtom ::
// -
// ClassAtomNoDash
if (match('-')) {
return createCharacter('-');
} else {
return parseClassAtomNoDash();
}
}
function parseClassAtomNoDash() {
// ClassAtomNoDash ::
// SourceCharacter but not one of \ or ] or -
// \ ClassEscape
var res;
if (res = matchReg(/^[^\\\]-]/)) {
return createCharacter(res[0]);
} else if (match('\\')) {
res = parseClassEscape();
if (!res) {
bail('classEscape');
}
return parseUnicodeSurrogatePairEscape(res);
}
}
function bail(message, details, from, to) {
from = from == null ? pos : from;
to = to == null ? from : to;
var contextStart = Math.max(0, from - 10);
var contextEnd = Math.min(to + 10, str.length);
// Output a bit of context and a line pointing to where our error is.
//
// We are assuming that there are no actual newlines in the content as this is a regular expression.
var context = ' ' + str.substring(contextStart, contextEnd);
var pointer = ' ' + new Array(from - contextStart + 1).join(' ') + '^';
throw SyntaxError(message + ' at position ' + from + (details ? ': ' + details : '') + '\n' + context + '\n' + pointer);
}
var backrefDenied = [];
var closedCaptureCounter = 0;
var firstIteration = true;
var hasUnicodeFlag = (flags || "").indexOf("u") !== -1;
var pos = 0;
// Convert the input to a string and treat the empty string special.
str = String(str);
if (str === '') {
str = '(?:)';
}
var result = parseDisjunction();
if (result.range[1] !== str.length) {
bail('Could not parse entire input - got stuck', '', result.range[1]);
}
// The spec requires to interpret the `\2` in `/\2()()/` as backreference.
// As the parser collects the number of capture groups as the string is
// parsed it is impossible to make these decisions at the point when the
// `\2` is handled. In case the local decision turns out to be wrong after
// the parsing has finished, the input string is parsed a second time with
// the total number of capture groups set.
//
// SEE: https://github.com/jviereck/regjsparser/issues/70
for (var i = 0; i < backrefDenied.length; i++) {
if (backrefDenied[i] <= closedCaptureCounter) {
// Parse the input a second time.
pos = 0;
firstIteration = false;
return parseDisjunction();
}
}
return result;
}
var regjsparser = {
parse: parse
};
if (typeof module !== 'undefined' && module.exports) {
module.exports = regjsparser;
} else {
window.regjsparser = regjsparser;
}
}());
});
var require$$3 = (parser && typeof parser === 'object' && 'default' in parser ? parser['default'] : parser);
var regjsgen = __commonjs(function (module, exports, global) {
/*!
* RegJSGen
* Copyright 2014 Benjamin Tan <https://d10.github.io/>
* Available under MIT license <http://d10.mit-license.org/>
*/
;(function() {
'use strict';
/** Used to determine if values are of the language type `Object` */
var objectTypes = {
'function': true,
'object': true
};
/** Used as a reference to the global object */
var root = (objectTypes[typeof window] && window) || this;
/** Backup possible global object */
var oldRoot = root;
/** Detect free variable `exports` */
var freeExports = objectTypes[typeof exports] && exports;
/** Detect free variable `module` */
var freeModule = objectTypes[typeof module] && module && !module.nodeType && module;
/** Detect free variable `global` from Node.js or Browserified code and use it as `root` */
var freeGlobal = freeExports && freeModule && typeof global == 'object' && global;
if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal || freeGlobal.self === freeGlobal)) {
root = freeGlobal;
}
/*--------------------------------------------------------------------------*/
/*! Based on https://mths.be/fromcodepoint v0.2.0 by @mathias */
var stringFromCharCode = String.fromCharCode;
var floor = Math.floor;
function fromCodePoint() {
var MAX_SIZE = 0x4000;
var codeUnits = [];
var highSurrogate;
var lowSurrogate;
var index = -1;
var length = arguments.length;
if (!length) {
return '';
}
var result = '';
while (++index < length) {
var codePoint = Number(arguments[index]);
if (
!isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity`
codePoint < 0 || // not a valid Unicode code point
codePoint > 0x10FFFF || // not a valid Unicode code point
floor(codePoint) != codePoint // not an integer
) {
throw RangeError('Invalid code point: ' + codePoint);
}
if (codePoint <= 0xFFFF) {
// BMP code point
codeUnits.push(codePoint);
} else {
// Astral code point; split in surrogate halves
// http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
codePoint -= 0x10000;
highSurrogate = (codePoint >> 10) + 0xD800;
lowSurrogate = (codePoint % 0x400) + 0xDC00;
codeUnits.push(highSurrogate, lowSurrogate);
}
if (index + 1 == length || codeUnits.length > MAX_SIZE) {
result += stringFromCharCode.apply(null, codeUnits);
codeUnits.length = 0;
}
}
return result;
}
function assertType(type, expected) {
if (expected.indexOf('|') == -1) {
if (type == expected) {
return;
}
throw Error('Invalid node type: ' + type);
}
expected = assertType.hasOwnProperty(expected)
? assertType[expected]
: (assertType[expected] = RegExp('^(?:' + expected + ')$'));
if (expected.test(type)) {
return;
}
throw Error('Invalid node type: ' + type);
}
/*--------------------------------------------------------------------------*/
function generate(node) {
var type = node.type;
if (generate.hasOwnProperty(type) && typeof generate[type] == 'function') {
return generate[type](node);
}
throw Error('Invalid node type: ' + type);
}
/*--------------------------------------------------------------------------*/
function generateAlternative(node) {
assertType(node.type, 'alternative');
var terms = node.body,
length = terms ? terms.length : 0;
if (length == 1) {
return generateTerm(terms[0]);
} else {
var i = -1,
result = '';
while (++i < length) {
result += generateTerm(terms[i]);
}
return result;
}
}
function generateAnchor(node) {
assertType(node.type, 'anchor');
switch (node.kind) {
case 'start':
return '^';
case 'end':
return '$';
case 'boundary':
return '\\b';
case 'not-boundary':
return '\\B';
default:
throw Error('Invalid assertion');
}
}
function generateAtom(node) {
assertType(node.type, 'anchor|characterClass|characterClassEscape|dot|group|reference|value');
return generate(node);
}
function generateCharacterClass(node) {
assertType(node.type, 'characterClass');
var classRanges = node.body,
length = classRanges ? classRanges.length : 0;
var i = -1,
result = '[';
if (node.negative) {
result += '^';
}
while (++i < length) {
result += generateClassAtom(classRanges[i]);
}
result += ']';
return result;
}
function generateCharacterClassEscape(node) {
assertType(node.type, 'characterClassEscape');
return '\\' + node.value;
}
function generateCharacterClassRange(node) {
assertType(node.type, 'characterClassRange');
var min = node.min,
max = node.max;
if (min.type == 'characterClassRange' || max.type == 'characterClassRange') {
throw Error('Invalid character class range');
}
return generateClassAtom(min) + '-' + generateClassAtom(max);
}
function generateClassAtom(node) {
assertType(node.type, 'anchor|characterClassEscape|characterClassRange|dot|value');
return generate(node);
}
function generateDisjunction(node) {
assertType(node.type, 'disjunction');
var body = node.body,
length = body ? body.length : 0;
if (length == 0) {
throw Error('No body');
} else if (length == 1) {
return generate(body[0]);
} else {
var i = -1,
result = '';
while (++i < length) {
if (i != 0) {
result += '|';
}
result += generate(body[i]);
}
return result;
}
}
function generateDot(node) {
assertType(node.type, 'dot');
return '.';
}
function generateGroup(node) {
assertType(node.type, 'group');
var result = '(';
switch (node.behavior) {
case 'normal':
break;
case 'ignore':
result += '?:';
break;
case 'lookahead':
result += '?=';
break;
case 'negativeLookahead':
result += '?!';
break;
default:
throw Error('Invalid behaviour: ' + node.behaviour);
}
var body = node.body,
length = body ? body.length : 0;
if (length == 1) {
result += generate(body[0]);
} else {
var i = -1;
while (++i < length) {
result += generate(body[i]);
}
}
result += ')';
return result;
}
function generateQuantifier(node) {
assertType(node.type, 'quantifier');
var quantifier = '',
min = node.min,
max = node.max;
switch (max) {
case undefined:
case null:
switch (min) {
case 0:
quantifier = '*'
break;
case 1:
quantifier = '+';
break;
default:
quantifier = '{' + min + ',}';
break;
}
break;
default:
if (min == max) {
quantifier = '{' + min + '}';
}
else if (min == 0 && max == 1) {
quantifier = '?';
} else {
quantifier = '{' + min + ',' + max + '}';
}
break;
}
if (!node.greedy) {
quantifier += '?';
}
return generateAtom(node.body[0]) + quantifier;
}
function generateReference(node) {
assertType(node.type, 'reference');
return '\\' + node.matchIndex;
}
function generateTerm(node) {
assertType(node.type, 'anchor|characterClass|characterClassEscape|empty|group|quantifier|reference|value');
return generate(node);
}
function generateValue(node) {
assertType(node.type, 'value');
var kind = node.kind,
codePoint = node.codePoint;
switch (kind) {
case 'controlLetter':
return '\\c' + fromCodePoint(codePoint + 64);
case 'hexadecimalEscape':
return '\\x' + ('00' + codePoint.toString(16).toUpperCase()).slice(-2);
case 'identifier':
return '\\' + fromCodePoint(codePoint);
case 'null':
return '\\' + codePoint;
case 'octal':
return '\\' + codePoint.toString(8);
case 'singleEscape':
switch (codePoint) {
case 0x0008:
return '\\b';
case 0x009:
return '\\t';
case 0x00A:
return '\\n';
case 0x00B:
return '\\v';
case 0x00C:
return '\\f';
case 0x00D:
return '\\r';
default:
throw Error('Invalid codepoint: ' + codePoint);
}
case 'symbol':
return fromCodePoint(codePoint);
case 'unicodeEscape':
return '\\u' + ('0000' + codePoint.toString(16).toUpperCase()).slice(-4);
case 'unicodeCodePointEscape':
return '\\u{' + codePoint.toString(16).toUpperCase() + '}';
default:
throw Error('Unsupported node kind: ' + kind);
}
}
/*--------------------------------------------------------------------------*/
generate.alternative = generateAlternative;
generate.anchor = generateAnchor;
generate.characterClass = generateCharacterClass;
generate.characterClassEscape = generateCharacterClassEscape;
generate.characterClassRange = generateCharacterClassRange;
generate.disjunction = generateDisjunction;
generate.dot = generateDot;
generate.group = generateGroup;
generate.quantifier = generateQuantifier;
generate.reference = generateReference;
generate.value = generateValue;
/*--------------------------------------------------------------------------*/
// export regjsgen
// some AMD build optimizers, like r.js, check for condition patterns like the following:
if (true) {
// define as an anonymous module so, through path mapping, it can be aliased
!(__WEBPACK_AMD_DEFINE_RESULT__ = function() {
return {
'generate': generate
};
}.call(exports, __webpack_require__, exports, module),
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
}
// check for `exports` after `define` in case a build optimizer adds an `exports` object
else if (freeExports && freeModule) {
// in Narwhal, Node.js, Rhino -require, or RingoJS
freeExports.generate = generate;
}
// in a browser or Rhino
else {
root.regjsgen = {
'generate': generate
};
}
}.call(__commonjs_global));
});
var require$$4 = (regjsgen && typeof regjsgen === 'object' && 'default' in regjsgen ? regjsgen['default'] : regjsgen);
var rewritePattern = __commonjs(function (module) {
var generate = require$$4.generate;
var parse = require$$3.parse;
var regenerate = require$$0$2;
var iuMappings = require$$1;
var ESCAPE_SETS = require$$0$1;
function getCharacterClassEscapeSet(character) {
if (unicode) {
if (ignoreCase) {
return ESCAPE_SETS.UNICODE_IGNORE_CASE[character];
}
return ESCAPE_SETS.UNICODE[character];
}
return ESCAPE_SETS.REGULAR[character];
}
var object = {};
var hasOwnProperty = object.hasOwnProperty;
function has(object, property) {
return hasOwnProperty.call(object, property);
}
// Prepare a Regenerate set containing all code points, used for negative
// character classes (if any).
var UNICODE_SET = regenerate().addRange(0x0, 0x10FFFF);
// Without the `u` flag, the range stops at 0xFFFF.
// https://mths.be/es6#sec-pattern-semantics
var BMP_SET = regenerate().addRange(0x0, 0xFFFF);
// Prepare a Regenerate set containing all code points that are supposed to be
// matched by `/./u`. https://mths.be/es6#sec-atom
var DOT_SET_UNICODE = UNICODE_SET.clone() // all Unicode code points
.remove(
// minus `LineTerminator`s (https://mths.be/es6#sec-line-terminators):
0x000A, // Line Feed <LF>
0x000D, // Carriage Return <CR>
0x2028, // Line Separator <LS>
0x2029 // Paragraph Separator <PS>
);
// Prepare a Regenerate set containing all code points that are supposed to be
// matched by `/./` (only BMP code points).
var DOT_SET = DOT_SET_UNICODE.clone()
.intersection(BMP_SET);
// Add a range of code points + any case-folded code points in that range to a
// set.
regenerate.prototype.iuAddRange = function(min, max) {
var $this = this;
do {
var folded = caseFold(min);
if (folded) {
$this.add(folded);
}
} while (++min <= max);
return $this;
};
function assign(target, source) {
for (var key in source) {
// Note: `hasOwnProperty` is not needed here.
target[key] = source[key];
}
}
function update(item, pattern) {
// TODO: Test if memoizing `pattern` here is worth the effort.
if (!pattern) {
return;
}
var tree = parse(pattern, '');
switch (tree.type) {
case 'characterClass':
case 'group':
case 'value':
// No wrapping needed.
break;
default:
// Wrap the pattern in a non-capturing group.
tree = wrap(tree, pattern);
}
assign(item, tree);
}
function wrap(tree, pattern) {
// Wrap the pattern in a non-capturing group.
return {
'type': 'group',
'behavior': 'ignore',
'body': [tree],
'raw': '(?:' + pattern + ')'
};
}
function caseFold(codePoint) {
return has(iuMappings, codePoint) ? iuMappings[codePoint] : false;
}
var ignoreCase = false;
var unicode = false;
function processCharacterClass(characterClassItem) {
var set = regenerate();
var body = characterClassItem.body.forEach(function(item) {
switch (item.type) {
case 'value':
set.add(item.codePoint);
if (ignoreCase && unicode) {
var folded = caseFold(item.codePoint);
if (folded) {
set.add(folded);
}
}
break;
case 'characterClassRange':
var min = item.min.codePoint;
var max = item.max.codePoint;
set.addRange(min, max);
if (ignoreCase && unicode) {
set.iuAddRange(min, max);
}
break;
case 'characterClassEscape':
set.add(getCharacterClassEscapeSet(item.value));
break;
// The `default` clause is only here as a safeguard; it should never be
// reached. Code coverage tools should ignore it.
/* istanbul ignore next */
default:
throw Error('Unknown term type: ' + item.type);
}
});
if (characterClassItem.negative) {
set = (unicode ? UNICODE_SET : BMP_SET).clone().remove(set);
}
update(characterClassItem, set.toString());
return characterClassItem;
}
function processTerm(item) {
switch (item.type) {
case 'dot':
update(
item,
(unicode ? DOT_SET_UNICODE : DOT_SET).toString()
);
break;
case 'characterClass':
item = processCharacterClass(item);
break;
case 'characterClassEscape':
update(
item,
getCharacterClassEscapeSet(item.value).toString()
);
break;
case 'alternative':
case 'disjunction':
case 'group':
case 'quantifier':
item.body = item.body.map(processTerm);
break;
case 'value':
var codePoint = item.codePoint;
var set = regenerate(codePoint);
if (ignoreCase && unicode) {
var folded = caseFold(codePoint);
if (folded) {
set.add(folded);
}
}
update(item, set.toString());
break;
case 'anchor':
case 'empty':
case 'group':
case 'reference':
// Nothing to do here.
break;
// The `default` clause is only here as a safeguard; it should never be
// reached. Code coverage tools should ignore it.
/* istanbul ignore next */
default:
throw Error('Unknown term type: ' + item.type);
}
return item;
};
module.exports = function(pattern, flags) {
var tree = parse(pattern, flags);
ignoreCase = flags ? flags.indexOf('i') > -1 : false;
unicode = flags ? flags.indexOf('u') > -1 : false;
assign(tree, processTerm(tree));
return generate(tree);
};
});
var rewritePattern$1 = (rewritePattern && typeof rewritePattern === 'object' && 'default' in rewritePattern ? rewritePattern['default'] : rewritePattern);
var Literal = (function (Node) {
function Literal () {
Node.apply(this, arguments);
}
if ( Node ) Literal.__proto__ = Node;
Literal.prototype = Object.create( Node && Node.prototype );
Literal.prototype.constructor = Literal;
Literal.prototype.initialise = function initialise () {
if ( typeof this.value === 'string' ) {
this.program.indentExclusionElements.push( this );
}
};
Literal.prototype.transpile = function transpile ( code, transforms ) {
if ( transforms.numericLiteral ) {
var leading = this.raw.slice( 0, 2 );
if ( leading === '0b' || leading === '0o' ) {
code.overwrite( this.start, this.end, String( this.value ), true );
}
}
if ( this.regex ) {
var ref = this.regex;
var pattern = ref.pattern;
var flags = ref.flags;
if ( transforms.stickyRegExp && /y/.test( flags ) ) throw new CompileError( this, 'Regular expression sticky flag is not supported' );
if ( transforms.unicodeRegExp && /u/.test( flags ) ) {
code.overwrite( this.start, this.end, ("/" + (rewritePattern$1( pattern, flags )) + "/" + (flags.replace( 'u', '' ))) );
}
}
};
return Literal;
}(Node));
var MemberExpression = (function (Node) {
function MemberExpression () {
Node.apply(this, arguments);
}
if ( Node ) MemberExpression.__proto__ = Node;
MemberExpression.prototype = Object.create( Node && Node.prototype );
MemberExpression.prototype.constructor = MemberExpression;
MemberExpression.prototype.transpile = function transpile ( code, transforms ) {
if ( transforms.reservedProperties && reserved[ this.property.name ] ) {
code.overwrite( this.object.end, this.property.start, "['" );
code.insertLeft( this.property.end, "']" );
}
Node.prototype.transpile.call( this, code, transforms );
};
return MemberExpression;
}(Node));
var NewExpression = (function (Node) {
function NewExpression () {
Node.apply(this, arguments);
}
if ( Node ) NewExpression.__proto__ = Node;
NewExpression.prototype = Object.create( Node && Node.prototype );
NewExpression.prototype.constructor = NewExpression;
NewExpression.prototype.initialise = function initialise ( transforms ) {
var this$1 = this;
if ( transforms.spreadRest && this.arguments.length ) {
var lexicalBoundary = this.findLexicalBoundary();
var i = this.arguments.length;
while ( i-- ) {
var arg = this$1.arguments[i];
if ( arg.type === 'SpreadElement' && isArguments( arg.argument ) ) {
this$1.argumentsArrayAlias = lexicalBoundary.getArgumentsArrayAlias();
break;
}
}
}
Node.prototype.initialise.call( this, transforms );
};
NewExpression.prototype.transpile = function transpile ( code, transforms ) {
if ( transforms.spreadRest && this.arguments.length ) {
var firstArgument = this.arguments[0];
var isNew = true;
var hasSpreadElements = spread( code, this.arguments, firstArgument.start, this.argumentsArrayAlias, isNew );
if ( hasSpreadElements ) {
code.insertRight( this.start + 'new'.length, ' (Function.prototype.bind.apply(' );
code.overwrite( this.callee.end, firstArgument.start, ', [ null ].concat( ' );
code.insertLeft( this.end, ' ))' );
}
}
Node.prototype.transpile.call( this, code, transforms );
};
return NewExpression;
}(Node));
var ObjectExpression = (function (Node) {
function ObjectExpression () {
Node.apply(this, arguments);
}
if ( Node ) ObjectExpression.__proto__ = Node;
ObjectExpression.prototype = Object.create( Node && Node.prototype );
ObjectExpression.prototype.constructor = ObjectExpression;
ObjectExpression.prototype.transpile = function transpile ( code, transforms ) {
var this$1 = this;
Node.prototype.transpile.call( this, code, transforms );
var firstPropertyStart = this.start + 1;
var regularPropertyCount = 0;
var spreadPropertyCount = 0;
var computedPropertyCount = 0;
for ( var i$2 = 0, list = this.properties; i$2 < list.length; i$2 += 1 ) {
var prop = list[i$2];
if ( prop.type === 'SpreadProperty' ) {
spreadPropertyCount += 1;
} else if ( prop.computed ) {
computedPropertyCount += 1;
} else if ( prop.type === 'Property' ) {
regularPropertyCount += 1;
}
}
if ( spreadPropertyCount ) {
if ( !this.program.options.objectAssign ) {
throw new CompileError( this, 'Object spread operator requires specified objectAssign option with \'Object.assign\' or polyfill helper.' );
}
// enclose run of non-spread properties in curlies
var i = this.properties.length;
if ( regularPropertyCount ) {
while ( i-- ) {
var prop$1 = this$1.properties[i];
if ( prop$1.type === 'Property' && !prop$1.computed ) {
var lastProp = this$1.properties[ i - 1 ];
var nextProp = this$1.properties[ i + 1 ];
if ( !lastProp || lastProp.type !== 'Property' || lastProp.computed ) {
code.insertRight( prop$1.start, '{' );
}
if ( !nextProp || nextProp.type !== 'Property' || nextProp.computed ) {
code.insertLeft( prop$1.end, '}' );
}
}
}
}
// wrap the whole thing in Object.assign
firstPropertyStart = this.properties[0].start;
code.overwrite( this.start, firstPropertyStart, ((this.program.options.objectAssign) + "({}, "));
code.overwrite( this.properties[ this.properties.length - 1 ].end, this.end, ')' );
}
if ( computedPropertyCount && transforms.computedProperty ) {
var i0 = this.getIndentation();
var isSimpleAssignment;
var name;
if ( this.parent.type === 'VariableDeclarator' && this.parent.parent.declarations.length === 1 ) {
isSimpleAssignment = true;
name = this.parent.id.alias || this.parent.id.name; // TODO is this right?
} else if ( this.parent.type === 'AssignmentExpression' && this.parent.parent.type === 'ExpressionStatement' && this.parent.left.type === 'Identifier' ) {
isSimpleAssignment = true;
name = this.parent.left.alias || this.parent.left.name; // TODO is this right?
} else if ( this.parent.type === 'AssignmentPattern' && this.parent.left.type === 'Identifier' ) {
isSimpleAssignment = true;
name = this.parent.left.alias || this.parent.left.name; // TODO is this right?
}
// handle block scoping
var declaration = this.findScope( false ).findDeclaration( name );
if ( declaration ) name = declaration.name;
var start = firstPropertyStart;
var end = this.end;
if ( isSimpleAssignment ) {
// ???
} else {
name = this.findScope( true ).createIdentifier( 'obj' );
var statement = this.findNearest( /(?:Statement|Declaration)$/ );
code.insertLeft( statement.end, ("\n" + i0 + "var " + name + ";") );
code.insertRight( this.start, ("( " + name + " = ") );
}
var len = this.properties.length;
var lastComputedProp;
var sawNonComputedProperty = false;
for ( var i$1 = 0; i$1 < len; i$1 += 1 ) {
var prop$2 = this$1.properties[i$1];
if ( prop$2.computed ) {
lastComputedProp = prop$2;
var moveStart = i$1 > 0 ? this$1.properties[ i$1 - 1 ].end : start;
var propId = isSimpleAssignment ? (";\n" + i0 + name) : (", " + name);
if (moveStart < prop$2.start) {
code.overwrite( moveStart, prop$2.start, propId );
} else {
code.insertRight( prop$2.start, propId );
}
var c = prop$2.key.end;
while ( code.original[c] !== ']' ) c += 1;
c += 1;
if ( prop$2.value.start > c ) code.remove( c, prop$2.value.start );
code.insertLeft( c, ' = ' );
code.move( moveStart, prop$2.end, end );
if ( i$1 < len - 1 && ! sawNonComputedProperty ) {
// remove trailing comma
c = prop$2.end;
while ( code.original[c] !== ',' ) c += 1;
code.remove( prop$2.end, c + 1 );
}
if ( prop$2.method && transforms.conciseMethodProperty ) {
code.insertRight( prop$2.value.start, 'function ' );
}
} else {
sawNonComputedProperty = true;
}
}
// special case
if ( computedPropertyCount === len ) {
code.remove( this.properties[ len - 1 ].end, this.end - 1 );
}
if ( !isSimpleAssignment ) {
code.insertLeft( lastComputedProp.end, (", " + name + " )") );
}
}
};
return ObjectExpression;
}(Node));
var Property = (function (Node) {
function Property () {
Node.apply(this, arguments);
}
if ( Node ) Property.__proto__ = Node;
Property.prototype = Object.create( Node && Node.prototype );
Property.prototype.constructor = Property;
Property.prototype.transpile = function transpile ( code, transforms ) {
if ( transforms.conciseMethodProperty && !this.computed && this.parent.type !== 'ObjectPattern' ) {
if ( this.shorthand ) {
code.insertRight( this.start, ((this.key.name) + ": ") );
} else if ( this.method ) {
var name = '';
if ( this.program.options.namedFunctionExpressions !== false ) {
if ( this.key.type === 'Literal' && typeof this.key.value === 'number' ) {
name = "";
} else if ( this.key.type === 'Identifier' ) {
if ( reserved[ this.key.name ] ||
! /^[a-z_$][a-z0-9_$]*$/i.test( this.key.name ) ||
this.value.body.scope.references[this.key.name] ) {
name = this.findScope( true ).createIdentifier( this.key.name );
} else {
name = this.key.name;
}
} else {
name = this.findScope( true ).createIdentifier( this.key.value );
}
name = ' ' + name;
}
if ( this.value.generator ) code.remove( this.start, this.key.start );
code.insertLeft( this.key.end, (": function" + (this.value.generator ? '*' : '') + name) );
}
}
if ( transforms.reservedProperties && reserved[ this.key.name ] ) {
code.insertRight( this.key.start, "'" );
code.insertLeft( this.key.end, "'" );
}
Node.prototype.transpile.call( this, code, transforms );
};
return Property;
}(Node));
var ReturnStatement = (function (Node) {
function ReturnStatement () {
Node.apply(this, arguments);
}
if ( Node ) ReturnStatement.__proto__ = Node;
ReturnStatement.prototype = Object.create( Node && Node.prototype );
ReturnStatement.prototype.constructor = ReturnStatement;
ReturnStatement.prototype.initialise = function initialise ( transforms ) {
this.loop = this.findNearest( loopStatement );
this.nearestFunction = this.findNearest( /Function/ );
if ( this.loop && ( !this.nearestFunction || this.loop.depth > this.nearestFunction.depth ) ) {
this.loop.canReturn = true;
this.shouldWrap = true;
}
if ( this.argument ) this.argument.initialise( transforms );
};
ReturnStatement.prototype.transpile = function transpile ( code, transforms ) {
var shouldWrap = this.shouldWrap && this.loop && this.loop.shouldRewriteAsFunction;
if ( this.argument ) {
if ( shouldWrap ) code.insertRight( this.argument.start, "{ v: " );
this.argument.transpile( code, transforms );
if ( shouldWrap ) code.insertLeft( this.argument.end, " }" );
} else if ( shouldWrap ) {
code.insertLeft( this.start + 6, ' {}' );
}
};
return ReturnStatement;
}(Node));
var SpreadProperty = (function (Node) {
function SpreadProperty () {
Node.apply(this, arguments);
}
if ( Node ) SpreadProperty.__proto__ = Node;
SpreadProperty.prototype = Object.create( Node && Node.prototype );
SpreadProperty.prototype.constructor = SpreadProperty;
SpreadProperty.prototype.transpile = function transpile ( code, transforms ) {
code.remove( this.start, this.argument.start );
code.remove( this.argument.end, this.end );
Node.prototype.transpile.call( this, code, transforms );
};
return SpreadProperty;
}(Node));
var Super = (function (Node) {
function Super () {
Node.apply(this, arguments);
}
if ( Node ) Super.__proto__ = Node;
Super.prototype = Object.create( Node && Node.prototype );
Super.prototype.constructor = Super;
Super.prototype.initialise = function initialise ( transforms ) {
if ( transforms.classes ) {
this.method = this.findNearest( 'MethodDefinition' );
if ( !this.method ) throw new CompileError( this, 'use of super outside class method' );
var parentClass = this.findNearest( 'ClassBody' ).parent;
this.superClassName = parentClass.superClass && (parentClass.superClass.name || 'superclass');
if ( !this.superClassName ) throw new CompileError( this, 'super used in base class' );
this.isCalled = this.parent.type === 'CallExpression' && this === this.parent.callee;
if ( this.method.kind !== 'constructor' && this.isCalled ) {
throw new CompileError( this, 'super() not allowed outside class constructor' );
}
this.isMember = this.parent.type === 'MemberExpression';
if ( !this.isCalled && !this.isMember ) {
throw new CompileError( this, 'Unexpected use of `super` (expected `super(...)` or `super.*`)' );
}
}
if ( transforms.arrow ) {
var lexicalBoundary = this.findLexicalBoundary();
var arrowFunction = this.findNearest( 'ArrowFunctionExpression' );
var loop = this.findNearest( loopStatement );
if ( arrowFunction && arrowFunction.depth > lexicalBoundary.depth ) {
this.thisAlias = lexicalBoundary.getThisAlias();
}
if ( loop && loop.body.contains( this ) && loop.depth > lexicalBoundary.depth ) {
this.thisAlias = lexicalBoundary.getThisAlias();
}
}
};
Super.prototype.transpile = function transpile ( code, transforms ) {
if ( transforms.classes ) {
var expression = ( this.isCalled || this.method.static ) ?
this.superClassName :
((this.superClassName) + ".prototype");
code.overwrite( this.start, this.end, expression, true );
var callExpression = this.isCalled ? this.parent : this.parent.parent;
if ( callExpression && callExpression.type === 'CallExpression' ) {
if ( !this.noCall ) { // special case `super( ...args )`
code.insertLeft( callExpression.callee.end, '.call' );
}
var thisAlias = this.thisAlias || 'this';
if ( callExpression.arguments.length ) {
code.insertLeft( callExpression.arguments[0].start, (thisAlias + ", ") );
} else {
code.insertLeft( callExpression.end - 1, ("" + thisAlias) );
}
}
}
};
return Super;
}(Node));
var TaggedTemplateExpression = (function (Node) {
function TaggedTemplateExpression () {
Node.apply(this, arguments);
}
if ( Node ) TaggedTemplateExpression.__proto__ = Node;
TaggedTemplateExpression.prototype = Object.create( Node && Node.prototype );
TaggedTemplateExpression.prototype.constructor = TaggedTemplateExpression;
TaggedTemplateExpression.prototype.initialise = function initialise ( transforms ) {
if ( transforms.templateString && !transforms.dangerousTaggedTemplateString ) {
throw new CompileError( this, 'Tagged template strings are not supported. Use `transforms: { templateString: false }` to skip transformation and disable this error, or `transforms: { dangerousTaggedTemplateString: true }` if you know what you\'re doing' );
}
Node.prototype.initialise.call( this, transforms );
};
TaggedTemplateExpression.prototype.transpile = function transpile ( code, transforms ) {
if ( transforms.templateString && transforms.dangerousTaggedTemplateString ) {
var ordered = this.quasi.expressions.concat( this.quasi.quasis ).sort( function ( a, b ) { return a.start - b.start; } );
// insert strings at start
var templateStrings = this.quasi.quasis.map( function ( quasi ) { return JSON.stringify( quasi.value.cooked ); } );
code.overwrite( this.tag.end, ordered[0].start, ("([" + (templateStrings.join(', ')) + "]") );
var lastIndex = ordered[0].start;
ordered.forEach( function ( node ) {
if ( node.type === 'TemplateElement' ) {
code.remove( lastIndex, node.end );
} else {
code.overwrite( lastIndex, node.start, ', ' );
}
lastIndex = node.end;
});
code.overwrite( lastIndex, this.end, ')' );
}
Node.prototype.transpile.call( this, code, transforms );
};
return TaggedTemplateExpression;
}(Node));
var TemplateElement = (function (Node) {
function TemplateElement () {
Node.apply(this, arguments);
}
if ( Node ) TemplateElement.__proto__ = Node;
TemplateElement.prototype = Object.create( Node && Node.prototype );
TemplateElement.prototype.constructor = TemplateElement;
TemplateElement.prototype.initialise = function initialise () {
this.program.indentExclusionElements.push( this );
};
return TemplateElement;
}(Node));
var TemplateLiteral = (function (Node) {
function TemplateLiteral () {
Node.apply(this, arguments);
}
if ( Node ) TemplateLiteral.__proto__ = Node;
TemplateLiteral.prototype = Object.create( Node && Node.prototype );
TemplateLiteral.prototype.constructor = TemplateLiteral;
TemplateLiteral.prototype.transpile = function transpile ( code, transforms ) {
if ( transforms.templateString && this.parent.type !== 'TaggedTemplateExpression' ) {
var ordered = this.expressions.concat( this.quasis )
.sort( function ( a, b ) { return a.start - b.start || a.end - b.end; } )
.filter( function ( node, i ) {
// include all expressions
if ( node.type !== 'TemplateElement' ) return true;
// include all non-empty strings
if ( node.value.raw ) return true;
// exclude all empty strings not at the head
return !i;
});
// special case we may be able to skip the first element,
// if it's the empty string, but only if the second and
// third elements aren't both expressions (since they maybe
// be numeric, and `1 + 2 + '3' === '33'`)
if ( ordered.length >= 3 ) {
var first = ordered[0];
var third = ordered[2];
if ( first.type === 'TemplateElement' && first.value.raw === '' && third.type === 'TemplateElement' ) {
ordered.shift();
}
}
var parenthesise = ( this.quasis.length !== 1 || this.expressions.length !== 0 ) &&
this.parent.type !== 'AssignmentExpression' &&
this.parent.type !== 'AssignmentPattern' &&
this.parent.type !== 'VariableDeclarator' &&
( this.parent.type !== 'BinaryExpression' || this.parent.operator !== '+' );
if ( parenthesise ) code.insertRight( this.start, '(' );
var lastIndex = this.start;
ordered.forEach( function ( node, i ) {
if ( node.type === 'TemplateElement' ) {
var replacement = '';
if ( i ) replacement += ' + ';
replacement += JSON.stringify( node.value.cooked );
code.overwrite( lastIndex, node.end, replacement );
} else {
var parenthesise = node.type !== 'Identifier'; // TODO other cases where it's safe
var replacement$1 = '';
if ( i ) replacement$1 += ' + ';
if ( parenthesise ) replacement$1 += '(';
code.overwrite( lastIndex, node.start, replacement$1 );
if ( parenthesise ) code.insertLeft( node.end, ')' );
}
lastIndex = node.end;
});
var close = '';
if ( parenthesise ) close += ')';
code.overwrite( lastIndex, this.end, close );
}
Node.prototype.transpile.call( this, code, transforms );
};
return TemplateLiteral;
}(Node));
var ThisExpression = (function (Node) {
function ThisExpression () {
Node.apply(this, arguments);
}
if ( Node ) ThisExpression.__proto__ = Node;
ThisExpression.prototype = Object.create( Node && Node.prototype );
ThisExpression.prototype.constructor = ThisExpression;
ThisExpression.prototype.initialise = function initialise ( transforms ) {
if ( transforms.arrow ) {
var lexicalBoundary = this.findLexicalBoundary();
var arrowFunction = this.findNearest( 'ArrowFunctionExpression' );
var loop = this.findNearest( loopStatement );
if ( ( arrowFunction && arrowFunction.depth > lexicalBoundary.depth )
|| ( loop && loop.body.contains( this ) && loop.depth > lexicalBoundary.depth )
|| ( loop && loop.right && loop.right.contains( this ) ) ) {
this.alias = lexicalBoundary.getThisAlias();
}
}
};
ThisExpression.prototype.transpile = function transpile ( code ) {
if ( this.alias ) {
code.overwrite( this.start, this.end, this.alias, true );
}
};
return ThisExpression;
}(Node));
var UpdateExpression = (function (Node) {
function UpdateExpression () {
Node.apply(this, arguments);
}
if ( Node ) UpdateExpression.__proto__ = Node;
UpdateExpression.prototype = Object.create( Node && Node.prototype );
UpdateExpression.prototype.constructor = UpdateExpression;
UpdateExpression.prototype.initialise = function initialise ( transforms ) {
if ( this.argument.type === 'Identifier' ) {
var declaration = this.findScope( false ).findDeclaration( this.argument.name );
if ( declaration && declaration.kind === 'const' ) {
throw new CompileError( this, ((this.argument.name) + " is read-only") );
}
// special case https://gitlab.com/Rich-Harris/buble/issues/150
var statement = declaration && declaration.node.ancestor( 3 );
if ( statement && statement.type === 'ForStatement' && statement.body.contains( this ) ) {
statement.reassigned[ this.argument.name ] = true;
}
}
Node.prototype.initialise.call( this, transforms );
};
return UpdateExpression;
}(Node));
var VariableDeclaration = (function (Node) {
function VariableDeclaration () {
Node.apply(this, arguments);
}
if ( Node ) VariableDeclaration.__proto__ = Node;
VariableDeclaration.prototype = Object.create( Node && Node.prototype );
VariableDeclaration.prototype.constructor = VariableDeclaration;
VariableDeclaration.prototype.initialise = function initialise ( transforms ) {
this.scope = this.findScope( this.kind === 'var' );
this.declarations.forEach( function ( declarator ) { return declarator.initialise( transforms ); } );
};
VariableDeclaration.prototype.transpile = function transpile ( code, transforms ) {
var this$1 = this;
var i0 = this.getIndentation();
var kind = this.kind;
if ( transforms.letConst && kind !== 'var' ) {
kind = 'var';
code.overwrite( this.start, this.start + this.kind.length, kind, true );
}
if ( transforms.destructuring && this.parent.type !== 'ForOfStatement' ) {
var c = this.start;
var lastDeclaratorIsPattern;
this.declarations.forEach( function ( declarator, i ) {
if ( declarator.id.type === 'Identifier' ) {
if ( i > 0 && this$1.declarations[ i - 1 ].id.type !== 'Identifier' ) {
code.overwrite( c, declarator.id.start, "var " );
}
} else {
var inline = loopStatement.test( this$1.parent.type );
if ( i === 0 ) {
code.remove( c, declarator.id.start );
} else {
code.overwrite( c, declarator.id.start, (";\n" + i0) );
}
var simple = declarator.init.type === 'Identifier' && !declarator.init.rewritten;
var name = simple ? declarator.init.name : declarator.findScope( true ).createIdentifier( 'ref' );
var c$1 = declarator.start;
var statementGenerators = [];
if ( simple ) {
code.remove( declarator.id.end, declarator.end );
} else {
statementGenerators.push( function ( start, prefix, suffix ) {
code.insertRight( declarator.id.end, ("var " + name) );
code.insertLeft( declarator.init.end, ("" + suffix) );
code.move( declarator.id.end, declarator.end, start );
});
}
destructure( code, declarator.findScope( false ), declarator.id, name, inline, statementGenerators );
var prefix = inline ? 'var ' : '';
var suffix = inline ? ", " : (";\n" + i0);
statementGenerators.forEach( function ( fn, j ) {
if ( i === this$1.declarations.length - 1 && j === statementGenerators.length - 1 ) {
suffix = inline ? '' : ';';
}
fn( declarator.start, j === 0 ? prefix : '', suffix );
});
}
declarator.transpile( code, transforms );
c = declarator.end;
lastDeclaratorIsPattern = declarator.id.type !== 'Identifier';
});
if ( lastDeclaratorIsPattern ) {
code.remove( c, this.end );
}
}
else {
this.declarations.forEach( function ( declarator ) {
declarator.transpile( code, transforms );
});
}
};
return VariableDeclaration;
}(Node));
var VariableDeclarator = (function (Node) {
function VariableDeclarator () {
Node.apply(this, arguments);
}
if ( Node ) VariableDeclarator.__proto__ = Node;
VariableDeclarator.prototype = Object.create( Node && Node.prototype );
VariableDeclarator.prototype.constructor = VariableDeclarator;
VariableDeclarator.prototype.initialise = function initialise ( transforms ) {
var kind = this.parent.kind;
if ( kind === 'let' && this.parent.parent.type === 'ForStatement' ) {
kind = 'for.let'; // special case...
}
this.parent.scope.addDeclaration( this.id, kind );
Node.prototype.initialise.call( this, transforms );
};
VariableDeclarator.prototype.transpile = function transpile ( code, transforms ) {
if ( !this.init && transforms.letConst && this.parent.kind !== 'var' ) {
var inLoop = this.findNearest( /Function|^For(In|Of)?Statement|^(?:Do)?WhileStatement/ );
if ( inLoop && ! /Function/.test( inLoop.type ) && ! this.isLeftDeclaratorOfLoop() ) {
code.insertLeft( this.id.end, ' = (void 0)' );
}
}
if ( this.id ) this.id.transpile( code, transforms );
if ( this.init ) this.init.transpile( code, transforms );
};
VariableDeclarator.prototype.isLeftDeclaratorOfLoop = function isLeftDeclaratorOfLoop () {
return this.parent
&& this.parent.type === 'VariableDeclaration'
&& this.parent.parent
&& (this.parent.parent.type === 'ForInStatement'
|| this.parent.parent.type === 'ForOfStatement')
&& this.parent.parent.left
&& this.parent.parent.left.declarations[0] === this;
};
return VariableDeclarator;
}(Node));
var types = {
ArrayExpression: ArrayExpression,
ArrowFunctionExpression: ArrowFunctionExpression,
AssignmentExpression: AssignmentExpression,
BinaryExpression: BinaryExpression,
BreakStatement: BreakStatement,
CallExpression: CallExpression,
ClassBody: ClassBody,
ClassDeclaration: ClassDeclaration,
ClassExpression: ClassExpression,
ContinueStatement: ContinueStatement,
DoWhileStatement: LoopStatement,
ExportNamedDeclaration: ExportNamedDeclaration,
ExportDefaultDeclaration: ExportDefaultDeclaration,
ForStatement: ForStatement,
ForInStatement: ForInStatement,
ForOfStatement: ForOfStatement,
FunctionDeclaration: FunctionDeclaration,
FunctionExpression: FunctionExpression,
Identifier: Identifier,
IfStatement: IfStatement,
ImportDeclaration: ImportDeclaration,
ImportDefaultSpecifier: ImportDefaultSpecifier,
ImportSpecifier: ImportSpecifier,
JSXAttribute: JSXAttribute,
JSXClosingElement: JSXClosingElement,
JSXElement: JSXElement,
JSXExpressionContainer: JSXExpressionContainer,
JSXOpeningElement: JSXOpeningElement,
JSXSpreadAttribute: JSXSpreadAttribute,
Literal: Literal,
MemberExpression: MemberExpression,
NewExpression: NewExpression,
ObjectExpression: ObjectExpression,
Property: Property,
ReturnStatement: ReturnStatement,
SpreadProperty: SpreadProperty,
Super: Super,
TaggedTemplateExpression: TaggedTemplateExpression,
TemplateElement: TemplateElement,
TemplateLiteral: TemplateLiteral,
ThisExpression: ThisExpression,
UpdateExpression: UpdateExpression,
VariableDeclaration: VariableDeclaration,
VariableDeclarator: VariableDeclarator,
WhileStatement: LoopStatement
};
var statementsWithBlocks = {
IfStatement: 'consequent',
ForStatement: 'body',
ForInStatement: 'body',
ForOfStatement: 'body',
WhileStatement: 'body',
DoWhileStatement: 'body',
ArrowFunctionExpression: 'body'
};
function wrap ( raw, parent ) {
if ( !raw ) return;
if ( 'length' in raw ) {
var i = raw.length;
while ( i-- ) wrap( raw[i], parent );
return;
}
// with e.g. shorthand properties, key and value are
// the same node. We don't want to wrap an object twice
if ( raw.__wrapped ) return;
raw.__wrapped = true;
if ( !keys[ raw.type ] ) {
keys[ raw.type ] = Object.keys( raw ).filter( function ( key ) { return typeof raw[ key ] === 'object'; } );
}
// special case body-less if/for/while statements. TODO others?
var bodyType = statementsWithBlocks[ raw.type ];
if ( bodyType && raw[ bodyType ].type !== 'BlockStatement' ) {
var expression = raw[ bodyType ];
// create a synthetic block statement, otherwise all hell
// breaks loose when it comes to block scoping
raw[ bodyType ] = {
start: expression.start,
end: expression.end,
type: 'BlockStatement',
body: [ expression ],
synthetic: true
};
}
new Node( raw, parent );
var type = ( raw.type === 'BlockStatement' ? BlockStatement : types[ raw.type ] ) || Node;
raw.__proto__ = type.prototype;
}
var letConst = /^(?:let|const)$/;
function Scope ( options ) {
options = options || {};
this.parent = options.parent;
this.isBlockScope = !!options.block;
var scope = this;
while ( scope.isBlockScope ) scope = scope.parent;
this.functionScope = scope;
this.identifiers = [];
this.declarations = Object.create( null );
this.references = Object.create( null );
this.blockScopedDeclarations = this.isBlockScope ? null : Object.create( null );
this.aliases = this.isBlockScope ? null : Object.create( null );
}
Scope.prototype = {
addDeclaration: function addDeclaration ( node, kind ) {
for ( var i = 0, list = extractNames( node ); i < list.length; i += 1 ) {
var identifier = list[i];
var name = identifier.name;
var existingDeclaration = this.declarations[ name ];
if ( existingDeclaration && ( letConst.test( kind ) || letConst.test( existingDeclaration.kind ) ) ) {
// TODO warn about double var declarations?
throw new CompileError( identifier, (name + " is already declared") );
}
var declaration = { name: name, node: identifier, kind: kind, instances: [] };
this.declarations[ name ] = declaration;
if ( this.isBlockScope ) {
if ( !this.functionScope.blockScopedDeclarations[ name ] ) this.functionScope.blockScopedDeclarations[ name ] = [];
this.functionScope.blockScopedDeclarations[ name ].push( declaration );
}
}
},
addReference: function addReference ( identifier ) {
if ( this.consolidated ) {
this.consolidateReference( identifier );
} else {
this.identifiers.push( identifier );
}
},
consolidate: function consolidate () {
var this$1 = this;
for ( var i = 0; i < this$1.identifiers.length; i += 1 ) { // we might push to the array during consolidation, so don't cache length
var identifier = this$1.identifiers[i];
this$1.consolidateReference( identifier );
}
this.consolidated = true; // TODO understand why this is necessary... seems bad
},
consolidateReference: function consolidateReference ( identifier ) {
var declaration = this.declarations[ identifier.name ];
if ( declaration ) {
declaration.instances.push( identifier );
} else {
this.references[ identifier.name ] = true;
if ( this.parent ) this.parent.addReference( identifier );
}
},
contains: function contains ( name ) {
return this.declarations[ name ] ||
( this.parent ? this.parent.contains( name ) : false );
},
createIdentifier: function createIdentifier ( base ) {
var this$1 = this;
if ( typeof base === 'number' ) base = base.toString();
base = base
.replace( /\s/g, '' )
.replace( /\[([^\]]+)\]/g, '_$1' )
.replace( /[^a-zA-Z0-9_$]/g, '_' )
.replace( /_{2,}/, '_' );
var name = base;
var counter = 1;
while ( this$1.declarations[ name ] || this$1.references[ name ] || this$1.aliases[ name ] || name in reserved ) {
name = base + "$" + (counter++);
}
this.aliases[ name ] = true;
return name;
},
findDeclaration: function findDeclaration ( name ) {
return this.declarations[ name ] ||
( this.parent && this.parent.findDeclaration( name ) );
}
};
function isUseStrict ( node ) {
if ( !node ) return false;
if ( node.type !== 'ExpressionStatement' ) return false;
if ( node.expression.type !== 'Literal' ) return false;
return node.expression.value === 'use strict';
}
var BlockStatement = (function (Node) {
function BlockStatement () {
Node.apply(this, arguments);
}
if ( Node ) BlockStatement.__proto__ = Node;
BlockStatement.prototype = Object.create( Node && Node.prototype );
BlockStatement.prototype.constructor = BlockStatement;
BlockStatement.prototype.createScope = function createScope () {
var this$1 = this;
this.parentIsFunction = /Function/.test( this.parent.type );
this.isFunctionBlock = this.parentIsFunction || this.parent.type === 'Root';
this.scope = new Scope({
block: !this.isFunctionBlock,
parent: this.parent.findScope( false )
});
if ( this.parentIsFunction ) {
this.parent.params.forEach( function ( node ) {
this$1.scope.addDeclaration( node, 'param' );
});
}
};
BlockStatement.prototype.initialise = function initialise ( transforms ) {
this.thisAlias = null;
this.argumentsAlias = null;
this.defaultParameters = [];
// normally the scope gets created here, during initialisation,
// but in some cases (e.g. `for` statements), we need to create
// the scope early, as it pertains to both the init block and
// the body of the statement
if ( !this.scope ) this.createScope();
this.body.forEach( function ( node ) { return node.initialise( transforms ); } );
this.scope.consolidate();
};
BlockStatement.prototype.findLexicalBoundary = function findLexicalBoundary () {
if ( this.type === 'Program' ) return this;
if ( /^Function/.test( this.parent.type ) ) return this;
return this.parent.findLexicalBoundary();
};
BlockStatement.prototype.findScope = function findScope ( functionScope ) {
if ( functionScope && !this.isFunctionBlock ) return this.parent.findScope( functionScope );
return this.scope;
};
BlockStatement.prototype.getArgumentsAlias = function getArgumentsAlias () {
if ( !this.argumentsAlias ) {
this.argumentsAlias = this.scope.createIdentifier( 'arguments' );
}
return this.argumentsAlias;
};
BlockStatement.prototype.getArgumentsArrayAlias = function getArgumentsArrayAlias () {
if ( !this.argumentsArrayAlias ) {
this.argumentsArrayAlias = this.scope.createIdentifier( 'argsArray' );
}
return this.argumentsArrayAlias;
};
BlockStatement.prototype.getThisAlias = function getThisAlias () {
if ( !this.thisAlias ) {
this.thisAlias = this.scope.createIdentifier( 'this' );
}
return this.thisAlias;
};
BlockStatement.prototype.getIndentation = function getIndentation () {
var this$1 = this;
if ( this.indentation === undefined ) {
var source = this.program.magicString.original;
var useOuter = this.synthetic || !this.body.length;
var c = useOuter ? this.start : this.body[0].start;
while ( c && source[c] !== '\n' ) c -= 1;
this.indentation = '';
while ( true ) { // eslint-disable-line no-constant-condition
c += 1;
var char = source[c];
if ( char !== ' ' && char !== '\t' ) break;
this$1.indentation += char;
}
var indentString = this.program.magicString.getIndentString();
// account for dedented class constructors
var parent = this.parent;
while ( parent ) {
if ( parent.kind === 'constructor' && !parent.parent.parent.superClass ) {
this$1.indentation = this$1.indentation.replace( indentString, '' );
}
parent = parent.parent;
}
if ( useOuter ) this.indentation += indentString;
}
return this.indentation;
};
BlockStatement.prototype.transpile = function transpile ( code, transforms ) {
var this$1 = this;
var indentation = this.getIndentation();
var introStatementGenerators = [];
if ( this.argumentsAlias ) {
introStatementGenerators.push( function ( start, prefix, suffix ) {
var assignment = prefix + "var " + (this$1.argumentsAlias) + " = arguments" + suffix;
code.insertLeft( start, assignment );
});
}
if ( this.thisAlias ) {
introStatementGenerators.push( function ( start, prefix, suffix ) {
var assignment = prefix + "var " + (this$1.thisAlias) + " = this" + suffix;
code.insertLeft( start, assignment );
});
}
if ( this.argumentsArrayAlias ) {
introStatementGenerators.push( function ( start, prefix, suffix ) {
var i = this$1.scope.createIdentifier( 'i' );
var assignment = prefix + "var " + i + " = arguments.length, " + (this$1.argumentsArrayAlias) + " = Array(" + i + ");\n" + indentation + "while ( " + i + "-- ) " + (this$1.argumentsArrayAlias) + "[" + i + "] = arguments[" + i + "]" + suffix;
code.insertLeft( start, assignment );
});
}
if ( /Function/.test( this.parent.type ) ) {
this.transpileParameters( code, transforms, indentation, introStatementGenerators );
}
if ( transforms.letConst && this.isFunctionBlock ) {
this.transpileBlockScopedIdentifiers( code );
}
Node.prototype.transpile.call( this, code, transforms );
if ( this.synthetic ) {
if ( this.parent.type === 'ArrowFunctionExpression' ) {
var expr = this.body[0];
if ( introStatementGenerators.length ) {
code.insertLeft( this.start, "{" ).insertRight( this.end, ((this.parent.getIndentation()) + "}") );
code.insertRight( expr.start, ("\n" + indentation + "return ") );
code.insertLeft( expr.end, ";\n" );
} else if ( transforms.arrow ) {
code.insertLeft( expr.start, "{ return " );
code.insertLeft( expr.end, "; }" );
}
}
else if ( introStatementGenerators.length ) {
code.insertLeft( this.start, "{" ).insertRight( this.end, "}" );
}
}
var start;
if ( isUseStrict( this.body[0] ) ) {
start = this.body[0].end;
} else if ( this.synthetic || this.parent.type === 'Root' ) {
start = this.start;
} else {
start = this.start + 1;
}
var prefix = "\n" + indentation;
var suffix = ';';
introStatementGenerators.forEach( function ( fn, i ) {
if ( i === introStatementGenerators.length - 1 ) suffix = ";\n";
fn( start, prefix, suffix );
});
};
BlockStatement.prototype.transpileParameters = function transpileParameters ( code, transforms, indentation, introStatementGenerators ) {
var this$1 = this;
var params = this.parent.params;
params.forEach( function ( param ) {
if ( param.type === 'AssignmentPattern' && param.left.type === 'Identifier' ) {
if ( transforms.defaultParameter ) {
introStatementGenerators.push( function ( start, prefix, suffix ) {
var lhs = prefix + "if ( " + (param.left.name) + " === void 0 ) " + (param.left.name);
code
.insertRight( param.left.end, lhs )
.move( param.left.end, param.right.end, start )
.insertLeft( param.right.end, suffix );
});
}
}
else if ( param.type === 'RestElement' ) {
if ( transforms.spreadRest ) {
introStatementGenerators.push( function ( start, prefix, suffix ) {
var penultimateParam = params[ params.length - 2 ];
if ( penultimateParam ) {
code.remove( penultimateParam ? penultimateParam.end : param.start, param.end );
} else {
var start$1 = param.start, end = param.end; // TODO https://gitlab.com/Rich-Harris/buble/issues/8
while ( /\s/.test( code.original[ start$1 - 1 ] ) ) start$1 -= 1;
while ( /\s/.test( code.original[ end ] ) ) end += 1;
code.remove( start$1, end );
}
var name = param.argument.name;
var len = this$1.scope.createIdentifier( 'len' );
var count = params.length - 1;
if ( count ) {
code.insertLeft( start, (prefix + "var " + name + " = [], " + len + " = arguments.length - " + count + ";\n" + indentation + "while ( " + len + "-- > 0 ) " + name + "[ " + len + " ] = arguments[ " + len + " + " + count + " ]" + suffix) );
} else {
code.insertLeft( start, (prefix + "var " + name + " = [], " + len + " = arguments.length;\n" + indentation + "while ( " + len + "-- ) " + name + "[ " + len + " ] = arguments[ " + len + " ]" + suffix) );
}
});
}
}
else if ( param.type !== 'Identifier' ) {
if ( transforms.parameterDestructuring ) {
var ref = this$1.scope.createIdentifier( 'ref' );
destructure( code, this$1.scope, param, ref, false, introStatementGenerators );
code.insertLeft( param.start, ref );
}
}
});
};
BlockStatement.prototype.transpileBlockScopedIdentifiers = function transpileBlockScopedIdentifiers ( code ) {
var this$1 = this;
Object.keys( this.scope.blockScopedDeclarations ).forEach( function ( name ) {
var declarations = this$1.scope.blockScopedDeclarations[ name ];
for ( var i = 0, list = declarations; i < list.length; i += 1 ) {
var declaration = list[i];
var cont = false; // TODO implement proper continue...
if ( declaration.kind === 'for.let' ) {
// special case
var forStatement = declaration.node.findNearest( 'ForStatement' );
if ( forStatement.shouldRewriteAsFunction ) {
var outerAlias = this$1.scope.createIdentifier( name );
var innerAlias = forStatement.reassigned[ name ] ?
this$1.scope.createIdentifier( name ) :
name;
declaration.name = outerAlias;
code.overwrite( declaration.node.start, declaration.node.end, outerAlias, true );
forStatement.aliases[ name ] = {
outer: outerAlias,
inner: innerAlias
};
for ( var i$1 = 0, list$1 = declaration.instances; i$1 < list$1.length; i$1 += 1 ) {
var identifier = list$1[i$1];
var alias = forStatement.body.contains( identifier ) ?
innerAlias :
outerAlias;
if ( name !== alias ) {
code.overwrite( identifier.start, identifier.end, alias, true );
}
}
cont = true;
}
}
if ( !cont ) {
var alias$1 = this$1.scope.createIdentifier( name );
if ( name !== alias$1 ) {
declaration.name = alias$1;
code.overwrite( declaration.node.start, declaration.node.end, alias$1, true );
for ( var i$2 = 0, list$2 = declaration.instances; i$2 < list$2.length; i$2 += 1 ) {
var identifier$1 = list$2[i$2];
identifier$1.rewritten = true;
code.overwrite( identifier$1.start, identifier$1.end, alias$1, true );
}
}
}
}
});
};
return BlockStatement;
}(Node));
function Program ( source, ast, transforms, options ) {
var this$1 = this;
this.type = 'Root';
// options
this.jsx = options.jsx || 'React.createElement';
this.options = options;
this.source = source;
this.magicString = new MagicString( source );
this.ast = ast;
this.depth = 0;
wrap( this.body = ast, this );
this.body.__proto__ = BlockStatement.prototype;
this.indentExclusionElements = [];
this.body.initialise( transforms );
this.indentExclusions = Object.create( null );
for ( var i$1 = 0, list = this.indentExclusionElements; i$1 < list.length; i$1 += 1 ) {
var node = list[i$1];
for ( var i = node.start; i < node.end; i += 1 ) {
this$1.indentExclusions[ i ] = true;
}
}
this.body.transpile( this.magicString, transforms );
}
Program.prototype = {
export: function export$1 ( options ) {
if ( options === void 0 ) options = {};
return {
code: this.magicString.toString(),
map: this.magicString.generateMap({
file: options.file,
source: options.source,
includeContent: options.includeContent !== false
})
};
},
findNearest: function findNearest () {
return null;
},
findScope: function findScope () {
return null;
}
};
var matrix = {
chrome: {
48: 1333689725,
49: 1342078975,
50: 1610514431,
51: 1610514431,
52: 2147385343
},
firefox: {
43: 1207307741,
44: 1207307741,
45: 1207307741,
46: 1476267485,
47: 1476296671,
48: 1476296671
},
safari: {
8: 1073741824,
9: 1328940894
},
ie: {
8: 0,
9: 1073741824,
10: 1073741824,
11: 1073770592
},
edge: {
12: 1591620701,
13: 1608400479
},
node: {
'0.10': 1075052608,
'0.12': 1091830852,
4: 1327398527,
5: 1327398527,
6: 1610514431
}
};
var features = [
'arrow',
'classes',
'collections',
'computedProperty',
'conciseMethodProperty',
'constLoop',
'constRedef',
'defaultParameter',
'destructuring',
'extendNatives',
'forOf',
'generator',
'letConst',
'letLoop',
'letLoopScope',
'moduleExport',
'moduleImport',
'numericLiteral',
'objectProto',
'objectSuper',
'oldOctalLiteral',
'parameterDestructuring',
'spreadRest',
'stickyRegExp',
'symbol',
'templateString',
'unicodeEscape',
'unicodeIdentifier',
'unicodeRegExp',
// ES2016
'exponentiation',
// additional transforms, not from
// https://featuretests.io
'reservedProperties'
];
var version = "0.15.2";
var ref = [
acornObjectSpread,
acornJsx
].reduce( function ( final, plugin ) { return plugin( final ); }, acorn );
var parse = ref.parse;
var dangerousTransforms = [
'dangerousTaggedTemplateString',
'dangerousForOf'
];
function target ( target ) {
var targets = Object.keys( target );
var bitmask = targets.length ?
2147483647 :
1073741824;
Object.keys( target ).forEach( function ( environment ) {
var versions = matrix[ environment ];
if ( !versions ) throw new Error( ("Unknown environment '" + environment + "'. Please raise an issue at https://gitlab.com/Rich-Harris/buble/issues") );
var targetVersion = target[ environment ];
if ( !( targetVersion in versions ) ) throw new Error( ("Support data exists for the following versions of " + environment + ": " + (Object.keys( versions ).join( ', ')) + ". Please raise an issue at https://gitlab.com/Rich-Harris/buble/issues") );
var support = versions[ targetVersion ];
bitmask &= support;
});
var transforms = Object.create( null );
features.forEach( function ( name, i ) {
transforms[ name ] = !( bitmask & 1 << i );
});
dangerousTransforms.forEach( function ( name ) {
transforms[ name ] = false;
});
return transforms;
}
function transform ( source, options ) {
if ( options === void 0 ) options = {};
var ast;
try {
ast = parse( source, {
ecmaVersion: 7,
preserveParens: true,
sourceType: 'module',
plugins: {
jsx: true,
objectSpread: true
}
});
} catch ( err ) {
err.snippet = getSnippet( source, err.loc );
err.toString = function () { return ((err.name) + ": " + (err.message) + "\n" + (err.snippet)); };
throw err;
}
var transforms = target( options.target || {} );
Object.keys( options.transforms || {} ).forEach( function ( name ) {
if ( name === 'modules' ) {
if ( !( 'moduleImport' in options.transforms ) ) transforms.moduleImport = options.transforms.modules;
if ( !( 'moduleExport' in options.transforms ) ) transforms.moduleExport = options.transforms.modules;
return;
}
if ( !( name in transforms ) ) throw new Error( ("Unknown transform '" + name + "'") );
transforms[ name ] = options.transforms[ name ];
});
return new Program( source, ast, transforms, options ).export( options );
}
exports.target = target;
exports.transform = transform;
exports.VERSION = version;
Object.defineProperty(exports, '__esModule', { value: true });
}));
//# sourceMappingURL=buble.umd.js.map
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(16)))
/***/ }),
/* 417 */
/***/ (function(module, exports, __webpack_require__) {
(function (global, factory) {
true ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(factory((global.acorn = global.acorn || {})));
}(this, function (exports) { 'use strict';
// Reserved word lists for various dialects of the language
var reservedWords = {
3: "abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",
5: "class enum extends super const export import",
6: "enum",
7: "enum",
strict: "implements interface let package private protected public static yield",
strictBind: "eval arguments"
}
// And the keywords
var ecma5AndLessKeywords = "break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this"
var keywords = {
5: ecma5AndLessKeywords,
6: ecma5AndLessKeywords + " const class extends export import super"
}
// ## Character categories
// Big ugly regular expressions that match characters in the
// whitespace, identifier, and identifier-start categories. These
// are only applied when a character is found to actually have a
// code point above 128.
// Generated by `bin/generate-identifier-regex.js`.
var nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0-\u08b4\u08b6-\u08bd\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\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\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\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\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\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\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fd5\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7ae\ua7b0-\ua7b7\ua7f7-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab65\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"
var nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08d4-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c03\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d01-\u0d03\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf2-\u1cf4\u1cf8\u1cf9\u1dc0-\u1df5\u1dfb-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua900-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f"
var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]")
var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]")
nonASCIIidentifierStartChars = nonASCIIidentifierChars = null
// These are a run-length and offset encoded representation of the
// >0xffff code points that are a valid part of identifiers. The
// offset starts at 0x10000, and each pair of numbers represents an
// offset to the next range, and then a size of the range. They were
// generated by bin/generate-identifier-regex.js
var astralIdentifierStartCodes = [0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,17,26,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,26,45,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,785,52,76,44,33,24,27,35,42,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,54,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,86,25,391,63,32,0,449,56,264,8,2,36,18,0,50,29,881,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,881,68,12,0,67,12,65,0,32,6124,20,754,9486,1,3071,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,4149,196,60,67,1213,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42710,42,4148,12,221,3,5761,10591,541]
var astralIdentifierCodes = [509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,1306,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,52,0,13,2,49,13,10,2,4,9,83,11,7,0,161,11,6,9,7,3,57,0,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,87,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,423,9,838,7,2,7,17,9,57,21,2,13,19882,9,135,4,60,6,26,9,1016,45,17,3,19723,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,2214,6,110,6,6,9,792487,239]
// This has a complexity linear to the value of the code. The
// assumption is that looking up astral identifier characters is
// rare.
function isInAstralSet(code, set) {
var pos = 0x10000
for (var i = 0; i < set.length; i += 2) {
pos += set[i]
if (pos > code) return false
pos += set[i + 1]
if (pos >= code) return true
}
}
// Test whether a given character code starts an identifier.
function isIdentifierStart(code, astral) {
if (code < 65) return code === 36
if (code < 91) return true
if (code < 97) return code === 95
if (code < 123) return true
if (code <= 0xffff) return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code))
if (astral === false) return false
return isInAstralSet(code, astralIdentifierStartCodes)
}
// Test whether a given character is part of an identifier.
function isIdentifierChar(code, astral) {
if (code < 48) return code === 36
if (code < 58) return true
if (code < 65) return false
if (code < 91) return true
if (code < 97) return code === 95
if (code < 123) return true
if (code <= 0xffff) return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code))
if (astral === false) return false
return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes)
}
// ## Token types
// The assignment of fine-grained, information-carrying type objects
// allows the tokenizer to store the information it has about a
// token in a way that is very cheap for the parser to look up.
// All token type variables start with an underscore, to make them
// easy to recognize.
// The `beforeExpr` property is used to disambiguate between regular
// expressions and divisions. It is set on all token types that can
// be followed by an expression (thus, a slash after them would be a
// regular expression).
//
// The `startsExpr` property is used to check if the token ends a
// `yield` expression. It is set on all token types that either can
// directly start an expression (like a quotation mark) or can
// continue an expression (like the body of a string).
//
// `isLoop` marks a keyword as starting a loop, which is important
// to know when parsing a label, in order to allow or disallow
// continue jumps to that label.
var TokenType = function TokenType(label, conf) {
if ( conf === void 0 ) conf = {};
this.label = label
this.keyword = conf.keyword
this.beforeExpr = !!conf.beforeExpr
this.startsExpr = !!conf.startsExpr
this.isLoop = !!conf.isLoop
this.isAssign = !!conf.isAssign
this.prefix = !!conf.prefix
this.postfix = !!conf.postfix
this.binop = conf.binop || null
this.updateContext = null
};
function binop(name, prec) {
return new TokenType(name, {beforeExpr: true, binop: prec})
}
var beforeExpr = {beforeExpr: true};
var startsExpr = {startsExpr: true};
// Map keyword names to token types.
var keywordTypes = {}
// Succinct definitions of keyword token types
function kw(name, options) {
if ( options === void 0 ) options = {};
options.keyword = name
return keywordTypes[name] = new TokenType(name, options)
}
var tt = {
num: new TokenType("num", startsExpr),
regexp: new TokenType("regexp", startsExpr),
string: new TokenType("string", startsExpr),
name: new TokenType("name", startsExpr),
eof: new TokenType("eof"),
// Punctuation token types.
bracketL: new TokenType("[", {beforeExpr: true, startsExpr: true}),
bracketR: new TokenType("]"),
braceL: new TokenType("{", {beforeExpr: true, startsExpr: true}),
braceR: new TokenType("}"),
parenL: new TokenType("(", {beforeExpr: true, startsExpr: true}),
parenR: new TokenType(")"),
comma: new TokenType(",", beforeExpr),
semi: new TokenType(";", beforeExpr),
colon: new TokenType(":", beforeExpr),
dot: new TokenType("."),
question: new TokenType("?", beforeExpr),
arrow: new TokenType("=>", beforeExpr),
template: new TokenType("template"),
ellipsis: new TokenType("...", beforeExpr),
backQuote: new TokenType("`", startsExpr),
dollarBraceL: new TokenType("${", {beforeExpr: true, startsExpr: true}),
// Operators. These carry several kinds of properties to help the
// parser use them properly (the presence of these properties is
// what categorizes them as operators).
//
// `binop`, when present, specifies that this operator is a binary
// operator, and will refer to its precedence.
//
// `prefix` and `postfix` mark the operator as a prefix or postfix
// unary operator.
//
// `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as
// binary operators with a very low precedence, that should result
// in AssignmentExpression nodes.
eq: new TokenType("=", {beforeExpr: true, isAssign: true}),
assign: new TokenType("_=", {beforeExpr: true, isAssign: true}),
incDec: new TokenType("++/--", {prefix: true, postfix: true, startsExpr: true}),
prefix: new TokenType("prefix", {beforeExpr: true, prefix: true, startsExpr: true}),
logicalOR: binop("||", 1),
logicalAND: binop("&&", 2),
bitwiseOR: binop("|", 3),
bitwiseXOR: binop("^", 4),
bitwiseAND: binop("&", 5),
equality: binop("==/!=", 6),
relational: binop("</>", 7),
bitShift: binop("<</>>", 8),
plusMin: new TokenType("+/-", {beforeExpr: true, binop: 9, prefix: true, startsExpr: true}),
modulo: binop("%", 10),
star: binop("*", 10),
slash: binop("/", 10),
starstar: new TokenType("**", {beforeExpr: true}),
// Keyword token types.
_break: kw("break"),
_case: kw("case", beforeExpr),
_catch: kw("catch"),
_continue: kw("continue"),
_debugger: kw("debugger"),
_default: kw("default", beforeExpr),
_do: kw("do", {isLoop: true, beforeExpr: true}),
_else: kw("else", beforeExpr),
_finally: kw("finally"),
_for: kw("for", {isLoop: true}),
_function: kw("function", startsExpr),
_if: kw("if"),
_return: kw("return", beforeExpr),
_switch: kw("switch"),
_throw: kw("throw", beforeExpr),
_try: kw("try"),
_var: kw("var"),
_const: kw("const"),
_while: kw("while", {isLoop: true}),
_with: kw("with"),
_new: kw("new", {beforeExpr: true, startsExpr: true}),
_this: kw("this", startsExpr),
_super: kw("super", startsExpr),
_class: kw("class"),
_extends: kw("extends", beforeExpr),
_export: kw("export"),
_import: kw("import"),
_null: kw("null", startsExpr),
_true: kw("true", startsExpr),
_false: kw("false", startsExpr),
_in: kw("in", {beforeExpr: true, binop: 7}),
_instanceof: kw("instanceof", {beforeExpr: true, binop: 7}),
_typeof: kw("typeof", {beforeExpr: true, prefix: true, startsExpr: true}),
_void: kw("void", {beforeExpr: true, prefix: true, startsExpr: true}),
_delete: kw("delete", {beforeExpr: true, prefix: true, startsExpr: true})
}
// Matches a whole line break (where CRLF is considered a single
// line break). Used to count lines.
var lineBreak = /\r\n?|\n|\u2028|\u2029/
var lineBreakG = new RegExp(lineBreak.source, "g")
function isNewLine(code) {
return code === 10 || code === 13 || code === 0x2028 || code == 0x2029
}
var nonASCIIwhitespace = /[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/
var skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g
function isArray(obj) {
return Object.prototype.toString.call(obj) === "[object Array]"
}
// Checks if an object has a property.
function has(obj, propName) {
return Object.prototype.hasOwnProperty.call(obj, propName)
}
// These are used when `options.locations` is on, for the
// `startLoc` and `endLoc` properties.
var Position = function Position(line, col) {
this.line = line
this.column = col
};
Position.prototype.offset = function offset (n) {
return new Position(this.line, this.column + n)
};
var SourceLocation = function SourceLocation(p, start, end) {
this.start = start
this.end = end
if (p.sourceFile !== null) this.source = p.sourceFile
};
// The `getLineInfo` function is mostly useful when the
// `locations` option is off (for performance reasons) and you
// want to find the line/column position for a given character
// offset. `input` should be the code string that the offset refers
// into.
function getLineInfo(input, offset) {
for (var line = 1, cur = 0;;) {
lineBreakG.lastIndex = cur
var match = lineBreakG.exec(input)
if (match && match.index < offset) {
++line
cur = match.index + match[0].length
} else {
return new Position(line, offset - cur)
}
}
}
// A second optional argument can be given to further configure
// the parser process. These options are recognized:
var defaultOptions = {
// `ecmaVersion` indicates the ECMAScript version to parse. Must
// be either 3, or 5, or 6. This influences support for strict
// mode, the set of reserved words, support for getters and
// setters and other features. The default is 6.
ecmaVersion: 6,
// Source type ("script" or "module") for different semantics
sourceType: "script",
// `onInsertedSemicolon` can be a callback that will be called
// when a semicolon is automatically inserted. It will be passed
// th position of the comma as an offset, and if `locations` is
// enabled, it is given the location as a `{line, column}` object
// as second argument.
onInsertedSemicolon: null,
// `onTrailingComma` is similar to `onInsertedSemicolon`, but for
// trailing commas.
onTrailingComma: null,
// By default, reserved words are only enforced if ecmaVersion >= 5.
// Set `allowReserved` to a boolean value to explicitly turn this on
// an off. When this option has the value "never", reserved words
// and keywords can also not be used as property names.
allowReserved: null,
// When enabled, a return at the top level is not considered an
// error.
allowReturnOutsideFunction: false,
// When enabled, import/export statements are not constrained to
// appearing at the top of the program.
allowImportExportEverywhere: false,
// When enabled, hashbang directive in the beginning of file
// is allowed and treated as a line comment.
allowHashBang: false,
// When `locations` is on, `loc` properties holding objects with
// `start` and `end` properties in `{line, column}` form (with
// line being 1-based and column 0-based) will be attached to the
// nodes.
locations: false,
// A function can be passed as `onToken` option, which will
// cause Acorn to call that function with object in the same
// format as tokens returned from `tokenizer().getToken()`. Note
// that you are not allowed to call the parser from the
// callback—that will corrupt its internal state.
onToken: null,
// A function can be passed as `onComment` option, which will
// cause Acorn to call that function with `(block, text, start,
// end)` parameters whenever a comment is skipped. `block` is a
// boolean indicating whether this is a block (`/* */`) comment,
// `text` is the content of the comment, and `start` and `end` are
// character offsets that denote the start and end of the comment.
// When the `locations` option is on, two more parameters are
// passed, the full `{line, column}` locations of the start and
// end of the comments. Note that you are not allowed to call the
// parser from the callback—that will corrupt its internal state.
onComment: null,
// Nodes have their start and end characters offsets recorded in
// `start` and `end` properties (directly on the node, rather than
// the `loc` object, which holds line/column data. To also add a
// [semi-standardized][range] `range` property holding a `[start,
// end]` array with the same numbers, set the `ranges` option to
// `true`.
//
// [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678
ranges: false,
// It is possible to parse multiple files into a single AST by
// passing the tree produced by parsing the first file as
// `program` option in subsequent parses. This will add the
// toplevel forms of the parsed file to the `Program` (top) node
// of an existing parse tree.
program: null,
// When `locations` is on, you can pass this to record the source
// file in every node's `loc` object.
sourceFile: null,
// This value, if given, is stored in every node, whether
// `locations` is on or off.
directSourceFile: null,
// When enabled, parenthesized expressions are represented by
// (non-standard) ParenthesizedExpression nodes
preserveParens: false,
plugins: {}
}
// Interpret and default an options object
function getOptions(opts) {
var options = {}
for (var opt in defaultOptions)
options[opt] = opts && has(opts, opt) ? opts[opt] : defaultOptions[opt]
if (options.allowReserved == null)
options.allowReserved = options.ecmaVersion < 5
if (isArray(options.onToken)) {
var tokens = options.onToken
options.onToken = function (token) { return tokens.push(token); }
}
if (isArray(options.onComment))
options.onComment = pushComment(options, options.onComment)
return options
}
function pushComment(options, array) {
return function (block, text, start, end, startLoc, endLoc) {
var comment = {
type: block ? 'Block' : 'Line',
value: text,
start: start,
end: end
}
if (options.locations)
comment.loc = new SourceLocation(this, startLoc, endLoc)
if (options.ranges)
comment.range = [start, end]
array.push(comment)
}
}
// Registered plugins
var plugins = {}
function keywordRegexp(words) {
return new RegExp("^(" + words.replace(/ /g, "|") + ")$")
}
var Parser = function Parser(options, input, startPos) {
this.options = options = getOptions(options)
this.sourceFile = options.sourceFile
this.keywords = keywordRegexp(keywords[options.ecmaVersion >= 6 ? 6 : 5])
var reserved = options.allowReserved ? "" :
reservedWords[options.ecmaVersion] + (options.sourceType == "module" ? " await" : "")
this.reservedWords = keywordRegexp(reserved)
var reservedStrict = (reserved ? reserved + " " : "") + reservedWords.strict
this.reservedWordsStrict = keywordRegexp(reservedStrict)
this.reservedWordsStrictBind = keywordRegexp(reservedStrict + " " + reservedWords.strictBind)
this.input = String(input)
// Used to signal to callers of `readWord1` whether the word
// contained any escape sequences. This is needed because words with
// escape sequences must not be interpreted as keywords.
this.containsEsc = false
// Load plugins
this.loadPlugins(options.plugins)
// Set up token state
// The current position of the tokenizer in the input.
if (startPos) {
this.pos = startPos
this.lineStart = Math.max(0, this.input.lastIndexOf("\n", startPos))
this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length
} else {
this.pos = this.lineStart = 0
this.curLine = 1
}
// Properties of the current token:
// Its type
this.type = tt.eof
// For tokens that include more information than their type, the value
this.value = null
// Its start and end offset
this.start = this.end = this.pos
// And, if locations are used, the {line, column} object
// corresponding to those offsets
this.startLoc = this.endLoc = this.curPosition()
// Position information for the previous token
this.lastTokEndLoc = this.lastTokStartLoc = null
this.lastTokStart = this.lastTokEnd = this.pos
// The context stack is used to superficially track syntactic
// context to predict whether a regular expression is allowed in a
// given position.
this.context = this.initialContext()
this.exprAllowed = true
// Figure out if it's a module code.
this.strict = this.inModule = options.sourceType === "module"
// Used to signify the start of a potential arrow function
this.potentialArrowAt = -1
// Flags to track whether we are in a function, a generator.
this.inFunction = this.inGenerator = false
// Labels in scope.
this.labels = []
// If enabled, skip leading hashbang line.
if (this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === '#!')
this.skipLineComment(2)
};
// DEPRECATED Kept for backwards compatibility until 3.0 in case a plugin uses them
Parser.prototype.isKeyword = function isKeyword (word) { return this.keywords.test(word) };
Parser.prototype.isReservedWord = function isReservedWord (word) { return this.reservedWords.test(word) };
Parser.prototype.extend = function extend (name, f) {
this[name] = f(this[name])
};
Parser.prototype.loadPlugins = function loadPlugins (pluginConfigs) {
var this$1 = this;
for (var name in pluginConfigs) {
var plugin = plugins[name]
if (!plugin) throw new Error("Plugin '" + name + "' not found")
plugin(this$1, pluginConfigs[name])
}
};
Parser.prototype.parse = function parse () {
var node = this.options.program || this.startNode()
this.nextToken()
return this.parseTopLevel(node)
};
var pp = Parser.prototype
// ## Parser utilities
// Test whether a statement node is the string literal `"use strict"`.
pp.isUseStrict = function(stmt) {
return this.options.ecmaVersion >= 5 && stmt.type === "ExpressionStatement" &&
stmt.expression.type === "Literal" &&
stmt.expression.raw.slice(1, -1) === "use strict"
}
// Predicate that tests whether the next token is of the given
// type, and if yes, consumes it as a side effect.
pp.eat = function(type) {
if (this.type === type) {
this.next()
return true
} else {
return false
}
}
// Tests whether parsed token is a contextual keyword.
pp.isContextual = function(name) {
return this.type === tt.name && this.value === name
}
// Consumes contextual keyword if possible.
pp.eatContextual = function(name) {
return this.value === name && this.eat(tt.name)
}
// Asserts that following token is given contextual keyword.
pp.expectContextual = function(name) {
if (!this.eatContextual(name)) this.unexpected()
}
// Test whether a semicolon can be inserted at the current position.
pp.canInsertSemicolon = function() {
return this.type === tt.eof ||
this.type === tt.braceR ||
lineBreak.test(this.input.slice(this.lastTokEnd, this.start))
}
pp.insertSemicolon = function() {
if (this.canInsertSemicolon()) {
if (this.options.onInsertedSemicolon)
this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc)
return true
}
}
// Consume a semicolon, or, failing that, see if we are allowed to
// pretend that there is a semicolon at this position.
pp.semicolon = function() {
if (!this.eat(tt.semi) && !this.insertSemicolon()) this.unexpected()
}
pp.afterTrailingComma = function(tokType) {
if (this.type == tokType) {
if (this.options.onTrailingComma)
this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc)
this.next()
return true
}
}
// Expect a token of a given type. If found, consume it, otherwise,
// raise an unexpected token error.
pp.expect = function(type) {
this.eat(type) || this.unexpected()
}
// Raise an unexpected token error.
pp.unexpected = function(pos) {
this.raise(pos != null ? pos : this.start, "Unexpected token")
}
var DestructuringErrors = function DestructuringErrors() {
this.shorthandAssign = 0
this.trailingComma = 0
};
pp.checkPatternErrors = function(refDestructuringErrors, andThrow) {
var trailing = refDestructuringErrors && refDestructuringErrors.trailingComma
if (!andThrow) return !!trailing
if (trailing) this.raise(trailing, "Comma is not permitted after the rest element")
}
pp.checkExpressionErrors = function(refDestructuringErrors, andThrow) {
var pos = refDestructuringErrors && refDestructuringErrors.shorthandAssign
if (!andThrow) return !!pos
if (pos) this.raise(pos, "Shorthand property assignments are valid only in destructuring patterns")
}
var pp$1 = Parser.prototype
// ### Statement parsing
// Parse a program. Initializes the parser, reads any number of
// statements, and wraps them in a Program node. Optionally takes a
// `program` argument. If present, the statements will be appended
// to its body instead of creating a new node.
pp$1.parseTopLevel = function(node) {
var this$1 = this;
var first = true
if (!node.body) node.body = []
while (this.type !== tt.eof) {
var stmt = this$1.parseStatement(true, true)
node.body.push(stmt)
if (first) {
if (this$1.isUseStrict(stmt)) this$1.setStrict(true)
first = false
}
}
this.next()
if (this.options.ecmaVersion >= 6) {
node.sourceType = this.options.sourceType
}
return this.finishNode(node, "Program")
}
var loopLabel = {kind: "loop"};
var switchLabel = {kind: "switch"};
pp$1.isLet = function() {
if (this.type !== tt.name || this.options.ecmaVersion < 6 || this.value != "let") return false
skipWhiteSpace.lastIndex = this.pos
var skip = skipWhiteSpace.exec(this.input)
var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next)
if (nextCh === 91 || nextCh == 123) return true // '{' and '['
if (isIdentifierStart(nextCh, true)) {
for (var pos = next + 1; isIdentifierChar(this.input.charCodeAt(pos), true); ++pos) {}
var ident = this.input.slice(next, pos)
if (!this.isKeyword(ident)) return true
}
return false
}
// Parse a single statement.
//
// If expecting a statement and finding a slash operator, parse a
// regular expression literal. This is to handle cases like
// `if (foo) /blah/.exec(foo)`, where looking at the previous token
// does not help.
pp$1.parseStatement = function(declaration, topLevel) {
var starttype = this.type, node = this.startNode(), kind
if (this.isLet()) {
starttype = tt._var
kind = "let"
}
// Most types of statements are recognized by the keyword they
// start with. Many are trivial to parse, some require a bit of
// complexity.
switch (starttype) {
case tt._break: case tt._continue: return this.parseBreakContinueStatement(node, starttype.keyword)
case tt._debugger: return this.parseDebuggerStatement(node)
case tt._do: return this.parseDoStatement(node)
case tt._for: return this.parseForStatement(node)
case tt._function:
if (!declaration && this.options.ecmaVersion >= 6) this.unexpected()
return this.parseFunctionStatement(node)
case tt._class:
if (!declaration) this.unexpected()
return this.parseClass(node, true)
case tt._if: return this.parseIfStatement(node)
case tt._return: return this.parseReturnStatement(node)
case tt._switch: return this.parseSwitchStatement(node)
case tt._throw: return this.parseThrowStatement(node)
case tt._try: return this.parseTryStatement(node)
case tt._const: case tt._var:
kind = kind || this.value
if (!declaration && kind != "var") this.unexpected()
return this.parseVarStatement(node, kind)
case tt._while: return this.parseWhileStatement(node)
case tt._with: return this.parseWithStatement(node)
case tt.braceL: return this.parseBlock()
case tt.semi: return this.parseEmptyStatement(node)
case tt._export:
case tt._import:
if (!this.options.allowImportExportEverywhere) {
if (!topLevel)
this.raise(this.start, "'import' and 'export' may only appear at the top level")
if (!this.inModule)
this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'")
}
return starttype === tt._import ? this.parseImport(node) : this.parseExport(node)
// If the statement does not start with a statement keyword or a
// brace, it's an ExpressionStatement or LabeledStatement. We
// simply start parsing an expression, and afterwards, if the
// next token is a colon and the expression was a simple
// Identifier node, we switch to interpreting it as a label.
default:
var maybeName = this.value, expr = this.parseExpression()
if (starttype === tt.name && expr.type === "Identifier" && this.eat(tt.colon))
return this.parseLabeledStatement(node, maybeName, expr)
else return this.parseExpressionStatement(node, expr)
}
}
pp$1.parseBreakContinueStatement = function(node, keyword) {
var this$1 = this;
var isBreak = keyword == "break"
this.next()
if (this.eat(tt.semi) || this.insertSemicolon()) node.label = null
else if (this.type !== tt.name) this.unexpected()
else {
node.label = this.parseIdent()
this.semicolon()
}
// Verify that there is an actual destination to break or
// continue to.
for (var i = 0; i < this.labels.length; ++i) {
var lab = this$1.labels[i]
if (node.label == null || lab.name === node.label.name) {
if (lab.kind != null && (isBreak || lab.kind === "loop")) break
if (node.label && isBreak) break
}
}
if (i === this.labels.length) this.raise(node.start, "Unsyntactic " + keyword)
return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement")
}
pp$1.parseDebuggerStatement = function(node) {
this.next()
this.semicolon()
return this.finishNode(node, "DebuggerStatement")
}
pp$1.parseDoStatement = function(node) {
this.next()
this.labels.push(loopLabel)
node.body = this.parseStatement(false)
this.labels.pop()
this.expect(tt._while)
node.test = this.parseParenExpression()
if (this.options.ecmaVersion >= 6)
this.eat(tt.semi)
else
this.semicolon()
return this.finishNode(node, "DoWhileStatement")
}
// Disambiguating between a `for` and a `for`/`in` or `for`/`of`
// loop is non-trivial. Basically, we have to parse the init `var`
// statement or expression, disallowing the `in` operator (see
// the second parameter to `parseExpression`), and then check
// whether the next token is `in` or `of`. When there is no init
// part (semicolon immediately after the opening parenthesis), it
// is a regular `for` loop.
pp$1.parseForStatement = function(node) {
this.next()
this.labels.push(loopLabel)
this.expect(tt.parenL)
if (this.type === tt.semi) return this.parseFor(node, null)
var isLet = this.isLet()
if (this.type === tt._var || this.type === tt._const || isLet) {
var init$1 = this.startNode(), kind = isLet ? "let" : this.value
this.next()
this.parseVar(init$1, true, kind)
this.finishNode(init$1, "VariableDeclaration")
if ((this.type === tt._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) && init$1.declarations.length === 1 &&
!(kind !== "var" && init$1.declarations[0].init))
return this.parseForIn(node, init$1)
return this.parseFor(node, init$1)
}
var refDestructuringErrors = new DestructuringErrors
var init = this.parseExpression(true, refDestructuringErrors)
if (this.type === tt._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) {
this.checkPatternErrors(refDestructuringErrors, true)
this.toAssignable(init)
this.checkLVal(init)
return this.parseForIn(node, init)
} else {
this.checkExpressionErrors(refDestructuringErrors, true)
}
return this.parseFor(node, init)
}
pp$1.parseFunctionStatement = function(node) {
this.next()
return this.parseFunction(node, true)
}
pp$1.parseIfStatement = function(node) {
this.next()
node.test = this.parseParenExpression()
node.consequent = this.parseStatement(false)
node.alternate = this.eat(tt._else) ? this.parseStatement(false) : null
return this.finishNode(node, "IfStatement")
}
pp$1.parseReturnStatement = function(node) {
if (!this.inFunction && !this.options.allowReturnOutsideFunction)
this.raise(this.start, "'return' outside of function")
this.next()
// In `return` (and `break`/`continue`), the keywords with
// optional arguments, we eagerly look for a semicolon or the
// possibility to insert one.
if (this.eat(tt.semi) || this.insertSemicolon()) node.argument = null
else { node.argument = this.parseExpression(); this.semicolon() }
return this.finishNode(node, "ReturnStatement")
}
pp$1.parseSwitchStatement = function(node) {
var this$1 = this;
this.next()
node.discriminant = this.parseParenExpression()
node.cases = []
this.expect(tt.braceL)
this.labels.push(switchLabel)
// Statements under must be grouped (by label) in SwitchCase
// nodes. `cur` is used to keep the node that we are currently
// adding statements to.
for (var cur, sawDefault = false; this.type != tt.braceR;) {
if (this$1.type === tt._case || this$1.type === tt._default) {
var isCase = this$1.type === tt._case
if (cur) this$1.finishNode(cur, "SwitchCase")
node.cases.push(cur = this$1.startNode())
cur.consequent = []
this$1.next()
if (isCase) {
cur.test = this$1.parseExpression()
} else {
if (sawDefault) this$1.raiseRecoverable(this$1.lastTokStart, "Multiple default clauses")
sawDefault = true
cur.test = null
}
this$1.expect(tt.colon)
} else {
if (!cur) this$1.unexpected()
cur.consequent.push(this$1.parseStatement(true))
}
}
if (cur) this.finishNode(cur, "SwitchCase")
this.next() // Closing brace
this.labels.pop()
return this.finishNode(node, "SwitchStatement")
}
pp$1.parseThrowStatement = function(node) {
this.next()
if (lineBreak.test(this.input.slice(this.lastTokEnd, this.start)))
this.raise(this.lastTokEnd, "Illegal newline after throw")
node.argument = this.parseExpression()
this.semicolon()
return this.finishNode(node, "ThrowStatement")
}
// Reused empty array added for node fields that are always empty.
var empty = []
pp$1.parseTryStatement = function(node) {
this.next()
node.block = this.parseBlock()
node.handler = null
if (this.type === tt._catch) {
var clause = this.startNode()
this.next()
this.expect(tt.parenL)
clause.param = this.parseBindingAtom()
this.checkLVal(clause.param, true)
this.expect(tt.parenR)
clause.body = this.parseBlock()
node.handler = this.finishNode(clause, "CatchClause")
}
node.finalizer = this.eat(tt._finally) ? this.parseBlock() : null
if (!node.handler && !node.finalizer)
this.raise(node.start, "Missing catch or finally clause")
return this.finishNode(node, "TryStatement")
}
pp$1.parseVarStatement = function(node, kind) {
this.next()
this.parseVar(node, false, kind)
this.semicolon()
return this.finishNode(node, "VariableDeclaration")
}
pp$1.parseWhileStatement = function(node) {
this.next()
node.test = this.parseParenExpression()
this.labels.push(loopLabel)
node.body = this.parseStatement(false)
this.labels.pop()
return this.finishNode(node, "WhileStatement")
}
pp$1.parseWithStatement = function(node) {
if (this.strict) this.raise(this.start, "'with' in strict mode")
this.next()
node.object = this.parseParenExpression()
node.body = this.parseStatement(false)
return this.finishNode(node, "WithStatement")
}
pp$1.parseEmptyStatement = function(node) {
this.next()
return this.finishNode(node, "EmptyStatement")
}
pp$1.parseLabeledStatement = function(node, maybeName, expr) {
var this$1 = this;
for (var i = 0; i < this.labels.length; ++i)
if (this$1.labels[i].name === maybeName) this$1.raise(expr.start, "Label '" + maybeName + "' is already declared")
var kind = this.type.isLoop ? "loop" : this.type === tt._switch ? "switch" : null
for (var i$1 = this.labels.length - 1; i$1 >= 0; i$1--) {
var label = this$1.labels[i$1]
if (label.statementStart == node.start) {
label.statementStart = this$1.start
label.kind = kind
} else break
}
this.labels.push({name: maybeName, kind: kind, statementStart: this.start})
node.body = this.parseStatement(true)
this.labels.pop()
node.label = expr
return this.finishNode(node, "LabeledStatement")
}
pp$1.parseExpressionStatement = function(node, expr) {
node.expression = expr
this.semicolon()
return this.finishNode(node, "ExpressionStatement")
}
// Parse a semicolon-enclosed block of statements, handling `"use
// strict"` declarations when `allowStrict` is true (used for
// function bodies).
pp$1.parseBlock = function(allowStrict) {
var this$1 = this;
var node = this.startNode(), first = true, oldStrict
node.body = []
this.expect(tt.braceL)
while (!this.eat(tt.braceR)) {
var stmt = this$1.parseStatement(true)
node.body.push(stmt)
if (first && allowStrict && this$1.isUseStrict(stmt)) {
oldStrict = this$1.strict
this$1.setStrict(this$1.strict = true)
}
first = false
}
if (oldStrict === false) this.setStrict(false)
return this.finishNode(node, "BlockStatement")
}
// Parse a regular `for` loop. The disambiguation code in
// `parseStatement` will already have parsed the init statement or
// expression.
pp$1.parseFor = function(node, init) {
node.init = init
this.expect(tt.semi)
node.test = this.type === tt.semi ? null : this.parseExpression()
this.expect(tt.semi)
node.update = this.type === tt.parenR ? null : this.parseExpression()
this.expect(tt.parenR)
node.body = this.parseStatement(false)
this.labels.pop()
return this.finishNode(node, "ForStatement")
}
// Parse a `for`/`in` and `for`/`of` loop, which are almost
// same from parser's perspective.
pp$1.parseForIn = function(node, init) {
var type = this.type === tt._in ? "ForInStatement" : "ForOfStatement"
this.next()
node.left = init
node.right = this.parseExpression()
this.expect(tt.parenR)
node.body = this.parseStatement(false)
this.labels.pop()
return this.finishNode(node, type)
}
// Parse a list of variable declarations.
pp$1.parseVar = function(node, isFor, kind) {
var this$1 = this;
node.declarations = []
node.kind = kind
for (;;) {
var decl = this$1.startNode()
this$1.parseVarId(decl)
if (this$1.eat(tt.eq)) {
decl.init = this$1.parseMaybeAssign(isFor)
} else if (kind === "const" && !(this$1.type === tt._in || (this$1.options.ecmaVersion >= 6 && this$1.isContextual("of")))) {
this$1.unexpected()
} else if (decl.id.type != "Identifier" && !(isFor && (this$1.type === tt._in || this$1.isContextual("of")))) {
this$1.raise(this$1.lastTokEnd, "Complex binding patterns require an initialization value")
} else {
decl.init = null
}
node.declarations.push(this$1.finishNode(decl, "VariableDeclarator"))
if (!this$1.eat(tt.comma)) break
}
return node
}
pp$1.parseVarId = function(decl) {
decl.id = this.parseBindingAtom()
this.checkLVal(decl.id, true)
}
// Parse a function declaration or literal (depending on the
// `isStatement` parameter).
pp$1.parseFunction = function(node, isStatement, allowExpressionBody) {
this.initFunction(node)
if (this.options.ecmaVersion >= 6)
node.generator = this.eat(tt.star)
var oldInGen = this.inGenerator
this.inGenerator = node.generator
if (isStatement || this.type === tt.name)
node.id = this.parseIdent()
this.parseFunctionParams(node)
this.parseFunctionBody(node, allowExpressionBody)
this.inGenerator = oldInGen
return this.finishNode(node, isStatement ? "FunctionDeclaration" : "FunctionExpression")
}
pp$1.parseFunctionParams = function(node) {
this.expect(tt.parenL)
node.params = this.parseBindingList(tt.parenR, false, false, true)
}
// Parse a class declaration or literal (depending on the
// `isStatement` parameter).
pp$1.parseClass = function(node, isStatement) {
var this$1 = this;
this.next()
this.parseClassId(node, isStatement)
this.parseClassSuper(node)
var classBody = this.startNode()
var hadConstructor = false
classBody.body = []
this.expect(tt.braceL)
while (!this.eat(tt.braceR)) {
if (this$1.eat(tt.semi)) continue
var method = this$1.startNode()
var isGenerator = this$1.eat(tt.star)
var isMaybeStatic = this$1.type === tt.name && this$1.value === "static"
this$1.parsePropertyName(method)
method.static = isMaybeStatic && this$1.type !== tt.parenL
if (method.static) {
if (isGenerator) this$1.unexpected()
isGenerator = this$1.eat(tt.star)
this$1.parsePropertyName(method)
}
method.kind = "method"
var isGetSet = false
if (!method.computed) {
var key = method.key;
if (!isGenerator && key.type === "Identifier" && this$1.type !== tt.parenL && (key.name === "get" || key.name === "set")) {
isGetSet = true
method.kind = key.name
key = this$1.parsePropertyName(method)
}
if (!method.static && (key.type === "Identifier" && key.name === "constructor" ||
key.type === "Literal" && key.value === "constructor")) {
if (hadConstructor) this$1.raise(key.start, "Duplicate constructor in the same class")
if (isGetSet) this$1.raise(key.start, "Constructor can't have get/set modifier")
if (isGenerator) this$1.raise(key.start, "Constructor can't be a generator")
method.kind = "constructor"
hadConstructor = true
}
}
this$1.parseClassMethod(classBody, method, isGenerator)
if (isGetSet) {
var paramCount = method.kind === "get" ? 0 : 1
if (method.value.params.length !== paramCount) {
var start = method.value.start
if (method.kind === "get")
this$1.raiseRecoverable(start, "getter should have no params")
else
this$1.raiseRecoverable(start, "setter should have exactly one param")
}
if (method.kind === "set" && method.value.params[0].type === "RestElement")
this$1.raise(method.value.params[0].start, "Setter cannot use rest params")
}
}
node.body = this.finishNode(classBody, "ClassBody")
return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression")
}
pp$1.parseClassMethod = function(classBody, method, isGenerator) {
method.value = this.parseMethod(isGenerator)
classBody.body.push(this.finishNode(method, "MethodDefinition"))
}
pp$1.parseClassId = function(node, isStatement) {
node.id = this.type === tt.name ? this.parseIdent() : isStatement ? this.unexpected() : null
}
pp$1.parseClassSuper = function(node) {
node.superClass = this.eat(tt._extends) ? this.parseExprSubscripts() : null
}
// Parses module export declaration.
pp$1.parseExport = function(node) {
var this$1 = this;
this.next()
// export * from '...'
if (this.eat(tt.star)) {
this.expectContextual("from")
node.source = this.type === tt.string ? this.parseExprAtom() : this.unexpected()
this.semicolon()
return this.finishNode(node, "ExportAllDeclaration")
}
if (this.eat(tt._default)) { // export default ...
var parens = this.type == tt.parenL
var expr = this.parseMaybeAssign()
var needsSemi = true
if (!parens && (expr.type == "FunctionExpression" ||
expr.type == "ClassExpression")) {
needsSemi = false
if (expr.id) {
expr.type = expr.type == "FunctionExpression"
? "FunctionDeclaration"
: "ClassDeclaration"
}
}
node.declaration = expr
if (needsSemi) this.semicolon()
return this.finishNode(node, "ExportDefaultDeclaration")
}
// export var|const|let|function|class ...
if (this.shouldParseExportStatement()) {
node.declaration = this.parseStatement(true)
node.specifiers = []
node.source = null
} else { // export { x, y as z } [from '...']
node.declaration = null
node.specifiers = this.parseExportSpecifiers()
if (this.eatContextual("from")) {
node.source = this.type === tt.string ? this.parseExprAtom() : this.unexpected()
} else {
// check for keywords used as local names
for (var i = 0; i < node.specifiers.length; i++) {
if (this$1.keywords.test(node.specifiers[i].local.name) || this$1.reservedWords.test(node.specifiers[i].local.name)) {
this$1.unexpected(node.specifiers[i].local.start)
}
}
node.source = null
}
this.semicolon()
}
return this.finishNode(node, "ExportNamedDeclaration")
}
pp$1.shouldParseExportStatement = function() {
return this.type.keyword || this.isLet()
}
// Parses a comma-separated list of module exports.
pp$1.parseExportSpecifiers = function() {
var this$1 = this;
var nodes = [], first = true
// export { x, y as z } [from '...']
this.expect(tt.braceL)
while (!this.eat(tt.braceR)) {
if (!first) {
this$1.expect(tt.comma)
if (this$1.afterTrailingComma(tt.braceR)) break
} else first = false
var node = this$1.startNode()
node.local = this$1.parseIdent(this$1.type === tt._default)
node.exported = this$1.eatContextual("as") ? this$1.parseIdent(true) : node.local
nodes.push(this$1.finishNode(node, "ExportSpecifier"))
}
return nodes
}
// Parses import declaration.
pp$1.parseImport = function(node) {
this.next()
// import '...'
if (this.type === tt.string) {
node.specifiers = empty
node.source = this.parseExprAtom()
} else {
node.specifiers = this.parseImportSpecifiers()
this.expectContextual("from")
node.source = this.type === tt.string ? this.parseExprAtom() : this.unexpected()
}
this.semicolon()
return this.finishNode(node, "ImportDeclaration")
}
// Parses a comma-separated list of module imports.
pp$1.parseImportSpecifiers = function() {
var this$1 = this;
var nodes = [], first = true
if (this.type === tt.name) {
// import defaultObj, { x, y as z } from '...'
var node = this.startNode()
node.local = this.parseIdent()
this.checkLVal(node.local, true)
nodes.push(this.finishNode(node, "ImportDefaultSpecifier"))
if (!this.eat(tt.comma)) return nodes
}
if (this.type === tt.star) {
var node$1 = this.startNode()
this.next()
this.expectContextual("as")
node$1.local = this.parseIdent()
this.checkLVal(node$1.local, true)
nodes.push(this.finishNode(node$1, "ImportNamespaceSpecifier"))
return nodes
}
this.expect(tt.braceL)
while (!this.eat(tt.braceR)) {
if (!first) {
this$1.expect(tt.comma)
if (this$1.afterTrailingComma(tt.braceR)) break
} else first = false
var node$2 = this$1.startNode()
node$2.imported = this$1.parseIdent(true)
if (this$1.eatContextual("as")) {
node$2.local = this$1.parseIdent()
} else {
node$2.local = node$2.imported
if (this$1.isKeyword(node$2.local.name)) this$1.unexpected(node$2.local.start)
if (this$1.reservedWordsStrict.test(node$2.local.name)) this$1.raise(node$2.local.start, "The keyword '" + node$2.local.name + "' is reserved")
}
this$1.checkLVal(node$2.local, true)
nodes.push(this$1.finishNode(node$2, "ImportSpecifier"))
}
return nodes
}
var pp$2 = Parser.prototype
// Convert existing expression atom to assignable pattern
// if possible.
pp$2.toAssignable = function(node, isBinding) {
var this$1 = this;
if (this.options.ecmaVersion >= 6 && node) {
switch (node.type) {
case "Identifier":
case "ObjectPattern":
case "ArrayPattern":
break
case "ObjectExpression":
node.type = "ObjectPattern"
for (var i = 0; i < node.properties.length; i++) {
var prop = node.properties[i]
if (prop.kind !== "init") this$1.raise(prop.key.start, "Object pattern can't contain getter or setter")
this$1.toAssignable(prop.value, isBinding)
}
break
case "ArrayExpression":
node.type = "ArrayPattern"
this.toAssignableList(node.elements, isBinding)
break
case "AssignmentExpression":
if (node.operator === "=") {
node.type = "AssignmentPattern"
delete node.operator
// falls through to AssignmentPattern
} else {
this.raise(node.left.end, "Only '=' operator can be used for specifying default value.")
break
}
case "AssignmentPattern":
if (node.right.type === "YieldExpression")
this.raise(node.right.start, "Yield expression cannot be a default value")
break
case "ParenthesizedExpression":
node.expression = this.toAssignable(node.expression, isBinding)
break
case "MemberExpression":
if (!isBinding) break
default:
this.raise(node.start, "Assigning to rvalue")
}
}
return node
}
// Convert list of expression atoms to binding list.
pp$2.toAssignableList = function(exprList, isBinding) {
var this$1 = this;
var end = exprList.length
if (end) {
var last = exprList[end - 1]
if (last && last.type == "RestElement") {
--end
} else if (last && last.type == "SpreadElement") {
last.type = "RestElement"
var arg = last.argument
this.toAssignable(arg, isBinding)
if (arg.type !== "Identifier" && arg.type !== "MemberExpression" && arg.type !== "ArrayPattern")
this.unexpected(arg.start)
--end
}
if (isBinding && last && last.type === "RestElement" && last.argument.type !== "Identifier")
this.unexpected(last.argument.start)
}
for (var i = 0; i < end; i++) {
var elt = exprList[i]
if (elt) this$1.toAssignable(elt, isBinding)
}
return exprList
}
// Parses spread element.
pp$2.parseSpread = function(refDestructuringErrors) {
var node = this.startNode()
this.next()
node.argument = this.parseMaybeAssign(false, refDestructuringErrors)
return this.finishNode(node, "SpreadElement")
}
pp$2.parseRest = function(allowNonIdent) {
var node = this.startNode()
this.next()
// RestElement inside of a function parameter must be an identifier
if (allowNonIdent) node.argument = this.type === tt.name ? this.parseIdent() : this.unexpected()
else node.argument = this.type === tt.name || this.type === tt.bracketL ? this.parseBindingAtom() : this.unexpected()
return this.finishNode(node, "RestElement")
}
// Parses lvalue (assignable) atom.
pp$2.parseBindingAtom = function() {
if (this.options.ecmaVersion < 6) return this.parseIdent()
switch (this.type) {
case tt.name:
return this.parseIdent()
case tt.bracketL:
var node = this.startNode()
this.next()
node.elements = this.parseBindingList(tt.bracketR, true, true)
return this.finishNode(node, "ArrayPattern")
case tt.braceL:
return this.parseObj(true)
default:
this.unexpected()
}
}
pp$2.parseBindingList = function(close, allowEmpty, allowTrailingComma, allowNonIdent) {
var this$1 = this;
var elts = [], first = true
while (!this.eat(close)) {
if (first) first = false
else this$1.expect(tt.comma)
if (allowEmpty && this$1.type === tt.comma) {
elts.push(null)
} else if (allowTrailingComma && this$1.afterTrailingComma(close)) {
break
} else if (this$1.type === tt.ellipsis) {
var rest = this$1.parseRest(allowNonIdent)
this$1.parseBindingListItem(rest)
elts.push(rest)
if (this$1.type === tt.comma) this$1.raise(this$1.start, "Comma is not permitted after the rest element")
this$1.expect(close)
break
} else {
var elem = this$1.parseMaybeDefault(this$1.start, this$1.startLoc)
this$1.parseBindingListItem(elem)
elts.push(elem)
}
}
return elts
}
pp$2.parseBindingListItem = function(param) {
return param
}
// Parses assignment pattern around given atom if possible.
pp$2.parseMaybeDefault = function(startPos, startLoc, left) {
left = left || this.parseBindingAtom()
if (this.options.ecmaVersion < 6 || !this.eat(tt.eq)) return left
var node = this.startNodeAt(startPos, startLoc)
node.left = left
node.right = this.parseMaybeAssign()
return this.finishNode(node, "AssignmentPattern")
}
// Verify that a node is an lval — something that can be assigned
// to.
pp$2.checkLVal = function(expr, isBinding, checkClashes) {
var this$1 = this;
switch (expr.type) {
case "Identifier":
if (this.strict && this.reservedWordsStrictBind.test(expr.name))
this.raiseRecoverable(expr.start, (isBinding ? "Binding " : "Assigning to ") + expr.name + " in strict mode")
if (checkClashes) {
if (has(checkClashes, expr.name))
this.raiseRecoverable(expr.start, "Argument name clash")
checkClashes[expr.name] = true
}
break
case "MemberExpression":
if (isBinding) this.raiseRecoverable(expr.start, (isBinding ? "Binding" : "Assigning to") + " member expression")
break
case "ObjectPattern":
for (var i = 0; i < expr.properties.length; i++)
this$1.checkLVal(expr.properties[i].value, isBinding, checkClashes)
break
case "ArrayPattern":
for (var i$1 = 0; i$1 < expr.elements.length; i$1++) {
var elem = expr.elements[i$1]
if (elem) this$1.checkLVal(elem, isBinding, checkClashes)
}
break
case "AssignmentPattern":
this.checkLVal(expr.left, isBinding, checkClashes)
break
case "RestElement":
this.checkLVal(expr.argument, isBinding, checkClashes)
break
case "ParenthesizedExpression":
this.checkLVal(expr.expression, isBinding, checkClashes)
break
default:
this.raise(expr.start, (isBinding ? "Binding" : "Assigning to") + " rvalue")
}
}
var pp$3 = Parser.prototype
// Check if property name clashes with already added.
// Object/class getters and setters are not allowed to clash —
// either with each other or with an init property — and in
// strict mode, init properties are also not allowed to be repeated.
pp$3.checkPropClash = function(prop, propHash) {
if (this.options.ecmaVersion >= 6 && (prop.computed || prop.method || prop.shorthand))
return
var key = prop.key;
var name
switch (key.type) {
case "Identifier": name = key.name; break
case "Literal": name = String(key.value); break
default: return
}
var kind = prop.kind;
if (this.options.ecmaVersion >= 6) {
if (name === "__proto__" && kind === "init") {
if (propHash.proto) this.raiseRecoverable(key.start, "Redefinition of __proto__ property")
propHash.proto = true
}
return
}
name = "$" + name
var other = propHash[name]
if (other) {
var isGetSet = kind !== "init"
if ((this.strict || isGetSet) && other[kind] || !(isGetSet ^ other.init))
this.raiseRecoverable(key.start, "Redefinition of property")
} else {
other = propHash[name] = {
init: false,
get: false,
set: false
}
}
other[kind] = true
}
// ### Expression parsing
// These nest, from the most general expression type at the top to
// 'atomic', nondivisible expression types at the bottom. Most of
// the functions will simply let the function(s) below them parse,
// and, *if* the syntactic construct they handle is present, wrap
// the AST node that the inner parser gave them in another node.
// Parse a full expression. The optional arguments are used to
// forbid the `in` operator (in for loops initalization expressions)
// and provide reference for storing '=' operator inside shorthand
// property assignment in contexts where both object expression
// and object pattern might appear (so it's possible to raise
// delayed syntax error at correct position).
pp$3.parseExpression = function(noIn, refDestructuringErrors) {
var this$1 = this;
var startPos = this.start, startLoc = this.startLoc
var expr = this.parseMaybeAssign(noIn, refDestructuringErrors)
if (this.type === tt.comma) {
var node = this.startNodeAt(startPos, startLoc)
node.expressions = [expr]
while (this.eat(tt.comma)) node.expressions.push(this$1.parseMaybeAssign(noIn, refDestructuringErrors))
return this.finishNode(node, "SequenceExpression")
}
return expr
}
// Parse an assignment expression. This includes applications of
// operators like `+=`.
pp$3.parseMaybeAssign = function(noIn, refDestructuringErrors, afterLeftParse) {
if (this.inGenerator && this.isContextual("yield")) return this.parseYield()
var ownDestructuringErrors = false
if (!refDestructuringErrors) {
refDestructuringErrors = new DestructuringErrors
ownDestructuringErrors = true
}
var startPos = this.start, startLoc = this.startLoc
if (this.type == tt.parenL || this.type == tt.name)
this.potentialArrowAt = this.start
var left = this.parseMaybeConditional(noIn, refDestructuringErrors)
if (afterLeftParse) left = afterLeftParse.call(this, left, startPos, startLoc)
if (this.type.isAssign) {
this.checkPatternErrors(refDestructuringErrors, true)
if (!ownDestructuringErrors) DestructuringErrors.call(refDestructuringErrors)
var node = this.startNodeAt(startPos, startLoc)
node.operator = this.value
node.left = this.type === tt.eq ? this.toAssignable(left) : left
refDestructuringErrors.shorthandAssign = 0 // reset because shorthand default was used correctly
this.checkLVal(left)
this.next()
node.right = this.parseMaybeAssign(noIn)
return this.finishNode(node, "AssignmentExpression")
} else {
if (ownDestructuringErrors) this.checkExpressionErrors(refDestructuringErrors, true)
}
return left
}
// Parse a ternary conditional (`?:`) operator.
pp$3.parseMaybeConditional = function(noIn, refDestructuringErrors) {
var startPos = this.start, startLoc = this.startLoc
var expr = this.parseExprOps(noIn, refDestructuringErrors)
if (this.checkExpressionErrors(refDestructuringErrors)) return expr
if (this.eat(tt.question)) {
var node = this.startNodeAt(startPos, startLoc)
node.test = expr
node.consequent = this.parseMaybeAssign()
this.expect(tt.colon)
node.alternate = this.parseMaybeAssign(noIn)
return this.finishNode(node, "ConditionalExpression")
}
return expr
}
// Start the precedence parser.
pp$3.parseExprOps = function(noIn, refDestructuringErrors) {
var startPos = this.start, startLoc = this.startLoc
var expr = this.parseMaybeUnary(refDestructuringErrors, false)
if (this.checkExpressionErrors(refDestructuringErrors)) return expr
return this.parseExprOp(expr, startPos, startLoc, -1, noIn)
}
// Parse binary operators with the operator precedence parsing
// algorithm. `left` is the left-hand side of the operator.
// `minPrec` provides context that allows the function to stop and
// defer further parser to one of its callers when it encounters an
// operator that has a lower precedence than the set it is parsing.
pp$3.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, noIn) {
var prec = this.type.binop
if (prec != null && (!noIn || this.type !== tt._in)) {
if (prec > minPrec) {
var logical = this.type === tt.logicalOR || this.type === tt.logicalAND
var op = this.value
this.next()
var startPos = this.start, startLoc = this.startLoc
var right = this.parseExprOp(this.parseMaybeUnary(null, false), startPos, startLoc, prec, noIn)
var node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical)
return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, noIn)
}
}
return left
}
pp$3.buildBinary = function(startPos, startLoc, left, right, op, logical) {
var node = this.startNodeAt(startPos, startLoc)
node.left = left
node.operator = op
node.right = right
return this.finishNode(node, logical ? "LogicalExpression" : "BinaryExpression")
}
// Parse unary operators, both prefix and postfix.
pp$3.parseMaybeUnary = function(refDestructuringErrors, sawUnary) {
var this$1 = this;
var startPos = this.start, startLoc = this.startLoc, expr
if (this.type.prefix) {
var node = this.startNode(), update = this.type === tt.incDec
node.operator = this.value
node.prefix = true
this.next()
node.argument = this.parseMaybeUnary(null, true)
this.checkExpressionErrors(refDestructuringErrors, true)
if (update) this.checkLVal(node.argument)
else if (this.strict && node.operator === "delete" &&
node.argument.type === "Identifier")
this.raiseRecoverable(node.start, "Deleting local variable in strict mode")
else sawUnary = true
expr = this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression")
} else {
expr = this.parseExprSubscripts(refDestructuringErrors)
if (this.checkExpressionErrors(refDestructuringErrors)) return expr
while (this.type.postfix && !this.canInsertSemicolon()) {
var node$1 = this$1.startNodeAt(startPos, startLoc)
node$1.operator = this$1.value
node$1.prefix = false
node$1.argument = expr
this$1.checkLVal(expr)
this$1.next()
expr = this$1.finishNode(node$1, "UpdateExpression")
}
}
if (!sawUnary && this.eat(tt.starstar))
return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, false), "**", false)
else
return expr
}
// Parse call, dot, and `[]`-subscript expressions.
pp$3.parseExprSubscripts = function(refDestructuringErrors) {
var startPos = this.start, startLoc = this.startLoc
var expr = this.parseExprAtom(refDestructuringErrors)
var skipArrowSubscripts = expr.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")"
if (this.checkExpressionErrors(refDestructuringErrors) || skipArrowSubscripts) return expr
return this.parseSubscripts(expr, startPos, startLoc)
}
pp$3.parseSubscripts = function(base, startPos, startLoc, noCalls) {
var this$1 = this;
for (;;) {
if (this$1.eat(tt.dot)) {
var node = this$1.startNodeAt(startPos, startLoc)
node.object = base
node.property = this$1.parseIdent(true)
node.computed = false
base = this$1.finishNode(node, "MemberExpression")
} else if (this$1.eat(tt.bracketL)) {
var node$1 = this$1.startNodeAt(startPos, startLoc)
node$1.object = base
node$1.property = this$1.parseExpression()
node$1.computed = true
this$1.expect(tt.bracketR)
base = this$1.finishNode(node$1, "MemberExpression")
} else if (!noCalls && this$1.eat(tt.parenL)) {
var node$2 = this$1.startNodeAt(startPos, startLoc)
node$2.callee = base
node$2.arguments = this$1.parseExprList(tt.parenR, false)
base = this$1.finishNode(node$2, "CallExpression")
} else if (this$1.type === tt.backQuote) {
var node$3 = this$1.startNodeAt(startPos, startLoc)
node$3.tag = base
node$3.quasi = this$1.parseTemplate()
base = this$1.finishNode(node$3, "TaggedTemplateExpression")
} else {
return base
}
}
}
// Parse an atomic expression — either a single token that is an
// expression, an expression started by a keyword like `function` or
// `new`, or an expression wrapped in punctuation like `()`, `[]`,
// or `{}`.
pp$3.parseExprAtom = function(refDestructuringErrors) {
var node, canBeArrow = this.potentialArrowAt == this.start
switch (this.type) {
case tt._super:
if (!this.inFunction)
this.raise(this.start, "'super' outside of function or class")
case tt._this:
var type = this.type === tt._this ? "ThisExpression" : "Super"
node = this.startNode()
this.next()
return this.finishNode(node, type)
case tt.name:
var startPos = this.start, startLoc = this.startLoc
var id = this.parseIdent(this.type !== tt.name)
if (canBeArrow && !this.canInsertSemicolon() && this.eat(tt.arrow))
return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id])
return id
case tt.regexp:
var value = this.value
node = this.parseLiteral(value.value)
node.regex = {pattern: value.pattern, flags: value.flags}
return node
case tt.num: case tt.string:
return this.parseLiteral(this.value)
case tt._null: case tt._true: case tt._false:
node = this.startNode()
node.value = this.type === tt._null ? null : this.type === tt._true
node.raw = this.type.keyword
this.next()
return this.finishNode(node, "Literal")
case tt.parenL:
return this.parseParenAndDistinguishExpression(canBeArrow)
case tt.bracketL:
node = this.startNode()
this.next()
node.elements = this.parseExprList(tt.bracketR, true, true, refDestructuringErrors)
return this.finishNode(node, "ArrayExpression")
case tt.braceL:
return this.parseObj(false, refDestructuringErrors)
case tt._function:
node = this.startNode()
this.next()
return this.parseFunction(node, false)
case tt._class:
return this.parseClass(this.startNode(), false)
case tt._new:
return this.parseNew()
case tt.backQuote:
return this.parseTemplate()
default:
this.unexpected()
}
}
pp$3.parseLiteral = function(value) {
var node = this.startNode()
node.value = value
node.raw = this.input.slice(this.start, this.end)
this.next()
return this.finishNode(node, "Literal")
}
pp$3.parseParenExpression = function() {
this.expect(tt.parenL)
var val = this.parseExpression()
this.expect(tt.parenR)
return val
}
pp$3.parseParenAndDistinguishExpression = function(canBeArrow) {
var this$1 = this;
var startPos = this.start, startLoc = this.startLoc, val
if (this.options.ecmaVersion >= 6) {
this.next()
var innerStartPos = this.start, innerStartLoc = this.startLoc
var exprList = [], first = true
var refDestructuringErrors = new DestructuringErrors, spreadStart, innerParenStart
while (this.type !== tt.parenR) {
first ? first = false : this$1.expect(tt.comma)
if (this$1.type === tt.ellipsis) {
spreadStart = this$1.start
exprList.push(this$1.parseParenItem(this$1.parseRest()))
break
} else {
if (this$1.type === tt.parenL && !innerParenStart) {
innerParenStart = this$1.start
}
exprList.push(this$1.parseMaybeAssign(false, refDestructuringErrors, this$1.parseParenItem))
}
}
var innerEndPos = this.start, innerEndLoc = this.startLoc
this.expect(tt.parenR)
if (canBeArrow && !this.canInsertSemicolon() && this.eat(tt.arrow)) {
this.checkPatternErrors(refDestructuringErrors, true)
if (innerParenStart) this.unexpected(innerParenStart)
return this.parseParenArrowList(startPos, startLoc, exprList)
}
if (!exprList.length) this.unexpected(this.lastTokStart)
if (spreadStart) this.unexpected(spreadStart)
this.checkExpressionErrors(refDestructuringErrors, true)
if (exprList.length > 1) {
val = this.startNodeAt(innerStartPos, innerStartLoc)
val.expressions = exprList
this.finishNodeAt(val, "SequenceExpression", innerEndPos, innerEndLoc)
} else {
val = exprList[0]
}
} else {
val = this.parseParenExpression()
}
if (this.options.preserveParens) {
var par = this.startNodeAt(startPos, startLoc)
par.expression = val
return this.finishNode(par, "ParenthesizedExpression")
} else {
return val
}
}
pp$3.parseParenItem = function(item) {
return item
}
pp$3.parseParenArrowList = function(startPos, startLoc, exprList) {
return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList)
}
// New's precedence is slightly tricky. It must allow its argument to
// be a `[]` or dot subscript expression, but not a call — at least,
// not without wrapping it in parentheses. Thus, it uses the noCalls
// argument to parseSubscripts to prevent it from consuming the
// argument list.
var empty$1 = []
pp$3.parseNew = function() {
var node = this.startNode()
var meta = this.parseIdent(true)
if (this.options.ecmaVersion >= 6 && this.eat(tt.dot)) {
node.meta = meta
node.property = this.parseIdent(true)
if (node.property.name !== "target")
this.raiseRecoverable(node.property.start, "The only valid meta property for new is new.target")
if (!this.inFunction)
this.raiseRecoverable(node.start, "new.target can only be used in functions")
return this.finishNode(node, "MetaProperty")
}
var startPos = this.start, startLoc = this.startLoc
node.callee = this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true)
if (this.eat(tt.parenL)) node.arguments = this.parseExprList(tt.parenR, false)
else node.arguments = empty$1
return this.finishNode(node, "NewExpression")
}
// Parse template expression.
pp$3.parseTemplateElement = function() {
var elem = this.startNode()
elem.value = {
raw: this.input.slice(this.start, this.end).replace(/\r\n?/g, '\n'),
cooked: this.value
}
this.next()
elem.tail = this.type === tt.backQuote
return this.finishNode(elem, "TemplateElement")
}
pp$3.parseTemplate = function() {
var this$1 = this;
var node = this.startNode()
this.next()
node.expressions = []
var curElt = this.parseTemplateElement()
node.quasis = [curElt]
while (!curElt.tail) {
this$1.expect(tt.dollarBraceL)
node.expressions.push(this$1.parseExpression())
this$1.expect(tt.braceR)
node.quasis.push(curElt = this$1.parseTemplateElement())
}
this.next()
return this.finishNode(node, "TemplateLiteral")
}
// Parse an object literal or binding pattern.
pp$3.parseObj = function(isPattern, refDestructuringErrors) {
var this$1 = this;
var node = this.startNode(), first = true, propHash = {}
node.properties = []
this.next()
while (!this.eat(tt.braceR)) {
if (!first) {
this$1.expect(tt.comma)
if (this$1.afterTrailingComma(tt.braceR)) break
} else first = false
var prop = this$1.startNode(), isGenerator, startPos, startLoc
if (this$1.options.ecmaVersion >= 6) {
prop.method = false
prop.shorthand = false
if (isPattern || refDestructuringErrors) {
startPos = this$1.start
startLoc = this$1.startLoc
}
if (!isPattern)
isGenerator = this$1.eat(tt.star)
}
this$1.parsePropertyName(prop)
this$1.parsePropertyValue(prop, isPattern, isGenerator, startPos, startLoc, refDestructuringErrors)
this$1.checkPropClash(prop, propHash)
node.properties.push(this$1.finishNode(prop, "Property"))
}
return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression")
}
pp$3.parsePropertyValue = function(prop, isPattern, isGenerator, startPos, startLoc, refDestructuringErrors) {
if (this.eat(tt.colon)) {
prop.value = isPattern ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(false, refDestructuringErrors)
prop.kind = "init"
} else if (this.options.ecmaVersion >= 6 && this.type === tt.parenL) {
if (isPattern) this.unexpected()
prop.kind = "init"
prop.method = true
prop.value = this.parseMethod(isGenerator)
} else if (this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === "Identifier" &&
(prop.key.name === "get" || prop.key.name === "set") &&
(this.type != tt.comma && this.type != tt.braceR)) {
if (isGenerator || isPattern) this.unexpected()
prop.kind = prop.key.name
this.parsePropertyName(prop)
prop.value = this.parseMethod(false)
var paramCount = prop.kind === "get" ? 0 : 1
if (prop.value.params.length !== paramCount) {
var start = prop.value.start
if (prop.kind === "get")
this.raiseRecoverable(start, "getter should have no params")
else
this.raiseRecoverable(start, "setter should have exactly one param")
}
if (prop.kind === "set" && prop.value.params[0].type === "RestElement")
this.raiseRecoverable(prop.value.params[0].start, "Setter cannot use rest params")
} else if (this.options.ecmaVersion >= 6 && !prop.computed && prop.key.type === "Identifier") {
if (this.keywords.test(prop.key.name) ||
(this.strict ? this.reservedWordsStrictBind : this.reservedWords).test(prop.key.name) ||
(this.inGenerator && prop.key.name == "yield"))
this.raiseRecoverable(prop.key.start, "'" + prop.key.name + "' can not be used as shorthand property")
prop.kind = "init"
if (isPattern) {
prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key)
} else if (this.type === tt.eq && refDestructuringErrors) {
if (!refDestructuringErrors.shorthandAssign)
refDestructuringErrors.shorthandAssign = this.start
prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key)
} else {
prop.value = prop.key
}
prop.shorthand = true
} else this.unexpected()
}
pp$3.parsePropertyName = function(prop) {
if (this.options.ecmaVersion >= 6) {
if (this.eat(tt.bracketL)) {
prop.computed = true
prop.key = this.parseMaybeAssign()
this.expect(tt.bracketR)
return prop.key
} else {
prop.computed = false
}
}
return prop.key = this.type === tt.num || this.type === tt.string ? this.parseExprAtom() : this.parseIdent(true)
}
// Initialize empty function node.
pp$3.initFunction = function(node) {
node.id = null
if (this.options.ecmaVersion >= 6) {
node.generator = false
node.expression = false
}
}
// Parse object or class method.
pp$3.parseMethod = function(isGenerator) {
var node = this.startNode(), oldInGen = this.inGenerator
this.inGenerator = isGenerator
this.initFunction(node)
this.expect(tt.parenL)
node.params = this.parseBindingList(tt.parenR, false, false)
if (this.options.ecmaVersion >= 6)
node.generator = isGenerator
this.parseFunctionBody(node, false)
this.inGenerator = oldInGen
return this.finishNode(node, "FunctionExpression")
}
// Parse arrow function expression with given parameters.
pp$3.parseArrowExpression = function(node, params) {
var oldInGen = this.inGenerator
this.inGenerator = false
this.initFunction(node)
node.params = this.toAssignableList(params, true)
this.parseFunctionBody(node, true)
this.inGenerator = oldInGen
return this.finishNode(node, "ArrowFunctionExpression")
}
// Parse function body and check parameters.
pp$3.parseFunctionBody = function(node, isArrowFunction) {
var isExpression = isArrowFunction && this.type !== tt.braceL
if (isExpression) {
node.body = this.parseMaybeAssign()
node.expression = true
} else {
// Start a new scope with regard to labels and the `inFunction`
// flag (restore them to their old value afterwards).
var oldInFunc = this.inFunction, oldLabels = this.labels
this.inFunction = true; this.labels = []
node.body = this.parseBlock(true)
node.expression = false
this.inFunction = oldInFunc; this.labels = oldLabels
}
// If this is a strict mode function, verify that argument names
// are not repeated, and it does not try to bind the words `eval`
// or `arguments`.
var useStrict = (!isExpression && node.body.body.length && this.isUseStrict(node.body.body[0])) ? node.body.body[0] : null;
if (this.strict || useStrict) {
var oldStrict = this.strict
this.strict = true
if (node.id)
this.checkLVal(node.id, true)
this.checkParams(node, useStrict)
this.strict = oldStrict
} else if (isArrowFunction) {
this.checkParams(node, useStrict)
}
}
// Checks function params for various disallowed patterns such as using "eval"
// or "arguments" and duplicate parameters.
pp$3.checkParams = function(node, useStrict) {
var this$1 = this;
var nameHash = {}
for (var i = 0; i < node.params.length; i++) {
if (useStrict && this$1.options.ecmaVersion >= 7 && node.params[i].type !== "Identifier")
this$1.raiseRecoverable(useStrict.start, "Illegal 'use strict' directive in function with non-simple parameter list");
this$1.checkLVal(node.params[i], true, nameHash)
}
}
// Parses a comma-separated list of expressions, and returns them as
// an array. `close` is the token type that ends the list, and
// `allowEmpty` can be turned on to allow subsequent commas with
// nothing in between them to be parsed as `null` (which is needed
// for array literals).
pp$3.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) {
var this$1 = this;
var elts = [], first = true
while (!this.eat(close)) {
if (!first) {
this$1.expect(tt.comma)
if (allowTrailingComma && this$1.afterTrailingComma(close)) break
} else first = false
var elt
if (allowEmpty && this$1.type === tt.comma)
elt = null
else if (this$1.type === tt.ellipsis) {
elt = this$1.parseSpread(refDestructuringErrors)
if (this$1.type === tt.comma && refDestructuringErrors && !refDestructuringErrors.trailingComma) {
refDestructuringErrors.trailingComma = this$1.lastTokStart
}
} else
elt = this$1.parseMaybeAssign(false, refDestructuringErrors)
elts.push(elt)
}
return elts
}
// Parse the next token as an identifier. If `liberal` is true (used
// when parsing properties), it will also convert keywords into
// identifiers.
pp$3.parseIdent = function(liberal) {
var node = this.startNode()
if (liberal && this.options.allowReserved == "never") liberal = false
if (this.type === tt.name) {
if (!liberal && (this.strict ? this.reservedWordsStrict : this.reservedWords).test(this.value) &&
(this.options.ecmaVersion >= 6 ||
this.input.slice(this.start, this.end).indexOf("\\") == -1))
this.raiseRecoverable(this.start, "The keyword '" + this.value + "' is reserved")
if (!liberal && this.inGenerator && this.value === "yield")
this.raiseRecoverable(this.start, "Can not use 'yield' as identifier inside a generator")
node.name = this.value
} else if (liberal && this.type.keyword) {
node.name = this.type.keyword
} else {
this.unexpected()
}
this.next()
return this.finishNode(node, "Identifier")
}
// Parses yield expression inside generator.
pp$3.parseYield = function() {
var node = this.startNode()
this.next()
if (this.type == tt.semi || this.canInsertSemicolon() || (this.type != tt.star && !this.type.startsExpr)) {
node.delegate = false
node.argument = null
} else {
node.delegate = this.eat(tt.star)
node.argument = this.parseMaybeAssign()
}
return this.finishNode(node, "YieldExpression")
}
var pp$4 = Parser.prototype
// This function is used to raise exceptions on parse errors. It
// takes an offset integer (into the current `input`) to indicate
// the location of the error, attaches the position to the end
// of the error message, and then raises a `SyntaxError` with that
// message.
pp$4.raise = function(pos, message) {
var loc = getLineInfo(this.input, pos)
message += " (" + loc.line + ":" + loc.column + ")"
var err = new SyntaxError(message)
err.pos = pos; err.loc = loc; err.raisedAt = this.pos
throw err
}
pp$4.raiseRecoverable = pp$4.raise
pp$4.curPosition = function() {
if (this.options.locations) {
return new Position(this.curLine, this.pos - this.lineStart)
}
}
var Node = function Node(parser, pos, loc) {
this.type = ""
this.start = pos
this.end = 0
if (parser.options.locations)
this.loc = new SourceLocation(parser, loc)
if (parser.options.directSourceFile)
this.sourceFile = parser.options.directSourceFile
if (parser.options.ranges)
this.range = [pos, 0]
};
// Start an AST node, attaching a start offset.
var pp$5 = Parser.prototype
pp$5.startNode = function() {
return new Node(this, this.start, this.startLoc)
}
pp$5.startNodeAt = function(pos, loc) {
return new Node(this, pos, loc)
}
// Finish an AST node, adding `type` and `end` properties.
function finishNodeAt(node, type, pos, loc) {
node.type = type
node.end = pos
if (this.options.locations)
node.loc.end = loc
if (this.options.ranges)
node.range[1] = pos
return node
}
pp$5.finishNode = function(node, type) {
return finishNodeAt.call(this, node, type, this.lastTokEnd, this.lastTokEndLoc)
}
// Finish node at given position
pp$5.finishNodeAt = function(node, type, pos, loc) {
return finishNodeAt.call(this, node, type, pos, loc)
}
var TokContext = function TokContext(token, isExpr, preserveSpace, override) {
this.token = token
this.isExpr = !!isExpr
this.preserveSpace = !!preserveSpace
this.override = override
};
var types = {
b_stat: new TokContext("{", false),
b_expr: new TokContext("{", true),
b_tmpl: new TokContext("${", true),
p_stat: new TokContext("(", false),
p_expr: new TokContext("(", true),
q_tmpl: new TokContext("`", true, true, function (p) { return p.readTmplToken(); }),
f_expr: new TokContext("function", true)
}
var pp$6 = Parser.prototype
pp$6.initialContext = function() {
return [types.b_stat]
}
pp$6.braceIsBlock = function(prevType) {
if (prevType === tt.colon) {
var parent = this.curContext()
if (parent === types.b_stat || parent === types.b_expr)
return !parent.isExpr
}
if (prevType === tt._return)
return lineBreak.test(this.input.slice(this.lastTokEnd, this.start))
if (prevType === tt._else || prevType === tt.semi || prevType === tt.eof || prevType === tt.parenR)
return true
if (prevType == tt.braceL)
return this.curContext() === types.b_stat
return !this.exprAllowed
}
pp$6.updateContext = function(prevType) {
var update, type = this.type
if (type.keyword && prevType == tt.dot)
this.exprAllowed = false
else if (update = type.updateContext)
update.call(this, prevType)
else
this.exprAllowed = type.beforeExpr
}
// Token-specific context update code
tt.parenR.updateContext = tt.braceR.updateContext = function() {
if (this.context.length == 1) {
this.exprAllowed = true
return
}
var out = this.context.pop()
if (out === types.b_stat && this.curContext() === types.f_expr) {
this.context.pop()
this.exprAllowed = false
} else if (out === types.b_tmpl) {
this.exprAllowed = true
} else {
this.exprAllowed = !out.isExpr
}
}
tt.braceL.updateContext = function(prevType) {
this.context.push(this.braceIsBlock(prevType) ? types.b_stat : types.b_expr)
this.exprAllowed = true
}
tt.dollarBraceL.updateContext = function() {
this.context.push(types.b_tmpl)
this.exprAllowed = true
}
tt.parenL.updateContext = function(prevType) {
var statementParens = prevType === tt._if || prevType === tt._for || prevType === tt._with || prevType === tt._while
this.context.push(statementParens ? types.p_stat : types.p_expr)
this.exprAllowed = true
}
tt.incDec.updateContext = function() {
// tokExprAllowed stays unchanged
}
tt._function.updateContext = function(prevType) {
if (prevType.beforeExpr && prevType !== tt.semi && prevType !== tt._else &&
!((prevType === tt.colon || prevType === tt.braceL) && this.curContext() === types.b_stat))
this.context.push(types.f_expr)
this.exprAllowed = false
}
tt.backQuote.updateContext = function() {
if (this.curContext() === types.q_tmpl)
this.context.pop()
else
this.context.push(types.q_tmpl)
this.exprAllowed = false
}
// Object type used to represent tokens. Note that normally, tokens
// simply exist as properties on the parser object. This is only
// used for the onToken callback and the external tokenizer.
var Token = function Token(p) {
this.type = p.type
this.value = p.value
this.start = p.start
this.end = p.end
if (p.options.locations)
this.loc = new SourceLocation(p, p.startLoc, p.endLoc)
if (p.options.ranges)
this.range = [p.start, p.end]
};
// ## Tokenizer
var pp$7 = Parser.prototype
// Are we running under Rhino?
var isRhino = typeof Packages == "object" && Object.prototype.toString.call(Packages) == "[object JavaPackage]"
// Move to the next token
pp$7.next = function() {
if (this.options.onToken)
this.options.onToken(new Token(this))
this.lastTokEnd = this.end
this.lastTokStart = this.start
this.lastTokEndLoc = this.endLoc
this.lastTokStartLoc = this.startLoc
this.nextToken()
}
pp$7.getToken = function() {
this.next()
return new Token(this)
}
// If we're in an ES6 environment, make parsers iterable
if (typeof Symbol !== "undefined")
pp$7[Symbol.iterator] = function () {
var self = this
return {next: function () {
var token = self.getToken()
return {
done: token.type === tt.eof,
value: token
}
}}
}
// Toggle strict mode. Re-reads the next number or string to please
// pedantic tests (`"use strict"; 010;` should fail).
pp$7.setStrict = function(strict) {
var this$1 = this;
this.strict = strict
if (this.type !== tt.num && this.type !== tt.string) return
this.pos = this.start
if (this.options.locations) {
while (this.pos < this.lineStart) {
this$1.lineStart = this$1.input.lastIndexOf("\n", this$1.lineStart - 2) + 1
--this$1.curLine
}
}
this.nextToken()
}
pp$7.curContext = function() {
return this.context[this.context.length - 1]
}
// Read a single token, updating the parser object's token-related
// properties.
pp$7.nextToken = function() {
var curContext = this.curContext()
if (!curContext || !curContext.preserveSpace) this.skipSpace()
this.start = this.pos
if (this.options.locations) this.startLoc = this.curPosition()
if (this.pos >= this.input.length) return this.finishToken(tt.eof)
if (curContext.override) return curContext.override(this)
else this.readToken(this.fullCharCodeAtPos())
}
pp$7.readToken = function(code) {
// Identifier or keyword. '\uXXXX' sequences are allowed in
// identifiers, so '\' also dispatches to that.
if (isIdentifierStart(code, this.options.ecmaVersion >= 6) || code === 92 /* '\' */)
return this.readWord()
return this.getTokenFromCode(code)
}
pp$7.fullCharCodeAtPos = function() {
var code = this.input.charCodeAt(this.pos)
if (code <= 0xd7ff || code >= 0xe000) return code
var next = this.input.charCodeAt(this.pos + 1)
return (code << 10) + next - 0x35fdc00
}
pp$7.skipBlockComment = function() {
var this$1 = this;
var startLoc = this.options.onComment && this.curPosition()
var start = this.pos, end = this.input.indexOf("*/", this.pos += 2)
if (end === -1) this.raise(this.pos - 2, "Unterminated comment")
this.pos = end + 2
if (this.options.locations) {
lineBreakG.lastIndex = start
var match
while ((match = lineBreakG.exec(this.input)) && match.index < this.pos) {
++this$1.curLine
this$1.lineStart = match.index + match[0].length
}
}
if (this.options.onComment)
this.options.onComment(true, this.input.slice(start + 2, end), start, this.pos,
startLoc, this.curPosition())
}
pp$7.skipLineComment = function(startSkip) {
var this$1 = this;
var start = this.pos
var startLoc = this.options.onComment && this.curPosition()
var ch = this.input.charCodeAt(this.pos+=startSkip)
while (this.pos < this.input.length && ch !== 10 && ch !== 13 && ch !== 8232 && ch !== 8233) {
++this$1.pos
ch = this$1.input.charCodeAt(this$1.pos)
}
if (this.options.onComment)
this.options.onComment(false, this.input.slice(start + startSkip, this.pos), start, this.pos,
startLoc, this.curPosition())
}
// Called at the start of the parse and after every token. Skips
// whitespace and comments, and.
pp$7.skipSpace = function() {
var this$1 = this;
loop: while (this.pos < this.input.length) {
var ch = this$1.input.charCodeAt(this$1.pos)
switch (ch) {
case 32: case 160: // ' '
++this$1.pos
break
case 13:
if (this$1.input.charCodeAt(this$1.pos + 1) === 10) {
++this$1.pos
}
case 10: case 8232: case 8233:
++this$1.pos
if (this$1.options.locations) {
++this$1.curLine
this$1.lineStart = this$1.pos
}
break
case 47: // '/'
switch (this$1.input.charCodeAt(this$1.pos + 1)) {
case 42: // '*'
this$1.skipBlockComment()
break
case 47:
this$1.skipLineComment(2)
break
default:
break loop
}
break
default:
if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) {
++this$1.pos
} else {
break loop
}
}
}
}
// Called at the end of every token. Sets `end`, `val`, and
// maintains `context` and `exprAllowed`, and skips the space after
// the token, so that the next one's `start` will point at the
// right position.
pp$7.finishToken = function(type, val) {
this.end = this.pos
if (this.options.locations) this.endLoc = this.curPosition()
var prevType = this.type
this.type = type
this.value = val
this.updateContext(prevType)
}
// ### Token reading
// This is the function that is called to fetch the next token. It
// is somewhat obscure, because it works in character codes rather
// than characters, and because operator parsing has been inlined
// into it.
//
// All in the name of speed.
//
pp$7.readToken_dot = function() {
var next = this.input.charCodeAt(this.pos + 1)
if (next >= 48 && next <= 57) return this.readNumber(true)
var next2 = this.input.charCodeAt(this.pos + 2)
if (this.options.ecmaVersion >= 6 && next === 46 && next2 === 46) { // 46 = dot '.'
this.pos += 3
return this.finishToken(tt.ellipsis)
} else {
++this.pos
return this.finishToken(tt.dot)
}
}
pp$7.readToken_slash = function() { // '/'
var next = this.input.charCodeAt(this.pos + 1)
if (this.exprAllowed) {++this.pos; return this.readRegexp()}
if (next === 61) return this.finishOp(tt.assign, 2)
return this.finishOp(tt.slash, 1)
}
pp$7.readToken_mult_modulo_exp = function(code) { // '%*'
var next = this.input.charCodeAt(this.pos + 1)
var size = 1
var tokentype = code === 42 ? tt.star : tt.modulo
// exponentiation operator ** and **=
if (this.options.ecmaVersion >= 7 && next === 42) {
++size
tokentype = tt.starstar
next = this.input.charCodeAt(this.pos + 2)
}
if (next === 61) return this.finishOp(tt.assign, size + 1)
return this.finishOp(tokentype, size)
}
pp$7.readToken_pipe_amp = function(code) { // '|&'
var next = this.input.charCodeAt(this.pos + 1)
if (next === code) return this.finishOp(code === 124 ? tt.logicalOR : tt.logicalAND, 2)
if (next === 61) return this.finishOp(tt.assign, 2)
return this.finishOp(code === 124 ? tt.bitwiseOR : tt.bitwiseAND, 1)
}
pp$7.readToken_caret = function() { // '^'
var next = this.input.charCodeAt(this.pos + 1)
if (next === 61) return this.finishOp(tt.assign, 2)
return this.finishOp(tt.bitwiseXOR, 1)
}
pp$7.readToken_plus_min = function(code) { // '+-'
var next = this.input.charCodeAt(this.pos + 1)
if (next === code) {
if (next == 45 && this.input.charCodeAt(this.pos + 2) == 62 &&
lineBreak.test(this.input.slice(this.lastTokEnd, this.pos))) {
// A `-->` line comment
this.skipLineComment(3)
this.skipSpace()
return this.nextToken()
}
return this.finishOp(tt.incDec, 2)
}
if (next === 61) return this.finishOp(tt.assign, 2)
return this.finishOp(tt.plusMin, 1)
}
pp$7.readToken_lt_gt = function(code) { // '<>'
var next = this.input.charCodeAt(this.pos + 1)
var size = 1
if (next === code) {
size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2
if (this.input.charCodeAt(this.pos + size) === 61) return this.finishOp(tt.assign, size + 1)
return this.finishOp(tt.bitShift, size)
}
if (next == 33 && code == 60 && this.input.charCodeAt(this.pos + 2) == 45 &&
this.input.charCodeAt(this.pos + 3) == 45) {
if (this.inModule) this.unexpected()
// `<!--`, an XML-style comment that should be interpreted as a line comment
this.skipLineComment(4)
this.skipSpace()
return this.nextToken()
}
if (next === 61) size = 2
return this.finishOp(tt.relational, size)
}
pp$7.readToken_eq_excl = function(code) { // '=!'
var next = this.input.charCodeAt(this.pos + 1)
if (next === 61) return this.finishOp(tt.equality, this.input.charCodeAt(this.pos + 2) === 61 ? 3 : 2)
if (code === 61 && next === 62 && this.options.ecmaVersion >= 6) { // '=>'
this.pos += 2
return this.finishToken(tt.arrow)
}
return this.finishOp(code === 61 ? tt.eq : tt.prefix, 1)
}
pp$7.getTokenFromCode = function(code) {
switch (code) {
// The interpretation of a dot depends on whether it is followed
// by a digit or another two dots.
case 46: // '.'
return this.readToken_dot()
// Punctuation tokens.
case 40: ++this.pos; return this.finishToken(tt.parenL)
case 41: ++this.pos; return this.finishToken(tt.parenR)
case 59: ++this.pos; return this.finishToken(tt.semi)
case 44: ++this.pos; return this.finishToken(tt.comma)
case 91: ++this.pos; return this.finishToken(tt.bracketL)
case 93: ++this.pos; return this.finishToken(tt.bracketR)
case 123: ++this.pos; return this.finishToken(tt.braceL)
case 125: ++this.pos; return this.finishToken(tt.braceR)
case 58: ++this.pos; return this.finishToken(tt.colon)
case 63: ++this.pos; return this.finishToken(tt.question)
case 96: // '`'
if (this.options.ecmaVersion < 6) break
++this.pos
return this.finishToken(tt.backQuote)
case 48: // '0'
var next = this.input.charCodeAt(this.pos + 1)
if (next === 120 || next === 88) return this.readRadixNumber(16) // '0x', '0X' - hex number
if (this.options.ecmaVersion >= 6) {
if (next === 111 || next === 79) return this.readRadixNumber(8) // '0o', '0O' - octal number
if (next === 98 || next === 66) return this.readRadixNumber(2) // '0b', '0B' - binary number
}
// Anything else beginning with a digit is an integer, octal
// number, or float.
case 49: case 50: case 51: case 52: case 53: case 54: case 55: case 56: case 57: // 1-9
return this.readNumber(false)
// Quotes produce strings.
case 34: case 39: // '"', "'"
return this.readString(code)
// Operators are parsed inline in tiny state machines. '=' (61) is
// often referred to. `finishOp` simply skips the amount of
// characters it is given as second argument, and returns a token
// of the type given by its first argument.
case 47: // '/'
return this.readToken_slash()
case 37: case 42: // '%*'
return this.readToken_mult_modulo_exp(code)
case 124: case 38: // '|&'
return this.readToken_pipe_amp(code)
case 94: // '^'
return this.readToken_caret()
case 43: case 45: // '+-'
return this.readToken_plus_min(code)
case 60: case 62: // '<>'
return this.readToken_lt_gt(code)
case 61: case 33: // '=!'
return this.readToken_eq_excl(code)
case 126: // '~'
return this.finishOp(tt.prefix, 1)
}
this.raise(this.pos, "Unexpected character '" + codePointToString(code) + "'")
}
pp$7.finishOp = function(type, size) {
var str = this.input.slice(this.pos, this.pos + size)
this.pos += size
return this.finishToken(type, str)
}
// Parse a regular expression. Some context-awareness is necessary,
// since a '/' inside a '[]' set does not end the expression.
function tryCreateRegexp(src, flags, throwErrorAt, parser) {
try {
return new RegExp(src, flags)
} catch (e) {
if (throwErrorAt !== undefined) {
if (e instanceof SyntaxError) parser.raise(throwErrorAt, "Error parsing regular expression: " + e.message)
throw e
}
}
}
var regexpUnicodeSupport = !!tryCreateRegexp("\uffff", "u")
pp$7.readRegexp = function() {
var this$1 = this;
var escaped, inClass, start = this.pos
for (;;) {
if (this$1.pos >= this$1.input.length) this$1.raise(start, "Unterminated regular expression")
var ch = this$1.input.charAt(this$1.pos)
if (lineBreak.test(ch)) this$1.raise(start, "Unterminated regular expression")
if (!escaped) {
if (ch === "[") inClass = true
else if (ch === "]" && inClass) inClass = false
else if (ch === "/" && !inClass) break
escaped = ch === "\\"
} else escaped = false
++this$1.pos
}
var content = this.input.slice(start, this.pos)
++this.pos
// Need to use `readWord1` because '\uXXXX' sequences are allowed
// here (don't ask).
var mods = this.readWord1()
var tmp = content, tmpFlags = ""
if (mods) {
var validFlags = /^[gim]*$/
if (this.options.ecmaVersion >= 6) validFlags = /^[gimuy]*$/
if (!validFlags.test(mods)) this.raise(start, "Invalid regular expression flag")
if (mods.indexOf("u") >= 0) {
if (regexpUnicodeSupport) {
tmpFlags = "u"
} else {
// Replace each astral symbol and every Unicode escape sequence that
// possibly represents an astral symbol or a paired surrogate with a
// single ASCII symbol to avoid throwing on regular expressions that
// are only valid in combination with the `/u` flag.
// Note: replacing with the ASCII symbol `x` might cause false
// negatives in unlikely scenarios. For example, `[\u{61}-b]` is a
// perfectly valid pattern that is equivalent to `[a-b]`, but it would
// be replaced by `[x-b]` which throws an error.
tmp = tmp.replace(/\\u\{([0-9a-fA-F]+)\}/g, function (_match, code, offset) {
code = Number("0x" + code)
if (code > 0x10FFFF) this$1.raise(start + offset + 3, "Code point out of bounds")
return "x"
})
tmp = tmp.replace(/\\u([a-fA-F0-9]{4})|[\uD800-\uDBFF][\uDC00-\uDFFF]/g, "x")
tmpFlags = tmpFlags.replace("u", "")
}
}
}
// Detect invalid regular expressions.
var value = null
// Rhino's regular expression parser is flaky and throws uncatchable exceptions,
// so don't do detection if we are running under Rhino
if (!isRhino) {
tryCreateRegexp(tmp, tmpFlags, start, this)
// Get a regular expression object for this pattern-flag pair, or `null` in
// case the current environment doesn't support the flags it uses.
value = tryCreateRegexp(content, mods)
}
return this.finishToken(tt.regexp, {pattern: content, flags: mods, value: value})
}
// Read an integer in the given radix. Return null if zero digits
// were read, the integer value otherwise. When `len` is given, this
// will return `null` unless the integer has exactly `len` digits.
pp$7.readInt = function(radix, len) {
var this$1 = this;
var start = this.pos, total = 0
for (var i = 0, e = len == null ? Infinity : len; i < e; ++i) {
var code = this$1.input.charCodeAt(this$1.pos), val
if (code >= 97) val = code - 97 + 10 // a
else if (code >= 65) val = code - 65 + 10 // A
else if (code >= 48 && code <= 57) val = code - 48 // 0-9
else val = Infinity
if (val >= radix) break
++this$1.pos
total = total * radix + val
}
if (this.pos === start || len != null && this.pos - start !== len) return null
return total
}
pp$7.readRadixNumber = function(radix) {
this.pos += 2 // 0x
var val = this.readInt(radix)
if (val == null) this.raise(this.start + 2, "Expected number in radix " + radix)
if (isIdentifierStart(this.fullCharCodeAtPos())) this.raise(this.pos, "Identifier directly after number")
return this.finishToken(tt.num, val)
}
// Read an integer, octal integer, or floating-point number.
pp$7.readNumber = function(startsWithDot) {
var start = this.pos, isFloat = false, octal = this.input.charCodeAt(this.pos) === 48
if (!startsWithDot && this.readInt(10) === null) this.raise(start, "Invalid number")
var next = this.input.charCodeAt(this.pos)
if (next === 46) { // '.'
++this.pos
this.readInt(10)
isFloat = true
next = this.input.charCodeAt(this.pos)
}
if (next === 69 || next === 101) { // 'eE'
next = this.input.charCodeAt(++this.pos)
if (next === 43 || next === 45) ++this.pos // '+-'
if (this.readInt(10) === null) this.raise(start, "Invalid number")
isFloat = true
}
if (isIdentifierStart(this.fullCharCodeAtPos())) this.raise(this.pos, "Identifier directly after number")
var str = this.input.slice(start, this.pos), val
if (isFloat) val = parseFloat(str)
else if (!octal || str.length === 1) val = parseInt(str, 10)
else if (/[89]/.test(str) || this.strict) this.raise(start, "Invalid number")
else val = parseInt(str, 8)
return this.finishToken(tt.num, val)
}
// Read a string value, interpreting backslash-escapes.
pp$7.readCodePoint = function() {
var ch = this.input.charCodeAt(this.pos), code
if (ch === 123) {
if (this.options.ecmaVersion < 6) this.unexpected()
var codePos = ++this.pos
code = this.readHexChar(this.input.indexOf('}', this.pos) - this.pos)
++this.pos
if (code > 0x10FFFF) this.raise(codePos, "Code point out of bounds")
} else {
code = this.readHexChar(4)
}
return code
}
function codePointToString(code) {
// UTF-16 Decoding
if (code <= 0xFFFF) return String.fromCharCode(code)
code -= 0x10000
return String.fromCharCode((code >> 10) + 0xD800, (code & 1023) + 0xDC00)
}
pp$7.readString = function(quote) {
var this$1 = this;
var out = "", chunkStart = ++this.pos
for (;;) {
if (this$1.pos >= this$1.input.length) this$1.raise(this$1.start, "Unterminated string constant")
var ch = this$1.input.charCodeAt(this$1.pos)
if (ch === quote) break
if (ch === 92) { // '\'
out += this$1.input.slice(chunkStart, this$1.pos)
out += this$1.readEscapedChar(false)
chunkStart = this$1.pos
} else {
if (isNewLine(ch)) this$1.raise(this$1.start, "Unterminated string constant")
++this$1.pos
}
}
out += this.input.slice(chunkStart, this.pos++)
return this.finishToken(tt.string, out)
}
// Reads template string tokens.
pp$7.readTmplToken = function() {
var this$1 = this;
var out = "", chunkStart = this.pos
for (;;) {
if (this$1.pos >= this$1.input.length) this$1.raise(this$1.start, "Unterminated template")
var ch = this$1.input.charCodeAt(this$1.pos)
if (ch === 96 || ch === 36 && this$1.input.charCodeAt(this$1.pos + 1) === 123) { // '`', '${'
if (this$1.pos === this$1.start && this$1.type === tt.template) {
if (ch === 36) {
this$1.pos += 2
return this$1.finishToken(tt.dollarBraceL)
} else {
++this$1.pos
return this$1.finishToken(tt.backQuote)
}
}
out += this$1.input.slice(chunkStart, this$1.pos)
return this$1.finishToken(tt.template, out)
}
if (ch === 92) { // '\'
out += this$1.input.slice(chunkStart, this$1.pos)
out += this$1.readEscapedChar(true)
chunkStart = this$1.pos
} else if (isNewLine(ch)) {
out += this$1.input.slice(chunkStart, this$1.pos)
++this$1.pos
switch (ch) {
case 13:
if (this$1.input.charCodeAt(this$1.pos) === 10) ++this$1.pos
case 10:
out += "\n"
break
default:
out += String.fromCharCode(ch)
break
}
if (this$1.options.locations) {
++this$1.curLine
this$1.lineStart = this$1.pos
}
chunkStart = this$1.pos
} else {
++this$1.pos
}
}
}
// Used to read escaped characters
pp$7.readEscapedChar = function(inTemplate) {
var ch = this.input.charCodeAt(++this.pos)
++this.pos
switch (ch) {
case 110: return "\n" // 'n' -> '\n'
case 114: return "\r" // 'r' -> '\r'
case 120: return String.fromCharCode(this.readHexChar(2)) // 'x'
case 117: return codePointToString(this.readCodePoint()) // 'u'
case 116: return "\t" // 't' -> '\t'
case 98: return "\b" // 'b' -> '\b'
case 118: return "\u000b" // 'v' -> '\u000b'
case 102: return "\f" // 'f' -> '\f'
case 13: if (this.input.charCodeAt(this.pos) === 10) ++this.pos // '\r\n'
case 10: // ' \n'
if (this.options.locations) { this.lineStart = this.pos; ++this.curLine }
return ""
default:
if (ch >= 48 && ch <= 55) {
var octalStr = this.input.substr(this.pos - 1, 3).match(/^[0-7]+/)[0]
var octal = parseInt(octalStr, 8)
if (octal > 255) {
octalStr = octalStr.slice(0, -1)
octal = parseInt(octalStr, 8)
}
if (octalStr !== "0" && (this.strict || inTemplate)) {
this.raise(this.pos - 2, "Octal literal in strict mode")
}
this.pos += octalStr.length - 1
return String.fromCharCode(octal)
}
return String.fromCharCode(ch)
}
}
// Used to read character escape sequences ('\x', '\u', '\U').
pp$7.readHexChar = function(len) {
var codePos = this.pos
var n = this.readInt(16, len)
if (n === null) this.raise(codePos, "Bad character escape sequence")
return n
}
// Read an identifier, and return it as a string. Sets `this.containsEsc`
// to whether the word contained a '\u' escape.
//
// Incrementally adds only escaped chars, adding other chunks as-is
// as a micro-optimization.
pp$7.readWord1 = function() {
var this$1 = this;
this.containsEsc = false
var word = "", first = true, chunkStart = this.pos
var astral = this.options.ecmaVersion >= 6
while (this.pos < this.input.length) {
var ch = this$1.fullCharCodeAtPos()
if (isIdentifierChar(ch, astral)) {
this$1.pos += ch <= 0xffff ? 1 : 2
} else if (ch === 92) { // "\"
this$1.containsEsc = true
word += this$1.input.slice(chunkStart, this$1.pos)
var escStart = this$1.pos
if (this$1.input.charCodeAt(++this$1.pos) != 117) // "u"
this$1.raise(this$1.pos, "Expecting Unicode escape sequence \\uXXXX")
++this$1.pos
var esc = this$1.readCodePoint()
if (!(first ? isIdentifierStart : isIdentifierChar)(esc, astral))
this$1.raise(escStart, "Invalid Unicode escape")
word += codePointToString(esc)
chunkStart = this$1.pos
} else {
break
}
first = false
}
return word + this.input.slice(chunkStart, this.pos)
}
// Read an identifier or keyword token. Will check for reserved
// words when necessary.
pp$7.readWord = function() {
var word = this.readWord1()
var type = tt.name
if ((this.options.ecmaVersion >= 6 || !this.containsEsc) && this.keywords.test(word))
type = keywordTypes[word]
return this.finishToken(type, word)
}
var version = "3.3.0"
// The main exported interface (under `self.acorn` when in the
// browser) is a `parse` function that takes a code string and
// returns an abstract syntax tree as specified by [Mozilla parser
// API][api].
//
// [api]: https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API
function parse(input, options) {
return new Parser(options, input).parse()
}
// This function tries to parse a single expression at a given
// offset in a string. Useful for parsing mixed-language formats
// that embed JavaScript expressions.
function parseExpressionAt(input, pos, options) {
var p = new Parser(options, input, pos)
p.nextToken()
return p.parseExpression()
}
// Acorn is organized as a tokenizer and a recursive-descent parser.
// The `tokenizer` export provides an interface to the tokenizer.
function tokenizer(input, options) {
return new Parser(options, input)
}
exports.version = version;
exports.parse = parse;
exports.parseExpressionAt = parseExpressionAt;
exports.tokenizer = tokenizer;
exports.Parser = Parser;
exports.plugins = plugins;
exports.defaultOptions = defaultOptions;
exports.Position = Position;
exports.SourceLocation = SourceLocation;
exports.getLineInfo = getLineInfo;
exports.Node = Node;
exports.TokenType = TokenType;
exports.tokTypes = tt;
exports.TokContext = TokContext;
exports.tokContexts = types;
exports.isIdentifierChar = isIdentifierChar;
exports.isIdentifierStart = isIdentifierStart;
exports.Token = Token;
exports.isNewLine = isNewLine;
exports.lineBreak = lineBreak;
exports.lineBreakG = lineBreakG;
Object.defineProperty(exports, '__esModule', { value: true });
}));
/***/ }),
/* 418 */
/***/ (function(module, exports, __webpack_require__) {
var upperCase = __webpack_require__(327)
var noCase = __webpack_require__(265)
/**
* Camel case a string.
*
* @param {string} value
* @param {string} [locale]
* @return {string}
*/
module.exports = function (value, locale, mergeNumbers) {
var result = noCase(value, locale)
// Replace periods between numeric entities with an underscore.
if (!mergeNumbers) {
result = result.replace(/ (?=\d)/g, '_')
}
// Replace spaces between words with an upper cased character.
return result.replace(/ (.)/g, function (m, $1) {
return upperCase($1, locale)
})
}
/***/ }),
/* 419 */
/***/ (function(module, exports) {
module.exports = {
"AElig": "Æ",
"AMP": "&",
"Aacute": "Á",
"Acirc": "Â",
"Agrave": "À",
"Aring": "Å",
"Atilde": "Ã",
"Auml": "Ä",
"COPY": "©",
"Ccedil": "Ç",
"ETH": "Ð",
"Eacute": "É",
"Ecirc": "Ê",
"Egrave": "È",
"Euml": "Ë",
"GT": ">",
"Iacute": "Í",
"Icirc": "Î",
"Igrave": "Ì",
"Iuml": "Ï",
"LT": "<",
"Ntilde": "Ñ",
"Oacute": "Ó",
"Ocirc": "Ô",
"Ograve": "Ò",
"Oslash": "Ø",
"Otilde": "Õ",
"Ouml": "Ö",
"QUOT": "\"",
"REG": "®",
"THORN": "Þ",
"Uacute": "Ú",
"Ucirc": "Û",
"Ugrave": "Ù",
"Uuml": "Ü",
"Yacute": "Ý",
"aacute": "á",
"acirc": "â",
"acute": "´",
"aelig": "æ",
"agrave": "à",
"amp": "&",
"aring": "å",
"atilde": "ã",
"auml": "ä",
"brvbar": "¦",
"ccedil": "ç",
"cedil": "¸",
"cent": "¢",
"copy": "©",
"curren": "¤",
"deg": "°",
"divide": "÷",
"eacute": "é",
"ecirc": "ê",
"egrave": "è",
"eth": "ð",
"euml": "ë",
"frac12": "½",
"frac14": "¼",
"frac34": "¾",
"gt": ">",
"iacute": "í",
"icirc": "î",
"iexcl": "¡",
"igrave": "ì",
"iquest": "¿",
"iuml": "ï",
"laquo": "«",
"lt": "<",
"macr": "¯",
"micro": "µ",
"middot": "·",
"nbsp": " ",
"not": "¬",
"ntilde": "ñ",
"oacute": "ó",
"ocirc": "ô",
"ograve": "ò",
"ordf": "ª",
"ordm": "º",
"oslash": "ø",
"otilde": "õ",
"ouml": "ö",
"para": "¶",
"plusmn": "±",
"pound": "£",
"quot": "\"",
"raquo": "»",
"reg": "®",
"sect": "§",
"shy": "­",
"sup1": "¹",
"sup2": "²",
"sup3": "³",
"szlig": "ß",
"thorn": "þ",
"times": "×",
"uacute": "ú",
"ucirc": "û",
"ugrave": "ù",
"uml": "¨",
"uuml": "ü",
"yacute": "ý",
"yen": "¥",
"yuml": "ÿ"
};
/***/ }),
/* 420 */
/***/ (function(module, exports) {
module.exports = {
"AEli": "Æ",
"AElig": "Æ",
"AM": "&",
"AMP": "&",
"Aacut": "Á",
"Aacute": "Á",
"Abreve": "Ă",
"Acir": "Â",
"Acirc": "Â",
"Acy": "А",
"Afr": "𝔄",
"Agrav": "À",
"Agrave": "À",
"Alpha": "Α",
"Amacr": "Ā",
"And": "⩓",
"Aogon": "Ą",
"Aopf": "𝔸",
"ApplyFunction": "",
"Arin": "Å",
"Aring": "Å",
"Ascr": "𝒜",
"Assign": "≔",
"Atild": "Ã",
"Atilde": "Ã",
"Aum": "Ä",
"Auml": "Ä",
"Backslash": "",
"Barv": "⫧",
"Barwed": "⌆",
"Bcy": "Б",
"Because": "∵",
"Bernoullis": "",
"Beta": "Β",
"Bfr": "𝔅",
"Bopf": "𝔹",
"Breve": "˘",
"Bscr": "",
"Bumpeq": "≎",
"CHcy": "Ч",
"COP": "©",
"COPY": "©",
"Cacute": "Ć",
"Cap": "⋒",
"CapitalDifferentialD": "",
"Cayleys": "",
"Ccaron": "Č",
"Ccedi": "Ç",
"Ccedil": "Ç",
"Ccirc": "Ĉ",
"Cconint": "∰",
"Cdot": "Ċ",
"Cedilla": "¸",
"CenterDot": "·",
"Cfr": "",
"Chi": "Χ",
"CircleDot": "⊙",
"CircleMinus": "⊖",
"CirclePlus": "⊕",
"CircleTimes": "⊗",
"ClockwiseContourIntegral": "∲",
"CloseCurlyDoubleQuote": "”",
"CloseCurlyQuote": "",
"Colon": "∷",
"Colone": "⩴",
"Congruent": "≡",
"Conint": "∯",
"ContourIntegral": "∮",
"Copf": "",
"Coproduct": "∐",
"CounterClockwiseContourIntegral": "∳",
"Cross": "",
"Cscr": "𝒞",
"Cup": "⋓",
"CupCap": "≍",
"DD": "",
"DDotrahd": "⤑",
"DJcy": "Ђ",
"DScy": "Ѕ",
"DZcy": "Џ",
"Dagger": "‡",
"Darr": "↡",
"Dashv": "⫤",
"Dcaron": "Ď",
"Dcy": "Д",
"Del": "∇",
"Delta": "Δ",
"Dfr": "𝔇",
"DiacriticalAcute": "´",
"DiacriticalDot": "˙",
"DiacriticalDoubleAcute": "˝",
"DiacriticalGrave": "`",
"DiacriticalTilde": "˜",
"Diamond": "⋄",
"DifferentialD": "",
"Dopf": "𝔻",
"Dot": "¨",
"DotDot": "⃜",
"DotEqual": "≐",
"DoubleContourIntegral": "∯",
"DoubleDot": "¨",
"DoubleDownArrow": "⇓",
"DoubleLeftArrow": "⇐",
"DoubleLeftRightArrow": "⇔",
"DoubleLeftTee": "⫤",
"DoubleLongLeftArrow": "⟸",
"DoubleLongLeftRightArrow": "⟺",
"DoubleLongRightArrow": "⟹",
"DoubleRightArrow": "⇒",
"DoubleRightTee": "⊨",
"DoubleUpArrow": "⇑",
"DoubleUpDownArrow": "⇕",
"DoubleVerticalBar": "∥",
"DownArrow": "↓",
"DownArrowBar": "⤓",
"DownArrowUpArrow": "⇵",
"DownBreve": "̑",
"DownLeftRightVector": "⥐",
"DownLeftTeeVector": "⥞",
"DownLeftVector": "↽",
"DownLeftVectorBar": "⥖",
"DownRightTeeVector": "⥟",
"DownRightVector": "⇁",
"DownRightVectorBar": "⥗",
"DownTee": "",
"DownTeeArrow": "↧",
"Downarrow": "⇓",
"Dscr": "𝒟",
"Dstrok": "Đ",
"ENG": "Ŋ",
"ET": "Ð",
"ETH": "Ð",
"Eacut": "É",
"Eacute": "É",
"Ecaron": "Ě",
"Ecir": "Ê",
"Ecirc": "Ê",
"Ecy": "Э",
"Edot": "Ė",
"Efr": "𝔈",
"Egrav": "È",
"Egrave": "È",
"Element": "∈",
"Emacr": "Ē",
"EmptySmallSquare": "◻",
"EmptyVerySmallSquare": "▫",
"Eogon": "Ę",
"Eopf": "𝔼",
"Epsilon": "Ε",
"Equal": "⩵",
"EqualTilde": "≂",
"Equilibrium": "⇌",
"Escr": "",
"Esim": "⩳",
"Eta": "Η",
"Eum": "Ë",
"Euml": "Ë",
"Exists": "∃",
"ExponentialE": "",
"Fcy": "Ф",
"Ffr": "𝔉",
"FilledSmallSquare": "◼",
"FilledVerySmallSquare": "▪",
"Fopf": "𝔽",
"ForAll": "∀",
"Fouriertrf": "",
"Fscr": "",
"GJcy": "Ѓ",
"G": ">",
"GT": ">",
"Gamma": "Γ",
"Gammad": "Ϝ",
"Gbreve": "Ğ",
"Gcedil": "Ģ",
"Gcirc": "Ĝ",
"Gcy": "Г",
"Gdot": "Ġ",
"Gfr": "𝔊",
"Gg": "⋙",
"Gopf": "𝔾",
"GreaterEqual": "≥",
"GreaterEqualLess": "⋛",
"GreaterFullEqual": "≧",
"GreaterGreater": "⪢",
"GreaterLess": "≷",
"GreaterSlantEqual": "⩾",
"GreaterTilde": "≳",
"Gscr": "𝒢",
"Gt": "≫",
"HARDcy": "Ъ",
"Hacek": "ˇ",
"Hat": "^",
"Hcirc": "Ĥ",
"Hfr": "",
"HilbertSpace": "",
"Hopf": "",
"HorizontalLine": "─",
"Hscr": "",
"Hstrok": "Ħ",
"HumpDownHump": "≎",
"HumpEqual": "≏",
"IEcy": "Е",
"IJlig": "IJ",
"IOcy": "Ё",
"Iacut": "Í",
"Iacute": "Í",
"Icir": "Î",
"Icirc": "Î",
"Icy": "И",
"Idot": "İ",
"Ifr": "",
"Igrav": "Ì",
"Igrave": "Ì",
"Im": "",
"Imacr": "Ī",
"ImaginaryI": "",
"Implies": "⇒",
"Int": "∬",
"Integral": "∫",
"Intersection": "⋂",
"InvisibleComma": "",
"InvisibleTimes": "",
"Iogon": "Į",
"Iopf": "𝕀",
"Iota": "Ι",
"Iscr": "",
"Itilde": "Ĩ",
"Iukcy": "І",
"Ium": "Ï",
"Iuml": "Ï",
"Jcirc": "Ĵ",
"Jcy": "Й",
"Jfr": "𝔍",
"Jopf": "𝕁",
"Jscr": "𝒥",
"Jsercy": "Ј",
"Jukcy": "Є",
"KHcy": "Х",
"KJcy": "Ќ",
"Kappa": "Κ",
"Kcedil": "Ķ",
"Kcy": "К",
"Kfr": "𝔎",
"Kopf": "𝕂",
"Kscr": "𝒦",
"LJcy": "Љ",
"L": "<",
"LT": "<",
"Lacute": "Ĺ",
"Lambda": "Λ",
"Lang": "⟪",
"Laplacetrf": "",
"Larr": "↞",
"Lcaron": "Ľ",
"Lcedil": "Ļ",
"Lcy": "Л",
"LeftAngleBracket": "⟨",
"LeftArrow": "←",
"LeftArrowBar": "⇤",
"LeftArrowRightArrow": "⇆",
"LeftCeiling": "⌈",
"LeftDoubleBracket": "⟦",
"LeftDownTeeVector": "⥡",
"LeftDownVector": "⇃",
"LeftDownVectorBar": "⥙",
"LeftFloor": "⌊",
"LeftRightArrow": "↔",
"LeftRightVector": "⥎",
"LeftTee": "⊣",
"LeftTeeArrow": "↤",
"LeftTeeVector": "⥚",
"LeftTriangle": "⊲",
"LeftTriangleBar": "⧏",
"LeftTriangleEqual": "⊴",
"LeftUpDownVector": "⥑",
"LeftUpTeeVector": "⥠",
"LeftUpVector": "↿",
"LeftUpVectorBar": "⥘",
"LeftVector": "↼",
"LeftVectorBar": "⥒",
"Leftarrow": "⇐",
"Leftrightarrow": "⇔",
"LessEqualGreater": "⋚",
"LessFullEqual": "≦",
"LessGreater": "≶",
"LessLess": "⪡",
"LessSlantEqual": "⩽",
"LessTilde": "≲",
"Lfr": "𝔏",
"Ll": "⋘",
"Lleftarrow": "⇚",
"Lmidot": "Ŀ",
"LongLeftArrow": "⟵",
"LongLeftRightArrow": "⟷",
"LongRightArrow": "⟶",
"Longleftarrow": "⟸",
"Longleftrightarrow": "⟺",
"Longrightarrow": "⟹",
"Lopf": "𝕃",
"LowerLeftArrow": "↙",
"LowerRightArrow": "↘",
"Lscr": "",
"Lsh": "↰",
"Lstrok": "Ł",
"Lt": "≪",
"Map": "⤅",
"Mcy": "М",
"MediumSpace": "",
"Mellintrf": "",
"Mfr": "𝔐",
"MinusPlus": "∓",
"Mopf": "𝕄",
"Mscr": "",
"Mu": "Μ",
"NJcy": "Њ",
"Nacute": "Ń",
"Ncaron": "Ň",
"Ncedil": "Ņ",
"Ncy": "Н",
"NegativeMediumSpace": "",
"NegativeThickSpace": "",
"NegativeThinSpace": "",
"NegativeVeryThinSpace": "",
"NestedGreaterGreater": "≫",
"NestedLessLess": "≪",
"NewLine": "\n",
"Nfr": "𝔑",
"NoBreak": "",
"NonBreakingSpace": " ",
"Nopf": "",
"Not": "⫬",
"NotCongruent": "≢",
"NotCupCap": "≭",
"NotDoubleVerticalBar": "∦",
"NotElement": "∉",
"NotEqual": "≠",
"NotEqualTilde": "≂̸",
"NotExists": "∄",
"NotGreater": "≯",
"NotGreaterEqual": "≱",
"NotGreaterFullEqual": "≧̸",
"NotGreaterGreater": "≫̸",
"NotGreaterLess": "≹",
"NotGreaterSlantEqual": "⩾̸",
"NotGreaterTilde": "≵",
"NotHumpDownHump": "≎̸",
"NotHumpEqual": "≏̸",
"NotLeftTriangle": "⋪",
"NotLeftTriangleBar": "⧏̸",
"NotLeftTriangleEqual": "⋬",
"NotLess": "≮",
"NotLessEqual": "≰",
"NotLessGreater": "≸",
"NotLessLess": "≪̸",
"NotLessSlantEqual": "⩽̸",
"NotLessTilde": "≴",
"NotNestedGreaterGreater": "⪢̸",
"NotNestedLessLess": "⪡̸",
"NotPrecedes": "⊀",
"NotPrecedesEqual": "⪯̸",
"NotPrecedesSlantEqual": "⋠",
"NotReverseElement": "∌",
"NotRightTriangle": "⋫",
"NotRightTriangleBar": "⧐̸",
"NotRightTriangleEqual": "⋭",
"NotSquareSubset": "⊏̸",
"NotSquareSubsetEqual": "⋢",
"NotSquareSuperset": "⊐̸",
"NotSquareSupersetEqual": "⋣",
"NotSubset": "⊂⃒",
"NotSubsetEqual": "⊈",
"NotSucceeds": "⊁",
"NotSucceedsEqual": "⪰̸",
"NotSucceedsSlantEqual": "⋡",
"NotSucceedsTilde": "≿̸",
"NotSuperset": "⊃⃒",
"NotSupersetEqual": "⊉",
"NotTilde": "≁",
"NotTildeEqual": "≄",
"NotTildeFullEqual": "≇",
"NotTildeTilde": "≉",
"NotVerticalBar": "∤",
"Nscr": "𝒩",
"Ntild": "Ñ",
"Ntilde": "Ñ",
"Nu": "Ν",
"OElig": "Œ",
"Oacut": "Ó",
"Oacute": "Ó",
"Ocir": "Ô",
"Ocirc": "Ô",
"Ocy": "О",
"Odblac": "Ő",
"Ofr": "𝔒",
"Ograv": "Ò",
"Ograve": "Ò",
"Omacr": "Ō",
"Omega": "Ω",
"Omicron": "Ο",
"Oopf": "𝕆",
"OpenCurlyDoubleQuote": "“",
"OpenCurlyQuote": "",
"Or": "⩔",
"Oscr": "𝒪",
"Oslas": "Ø",
"Oslash": "Ø",
"Otild": "Õ",
"Otilde": "Õ",
"Otimes": "⨷",
"Oum": "Ö",
"Ouml": "Ö",
"OverBar": "‾",
"OverBrace": "⏞",
"OverBracket": "⎴",
"OverParenthesis": "⏜",
"PartialD": "∂",
"Pcy": "П",
"Pfr": "𝔓",
"Phi": "Φ",
"Pi": "Π",
"PlusMinus": "±",
"Poincareplane": "",
"Popf": "",
"Pr": "⪻",
"Precedes": "≺",
"PrecedesEqual": "⪯",
"PrecedesSlantEqual": "≼",
"PrecedesTilde": "≾",
"Prime": "″",
"Product": "∏",
"Proportion": "∷",
"Proportional": "∝",
"Pscr": "𝒫",
"Psi": "Ψ",
"QUO": "\"",
"QUOT": "\"",
"Qfr": "𝔔",
"Qopf": "",
"Qscr": "𝒬",
"RBarr": "⤐",
"RE": "®",
"REG": "®",
"Racute": "Ŕ",
"Rang": "⟫",
"Rarr": "↠",
"Rarrtl": "⤖",
"Rcaron": "Ř",
"Rcedil": "Ŗ",
"Rcy": "Р",
"Re": "",
"ReverseElement": "∋",
"ReverseEquilibrium": "⇋",
"ReverseUpEquilibrium": "⥯",
"Rfr": "",
"Rho": "Ρ",
"RightAngleBracket": "⟩",
"RightArrow": "→",
"RightArrowBar": "⇥",
"RightArrowLeftArrow": "⇄",
"RightCeiling": "⌉",
"RightDoubleBracket": "⟧",
"RightDownTeeVector": "⥝",
"RightDownVector": "⇂",
"RightDownVectorBar": "⥕",
"RightFloor": "⌋",
"RightTee": "⊢",
"RightTeeArrow": "↦",
"RightTeeVector": "⥛",
"RightTriangle": "⊳",
"RightTriangleBar": "⧐",
"RightTriangleEqual": "⊵",
"RightUpDownVector": "⥏",
"RightUpTeeVector": "⥜",
"RightUpVector": "↾",
"RightUpVectorBar": "⥔",
"RightVector": "⇀",
"RightVectorBar": "⥓",
"Rightarrow": "⇒",
"Ropf": "",
"RoundImplies": "⥰",
"Rrightarrow": "⇛",
"Rscr": "",
"Rsh": "↱",
"RuleDelayed": "⧴",
"SHCHcy": "Щ",
"SHcy": "Ш",
"SOFTcy": "Ь",
"Sacute": "Ś",
"Sc": "⪼",
"Scaron": "Š",
"Scedil": "Ş",
"Scirc": "Ŝ",
"Scy": "С",
"Sfr": "𝔖",
"ShortDownArrow": "↓",
"ShortLeftArrow": "←",
"ShortRightArrow": "→",
"ShortUpArrow": "↑",
"Sigma": "Σ",
"SmallCircle": "∘",
"Sopf": "𝕊",
"Sqrt": "√",
"Square": "□",
"SquareIntersection": "⊓",
"SquareSubset": "⊏",
"SquareSubsetEqual": "⊑",
"SquareSuperset": "⊐",
"SquareSupersetEqual": "⊒",
"SquareUnion": "⊔",
"Sscr": "𝒮",
"Star": "⋆",
"Sub": "⋐",
"Subset": "⋐",
"SubsetEqual": "⊆",
"Succeeds": "≻",
"SucceedsEqual": "⪰",
"SucceedsSlantEqual": "≽",
"SucceedsTilde": "≿",
"SuchThat": "∋",
"Sum": "∑",
"Sup": "⋑",
"Superset": "⊃",
"SupersetEqual": "⊇",
"Supset": "⋑",
"THOR": "Þ",
"THORN": "Þ",
"TRADE": "™",
"TSHcy": "Ћ",
"TScy": "Ц",
"Tab": "\t",
"Tau": "Τ",
"Tcaron": "Ť",
"Tcedil": "Ţ",
"Tcy": "Т",
"Tfr": "𝔗",
"Therefore": "∴",
"Theta": "Θ",
"ThickSpace": "",
"ThinSpace": "",
"Tilde": "",
"TildeEqual": "≃",
"TildeFullEqual": "≅",
"TildeTilde": "≈",
"Topf": "𝕋",
"TripleDot": "⃛",
"Tscr": "𝒯",
"Tstrok": "Ŧ",
"Uacut": "Ú",
"Uacute": "Ú",
"Uarr": "↟",
"Uarrocir": "⥉",
"Ubrcy": "Ў",
"Ubreve": "Ŭ",
"Ucir": "Û",
"Ucirc": "Û",
"Ucy": "У",
"Udblac": "Ű",
"Ufr": "𝔘",
"Ugrav": "Ù",
"Ugrave": "Ù",
"Umacr": "Ū",
"UnderBar": "_",
"UnderBrace": "⏟",
"UnderBracket": "⎵",
"UnderParenthesis": "⏝",
"Union": "",
"UnionPlus": "⊎",
"Uogon": "Ų",
"Uopf": "𝕌",
"UpArrow": "↑",
"UpArrowBar": "⤒",
"UpArrowDownArrow": "⇅",
"UpDownArrow": "↕",
"UpEquilibrium": "⥮",
"UpTee": "⊥",
"UpTeeArrow": "↥",
"Uparrow": "⇑",
"Updownarrow": "⇕",
"UpperLeftArrow": "↖",
"UpperRightArrow": "↗",
"Upsi": "ϒ",
"Upsilon": "Υ",
"Uring": "Ů",
"Uscr": "𝒰",
"Utilde": "Ũ",
"Uum": "Ü",
"Uuml": "Ü",
"VDash": "⊫",
"Vbar": "⫫",
"Vcy": "В",
"Vdash": "⊩",
"Vdashl": "⫦",
"Vee": "",
"Verbar": "‖",
"Vert": "‖",
"VerticalBar": "",
"VerticalLine": "|",
"VerticalSeparator": "❘",
"VerticalTilde": "≀",
"VeryThinSpace": "",
"Vfr": "𝔙",
"Vopf": "𝕍",
"Vscr": "𝒱",
"Vvdash": "⊪",
"Wcirc": "Ŵ",
"Wedge": "⋀",
"Wfr": "𝔚",
"Wopf": "𝕎",
"Wscr": "𝒲",
"Xfr": "𝔛",
"Xi": "Ξ",
"Xopf": "𝕏",
"Xscr": "𝒳",
"YAcy": "Я",
"YIcy": "Ї",
"YUcy": "Ю",
"Yacut": "Ý",
"Yacute": "Ý",
"Ycirc": "Ŷ",
"Ycy": "Ы",
"Yfr": "𝔜",
"Yopf": "𝕐",
"Yscr": "𝒴",
"Yuml": "Ÿ",
"ZHcy": "Ж",
"Zacute": "Ź",
"Zcaron": "Ž",
"Zcy": "З",
"Zdot": "Ż",
"ZeroWidthSpace": "",
"Zeta": "Ζ",
"Zfr": "",
"Zopf": "",
"Zscr": "𝒵",
"aacut": "á",
"aacute": "á",
"abreve": "ă",
"ac": "∾",
"acE": "∾̳",
"acd": "∿",
"acir": "â",
"acirc": "â",
"acut": "´",
"acute": "´",
"acy": "а",
"aeli": "æ",
"aelig": "æ",
"af": "",
"afr": "𝔞",
"agrav": "à",
"agrave": "à",
"alefsym": "ℵ",
"aleph": "ℵ",
"alpha": "α",
"amacr": "ā",
"amalg": "⨿",
"am": "&",
"amp": "&",
"and": "∧",
"andand": "⩕",
"andd": "⩜",
"andslope": "⩘",
"andv": "⩚",
"ang": "∠",
"ange": "⦤",
"angle": "∠",
"angmsd": "∡",
"angmsdaa": "⦨",
"angmsdab": "⦩",
"angmsdac": "⦪",
"angmsdad": "⦫",
"angmsdae": "⦬",
"angmsdaf": "⦭",
"angmsdag": "⦮",
"angmsdah": "⦯",
"angrt": "∟",
"angrtvb": "⊾",
"angrtvbd": "⦝",
"angsph": "∢",
"angst": "Å",
"angzarr": "⍼",
"aogon": "ą",
"aopf": "𝕒",
"ap": "≈",
"apE": "⩰",
"apacir": "⩯",
"ape": "≊",
"apid": "≋",
"apos": "'",
"approx": "≈",
"approxeq": "≊",
"arin": "å",
"aring": "å",
"ascr": "𝒶",
"ast": "*",
"asymp": "≈",
"asympeq": "≍",
"atild": "ã",
"atilde": "ã",
"aum": "ä",
"auml": "ä",
"awconint": "∳",
"awint": "⨑",
"bNot": "⫭",
"backcong": "≌",
"backepsilon": "϶",
"backprime": "",
"backsim": "∽",
"backsimeq": "⋍",
"barvee": "⊽",
"barwed": "⌅",
"barwedge": "⌅",
"bbrk": "⎵",
"bbrktbrk": "⎶",
"bcong": "≌",
"bcy": "б",
"bdquo": "„",
"becaus": "∵",
"because": "∵",
"bemptyv": "⦰",
"bepsi": "϶",
"bernou": "",
"beta": "β",
"beth": "ℶ",
"between": "≬",
"bfr": "𝔟",
"bigcap": "⋂",
"bigcirc": "◯",
"bigcup": "",
"bigodot": "⨀",
"bigoplus": "⨁",
"bigotimes": "⨂",
"bigsqcup": "⨆",
"bigstar": "★",
"bigtriangledown": "▽",
"bigtriangleup": "△",
"biguplus": "⨄",
"bigvee": "",
"bigwedge": "⋀",
"bkarow": "⤍",
"blacklozenge": "⧫",
"blacksquare": "▪",
"blacktriangle": "▴",
"blacktriangledown": "▾",
"blacktriangleleft": "◂",
"blacktriangleright": "▸",
"blank": "␣",
"blk12": "▒",
"blk14": "░",
"blk34": "▓",
"block": "█",
"bne": "=⃥",
"bnequiv": "≡⃥",
"bnot": "⌐",
"bopf": "𝕓",
"bot": "⊥",
"bottom": "⊥",
"bowtie": "⋈",
"boxDL": "╗",
"boxDR": "╔",
"boxDl": "╖",
"boxDr": "╓",
"boxH": "═",
"boxHD": "╦",
"boxHU": "╩",
"boxHd": "╤",
"boxHu": "╧",
"boxUL": "╝",
"boxUR": "╚",
"boxUl": "╜",
"boxUr": "╙",
"boxV": "║",
"boxVH": "╬",
"boxVL": "╣",
"boxVR": "╠",
"boxVh": "╫",
"boxVl": "╢",
"boxVr": "╟",
"boxbox": "⧉",
"boxdL": "╕",
"boxdR": "╒",
"boxdl": "┐",
"boxdr": "┌",
"boxh": "─",
"boxhD": "╥",
"boxhU": "╨",
"boxhd": "┬",
"boxhu": "┴",
"boxminus": "⊟",
"boxplus": "⊞",
"boxtimes": "⊠",
"boxuL": "╛",
"boxuR": "╘",
"boxul": "┘",
"boxur": "└",
"boxv": "│",
"boxvH": "╪",
"boxvL": "╡",
"boxvR": "╞",
"boxvh": "┼",
"boxvl": "┤",
"boxvr": "├",
"bprime": "",
"breve": "˘",
"brvba": "¦",
"brvbar": "¦",
"bscr": "𝒷",
"bsemi": "⁏",
"bsim": "∽",
"bsime": "⋍",
"bsol": "\\",
"bsolb": "⧅",
"bsolhsub": "⟈",
"bull": "•",
"bullet": "•",
"bump": "≎",
"bumpE": "⪮",
"bumpe": "≏",
"bumpeq": "≏",
"cacute": "ć",
"cap": "∩",
"capand": "⩄",
"capbrcup": "⩉",
"capcap": "⩋",
"capcup": "⩇",
"capdot": "⩀",
"caps": "∩︀",
"caret": "",
"caron": "ˇ",
"ccaps": "⩍",
"ccaron": "č",
"ccedi": "ç",
"ccedil": "ç",
"ccirc": "ĉ",
"ccups": "⩌",
"ccupssm": "⩐",
"cdot": "ċ",
"cedi": "¸",
"cedil": "¸",
"cemptyv": "⦲",
"cen": "¢",
"cent": "¢",
"centerdot": "·",
"cfr": "𝔠",
"chcy": "ч",
"check": "✓",
"checkmark": "✓",
"chi": "χ",
"cir": "○",
"cirE": "⧃",
"circ": "ˆ",
"circeq": "≗",
"circlearrowleft": "↺",
"circlearrowright": "↻",
"circledR": "®",
"circledS": "Ⓢ",
"circledast": "⊛",
"circledcirc": "⊚",
"circleddash": "⊝",
"cire": "≗",
"cirfnint": "⨐",
"cirmid": "⫯",
"cirscir": "⧂",
"clubs": "♣",
"clubsuit": "♣",
"colon": ":",
"colone": "≔",
"coloneq": "≔",
"comma": ",",
"commat": "@",
"comp": "∁",
"compfn": "∘",
"complement": "∁",
"complexes": "",
"cong": "≅",
"congdot": "⩭",
"conint": "∮",
"copf": "𝕔",
"coprod": "∐",
"cop": "©",
"copy": "©",
"copysr": "℗",
"crarr": "↵",
"cross": "✗",
"cscr": "𝒸",
"csub": "⫏",
"csube": "⫑",
"csup": "⫐",
"csupe": "⫒",
"ctdot": "⋯",
"cudarrl": "⤸",
"cudarrr": "⤵",
"cuepr": "⋞",
"cuesc": "⋟",
"cularr": "↶",
"cularrp": "⤽",
"cup": "",
"cupbrcap": "⩈",
"cupcap": "⩆",
"cupcup": "⩊",
"cupdot": "⊍",
"cupor": "⩅",
"cups": "",
"curarr": "↷",
"curarrm": "⤼",
"curlyeqprec": "⋞",
"curlyeqsucc": "⋟",
"curlyvee": "⋎",
"curlywedge": "⋏",
"curre": "¤",
"curren": "¤",
"curvearrowleft": "↶",
"curvearrowright": "↷",
"cuvee": "⋎",
"cuwed": "⋏",
"cwconint": "∲",
"cwint": "∱",
"cylcty": "⌭",
"dArr": "⇓",
"dHar": "⥥",
"dagger": "†",
"daleth": "ℸ",
"darr": "↓",
"dash": "",
"dashv": "⊣",
"dbkarow": "⤏",
"dblac": "˝",
"dcaron": "ď",
"dcy": "д",
"dd": "",
"ddagger": "‡",
"ddarr": "⇊",
"ddotseq": "⩷",
"de": "°",
"deg": "°",
"delta": "δ",
"demptyv": "⦱",
"dfisht": "⥿",
"dfr": "𝔡",
"dharl": "⇃",
"dharr": "⇂",
"diam": "⋄",
"diamond": "⋄",
"diamondsuit": "♦",
"diams": "♦",
"die": "¨",
"digamma": "ϝ",
"disin": "⋲",
"div": "÷",
"divid": "÷",
"divide": "÷",
"divideontimes": "⋇",
"divonx": "⋇",
"djcy": "ђ",
"dlcorn": "⌞",
"dlcrop": "⌍",
"dollar": "$",
"dopf": "𝕕",
"dot": "˙",
"doteq": "≐",
"doteqdot": "≑",
"dotminus": "∸",
"dotplus": "∔",
"dotsquare": "⊡",
"doublebarwedge": "⌆",
"downarrow": "↓",
"downdownarrows": "⇊",
"downharpoonleft": "⇃",
"downharpoonright": "⇂",
"drbkarow": "⤐",
"drcorn": "⌟",
"drcrop": "⌌",
"dscr": "𝒹",
"dscy": "ѕ",
"dsol": "⧶",
"dstrok": "đ",
"dtdot": "⋱",
"dtri": "▿",
"dtrif": "▾",
"duarr": "⇵",
"duhar": "⥯",
"dwangle": "⦦",
"dzcy": "џ",
"dzigrarr": "⟿",
"eDDot": "⩷",
"eDot": "≑",
"eacut": "é",
"eacute": "é",
"easter": "⩮",
"ecaron": "ě",
"ecir": "ê",
"ecirc": "ê",
"ecolon": "≕",
"ecy": "э",
"edot": "ė",
"ee": "",
"efDot": "≒",
"efr": "𝔢",
"eg": "⪚",
"egrav": "è",
"egrave": "è",
"egs": "⪖",
"egsdot": "⪘",
"el": "⪙",
"elinters": "⏧",
"ell": "",
"els": "⪕",
"elsdot": "⪗",
"emacr": "ē",
"empty": "∅",
"emptyset": "∅",
"emptyv": "∅",
"emsp13": "",
"emsp14": "",
"emsp": "",
"eng": "ŋ",
"ensp": "",
"eogon": "ę",
"eopf": "𝕖",
"epar": "⋕",
"eparsl": "⧣",
"eplus": "⩱",
"epsi": "ε",
"epsilon": "ε",
"epsiv": "ϵ",
"eqcirc": "≖",
"eqcolon": "≕",
"eqsim": "≂",
"eqslantgtr": "⪖",
"eqslantless": "⪕",
"equals": "=",
"equest": "≟",
"equiv": "≡",
"equivDD": "⩸",
"eqvparsl": "⧥",
"erDot": "≓",
"erarr": "⥱",
"escr": "",
"esdot": "≐",
"esim": "≂",
"eta": "η",
"et": "ð",
"eth": "ð",
"eum": "ë",
"euml": "ë",
"euro": "€",
"excl": "!",
"exist": "∃",
"expectation": "",
"exponentiale": "",
"fallingdotseq": "≒",
"fcy": "ф",
"female": "♀",
"ffilig": "ffi",
"fflig": "ff",
"ffllig": "ffl",
"ffr": "𝔣",
"filig": "fi",
"fjlig": "fj",
"flat": "♭",
"fllig": "fl",
"fltns": "▱",
"fnof": "ƒ",
"fopf": "𝕗",
"forall": "∀",
"fork": "⋔",
"forkv": "⫙",
"fpartint": "⨍",
"frac1": "¼",
"frac12": "½",
"frac13": "⅓",
"frac14": "¼",
"frac15": "⅕",
"frac16": "⅙",
"frac18": "⅛",
"frac23": "⅔",
"frac25": "⅖",
"frac3": "¾",
"frac34": "¾",
"frac35": "⅗",
"frac38": "⅜",
"frac45": "⅘",
"frac56": "⅚",
"frac58": "⅝",
"frac78": "⅞",
"frasl": "",
"frown": "⌢",
"fscr": "𝒻",
"gE": "≧",
"gEl": "⪌",
"gacute": "ǵ",
"gamma": "γ",
"gammad": "ϝ",
"gap": "⪆",
"gbreve": "ğ",
"gcirc": "ĝ",
"gcy": "г",
"gdot": "ġ",
"ge": "≥",
"gel": "⋛",
"geq": "≥",
"geqq": "≧",
"geqslant": "⩾",
"ges": "⩾",
"gescc": "⪩",
"gesdot": "⪀",
"gesdoto": "⪂",
"gesdotol": "⪄",
"gesl": "⋛︀",
"gesles": "⪔",
"gfr": "𝔤",
"gg": "≫",
"ggg": "⋙",
"gimel": "ℷ",
"gjcy": "ѓ",
"gl": "≷",
"glE": "⪒",
"gla": "⪥",
"glj": "⪤",
"gnE": "≩",
"gnap": "⪊",
"gnapprox": "⪊",
"gne": "⪈",
"gneq": "⪈",
"gneqq": "≩",
"gnsim": "⋧",
"gopf": "𝕘",
"grave": "`",
"gscr": "",
"gsim": "≳",
"gsime": "⪎",
"gsiml": "⪐",
"g": ">",
"gt": ">",
"gtcc": "⪧",
"gtcir": "⩺",
"gtdot": "⋗",
"gtlPar": "⦕",
"gtquest": "⩼",
"gtrapprox": "⪆",
"gtrarr": "⥸",
"gtrdot": "⋗",
"gtreqless": "⋛",
"gtreqqless": "⪌",
"gtrless": "≷",
"gtrsim": "≳",
"gvertneqq": "≩︀",
"gvnE": "≩︀",
"hArr": "⇔",
"hairsp": "",
"half": "½",
"hamilt": "",
"hardcy": "ъ",
"harr": "↔",
"harrcir": "⥈",
"harrw": "↭",
"hbar": "ℏ",
"hcirc": "ĥ",
"hearts": "♥",
"heartsuit": "♥",
"hellip": "…",
"hercon": "⊹",
"hfr": "𝔥",
"hksearow": "⤥",
"hkswarow": "⤦",
"hoarr": "⇿",
"homtht": "∻",
"hookleftarrow": "↩",
"hookrightarrow": "↪",
"hopf": "𝕙",
"horbar": "―",
"hscr": "𝒽",
"hslash": "ℏ",
"hstrok": "ħ",
"hybull": "",
"hyphen": "",
"iacut": "í",
"iacute": "í",
"ic": "",
"icir": "î",
"icirc": "î",
"icy": "и",
"iecy": "е",
"iexc": "¡",
"iexcl": "¡",
"iff": "⇔",
"ifr": "𝔦",
"igrav": "ì",
"igrave": "ì",
"ii": "",
"iiiint": "⨌",
"iiint": "∭",
"iinfin": "⧜",
"iiota": "℩",
"ijlig": "ij",
"imacr": "ī",
"image": "",
"imagline": "",
"imagpart": "",
"imath": "ı",
"imof": "⊷",
"imped": "Ƶ",
"in": "∈",
"incare": "℅",
"infin": "∞",
"infintie": "⧝",
"inodot": "ı",
"int": "∫",
"intcal": "⊺",
"integers": "",
"intercal": "⊺",
"intlarhk": "⨗",
"intprod": "⨼",
"iocy": "ё",
"iogon": "į",
"iopf": "𝕚",
"iota": "ι",
"iprod": "⨼",
"iques": "¿",
"iquest": "¿",
"iscr": "𝒾",
"isin": "∈",
"isinE": "⋹",
"isindot": "⋵",
"isins": "⋴",
"isinsv": "⋳",
"isinv": "∈",
"it": "",
"itilde": "ĩ",
"iukcy": "і",
"ium": "ï",
"iuml": "ï",
"jcirc": "ĵ",
"jcy": "й",
"jfr": "𝔧",
"jmath": "ȷ",
"jopf": "𝕛",
"jscr": "𝒿",
"jsercy": "ј",
"jukcy": "є",
"kappa": "κ",
"kappav": "ϰ",
"kcedil": "ķ",
"kcy": "к",
"kfr": "𝔨",
"kgreen": "ĸ",
"khcy": "х",
"kjcy": "ќ",
"kopf": "𝕜",
"kscr": "𝓀",
"lAarr": "⇚",
"lArr": "⇐",
"lAtail": "⤛",
"lBarr": "⤎",
"lE": "≦",
"lEg": "⪋",
"lHar": "⥢",
"lacute": "ĺ",
"laemptyv": "⦴",
"lagran": "",
"lambda": "λ",
"lang": "⟨",
"langd": "⦑",
"langle": "⟨",
"lap": "⪅",
"laqu": "«",
"laquo": "«",
"larr": "←",
"larrb": "⇤",
"larrbfs": "⤟",
"larrfs": "⤝",
"larrhk": "↩",
"larrlp": "↫",
"larrpl": "⤹",
"larrsim": "⥳",
"larrtl": "↢",
"lat": "⪫",
"latail": "⤙",
"late": "⪭",
"lates": "⪭︀",
"lbarr": "⤌",
"lbbrk": "",
"lbrace": "{",
"lbrack": "[",
"lbrke": "⦋",
"lbrksld": "⦏",
"lbrkslu": "⦍",
"lcaron": "ľ",
"lcedil": "ļ",
"lceil": "⌈",
"lcub": "{",
"lcy": "л",
"ldca": "⤶",
"ldquo": "“",
"ldquor": "„",
"ldrdhar": "⥧",
"ldrushar": "⥋",
"ldsh": "↲",
"le": "≤",
"leftarrow": "←",
"leftarrowtail": "↢",
"leftharpoondown": "↽",
"leftharpoonup": "↼",
"leftleftarrows": "⇇",
"leftrightarrow": "↔",
"leftrightarrows": "⇆",
"leftrightharpoons": "⇋",
"leftrightsquigarrow": "↭",
"leftthreetimes": "⋋",
"leg": "⋚",
"leq": "≤",
"leqq": "≦",
"leqslant": "⩽",
"les": "⩽",
"lescc": "⪨",
"lesdot": "⩿",
"lesdoto": "⪁",
"lesdotor": "⪃",
"lesg": "⋚︀",
"lesges": "⪓",
"lessapprox": "⪅",
"lessdot": "⋖",
"lesseqgtr": "⋚",
"lesseqqgtr": "⪋",
"lessgtr": "≶",
"lesssim": "≲",
"lfisht": "⥼",
"lfloor": "⌊",
"lfr": "𝔩",
"lg": "≶",
"lgE": "⪑",
"lhard": "↽",
"lharu": "↼",
"lharul": "⥪",
"lhblk": "▄",
"ljcy": "љ",
"ll": "≪",
"llarr": "⇇",
"llcorner": "⌞",
"llhard": "⥫",
"lltri": "◺",
"lmidot": "ŀ",
"lmoust": "⎰",
"lmoustache": "⎰",
"lnE": "≨",
"lnap": "⪉",
"lnapprox": "⪉",
"lne": "⪇",
"lneq": "⪇",
"lneqq": "≨",
"lnsim": "⋦",
"loang": "⟬",
"loarr": "⇽",
"lobrk": "⟦",
"longleftarrow": "⟵",
"longleftrightarrow": "⟷",
"longmapsto": "⟼",
"longrightarrow": "⟶",
"looparrowleft": "↫",
"looparrowright": "↬",
"lopar": "⦅",
"lopf": "𝕝",
"loplus": "⨭",
"lotimes": "⨴",
"lowast": "",
"lowbar": "_",
"loz": "◊",
"lozenge": "◊",
"lozf": "⧫",
"lpar": "(",
"lparlt": "⦓",
"lrarr": "⇆",
"lrcorner": "⌟",
"lrhar": "⇋",
"lrhard": "⥭",
"lrm": "",
"lrtri": "⊿",
"lsaquo": "",
"lscr": "𝓁",
"lsh": "↰",
"lsim": "≲",
"lsime": "⪍",
"lsimg": "⪏",
"lsqb": "[",
"lsquo": "",
"lsquor": "",
"lstrok": "ł",
"l": "<",
"lt": "<",
"ltcc": "⪦",
"ltcir": "⩹",
"ltdot": "⋖",
"lthree": "⋋",
"ltimes": "⋉",
"ltlarr": "⥶",
"ltquest": "⩻",
"ltrPar": "⦖",
"ltri": "◃",
"ltrie": "⊴",
"ltrif": "◂",
"lurdshar": "⥊",
"luruhar": "⥦",
"lvertneqq": "≨︀",
"lvnE": "≨︀",
"mDDot": "∺",
"mac": "¯",
"macr": "¯",
"male": "♂",
"malt": "✠",
"maltese": "✠",
"map": "↦",
"mapsto": "↦",
"mapstodown": "↧",
"mapstoleft": "↤",
"mapstoup": "↥",
"marker": "▮",
"mcomma": "⨩",
"mcy": "м",
"mdash": "—",
"measuredangle": "∡",
"mfr": "𝔪",
"mho": "℧",
"micr": "µ",
"micro": "µ",
"mid": "",
"midast": "*",
"midcir": "⫰",
"middo": "·",
"middot": "·",
"minus": "",
"minusb": "⊟",
"minusd": "∸",
"minusdu": "⨪",
"mlcp": "⫛",
"mldr": "…",
"mnplus": "∓",
"models": "⊧",
"mopf": "𝕞",
"mp": "∓",
"mscr": "𝓂",
"mstpos": "∾",
"mu": "μ",
"multimap": "⊸",
"mumap": "⊸",
"nGg": "⋙̸",
"nGt": "≫⃒",
"nGtv": "≫̸",
"nLeftarrow": "⇍",
"nLeftrightarrow": "⇎",
"nLl": "⋘̸",
"nLt": "≪⃒",
"nLtv": "≪̸",
"nRightarrow": "⇏",
"nVDash": "⊯",
"nVdash": "⊮",
"nabla": "∇",
"nacute": "ń",
"nang": "∠⃒",
"nap": "≉",
"napE": "⩰̸",
"napid": "≋̸",
"napos": "ʼn",
"napprox": "≉",
"natur": "♮",
"natural": "♮",
"naturals": "",
"nbs": " ",
"nbsp": " ",
"nbump": "≎̸",
"nbumpe": "≏̸",
"ncap": "⩃",
"ncaron": "ň",
"ncedil": "ņ",
"ncong": "≇",
"ncongdot": "⩭̸",
"ncup": "⩂",
"ncy": "н",
"ndash": "",
"ne": "≠",
"neArr": "⇗",
"nearhk": "⤤",
"nearr": "↗",
"nearrow": "↗",
"nedot": "≐̸",
"nequiv": "≢",
"nesear": "⤨",
"nesim": "≂̸",
"nexist": "∄",
"nexists": "∄",
"nfr": "𝔫",
"ngE": "≧̸",
"nge": "≱",
"ngeq": "≱",
"ngeqq": "≧̸",
"ngeqslant": "⩾̸",
"nges": "⩾̸",
"ngsim": "≵",
"ngt": "≯",
"ngtr": "≯",
"nhArr": "⇎",
"nharr": "↮",
"nhpar": "⫲",
"ni": "∋",
"nis": "⋼",
"nisd": "⋺",
"niv": "∋",
"njcy": "њ",
"nlArr": "⇍",
"nlE": "≦̸",
"nlarr": "↚",
"nldr": "‥",
"nle": "≰",
"nleftarrow": "↚",
"nleftrightarrow": "↮",
"nleq": "≰",
"nleqq": "≦̸",
"nleqslant": "⩽̸",
"nles": "⩽̸",
"nless": "≮",
"nlsim": "≴",
"nlt": "≮",
"nltri": "⋪",
"nltrie": "⋬",
"nmid": "∤",
"nopf": "𝕟",
"no": "¬",
"not": "¬",
"notin": "∉",
"notinE": "⋹̸",
"notindot": "⋵̸",
"notinva": "∉",
"notinvb": "⋷",
"notinvc": "⋶",
"notni": "∌",
"notniva": "∌",
"notnivb": "⋾",
"notnivc": "⋽",
"npar": "∦",
"nparallel": "∦",
"nparsl": "⫽⃥",
"npart": "∂̸",
"npolint": "⨔",
"npr": "⊀",
"nprcue": "⋠",
"npre": "⪯̸",
"nprec": "⊀",
"npreceq": "⪯̸",
"nrArr": "⇏",
"nrarr": "↛",
"nrarrc": "⤳̸",
"nrarrw": "↝̸",
"nrightarrow": "↛",
"nrtri": "⋫",
"nrtrie": "⋭",
"nsc": "⊁",
"nsccue": "⋡",
"nsce": "⪰̸",
"nscr": "𝓃",
"nshortmid": "∤",
"nshortparallel": "∦",
"nsim": "≁",
"nsime": "≄",
"nsimeq": "≄",
"nsmid": "∤",
"nspar": "∦",
"nsqsube": "⋢",
"nsqsupe": "⋣",
"nsub": "⊄",
"nsubE": "⫅̸",
"nsube": "⊈",
"nsubset": "⊂⃒",
"nsubseteq": "⊈",
"nsubseteqq": "⫅̸",
"nsucc": "⊁",
"nsucceq": "⪰̸",
"nsup": "⊅",
"nsupE": "⫆̸",
"nsupe": "⊉",
"nsupset": "⊃⃒",
"nsupseteq": "⊉",
"nsupseteqq": "⫆̸",
"ntgl": "≹",
"ntild": "ñ",
"ntilde": "ñ",
"ntlg": "≸",
"ntriangleleft": "⋪",
"ntrianglelefteq": "⋬",
"ntriangleright": "⋫",
"ntrianglerighteq": "⋭",
"nu": "ν",
"num": "#",
"numero": "№",
"numsp": "",
"nvDash": "⊭",
"nvHarr": "⤄",
"nvap": "≍⃒",
"nvdash": "⊬",
"nvge": "≥⃒",
"nvgt": ">⃒",
"nvinfin": "⧞",
"nvlArr": "⤂",
"nvle": "≤⃒",
"nvlt": "<⃒",
"nvltrie": "⊴⃒",
"nvrArr": "⤃",
"nvrtrie": "⊵⃒",
"nvsim": "∼⃒",
"nwArr": "⇖",
"nwarhk": "⤣",
"nwarr": "↖",
"nwarrow": "↖",
"nwnear": "⤧",
"oS": "Ⓢ",
"oacut": "ó",
"oacute": "ó",
"oast": "⊛",
"ocir": "ô",
"ocirc": "ô",
"ocy": "о",
"odash": "⊝",
"odblac": "ő",
"odiv": "⨸",
"odot": "⊙",
"odsold": "⦼",
"oelig": "œ",
"ofcir": "⦿",
"ofr": "𝔬",
"ogon": "˛",
"ograv": "ò",
"ograve": "ò",
"ogt": "⧁",
"ohbar": "⦵",
"ohm": "Ω",
"oint": "∮",
"olarr": "↺",
"olcir": "⦾",
"olcross": "⦻",
"oline": "‾",
"olt": "⧀",
"omacr": "ō",
"omega": "ω",
"omicron": "ο",
"omid": "⦶",
"ominus": "⊖",
"oopf": "𝕠",
"opar": "⦷",
"operp": "⦹",
"oplus": "⊕",
"or": "",
"orarr": "↻",
"ord": "º",
"order": "",
"orderof": "",
"ordf": "ª",
"ordm": "º",
"origof": "⊶",
"oror": "⩖",
"orslope": "⩗",
"orv": "⩛",
"oscr": "",
"oslas": "ø",
"oslash": "ø",
"osol": "⊘",
"otild": "õ",
"otilde": "õ",
"otimes": "⊗",
"otimesas": "⨶",
"oum": "ö",
"ouml": "ö",
"ovbar": "⌽",
"par": "¶",
"para": "¶",
"parallel": "∥",
"parsim": "⫳",
"parsl": "⫽",
"part": "∂",
"pcy": "п",
"percnt": "%",
"period": ".",
"permil": "‰",
"perp": "⊥",
"pertenk": "‱",
"pfr": "𝔭",
"phi": "φ",
"phiv": "ϕ",
"phmmat": "",
"phone": "☎",
"pi": "π",
"pitchfork": "⋔",
"piv": "ϖ",
"planck": "ℏ",
"planckh": "",
"plankv": "ℏ",
"plus": "+",
"plusacir": "⨣",
"plusb": "⊞",
"pluscir": "⨢",
"plusdo": "∔",
"plusdu": "⨥",
"pluse": "⩲",
"plusm": "±",
"plusmn": "±",
"plussim": "⨦",
"plustwo": "⨧",
"pm": "±",
"pointint": "⨕",
"popf": "𝕡",
"poun": "£",
"pound": "£",
"pr": "≺",
"prE": "⪳",
"prap": "⪷",
"prcue": "≼",
"pre": "⪯",
"prec": "≺",
"precapprox": "⪷",
"preccurlyeq": "≼",
"preceq": "⪯",
"precnapprox": "⪹",
"precneqq": "⪵",
"precnsim": "⋨",
"precsim": "≾",
"prime": "",
"primes": "",
"prnE": "⪵",
"prnap": "⪹",
"prnsim": "⋨",
"prod": "∏",
"profalar": "⌮",
"profline": "⌒",
"profsurf": "⌓",
"prop": "∝",
"propto": "∝",
"prsim": "≾",
"prurel": "⊰",
"pscr": "𝓅",
"psi": "ψ",
"puncsp": "",
"qfr": "𝔮",
"qint": "⨌",
"qopf": "𝕢",
"qprime": "⁗",
"qscr": "𝓆",
"quaternions": "",
"quatint": "⨖",
"quest": "?",
"questeq": "≟",
"quo": "\"",
"quot": "\"",
"rAarr": "⇛",
"rArr": "⇒",
"rAtail": "⤜",
"rBarr": "⤏",
"rHar": "⥤",
"race": "∽̱",
"racute": "ŕ",
"radic": "√",
"raemptyv": "⦳",
"rang": "⟩",
"rangd": "⦒",
"range": "⦥",
"rangle": "⟩",
"raqu": "»",
"raquo": "»",
"rarr": "→",
"rarrap": "⥵",
"rarrb": "⇥",
"rarrbfs": "⤠",
"rarrc": "⤳",
"rarrfs": "⤞",
"rarrhk": "↪",
"rarrlp": "↬",
"rarrpl": "⥅",
"rarrsim": "⥴",
"rarrtl": "↣",
"rarrw": "↝",
"ratail": "⤚",
"ratio": "",
"rationals": "",
"rbarr": "⤍",
"rbbrk": "",
"rbrace": "}",
"rbrack": "]",
"rbrke": "⦌",
"rbrksld": "⦎",
"rbrkslu": "⦐",
"rcaron": "ř",
"rcedil": "ŗ",
"rceil": "⌉",
"rcub": "}",
"rcy": "р",
"rdca": "⤷",
"rdldhar": "⥩",
"rdquo": "”",
"rdquor": "”",
"rdsh": "↳",
"real": "",
"realine": "",
"realpart": "",
"reals": "",
"rect": "▭",
"re": "®",
"reg": "®",
"rfisht": "⥽",
"rfloor": "⌋",
"rfr": "𝔯",
"rhard": "⇁",
"rharu": "⇀",
"rharul": "⥬",
"rho": "ρ",
"rhov": "ϱ",
"rightarrow": "→",
"rightarrowtail": "↣",
"rightharpoondown": "⇁",
"rightharpoonup": "⇀",
"rightleftarrows": "⇄",
"rightleftharpoons": "⇌",
"rightrightarrows": "⇉",
"rightsquigarrow": "↝",
"rightthreetimes": "⋌",
"ring": "˚",
"risingdotseq": "≓",
"rlarr": "⇄",
"rlhar": "⇌",
"rlm": "",
"rmoust": "⎱",
"rmoustache": "⎱",
"rnmid": "⫮",
"roang": "⟭",
"roarr": "⇾",
"robrk": "⟧",
"ropar": "⦆",
"ropf": "𝕣",
"roplus": "⨮",
"rotimes": "⨵",
"rpar": ")",
"rpargt": "⦔",
"rppolint": "⨒",
"rrarr": "⇉",
"rsaquo": "",
"rscr": "𝓇",
"rsh": "↱",
"rsqb": "]",
"rsquo": "",
"rsquor": "",
"rthree": "⋌",
"rtimes": "⋊",
"rtri": "▹",
"rtrie": "⊵",
"rtrif": "▸",
"rtriltri": "⧎",
"ruluhar": "⥨",
"rx": "℞",
"sacute": "ś",
"sbquo": "",
"sc": "≻",
"scE": "⪴",
"scap": "⪸",
"scaron": "š",
"sccue": "≽",
"sce": "⪰",
"scedil": "ş",
"scirc": "ŝ",
"scnE": "⪶",
"scnap": "⪺",
"scnsim": "⋩",
"scpolint": "⨓",
"scsim": "≿",
"scy": "с",
"sdot": "⋅",
"sdotb": "⊡",
"sdote": "⩦",
"seArr": "⇘",
"searhk": "⤥",
"searr": "↘",
"searrow": "↘",
"sec": "§",
"sect": "§",
"semi": ";",
"seswar": "⤩",
"setminus": "",
"setmn": "",
"sext": "✶",
"sfr": "𝔰",
"sfrown": "⌢",
"sharp": "♯",
"shchcy": "щ",
"shcy": "ш",
"shortmid": "",
"shortparallel": "∥",
"sh": "­",
"shy": "­",
"sigma": "σ",
"sigmaf": "ς",
"sigmav": "ς",
"sim": "",
"simdot": "⩪",
"sime": "≃",
"simeq": "≃",
"simg": "⪞",
"simgE": "⪠",
"siml": "⪝",
"simlE": "⪟",
"simne": "≆",
"simplus": "⨤",
"simrarr": "⥲",
"slarr": "←",
"smallsetminus": "",
"smashp": "⨳",
"smeparsl": "⧤",
"smid": "",
"smile": "⌣",
"smt": "⪪",
"smte": "⪬",
"smtes": "⪬︀",
"softcy": "ь",
"sol": "/",
"solb": "⧄",
"solbar": "⌿",
"sopf": "𝕤",
"spades": "♠",
"spadesuit": "♠",
"spar": "∥",
"sqcap": "⊓",
"sqcaps": "⊓︀",
"sqcup": "⊔",
"sqcups": "⊔︀",
"sqsub": "⊏",
"sqsube": "⊑",
"sqsubset": "⊏",
"sqsubseteq": "⊑",
"sqsup": "⊐",
"sqsupe": "⊒",
"sqsupset": "⊐",
"sqsupseteq": "⊒",
"squ": "□",
"square": "□",
"squarf": "▪",
"squf": "▪",
"srarr": "→",
"sscr": "𝓈",
"ssetmn": "",
"ssmile": "⌣",
"sstarf": "⋆",
"star": "☆",
"starf": "★",
"straightepsilon": "ϵ",
"straightphi": "ϕ",
"strns": "¯",
"sub": "⊂",
"subE": "⫅",
"subdot": "⪽",
"sube": "⊆",
"subedot": "⫃",
"submult": "⫁",
"subnE": "⫋",
"subne": "⊊",
"subplus": "⪿",
"subrarr": "⥹",
"subset": "⊂",
"subseteq": "⊆",
"subseteqq": "⫅",
"subsetneq": "⊊",
"subsetneqq": "⫋",
"subsim": "⫇",
"subsub": "⫕",
"subsup": "⫓",
"succ": "≻",
"succapprox": "⪸",
"succcurlyeq": "≽",
"succeq": "⪰",
"succnapprox": "⪺",
"succneqq": "⪶",
"succnsim": "⋩",
"succsim": "≿",
"sum": "∑",
"sung": "♪",
"sup": "⊃",
"sup1": "¹",
"sup2": "²",
"sup3": "³",
"supE": "⫆",
"supdot": "⪾",
"supdsub": "⫘",
"supe": "⊇",
"supedot": "⫄",
"suphsol": "⟉",
"suphsub": "⫗",
"suplarr": "⥻",
"supmult": "⫂",
"supnE": "⫌",
"supne": "⊋",
"supplus": "⫀",
"supset": "⊃",
"supseteq": "⊇",
"supseteqq": "⫆",
"supsetneq": "⊋",
"supsetneqq": "⫌",
"supsim": "⫈",
"supsub": "⫔",
"supsup": "⫖",
"swArr": "⇙",
"swarhk": "⤦",
"swarr": "↙",
"swarrow": "↙",
"swnwar": "⤪",
"szli": "ß",
"szlig": "ß",
"target": "⌖",
"tau": "τ",
"tbrk": "⎴",
"tcaron": "ť",
"tcedil": "ţ",
"tcy": "т",
"tdot": "⃛",
"telrec": "⌕",
"tfr": "𝔱",
"there4": "∴",
"therefore": "∴",
"theta": "θ",
"thetasym": "ϑ",
"thetav": "ϑ",
"thickapprox": "≈",
"thicksim": "",
"thinsp": "",
"thkap": "≈",
"thksim": "",
"thor": "þ",
"thorn": "þ",
"tilde": "˜",
"time": "×",
"times": "×",
"timesb": "⊠",
"timesbar": "⨱",
"timesd": "⨰",
"tint": "∭",
"toea": "⤨",
"top": "",
"topbot": "⌶",
"topcir": "⫱",
"topf": "𝕥",
"topfork": "⫚",
"tosa": "⤩",
"tprime": "‴",
"trade": "™",
"triangle": "▵",
"triangledown": "▿",
"triangleleft": "◃",
"trianglelefteq": "⊴",
"triangleq": "≜",
"triangleright": "▹",
"trianglerighteq": "⊵",
"tridot": "◬",
"trie": "≜",
"triminus": "⨺",
"triplus": "⨹",
"trisb": "⧍",
"tritime": "⨻",
"trpezium": "⏢",
"tscr": "𝓉",
"tscy": "ц",
"tshcy": "ћ",
"tstrok": "ŧ",
"twixt": "≬",
"twoheadleftarrow": "↞",
"twoheadrightarrow": "↠",
"uArr": "⇑",
"uHar": "⥣",
"uacut": "ú",
"uacute": "ú",
"uarr": "↑",
"ubrcy": "ў",
"ubreve": "ŭ",
"ucir": "û",
"ucirc": "û",
"ucy": "у",
"udarr": "⇅",
"udblac": "ű",
"udhar": "⥮",
"ufisht": "⥾",
"ufr": "𝔲",
"ugrav": "ù",
"ugrave": "ù",
"uharl": "↿",
"uharr": "↾",
"uhblk": "▀",
"ulcorn": "⌜",
"ulcorner": "⌜",
"ulcrop": "⌏",
"ultri": "◸",
"umacr": "ū",
"um": "¨",
"uml": "¨",
"uogon": "ų",
"uopf": "𝕦",
"uparrow": "↑",
"updownarrow": "↕",
"upharpoonleft": "↿",
"upharpoonright": "↾",
"uplus": "⊎",
"upsi": "υ",
"upsih": "ϒ",
"upsilon": "υ",
"upuparrows": "⇈",
"urcorn": "⌝",
"urcorner": "⌝",
"urcrop": "⌎",
"uring": "ů",
"urtri": "◹",
"uscr": "𝓊",
"utdot": "⋰",
"utilde": "ũ",
"utri": "▵",
"utrif": "▴",
"uuarr": "⇈",
"uum": "ü",
"uuml": "ü",
"uwangle": "⦧",
"vArr": "⇕",
"vBar": "⫨",
"vBarv": "⫩",
"vDash": "⊨",
"vangrt": "⦜",
"varepsilon": "ϵ",
"varkappa": "ϰ",
"varnothing": "∅",
"varphi": "ϕ",
"varpi": "ϖ",
"varpropto": "∝",
"varr": "↕",
"varrho": "ϱ",
"varsigma": "ς",
"varsubsetneq": "⊊︀",
"varsubsetneqq": "⫋︀",
"varsupsetneq": "⊋︀",
"varsupsetneqq": "⫌︀",
"vartheta": "ϑ",
"vartriangleleft": "⊲",
"vartriangleright": "⊳",
"vcy": "в",
"vdash": "⊢",
"vee": "",
"veebar": "⊻",
"veeeq": "≚",
"vellip": "⋮",
"verbar": "|",
"vert": "|",
"vfr": "𝔳",
"vltri": "⊲",
"vnsub": "⊂⃒",
"vnsup": "⊃⃒",
"vopf": "𝕧",
"vprop": "∝",
"vrtri": "⊳",
"vscr": "𝓋",
"vsubnE": "⫋︀",
"vsubne": "⊊︀",
"vsupnE": "⫌︀",
"vsupne": "⊋︀",
"vzigzag": "⦚",
"wcirc": "ŵ",
"wedbar": "⩟",
"wedge": "∧",
"wedgeq": "≙",
"weierp": "℘",
"wfr": "𝔴",
"wopf": "𝕨",
"wp": "℘",
"wr": "≀",
"wreath": "≀",
"wscr": "𝓌",
"xcap": "⋂",
"xcirc": "◯",
"xcup": "",
"xdtri": "▽",
"xfr": "𝔵",
"xhArr": "⟺",
"xharr": "⟷",
"xi": "ξ",
"xlArr": "⟸",
"xlarr": "⟵",
"xmap": "⟼",
"xnis": "⋻",
"xodot": "⨀",
"xopf": "𝕩",
"xoplus": "⨁",
"xotime": "⨂",
"xrArr": "⟹",
"xrarr": "⟶",
"xscr": "𝓍",
"xsqcup": "⨆",
"xuplus": "⨄",
"xutri": "△",
"xvee": "",
"xwedge": "⋀",
"yacut": "ý",
"yacute": "ý",
"yacy": "я",
"ycirc": "ŷ",
"ycy": "ы",
"ye": "¥",
"yen": "¥",
"yfr": "𝔶",
"yicy": "ї",
"yopf": "𝕪",
"yscr": "𝓎",
"yucy": "ю",
"yum": "ÿ",
"yuml": "ÿ",
"zacute": "ź",
"zcaron": "ž",
"zcy": "з",
"zdot": "ż",
"zeetrf": "",
"zeta": "ζ",
"zfr": "𝔷",
"zhcy": "ж",
"zigrarr": "⇝",
"zopf": "𝕫",
"zscr": "𝓏",
"zwj": "",
"zwnj": ""
};
/***/ }),
/* 421 */
/***/ (function(module, exports) {
module.exports = {
"0": "<22>",
"128": "€",
"130": "",
"131": "ƒ",
"132": "„",
"133": "…",
"134": "†",
"135": "‡",
"136": "ˆ",
"137": "‰",
"138": "Š",
"139": "",
"140": "Œ",
"142": "Ž",
"145": "",
"146": "",
"147": "“",
"148": "”",
"149": "•",
"150": "",
"151": "—",
"152": "˜",
"153": "™",
"154": "š",
"155": "",
"156": "œ",
"158": "ž",
"159": "Ÿ"
};
/***/ }),
/* 422 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module collapse-white-space
* @fileoverview Replace multiple white-space characters
* with a single space.
*/
/* Expose. */
module.exports = collapse;
/**
* Replace multiple white-space characters with a single space.
*
* @example
* collapse(' \t\nbar \nbaz\t'); // ' bar baz '
*
* @param {string} value - Value with uncollapsed white-space,
* coerced to string.
* @return {string} - Value with collapsed white-space.
*/
function collapse(value) {
return String(value).replace(/\s+/g, ' ');
}
/***/ }),
/* 423 */
/***/ (function(module, exports, __webpack_require__) {
// https://d3js.org Version 4.9.1. Copyright 2017 Mike Bostock.
(function (global, factory) {
true ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(factory((global.d3 = global.d3 || {})));
}(this, (function (exports) { 'use strict';
var version = "4.9.1";
var ascending = function(a, b) {
return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;
};
var bisector = function(compare) {
if (compare.length === 1) compare = ascendingComparator(compare);
return {
left: function(a, x, lo, hi) {
if (lo == null) lo = 0;
if (hi == null) hi = a.length;
while (lo < hi) {
var mid = lo + hi >>> 1;
if (compare(a[mid], x) < 0) lo = mid + 1;
else hi = mid;
}
return lo;
},
right: function(a, x, lo, hi) {
if (lo == null) lo = 0;
if (hi == null) hi = a.length;
while (lo < hi) {
var mid = lo + hi >>> 1;
if (compare(a[mid], x) > 0) hi = mid;
else lo = mid + 1;
}
return lo;
}
};
};
function ascendingComparator(f) {
return function(d, x) {
return ascending(f(d), x);
};
}
var ascendingBisect = bisector(ascending);
var bisectRight = ascendingBisect.right;
var bisectLeft = ascendingBisect.left;
var pairs = function(array, f) {
if (f == null) f = pair;
var i = 0, n = array.length - 1, p = array[0], pairs = new Array(n < 0 ? 0 : n);
while (i < n) pairs[i] = f(p, p = array[++i]);
return pairs;
};
function pair(a, b) {
return [a, b];
}
var cross = function(values0, values1, reduce) {
var n0 = values0.length,
n1 = values1.length,
values = new Array(n0 * n1),
i0,
i1,
i,
value0;
if (reduce == null) reduce = pair;
for (i0 = i = 0; i0 < n0; ++i0) {
for (value0 = values0[i0], i1 = 0; i1 < n1; ++i1, ++i) {
values[i] = reduce(value0, values1[i1]);
}
}
return values;
};
var descending = function(a, b) {
return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;
};
var number = function(x) {
return x === null ? NaN : +x;
};
var variance = function(values, valueof) {
var n = values.length,
m = 0,
i = -1,
mean = 0,
value,
delta,
sum = 0;
if (valueof == null) {
while (++i < n) {
if (!isNaN(value = number(values[i]))) {
delta = value - mean;
mean += delta / ++m;
sum += delta * (value - mean);
}
}
}
else {
while (++i < n) {
if (!isNaN(value = number(valueof(values[i], i, values)))) {
delta = value - mean;
mean += delta / ++m;
sum += delta * (value - mean);
}
}
}
if (m > 1) return sum / (m - 1);
};
var deviation = function(array, f) {
var v = variance(array, f);
return v ? Math.sqrt(v) : v;
};
var extent = function(values, valueof) {
var n = values.length,
i = -1,
value,
min,
max;
if (valueof == null) {
while (++i < n) { // Find the first comparable value.
if ((value = values[i]) != null && value >= value) {
min = max = value;
while (++i < n) { // Compare the remaining values.
if ((value = values[i]) != null) {
if (min > value) min = value;
if (max < value) max = value;
}
}
}
}
}
else {
while (++i < n) { // Find the first comparable value.
if ((value = valueof(values[i], i, values)) != null && value >= value) {
min = max = value;
while (++i < n) { // Compare the remaining values.
if ((value = valueof(values[i], i, values)) != null) {
if (min > value) min = value;
if (max < value) max = value;
}
}
}
}
}
return [min, max];
};
var array = Array.prototype;
var slice = array.slice;
var map = array.map;
var constant = function(x) {
return function() {
return x;
};
};
var identity = function(x) {
return x;
};
var sequence = function(start, stop, step) {
start = +start, stop = +stop, step = (n = arguments.length) < 2 ? (stop = start, start = 0, 1) : n < 3 ? 1 : +step;
var i = -1,
n = Math.max(0, Math.ceil((stop - start) / step)) | 0,
range = new Array(n);
while (++i < n) {
range[i] = start + i * step;
}
return range;
};
var e10 = Math.sqrt(50);
var e5 = Math.sqrt(10);
var e2 = Math.sqrt(2);
var ticks = function(start, stop, count) {
var reverse = stop < start,
i = -1,
n,
ticks,
step;
if (reverse) n = start, start = stop, stop = n;
if ((step = tickIncrement(start, stop, count)) === 0 || !isFinite(step)) return [];
if (step > 0) {
start = Math.ceil(start / step);
stop = Math.floor(stop / step);
ticks = new Array(n = Math.ceil(stop - start + 1));
while (++i < n) ticks[i] = (start + i) * step;
} else {
start = Math.floor(start * step);
stop = Math.ceil(stop * step);
ticks = new Array(n = Math.ceil(start - stop + 1));
while (++i < n) ticks[i] = (start - i) / step;
}
if (reverse) ticks.reverse();
return ticks;
};
function tickIncrement(start, stop, count) {
var step = (stop - start) / Math.max(0, count),
power = Math.floor(Math.log(step) / Math.LN10),
error = step / Math.pow(10, power);
return power >= 0
? (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1) * Math.pow(10, power)
: -Math.pow(10, -power) / (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1);
}
function tickStep(start, stop, count) {
var step0 = Math.abs(stop - start) / Math.max(0, count),
step1 = Math.pow(10, Math.floor(Math.log(step0) / Math.LN10)),
error = step0 / step1;
if (error >= e10) step1 *= 10;
else if (error >= e5) step1 *= 5;
else if (error >= e2) step1 *= 2;
return stop < start ? -step1 : step1;
}
var sturges = function(values) {
return Math.ceil(Math.log(values.length) / Math.LN2) + 1;
};
var histogram = function() {
var value = identity,
domain = extent,
threshold = sturges;
function histogram(data) {
var i,
n = data.length,
x,
values = new Array(n);
for (i = 0; i < n; ++i) {
values[i] = value(data[i], i, data);
}
var xz = domain(values),
x0 = xz[0],
x1 = xz[1],
tz = threshold(values, x0, x1);
// Convert number of thresholds into uniform thresholds.
if (!Array.isArray(tz)) {
tz = tickStep(x0, x1, tz);
tz = sequence(Math.ceil(x0 / tz) * tz, Math.floor(x1 / tz) * tz, tz); // exclusive
}
// Remove any thresholds outside the domain.
var m = tz.length;
while (tz[0] <= x0) tz.shift(), --m;
while (tz[m - 1] > x1) tz.pop(), --m;
var bins = new Array(m + 1),
bin;
// Initialize bins.
for (i = 0; i <= m; ++i) {
bin = bins[i] = [];
bin.x0 = i > 0 ? tz[i - 1] : x0;
bin.x1 = i < m ? tz[i] : x1;
}
// Assign data to bins by value, ignoring any outside the domain.
for (i = 0; i < n; ++i) {
x = values[i];
if (x0 <= x && x <= x1) {
bins[bisectRight(tz, x, 0, m)].push(data[i]);
}
}
return bins;
}
histogram.value = function(_) {
return arguments.length ? (value = typeof _ === "function" ? _ : constant(_), histogram) : value;
};
histogram.domain = function(_) {
return arguments.length ? (domain = typeof _ === "function" ? _ : constant([_[0], _[1]]), histogram) : domain;
};
histogram.thresholds = function(_) {
return arguments.length ? (threshold = typeof _ === "function" ? _ : Array.isArray(_) ? constant(slice.call(_)) : constant(_), histogram) : threshold;
};
return histogram;
};
var threshold = function(values, p, valueof) {
if (valueof == null) valueof = number;
if (!(n = values.length)) return;
if ((p = +p) <= 0 || n < 2) return +valueof(values[0], 0, values);
if (p >= 1) return +valueof(values[n - 1], n - 1, values);
var n,
i = (n - 1) * p,
i0 = Math.floor(i),
value0 = +valueof(values[i0], i0, values),
value1 = +valueof(values[i0 + 1], i0 + 1, values);
return value0 + (value1 - value0) * (i - i0);
};
var freedmanDiaconis = function(values, min, max) {
values = map.call(values, number).sort(ascending);
return Math.ceil((max - min) / (2 * (threshold(values, 0.75) - threshold(values, 0.25)) * Math.pow(values.length, -1 / 3)));
};
var scott = function(values, min, max) {
return Math.ceil((max - min) / (3.5 * deviation(values) * Math.pow(values.length, -1 / 3)));
};
var max = function(values, valueof) {
var n = values.length,
i = -1,
value,
max;
if (valueof == null) {
while (++i < n) { // Find the first comparable value.
if ((value = values[i]) != null && value >= value) {
max = value;
while (++i < n) { // Compare the remaining values.
if ((value = values[i]) != null && value > max) {
max = value;
}
}
}
}
}
else {
while (++i < n) { // Find the first comparable value.
if ((value = valueof(values[i], i, values)) != null && value >= value) {
max = value;
while (++i < n) { // Compare the remaining values.
if ((value = valueof(values[i], i, values)) != null && value > max) {
max = value;
}
}
}
}
}
return max;
};
var mean = function(values, valueof) {
var n = values.length,
m = n,
i = -1,
value,
sum = 0;
if (valueof == null) {
while (++i < n) {
if (!isNaN(value = number(values[i]))) sum += value;
else --m;
}
}
else {
while (++i < n) {
if (!isNaN(value = number(valueof(values[i], i, values)))) sum += value;
else --m;
}
}
if (m) return sum / m;
};
var median = function(values, valueof) {
var n = values.length,
i = -1,
value,
numbers = [];
if (valueof == null) {
while (++i < n) {
if (!isNaN(value = number(values[i]))) {
numbers.push(value);
}
}
}
else {
while (++i < n) {
if (!isNaN(value = number(valueof(values[i], i, values)))) {
numbers.push(value);
}
}
}
return threshold(numbers.sort(ascending), 0.5);
};
var merge = function(arrays) {
var n = arrays.length,
m,
i = -1,
j = 0,
merged,
array;
while (++i < n) j += arrays[i].length;
merged = new Array(j);
while (--n >= 0) {
array = arrays[n];
m = array.length;
while (--m >= 0) {
merged[--j] = array[m];
}
}
return merged;
};
var min = function(values, valueof) {
var n = values.length,
i = -1,
value,
min;
if (valueof == null) {
while (++i < n) { // Find the first comparable value.
if ((value = values[i]) != null && value >= value) {
min = value;
while (++i < n) { // Compare the remaining values.
if ((value = values[i]) != null && min > value) {
min = value;
}
}
}
}
}
else {
while (++i < n) { // Find the first comparable value.
if ((value = valueof(values[i], i, values)) != null && value >= value) {
min = value;
while (++i < n) { // Compare the remaining values.
if ((value = valueof(values[i], i, values)) != null && min > value) {
min = value;
}
}
}
}
}
return min;
};
var permute = function(array, indexes) {
var i = indexes.length, permutes = new Array(i);
while (i--) permutes[i] = array[indexes[i]];
return permutes;
};
var scan = function(values, compare) {
if (!(n = values.length)) return;
var n,
i = 0,
j = 0,
xi,
xj = values[j];
if (compare == null) compare = ascending;
while (++i < n) {
if (compare(xi = values[i], xj) < 0 || compare(xj, xj) !== 0) {
xj = xi, j = i;
}
}
if (compare(xj, xj) === 0) return j;
};
var shuffle = function(array, i0, i1) {
var m = (i1 == null ? array.length : i1) - (i0 = i0 == null ? 0 : +i0),
t,
i;
while (m) {
i = Math.random() * m-- | 0;
t = array[m + i0];
array[m + i0] = array[i + i0];
array[i + i0] = t;
}
return array;
};
var sum = function(values, valueof) {
var n = values.length,
i = -1,
value,
sum = 0;
if (valueof == null) {
while (++i < n) {
if (value = +values[i]) sum += value; // Note: zero and null are equivalent.
}
}
else {
while (++i < n) {
if (value = +valueof(values[i], i, values)) sum += value;
}
}
return sum;
};
var transpose = function(matrix) {
if (!(n = matrix.length)) return [];
for (var i = -1, m = min(matrix, length), transpose = new Array(m); ++i < m;) {
for (var j = -1, n, row = transpose[i] = new Array(n); ++j < n;) {
row[j] = matrix[j][i];
}
}
return transpose;
};
function length(d) {
return d.length;
}
var zip = function() {
return transpose(arguments);
};
var slice$1 = Array.prototype.slice;
var identity$1 = function(x) {
return x;
};
var top = 1;
var right = 2;
var bottom = 3;
var left = 4;
var epsilon = 1e-6;
function translateX(x) {
return "translate(" + (x + 0.5) + ",0)";
}
function translateY(y) {
return "translate(0," + (y + 0.5) + ")";
}
function center(scale) {
var offset = Math.max(0, scale.bandwidth() - 1) / 2; // Adjust for 0.5px offset.
if (scale.round()) offset = Math.round(offset);
return function(d) {
return scale(d) + offset;
};
}
function entering() {
return !this.__axis;
}
function axis(orient, scale) {
var tickArguments = [],
tickValues = null,
tickFormat = null,
tickSizeInner = 6,
tickSizeOuter = 6,
tickPadding = 3,
k = orient === top || orient === left ? -1 : 1,
x = orient === left || orient === right ? "x" : "y",
transform = orient === top || orient === bottom ? translateX : translateY;
function axis(context) {
var values = tickValues == null ? (scale.ticks ? scale.ticks.apply(scale, tickArguments) : scale.domain()) : tickValues,
format = tickFormat == null ? (scale.tickFormat ? scale.tickFormat.apply(scale, tickArguments) : identity$1) : tickFormat,
spacing = Math.max(tickSizeInner, 0) + tickPadding,
range = scale.range(),
range0 = range[0] + 0.5,
range1 = range[range.length - 1] + 0.5,
position = (scale.bandwidth ? center : identity$1)(scale.copy()),
selection = context.selection ? context.selection() : context,
path = selection.selectAll(".domain").data([null]),
tick = selection.selectAll(".tick").data(values, scale).order(),
tickExit = tick.exit(),
tickEnter = tick.enter().append("g").attr("class", "tick"),
line = tick.select("line"),
text = tick.select("text");
path = path.merge(path.enter().insert("path", ".tick")
.attr("class", "domain")
.attr("stroke", "#000"));
tick = tick.merge(tickEnter);
line = line.merge(tickEnter.append("line")
.attr("stroke", "#000")
.attr(x + "2", k * tickSizeInner));
text = text.merge(tickEnter.append("text")
.attr("fill", "#000")
.attr(x, k * spacing)
.attr("dy", orient === top ? "0em" : orient === bottom ? "0.71em" : "0.32em"));
if (context !== selection) {
path = path.transition(context);
tick = tick.transition(context);
line = line.transition(context);
text = text.transition(context);
tickExit = tickExit.transition(context)
.attr("opacity", epsilon)
.attr("transform", function(d) { return isFinite(d = position(d)) ? transform(d) : this.getAttribute("transform"); });
tickEnter
.attr("opacity", epsilon)
.attr("transform", function(d) { var p = this.parentNode.__axis; return transform(p && isFinite(p = p(d)) ? p : position(d)); });
}
tickExit.remove();
path
.attr("d", orient === left || orient == right
? "M" + k * tickSizeOuter + "," + range0 + "H0.5V" + range1 + "H" + k * tickSizeOuter
: "M" + range0 + "," + k * tickSizeOuter + "V0.5H" + range1 + "V" + k * tickSizeOuter);
tick
.attr("opacity", 1)
.attr("transform", function(d) { return transform(position(d)); });
line
.attr(x + "2", k * tickSizeInner);
text
.attr(x, k * spacing)
.text(format);
selection.filter(entering)
.attr("fill", "none")
.attr("font-size", 10)
.attr("font-family", "sans-serif")
.attr("text-anchor", orient === right ? "start" : orient === left ? "end" : "middle");
selection
.each(function() { this.__axis = position; });
}
axis.scale = function(_) {
return arguments.length ? (scale = _, axis) : scale;
};
axis.ticks = function() {
return tickArguments = slice$1.call(arguments), axis;
};
axis.tickArguments = function(_) {
return arguments.length ? (tickArguments = _ == null ? [] : slice$1.call(_), axis) : tickArguments.slice();
};
axis.tickValues = function(_) {
return arguments.length ? (tickValues = _ == null ? null : slice$1.call(_), axis) : tickValues && tickValues.slice();
};
axis.tickFormat = function(_) {
return arguments.length ? (tickFormat = _, axis) : tickFormat;
};
axis.tickSize = function(_) {
return arguments.length ? (tickSizeInner = tickSizeOuter = +_, axis) : tickSizeInner;
};
axis.tickSizeInner = function(_) {
return arguments.length ? (tickSizeInner = +_, axis) : tickSizeInner;
};
axis.tickSizeOuter = function(_) {
return arguments.length ? (tickSizeOuter = +_, axis) : tickSizeOuter;
};
axis.tickPadding = function(_) {
return arguments.length ? (tickPadding = +_, axis) : tickPadding;
};
return axis;
}
function axisTop(scale) {
return axis(top, scale);
}
function axisRight(scale) {
return axis(right, scale);
}
function axisBottom(scale) {
return axis(bottom, scale);
}
function axisLeft(scale) {
return axis(left, scale);
}
var noop = {value: function() {}};
function dispatch() {
for (var i = 0, n = arguments.length, _ = {}, t; i < n; ++i) {
if (!(t = arguments[i] + "") || (t in _)) throw new Error("illegal type: " + t);
_[t] = [];
}
return new Dispatch(_);
}
function Dispatch(_) {
this._ = _;
}
function parseTypenames(typenames, types) {
return typenames.trim().split(/^|\s+/).map(function(t) {
var name = "", i = t.indexOf(".");
if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);
if (t && !types.hasOwnProperty(t)) throw new Error("unknown type: " + t);
return {type: t, name: name};
});
}
Dispatch.prototype = dispatch.prototype = {
constructor: Dispatch,
on: function(typename, callback) {
var _ = this._,
T = parseTypenames(typename + "", _),
t,
i = -1,
n = T.length;
// If no callback was specified, return the callback of the given type and name.
if (arguments.length < 2) {
while (++i < n) if ((t = (typename = T[i]).type) && (t = get(_[t], typename.name))) return t;
return;
}
// If a type was specified, set the callback for the given type and name.
// Otherwise, if a null callback was specified, remove callbacks of the given name.
if (callback != null && typeof callback !== "function") throw new Error("invalid callback: " + callback);
while (++i < n) {
if (t = (typename = T[i]).type) _[t] = set(_[t], typename.name, callback);
else if (callback == null) for (t in _) _[t] = set(_[t], typename.name, null);
}
return this;
},
copy: function() {
var copy = {}, _ = this._;
for (var t in _) copy[t] = _[t].slice();
return new Dispatch(copy);
},
call: function(type, that) {
if ((n = arguments.length - 2) > 0) for (var args = new Array(n), i = 0, n, t; i < n; ++i) args[i] = arguments[i + 2];
if (!this._.hasOwnProperty(type)) throw new Error("unknown type: " + type);
for (t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);
},
apply: function(type, that, args) {
if (!this._.hasOwnProperty(type)) throw new Error("unknown type: " + type);
for (var t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);
}
};
function get(type, name) {
for (var i = 0, n = type.length, c; i < n; ++i) {
if ((c = type[i]).name === name) {
return c.value;
}
}
}
function set(type, name, callback) {
for (var i = 0, n = type.length; i < n; ++i) {
if (type[i].name === name) {
type[i] = noop, type = type.slice(0, i).concat(type.slice(i + 1));
break;
}
}
if (callback != null) type.push({name: name, value: callback});
return type;
}
var xhtml = "http://www.w3.org/1999/xhtml";
var namespaces = {
svg: "http://www.w3.org/2000/svg",
xhtml: xhtml,
xlink: "http://www.w3.org/1999/xlink",
xml: "http://www.w3.org/XML/1998/namespace",
xmlns: "http://www.w3.org/2000/xmlns/"
};
var namespace = function(name) {
var prefix = name += "", i = prefix.indexOf(":");
if (i >= 0 && (prefix = name.slice(0, i)) !== "xmlns") name = name.slice(i + 1);
return namespaces.hasOwnProperty(prefix) ? {space: namespaces[prefix], local: name} : name;
};
function creatorInherit(name) {
return function() {
var document = this.ownerDocument,
uri = this.namespaceURI;
return uri === xhtml && document.documentElement.namespaceURI === xhtml
? document.createElement(name)
: document.createElementNS(uri, name);
};
}
function creatorFixed(fullname) {
return function() {
return this.ownerDocument.createElementNS(fullname.space, fullname.local);
};
}
var creator = function(name) {
var fullname = namespace(name);
return (fullname.local
? creatorFixed
: creatorInherit)(fullname);
};
var nextId = 0;
function local$1() {
return new Local;
}
function Local() {
this._ = "@" + (++nextId).toString(36);
}
Local.prototype = local$1.prototype = {
constructor: Local,
get: function(node) {
var id = this._;
while (!(id in node)) if (!(node = node.parentNode)) return;
return node[id];
},
set: function(node, value) {
return node[this._] = value;
},
remove: function(node) {
return this._ in node && delete node[this._];
},
toString: function() {
return this._;
}
};
var matcher = function(selector) {
return function() {
return this.matches(selector);
};
};
if (typeof document !== "undefined") {
var element = document.documentElement;
if (!element.matches) {
var vendorMatches = element.webkitMatchesSelector
|| element.msMatchesSelector
|| element.mozMatchesSelector
|| element.oMatchesSelector;
matcher = function(selector) {
return function() {
return vendorMatches.call(this, selector);
};
};
}
}
var matcher$1 = matcher;
var filterEvents = {};
exports.event = null;
if (typeof document !== "undefined") {
var element$1 = document.documentElement;
if (!("onmouseenter" in element$1)) {
filterEvents = {mouseenter: "mouseover", mouseleave: "mouseout"};
}
}
function filterContextListener(listener, index, group) {
listener = contextListener(listener, index, group);
return function(event) {
var related = event.relatedTarget;
if (!related || (related !== this && !(related.compareDocumentPosition(this) & 8))) {
listener.call(this, event);
}
};
}
function contextListener(listener, index, group) {
return function(event1) {
var event0 = exports.event; // Events can be reentrant (e.g., focus).
exports.event = event1;
try {
listener.call(this, this.__data__, index, group);
} finally {
exports.event = event0;
}
};
}
function parseTypenames$1(typenames) {
return typenames.trim().split(/^|\s+/).map(function(t) {
var name = "", i = t.indexOf(".");
if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);
return {type: t, name: name};
});
}
function onRemove(typename) {
return function() {
var on = this.__on;
if (!on) return;
for (var j = 0, i = -1, m = on.length, o; j < m; ++j) {
if (o = on[j], (!typename.type || o.type === typename.type) && o.name === typename.name) {
this.removeEventListener(o.type, o.listener, o.capture);
} else {
on[++i] = o;
}
}
if (++i) on.length = i;
else delete this.__on;
};
}
function onAdd(typename, value, capture) {
var wrap = filterEvents.hasOwnProperty(typename.type) ? filterContextListener : contextListener;
return function(d, i, group) {
var on = this.__on, o, listener = wrap(value, i, group);
if (on) for (var j = 0, m = on.length; j < m; ++j) {
if ((o = on[j]).type === typename.type && o.name === typename.name) {
this.removeEventListener(o.type, o.listener, o.capture);
this.addEventListener(o.type, o.listener = listener, o.capture = capture);
o.value = value;
return;
}
}
this.addEventListener(typename.type, listener, capture);
o = {type: typename.type, name: typename.name, value: value, listener: listener, capture: capture};
if (!on) this.__on = [o];
else on.push(o);
};
}
var selection_on = function(typename, value, capture) {
var typenames = parseTypenames$1(typename + ""), i, n = typenames.length, t;
if (arguments.length < 2) {
var on = this.node().__on;
if (on) for (var j = 0, m = on.length, o; j < m; ++j) {
for (i = 0, o = on[j]; i < n; ++i) {
if ((t = typenames[i]).type === o.type && t.name === o.name) {
return o.value;
}
}
}
return;
}
on = value ? onAdd : onRemove;
if (capture == null) capture = false;
for (i = 0; i < n; ++i) this.each(on(typenames[i], value, capture));
return this;
};
function customEvent(event1, listener, that, args) {
var event0 = exports.event;
event1.sourceEvent = exports.event;
exports.event = event1;
try {
return listener.apply(that, args);
} finally {
exports.event = event0;
}
}
var sourceEvent = function() {
var current = exports.event, source;
while (source = current.sourceEvent) current = source;
return current;
};
var point = function(node, event) {
var svg = node.ownerSVGElement || node;
if (svg.createSVGPoint) {
var point = svg.createSVGPoint();
point.x = event.clientX, point.y = event.clientY;
point = point.matrixTransform(node.getScreenCTM().inverse());
return [point.x, point.y];
}
var rect = node.getBoundingClientRect();
return [event.clientX - rect.left - node.clientLeft, event.clientY - rect.top - node.clientTop];
};
var mouse = function(node) {
var event = sourceEvent();
if (event.changedTouches) event = event.changedTouches[0];
return point(node, event);
};
function none() {}
var selector = function(selector) {
return selector == null ? none : function() {
return this.querySelector(selector);
};
};
var selection_select = function(select) {
if (typeof select !== "function") select = selector(select);
for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {
for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) {
if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) {
if ("__data__" in node) subnode.__data__ = node.__data__;
subgroup[i] = subnode;
}
}
}
return new Selection(subgroups, this._parents);
};
function empty$1() {
return [];
}
var selectorAll = function(selector) {
return selector == null ? empty$1 : function() {
return this.querySelectorAll(selector);
};
};
var selection_selectAll = function(select) {
if (typeof select !== "function") select = selectorAll(select);
for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) {
for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {
if (node = group[i]) {
subgroups.push(select.call(node, node.__data__, i, group));
parents.push(node);
}
}
}
return new Selection(subgroups, parents);
};
var selection_filter = function(match) {
if (typeof match !== "function") match = matcher$1(match);
for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {
for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {
if ((node = group[i]) && match.call(node, node.__data__, i, group)) {
subgroup.push(node);
}
}
}
return new Selection(subgroups, this._parents);
};
var sparse = function(update) {
return new Array(update.length);
};
var selection_enter = function() {
return new Selection(this._enter || this._groups.map(sparse), this._parents);
};
function EnterNode(parent, datum) {
this.ownerDocument = parent.ownerDocument;
this.namespaceURI = parent.namespaceURI;
this._next = null;
this._parent = parent;
this.__data__ = datum;
}
EnterNode.prototype = {
constructor: EnterNode,
appendChild: function(child) { return this._parent.insertBefore(child, this._next); },
insertBefore: function(child, next) { return this._parent.insertBefore(child, next); },
querySelector: function(selector) { return this._parent.querySelector(selector); },
querySelectorAll: function(selector) { return this._parent.querySelectorAll(selector); }
};
var constant$1 = function(x) {
return function() {
return x;
};
};
var keyPrefix = "$"; // Protect against keys like “__proto__”.
function bindIndex(parent, group, enter, update, exit, data) {
var i = 0,
node,
groupLength = group.length,
dataLength = data.length;
// Put any non-null nodes that fit into update.
// Put any null nodes into enter.
// Put any remaining data into enter.
for (; i < dataLength; ++i) {
if (node = group[i]) {
node.__data__ = data[i];
update[i] = node;
} else {
enter[i] = new EnterNode(parent, data[i]);
}
}
// Put any non-null nodes that dont fit into exit.
for (; i < groupLength; ++i) {
if (node = group[i]) {
exit[i] = node;
}
}
}
function bindKey(parent, group, enter, update, exit, data, key) {
var i,
node,
nodeByKeyValue = {},
groupLength = group.length,
dataLength = data.length,
keyValues = new Array(groupLength),
keyValue;
// Compute the key for each node.
// If multiple nodes have the same key, the duplicates are added to exit.
for (i = 0; i < groupLength; ++i) {
if (node = group[i]) {
keyValues[i] = keyValue = keyPrefix + key.call(node, node.__data__, i, group);
if (keyValue in nodeByKeyValue) {
exit[i] = node;
} else {
nodeByKeyValue[keyValue] = node;
}
}
}
// Compute the key for each datum.
// If there a node associated with this key, join and add it to update.
// If there is not (or the key is a duplicate), add it to enter.
for (i = 0; i < dataLength; ++i) {
keyValue = keyPrefix + key.call(parent, data[i], i, data);
if (node = nodeByKeyValue[keyValue]) {
update[i] = node;
node.__data__ = data[i];
nodeByKeyValue[keyValue] = null;
} else {
enter[i] = new EnterNode(parent, data[i]);
}
}
// Add any remaining nodes that were not bound to data to exit.
for (i = 0; i < groupLength; ++i) {
if ((node = group[i]) && (nodeByKeyValue[keyValues[i]] === node)) {
exit[i] = node;
}
}
}
var selection_data = function(value, key) {
if (!value) {
data = new Array(this.size()), j = -1;
this.each(function(d) { data[++j] = d; });
return data;
}
var bind = key ? bindKey : bindIndex,
parents = this._parents,
groups = this._groups;
if (typeof value !== "function") value = constant$1(value);
for (var m = groups.length, update = new Array(m), enter = new Array(m), exit = new Array(m), j = 0; j < m; ++j) {
var parent = parents[j],
group = groups[j],
groupLength = group.length,
data = value.call(parent, parent && parent.__data__, j, parents),
dataLength = data.length,
enterGroup = enter[j] = new Array(dataLength),
updateGroup = update[j] = new Array(dataLength),
exitGroup = exit[j] = new Array(groupLength);
bind(parent, group, enterGroup, updateGroup, exitGroup, data, key);
// Now connect the enter nodes to their following update node, such that
// appendChild can insert the materialized enter node before this node,
// rather than at the end of the parent node.
for (var i0 = 0, i1 = 0, previous, next; i0 < dataLength; ++i0) {
if (previous = enterGroup[i0]) {
if (i0 >= i1) i1 = i0 + 1;
while (!(next = updateGroup[i1]) && ++i1 < dataLength);
previous._next = next || null;
}
}
}
update = new Selection(update, parents);
update._enter = enter;
update._exit = exit;
return update;
};
var selection_exit = function() {
return new Selection(this._exit || this._groups.map(sparse), this._parents);
};
var selection_merge = function(selection) {
for (var groups0 = this._groups, groups1 = selection._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {
for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) {
if (node = group0[i] || group1[i]) {
merge[i] = node;
}
}
}
for (; j < m0; ++j) {
merges[j] = groups0[j];
}
return new Selection(merges, this._parents);
};
var selection_order = function() {
for (var groups = this._groups, j = -1, m = groups.length; ++j < m;) {
for (var group = groups[j], i = group.length - 1, next = group[i], node; --i >= 0;) {
if (node = group[i]) {
if (next && next !== node.nextSibling) next.parentNode.insertBefore(node, next);
next = node;
}
}
}
return this;
};
var selection_sort = function(compare) {
if (!compare) compare = ascending$1;
function compareNode(a, b) {
return a && b ? compare(a.__data__, b.__data__) : !a - !b;
}
for (var groups = this._groups, m = groups.length, sortgroups = new Array(m), j = 0; j < m; ++j) {
for (var group = groups[j], n = group.length, sortgroup = sortgroups[j] = new Array(n), node, i = 0; i < n; ++i) {
if (node = group[i]) {
sortgroup[i] = node;
}
}
sortgroup.sort(compareNode);
}
return new Selection(sortgroups, this._parents).order();
};
function ascending$1(a, b) {
return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;
}
var selection_call = function() {
var callback = arguments[0];
arguments[0] = this;
callback.apply(null, arguments);
return this;
};
var selection_nodes = function() {
var nodes = new Array(this.size()), i = -1;
this.each(function() { nodes[++i] = this; });
return nodes;
};
var selection_node = function() {
for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {
for (var group = groups[j], i = 0, n = group.length; i < n; ++i) {
var node = group[i];
if (node) return node;
}
}
return null;
};
var selection_size = function() {
var size = 0;
this.each(function() { ++size; });
return size;
};
var selection_empty = function() {
return !this.node();
};
var selection_each = function(callback) {
for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {
for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) {
if (node = group[i]) callback.call(node, node.__data__, i, group);
}
}
return this;
};
function attrRemove(name) {
return function() {
this.removeAttribute(name);
};
}
function attrRemoveNS(fullname) {
return function() {
this.removeAttributeNS(fullname.space, fullname.local);
};
}
function attrConstant(name, value) {
return function() {
this.setAttribute(name, value);
};
}
function attrConstantNS(fullname, value) {
return function() {
this.setAttributeNS(fullname.space, fullname.local, value);
};
}
function attrFunction(name, value) {
return function() {
var v = value.apply(this, arguments);
if (v == null) this.removeAttribute(name);
else this.setAttribute(name, v);
};
}
function attrFunctionNS(fullname, value) {
return function() {
var v = value.apply(this, arguments);
if (v == null) this.removeAttributeNS(fullname.space, fullname.local);
else this.setAttributeNS(fullname.space, fullname.local, v);
};
}
var selection_attr = function(name, value) {
var fullname = namespace(name);
if (arguments.length < 2) {
var node = this.node();
return fullname.local
? node.getAttributeNS(fullname.space, fullname.local)
: node.getAttribute(fullname);
}
return this.each((value == null
? (fullname.local ? attrRemoveNS : attrRemove) : (typeof value === "function"
? (fullname.local ? attrFunctionNS : attrFunction)
: (fullname.local ? attrConstantNS : attrConstant)))(fullname, value));
};
var defaultView = function(node) {
return (node.ownerDocument && node.ownerDocument.defaultView) // node is a Node
|| (node.document && node) // node is a Window
|| node.defaultView; // node is a Document
};
function styleRemove(name) {
return function() {
this.style.removeProperty(name);
};
}
function styleConstant(name, value, priority) {
return function() {
this.style.setProperty(name, value, priority);
};
}
function styleFunction(name, value, priority) {
return function() {
var v = value.apply(this, arguments);
if (v == null) this.style.removeProperty(name);
else this.style.setProperty(name, v, priority);
};
}
var selection_style = function(name, value, priority) {
return arguments.length > 1
? this.each((value == null
? styleRemove : typeof value === "function"
? styleFunction
: styleConstant)(name, value, priority == null ? "" : priority))
: styleValue(this.node(), name);
};
function styleValue(node, name) {
return node.style.getPropertyValue(name)
|| defaultView(node).getComputedStyle(node, null).getPropertyValue(name);
}
function propertyRemove(name) {
return function() {
delete this[name];
};
}
function propertyConstant(name, value) {
return function() {
this[name] = value;
};
}
function propertyFunction(name, value) {
return function() {
var v = value.apply(this, arguments);
if (v == null) delete this[name];
else this[name] = v;
};
}
var selection_property = function(name, value) {
return arguments.length > 1
? this.each((value == null
? propertyRemove : typeof value === "function"
? propertyFunction
: propertyConstant)(name, value))
: this.node()[name];
};
function classArray(string) {
return string.trim().split(/^|\s+/);
}
function classList(node) {
return node.classList || new ClassList(node);
}
function ClassList(node) {
this._node = node;
this._names = classArray(node.getAttribute("class") || "");
}
ClassList.prototype = {
add: function(name) {
var i = this._names.indexOf(name);
if (i < 0) {
this._names.push(name);
this._node.setAttribute("class", this._names.join(" "));
}
},
remove: function(name) {
var i = this._names.indexOf(name);
if (i >= 0) {
this._names.splice(i, 1);
this._node.setAttribute("class", this._names.join(" "));
}
},
contains: function(name) {
return this._names.indexOf(name) >= 0;
}
};
function classedAdd(node, names) {
var list = classList(node), i = -1, n = names.length;
while (++i < n) list.add(names[i]);
}
function classedRemove(node, names) {
var list = classList(node), i = -1, n = names.length;
while (++i < n) list.remove(names[i]);
}
function classedTrue(names) {
return function() {
classedAdd(this, names);
};
}
function classedFalse(names) {
return function() {
classedRemove(this, names);
};
}
function classedFunction(names, value) {
return function() {
(value.apply(this, arguments) ? classedAdd : classedRemove)(this, names);
};
}
var selection_classed = function(name, value) {
var names = classArray(name + "");
if (arguments.length < 2) {
var list = classList(this.node()), i = -1, n = names.length;
while (++i < n) if (!list.contains(names[i])) return false;
return true;
}
return this.each((typeof value === "function"
? classedFunction : value
? classedTrue
: classedFalse)(names, value));
};
function textRemove() {
this.textContent = "";
}
function textConstant(value) {
return function() {
this.textContent = value;
};
}
function textFunction(value) {
return function() {
var v = value.apply(this, arguments);
this.textContent = v == null ? "" : v;
};
}
var selection_text = function(value) {
return arguments.length
? this.each(value == null
? textRemove : (typeof value === "function"
? textFunction
: textConstant)(value))
: this.node().textContent;
};
function htmlRemove() {
this.innerHTML = "";
}
function htmlConstant(value) {
return function() {
this.innerHTML = value;
};
}
function htmlFunction(value) {
return function() {
var v = value.apply(this, arguments);
this.innerHTML = v == null ? "" : v;
};
}
var selection_html = function(value) {
return arguments.length
? this.each(value == null
? htmlRemove : (typeof value === "function"
? htmlFunction
: htmlConstant)(value))
: this.node().innerHTML;
};
function raise() {
if (this.nextSibling) this.parentNode.appendChild(this);
}
var selection_raise = function() {
return this.each(raise);
};
function lower() {
if (this.previousSibling) this.parentNode.insertBefore(this, this.parentNode.firstChild);
}
var selection_lower = function() {
return this.each(lower);
};
var selection_append = function(name) {
var create = typeof name === "function" ? name : creator(name);
return this.select(function() {
return this.appendChild(create.apply(this, arguments));
});
};
function constantNull() {
return null;
}
var selection_insert = function(name, before) {
var create = typeof name === "function" ? name : creator(name),
select = before == null ? constantNull : typeof before === "function" ? before : selector(before);
return this.select(function() {
return this.insertBefore(create.apply(this, arguments), select.apply(this, arguments) || null);
});
};
function remove() {
var parent = this.parentNode;
if (parent) parent.removeChild(this);
}
var selection_remove = function() {
return this.each(remove);
};
var selection_datum = function(value) {
return arguments.length
? this.property("__data__", value)
: this.node().__data__;
};
function dispatchEvent(node, type, params) {
var window = defaultView(node),
event = window.CustomEvent;
if (typeof event === "function") {
event = new event(type, params);
} else {
event = window.document.createEvent("Event");
if (params) event.initEvent(type, params.bubbles, params.cancelable), event.detail = params.detail;
else event.initEvent(type, false, false);
}
node.dispatchEvent(event);
}
function dispatchConstant(type, params) {
return function() {
return dispatchEvent(this, type, params);
};
}
function dispatchFunction(type, params) {
return function() {
return dispatchEvent(this, type, params.apply(this, arguments));
};
}
var selection_dispatch = function(type, params) {
return this.each((typeof params === "function"
? dispatchFunction
: dispatchConstant)(type, params));
};
var root = [null];
function Selection(groups, parents) {
this._groups = groups;
this._parents = parents;
}
function selection() {
return new Selection([[document.documentElement]], root);
}
Selection.prototype = selection.prototype = {
constructor: Selection,
select: selection_select,
selectAll: selection_selectAll,
filter: selection_filter,
data: selection_data,
enter: selection_enter,
exit: selection_exit,
merge: selection_merge,
order: selection_order,
sort: selection_sort,
call: selection_call,
nodes: selection_nodes,
node: selection_node,
size: selection_size,
empty: selection_empty,
each: selection_each,
attr: selection_attr,
style: selection_style,
property: selection_property,
classed: selection_classed,
text: selection_text,
html: selection_html,
raise: selection_raise,
lower: selection_lower,
append: selection_append,
insert: selection_insert,
remove: selection_remove,
datum: selection_datum,
on: selection_on,
dispatch: selection_dispatch
};
var select = function(selector) {
return typeof selector === "string"
? new Selection([[document.querySelector(selector)]], [document.documentElement])
: new Selection([[selector]], root);
};
var selectAll = function(selector) {
return typeof selector === "string"
? new Selection([document.querySelectorAll(selector)], [document.documentElement])
: new Selection([selector == null ? [] : selector], root);
};
var touch = function(node, touches, identifier) {
if (arguments.length < 3) identifier = touches, touches = sourceEvent().changedTouches;
for (var i = 0, n = touches ? touches.length : 0, touch; i < n; ++i) {
if ((touch = touches[i]).identifier === identifier) {
return point(node, touch);
}
}
return null;
};
var touches = function(node, touches) {
if (touches == null) touches = sourceEvent().touches;
for (var i = 0, n = touches ? touches.length : 0, points = new Array(n); i < n; ++i) {
points[i] = point(node, touches[i]);
}
return points;
};
function nopropagation() {
exports.event.stopImmediatePropagation();
}
var noevent = function() {
exports.event.preventDefault();
exports.event.stopImmediatePropagation();
};
var dragDisable = function(view) {
var root = view.document.documentElement,
selection$$1 = select(view).on("dragstart.drag", noevent, true);
if ("onselectstart" in root) {
selection$$1.on("selectstart.drag", noevent, true);
} else {
root.__noselect = root.style.MozUserSelect;
root.style.MozUserSelect = "none";
}
};
function yesdrag(view, noclick) {
var root = view.document.documentElement,
selection$$1 = select(view).on("dragstart.drag", null);
if (noclick) {
selection$$1.on("click.drag", noevent, true);
setTimeout(function() { selection$$1.on("click.drag", null); }, 0);
}
if ("onselectstart" in root) {
selection$$1.on("selectstart.drag", null);
} else {
root.style.MozUserSelect = root.__noselect;
delete root.__noselect;
}
}
var constant$2 = function(x) {
return function() {
return x;
};
};
function DragEvent(target, type, subject, id, active, x, y, dx, dy, dispatch) {
this.target = target;
this.type = type;
this.subject = subject;
this.identifier = id;
this.active = active;
this.x = x;
this.y = y;
this.dx = dx;
this.dy = dy;
this._ = dispatch;
}
DragEvent.prototype.on = function() {
var value = this._.on.apply(this._, arguments);
return value === this._ ? this : value;
};
// Ignore right-click, since that should open the context menu.
function defaultFilter$1() {
return !exports.event.button;
}
function defaultContainer() {
return this.parentNode;
}
function defaultSubject(d) {
return d == null ? {x: exports.event.x, y: exports.event.y} : d;
}
var drag = function() {
var filter = defaultFilter$1,
container = defaultContainer,
subject = defaultSubject,
gestures = {},
listeners = dispatch("start", "drag", "end"),
active = 0,
mousedownx,
mousedowny,
mousemoving,
touchending,
clickDistance2 = 0;
function drag(selection$$1) {
selection$$1
.on("mousedown.drag", mousedowned)
.on("touchstart.drag", touchstarted)
.on("touchmove.drag", touchmoved)
.on("touchend.drag touchcancel.drag", touchended)
.style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
}
function mousedowned() {
if (touchending || !filter.apply(this, arguments)) return;
var gesture = beforestart("mouse", container.apply(this, arguments), mouse, this, arguments);
if (!gesture) return;
select(exports.event.view).on("mousemove.drag", mousemoved, true).on("mouseup.drag", mouseupped, true);
dragDisable(exports.event.view);
nopropagation();
mousemoving = false;
mousedownx = exports.event.clientX;
mousedowny = exports.event.clientY;
gesture("start");
}
function mousemoved() {
noevent();
if (!mousemoving) {
var dx = exports.event.clientX - mousedownx, dy = exports.event.clientY - mousedowny;
mousemoving = dx * dx + dy * dy > clickDistance2;
}
gestures.mouse("drag");
}
function mouseupped() {
select(exports.event.view).on("mousemove.drag mouseup.drag", null);
yesdrag(exports.event.view, mousemoving);
noevent();
gestures.mouse("end");
}
function touchstarted() {
if (!filter.apply(this, arguments)) return;
var touches$$1 = exports.event.changedTouches,
c = container.apply(this, arguments),
n = touches$$1.length, i, gesture;
for (i = 0; i < n; ++i) {
if (gesture = beforestart(touches$$1[i].identifier, c, touch, this, arguments)) {
nopropagation();
gesture("start");
}
}
}
function touchmoved() {
var touches$$1 = exports.event.changedTouches,
n = touches$$1.length, i, gesture;
for (i = 0; i < n; ++i) {
if (gesture = gestures[touches$$1[i].identifier]) {
noevent();
gesture("drag");
}
}
}
function touchended() {
var touches$$1 = exports.event.changedTouches,
n = touches$$1.length, i, gesture;
if (touchending) clearTimeout(touchending);
touchending = setTimeout(function() { touchending = null; }, 500); // Ghost clicks are delayed!
for (i = 0; i < n; ++i) {
if (gesture = gestures[touches$$1[i].identifier]) {
nopropagation();
gesture("end");
}
}
}
function beforestart(id, container, point, that, args) {
var p = point(container, id), s, dx, dy,
sublisteners = listeners.copy();
if (!customEvent(new DragEvent(drag, "beforestart", s, id, active, p[0], p[1], 0, 0, sublisteners), function() {
if ((exports.event.subject = s = subject.apply(that, args)) == null) return false;
dx = s.x - p[0] || 0;
dy = s.y - p[1] || 0;
return true;
})) return;
return function gesture(type) {
var p0 = p, n;
switch (type) {
case "start": gestures[id] = gesture, n = active++; break;
case "end": delete gestures[id], --active; // nobreak
case "drag": p = point(container, id), n = active; break;
}
customEvent(new DragEvent(drag, type, s, id, n, p[0] + dx, p[1] + dy, p[0] - p0[0], p[1] - p0[1], sublisteners), sublisteners.apply, sublisteners, [type, that, args]);
};
}
drag.filter = function(_) {
return arguments.length ? (filter = typeof _ === "function" ? _ : constant$2(!!_), drag) : filter;
};
drag.container = function(_) {
return arguments.length ? (container = typeof _ === "function" ? _ : constant$2(_), drag) : container;
};
drag.subject = function(_) {
return arguments.length ? (subject = typeof _ === "function" ? _ : constant$2(_), drag) : subject;
};
drag.on = function() {
var value = listeners.on.apply(listeners, arguments);
return value === listeners ? drag : value;
};
drag.clickDistance = function(_) {
return arguments.length ? (clickDistance2 = (_ = +_) * _, drag) : Math.sqrt(clickDistance2);
};
return drag;
};
var define = function(constructor, factory, prototype) {
constructor.prototype = factory.prototype = prototype;
prototype.constructor = constructor;
};
function extend(parent, definition) {
var prototype = Object.create(parent.prototype);
for (var key in definition) prototype[key] = definition[key];
return prototype;
}
function Color() {}
var darker = 0.7;
var brighter = 1 / darker;
var reI = "\\s*([+-]?\\d+)\\s*";
var reN = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*";
var reP = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*";
var reHex3 = /^#([0-9a-f]{3})$/;
var reHex6 = /^#([0-9a-f]{6})$/;
var reRgbInteger = new RegExp("^rgb\\(" + [reI, reI, reI] + "\\)$");
var reRgbPercent = new RegExp("^rgb\\(" + [reP, reP, reP] + "\\)$");
var reRgbaInteger = new RegExp("^rgba\\(" + [reI, reI, reI, reN] + "\\)$");
var reRgbaPercent = new RegExp("^rgba\\(" + [reP, reP, reP, reN] + "\\)$");
var reHslPercent = new RegExp("^hsl\\(" + [reN, reP, reP] + "\\)$");
var reHslaPercent = new RegExp("^hsla\\(" + [reN, reP, reP, reN] + "\\)$");
var named = {
aliceblue: 0xf0f8ff,
antiquewhite: 0xfaebd7,
aqua: 0x00ffff,
aquamarine: 0x7fffd4,
azure: 0xf0ffff,
beige: 0xf5f5dc,
bisque: 0xffe4c4,
black: 0x000000,
blanchedalmond: 0xffebcd,
blue: 0x0000ff,
blueviolet: 0x8a2be2,
brown: 0xa52a2a,
burlywood: 0xdeb887,
cadetblue: 0x5f9ea0,
chartreuse: 0x7fff00,
chocolate: 0xd2691e,
coral: 0xff7f50,
cornflowerblue: 0x6495ed,
cornsilk: 0xfff8dc,
crimson: 0xdc143c,
cyan: 0x00ffff,
darkblue: 0x00008b,
darkcyan: 0x008b8b,
darkgoldenrod: 0xb8860b,
darkgray: 0xa9a9a9,
darkgreen: 0x006400,
darkgrey: 0xa9a9a9,
darkkhaki: 0xbdb76b,
darkmagenta: 0x8b008b,
darkolivegreen: 0x556b2f,
darkorange: 0xff8c00,
darkorchid: 0x9932cc,
darkred: 0x8b0000,
darksalmon: 0xe9967a,
darkseagreen: 0x8fbc8f,
darkslateblue: 0x483d8b,
darkslategray: 0x2f4f4f,
darkslategrey: 0x2f4f4f,
darkturquoise: 0x00ced1,
darkviolet: 0x9400d3,
deeppink: 0xff1493,
deepskyblue: 0x00bfff,
dimgray: 0x696969,
dimgrey: 0x696969,
dodgerblue: 0x1e90ff,
firebrick: 0xb22222,
floralwhite: 0xfffaf0,
forestgreen: 0x228b22,
fuchsia: 0xff00ff,
gainsboro: 0xdcdcdc,
ghostwhite: 0xf8f8ff,
gold: 0xffd700,
goldenrod: 0xdaa520,
gray: 0x808080,
green: 0x008000,
greenyellow: 0xadff2f,
grey: 0x808080,
honeydew: 0xf0fff0,
hotpink: 0xff69b4,
indianred: 0xcd5c5c,
indigo: 0x4b0082,
ivory: 0xfffff0,
khaki: 0xf0e68c,
lavender: 0xe6e6fa,
lavenderblush: 0xfff0f5,
lawngreen: 0x7cfc00,
lemonchiffon: 0xfffacd,
lightblue: 0xadd8e6,
lightcoral: 0xf08080,
lightcyan: 0xe0ffff,
lightgoldenrodyellow: 0xfafad2,
lightgray: 0xd3d3d3,
lightgreen: 0x90ee90,
lightgrey: 0xd3d3d3,
lightpink: 0xffb6c1,
lightsalmon: 0xffa07a,
lightseagreen: 0x20b2aa,
lightskyblue: 0x87cefa,
lightslategray: 0x778899,
lightslategrey: 0x778899,
lightsteelblue: 0xb0c4de,
lightyellow: 0xffffe0,
lime: 0x00ff00,
limegreen: 0x32cd32,
linen: 0xfaf0e6,
magenta: 0xff00ff,
maroon: 0x800000,
mediumaquamarine: 0x66cdaa,
mediumblue: 0x0000cd,
mediumorchid: 0xba55d3,
mediumpurple: 0x9370db,
mediumseagreen: 0x3cb371,
mediumslateblue: 0x7b68ee,
mediumspringgreen: 0x00fa9a,
mediumturquoise: 0x48d1cc,
mediumvioletred: 0xc71585,
midnightblue: 0x191970,
mintcream: 0xf5fffa,
mistyrose: 0xffe4e1,
moccasin: 0xffe4b5,
navajowhite: 0xffdead,
navy: 0x000080,
oldlace: 0xfdf5e6,
olive: 0x808000,
olivedrab: 0x6b8e23,
orange: 0xffa500,
orangered: 0xff4500,
orchid: 0xda70d6,
palegoldenrod: 0xeee8aa,
palegreen: 0x98fb98,
paleturquoise: 0xafeeee,
palevioletred: 0xdb7093,
papayawhip: 0xffefd5,
peachpuff: 0xffdab9,
peru: 0xcd853f,
pink: 0xffc0cb,
plum: 0xdda0dd,
powderblue: 0xb0e0e6,
purple: 0x800080,
rebeccapurple: 0x663399,
red: 0xff0000,
rosybrown: 0xbc8f8f,
royalblue: 0x4169e1,
saddlebrown: 0x8b4513,
salmon: 0xfa8072,
sandybrown: 0xf4a460,
seagreen: 0x2e8b57,
seashell: 0xfff5ee,
sienna: 0xa0522d,
silver: 0xc0c0c0,
skyblue: 0x87ceeb,
slateblue: 0x6a5acd,
slategray: 0x708090,
slategrey: 0x708090,
snow: 0xfffafa,
springgreen: 0x00ff7f,
steelblue: 0x4682b4,
tan: 0xd2b48c,
teal: 0x008080,
thistle: 0xd8bfd8,
tomato: 0xff6347,
turquoise: 0x40e0d0,
violet: 0xee82ee,
wheat: 0xf5deb3,
white: 0xffffff,
whitesmoke: 0xf5f5f5,
yellow: 0xffff00,
yellowgreen: 0x9acd32
};
define(Color, color, {
displayable: function() {
return this.rgb().displayable();
},
toString: function() {
return this.rgb() + "";
}
});
function color(format) {
var m;
format = (format + "").trim().toLowerCase();
return (m = reHex3.exec(format)) ? (m = parseInt(m[1], 16), new Rgb((m >> 8 & 0xf) | (m >> 4 & 0x0f0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1)) // #f00
: (m = reHex6.exec(format)) ? rgbn(parseInt(m[1], 16)) // #ff0000
: (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0)
: (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%)
: (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1)
: (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1)
: (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%)
: (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1)
: named.hasOwnProperty(format) ? rgbn(named[format])
: format === "transparent" ? new Rgb(NaN, NaN, NaN, 0)
: null;
}
function rgbn(n) {
return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1);
}
function rgba(r, g, b, a) {
if (a <= 0) r = g = b = NaN;
return new Rgb(r, g, b, a);
}
function rgbConvert(o) {
if (!(o instanceof Color)) o = color(o);
if (!o) return new Rgb;
o = o.rgb();
return new Rgb(o.r, o.g, o.b, o.opacity);
}
function rgb(r, g, b, opacity) {
return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);
}
function Rgb(r, g, b, opacity) {
this.r = +r;
this.g = +g;
this.b = +b;
this.opacity = +opacity;
}
define(Rgb, rgb, extend(Color, {
brighter: function(k) {
k = k == null ? brighter : Math.pow(brighter, k);
return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
},
darker: function(k) {
k = k == null ? darker : Math.pow(darker, k);
return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
},
rgb: function() {
return this;
},
displayable: function() {
return (0 <= this.r && this.r <= 255)
&& (0 <= this.g && this.g <= 255)
&& (0 <= this.b && this.b <= 255)
&& (0 <= this.opacity && this.opacity <= 1);
},
toString: function() {
var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a));
return (a === 1 ? "rgb(" : "rgba(")
+ Math.max(0, Math.min(255, Math.round(this.r) || 0)) + ", "
+ Math.max(0, Math.min(255, Math.round(this.g) || 0)) + ", "
+ Math.max(0, Math.min(255, Math.round(this.b) || 0))
+ (a === 1 ? ")" : ", " + a + ")");
}
}));
function hsla(h, s, l, a) {
if (a <= 0) h = s = l = NaN;
else if (l <= 0 || l >= 1) h = s = NaN;
else if (s <= 0) h = NaN;
return new Hsl(h, s, l, a);
}
function hslConvert(o) {
if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);
if (!(o instanceof Color)) o = color(o);
if (!o) return new Hsl;
if (o instanceof Hsl) return o;
o = o.rgb();
var r = o.r / 255,
g = o.g / 255,
b = o.b / 255,
min = Math.min(r, g, b),
max = Math.max(r, g, b),
h = NaN,
s = max - min,
l = (max + min) / 2;
if (s) {
if (r === max) h = (g - b) / s + (g < b) * 6;
else if (g === max) h = (b - r) / s + 2;
else h = (r - g) / s + 4;
s /= l < 0.5 ? max + min : 2 - max - min;
h *= 60;
} else {
s = l > 0 && l < 1 ? 0 : h;
}
return new Hsl(h, s, l, o.opacity);
}
function hsl(h, s, l, opacity) {
return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity);
}
function Hsl(h, s, l, opacity) {
this.h = +h;
this.s = +s;
this.l = +l;
this.opacity = +opacity;
}
define(Hsl, hsl, extend(Color, {
brighter: function(k) {
k = k == null ? brighter : Math.pow(brighter, k);
return new Hsl(this.h, this.s, this.l * k, this.opacity);
},
darker: function(k) {
k = k == null ? darker : Math.pow(darker, k);
return new Hsl(this.h, this.s, this.l * k, this.opacity);
},
rgb: function() {
var h = this.h % 360 + (this.h < 0) * 360,
s = isNaN(h) || isNaN(this.s) ? 0 : this.s,
l = this.l,
m2 = l + (l < 0.5 ? l : 1 - l) * s,
m1 = 2 * l - m2;
return new Rgb(
hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),
hsl2rgb(h, m1, m2),
hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2),
this.opacity
);
},
displayable: function() {
return (0 <= this.s && this.s <= 1 || isNaN(this.s))
&& (0 <= this.l && this.l <= 1)
&& (0 <= this.opacity && this.opacity <= 1);
}
}));
/* From FvD 13.37, CSS Color Module Level 3 */
function hsl2rgb(h, m1, m2) {
return (h < 60 ? m1 + (m2 - m1) * h / 60
: h < 180 ? m2
: h < 240 ? m1 + (m2 - m1) * (240 - h) / 60
: m1) * 255;
}
var deg2rad = Math.PI / 180;
var rad2deg = 180 / Math.PI;
var Kn = 18;
var Xn = 0.950470;
var Yn = 1;
var Zn = 1.088830;
var t0 = 4 / 29;
var t1 = 6 / 29;
var t2 = 3 * t1 * t1;
var t3 = t1 * t1 * t1;
function labConvert(o) {
if (o instanceof Lab) return new Lab(o.l, o.a, o.b, o.opacity);
if (o instanceof Hcl) {
var h = o.h * deg2rad;
return new Lab(o.l, Math.cos(h) * o.c, Math.sin(h) * o.c, o.opacity);
}
if (!(o instanceof Rgb)) o = rgbConvert(o);
var b = rgb2xyz(o.r),
a = rgb2xyz(o.g),
l = rgb2xyz(o.b),
x = xyz2lab((0.4124564 * b + 0.3575761 * a + 0.1804375 * l) / Xn),
y = xyz2lab((0.2126729 * b + 0.7151522 * a + 0.0721750 * l) / Yn),
z = xyz2lab((0.0193339 * b + 0.1191920 * a + 0.9503041 * l) / Zn);
return new Lab(116 * y - 16, 500 * (x - y), 200 * (y - z), o.opacity);
}
function lab(l, a, b, opacity) {
return arguments.length === 1 ? labConvert(l) : new Lab(l, a, b, opacity == null ? 1 : opacity);
}
function Lab(l, a, b, opacity) {
this.l = +l;
this.a = +a;
this.b = +b;
this.opacity = +opacity;
}
define(Lab, lab, extend(Color, {
brighter: function(k) {
return new Lab(this.l + Kn * (k == null ? 1 : k), this.a, this.b, this.opacity);
},
darker: function(k) {
return new Lab(this.l - Kn * (k == null ? 1 : k), this.a, this.b, this.opacity);
},
rgb: function() {
var y = (this.l + 16) / 116,
x = isNaN(this.a) ? y : y + this.a / 500,
z = isNaN(this.b) ? y : y - this.b / 200;
y = Yn * lab2xyz(y);
x = Xn * lab2xyz(x);
z = Zn * lab2xyz(z);
return new Rgb(
xyz2rgb( 3.2404542 * x - 1.5371385 * y - 0.4985314 * z), // D65 -> sRGB
xyz2rgb(-0.9692660 * x + 1.8760108 * y + 0.0415560 * z),
xyz2rgb( 0.0556434 * x - 0.2040259 * y + 1.0572252 * z),
this.opacity
);
}
}));
function xyz2lab(t) {
return t > t3 ? Math.pow(t, 1 / 3) : t / t2 + t0;
}
function lab2xyz(t) {
return t > t1 ? t * t * t : t2 * (t - t0);
}
function xyz2rgb(x) {
return 255 * (x <= 0.0031308 ? 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055);
}
function rgb2xyz(x) {
return (x /= 255) <= 0.04045 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4);
}
function hclConvert(o) {
if (o instanceof Hcl) return new Hcl(o.h, o.c, o.l, o.opacity);
if (!(o instanceof Lab)) o = labConvert(o);
var h = Math.atan2(o.b, o.a) * rad2deg;
return new Hcl(h < 0 ? h + 360 : h, Math.sqrt(o.a * o.a + o.b * o.b), o.l, o.opacity);
}
function hcl(h, c, l, opacity) {
return arguments.length === 1 ? hclConvert(h) : new Hcl(h, c, l, opacity == null ? 1 : opacity);
}
function Hcl(h, c, l, opacity) {
this.h = +h;
this.c = +c;
this.l = +l;
this.opacity = +opacity;
}
define(Hcl, hcl, extend(Color, {
brighter: function(k) {
return new Hcl(this.h, this.c, this.l + Kn * (k == null ? 1 : k), this.opacity);
},
darker: function(k) {
return new Hcl(this.h, this.c, this.l - Kn * (k == null ? 1 : k), this.opacity);
},
rgb: function() {
return labConvert(this).rgb();
}
}));
var A = -0.14861;
var B = +1.78277;
var C = -0.29227;
var D = -0.90649;
var E = +1.97294;
var ED = E * D;
var EB = E * B;
var BC_DA = B * C - D * A;
function cubehelixConvert(o) {
if (o instanceof Cubehelix) return new Cubehelix(o.h, o.s, o.l, o.opacity);
if (!(o instanceof Rgb)) o = rgbConvert(o);
var r = o.r / 255,
g = o.g / 255,
b = o.b / 255,
l = (BC_DA * b + ED * r - EB * g) / (BC_DA + ED - EB),
bl = b - l,
k = (E * (g - l) - C * bl) / D,
s = Math.sqrt(k * k + bl * bl) / (E * l * (1 - l)), // NaN if l=0 or l=1
h = s ? Math.atan2(k, bl) * rad2deg - 120 : NaN;
return new Cubehelix(h < 0 ? h + 360 : h, s, l, o.opacity);
}
function cubehelix(h, s, l, opacity) {
return arguments.length === 1 ? cubehelixConvert(h) : new Cubehelix(h, s, l, opacity == null ? 1 : opacity);
}
function Cubehelix(h, s, l, opacity) {
this.h = +h;
this.s = +s;
this.l = +l;
this.opacity = +opacity;
}
define(Cubehelix, cubehelix, extend(Color, {
brighter: function(k) {
k = k == null ? brighter : Math.pow(brighter, k);
return new Cubehelix(this.h, this.s, this.l * k, this.opacity);
},
darker: function(k) {
k = k == null ? darker : Math.pow(darker, k);
return new Cubehelix(this.h, this.s, this.l * k, this.opacity);
},
rgb: function() {
var h = isNaN(this.h) ? 0 : (this.h + 120) * deg2rad,
l = +this.l,
a = isNaN(this.s) ? 0 : this.s * l * (1 - l),
cosh = Math.cos(h),
sinh = Math.sin(h);
return new Rgb(
255 * (l + a * (A * cosh + B * sinh)),
255 * (l + a * (C * cosh + D * sinh)),
255 * (l + a * (E * cosh)),
this.opacity
);
}
}));
function basis(t1, v0, v1, v2, v3) {
var t2 = t1 * t1, t3 = t2 * t1;
return ((1 - 3 * t1 + 3 * t2 - t3) * v0
+ (4 - 6 * t2 + 3 * t3) * v1
+ (1 + 3 * t1 + 3 * t2 - 3 * t3) * v2
+ t3 * v3) / 6;
}
var basis$1 = function(values) {
var n = values.length - 1;
return function(t) {
var i = t <= 0 ? (t = 0) : t >= 1 ? (t = 1, n - 1) : Math.floor(t * n),
v1 = values[i],
v2 = values[i + 1],
v0 = i > 0 ? values[i - 1] : 2 * v1 - v2,
v3 = i < n - 1 ? values[i + 2] : 2 * v2 - v1;
return basis((t - i / n) * n, v0, v1, v2, v3);
};
};
var basisClosed = function(values) {
var n = values.length;
return function(t) {
var i = Math.floor(((t %= 1) < 0 ? ++t : t) * n),
v0 = values[(i + n - 1) % n],
v1 = values[i % n],
v2 = values[(i + 1) % n],
v3 = values[(i + 2) % n];
return basis((t - i / n) * n, v0, v1, v2, v3);
};
};
var constant$3 = function(x) {
return function() {
return x;
};
};
function linear(a, d) {
return function(t) {
return a + t * d;
};
}
function exponential(a, b, y) {
return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) {
return Math.pow(a + t * b, y);
};
}
function hue(a, b) {
var d = b - a;
return d ? linear(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : constant$3(isNaN(a) ? b : a);
}
function gamma(y) {
return (y = +y) === 1 ? nogamma : function(a, b) {
return b - a ? exponential(a, b, y) : constant$3(isNaN(a) ? b : a);
};
}
function nogamma(a, b) {
var d = b - a;
return d ? linear(a, d) : constant$3(isNaN(a) ? b : a);
}
var interpolateRgb = ((function rgbGamma(y) {
var color$$1 = gamma(y);
function rgb$$1(start, end) {
var r = color$$1((start = rgb(start)).r, (end = rgb(end)).r),
g = color$$1(start.g, end.g),
b = color$$1(start.b, end.b),
opacity = nogamma(start.opacity, end.opacity);
return function(t) {
start.r = r(t);
start.g = g(t);
start.b = b(t);
start.opacity = opacity(t);
return start + "";
};
}
rgb$$1.gamma = rgbGamma;
return rgb$$1;
}))(1);
function rgbSpline(spline) {
return function(colors) {
var n = colors.length,
r = new Array(n),
g = new Array(n),
b = new Array(n),
i, color$$1;
for (i = 0; i < n; ++i) {
color$$1 = rgb(colors[i]);
r[i] = color$$1.r || 0;
g[i] = color$$1.g || 0;
b[i] = color$$1.b || 0;
}
r = spline(r);
g = spline(g);
b = spline(b);
color$$1.opacity = 1;
return function(t) {
color$$1.r = r(t);
color$$1.g = g(t);
color$$1.b = b(t);
return color$$1 + "";
};
};
}
var rgbBasis = rgbSpline(basis$1);
var rgbBasisClosed = rgbSpline(basisClosed);
var array$1 = function(a, b) {
var nb = b ? b.length : 0,
na = a ? Math.min(nb, a.length) : 0,
x = new Array(nb),
c = new Array(nb),
i;
for (i = 0; i < na; ++i) x[i] = interpolateValue(a[i], b[i]);
for (; i < nb; ++i) c[i] = b[i];
return function(t) {
for (i = 0; i < na; ++i) c[i] = x[i](t);
return c;
};
};
var date = function(a, b) {
var d = new Date;
return a = +a, b -= a, function(t) {
return d.setTime(a + b * t), d;
};
};
var reinterpolate = function(a, b) {
return a = +a, b -= a, function(t) {
return a + b * t;
};
};
var object = function(a, b) {
var i = {},
c = {},
k;
if (a === null || typeof a !== "object") a = {};
if (b === null || typeof b !== "object") b = {};
for (k in b) {
if (k in a) {
i[k] = interpolateValue(a[k], b[k]);
} else {
c[k] = b[k];
}
}
return function(t) {
for (k in i) c[k] = i[k](t);
return c;
};
};
var reA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g;
var reB = new RegExp(reA.source, "g");
function zero(b) {
return function() {
return b;
};
}
function one(b) {
return function(t) {
return b(t) + "";
};
}
var interpolateString = function(a, b) {
var bi = reA.lastIndex = reB.lastIndex = 0, // scan index for next number in b
am, // current match in a
bm, // current match in b
bs, // string preceding current number in b, if any
i = -1, // index in s
s = [], // string constants and placeholders
q = []; // number interpolators
// Coerce inputs to strings.
a = a + "", b = b + "";
// Interpolate pairs of numbers in a & b.
while ((am = reA.exec(a))
&& (bm = reB.exec(b))) {
if ((bs = bm.index) > bi) { // a string precedes the next number in b
bs = b.slice(bi, bs);
if (s[i]) s[i] += bs; // coalesce with previous string
else s[++i] = bs;
}
if ((am = am[0]) === (bm = bm[0])) { // numbers in a & b match
if (s[i]) s[i] += bm; // coalesce with previous string
else s[++i] = bm;
} else { // interpolate non-matching numbers
s[++i] = null;
q.push({i: i, x: reinterpolate(am, bm)});
}
bi = reB.lastIndex;
}
// Add remains of b.
if (bi < b.length) {
bs = b.slice(bi);
if (s[i]) s[i] += bs; // coalesce with previous string
else s[++i] = bs;
}
// Special optimization for only a single match.
// Otherwise, interpolate each of the numbers and rejoin the string.
return s.length < 2 ? (q[0]
? one(q[0].x)
: zero(b))
: (b = q.length, function(t) {
for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t);
return s.join("");
});
};
var interpolateValue = function(a, b) {
var t = typeof b, c;
return b == null || t === "boolean" ? constant$3(b)
: (t === "number" ? reinterpolate
: t === "string" ? ((c = color(b)) ? (b = c, interpolateRgb) : interpolateString)
: b instanceof color ? interpolateRgb
: b instanceof Date ? date
: Array.isArray(b) ? array$1
: typeof b.valueOf !== "function" && typeof b.toString !== "function" || isNaN(b) ? object
: reinterpolate)(a, b);
};
var interpolateRound = function(a, b) {
return a = +a, b -= a, function(t) {
return Math.round(a + b * t);
};
};
var degrees = 180 / Math.PI;
var identity$2 = {
translateX: 0,
translateY: 0,
rotate: 0,
skewX: 0,
scaleX: 1,
scaleY: 1
};
var decompose = function(a, b, c, d, e, f) {
var scaleX, scaleY, skewX;
if (scaleX = Math.sqrt(a * a + b * b)) a /= scaleX, b /= scaleX;
if (skewX = a * c + b * d) c -= a * skewX, d -= b * skewX;
if (scaleY = Math.sqrt(c * c + d * d)) c /= scaleY, d /= scaleY, skewX /= scaleY;
if (a * d < b * c) a = -a, b = -b, skewX = -skewX, scaleX = -scaleX;
return {
translateX: e,
translateY: f,
rotate: Math.atan2(b, a) * degrees,
skewX: Math.atan(skewX) * degrees,
scaleX: scaleX,
scaleY: scaleY
};
};
var cssNode;
var cssRoot;
var cssView;
var svgNode;
function parseCss(value) {
if (value === "none") return identity$2;
if (!cssNode) cssNode = document.createElement("DIV"), cssRoot = document.documentElement, cssView = document.defaultView;
cssNode.style.transform = value;
value = cssView.getComputedStyle(cssRoot.appendChild(cssNode), null).getPropertyValue("transform");
cssRoot.removeChild(cssNode);
value = value.slice(7, -1).split(",");
return decompose(+value[0], +value[1], +value[2], +value[3], +value[4], +value[5]);
}
function parseSvg(value) {
if (value == null) return identity$2;
if (!svgNode) svgNode = document.createElementNS("http://www.w3.org/2000/svg", "g");
svgNode.setAttribute("transform", value);
if (!(value = svgNode.transform.baseVal.consolidate())) return identity$2;
value = value.matrix;
return decompose(value.a, value.b, value.c, value.d, value.e, value.f);
}
function interpolateTransform(parse, pxComma, pxParen, degParen) {
function pop(s) {
return s.length ? s.pop() + " " : "";
}
function translate(xa, ya, xb, yb, s, q) {
if (xa !== xb || ya !== yb) {
var i = s.push("translate(", null, pxComma, null, pxParen);
q.push({i: i - 4, x: reinterpolate(xa, xb)}, {i: i - 2, x: reinterpolate(ya, yb)});
} else if (xb || yb) {
s.push("translate(" + xb + pxComma + yb + pxParen);
}
}
function rotate(a, b, s, q) {
if (a !== b) {
if (a - b > 180) b += 360; else if (b - a > 180) a += 360; // shortest path
q.push({i: s.push(pop(s) + "rotate(", null, degParen) - 2, x: reinterpolate(a, b)});
} else if (b) {
s.push(pop(s) + "rotate(" + b + degParen);
}
}
function skewX(a, b, s, q) {
if (a !== b) {
q.push({i: s.push(pop(s) + "skewX(", null, degParen) - 2, x: reinterpolate(a, b)});
} else if (b) {
s.push(pop(s) + "skewX(" + b + degParen);
}
}
function scale(xa, ya, xb, yb, s, q) {
if (xa !== xb || ya !== yb) {
var i = s.push(pop(s) + "scale(", null, ",", null, ")");
q.push({i: i - 4, x: reinterpolate(xa, xb)}, {i: i - 2, x: reinterpolate(ya, yb)});
} else if (xb !== 1 || yb !== 1) {
s.push(pop(s) + "scale(" + xb + "," + yb + ")");
}
}
return function(a, b) {
var s = [], // string constants and placeholders
q = []; // number interpolators
a = parse(a), b = parse(b);
translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q);
rotate(a.rotate, b.rotate, s, q);
skewX(a.skewX, b.skewX, s, q);
scale(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q);
a = b = null; // gc
return function(t) {
var i = -1, n = q.length, o;
while (++i < n) s[(o = q[i]).i] = o.x(t);
return s.join("");
};
};
}
var interpolateTransformCss = interpolateTransform(parseCss, "px, ", "px)", "deg)");
var interpolateTransformSvg = interpolateTransform(parseSvg, ", ", ")", ")");
var rho = Math.SQRT2;
var rho2 = 2;
var rho4 = 4;
var epsilon2 = 1e-12;
function cosh(x) {
return ((x = Math.exp(x)) + 1 / x) / 2;
}
function sinh(x) {
return ((x = Math.exp(x)) - 1 / x) / 2;
}
function tanh(x) {
return ((x = Math.exp(2 * x)) - 1) / (x + 1);
}
// p0 = [ux0, uy0, w0]
// p1 = [ux1, uy1, w1]
var interpolateZoom = function(p0, p1) {
var ux0 = p0[0], uy0 = p0[1], w0 = p0[2],
ux1 = p1[0], uy1 = p1[1], w1 = p1[2],
dx = ux1 - ux0,
dy = uy1 - uy0,
d2 = dx * dx + dy * dy,
i,
S;
// Special case for u0 ≅ u1.
if (d2 < epsilon2) {
S = Math.log(w1 / w0) / rho;
i = function(t) {
return [
ux0 + t * dx,
uy0 + t * dy,
w0 * Math.exp(rho * t * S)
];
};
}
// General case.
else {
var d1 = Math.sqrt(d2),
b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1),
b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1),
r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0),
r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);
S = (r1 - r0) / rho;
i = function(t) {
var s = t * S,
coshr0 = cosh(r0),
u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s + r0) - sinh(r0));
return [
ux0 + u * dx,
uy0 + u * dy,
w0 * coshr0 / cosh(rho * s + r0)
];
};
}
i.duration = S * 1000;
return i;
};
function hsl$1(hue$$1) {
return function(start, end) {
var h = hue$$1((start = hsl(start)).h, (end = hsl(end)).h),
s = nogamma(start.s, end.s),
l = nogamma(start.l, end.l),
opacity = nogamma(start.opacity, end.opacity);
return function(t) {
start.h = h(t);
start.s = s(t);
start.l = l(t);
start.opacity = opacity(t);
return start + "";
};
}
}
var hsl$2 = hsl$1(hue);
var hslLong = hsl$1(nogamma);
function lab$1(start, end) {
var l = nogamma((start = lab(start)).l, (end = lab(end)).l),
a = nogamma(start.a, end.a),
b = nogamma(start.b, end.b),
opacity = nogamma(start.opacity, end.opacity);
return function(t) {
start.l = l(t);
start.a = a(t);
start.b = b(t);
start.opacity = opacity(t);
return start + "";
};
}
function hcl$1(hue$$1) {
return function(start, end) {
var h = hue$$1((start = hcl(start)).h, (end = hcl(end)).h),
c = nogamma(start.c, end.c),
l = nogamma(start.l, end.l),
opacity = nogamma(start.opacity, end.opacity);
return function(t) {
start.h = h(t);
start.c = c(t);
start.l = l(t);
start.opacity = opacity(t);
return start + "";
};
}
}
var hcl$2 = hcl$1(hue);
var hclLong = hcl$1(nogamma);
function cubehelix$1(hue$$1) {
return (function cubehelixGamma(y) {
y = +y;
function cubehelix$$1(start, end) {
var h = hue$$1((start = cubehelix(start)).h, (end = cubehelix(end)).h),
s = nogamma(start.s, end.s),
l = nogamma(start.l, end.l),
opacity = nogamma(start.opacity, end.opacity);
return function(t) {
start.h = h(t);
start.s = s(t);
start.l = l(Math.pow(t, y));
start.opacity = opacity(t);
return start + "";
};
}
cubehelix$$1.gamma = cubehelixGamma;
return cubehelix$$1;
})(1);
}
var cubehelix$2 = cubehelix$1(hue);
var cubehelixLong = cubehelix$1(nogamma);
var quantize = function(interpolator, n) {
var samples = new Array(n);
for (var i = 0; i < n; ++i) samples[i] = interpolator(i / (n - 1));
return samples;
};
var frame = 0;
var timeout = 0;
var interval = 0;
var pokeDelay = 1000;
var taskHead;
var taskTail;
var clockLast = 0;
var clockNow = 0;
var clockSkew = 0;
var clock = typeof performance === "object" && performance.now ? performance : Date;
var setFrame = typeof requestAnimationFrame === "function" ? requestAnimationFrame : function(f) { setTimeout(f, 17); };
function now() {
return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew);
}
function clearNow() {
clockNow = 0;
}
function Timer() {
this._call =
this._time =
this._next = null;
}
Timer.prototype = timer.prototype = {
constructor: Timer,
restart: function(callback, delay, time) {
if (typeof callback !== "function") throw new TypeError("callback is not a function");
time = (time == null ? now() : +time) + (delay == null ? 0 : +delay);
if (!this._next && taskTail !== this) {
if (taskTail) taskTail._next = this;
else taskHead = this;
taskTail = this;
}
this._call = callback;
this._time = time;
sleep();
},
stop: function() {
if (this._call) {
this._call = null;
this._time = Infinity;
sleep();
}
}
};
function timer(callback, delay, time) {
var t = new Timer;
t.restart(callback, delay, time);
return t;
}
function timerFlush() {
now(); // Get the current time, if not already set.
++frame; // Pretend weve set an alarm, if we havent already.
var t = taskHead, e;
while (t) {
if ((e = clockNow - t._time) >= 0) t._call.call(null, e);
t = t._next;
}
--frame;
}
function wake() {
clockNow = (clockLast = clock.now()) + clockSkew;
frame = timeout = 0;
try {
timerFlush();
} finally {
frame = 0;
nap();
clockNow = 0;
}
}
function poke() {
var now = clock.now(), delay = now - clockLast;
if (delay > pokeDelay) clockSkew -= delay, clockLast = now;
}
function nap() {
var t0, t1 = taskHead, t2, time = Infinity;
while (t1) {
if (t1._call) {
if (time > t1._time) time = t1._time;
t0 = t1, t1 = t1._next;
} else {
t2 = t1._next, t1._next = null;
t1 = t0 ? t0._next = t2 : taskHead = t2;
}
}
taskTail = t0;
sleep(time);
}
function sleep(time) {
if (frame) return; // Soonest alarm already set, or will be.
if (timeout) timeout = clearTimeout(timeout);
var delay = time - clockNow;
if (delay > 24) {
if (time < Infinity) timeout = setTimeout(wake, delay);
if (interval) interval = clearInterval(interval);
} else {
if (!interval) clockLast = clockNow, interval = setInterval(poke, pokeDelay);
frame = 1, setFrame(wake);
}
}
var timeout$1 = function(callback, delay, time) {
var t = new Timer;
delay = delay == null ? 0 : +delay;
t.restart(function(elapsed) {
t.stop();
callback(elapsed + delay);
}, delay, time);
return t;
};
var interval$1 = function(callback, delay, time) {
var t = new Timer, total = delay;
if (delay == null) return t.restart(callback, delay, time), t;
delay = +delay, time = time == null ? now() : +time;
t.restart(function tick(elapsed) {
elapsed += total;
t.restart(tick, total += delay, time);
callback(elapsed);
}, delay, time);
return t;
};
var emptyOn = dispatch("start", "end", "interrupt");
var emptyTween = [];
var CREATED = 0;
var SCHEDULED = 1;
var STARTING = 2;
var STARTED = 3;
var RUNNING = 4;
var ENDING = 5;
var ENDED = 6;
var schedule = function(node, name, id, index, group, timing) {
var schedules = node.__transition;
if (!schedules) node.__transition = {};
else if (id in schedules) return;
create(node, id, {
name: name,
index: index, // For context during callback.
group: group, // For context during callback.
on: emptyOn,
tween: emptyTween,
time: timing.time,
delay: timing.delay,
duration: timing.duration,
ease: timing.ease,
timer: null,
state: CREATED
});
};
function init(node, id) {
var schedule = node.__transition;
if (!schedule || !(schedule = schedule[id]) || schedule.state > CREATED) throw new Error("too late");
return schedule;
}
function set$1(node, id) {
var schedule = node.__transition;
if (!schedule || !(schedule = schedule[id]) || schedule.state > STARTING) throw new Error("too late");
return schedule;
}
function get$1(node, id) {
var schedule = node.__transition;
if (!schedule || !(schedule = schedule[id])) throw new Error("too late");
return schedule;
}
function create(node, id, self) {
var schedules = node.__transition,
tween;
// Initialize the self timer when the transition is created.
// Note the actual delay is not known until the first callback!
schedules[id] = self;
self.timer = timer(schedule, 0, self.time);
function schedule(elapsed) {
self.state = SCHEDULED;
self.timer.restart(start, self.delay, self.time);
// If the elapsed delay is less than our first sleep, start immediately.
if (self.delay <= elapsed) start(elapsed - self.delay);
}
function start(elapsed) {
var i, j, n, o;
// If the state is not SCHEDULED, then we previously errored on start.
if (self.state !== SCHEDULED) return stop();
for (i in schedules) {
o = schedules[i];
if (o.name !== self.name) continue;
// While this element already has a starting transition during this frame,
// defer starting an interrupting transition until that transition has a
// chance to tick (and possibly end); see d3/d3-transition#54!
if (o.state === STARTED) return timeout$1(start);
// Interrupt the active transition, if any.
// Dispatch the interrupt event.
if (o.state === RUNNING) {
o.state = ENDED;
o.timer.stop();
o.on.call("interrupt", node, node.__data__, o.index, o.group);
delete schedules[i];
}
// Cancel any pre-empted transitions. No interrupt event is dispatched
// because the cancelled transitions never started. Note that this also
// removes this transition from the pending list!
else if (+i < id) {
o.state = ENDED;
o.timer.stop();
delete schedules[i];
}
}
// Defer the first tick to end of the current frame; see d3/d3#1576.
// Note the transition may be canceled after start and before the first tick!
// Note this must be scheduled before the start event; see d3/d3-transition#16!
// Assuming this is successful, subsequent callbacks go straight to tick.
timeout$1(function() {
if (self.state === STARTED) {
self.state = RUNNING;
self.timer.restart(tick, self.delay, self.time);
tick(elapsed);
}
});
// Dispatch the start event.
// Note this must be done before the tween are initialized.
self.state = STARTING;
self.on.call("start", node, node.__data__, self.index, self.group);
if (self.state !== STARTING) return; // interrupted
self.state = STARTED;
// Initialize the tween, deleting null tween.
tween = new Array(n = self.tween.length);
for (i = 0, j = -1; i < n; ++i) {
if (o = self.tween[i].value.call(node, node.__data__, self.index, self.group)) {
tween[++j] = o;
}
}
tween.length = j + 1;
}
function tick(elapsed) {
var t = elapsed < self.duration ? self.ease.call(null, elapsed / self.duration) : (self.timer.restart(stop), self.state = ENDING, 1),
i = -1,
n = tween.length;
while (++i < n) {
tween[i].call(null, t);
}
// Dispatch the end event.
if (self.state === ENDING) {
self.on.call("end", node, node.__data__, self.index, self.group);
stop();
}
}
function stop() {
self.state = ENDED;
self.timer.stop();
delete schedules[id];
for (var i in schedules) return; // eslint-disable-line no-unused-vars
delete node.__transition;
}
}
var interrupt = function(node, name) {
var schedules = node.__transition,
schedule,
active,
empty = true,
i;
if (!schedules) return;
name = name == null ? null : name + "";
for (i in schedules) {
if ((schedule = schedules[i]).name !== name) { empty = false; continue; }
active = schedule.state > STARTING && schedule.state < ENDING;
schedule.state = ENDED;
schedule.timer.stop();
if (active) schedule.on.call("interrupt", node, node.__data__, schedule.index, schedule.group);
delete schedules[i];
}
if (empty) delete node.__transition;
};
var selection_interrupt = function(name) {
return this.each(function() {
interrupt(this, name);
});
};
function tweenRemove(id, name) {
var tween0, tween1;
return function() {
var schedule = set$1(this, id),
tween = schedule.tween;
// If this node shared tween with the previous node,
// just assign the updated shared tween and were done!
// Otherwise, copy-on-write.
if (tween !== tween0) {
tween1 = tween0 = tween;
for (var i = 0, n = tween1.length; i < n; ++i) {
if (tween1[i].name === name) {
tween1 = tween1.slice();
tween1.splice(i, 1);
break;
}
}
}
schedule.tween = tween1;
};
}
function tweenFunction(id, name, value) {
var tween0, tween1;
if (typeof value !== "function") throw new Error;
return function() {
var schedule = set$1(this, id),
tween = schedule.tween;
// If this node shared tween with the previous node,
// just assign the updated shared tween and were done!
// Otherwise, copy-on-write.
if (tween !== tween0) {
tween1 = (tween0 = tween).slice();
for (var t = {name: name, value: value}, i = 0, n = tween1.length; i < n; ++i) {
if (tween1[i].name === name) {
tween1[i] = t;
break;
}
}
if (i === n) tween1.push(t);
}
schedule.tween = tween1;
};
}
var transition_tween = function(name, value) {
var id = this._id;
name += "";
if (arguments.length < 2) {
var tween = get$1(this.node(), id).tween;
for (var i = 0, n = tween.length, t; i < n; ++i) {
if ((t = tween[i]).name === name) {
return t.value;
}
}
return null;
}
return this.each((value == null ? tweenRemove : tweenFunction)(id, name, value));
};
function tweenValue(transition, name, value) {
var id = transition._id;
transition.each(function() {
var schedule = set$1(this, id);
(schedule.value || (schedule.value = {}))[name] = value.apply(this, arguments);
});
return function(node) {
return get$1(node, id).value[name];
};
}
var interpolate$$1 = function(a, b) {
var c;
return (typeof b === "number" ? reinterpolate
: b instanceof color ? interpolateRgb
: (c = color(b)) ? (b = c, interpolateRgb)
: interpolateString)(a, b);
};
function attrRemove$1(name) {
return function() {
this.removeAttribute(name);
};
}
function attrRemoveNS$1(fullname) {
return function() {
this.removeAttributeNS(fullname.space, fullname.local);
};
}
function attrConstant$1(name, interpolate$$1, value1) {
var value00,
interpolate0;
return function() {
var value0 = this.getAttribute(name);
return value0 === value1 ? null
: value0 === value00 ? interpolate0
: interpolate0 = interpolate$$1(value00 = value0, value1);
};
}
function attrConstantNS$1(fullname, interpolate$$1, value1) {
var value00,
interpolate0;
return function() {
var value0 = this.getAttributeNS(fullname.space, fullname.local);
return value0 === value1 ? null
: value0 === value00 ? interpolate0
: interpolate0 = interpolate$$1(value00 = value0, value1);
};
}
function attrFunction$1(name, interpolate$$1, value) {
var value00,
value10,
interpolate0;
return function() {
var value0, value1 = value(this);
if (value1 == null) return void this.removeAttribute(name);
value0 = this.getAttribute(name);
return value0 === value1 ? null
: value0 === value00 && value1 === value10 ? interpolate0
: interpolate0 = interpolate$$1(value00 = value0, value10 = value1);
};
}
function attrFunctionNS$1(fullname, interpolate$$1, value) {
var value00,
value10,
interpolate0;
return function() {
var value0, value1 = value(this);
if (value1 == null) return void this.removeAttributeNS(fullname.space, fullname.local);
value0 = this.getAttributeNS(fullname.space, fullname.local);
return value0 === value1 ? null
: value0 === value00 && value1 === value10 ? interpolate0
: interpolate0 = interpolate$$1(value00 = value0, value10 = value1);
};
}
var transition_attr = function(name, value) {
var fullname = namespace(name), i = fullname === "transform" ? interpolateTransformSvg : interpolate$$1;
return this.attrTween(name, typeof value === "function"
? (fullname.local ? attrFunctionNS$1 : attrFunction$1)(fullname, i, tweenValue(this, "attr." + name, value))
: value == null ? (fullname.local ? attrRemoveNS$1 : attrRemove$1)(fullname)
: (fullname.local ? attrConstantNS$1 : attrConstant$1)(fullname, i, value + ""));
};
function attrTweenNS(fullname, value) {
function tween() {
var node = this, i = value.apply(node, arguments);
return i && function(t) {
node.setAttributeNS(fullname.space, fullname.local, i(t));
};
}
tween._value = value;
return tween;
}
function attrTween(name, value) {
function tween() {
var node = this, i = value.apply(node, arguments);
return i && function(t) {
node.setAttribute(name, i(t));
};
}
tween._value = value;
return tween;
}
var transition_attrTween = function(name, value) {
var key = "attr." + name;
if (arguments.length < 2) return (key = this.tween(key)) && key._value;
if (value == null) return this.tween(key, null);
if (typeof value !== "function") throw new Error;
var fullname = namespace(name);
return this.tween(key, (fullname.local ? attrTweenNS : attrTween)(fullname, value));
};
function delayFunction(id, value) {
return function() {
init(this, id).delay = +value.apply(this, arguments);
};
}
function delayConstant(id, value) {
return value = +value, function() {
init(this, id).delay = value;
};
}
var transition_delay = function(value) {
var id = this._id;
return arguments.length
? this.each((typeof value === "function"
? delayFunction
: delayConstant)(id, value))
: get$1(this.node(), id).delay;
};
function durationFunction(id, value) {
return function() {
set$1(this, id).duration = +value.apply(this, arguments);
};
}
function durationConstant(id, value) {
return value = +value, function() {
set$1(this, id).duration = value;
};
}
var transition_duration = function(value) {
var id = this._id;
return arguments.length
? this.each((typeof value === "function"
? durationFunction
: durationConstant)(id, value))
: get$1(this.node(), id).duration;
};
function easeConstant(id, value) {
if (typeof value !== "function") throw new Error;
return function() {
set$1(this, id).ease = value;
};
}
var transition_ease = function(value) {
var id = this._id;
return arguments.length
? this.each(easeConstant(id, value))
: get$1(this.node(), id).ease;
};
var transition_filter = function(match) {
if (typeof match !== "function") match = matcher$1(match);
for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {
for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {
if ((node = group[i]) && match.call(node, node.__data__, i, group)) {
subgroup.push(node);
}
}
}
return new Transition(subgroups, this._parents, this._name, this._id);
};
var transition_merge = function(transition) {
if (transition._id !== this._id) throw new Error;
for (var groups0 = this._groups, groups1 = transition._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {
for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) {
if (node = group0[i] || group1[i]) {
merge[i] = node;
}
}
}
for (; j < m0; ++j) {
merges[j] = groups0[j];
}
return new Transition(merges, this._parents, this._name, this._id);
};
function start(name) {
return (name + "").trim().split(/^|\s+/).every(function(t) {
var i = t.indexOf(".");
if (i >= 0) t = t.slice(0, i);
return !t || t === "start";
});
}
function onFunction(id, name, listener) {
var on0, on1, sit = start(name) ? init : set$1;
return function() {
var schedule = sit(this, id),
on = schedule.on;
// If this node shared a dispatch with the previous node,
// just assign the updated shared dispatch and were done!
// Otherwise, copy-on-write.
if (on !== on0) (on1 = (on0 = on).copy()).on(name, listener);
schedule.on = on1;
};
}
var transition_on = function(name, listener) {
var id = this._id;
return arguments.length < 2
? get$1(this.node(), id).on.on(name)
: this.each(onFunction(id, name, listener));
};
function removeFunction(id) {
return function() {
var parent = this.parentNode;
for (var i in this.__transition) if (+i !== id) return;
if (parent) parent.removeChild(this);
};
}
var transition_remove = function() {
return this.on("end.remove", removeFunction(this._id));
};
var transition_select = function(select$$1) {
var name = this._name,
id = this._id;
if (typeof select$$1 !== "function") select$$1 = selector(select$$1);
for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {
for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) {
if ((node = group[i]) && (subnode = select$$1.call(node, node.__data__, i, group))) {
if ("__data__" in node) subnode.__data__ = node.__data__;
subgroup[i] = subnode;
schedule(subgroup[i], name, id, i, subgroup, get$1(node, id));
}
}
}
return new Transition(subgroups, this._parents, name, id);
};
var transition_selectAll = function(select$$1) {
var name = this._name,
id = this._id;
if (typeof select$$1 !== "function") select$$1 = selectorAll(select$$1);
for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) {
for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {
if (node = group[i]) {
for (var children = select$$1.call(node, node.__data__, i, group), child, inherit = get$1(node, id), k = 0, l = children.length; k < l; ++k) {
if (child = children[k]) {
schedule(child, name, id, k, children, inherit);
}
}
subgroups.push(children);
parents.push(node);
}
}
}
return new Transition(subgroups, parents, name, id);
};
var Selection$1 = selection.prototype.constructor;
var transition_selection = function() {
return new Selection$1(this._groups, this._parents);
};
function styleRemove$1(name, interpolate$$2) {
var value00,
value10,
interpolate0;
return function() {
var value0 = styleValue(this, name),
value1 = (this.style.removeProperty(name), styleValue(this, name));
return value0 === value1 ? null
: value0 === value00 && value1 === value10 ? interpolate0
: interpolate0 = interpolate$$2(value00 = value0, value10 = value1);
};
}
function styleRemoveEnd(name) {
return function() {
this.style.removeProperty(name);
};
}
function styleConstant$1(name, interpolate$$2, value1) {
var value00,
interpolate0;
return function() {
var value0 = styleValue(this, name);
return value0 === value1 ? null
: value0 === value00 ? interpolate0
: interpolate0 = interpolate$$2(value00 = value0, value1);
};
}
function styleFunction$1(name, interpolate$$2, value) {
var value00,
value10,
interpolate0;
return function() {
var value0 = styleValue(this, name),
value1 = value(this);
if (value1 == null) value1 = (this.style.removeProperty(name), styleValue(this, name));
return value0 === value1 ? null
: value0 === value00 && value1 === value10 ? interpolate0
: interpolate0 = interpolate$$2(value00 = value0, value10 = value1);
};
}
var transition_style = function(name, value, priority) {
var i = (name += "") === "transform" ? interpolateTransformCss : interpolate$$1;
return value == null ? this
.styleTween(name, styleRemove$1(name, i))
.on("end.style." + name, styleRemoveEnd(name))
: this.styleTween(name, typeof value === "function"
? styleFunction$1(name, i, tweenValue(this, "style." + name, value))
: styleConstant$1(name, i, value + ""), priority);
};
function styleTween(name, value, priority) {
function tween() {
var node = this, i = value.apply(node, arguments);
return i && function(t) {
node.style.setProperty(name, i(t), priority);
};
}
tween._value = value;
return tween;
}
var transition_styleTween = function(name, value, priority) {
var key = "style." + (name += "");
if (arguments.length < 2) return (key = this.tween(key)) && key._value;
if (value == null) return this.tween(key, null);
if (typeof value !== "function") throw new Error;
return this.tween(key, styleTween(name, value, priority == null ? "" : priority));
};
function textConstant$1(value) {
return function() {
this.textContent = value;
};
}
function textFunction$1(value) {
return function() {
var value1 = value(this);
this.textContent = value1 == null ? "" : value1;
};
}
var transition_text = function(value) {
return this.tween("text", typeof value === "function"
? textFunction$1(tweenValue(this, "text", value))
: textConstant$1(value == null ? "" : value + ""));
};
var transition_transition = function() {
var name = this._name,
id0 = this._id,
id1 = newId();
for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) {
for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {
if (node = group[i]) {
var inherit = get$1(node, id0);
schedule(node, name, id1, i, group, {
time: inherit.time + inherit.delay + inherit.duration,
delay: 0,
duration: inherit.duration,
ease: inherit.ease
});
}
}
}
return new Transition(groups, this._parents, name, id1);
};
var id = 0;
function Transition(groups, parents, name, id) {
this._groups = groups;
this._parents = parents;
this._name = name;
this._id = id;
}
function transition(name) {
return selection().transition(name);
}
function newId() {
return ++id;
}
var selection_prototype = selection.prototype;
Transition.prototype = transition.prototype = {
constructor: Transition,
select: transition_select,
selectAll: transition_selectAll,
filter: transition_filter,
merge: transition_merge,
selection: transition_selection,
transition: transition_transition,
call: selection_prototype.call,
nodes: selection_prototype.nodes,
node: selection_prototype.node,
size: selection_prototype.size,
empty: selection_prototype.empty,
each: selection_prototype.each,
on: transition_on,
attr: transition_attr,
attrTween: transition_attrTween,
style: transition_style,
styleTween: transition_styleTween,
text: transition_text,
remove: transition_remove,
tween: transition_tween,
delay: transition_delay,
duration: transition_duration,
ease: transition_ease
};
function linear$1(t) {
return +t;
}
function quadIn(t) {
return t * t;
}
function quadOut(t) {
return t * (2 - t);
}
function quadInOut(t) {
return ((t *= 2) <= 1 ? t * t : --t * (2 - t) + 1) / 2;
}
function cubicIn(t) {
return t * t * t;
}
function cubicOut(t) {
return --t * t * t + 1;
}
function cubicInOut(t) {
return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;
}
var exponent = 3;
var polyIn = (function custom(e) {
e = +e;
function polyIn(t) {
return Math.pow(t, e);
}
polyIn.exponent = custom;
return polyIn;
})(exponent);
var polyOut = (function custom(e) {
e = +e;
function polyOut(t) {
return 1 - Math.pow(1 - t, e);
}
polyOut.exponent = custom;
return polyOut;
})(exponent);
var polyInOut = (function custom(e) {
e = +e;
function polyInOut(t) {
return ((t *= 2) <= 1 ? Math.pow(t, e) : 2 - Math.pow(2 - t, e)) / 2;
}
polyInOut.exponent = custom;
return polyInOut;
})(exponent);
var pi = Math.PI;
var halfPi = pi / 2;
function sinIn(t) {
return 1 - Math.cos(t * halfPi);
}
function sinOut(t) {
return Math.sin(t * halfPi);
}
function sinInOut(t) {
return (1 - Math.cos(pi * t)) / 2;
}
function expIn(t) {
return Math.pow(2, 10 * t - 10);
}
function expOut(t) {
return 1 - Math.pow(2, -10 * t);
}
function expInOut(t) {
return ((t *= 2) <= 1 ? Math.pow(2, 10 * t - 10) : 2 - Math.pow(2, 10 - 10 * t)) / 2;
}
function circleIn(t) {
return 1 - Math.sqrt(1 - t * t);
}
function circleOut(t) {
return Math.sqrt(1 - --t * t);
}
function circleInOut(t) {
return ((t *= 2) <= 1 ? 1 - Math.sqrt(1 - t * t) : Math.sqrt(1 - (t -= 2) * t) + 1) / 2;
}
var b1 = 4 / 11;
var b2 = 6 / 11;
var b3 = 8 / 11;
var b4 = 3 / 4;
var b5 = 9 / 11;
var b6 = 10 / 11;
var b7 = 15 / 16;
var b8 = 21 / 22;
var b9 = 63 / 64;
var b0 = 1 / b1 / b1;
function bounceIn(t) {
return 1 - bounceOut(1 - t);
}
function bounceOut(t) {
return (t = +t) < b1 ? b0 * t * t : t < b3 ? b0 * (t -= b2) * t + b4 : t < b6 ? b0 * (t -= b5) * t + b7 : b0 * (t -= b8) * t + b9;
}
function bounceInOut(t) {
return ((t *= 2) <= 1 ? 1 - bounceOut(1 - t) : bounceOut(t - 1) + 1) / 2;
}
var overshoot = 1.70158;
var backIn = (function custom(s) {
s = +s;
function backIn(t) {
return t * t * ((s + 1) * t - s);
}
backIn.overshoot = custom;
return backIn;
})(overshoot);
var backOut = (function custom(s) {
s = +s;
function backOut(t) {
return --t * t * ((s + 1) * t + s) + 1;
}
backOut.overshoot = custom;
return backOut;
})(overshoot);
var backInOut = (function custom(s) {
s = +s;
function backInOut(t) {
return ((t *= 2) < 1 ? t * t * ((s + 1) * t - s) : (t -= 2) * t * ((s + 1) * t + s) + 2) / 2;
}
backInOut.overshoot = custom;
return backInOut;
})(overshoot);
var tau = 2 * Math.PI;
var amplitude = 1;
var period = 0.3;
var elasticIn = (function custom(a, p) {
var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau);
function elasticIn(t) {
return a * Math.pow(2, 10 * --t) * Math.sin((s - t) / p);
}
elasticIn.amplitude = function(a) { return custom(a, p * tau); };
elasticIn.period = function(p) { return custom(a, p); };
return elasticIn;
})(amplitude, period);
var elasticOut = (function custom(a, p) {
var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau);
function elasticOut(t) {
return 1 - a * Math.pow(2, -10 * (t = +t)) * Math.sin((t + s) / p);
}
elasticOut.amplitude = function(a) { return custom(a, p * tau); };
elasticOut.period = function(p) { return custom(a, p); };
return elasticOut;
})(amplitude, period);
var elasticInOut = (function custom(a, p) {
var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau);
function elasticInOut(t) {
return ((t = t * 2 - 1) < 0
? a * Math.pow(2, 10 * t) * Math.sin((s - t) / p)
: 2 - a * Math.pow(2, -10 * t) * Math.sin((s + t) / p)) / 2;
}
elasticInOut.amplitude = function(a) { return custom(a, p * tau); };
elasticInOut.period = function(p) { return custom(a, p); };
return elasticInOut;
})(amplitude, period);
var defaultTiming = {
time: null, // Set on use.
delay: 0,
duration: 250,
ease: cubicInOut
};
function inherit(node, id) {
var timing;
while (!(timing = node.__transition) || !(timing = timing[id])) {
if (!(node = node.parentNode)) {
return defaultTiming.time = now(), defaultTiming;
}
}
return timing;
}
var selection_transition = function(name) {
var id,
timing;
if (name instanceof Transition) {
id = name._id, name = name._name;
} else {
id = newId(), (timing = defaultTiming).time = now(), name = name == null ? null : name + "";
}
for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) {
for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {
if (node = group[i]) {
schedule(node, name, id, i, group, timing || inherit(node, id));
}
}
}
return new Transition(groups, this._parents, name, id);
};
selection.prototype.interrupt = selection_interrupt;
selection.prototype.transition = selection_transition;
var root$1 = [null];
var active = function(node, name) {
var schedules = node.__transition,
schedule,
i;
if (schedules) {
name = name == null ? null : name + "";
for (i in schedules) {
if ((schedule = schedules[i]).state > SCHEDULED && schedule.name === name) {
return new Transition([[node]], root$1, name, +i);
}
}
}
return null;
};
var constant$4 = function(x) {
return function() {
return x;
};
};
var BrushEvent = function(target, type, selection) {
this.target = target;
this.type = type;
this.selection = selection;
};
function nopropagation$1() {
exports.event.stopImmediatePropagation();
}
var noevent$1 = function() {
exports.event.preventDefault();
exports.event.stopImmediatePropagation();
};
var MODE_DRAG = {name: "drag"};
var MODE_SPACE = {name: "space"};
var MODE_HANDLE = {name: "handle"};
var MODE_CENTER = {name: "center"};
var X = {
name: "x",
handles: ["e", "w"].map(type),
input: function(x, e) { return x && [[x[0], e[0][1]], [x[1], e[1][1]]]; },
output: function(xy) { return xy && [xy[0][0], xy[1][0]]; }
};
var Y = {
name: "y",
handles: ["n", "s"].map(type),
input: function(y, e) { return y && [[e[0][0], y[0]], [e[1][0], y[1]]]; },
output: function(xy) { return xy && [xy[0][1], xy[1][1]]; }
};
var XY = {
name: "xy",
handles: ["n", "e", "s", "w", "nw", "ne", "se", "sw"].map(type),
input: function(xy) { return xy; },
output: function(xy) { return xy; }
};
var cursors = {
overlay: "crosshair",
selection: "move",
n: "ns-resize",
e: "ew-resize",
s: "ns-resize",
w: "ew-resize",
nw: "nwse-resize",
ne: "nesw-resize",
se: "nwse-resize",
sw: "nesw-resize"
};
var flipX = {
e: "w",
w: "e",
nw: "ne",
ne: "nw",
se: "sw",
sw: "se"
};
var flipY = {
n: "s",
s: "n",
nw: "sw",
ne: "se",
se: "ne",
sw: "nw"
};
var signsX = {
overlay: +1,
selection: +1,
n: null,
e: +1,
s: null,
w: -1,
nw: -1,
ne: +1,
se: +1,
sw: -1
};
var signsY = {
overlay: +1,
selection: +1,
n: -1,
e: null,
s: +1,
w: null,
nw: -1,
ne: -1,
se: +1,
sw: +1
};
function type(t) {
return {type: t};
}
// Ignore right-click, since that should open the context menu.
function defaultFilter() {
return !exports.event.button;
}
function defaultExtent() {
var svg = this.ownerSVGElement || this;
return [[0, 0], [svg.width.baseVal.value, svg.height.baseVal.value]];
}
// Like d3.local, but with the name “__brush” rather than auto-generated.
function local$$1(node) {
while (!node.__brush) if (!(node = node.parentNode)) return;
return node.__brush;
}
function empty(extent) {
return extent[0][0] === extent[1][0]
|| extent[0][1] === extent[1][1];
}
function brushSelection(node) {
var state = node.__brush;
return state ? state.dim.output(state.selection) : null;
}
function brushX() {
return brush$1(X);
}
function brushY() {
return brush$1(Y);
}
var brush = function() {
return brush$1(XY);
};
function brush$1(dim) {
var extent = defaultExtent,
filter = defaultFilter,
listeners = dispatch(brush, "start", "brush", "end"),
handleSize = 6,
touchending;
function brush(group) {
var overlay = group
.property("__brush", initialize)
.selectAll(".overlay")
.data([type("overlay")]);
overlay.enter().append("rect")
.attr("class", "overlay")
.attr("pointer-events", "all")
.attr("cursor", cursors.overlay)
.merge(overlay)
.each(function() {
var extent = local$$1(this).extent;
select(this)
.attr("x", extent[0][0])
.attr("y", extent[0][1])
.attr("width", extent[1][0] - extent[0][0])
.attr("height", extent[1][1] - extent[0][1]);
});
group.selectAll(".selection")
.data([type("selection")])
.enter().append("rect")
.attr("class", "selection")
.attr("cursor", cursors.selection)
.attr("fill", "#777")
.attr("fill-opacity", 0.3)
.attr("stroke", "#fff")
.attr("shape-rendering", "crispEdges");
var handle = group.selectAll(".handle")
.data(dim.handles, function(d) { return d.type; });
handle.exit().remove();
handle.enter().append("rect")
.attr("class", function(d) { return "handle handle--" + d.type; })
.attr("cursor", function(d) { return cursors[d.type]; });
group
.each(redraw)
.attr("fill", "none")
.attr("pointer-events", "all")
.style("-webkit-tap-highlight-color", "rgba(0,0,0,0)")
.on("mousedown.brush touchstart.brush", started);
}
brush.move = function(group, selection$$1) {
if (group.selection) {
group
.on("start.brush", function() { emitter(this, arguments).beforestart().start(); })
.on("interrupt.brush end.brush", function() { emitter(this, arguments).end(); })
.tween("brush", function() {
var that = this,
state = that.__brush,
emit = emitter(that, arguments),
selection0 = state.selection,
selection1 = dim.input(typeof selection$$1 === "function" ? selection$$1.apply(this, arguments) : selection$$1, state.extent),
i = interpolateValue(selection0, selection1);
function tween(t) {
state.selection = t === 1 && empty(selection1) ? null : i(t);
redraw.call(that);
emit.brush();
}
return selection0 && selection1 ? tween : tween(1);
});
} else {
group
.each(function() {
var that = this,
args = arguments,
state = that.__brush,
selection1 = dim.input(typeof selection$$1 === "function" ? selection$$1.apply(that, args) : selection$$1, state.extent),
emit = emitter(that, args).beforestart();
interrupt(that);
state.selection = selection1 == null || empty(selection1) ? null : selection1;
redraw.call(that);
emit.start().brush().end();
});
}
};
function redraw() {
var group = select(this),
selection$$1 = local$$1(this).selection;
if (selection$$1) {
group.selectAll(".selection")
.style("display", null)
.attr("x", selection$$1[0][0])
.attr("y", selection$$1[0][1])
.attr("width", selection$$1[1][0] - selection$$1[0][0])
.attr("height", selection$$1[1][1] - selection$$1[0][1]);
group.selectAll(".handle")
.style("display", null)
.attr("x", function(d) { return d.type[d.type.length - 1] === "e" ? selection$$1[1][0] - handleSize / 2 : selection$$1[0][0] - handleSize / 2; })
.attr("y", function(d) { return d.type[0] === "s" ? selection$$1[1][1] - handleSize / 2 : selection$$1[0][1] - handleSize / 2; })
.attr("width", function(d) { return d.type === "n" || d.type === "s" ? selection$$1[1][0] - selection$$1[0][0] + handleSize : handleSize; })
.attr("height", function(d) { return d.type === "e" || d.type === "w" ? selection$$1[1][1] - selection$$1[0][1] + handleSize : handleSize; });
}
else {
group.selectAll(".selection,.handle")
.style("display", "none")
.attr("x", null)
.attr("y", null)
.attr("width", null)
.attr("height", null);
}
}
function emitter(that, args) {
return that.__brush.emitter || new Emitter(that, args);
}
function Emitter(that, args) {
this.that = that;
this.args = args;
this.state = that.__brush;
this.active = 0;
}
Emitter.prototype = {
beforestart: function() {
if (++this.active === 1) this.state.emitter = this, this.starting = true;
return this;
},
start: function() {
if (this.starting) this.starting = false, this.emit("start");
return this;
},
brush: function() {
this.emit("brush");
return this;
},
end: function() {
if (--this.active === 0) delete this.state.emitter, this.emit("end");
return this;
},
emit: function(type) {
customEvent(new BrushEvent(brush, type, dim.output(this.state.selection)), listeners.apply, listeners, [type, this.that, this.args]);
}
};
function started() {
if (exports.event.touches) { if (exports.event.changedTouches.length < exports.event.touches.length) return noevent$1(); }
else if (touchending) return;
if (!filter.apply(this, arguments)) return;
var that = this,
type = exports.event.target.__data__.type,
mode = (exports.event.metaKey ? type = "overlay" : type) === "selection" ? MODE_DRAG : (exports.event.altKey ? MODE_CENTER : MODE_HANDLE),
signX = dim === Y ? null : signsX[type],
signY = dim === X ? null : signsY[type],
state = local$$1(that),
extent = state.extent,
selection$$1 = state.selection,
W = extent[0][0], w0, w1,
N = extent[0][1], n0, n1,
E = extent[1][0], e0, e1,
S = extent[1][1], s0, s1,
dx,
dy,
moving,
shifting = signX && signY && exports.event.shiftKey,
lockX,
lockY,
point0 = mouse(that),
point = point0,
emit = emitter(that, arguments).beforestart();
if (type === "overlay") {
state.selection = selection$$1 = [
[w0 = dim === Y ? W : point0[0], n0 = dim === X ? N : point0[1]],
[e0 = dim === Y ? E : w0, s0 = dim === X ? S : n0]
];
} else {
w0 = selection$$1[0][0];
n0 = selection$$1[0][1];
e0 = selection$$1[1][0];
s0 = selection$$1[1][1];
}
w1 = w0;
n1 = n0;
e1 = e0;
s1 = s0;
var group = select(that)
.attr("pointer-events", "none");
var overlay = group.selectAll(".overlay")
.attr("cursor", cursors[type]);
if (exports.event.touches) {
group
.on("touchmove.brush", moved, true)
.on("touchend.brush touchcancel.brush", ended, true);
} else {
var view = select(exports.event.view)
.on("keydown.brush", keydowned, true)
.on("keyup.brush", keyupped, true)
.on("mousemove.brush", moved, true)
.on("mouseup.brush", ended, true);
dragDisable(exports.event.view);
}
nopropagation$1();
interrupt(that);
redraw.call(that);
emit.start();
function moved() {
var point1 = mouse(that);
if (shifting && !lockX && !lockY) {
if (Math.abs(point1[0] - point[0]) > Math.abs(point1[1] - point[1])) lockY = true;
else lockX = true;
}
point = point1;
moving = true;
noevent$1();
move();
}
function move() {
var t;
dx = point[0] - point0[0];
dy = point[1] - point0[1];
switch (mode) {
case MODE_SPACE:
case MODE_DRAG: {
if (signX) dx = Math.max(W - w0, Math.min(E - e0, dx)), w1 = w0 + dx, e1 = e0 + dx;
if (signY) dy = Math.max(N - n0, Math.min(S - s0, dy)), n1 = n0 + dy, s1 = s0 + dy;
break;
}
case MODE_HANDLE: {
if (signX < 0) dx = Math.max(W - w0, Math.min(E - w0, dx)), w1 = w0 + dx, e1 = e0;
else if (signX > 0) dx = Math.max(W - e0, Math.min(E - e0, dx)), w1 = w0, e1 = e0 + dx;
if (signY < 0) dy = Math.max(N - n0, Math.min(S - n0, dy)), n1 = n0 + dy, s1 = s0;
else if (signY > 0) dy = Math.max(N - s0, Math.min(S - s0, dy)), n1 = n0, s1 = s0 + dy;
break;
}
case MODE_CENTER: {
if (signX) w1 = Math.max(W, Math.min(E, w0 - dx * signX)), e1 = Math.max(W, Math.min(E, e0 + dx * signX));
if (signY) n1 = Math.max(N, Math.min(S, n0 - dy * signY)), s1 = Math.max(N, Math.min(S, s0 + dy * signY));
break;
}
}
if (e1 < w1) {
signX *= -1;
t = w0, w0 = e0, e0 = t;
t = w1, w1 = e1, e1 = t;
if (type in flipX) overlay.attr("cursor", cursors[type = flipX[type]]);
}
if (s1 < n1) {
signY *= -1;
t = n0, n0 = s0, s0 = t;
t = n1, n1 = s1, s1 = t;
if (type in flipY) overlay.attr("cursor", cursors[type = flipY[type]]);
}
if (state.selection) selection$$1 = state.selection; // May be set by brush.move!
if (lockX) w1 = selection$$1[0][0], e1 = selection$$1[1][0];
if (lockY) n1 = selection$$1[0][1], s1 = selection$$1[1][1];
if (selection$$1[0][0] !== w1
|| selection$$1[0][1] !== n1
|| selection$$1[1][0] !== e1
|| selection$$1[1][1] !== s1) {
state.selection = [[w1, n1], [e1, s1]];
redraw.call(that);
emit.brush();
}
}
function ended() {
nopropagation$1();
if (exports.event.touches) {
if (exports.event.touches.length) return;
if (touchending) clearTimeout(touchending);
touchending = setTimeout(function() { touchending = null; }, 500); // Ghost clicks are delayed!
group.on("touchmove.brush touchend.brush touchcancel.brush", null);
} else {
yesdrag(exports.event.view, moving);
view.on("keydown.brush keyup.brush mousemove.brush mouseup.brush", null);
}
group.attr("pointer-events", "all");
overlay.attr("cursor", cursors.overlay);
if (state.selection) selection$$1 = state.selection; // May be set by brush.move (on start)!
if (empty(selection$$1)) state.selection = null, redraw.call(that);
emit.end();
}
function keydowned() {
switch (exports.event.keyCode) {
case 16: { // SHIFT
shifting = signX && signY;
break;
}
case 18: { // ALT
if (mode === MODE_HANDLE) {
if (signX) e0 = e1 - dx * signX, w0 = w1 + dx * signX;
if (signY) s0 = s1 - dy * signY, n0 = n1 + dy * signY;
mode = MODE_CENTER;
move();
}
break;
}
case 32: { // SPACE; takes priority over ALT
if (mode === MODE_HANDLE || mode === MODE_CENTER) {
if (signX < 0) e0 = e1 - dx; else if (signX > 0) w0 = w1 - dx;
if (signY < 0) s0 = s1 - dy; else if (signY > 0) n0 = n1 - dy;
mode = MODE_SPACE;
overlay.attr("cursor", cursors.selection);
move();
}
break;
}
default: return;
}
noevent$1();
}
function keyupped() {
switch (exports.event.keyCode) {
case 16: { // SHIFT
if (shifting) {
lockX = lockY = shifting = false;
move();
}
break;
}
case 18: { // ALT
if (mode === MODE_CENTER) {
if (signX < 0) e0 = e1; else if (signX > 0) w0 = w1;
if (signY < 0) s0 = s1; else if (signY > 0) n0 = n1;
mode = MODE_HANDLE;
move();
}
break;
}
case 32: { // SPACE
if (mode === MODE_SPACE) {
if (exports.event.altKey) {
if (signX) e0 = e1 - dx * signX, w0 = w1 + dx * signX;
if (signY) s0 = s1 - dy * signY, n0 = n1 + dy * signY;
mode = MODE_CENTER;
} else {
if (signX < 0) e0 = e1; else if (signX > 0) w0 = w1;
if (signY < 0) s0 = s1; else if (signY > 0) n0 = n1;
mode = MODE_HANDLE;
}
overlay.attr("cursor", cursors[type]);
move();
}
break;
}
default: return;
}
noevent$1();
}
}
function initialize() {
var state = this.__brush || {selection: null};
state.extent = extent.apply(this, arguments);
state.dim = dim;
return state;
}
brush.extent = function(_) {
return arguments.length ? (extent = typeof _ === "function" ? _ : constant$4([[+_[0][0], +_[0][1]], [+_[1][0], +_[1][1]]]), brush) : extent;
};
brush.filter = function(_) {
return arguments.length ? (filter = typeof _ === "function" ? _ : constant$4(!!_), brush) : filter;
};
brush.handleSize = function(_) {
return arguments.length ? (handleSize = +_, brush) : handleSize;
};
brush.on = function() {
var value = listeners.on.apply(listeners, arguments);
return value === listeners ? brush : value;
};
return brush;
}
var cos = Math.cos;
var sin = Math.sin;
var pi$1 = Math.PI;
var halfPi$1 = pi$1 / 2;
var tau$1 = pi$1 * 2;
var max$1 = Math.max;
function compareValue(compare) {
return function(a, b) {
return compare(
a.source.value + a.target.value,
b.source.value + b.target.value
);
};
}
var chord = function() {
var padAngle = 0,
sortGroups = null,
sortSubgroups = null,
sortChords = null;
function chord(matrix) {
var n = matrix.length,
groupSums = [],
groupIndex = sequence(n),
subgroupIndex = [],
chords = [],
groups = chords.groups = new Array(n),
subgroups = new Array(n * n),
k,
x,
x0,
dx,
i,
j;
// Compute the sum.
k = 0, i = -1; while (++i < n) {
x = 0, j = -1; while (++j < n) {
x += matrix[i][j];
}
groupSums.push(x);
subgroupIndex.push(sequence(n));
k += x;
}
// Sort groups…
if (sortGroups) groupIndex.sort(function(a, b) {
return sortGroups(groupSums[a], groupSums[b]);
});
// Sort subgroups…
if (sortSubgroups) subgroupIndex.forEach(function(d, i) {
d.sort(function(a, b) {
return sortSubgroups(matrix[i][a], matrix[i][b]);
});
});
// Convert the sum to scaling factor for [0, 2pi].
// TODO Allow start and end angle to be specified?
// TODO Allow padding to be specified as percentage?
k = max$1(0, tau$1 - padAngle * n) / k;
dx = k ? padAngle : tau$1 / n;
// Compute the start and end angle for each group and subgroup.
// Note: Opera has a bug reordering object literal properties!
x = 0, i = -1; while (++i < n) {
x0 = x, j = -1; while (++j < n) {
var di = groupIndex[i],
dj = subgroupIndex[di][j],
v = matrix[di][dj],
a0 = x,
a1 = x += v * k;
subgroups[dj * n + di] = {
index: di,
subindex: dj,
startAngle: a0,
endAngle: a1,
value: v
};
}
groups[di] = {
index: di,
startAngle: x0,
endAngle: x,
value: groupSums[di]
};
x += dx;
}
// Generate chords for each (non-empty) subgroup-subgroup link.
i = -1; while (++i < n) {
j = i - 1; while (++j < n) {
var source = subgroups[j * n + i],
target = subgroups[i * n + j];
if (source.value || target.value) {
chords.push(source.value < target.value
? {source: target, target: source}
: {source: source, target: target});
}
}
}
return sortChords ? chords.sort(sortChords) : chords;
}
chord.padAngle = function(_) {
return arguments.length ? (padAngle = max$1(0, _), chord) : padAngle;
};
chord.sortGroups = function(_) {
return arguments.length ? (sortGroups = _, chord) : sortGroups;
};
chord.sortSubgroups = function(_) {
return arguments.length ? (sortSubgroups = _, chord) : sortSubgroups;
};
chord.sortChords = function(_) {
return arguments.length ? (_ == null ? sortChords = null : (sortChords = compareValue(_))._ = _, chord) : sortChords && sortChords._;
};
return chord;
};
var slice$2 = Array.prototype.slice;
var constant$5 = function(x) {
return function() {
return x;
};
};
var pi$2 = Math.PI;
var tau$2 = 2 * pi$2;
var epsilon$1 = 1e-6;
var tauEpsilon = tau$2 - epsilon$1;
function Path() {
this._x0 = this._y0 = // start of current subpath
this._x1 = this._y1 = null; // end of current subpath
this._ = "";
}
function path() {
return new Path;
}
Path.prototype = path.prototype = {
constructor: Path,
moveTo: function(x, y) {
this._ += "M" + (this._x0 = this._x1 = +x) + "," + (this._y0 = this._y1 = +y);
},
closePath: function() {
if (this._x1 !== null) {
this._x1 = this._x0, this._y1 = this._y0;
this._ += "Z";
}
},
lineTo: function(x, y) {
this._ += "L" + (this._x1 = +x) + "," + (this._y1 = +y);
},
quadraticCurveTo: function(x1, y1, x, y) {
this._ += "Q" + (+x1) + "," + (+y1) + "," + (this._x1 = +x) + "," + (this._y1 = +y);
},
bezierCurveTo: function(x1, y1, x2, y2, x, y) {
this._ += "C" + (+x1) + "," + (+y1) + "," + (+x2) + "," + (+y2) + "," + (this._x1 = +x) + "," + (this._y1 = +y);
},
arcTo: function(x1, y1, x2, y2, r) {
x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r;
var x0 = this._x1,
y0 = this._y1,
x21 = x2 - x1,
y21 = y2 - y1,
x01 = x0 - x1,
y01 = y0 - y1,
l01_2 = x01 * x01 + y01 * y01;
// Is the radius negative? Error.
if (r < 0) throw new Error("negative radius: " + r);
// Is this path empty? Move to (x1,y1).
if (this._x1 === null) {
this._ += "M" + (this._x1 = x1) + "," + (this._y1 = y1);
}
// Or, is (x1,y1) coincident with (x0,y0)? Do nothing.
else if (!(l01_2 > epsilon$1)) {}
// Or, are (x0,y0), (x1,y1) and (x2,y2) collinear?
// Equivalently, is (x1,y1) coincident with (x2,y2)?
// Or, is the radius zero? Line to (x1,y1).
else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon$1) || !r) {
this._ += "L" + (this._x1 = x1) + "," + (this._y1 = y1);
}
// Otherwise, draw an arc!
else {
var x20 = x2 - x0,
y20 = y2 - y0,
l21_2 = x21 * x21 + y21 * y21,
l20_2 = x20 * x20 + y20 * y20,
l21 = Math.sqrt(l21_2),
l01 = Math.sqrt(l01_2),
l = r * Math.tan((pi$2 - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2),
t01 = l / l01,
t21 = l / l21;
// If the start tangent is not coincident with (x0,y0), line to.
if (Math.abs(t01 - 1) > epsilon$1) {
this._ += "L" + (x1 + t01 * x01) + "," + (y1 + t01 * y01);
}
this._ += "A" + r + "," + r + ",0,0," + (+(y01 * x20 > x01 * y20)) + "," + (this._x1 = x1 + t21 * x21) + "," + (this._y1 = y1 + t21 * y21);
}
},
arc: function(x, y, r, a0, a1, ccw) {
x = +x, y = +y, r = +r;
var dx = r * Math.cos(a0),
dy = r * Math.sin(a0),
x0 = x + dx,
y0 = y + dy,
cw = 1 ^ ccw,
da = ccw ? a0 - a1 : a1 - a0;
// Is the radius negative? Error.
if (r < 0) throw new Error("negative radius: " + r);
// Is this path empty? Move to (x0,y0).
if (this._x1 === null) {
this._ += "M" + x0 + "," + y0;
}
// Or, is (x0,y0) not coincident with the previous point? Line to (x0,y0).
else if (Math.abs(this._x1 - x0) > epsilon$1 || Math.abs(this._y1 - y0) > epsilon$1) {
this._ += "L" + x0 + "," + y0;
}
// Is this arc empty? Were done.
if (!r) return;
// Does the angle go the wrong way? Flip the direction.
if (da < 0) da = da % tau$2 + tau$2;
// Is this a complete circle? Draw two arcs to complete the circle.
if (da > tauEpsilon) {
this._ += "A" + r + "," + r + ",0,1," + cw + "," + (x - dx) + "," + (y - dy) + "A" + r + "," + r + ",0,1," + cw + "," + (this._x1 = x0) + "," + (this._y1 = y0);
}
// Is this arc non-empty? Draw an arc!
else if (da > epsilon$1) {
this._ += "A" + r + "," + r + ",0," + (+(da >= pi$2)) + "," + cw + "," + (this._x1 = x + r * Math.cos(a1)) + "," + (this._y1 = y + r * Math.sin(a1));
}
},
rect: function(x, y, w, h) {
this._ += "M" + (this._x0 = this._x1 = +x) + "," + (this._y0 = this._y1 = +y) + "h" + (+w) + "v" + (+h) + "h" + (-w) + "Z";
},
toString: function() {
return this._;
}
};
function defaultSource(d) {
return d.source;
}
function defaultTarget(d) {
return d.target;
}
function defaultRadius(d) {
return d.radius;
}
function defaultStartAngle(d) {
return d.startAngle;
}
function defaultEndAngle(d) {
return d.endAngle;
}
var ribbon = function() {
var source = defaultSource,
target = defaultTarget,
radius = defaultRadius,
startAngle = defaultStartAngle,
endAngle = defaultEndAngle,
context = null;
function ribbon() {
var buffer,
argv = slice$2.call(arguments),
s = source.apply(this, argv),
t = target.apply(this, argv),
sr = +radius.apply(this, (argv[0] = s, argv)),
sa0 = startAngle.apply(this, argv) - halfPi$1,
sa1 = endAngle.apply(this, argv) - halfPi$1,
sx0 = sr * cos(sa0),
sy0 = sr * sin(sa0),
tr = +radius.apply(this, (argv[0] = t, argv)),
ta0 = startAngle.apply(this, argv) - halfPi$1,
ta1 = endAngle.apply(this, argv) - halfPi$1;
if (!context) context = buffer = path();
context.moveTo(sx0, sy0);
context.arc(0, 0, sr, sa0, sa1);
if (sa0 !== ta0 || sa1 !== ta1) { // TODO sr !== tr?
context.quadraticCurveTo(0, 0, tr * cos(ta0), tr * sin(ta0));
context.arc(0, 0, tr, ta0, ta1);
}
context.quadraticCurveTo(0, 0, sx0, sy0);
context.closePath();
if (buffer) return context = null, buffer + "" || null;
}
ribbon.radius = function(_) {
return arguments.length ? (radius = typeof _ === "function" ? _ : constant$5(+_), ribbon) : radius;
};
ribbon.startAngle = function(_) {
return arguments.length ? (startAngle = typeof _ === "function" ? _ : constant$5(+_), ribbon) : startAngle;
};
ribbon.endAngle = function(_) {
return arguments.length ? (endAngle = typeof _ === "function" ? _ : constant$5(+_), ribbon) : endAngle;
};
ribbon.source = function(_) {
return arguments.length ? (source = _, ribbon) : source;
};
ribbon.target = function(_) {
return arguments.length ? (target = _, ribbon) : target;
};
ribbon.context = function(_) {
return arguments.length ? ((context = _ == null ? null : _), ribbon) : context;
};
return ribbon;
};
var prefix = "$";
function Map() {}
Map.prototype = map$1.prototype = {
constructor: Map,
has: function(key) {
return (prefix + key) in this;
},
get: function(key) {
return this[prefix + key];
},
set: function(key, value) {
this[prefix + key] = value;
return this;
},
remove: function(key) {
var property = prefix + key;
return property in this && delete this[property];
},
clear: function() {
for (var property in this) if (property[0] === prefix) delete this[property];
},
keys: function() {
var keys = [];
for (var property in this) if (property[0] === prefix) keys.push(property.slice(1));
return keys;
},
values: function() {
var values = [];
for (var property in this) if (property[0] === prefix) values.push(this[property]);
return values;
},
entries: function() {
var entries = [];
for (var property in this) if (property[0] === prefix) entries.push({key: property.slice(1), value: this[property]});
return entries;
},
size: function() {
var size = 0;
for (var property in this) if (property[0] === prefix) ++size;
return size;
},
empty: function() {
for (var property in this) if (property[0] === prefix) return false;
return true;
},
each: function(f) {
for (var property in this) if (property[0] === prefix) f(this[property], property.slice(1), this);
}
};
function map$1(object, f) {
var map = new Map;
// Copy constructor.
if (object instanceof Map) object.each(function(value, key) { map.set(key, value); });
// Index array by numeric index or specified key function.
else if (Array.isArray(object)) {
var i = -1,
n = object.length,
o;
if (f == null) while (++i < n) map.set(i, object[i]);
else while (++i < n) map.set(f(o = object[i], i, object), o);
}
// Convert object to map.
else if (object) for (var key in object) map.set(key, object[key]);
return map;
}
var nest = function() {
var keys = [],
sortKeys = [],
sortValues,
rollup,
nest;
function apply(array, depth, createResult, setResult) {
if (depth >= keys.length) return rollup != null
? rollup(array) : (sortValues != null
? array.sort(sortValues)
: array);
var i = -1,
n = array.length,
key = keys[depth++],
keyValue,
value,
valuesByKey = map$1(),
values,
result = createResult();
while (++i < n) {
if (values = valuesByKey.get(keyValue = key(value = array[i]) + "")) {
values.push(value);
} else {
valuesByKey.set(keyValue, [value]);
}
}
valuesByKey.each(function(values, key) {
setResult(result, key, apply(values, depth, createResult, setResult));
});
return result;
}
function entries(map, depth) {
if (++depth > keys.length) return map;
var array, sortKey = sortKeys[depth - 1];
if (rollup != null && depth >= keys.length) array = map.entries();
else array = [], map.each(function(v, k) { array.push({key: k, values: entries(v, depth)}); });
return sortKey != null ? array.sort(function(a, b) { return sortKey(a.key, b.key); }) : array;
}
return nest = {
object: function(array) { return apply(array, 0, createObject, setObject); },
map: function(array) { return apply(array, 0, createMap, setMap); },
entries: function(array) { return entries(apply(array, 0, createMap, setMap), 0); },
key: function(d) { keys.push(d); return nest; },
sortKeys: function(order) { sortKeys[keys.length - 1] = order; return nest; },
sortValues: function(order) { sortValues = order; return nest; },
rollup: function(f) { rollup = f; return nest; }
};
};
function createObject() {
return {};
}
function setObject(object, key, value) {
object[key] = value;
}
function createMap() {
return map$1();
}
function setMap(map, key, value) {
map.set(key, value);
}
function Set() {}
var proto = map$1.prototype;
Set.prototype = set$2.prototype = {
constructor: Set,
has: proto.has,
add: function(value) {
value += "";
this[prefix + value] = value;
return this;
},
remove: proto.remove,
clear: proto.clear,
values: proto.keys,
size: proto.size,
empty: proto.empty,
each: proto.each
};
function set$2(object, f) {
var set = new Set;
// Copy constructor.
if (object instanceof Set) object.each(function(value) { set.add(value); });
// Otherwise, assume its an array.
else if (object) {
var i = -1, n = object.length;
if (f == null) while (++i < n) set.add(object[i]);
else while (++i < n) set.add(f(object[i], i, object));
}
return set;
}
var keys = function(map) {
var keys = [];
for (var key in map) keys.push(key);
return keys;
};
var values = function(map) {
var values = [];
for (var key in map) values.push(map[key]);
return values;
};
var entries = function(map) {
var entries = [];
for (var key in map) entries.push({key: key, value: map[key]});
return entries;
};
function objectConverter(columns) {
return new Function("d", "return {" + columns.map(function(name, i) {
return JSON.stringify(name) + ": d[" + i + "]";
}).join(",") + "}");
}
function customConverter(columns, f) {
var object = objectConverter(columns);
return function(row, i) {
return f(object(row), i, columns);
};
}
// Compute unique columns in order of discovery.
function inferColumns(rows) {
var columnSet = Object.create(null),
columns = [];
rows.forEach(function(row) {
for (var column in row) {
if (!(column in columnSet)) {
columns.push(columnSet[column] = column);
}
}
});
return columns;
}
var dsv = function(delimiter) {
var reFormat = new RegExp("[\"" + delimiter + "\n\r]"),
delimiterCode = delimiter.charCodeAt(0);
function parse(text, f) {
var convert, columns, rows = parseRows(text, function(row, i) {
if (convert) return convert(row, i - 1);
columns = row, convert = f ? customConverter(row, f) : objectConverter(row);
});
rows.columns = columns;
return rows;
}
function parseRows(text, f) {
var EOL = {}, // sentinel value for end-of-line
EOF = {}, // sentinel value for end-of-file
rows = [], // output rows
N = text.length,
I = 0, // current character index
n = 0, // the current line number
t, // the current token
eol; // is the current token followed by EOL?
function token() {
if (I >= N) return EOF; // special case: end of file
if (eol) return eol = false, EOL; // special case: end of line
// special case: quotes
var j = I, c;
if (text.charCodeAt(j) === 34) {
var i = j;
while (i++ < N) {
if (text.charCodeAt(i) === 34) {
if (text.charCodeAt(i + 1) !== 34) break;
++i;
}
}
I = i + 2;
c = text.charCodeAt(i + 1);
if (c === 13) {
eol = true;
if (text.charCodeAt(i + 2) === 10) ++I;
} else if (c === 10) {
eol = true;
}
return text.slice(j + 1, i).replace(/""/g, "\"");
}
// common case: find next delimiter or newline
while (I < N) {
var k = 1;
c = text.charCodeAt(I++);
if (c === 10) eol = true; // \n
else if (c === 13) { eol = true; if (text.charCodeAt(I) === 10) ++I, ++k; } // \r|\r\n
else if (c !== delimiterCode) continue;
return text.slice(j, I - k);
}
// special case: last token before EOF
return text.slice(j);
}
while ((t = token()) !== EOF) {
var a = [];
while (t !== EOL && t !== EOF) {
a.push(t);
t = token();
}
if (f && (a = f(a, n++)) == null) continue;
rows.push(a);
}
return rows;
}
function format(rows, columns) {
if (columns == null) columns = inferColumns(rows);
return [columns.map(formatValue).join(delimiter)].concat(rows.map(function(row) {
return columns.map(function(column) {
return formatValue(row[column]);
}).join(delimiter);
})).join("\n");
}
function formatRows(rows) {
return rows.map(formatRow).join("\n");
}
function formatRow(row) {
return row.map(formatValue).join(delimiter);
}
function formatValue(text) {
return text == null ? ""
: reFormat.test(text += "") ? "\"" + text.replace(/\"/g, "\"\"") + "\""
: text;
}
return {
parse: parse,
parseRows: parseRows,
format: format,
formatRows: formatRows
};
};
var csv = dsv(",");
var csvParse = csv.parse;
var csvParseRows = csv.parseRows;
var csvFormat = csv.format;
var csvFormatRows = csv.formatRows;
var tsv = dsv("\t");
var tsvParse = tsv.parse;
var tsvParseRows = tsv.parseRows;
var tsvFormat = tsv.format;
var tsvFormatRows = tsv.formatRows;
var center$1 = function(x, y) {
var nodes;
if (x == null) x = 0;
if (y == null) y = 0;
function force() {
var i,
n = nodes.length,
node,
sx = 0,
sy = 0;
for (i = 0; i < n; ++i) {
node = nodes[i], sx += node.x, sy += node.y;
}
for (sx = sx / n - x, sy = sy / n - y, i = 0; i < n; ++i) {
node = nodes[i], node.x -= sx, node.y -= sy;
}
}
force.initialize = function(_) {
nodes = _;
};
force.x = function(_) {
return arguments.length ? (x = +_, force) : x;
};
force.y = function(_) {
return arguments.length ? (y = +_, force) : y;
};
return force;
};
var constant$6 = function(x) {
return function() {
return x;
};
};
var jiggle = function() {
return (Math.random() - 0.5) * 1e-6;
};
var tree_add = function(d) {
var x = +this._x.call(null, d),
y = +this._y.call(null, d);
return add(this.cover(x, y), x, y, d);
};
function add(tree, x, y, d) {
if (isNaN(x) || isNaN(y)) return tree; // ignore invalid points
var parent,
node = tree._root,
leaf = {data: d},
x0 = tree._x0,
y0 = tree._y0,
x1 = tree._x1,
y1 = tree._y1,
xm,
ym,
xp,
yp,
right,
bottom,
i,
j;
// If the tree is empty, initialize the root as a leaf.
if (!node) return tree._root = leaf, tree;
// Find the existing leaf for the new point, or add it.
while (node.length) {
if (right = x >= (xm = (x0 + x1) / 2)) x0 = xm; else x1 = xm;
if (bottom = y >= (ym = (y0 + y1) / 2)) y0 = ym; else y1 = ym;
if (parent = node, !(node = node[i = bottom << 1 | right])) return parent[i] = leaf, tree;
}
// Is the new point is exactly coincident with the existing point?
xp = +tree._x.call(null, node.data);
yp = +tree._y.call(null, node.data);
if (x === xp && y === yp) return leaf.next = node, parent ? parent[i] = leaf : tree._root = leaf, tree;
// Otherwise, split the leaf node until the old and new point are separated.
do {
parent = parent ? parent[i] = new Array(4) : tree._root = new Array(4);
if (right = x >= (xm = (x0 + x1) / 2)) x0 = xm; else x1 = xm;
if (bottom = y >= (ym = (y0 + y1) / 2)) y0 = ym; else y1 = ym;
} while ((i = bottom << 1 | right) === (j = (yp >= ym) << 1 | (xp >= xm)));
return parent[j] = node, parent[i] = leaf, tree;
}
function addAll(data) {
var d, i, n = data.length,
x,
y,
xz = new Array(n),
yz = new Array(n),
x0 = Infinity,
y0 = Infinity,
x1 = -Infinity,
y1 = -Infinity;
// Compute the points and their extent.
for (i = 0; i < n; ++i) {
if (isNaN(x = +this._x.call(null, d = data[i])) || isNaN(y = +this._y.call(null, d))) continue;
xz[i] = x;
yz[i] = y;
if (x < x0) x0 = x;
if (x > x1) x1 = x;
if (y < y0) y0 = y;
if (y > y1) y1 = y;
}
// If there were no (valid) points, inherit the existing extent.
if (x1 < x0) x0 = this._x0, x1 = this._x1;
if (y1 < y0) y0 = this._y0, y1 = this._y1;
// Expand the tree to cover the new points.
this.cover(x0, y0).cover(x1, y1);
// Add the new points.
for (i = 0; i < n; ++i) {
add(this, xz[i], yz[i], data[i]);
}
return this;
}
var tree_cover = function(x, y) {
if (isNaN(x = +x) || isNaN(y = +y)) return this; // ignore invalid points
var x0 = this._x0,
y0 = this._y0,
x1 = this._x1,
y1 = this._y1;
// If the quadtree has no extent, initialize them.
// Integer extent are necessary so that if we later double the extent,
// the existing quadrant boundaries dont change due to floating point error!
if (isNaN(x0)) {
x1 = (x0 = Math.floor(x)) + 1;
y1 = (y0 = Math.floor(y)) + 1;
}
// Otherwise, double repeatedly to cover.
else if (x0 > x || x > x1 || y0 > y || y > y1) {
var z = x1 - x0,
node = this._root,
parent,
i;
switch (i = (y < (y0 + y1) / 2) << 1 | (x < (x0 + x1) / 2)) {
case 0: {
do parent = new Array(4), parent[i] = node, node = parent;
while (z *= 2, x1 = x0 + z, y1 = y0 + z, x > x1 || y > y1);
break;
}
case 1: {
do parent = new Array(4), parent[i] = node, node = parent;
while (z *= 2, x0 = x1 - z, y1 = y0 + z, x0 > x || y > y1);
break;
}
case 2: {
do parent = new Array(4), parent[i] = node, node = parent;
while (z *= 2, x1 = x0 + z, y0 = y1 - z, x > x1 || y0 > y);
break;
}
case 3: {
do parent = new Array(4), parent[i] = node, node = parent;
while (z *= 2, x0 = x1 - z, y0 = y1 - z, x0 > x || y0 > y);
break;
}
}
if (this._root && this._root.length) this._root = node;
}
// If the quadtree covers the point already, just return.
else return this;
this._x0 = x0;
this._y0 = y0;
this._x1 = x1;
this._y1 = y1;
return this;
};
var tree_data = function() {
var data = [];
this.visit(function(node) {
if (!node.length) do data.push(node.data); while (node = node.next)
});
return data;
};
var tree_extent = function(_) {
return arguments.length
? this.cover(+_[0][0], +_[0][1]).cover(+_[1][0], +_[1][1])
: isNaN(this._x0) ? undefined : [[this._x0, this._y0], [this._x1, this._y1]];
};
var Quad = function(node, x0, y0, x1, y1) {
this.node = node;
this.x0 = x0;
this.y0 = y0;
this.x1 = x1;
this.y1 = y1;
};
var tree_find = function(x, y, radius) {
var data,
x0 = this._x0,
y0 = this._y0,
x1,
y1,
x2,
y2,
x3 = this._x1,
y3 = this._y1,
quads = [],
node = this._root,
q,
i;
if (node) quads.push(new Quad(node, x0, y0, x3, y3));
if (radius == null) radius = Infinity;
else {
x0 = x - radius, y0 = y - radius;
x3 = x + radius, y3 = y + radius;
radius *= radius;
}
while (q = quads.pop()) {
// Stop searching if this quadrant cant contain a closer node.
if (!(node = q.node)
|| (x1 = q.x0) > x3
|| (y1 = q.y0) > y3
|| (x2 = q.x1) < x0
|| (y2 = q.y1) < y0) continue;
// Bisect the current quadrant.
if (node.length) {
var xm = (x1 + x2) / 2,
ym = (y1 + y2) / 2;
quads.push(
new Quad(node[3], xm, ym, x2, y2),
new Quad(node[2], x1, ym, xm, y2),
new Quad(node[1], xm, y1, x2, ym),
new Quad(node[0], x1, y1, xm, ym)
);
// Visit the closest quadrant first.
if (i = (y >= ym) << 1 | (x >= xm)) {
q = quads[quads.length - 1];
quads[quads.length - 1] = quads[quads.length - 1 - i];
quads[quads.length - 1 - i] = q;
}
}
// Visit this point. (Visiting coincident points isnt necessary!)
else {
var dx = x - +this._x.call(null, node.data),
dy = y - +this._y.call(null, node.data),
d2 = dx * dx + dy * dy;
if (d2 < radius) {
var d = Math.sqrt(radius = d2);
x0 = x - d, y0 = y - d;
x3 = x + d, y3 = y + d;
data = node.data;
}
}
}
return data;
};
var tree_remove = function(d) {
if (isNaN(x = +this._x.call(null, d)) || isNaN(y = +this._y.call(null, d))) return this; // ignore invalid points
var parent,
node = this._root,
retainer,
previous,
next,
x0 = this._x0,
y0 = this._y0,
x1 = this._x1,
y1 = this._y1,
x,
y,
xm,
ym,
right,
bottom,
i,
j;
// If the tree is empty, initialize the root as a leaf.
if (!node) return this;
// Find the leaf node for the point.
// While descending, also retain the deepest parent with a non-removed sibling.
if (node.length) while (true) {
if (right = x >= (xm = (x0 + x1) / 2)) x0 = xm; else x1 = xm;
if (bottom = y >= (ym = (y0 + y1) / 2)) y0 = ym; else y1 = ym;
if (!(parent = node, node = node[i = bottom << 1 | right])) return this;
if (!node.length) break;
if (parent[(i + 1) & 3] || parent[(i + 2) & 3] || parent[(i + 3) & 3]) retainer = parent, j = i;
}
// Find the point to remove.
while (node.data !== d) if (!(previous = node, node = node.next)) return this;
if (next = node.next) delete node.next;
// If there are multiple coincident points, remove just the point.
if (previous) return (next ? previous.next = next : delete previous.next), this;
// If this is the root point, remove it.
if (!parent) return this._root = next, this;
// Remove this leaf.
next ? parent[i] = next : delete parent[i];
// If the parent now contains exactly one leaf, collapse superfluous parents.
if ((node = parent[0] || parent[1] || parent[2] || parent[3])
&& node === (parent[3] || parent[2] || parent[1] || parent[0])
&& !node.length) {
if (retainer) retainer[j] = node;
else this._root = node;
}
return this;
};
function removeAll(data) {
for (var i = 0, n = data.length; i < n; ++i) this.remove(data[i]);
return this;
}
var tree_root = function() {
return this._root;
};
var tree_size = function() {
var size = 0;
this.visit(function(node) {
if (!node.length) do ++size; while (node = node.next)
});
return size;
};
var tree_visit = function(callback) {
var quads = [], q, node = this._root, child, x0, y0, x1, y1;
if (node) quads.push(new Quad(node, this._x0, this._y0, this._x1, this._y1));
while (q = quads.pop()) {
if (!callback(node = q.node, x0 = q.x0, y0 = q.y0, x1 = q.x1, y1 = q.y1) && node.length) {
var xm = (x0 + x1) / 2, ym = (y0 + y1) / 2;
if (child = node[3]) quads.push(new Quad(child, xm, ym, x1, y1));
if (child = node[2]) quads.push(new Quad(child, x0, ym, xm, y1));
if (child = node[1]) quads.push(new Quad(child, xm, y0, x1, ym));
if (child = node[0]) quads.push(new Quad(child, x0, y0, xm, ym));
}
}
return this;
};
var tree_visitAfter = function(callback) {
var quads = [], next = [], q;
if (this._root) quads.push(new Quad(this._root, this._x0, this._y0, this._x1, this._y1));
while (q = quads.pop()) {
var node = q.node;
if (node.length) {
var child, x0 = q.x0, y0 = q.y0, x1 = q.x1, y1 = q.y1, xm = (x0 + x1) / 2, ym = (y0 + y1) / 2;
if (child = node[0]) quads.push(new Quad(child, x0, y0, xm, ym));
if (child = node[1]) quads.push(new Quad(child, xm, y0, x1, ym));
if (child = node[2]) quads.push(new Quad(child, x0, ym, xm, y1));
if (child = node[3]) quads.push(new Quad(child, xm, ym, x1, y1));
}
next.push(q);
}
while (q = next.pop()) {
callback(q.node, q.x0, q.y0, q.x1, q.y1);
}
return this;
};
function defaultX(d) {
return d[0];
}
var tree_x = function(_) {
return arguments.length ? (this._x = _, this) : this._x;
};
function defaultY(d) {
return d[1];
}
var tree_y = function(_) {
return arguments.length ? (this._y = _, this) : this._y;
};
function quadtree(nodes, x, y) {
var tree = new Quadtree(x == null ? defaultX : x, y == null ? defaultY : y, NaN, NaN, NaN, NaN);
return nodes == null ? tree : tree.addAll(nodes);
}
function Quadtree(x, y, x0, y0, x1, y1) {
this._x = x;
this._y = y;
this._x0 = x0;
this._y0 = y0;
this._x1 = x1;
this._y1 = y1;
this._root = undefined;
}
function leaf_copy(leaf) {
var copy = {data: leaf.data}, next = copy;
while (leaf = leaf.next) next = next.next = {data: leaf.data};
return copy;
}
var treeProto = quadtree.prototype = Quadtree.prototype;
treeProto.copy = function() {
var copy = new Quadtree(this._x, this._y, this._x0, this._y0, this._x1, this._y1),
node = this._root,
nodes,
child;
if (!node) return copy;
if (!node.length) return copy._root = leaf_copy(node), copy;
nodes = [{source: node, target: copy._root = new Array(4)}];
while (node = nodes.pop()) {
for (var i = 0; i < 4; ++i) {
if (child = node.source[i]) {
if (child.length) nodes.push({source: child, target: node.target[i] = new Array(4)});
else node.target[i] = leaf_copy(child);
}
}
}
return copy;
};
treeProto.add = tree_add;
treeProto.addAll = addAll;
treeProto.cover = tree_cover;
treeProto.data = tree_data;
treeProto.extent = tree_extent;
treeProto.find = tree_find;
treeProto.remove = tree_remove;
treeProto.removeAll = removeAll;
treeProto.root = tree_root;
treeProto.size = tree_size;
treeProto.visit = tree_visit;
treeProto.visitAfter = tree_visitAfter;
treeProto.x = tree_x;
treeProto.y = tree_y;
function x(d) {
return d.x + d.vx;
}
function y(d) {
return d.y + d.vy;
}
var collide = function(radius) {
var nodes,
radii,
strength = 1,
iterations = 1;
if (typeof radius !== "function") radius = constant$6(radius == null ? 1 : +radius);
function force() {
var i, n = nodes.length,
tree,
node,
xi,
yi,
ri,
ri2;
for (var k = 0; k < iterations; ++k) {
tree = quadtree(nodes, x, y).visitAfter(prepare);
for (i = 0; i < n; ++i) {
node = nodes[i];
ri = radii[node.index], ri2 = ri * ri;
xi = node.x + node.vx;
yi = node.y + node.vy;
tree.visit(apply);
}
}
function apply(quad, x0, y0, x1, y1) {
var data = quad.data, rj = quad.r, r = ri + rj;
if (data) {
if (data.index > node.index) {
var x = xi - data.x - data.vx,
y = yi - data.y - data.vy,
l = x * x + y * y;
if (l < r * r) {
if (x === 0) x = jiggle(), l += x * x;
if (y === 0) y = jiggle(), l += y * y;
l = (r - (l = Math.sqrt(l))) / l * strength;
node.vx += (x *= l) * (r = (rj *= rj) / (ri2 + rj));
node.vy += (y *= l) * r;
data.vx -= x * (r = 1 - r);
data.vy -= y * r;
}
}
return;
}
return x0 > xi + r || x1 < xi - r || y0 > yi + r || y1 < yi - r;
}
}
function prepare(quad) {
if (quad.data) return quad.r = radii[quad.data.index];
for (var i = quad.r = 0; i < 4; ++i) {
if (quad[i] && quad[i].r > quad.r) {
quad.r = quad[i].r;
}
}
}
function initialize() {
if (!nodes) return;
var i, n = nodes.length, node;
radii = new Array(n);
for (i = 0; i < n; ++i) node = nodes[i], radii[node.index] = +radius(node, i, nodes);
}
force.initialize = function(_) {
nodes = _;
initialize();
};
force.iterations = function(_) {
return arguments.length ? (iterations = +_, force) : iterations;
};
force.strength = function(_) {
return arguments.length ? (strength = +_, force) : strength;
};
force.radius = function(_) {
return arguments.length ? (radius = typeof _ === "function" ? _ : constant$6(+_), initialize(), force) : radius;
};
return force;
};
function index(d) {
return d.index;
}
function find(nodeById, nodeId) {
var node = nodeById.get(nodeId);
if (!node) throw new Error("missing: " + nodeId);
return node;
}
var link = function(links) {
var id = index,
strength = defaultStrength,
strengths,
distance = constant$6(30),
distances,
nodes,
count,
bias,
iterations = 1;
if (links == null) links = [];
function defaultStrength(link) {
return 1 / Math.min(count[link.source.index], count[link.target.index]);
}
function force(alpha) {
for (var k = 0, n = links.length; k < iterations; ++k) {
for (var i = 0, link, source, target, x, y, l, b; i < n; ++i) {
link = links[i], source = link.source, target = link.target;
x = target.x + target.vx - source.x - source.vx || jiggle();
y = target.y + target.vy - source.y - source.vy || jiggle();
l = Math.sqrt(x * x + y * y);
l = (l - distances[i]) / l * alpha * strengths[i];
x *= l, y *= l;
target.vx -= x * (b = bias[i]);
target.vy -= y * b;
source.vx += x * (b = 1 - b);
source.vy += y * b;
}
}
}
function initialize() {
if (!nodes) return;
var i,
n = nodes.length,
m = links.length,
nodeById = map$1(nodes, id),
link;
for (i = 0, count = new Array(n); i < m; ++i) {
link = links[i], link.index = i;
if (typeof link.source !== "object") link.source = find(nodeById, link.source);
if (typeof link.target !== "object") link.target = find(nodeById, link.target);
count[link.source.index] = (count[link.source.index] || 0) + 1;
count[link.target.index] = (count[link.target.index] || 0) + 1;
}
for (i = 0, bias = new Array(m); i < m; ++i) {
link = links[i], bias[i] = count[link.source.index] / (count[link.source.index] + count[link.target.index]);
}
strengths = new Array(m), initializeStrength();
distances = new Array(m), initializeDistance();
}
function initializeStrength() {
if (!nodes) return;
for (var i = 0, n = links.length; i < n; ++i) {
strengths[i] = +strength(links[i], i, links);
}
}
function initializeDistance() {
if (!nodes) return;
for (var i = 0, n = links.length; i < n; ++i) {
distances[i] = +distance(links[i], i, links);
}
}
force.initialize = function(_) {
nodes = _;
initialize();
};
force.links = function(_) {
return arguments.length ? (links = _, initialize(), force) : links;
};
force.id = function(_) {
return arguments.length ? (id = _, force) : id;
};
force.iterations = function(_) {
return arguments.length ? (iterations = +_, force) : iterations;
};
force.strength = function(_) {
return arguments.length ? (strength = typeof _ === "function" ? _ : constant$6(+_), initializeStrength(), force) : strength;
};
force.distance = function(_) {
return arguments.length ? (distance = typeof _ === "function" ? _ : constant$6(+_), initializeDistance(), force) : distance;
};
return force;
};
function x$1(d) {
return d.x;
}
function y$1(d) {
return d.y;
}
var initialRadius = 10;
var initialAngle = Math.PI * (3 - Math.sqrt(5));
var simulation = function(nodes) {
var simulation,
alpha = 1,
alphaMin = 0.001,
alphaDecay = 1 - Math.pow(alphaMin, 1 / 300),
alphaTarget = 0,
velocityDecay = 0.6,
forces = map$1(),
stepper = timer(step),
event = dispatch("tick", "end");
if (nodes == null) nodes = [];
function step() {
tick();
event.call("tick", simulation);
if (alpha < alphaMin) {
stepper.stop();
event.call("end", simulation);
}
}
function tick() {
var i, n = nodes.length, node;
alpha += (alphaTarget - alpha) * alphaDecay;
forces.each(function(force) {
force(alpha);
});
for (i = 0; i < n; ++i) {
node = nodes[i];
if (node.fx == null) node.x += node.vx *= velocityDecay;
else node.x = node.fx, node.vx = 0;
if (node.fy == null) node.y += node.vy *= velocityDecay;
else node.y = node.fy, node.vy = 0;
}
}
function initializeNodes() {
for (var i = 0, n = nodes.length, node; i < n; ++i) {
node = nodes[i], node.index = i;
if (isNaN(node.x) || isNaN(node.y)) {
var radius = initialRadius * Math.sqrt(i), angle = i * initialAngle;
node.x = radius * Math.cos(angle);
node.y = radius * Math.sin(angle);
}
if (isNaN(node.vx) || isNaN(node.vy)) {
node.vx = node.vy = 0;
}
}
}
function initializeForce(force) {
if (force.initialize) force.initialize(nodes);
return force;
}
initializeNodes();
return simulation = {
tick: tick,
restart: function() {
return stepper.restart(step), simulation;
},
stop: function() {
return stepper.stop(), simulation;
},
nodes: function(_) {
return arguments.length ? (nodes = _, initializeNodes(), forces.each(initializeForce), simulation) : nodes;
},
alpha: function(_) {
return arguments.length ? (alpha = +_, simulation) : alpha;
},
alphaMin: function(_) {
return arguments.length ? (alphaMin = +_, simulation) : alphaMin;
},
alphaDecay: function(_) {
return arguments.length ? (alphaDecay = +_, simulation) : +alphaDecay;
},
alphaTarget: function(_) {
return arguments.length ? (alphaTarget = +_, simulation) : alphaTarget;
},
velocityDecay: function(_) {
return arguments.length ? (velocityDecay = 1 - _, simulation) : 1 - velocityDecay;
},
force: function(name, _) {
return arguments.length > 1 ? ((_ == null ? forces.remove(name) : forces.set(name, initializeForce(_))), simulation) : forces.get(name);
},
find: function(x, y, radius) {
var i = 0,
n = nodes.length,
dx,
dy,
d2,
node,
closest;
if (radius == null) radius = Infinity;
else radius *= radius;
for (i = 0; i < n; ++i) {
node = nodes[i];
dx = x - node.x;
dy = y - node.y;
d2 = dx * dx + dy * dy;
if (d2 < radius) closest = node, radius = d2;
}
return closest;
},
on: function(name, _) {
return arguments.length > 1 ? (event.on(name, _), simulation) : event.on(name);
}
};
};
var manyBody = function() {
var nodes,
node,
alpha,
strength = constant$6(-30),
strengths,
distanceMin2 = 1,
distanceMax2 = Infinity,
theta2 = 0.81;
function force(_) {
var i, n = nodes.length, tree = quadtree(nodes, x$1, y$1).visitAfter(accumulate);
for (alpha = _, i = 0; i < n; ++i) node = nodes[i], tree.visit(apply);
}
function initialize() {
if (!nodes) return;
var i, n = nodes.length, node;
strengths = new Array(n);
for (i = 0; i < n; ++i) node = nodes[i], strengths[node.index] = +strength(node, i, nodes);
}
function accumulate(quad) {
var strength = 0, q, c, x$$1, y$$1, i;
// For internal nodes, accumulate forces from child quadrants.
if (quad.length) {
for (x$$1 = y$$1 = i = 0; i < 4; ++i) {
if ((q = quad[i]) && (c = q.value)) {
strength += c, x$$1 += c * q.x, y$$1 += c * q.y;
}
}
quad.x = x$$1 / strength;
quad.y = y$$1 / strength;
}
// For leaf nodes, accumulate forces from coincident quadrants.
else {
q = quad;
q.x = q.data.x;
q.y = q.data.y;
do strength += strengths[q.data.index];
while (q = q.next);
}
quad.value = strength;
}
function apply(quad, x1, _, x2) {
if (!quad.value) return true;
var x$$1 = quad.x - node.x,
y$$1 = quad.y - node.y,
w = x2 - x1,
l = x$$1 * x$$1 + y$$1 * y$$1;
// Apply the Barnes-Hut approximation if possible.
// Limit forces for very close nodes; randomize direction if coincident.
if (w * w / theta2 < l) {
if (l < distanceMax2) {
if (x$$1 === 0) x$$1 = jiggle(), l += x$$1 * x$$1;
if (y$$1 === 0) y$$1 = jiggle(), l += y$$1 * y$$1;
if (l < distanceMin2) l = Math.sqrt(distanceMin2 * l);
node.vx += x$$1 * quad.value * alpha / l;
node.vy += y$$1 * quad.value * alpha / l;
}
return true;
}
// Otherwise, process points directly.
else if (quad.length || l >= distanceMax2) return;
// Limit forces for very close nodes; randomize direction if coincident.
if (quad.data !== node || quad.next) {
if (x$$1 === 0) x$$1 = jiggle(), l += x$$1 * x$$1;
if (y$$1 === 0) y$$1 = jiggle(), l += y$$1 * y$$1;
if (l < distanceMin2) l = Math.sqrt(distanceMin2 * l);
}
do if (quad.data !== node) {
w = strengths[quad.data.index] * alpha / l;
node.vx += x$$1 * w;
node.vy += y$$1 * w;
} while (quad = quad.next);
}
force.initialize = function(_) {
nodes = _;
initialize();
};
force.strength = function(_) {
return arguments.length ? (strength = typeof _ === "function" ? _ : constant$6(+_), initialize(), force) : strength;
};
force.distanceMin = function(_) {
return arguments.length ? (distanceMin2 = _ * _, force) : Math.sqrt(distanceMin2);
};
force.distanceMax = function(_) {
return arguments.length ? (distanceMax2 = _ * _, force) : Math.sqrt(distanceMax2);
};
force.theta = function(_) {
return arguments.length ? (theta2 = _ * _, force) : Math.sqrt(theta2);
};
return force;
};
var x$2 = function(x) {
var strength = constant$6(0.1),
nodes,
strengths,
xz;
if (typeof x !== "function") x = constant$6(x == null ? 0 : +x);
function force(alpha) {
for (var i = 0, n = nodes.length, node; i < n; ++i) {
node = nodes[i], node.vx += (xz[i] - node.x) * strengths[i] * alpha;
}
}
function initialize() {
if (!nodes) return;
var i, n = nodes.length;
strengths = new Array(n);
xz = new Array(n);
for (i = 0; i < n; ++i) {
strengths[i] = isNaN(xz[i] = +x(nodes[i], i, nodes)) ? 0 : +strength(nodes[i], i, nodes);
}
}
force.initialize = function(_) {
nodes = _;
initialize();
};
force.strength = function(_) {
return arguments.length ? (strength = typeof _ === "function" ? _ : constant$6(+_), initialize(), force) : strength;
};
force.x = function(_) {
return arguments.length ? (x = typeof _ === "function" ? _ : constant$6(+_), initialize(), force) : x;
};
return force;
};
var y$2 = function(y) {
var strength = constant$6(0.1),
nodes,
strengths,
yz;
if (typeof y !== "function") y = constant$6(y == null ? 0 : +y);
function force(alpha) {
for (var i = 0, n = nodes.length, node; i < n; ++i) {
node = nodes[i], node.vy += (yz[i] - node.y) * strengths[i] * alpha;
}
}
function initialize() {
if (!nodes) return;
var i, n = nodes.length;
strengths = new Array(n);
yz = new Array(n);
for (i = 0; i < n; ++i) {
strengths[i] = isNaN(yz[i] = +y(nodes[i], i, nodes)) ? 0 : +strength(nodes[i], i, nodes);
}
}
force.initialize = function(_) {
nodes = _;
initialize();
};
force.strength = function(_) {
return arguments.length ? (strength = typeof _ === "function" ? _ : constant$6(+_), initialize(), force) : strength;
};
force.y = function(_) {
return arguments.length ? (y = typeof _ === "function" ? _ : constant$6(+_), initialize(), force) : y;
};
return force;
};
// Computes the decimal coefficient and exponent of the specified number x with
// significant digits p, where x is positive and p is in [1, 21] or undefined.
// For example, formatDecimal(1.23) returns ["123", 0].
var formatDecimal = function(x, p) {
if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf("e")) < 0) return null; // NaN, ±Infinity
var i, coefficient = x.slice(0, i);
// The string returned by toExponential either has the form \d\.\d+e[-+]\d+
// (e.g., 1.2e+3) or the form \de[-+]\d+ (e.g., 1e+3).
return [
coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,
+x.slice(i + 1)
];
};
var exponent$1 = function(x) {
return x = formatDecimal(Math.abs(x)), x ? x[1] : NaN;
};
var formatGroup = function(grouping, thousands) {
return function(value, width) {
var i = value.length,
t = [],
j = 0,
g = grouping[0],
length = 0;
while (i > 0 && g > 0) {
if (length + g + 1 > width) g = Math.max(1, width - length);
t.push(value.substring(i -= g, i + g));
if ((length += g + 1) > width) break;
g = grouping[j = (j + 1) % grouping.length];
}
return t.reverse().join(thousands);
};
};
var formatNumerals = function(numerals) {
return function(value) {
return value.replace(/[0-9]/g, function(i) {
return numerals[+i];
});
};
};
var formatDefault = function(x, p) {
x = x.toPrecision(p);
out: for (var n = x.length, i = 1, i0 = -1, i1; i < n; ++i) {
switch (x[i]) {
case ".": i0 = i1 = i; break;
case "0": if (i0 === 0) i0 = i; i1 = i; break;
case "e": break out;
default: if (i0 > 0) i0 = 0; break;
}
}
return i0 > 0 ? x.slice(0, i0) + x.slice(i1 + 1) : x;
};
var prefixExponent;
var formatPrefixAuto = function(x, p) {
var d = formatDecimal(x, p);
if (!d) return x + "";
var coefficient = d[0],
exponent = d[1],
i = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1,
n = coefficient.length;
return i === n ? coefficient
: i > n ? coefficient + new Array(i - n + 1).join("0")
: i > 0 ? coefficient.slice(0, i) + "." + coefficient.slice(i)
: "0." + new Array(1 - i).join("0") + formatDecimal(x, Math.max(0, p + i - 1))[0]; // less than 1y!
};
var formatRounded = function(x, p) {
var d = formatDecimal(x, p);
if (!d) return x + "";
var coefficient = d[0],
exponent = d[1];
return exponent < 0 ? "0." + new Array(-exponent).join("0") + coefficient
: coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + "." + coefficient.slice(exponent + 1)
: coefficient + new Array(exponent - coefficient.length + 2).join("0");
};
var formatTypes = {
"": formatDefault,
"%": function(x, p) { return (x * 100).toFixed(p); },
"b": function(x) { return Math.round(x).toString(2); },
"c": function(x) { return x + ""; },
"d": function(x) { return Math.round(x).toString(10); },
"e": function(x, p) { return x.toExponential(p); },
"f": function(x, p) { return x.toFixed(p); },
"g": function(x, p) { return x.toPrecision(p); },
"o": function(x) { return Math.round(x).toString(8); },
"p": function(x, p) { return formatRounded(x * 100, p); },
"r": formatRounded,
"s": formatPrefixAuto,
"X": function(x) { return Math.round(x).toString(16).toUpperCase(); },
"x": function(x) { return Math.round(x).toString(16); }
};
// [[fill]align][sign][symbol][0][width][,][.precision][type]
var re = /^(?:(.)?([<>=^]))?([+\-\( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?([a-z%])?$/i;
function formatSpecifier(specifier) {
return new FormatSpecifier(specifier);
}
formatSpecifier.prototype = FormatSpecifier.prototype; // instanceof
function FormatSpecifier(specifier) {
if (!(match = re.exec(specifier))) throw new Error("invalid format: " + specifier);
var match,
fill = match[1] || " ",
align = match[2] || ">",
sign = match[3] || "-",
symbol = match[4] || "",
zero = !!match[5],
width = match[6] && +match[6],
comma = !!match[7],
precision = match[8] && +match[8].slice(1),
type = match[9] || "";
// The "n" type is an alias for ",g".
if (type === "n") comma = true, type = "g";
// Map invalid types to the default format.
else if (!formatTypes[type]) type = "";
// If zero fill is specified, padding goes after sign and before digits.
if (zero || (fill === "0" && align === "=")) zero = true, fill = "0", align = "=";
this.fill = fill;
this.align = align;
this.sign = sign;
this.symbol = symbol;
this.zero = zero;
this.width = width;
this.comma = comma;
this.precision = precision;
this.type = type;
}
FormatSpecifier.prototype.toString = function() {
return this.fill
+ this.align
+ this.sign
+ this.symbol
+ (this.zero ? "0" : "")
+ (this.width == null ? "" : Math.max(1, this.width | 0))
+ (this.comma ? "," : "")
+ (this.precision == null ? "" : "." + Math.max(0, this.precision | 0))
+ this.type;
};
var identity$3 = function(x) {
return x;
};
var prefixes = ["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];
var formatLocale = function(locale) {
var group = locale.grouping && locale.thousands ? formatGroup(locale.grouping, locale.thousands) : identity$3,
currency = locale.currency,
decimal = locale.decimal,
numerals = locale.numerals ? formatNumerals(locale.numerals) : identity$3,
percent = locale.percent || "%";
function newFormat(specifier) {
specifier = formatSpecifier(specifier);
var fill = specifier.fill,
align = specifier.align,
sign = specifier.sign,
symbol = specifier.symbol,
zero = specifier.zero,
width = specifier.width,
comma = specifier.comma,
precision = specifier.precision,
type = specifier.type;
// Compute the prefix and suffix.
// For SI-prefix, the suffix is lazily computed.
var prefix = symbol === "$" ? currency[0] : symbol === "#" && /[boxX]/.test(type) ? "0" + type.toLowerCase() : "",
suffix = symbol === "$" ? currency[1] : /[%p]/.test(type) ? percent : "";
// What format function should we use?
// Is this an integer type?
// Can this type generate exponential notation?
var formatType = formatTypes[type],
maybeSuffix = !type || /[defgprs%]/.test(type);
// Set the default precision if not specified,
// or clamp the specified precision to the supported range.
// For significant precision, it must be in [1, 21].
// For fixed precision, it must be in [0, 20].
precision = precision == null ? (type ? 6 : 12)
: /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision))
: Math.max(0, Math.min(20, precision));
function format(value) {
var valuePrefix = prefix,
valueSuffix = suffix,
i, n, c;
if (type === "c") {
valueSuffix = formatType(value) + valueSuffix;
value = "";
} else {
value = +value;
// Perform the initial formatting.
var valueNegative = value < 0;
value = formatType(Math.abs(value), precision);
// If a negative value rounds to zero during formatting, treat as positive.
if (valueNegative && +value === 0) valueNegative = false;
// Compute the prefix and suffix.
valuePrefix = (valueNegative ? (sign === "(" ? sign : "-") : sign === "-" || sign === "(" ? "" : sign) + valuePrefix;
valueSuffix = valueSuffix + (type === "s" ? prefixes[8 + prefixExponent / 3] : "") + (valueNegative && sign === "(" ? ")" : "");
// Break the formatted value into the integer “value” part that can be
// grouped, and fractional or exponential “suffix” part that is not.
if (maybeSuffix) {
i = -1, n = value.length;
while (++i < n) {
if (c = value.charCodeAt(i), 48 > c || c > 57) {
valueSuffix = (c === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix;
value = value.slice(0, i);
break;
}
}
}
}
// If the fill character is not "0", grouping is applied before padding.
if (comma && !zero) value = group(value, Infinity);
// Compute the padding.
var length = valuePrefix.length + value.length + valueSuffix.length,
padding = length < width ? new Array(width - length + 1).join(fill) : "";
// If the fill character is "0", grouping is applied after padding.
if (comma && zero) value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = "";
// Reconstruct the final output based on the desired alignment.
switch (align) {
case "<": value = valuePrefix + value + valueSuffix + padding; break;
case "=": value = valuePrefix + padding + value + valueSuffix; break;
case "^": value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length); break;
default: value = padding + valuePrefix + value + valueSuffix; break;
}
return numerals(value);
}
format.toString = function() {
return specifier + "";
};
return format;
}
function formatPrefix(specifier, value) {
var f = newFormat((specifier = formatSpecifier(specifier), specifier.type = "f", specifier)),
e = Math.max(-8, Math.min(8, Math.floor(exponent$1(value) / 3))) * 3,
k = Math.pow(10, -e),
prefix = prefixes[8 + e / 3];
return function(value) {
return f(k * value) + prefix;
};
}
return {
format: newFormat,
formatPrefix: formatPrefix
};
};
var locale$1;
defaultLocale({
decimal: ".",
thousands: ",",
grouping: [3],
currency: ["$", ""]
});
function defaultLocale(definition) {
locale$1 = formatLocale(definition);
exports.format = locale$1.format;
exports.formatPrefix = locale$1.formatPrefix;
return locale$1;
}
var precisionFixed = function(step) {
return Math.max(0, -exponent$1(Math.abs(step)));
};
var precisionPrefix = function(step, value) {
return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent$1(value) / 3))) * 3 - exponent$1(Math.abs(step)));
};
var precisionRound = function(step, max) {
step = Math.abs(step), max = Math.abs(max) - step;
return Math.max(0, exponent$1(max) - exponent$1(step)) + 1;
};
// Adds floating point numbers with twice the normal precision.
// Reference: J. R. Shewchuk, Adaptive Precision Floating-Point Arithmetic and
// Fast Robust Geometric Predicates, Discrete & Computational Geometry 18(3)
// 305363 (1997).
// Code adapted from GeographicLib by Charles F. F. Karney,
// http://geographiclib.sourceforge.net/
var adder = function() {
return new Adder;
};
function Adder() {
this.reset();
}
Adder.prototype = {
constructor: Adder,
reset: function() {
this.s = // rounded value
this.t = 0; // exact error
},
add: function(y) {
add$1(temp, y, this.t);
add$1(this, temp.s, this.s);
if (this.s) this.t += temp.t;
else this.s = temp.t;
},
valueOf: function() {
return this.s;
}
};
var temp = new Adder;
function add$1(adder, a, b) {
var x = adder.s = a + b,
bv = x - a,
av = x - bv;
adder.t = (a - av) + (b - bv);
}
var epsilon$2 = 1e-6;
var epsilon2$1 = 1e-12;
var pi$3 = Math.PI;
var halfPi$2 = pi$3 / 2;
var quarterPi = pi$3 / 4;
var tau$3 = pi$3 * 2;
var degrees$1 = 180 / pi$3;
var radians = pi$3 / 180;
var abs = Math.abs;
var atan = Math.atan;
var atan2 = Math.atan2;
var cos$1 = Math.cos;
var ceil = Math.ceil;
var exp = Math.exp;
var log = Math.log;
var pow = Math.pow;
var sin$1 = Math.sin;
var sign = Math.sign || function(x) { return x > 0 ? 1 : x < 0 ? -1 : 0; };
var sqrt = Math.sqrt;
var tan = Math.tan;
function acos(x) {
return x > 1 ? 0 : x < -1 ? pi$3 : Math.acos(x);
}
function asin(x) {
return x > 1 ? halfPi$2 : x < -1 ? -halfPi$2 : Math.asin(x);
}
function haversin(x) {
return (x = sin$1(x / 2)) * x;
}
function noop$1() {}
function streamGeometry(geometry, stream) {
if (geometry && streamGeometryType.hasOwnProperty(geometry.type)) {
streamGeometryType[geometry.type](geometry, stream);
}
}
var streamObjectType = {
Feature: function(object, stream) {
streamGeometry(object.geometry, stream);
},
FeatureCollection: function(object, stream) {
var features = object.features, i = -1, n = features.length;
while (++i < n) streamGeometry(features[i].geometry, stream);
}
};
var streamGeometryType = {
Sphere: function(object, stream) {
stream.sphere();
},
Point: function(object, stream) {
object = object.coordinates;
stream.point(object[0], object[1], object[2]);
},
MultiPoint: function(object, stream) {
var coordinates = object.coordinates, i = -1, n = coordinates.length;
while (++i < n) object = coordinates[i], stream.point(object[0], object[1], object[2]);
},
LineString: function(object, stream) {
streamLine(object.coordinates, stream, 0);
},
MultiLineString: function(object, stream) {
var coordinates = object.coordinates, i = -1, n = coordinates.length;
while (++i < n) streamLine(coordinates[i], stream, 0);
},
Polygon: function(object, stream) {
streamPolygon(object.coordinates, stream);
},
MultiPolygon: function(object, stream) {
var coordinates = object.coordinates, i = -1, n = coordinates.length;
while (++i < n) streamPolygon(coordinates[i], stream);
},
GeometryCollection: function(object, stream) {
var geometries = object.geometries, i = -1, n = geometries.length;
while (++i < n) streamGeometry(geometries[i], stream);
}
};
function streamLine(coordinates, stream, closed) {
var i = -1, n = coordinates.length - closed, coordinate;
stream.lineStart();
while (++i < n) coordinate = coordinates[i], stream.point(coordinate[0], coordinate[1], coordinate[2]);
stream.lineEnd();
}
function streamPolygon(coordinates, stream) {
var i = -1, n = coordinates.length;
stream.polygonStart();
while (++i < n) streamLine(coordinates[i], stream, 1);
stream.polygonEnd();
}
var geoStream = function(object, stream) {
if (object && streamObjectType.hasOwnProperty(object.type)) {
streamObjectType[object.type](object, stream);
} else {
streamGeometry(object, stream);
}
};
var areaRingSum = adder();
var areaSum = adder();
var lambda00;
var phi00;
var lambda0;
var cosPhi0;
var sinPhi0;
var areaStream = {
point: noop$1,
lineStart: noop$1,
lineEnd: noop$1,
polygonStart: function() {
areaRingSum.reset();
areaStream.lineStart = areaRingStart;
areaStream.lineEnd = areaRingEnd;
},
polygonEnd: function() {
var areaRing = +areaRingSum;
areaSum.add(areaRing < 0 ? tau$3 + areaRing : areaRing);
this.lineStart = this.lineEnd = this.point = noop$1;
},
sphere: function() {
areaSum.add(tau$3);
}
};
function areaRingStart() {
areaStream.point = areaPointFirst;
}
function areaRingEnd() {
areaPoint(lambda00, phi00);
}
function areaPointFirst(lambda, phi) {
areaStream.point = areaPoint;
lambda00 = lambda, phi00 = phi;
lambda *= radians, phi *= radians;
lambda0 = lambda, cosPhi0 = cos$1(phi = phi / 2 + quarterPi), sinPhi0 = sin$1(phi);
}
function areaPoint(lambda, phi) {
lambda *= radians, phi *= radians;
phi = phi / 2 + quarterPi; // half the angular distance from south pole
// Spherical excess E for a spherical triangle with vertices: south pole,
// previous point, current point. Uses a formula derived from Cagnolis
// theorem. See Todhunter, Spherical Trig. (1871), Sec. 103, Eq. (2).
var dLambda = lambda - lambda0,
sdLambda = dLambda >= 0 ? 1 : -1,
adLambda = sdLambda * dLambda,
cosPhi = cos$1(phi),
sinPhi = sin$1(phi),
k = sinPhi0 * sinPhi,
u = cosPhi0 * cosPhi + k * cos$1(adLambda),
v = k * sdLambda * sin$1(adLambda);
areaRingSum.add(atan2(v, u));
// Advance the previous points.
lambda0 = lambda, cosPhi0 = cosPhi, sinPhi0 = sinPhi;
}
var area = function(object) {
areaSum.reset();
geoStream(object, areaStream);
return areaSum * 2;
};
function spherical(cartesian) {
return [atan2(cartesian[1], cartesian[0]), asin(cartesian[2])];
}
function cartesian(spherical) {
var lambda = spherical[0], phi = spherical[1], cosPhi = cos$1(phi);
return [cosPhi * cos$1(lambda), cosPhi * sin$1(lambda), sin$1(phi)];
}
function cartesianDot(a, b) {
return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
}
function cartesianCross(a, b) {
return [a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0]];
}
// TODO return a
function cartesianAddInPlace(a, b) {
a[0] += b[0], a[1] += b[1], a[2] += b[2];
}
function cartesianScale(vector, k) {
return [vector[0] * k, vector[1] * k, vector[2] * k];
}
// TODO return d
function cartesianNormalizeInPlace(d) {
var l = sqrt(d[0] * d[0] + d[1] * d[1] + d[2] * d[2]);
d[0] /= l, d[1] /= l, d[2] /= l;
}
var lambda0$1;
var phi0;
var lambda1;
var phi1;
var lambda2;
var lambda00$1;
var phi00$1;
var p0;
var deltaSum = adder();
var ranges;
var range;
var boundsStream = {
point: boundsPoint,
lineStart: boundsLineStart,
lineEnd: boundsLineEnd,
polygonStart: function() {
boundsStream.point = boundsRingPoint;
boundsStream.lineStart = boundsRingStart;
boundsStream.lineEnd = boundsRingEnd;
deltaSum.reset();
areaStream.polygonStart();
},
polygonEnd: function() {
areaStream.polygonEnd();
boundsStream.point = boundsPoint;
boundsStream.lineStart = boundsLineStart;
boundsStream.lineEnd = boundsLineEnd;
if (areaRingSum < 0) lambda0$1 = -(lambda1 = 180), phi0 = -(phi1 = 90);
else if (deltaSum > epsilon$2) phi1 = 90;
else if (deltaSum < -epsilon$2) phi0 = -90;
range[0] = lambda0$1, range[1] = lambda1;
}
};
function boundsPoint(lambda, phi) {
ranges.push(range = [lambda0$1 = lambda, lambda1 = lambda]);
if (phi < phi0) phi0 = phi;
if (phi > phi1) phi1 = phi;
}
function linePoint(lambda, phi) {
var p = cartesian([lambda * radians, phi * radians]);
if (p0) {
var normal = cartesianCross(p0, p),
equatorial = [normal[1], -normal[0], 0],
inflection = cartesianCross(equatorial, normal);
cartesianNormalizeInPlace(inflection);
inflection = spherical(inflection);
var delta = lambda - lambda2,
sign$$1 = delta > 0 ? 1 : -1,
lambdai = inflection[0] * degrees$1 * sign$$1,
phii,
antimeridian = abs(delta) > 180;
if (antimeridian ^ (sign$$1 * lambda2 < lambdai && lambdai < sign$$1 * lambda)) {
phii = inflection[1] * degrees$1;
if (phii > phi1) phi1 = phii;
} else if (lambdai = (lambdai + 360) % 360 - 180, antimeridian ^ (sign$$1 * lambda2 < lambdai && lambdai < sign$$1 * lambda)) {
phii = -inflection[1] * degrees$1;
if (phii < phi0) phi0 = phii;
} else {
if (phi < phi0) phi0 = phi;
if (phi > phi1) phi1 = phi;
}
if (antimeridian) {
if (lambda < lambda2) {
if (angle(lambda0$1, lambda) > angle(lambda0$1, lambda1)) lambda1 = lambda;
} else {
if (angle(lambda, lambda1) > angle(lambda0$1, lambda1)) lambda0$1 = lambda;
}
} else {
if (lambda1 >= lambda0$1) {
if (lambda < lambda0$1) lambda0$1 = lambda;
if (lambda > lambda1) lambda1 = lambda;
} else {
if (lambda > lambda2) {
if (angle(lambda0$1, lambda) > angle(lambda0$1, lambda1)) lambda1 = lambda;
} else {
if (angle(lambda, lambda1) > angle(lambda0$1, lambda1)) lambda0$1 = lambda;
}
}
}
} else {
ranges.push(range = [lambda0$1 = lambda, lambda1 = lambda]);
}
if (phi < phi0) phi0 = phi;
if (phi > phi1) phi1 = phi;
p0 = p, lambda2 = lambda;
}
function boundsLineStart() {
boundsStream.point = linePoint;
}
function boundsLineEnd() {
range[0] = lambda0$1, range[1] = lambda1;
boundsStream.point = boundsPoint;
p0 = null;
}
function boundsRingPoint(lambda, phi) {
if (p0) {
var delta = lambda - lambda2;
deltaSum.add(abs(delta) > 180 ? delta + (delta > 0 ? 360 : -360) : delta);
} else {
lambda00$1 = lambda, phi00$1 = phi;
}
areaStream.point(lambda, phi);
linePoint(lambda, phi);
}
function boundsRingStart() {
areaStream.lineStart();
}
function boundsRingEnd() {
boundsRingPoint(lambda00$1, phi00$1);
areaStream.lineEnd();
if (abs(deltaSum) > epsilon$2) lambda0$1 = -(lambda1 = 180);
range[0] = lambda0$1, range[1] = lambda1;
p0 = null;
}
// Finds the left-right distance between two longitudes.
// This is almost the same as (lambda1 - lambda0 + 360°) % 360°, except that we want
// the distance between ±180° to be 360°.
function angle(lambda0, lambda1) {
return (lambda1 -= lambda0) < 0 ? lambda1 + 360 : lambda1;
}
function rangeCompare(a, b) {
return a[0] - b[0];
}
function rangeContains(range, x) {
return range[0] <= range[1] ? range[0] <= x && x <= range[1] : x < range[0] || range[1] < x;
}
var bounds = function(feature) {
var i, n, a, b, merged, deltaMax, delta;
phi1 = lambda1 = -(lambda0$1 = phi0 = Infinity);
ranges = [];
geoStream(feature, boundsStream);
// First, sort ranges by their minimum longitudes.
if (n = ranges.length) {
ranges.sort(rangeCompare);
// Then, merge any ranges that overlap.
for (i = 1, a = ranges[0], merged = [a]; i < n; ++i) {
b = ranges[i];
if (rangeContains(a, b[0]) || rangeContains(a, b[1])) {
if (angle(a[0], b[1]) > angle(a[0], a[1])) a[1] = b[1];
if (angle(b[0], a[1]) > angle(a[0], a[1])) a[0] = b[0];
} else {
merged.push(a = b);
}
}
// Finally, find the largest gap between the merged ranges.
// The final bounding box will be the inverse of this gap.
for (deltaMax = -Infinity, n = merged.length - 1, i = 0, a = merged[n]; i <= n; a = b, ++i) {
b = merged[i];
if ((delta = angle(a[1], b[0])) > deltaMax) deltaMax = delta, lambda0$1 = b[0], lambda1 = a[1];
}
}
ranges = range = null;
return lambda0$1 === Infinity || phi0 === Infinity
? [[NaN, NaN], [NaN, NaN]]
: [[lambda0$1, phi0], [lambda1, phi1]];
};
var W0;
var W1;
var X0;
var Y0;
var Z0;
var X1;
var Y1;
var Z1;
var X2;
var Y2;
var Z2;
var lambda00$2;
var phi00$2;
var x0;
var y0;
var z0; // previous point
var centroidStream = {
sphere: noop$1,
point: centroidPoint,
lineStart: centroidLineStart,
lineEnd: centroidLineEnd,
polygonStart: function() {
centroidStream.lineStart = centroidRingStart;
centroidStream.lineEnd = centroidRingEnd;
},
polygonEnd: function() {
centroidStream.lineStart = centroidLineStart;
centroidStream.lineEnd = centroidLineEnd;
}
};
// Arithmetic mean of Cartesian vectors.
function centroidPoint(lambda, phi) {
lambda *= radians, phi *= radians;
var cosPhi = cos$1(phi);
centroidPointCartesian(cosPhi * cos$1(lambda), cosPhi * sin$1(lambda), sin$1(phi));
}
function centroidPointCartesian(x, y, z) {
++W0;
X0 += (x - X0) / W0;
Y0 += (y - Y0) / W0;
Z0 += (z - Z0) / W0;
}
function centroidLineStart() {
centroidStream.point = centroidLinePointFirst;
}
function centroidLinePointFirst(lambda, phi) {
lambda *= radians, phi *= radians;
var cosPhi = cos$1(phi);
x0 = cosPhi * cos$1(lambda);
y0 = cosPhi * sin$1(lambda);
z0 = sin$1(phi);
centroidStream.point = centroidLinePoint;
centroidPointCartesian(x0, y0, z0);
}
function centroidLinePoint(lambda, phi) {
lambda *= radians, phi *= radians;
var cosPhi = cos$1(phi),
x = cosPhi * cos$1(lambda),
y = cosPhi * sin$1(lambda),
z = sin$1(phi),
w = atan2(sqrt((w = y0 * z - z0 * y) * w + (w = z0 * x - x0 * z) * w + (w = x0 * y - y0 * x) * w), x0 * x + y0 * y + z0 * z);
W1 += w;
X1 += w * (x0 + (x0 = x));
Y1 += w * (y0 + (y0 = y));
Z1 += w * (z0 + (z0 = z));
centroidPointCartesian(x0, y0, z0);
}
function centroidLineEnd() {
centroidStream.point = centroidPoint;
}
// See J. E. Brock, The Inertia Tensor for a Spherical Triangle,
// J. Applied Mechanics 42, 239 (1975).
function centroidRingStart() {
centroidStream.point = centroidRingPointFirst;
}
function centroidRingEnd() {
centroidRingPoint(lambda00$2, phi00$2);
centroidStream.point = centroidPoint;
}
function centroidRingPointFirst(lambda, phi) {
lambda00$2 = lambda, phi00$2 = phi;
lambda *= radians, phi *= radians;
centroidStream.point = centroidRingPoint;
var cosPhi = cos$1(phi);
x0 = cosPhi * cos$1(lambda);
y0 = cosPhi * sin$1(lambda);
z0 = sin$1(phi);
centroidPointCartesian(x0, y0, z0);
}
function centroidRingPoint(lambda, phi) {
lambda *= radians, phi *= radians;
var cosPhi = cos$1(phi),
x = cosPhi * cos$1(lambda),
y = cosPhi * sin$1(lambda),
z = sin$1(phi),
cx = y0 * z - z0 * y,
cy = z0 * x - x0 * z,
cz = x0 * y - y0 * x,
m = sqrt(cx * cx + cy * cy + cz * cz),
w = asin(m), // line weight = angle
v = m && -w / m; // area weight multiplier
X2 += v * cx;
Y2 += v * cy;
Z2 += v * cz;
W1 += w;
X1 += w * (x0 + (x0 = x));
Y1 += w * (y0 + (y0 = y));
Z1 += w * (z0 + (z0 = z));
centroidPointCartesian(x0, y0, z0);
}
var centroid = function(object) {
W0 = W1 =
X0 = Y0 = Z0 =
X1 = Y1 = Z1 =
X2 = Y2 = Z2 = 0;
geoStream(object, centroidStream);
var x = X2,
y = Y2,
z = Z2,
m = x * x + y * y + z * z;
// If the area-weighted ccentroid is undefined, fall back to length-weighted ccentroid.
if (m < epsilon2$1) {
x = X1, y = Y1, z = Z1;
// If the feature has zero length, fall back to arithmetic mean of point vectors.
if (W1 < epsilon$2) x = X0, y = Y0, z = Z0;
m = x * x + y * y + z * z;
// If the feature still has an undefined ccentroid, then return.
if (m < epsilon2$1) return [NaN, NaN];
}
return [atan2(y, x) * degrees$1, asin(z / sqrt(m)) * degrees$1];
};
var constant$7 = function(x) {
return function() {
return x;
};
};
var compose = function(a, b) {
function compose(x, y) {
return x = a(x, y), b(x[0], x[1]);
}
if (a.invert && b.invert) compose.invert = function(x, y) {
return x = b.invert(x, y), x && a.invert(x[0], x[1]);
};
return compose;
};
function rotationIdentity(lambda, phi) {
return [lambda > pi$3 ? lambda - tau$3 : lambda < -pi$3 ? lambda + tau$3 : lambda, phi];
}
rotationIdentity.invert = rotationIdentity;
function rotateRadians(deltaLambda, deltaPhi, deltaGamma) {
return (deltaLambda %= tau$3) ? (deltaPhi || deltaGamma ? compose(rotationLambda(deltaLambda), rotationPhiGamma(deltaPhi, deltaGamma))
: rotationLambda(deltaLambda))
: (deltaPhi || deltaGamma ? rotationPhiGamma(deltaPhi, deltaGamma)
: rotationIdentity);
}
function forwardRotationLambda(deltaLambda) {
return function(lambda, phi) {
return lambda += deltaLambda, [lambda > pi$3 ? lambda - tau$3 : lambda < -pi$3 ? lambda + tau$3 : lambda, phi];
};
}
function rotationLambda(deltaLambda) {
var rotation = forwardRotationLambda(deltaLambda);
rotation.invert = forwardRotationLambda(-deltaLambda);
return rotation;
}
function rotationPhiGamma(deltaPhi, deltaGamma) {
var cosDeltaPhi = cos$1(deltaPhi),
sinDeltaPhi = sin$1(deltaPhi),
cosDeltaGamma = cos$1(deltaGamma),
sinDeltaGamma = sin$1(deltaGamma);
function rotation(lambda, phi) {
var cosPhi = cos$1(phi),
x = cos$1(lambda) * cosPhi,
y = sin$1(lambda) * cosPhi,
z = sin$1(phi),
k = z * cosDeltaPhi + x * sinDeltaPhi;
return [
atan2(y * cosDeltaGamma - k * sinDeltaGamma, x * cosDeltaPhi - z * sinDeltaPhi),
asin(k * cosDeltaGamma + y * sinDeltaGamma)
];
}
rotation.invert = function(lambda, phi) {
var cosPhi = cos$1(phi),
x = cos$1(lambda) * cosPhi,
y = sin$1(lambda) * cosPhi,
z = sin$1(phi),
k = z * cosDeltaGamma - y * sinDeltaGamma;
return [
atan2(y * cosDeltaGamma + z * sinDeltaGamma, x * cosDeltaPhi + k * sinDeltaPhi),
asin(k * cosDeltaPhi - x * sinDeltaPhi)
];
};
return rotation;
}
var rotation = function(rotate) {
rotate = rotateRadians(rotate[0] * radians, rotate[1] * radians, rotate.length > 2 ? rotate[2] * radians : 0);
function forward(coordinates) {
coordinates = rotate(coordinates[0] * radians, coordinates[1] * radians);
return coordinates[0] *= degrees$1, coordinates[1] *= degrees$1, coordinates;
}
forward.invert = function(coordinates) {
coordinates = rotate.invert(coordinates[0] * radians, coordinates[1] * radians);
return coordinates[0] *= degrees$1, coordinates[1] *= degrees$1, coordinates;
};
return forward;
};
// Generates a circle centered at [0°, 0°], with a given radius and precision.
function circleStream(stream, radius, delta, direction, t0, t1) {
if (!delta) return;
var cosRadius = cos$1(radius),
sinRadius = sin$1(radius),
step = direction * delta;
if (t0 == null) {
t0 = radius + direction * tau$3;
t1 = radius - step / 2;
} else {
t0 = circleRadius(cosRadius, t0);
t1 = circleRadius(cosRadius, t1);
if (direction > 0 ? t0 < t1 : t0 > t1) t0 += direction * tau$3;
}
for (var point, t = t0; direction > 0 ? t > t1 : t < t1; t -= step) {
point = spherical([cosRadius, -sinRadius * cos$1(t), -sinRadius * sin$1(t)]);
stream.point(point[0], point[1]);
}
}
// Returns the signed angle of a cartesian point relative to [cosRadius, 0, 0].
function circleRadius(cosRadius, point) {
point = cartesian(point), point[0] -= cosRadius;
cartesianNormalizeInPlace(point);
var radius = acos(-point[1]);
return ((-point[2] < 0 ? -radius : radius) + tau$3 - epsilon$2) % tau$3;
}
var circle = function() {
var center = constant$7([0, 0]),
radius = constant$7(90),
precision = constant$7(6),
ring,
rotate,
stream = {point: point};
function point(x, y) {
ring.push(x = rotate(x, y));
x[0] *= degrees$1, x[1] *= degrees$1;
}
function circle() {
var c = center.apply(this, arguments),
r = radius.apply(this, arguments) * radians,
p = precision.apply(this, arguments) * radians;
ring = [];
rotate = rotateRadians(-c[0] * radians, -c[1] * radians, 0).invert;
circleStream(stream, r, p, 1);
c = {type: "Polygon", coordinates: [ring]};
ring = rotate = null;
return c;
}
circle.center = function(_) {
return arguments.length ? (center = typeof _ === "function" ? _ : constant$7([+_[0], +_[1]]), circle) : center;
};
circle.radius = function(_) {
return arguments.length ? (radius = typeof _ === "function" ? _ : constant$7(+_), circle) : radius;
};
circle.precision = function(_) {
return arguments.length ? (precision = typeof _ === "function" ? _ : constant$7(+_), circle) : precision;
};
return circle;
};
var clipBuffer = function() {
var lines = [],
line;
return {
point: function(x, y) {
line.push([x, y]);
},
lineStart: function() {
lines.push(line = []);
},
lineEnd: noop$1,
rejoin: function() {
if (lines.length > 1) lines.push(lines.pop().concat(lines.shift()));
},
result: function() {
var result = lines;
lines = [];
line = null;
return result;
}
};
};
var clipLine = function(a, b, x0, y0, x1, y1) {
var ax = a[0],
ay = a[1],
bx = b[0],
by = b[1],
t0 = 0,
t1 = 1,
dx = bx - ax,
dy = by - ay,
r;
r = x0 - ax;
if (!dx && r > 0) return;
r /= dx;
if (dx < 0) {
if (r < t0) return;
if (r < t1) t1 = r;
} else if (dx > 0) {
if (r > t1) return;
if (r > t0) t0 = r;
}
r = x1 - ax;
if (!dx && r < 0) return;
r /= dx;
if (dx < 0) {
if (r > t1) return;
if (r > t0) t0 = r;
} else if (dx > 0) {
if (r < t0) return;
if (r < t1) t1 = r;
}
r = y0 - ay;
if (!dy && r > 0) return;
r /= dy;
if (dy < 0) {
if (r < t0) return;
if (r < t1) t1 = r;
} else if (dy > 0) {
if (r > t1) return;
if (r > t0) t0 = r;
}
r = y1 - ay;
if (!dy && r < 0) return;
r /= dy;
if (dy < 0) {
if (r > t1) return;
if (r > t0) t0 = r;
} else if (dy > 0) {
if (r < t0) return;
if (r < t1) t1 = r;
}
if (t0 > 0) a[0] = ax + t0 * dx, a[1] = ay + t0 * dy;
if (t1 < 1) b[0] = ax + t1 * dx, b[1] = ay + t1 * dy;
return true;
};
var pointEqual = function(a, b) {
return abs(a[0] - b[0]) < epsilon$2 && abs(a[1] - b[1]) < epsilon$2;
};
function Intersection(point, points, other, entry) {
this.x = point;
this.z = points;
this.o = other; // another intersection
this.e = entry; // is an entry?
this.v = false; // visited
this.n = this.p = null; // next & previous
}
// A generalized polygon clipping algorithm: given a polygon that has been cut
// into its visible line segments, and rejoins the segments by interpolating
// along the clip edge.
var clipPolygon = function(segments, compareIntersection, startInside, interpolate, stream) {
var subject = [],
clip = [],
i,
n;
segments.forEach(function(segment) {
if ((n = segment.length - 1) <= 0) return;
var n, p0 = segment[0], p1 = segment[n], x;
// If the first and last points of a segment are coincident, then treat as a
// closed ring. TODO if all rings are closed, then the winding order of the
// exterior ring should be checked.
if (pointEqual(p0, p1)) {
stream.lineStart();
for (i = 0; i < n; ++i) stream.point((p0 = segment[i])[0], p0[1]);
stream.lineEnd();
return;
}
subject.push(x = new Intersection(p0, segment, null, true));
clip.push(x.o = new Intersection(p0, null, x, false));
subject.push(x = new Intersection(p1, segment, null, false));
clip.push(x.o = new Intersection(p1, null, x, true));
});
if (!subject.length) return;
clip.sort(compareIntersection);
link$1(subject);
link$1(clip);
for (i = 0, n = clip.length; i < n; ++i) {
clip[i].e = startInside = !startInside;
}
var start = subject[0],
points,
point;
while (1) {
// Find first unvisited intersection.
var current = start,
isSubject = true;
while (current.v) if ((current = current.n) === start) return;
points = current.z;
stream.lineStart();
do {
current.v = current.o.v = true;
if (current.e) {
if (isSubject) {
for (i = 0, n = points.length; i < n; ++i) stream.point((point = points[i])[0], point[1]);
} else {
interpolate(current.x, current.n.x, 1, stream);
}
current = current.n;
} else {
if (isSubject) {
points = current.p.z;
for (i = points.length - 1; i >= 0; --i) stream.point((point = points[i])[0], point[1]);
} else {
interpolate(current.x, current.p.x, -1, stream);
}
current = current.p;
}
current = current.o;
points = current.z;
isSubject = !isSubject;
} while (!current.v);
stream.lineEnd();
}
};
function link$1(array) {
if (!(n = array.length)) return;
var n,
i = 0,
a = array[0],
b;
while (++i < n) {
a.n = b = array[i];
b.p = a;
a = b;
}
a.n = b = array[0];
b.p = a;
}
var clipMax = 1e9;
var clipMin = -clipMax;
// TODO Use d3-polygons polygonContains here for the ring check?
// TODO Eliminate duplicate buffering in clipBuffer and polygon.push?
function clipExtent(x0, y0, x1, y1) {
function visible(x, y) {
return x0 <= x && x <= x1 && y0 <= y && y <= y1;
}
function interpolate(from, to, direction, stream) {
var a = 0, a1 = 0;
if (from == null
|| (a = corner(from, direction)) !== (a1 = corner(to, direction))
|| comparePoint(from, to) < 0 ^ direction > 0) {
do stream.point(a === 0 || a === 3 ? x0 : x1, a > 1 ? y1 : y0);
while ((a = (a + direction + 4) % 4) !== a1);
} else {
stream.point(to[0], to[1]);
}
}
function corner(p, direction) {
return abs(p[0] - x0) < epsilon$2 ? direction > 0 ? 0 : 3
: abs(p[0] - x1) < epsilon$2 ? direction > 0 ? 2 : 1
: abs(p[1] - y0) < epsilon$2 ? direction > 0 ? 1 : 0
: direction > 0 ? 3 : 2; // abs(p[1] - y1) < epsilon
}
function compareIntersection(a, b) {
return comparePoint(a.x, b.x);
}
function comparePoint(a, b) {
var ca = corner(a, 1),
cb = corner(b, 1);
return ca !== cb ? ca - cb
: ca === 0 ? b[1] - a[1]
: ca === 1 ? a[0] - b[0]
: ca === 2 ? a[1] - b[1]
: b[0] - a[0];
}
return function(stream) {
var activeStream = stream,
bufferStream = clipBuffer(),
segments,
polygon,
ring,
x__, y__, v__, // first point
x_, y_, v_, // previous point
first,
clean;
var clipStream = {
point: point,
lineStart: lineStart,
lineEnd: lineEnd,
polygonStart: polygonStart,
polygonEnd: polygonEnd
};
function point(x, y) {
if (visible(x, y)) activeStream.point(x, y);
}
function polygonInside() {
var winding = 0;
for (var i = 0, n = polygon.length; i < n; ++i) {
for (var ring = polygon[i], j = 1, m = ring.length, point = ring[0], a0, a1, b0 = point[0], b1 = point[1]; j < m; ++j) {
a0 = b0, a1 = b1, point = ring[j], b0 = point[0], b1 = point[1];
if (a1 <= y1) { if (b1 > y1 && (b0 - a0) * (y1 - a1) > (b1 - a1) * (x0 - a0)) ++winding; }
else { if (b1 <= y1 && (b0 - a0) * (y1 - a1) < (b1 - a1) * (x0 - a0)) --winding; }
}
}
return winding;
}
// Buffer geometry within a polygon and then clip it en masse.
function polygonStart() {
activeStream = bufferStream, segments = [], polygon = [], clean = true;
}
function polygonEnd() {
var startInside = polygonInside(),
cleanInside = clean && startInside,
visible = (segments = merge(segments)).length;
if (cleanInside || visible) {
stream.polygonStart();
if (cleanInside) {
stream.lineStart();
interpolate(null, null, 1, stream);
stream.lineEnd();
}
if (visible) {
clipPolygon(segments, compareIntersection, startInside, interpolate, stream);
}
stream.polygonEnd();
}
activeStream = stream, segments = polygon = ring = null;
}
function lineStart() {
clipStream.point = linePoint;
if (polygon) polygon.push(ring = []);
first = true;
v_ = false;
x_ = y_ = NaN;
}
// TODO rather than special-case polygons, simply handle them separately.
// Ideally, coincident intersection points should be jittered to avoid
// clipping issues.
function lineEnd() {
if (segments) {
linePoint(x__, y__);
if (v__ && v_) bufferStream.rejoin();
segments.push(bufferStream.result());
}
clipStream.point = point;
if (v_) activeStream.lineEnd();
}
function linePoint(x, y) {
var v = visible(x, y);
if (polygon) ring.push([x, y]);
if (first) {
x__ = x, y__ = y, v__ = v;
first = false;
if (v) {
activeStream.lineStart();
activeStream.point(x, y);
}
} else {
if (v && v_) activeStream.point(x, y);
else {
var a = [x_ = Math.max(clipMin, Math.min(clipMax, x_)), y_ = Math.max(clipMin, Math.min(clipMax, y_))],
b = [x = Math.max(clipMin, Math.min(clipMax, x)), y = Math.max(clipMin, Math.min(clipMax, y))];
if (clipLine(a, b, x0, y0, x1, y1)) {
if (!v_) {
activeStream.lineStart();
activeStream.point(a[0], a[1]);
}
activeStream.point(b[0], b[1]);
if (!v) activeStream.lineEnd();
clean = false;
} else if (v) {
activeStream.lineStart();
activeStream.point(x, y);
clean = false;
}
}
}
x_ = x, y_ = y, v_ = v;
}
return clipStream;
};
}
var extent$1 = function() {
var x0 = 0,
y0 = 0,
x1 = 960,
y1 = 500,
cache,
cacheStream,
clip;
return clip = {
stream: function(stream) {
return cache && cacheStream === stream ? cache : cache = clipExtent(x0, y0, x1, y1)(cacheStream = stream);
},
extent: function(_) {
return arguments.length ? (x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1], cache = cacheStream = null, clip) : [[x0, y0], [x1, y1]];
}
};
};
var sum$1 = adder();
var polygonContains = function(polygon, point) {
var lambda = point[0],
phi = point[1],
normal = [sin$1(lambda), -cos$1(lambda), 0],
angle = 0,
winding = 0;
sum$1.reset();
for (var i = 0, n = polygon.length; i < n; ++i) {
if (!(m = (ring = polygon[i]).length)) continue;
var ring,
m,
point0 = ring[m - 1],
lambda0 = point0[0],
phi0 = point0[1] / 2 + quarterPi,
sinPhi0 = sin$1(phi0),
cosPhi0 = cos$1(phi0);
for (var j = 0; j < m; ++j, lambda0 = lambda1, sinPhi0 = sinPhi1, cosPhi0 = cosPhi1, point0 = point1) {
var point1 = ring[j],
lambda1 = point1[0],
phi1 = point1[1] / 2 + quarterPi,
sinPhi1 = sin$1(phi1),
cosPhi1 = cos$1(phi1),
delta = lambda1 - lambda0,
sign$$1 = delta >= 0 ? 1 : -1,
absDelta = sign$$1 * delta,
antimeridian = absDelta > pi$3,
k = sinPhi0 * sinPhi1;
sum$1.add(atan2(k * sign$$1 * sin$1(absDelta), cosPhi0 * cosPhi1 + k * cos$1(absDelta)));
angle += antimeridian ? delta + sign$$1 * tau$3 : delta;
// Are the longitudes either side of the points meridian (lambda),
// and are the latitudes smaller than the parallel (phi)?
if (antimeridian ^ lambda0 >= lambda ^ lambda1 >= lambda) {
var arc = cartesianCross(cartesian(point0), cartesian(point1));
cartesianNormalizeInPlace(arc);
var intersection = cartesianCross(normal, arc);
cartesianNormalizeInPlace(intersection);
var phiArc = (antimeridian ^ delta >= 0 ? -1 : 1) * asin(intersection[2]);
if (phi > phiArc || phi === phiArc && (arc[0] || arc[1])) {
winding += antimeridian ^ delta >= 0 ? 1 : -1;
}
}
}
}
// First, determine whether the South pole is inside or outside:
//
// It is inside if:
// * the polygon winds around it in a clockwise direction.
// * the polygon does not (cumulatively) wind around it, but has a negative
// (counter-clockwise) area.
//
// Second, count the (signed) number of times a segment crosses a lambda
// from the point to the South pole. If it is zero, then the point is the
// same side as the South pole.
return (angle < -epsilon$2 || angle < epsilon$2 && sum$1 < -epsilon$2) ^ (winding & 1);
};
var lengthSum = adder();
var lambda0$2;
var sinPhi0$1;
var cosPhi0$1;
var lengthStream = {
sphere: noop$1,
point: noop$1,
lineStart: lengthLineStart,
lineEnd: noop$1,
polygonStart: noop$1,
polygonEnd: noop$1
};
function lengthLineStart() {
lengthStream.point = lengthPointFirst;
lengthStream.lineEnd = lengthLineEnd;
}
function lengthLineEnd() {
lengthStream.point = lengthStream.lineEnd = noop$1;
}
function lengthPointFirst(lambda, phi) {
lambda *= radians, phi *= radians;
lambda0$2 = lambda, sinPhi0$1 = sin$1(phi), cosPhi0$1 = cos$1(phi);
lengthStream.point = lengthPoint;
}
function lengthPoint(lambda, phi) {
lambda *= radians, phi *= radians;
var sinPhi = sin$1(phi),
cosPhi = cos$1(phi),
delta = abs(lambda - lambda0$2),
cosDelta = cos$1(delta),
sinDelta = sin$1(delta),
x = cosPhi * sinDelta,
y = cosPhi0$1 * sinPhi - sinPhi0$1 * cosPhi * cosDelta,
z = sinPhi0$1 * sinPhi + cosPhi0$1 * cosPhi * cosDelta;
lengthSum.add(atan2(sqrt(x * x + y * y), z));
lambda0$2 = lambda, sinPhi0$1 = sinPhi, cosPhi0$1 = cosPhi;
}
var length$1 = function(object) {
lengthSum.reset();
geoStream(object, lengthStream);
return +lengthSum;
};
var coordinates = [null, null];
var object$1 = {type: "LineString", coordinates: coordinates};
var distance = function(a, b) {
coordinates[0] = a;
coordinates[1] = b;
return length$1(object$1);
};
var containsObjectType = {
Feature: function(object, point) {
return containsGeometry(object.geometry, point);
},
FeatureCollection: function(object, point) {
var features = object.features, i = -1, n = features.length;
while (++i < n) if (containsGeometry(features[i].geometry, point)) return true;
return false;
}
};
var containsGeometryType = {
Sphere: function() {
return true;
},
Point: function(object, point) {
return containsPoint(object.coordinates, point);
},
MultiPoint: function(object, point) {
var coordinates = object.coordinates, i = -1, n = coordinates.length;
while (++i < n) if (containsPoint(coordinates[i], point)) return true;
return false;
},
LineString: function(object, point) {
return containsLine(object.coordinates, point);
},
MultiLineString: function(object, point) {
var coordinates = object.coordinates, i = -1, n = coordinates.length;
while (++i < n) if (containsLine(coordinates[i], point)) return true;
return false;
},
Polygon: function(object, point) {
return containsPolygon(object.coordinates, point);
},
MultiPolygon: function(object, point) {
var coordinates = object.coordinates, i = -1, n = coordinates.length;
while (++i < n) if (containsPolygon(coordinates[i], point)) return true;
return false;
},
GeometryCollection: function(object, point) {
var geometries = object.geometries, i = -1, n = geometries.length;
while (++i < n) if (containsGeometry(geometries[i], point)) return true;
return false;
}
};
function containsGeometry(geometry, point) {
return geometry && containsGeometryType.hasOwnProperty(geometry.type)
? containsGeometryType[geometry.type](geometry, point)
: false;
}
function containsPoint(coordinates, point) {
return distance(coordinates, point) === 0;
}
function containsLine(coordinates, point) {
var ab = distance(coordinates[0], coordinates[1]),
ao = distance(coordinates[0], point),
ob = distance(point, coordinates[1]);
return ao + ob <= ab + epsilon$2;
}
function containsPolygon(coordinates, point) {
return !!polygonContains(coordinates.map(ringRadians), pointRadians(point));
}
function ringRadians(ring) {
return ring = ring.map(pointRadians), ring.pop(), ring;
}
function pointRadians(point) {
return [point[0] * radians, point[1] * radians];
}
var contains = function(object, point) {
return (object && containsObjectType.hasOwnProperty(object.type)
? containsObjectType[object.type]
: containsGeometry)(object, point);
};
function graticuleX(y0, y1, dy) {
var y = sequence(y0, y1 - epsilon$2, dy).concat(y1);
return function(x) { return y.map(function(y) { return [x, y]; }); };
}
function graticuleY(x0, x1, dx) {
var x = sequence(x0, x1 - epsilon$2, dx).concat(x1);
return function(y) { return x.map(function(x) { return [x, y]; }); };
}
function graticule() {
var x1, x0, X1, X0,
y1, y0, Y1, Y0,
dx = 10, dy = dx, DX = 90, DY = 360,
x, y, X, Y,
precision = 2.5;
function graticule() {
return {type: "MultiLineString", coordinates: lines()};
}
function lines() {
return sequence(ceil(X0 / DX) * DX, X1, DX).map(X)
.concat(sequence(ceil(Y0 / DY) * DY, Y1, DY).map(Y))
.concat(sequence(ceil(x0 / dx) * dx, x1, dx).filter(function(x) { return abs(x % DX) > epsilon$2; }).map(x))
.concat(sequence(ceil(y0 / dy) * dy, y1, dy).filter(function(y) { return abs(y % DY) > epsilon$2; }).map(y));
}
graticule.lines = function() {
return lines().map(function(coordinates) { return {type: "LineString", coordinates: coordinates}; });
};
graticule.outline = function() {
return {
type: "Polygon",
coordinates: [
X(X0).concat(
Y(Y1).slice(1),
X(X1).reverse().slice(1),
Y(Y0).reverse().slice(1))
]
};
};
graticule.extent = function(_) {
if (!arguments.length) return graticule.extentMinor();
return graticule.extentMajor(_).extentMinor(_);
};
graticule.extentMajor = function(_) {
if (!arguments.length) return [[X0, Y0], [X1, Y1]];
X0 = +_[0][0], X1 = +_[1][0];
Y0 = +_[0][1], Y1 = +_[1][1];
if (X0 > X1) _ = X0, X0 = X1, X1 = _;
if (Y0 > Y1) _ = Y0, Y0 = Y1, Y1 = _;
return graticule.precision(precision);
};
graticule.extentMinor = function(_) {
if (!arguments.length) return [[x0, y0], [x1, y1]];
x0 = +_[0][0], x1 = +_[1][0];
y0 = +_[0][1], y1 = +_[1][1];
if (x0 > x1) _ = x0, x0 = x1, x1 = _;
if (y0 > y1) _ = y0, y0 = y1, y1 = _;
return graticule.precision(precision);
};
graticule.step = function(_) {
if (!arguments.length) return graticule.stepMinor();
return graticule.stepMajor(_).stepMinor(_);
};
graticule.stepMajor = function(_) {
if (!arguments.length) return [DX, DY];
DX = +_[0], DY = +_[1];
return graticule;
};
graticule.stepMinor = function(_) {
if (!arguments.length) return [dx, dy];
dx = +_[0], dy = +_[1];
return graticule;
};
graticule.precision = function(_) {
if (!arguments.length) return precision;
precision = +_;
x = graticuleX(y0, y1, 90);
y = graticuleY(x0, x1, precision);
X = graticuleX(Y0, Y1, 90);
Y = graticuleY(X0, X1, precision);
return graticule;
};
return graticule
.extentMajor([[-180, -90 + epsilon$2], [180, 90 - epsilon$2]])
.extentMinor([[-180, -80 - epsilon$2], [180, 80 + epsilon$2]]);
}
function graticule10() {
return graticule()();
}
var interpolate$1 = function(a, b) {
var x0 = a[0] * radians,
y0 = a[1] * radians,
x1 = b[0] * radians,
y1 = b[1] * radians,
cy0 = cos$1(y0),
sy0 = sin$1(y0),
cy1 = cos$1(y1),
sy1 = sin$1(y1),
kx0 = cy0 * cos$1(x0),
ky0 = cy0 * sin$1(x0),
kx1 = cy1 * cos$1(x1),
ky1 = cy1 * sin$1(x1),
d = 2 * asin(sqrt(haversin(y1 - y0) + cy0 * cy1 * haversin(x1 - x0))),
k = sin$1(d);
var interpolate = d ? function(t) {
var B = sin$1(t *= d) / k,
A = sin$1(d - t) / k,
x = A * kx0 + B * kx1,
y = A * ky0 + B * ky1,
z = A * sy0 + B * sy1;
return [
atan2(y, x) * degrees$1,
atan2(z, sqrt(x * x + y * y)) * degrees$1
];
} : function() {
return [x0 * degrees$1, y0 * degrees$1];
};
interpolate.distance = d;
return interpolate;
};
var identity$4 = function(x) {
return x;
};
var areaSum$1 = adder();
var areaRingSum$1 = adder();
var x00;
var y00;
var x0$1;
var y0$1;
var areaStream$1 = {
point: noop$1,
lineStart: noop$1,
lineEnd: noop$1,
polygonStart: function() {
areaStream$1.lineStart = areaRingStart$1;
areaStream$1.lineEnd = areaRingEnd$1;
},
polygonEnd: function() {
areaStream$1.lineStart = areaStream$1.lineEnd = areaStream$1.point = noop$1;
areaSum$1.add(abs(areaRingSum$1));
areaRingSum$1.reset();
},
result: function() {
var area = areaSum$1 / 2;
areaSum$1.reset();
return area;
}
};
function areaRingStart$1() {
areaStream$1.point = areaPointFirst$1;
}
function areaPointFirst$1(x, y) {
areaStream$1.point = areaPoint$1;
x00 = x0$1 = x, y00 = y0$1 = y;
}
function areaPoint$1(x, y) {
areaRingSum$1.add(y0$1 * x - x0$1 * y);
x0$1 = x, y0$1 = y;
}
function areaRingEnd$1() {
areaPoint$1(x00, y00);
}
var x0$2 = Infinity;
var y0$2 = x0$2;
var x1 = -x0$2;
var y1 = x1;
var boundsStream$1 = {
point: boundsPoint$1,
lineStart: noop$1,
lineEnd: noop$1,
polygonStart: noop$1,
polygonEnd: noop$1,
result: function() {
var bounds = [[x0$2, y0$2], [x1, y1]];
x1 = y1 = -(y0$2 = x0$2 = Infinity);
return bounds;
}
};
function boundsPoint$1(x, y) {
if (x < x0$2) x0$2 = x;
if (x > x1) x1 = x;
if (y < y0$2) y0$2 = y;
if (y > y1) y1 = y;
}
// TODO Enforce positive area for exterior, negative area for interior?
var X0$1 = 0;
var Y0$1 = 0;
var Z0$1 = 0;
var X1$1 = 0;
var Y1$1 = 0;
var Z1$1 = 0;
var X2$1 = 0;
var Y2$1 = 0;
var Z2$1 = 0;
var x00$1;
var y00$1;
var x0$3;
var y0$3;
var centroidStream$1 = {
point: centroidPoint$1,
lineStart: centroidLineStart$1,
lineEnd: centroidLineEnd$1,
polygonStart: function() {
centroidStream$1.lineStart = centroidRingStart$1;
centroidStream$1.lineEnd = centroidRingEnd$1;
},
polygonEnd: function() {
centroidStream$1.point = centroidPoint$1;
centroidStream$1.lineStart = centroidLineStart$1;
centroidStream$1.lineEnd = centroidLineEnd$1;
},
result: function() {
var centroid = Z2$1 ? [X2$1 / Z2$1, Y2$1 / Z2$1]
: Z1$1 ? [X1$1 / Z1$1, Y1$1 / Z1$1]
: Z0$1 ? [X0$1 / Z0$1, Y0$1 / Z0$1]
: [NaN, NaN];
X0$1 = Y0$1 = Z0$1 =
X1$1 = Y1$1 = Z1$1 =
X2$1 = Y2$1 = Z2$1 = 0;
return centroid;
}
};
function centroidPoint$1(x, y) {
X0$1 += x;
Y0$1 += y;
++Z0$1;
}
function centroidLineStart$1() {
centroidStream$1.point = centroidPointFirstLine;
}
function centroidPointFirstLine(x, y) {
centroidStream$1.point = centroidPointLine;
centroidPoint$1(x0$3 = x, y0$3 = y);
}
function centroidPointLine(x, y) {
var dx = x - x0$3, dy = y - y0$3, z = sqrt(dx * dx + dy * dy);
X1$1 += z * (x0$3 + x) / 2;
Y1$1 += z * (y0$3 + y) / 2;
Z1$1 += z;
centroidPoint$1(x0$3 = x, y0$3 = y);
}
function centroidLineEnd$1() {
centroidStream$1.point = centroidPoint$1;
}
function centroidRingStart$1() {
centroidStream$1.point = centroidPointFirstRing;
}
function centroidRingEnd$1() {
centroidPointRing(x00$1, y00$1);
}
function centroidPointFirstRing(x, y) {
centroidStream$1.point = centroidPointRing;
centroidPoint$1(x00$1 = x0$3 = x, y00$1 = y0$3 = y);
}
function centroidPointRing(x, y) {
var dx = x - x0$3,
dy = y - y0$3,
z = sqrt(dx * dx + dy * dy);
X1$1 += z * (x0$3 + x) / 2;
Y1$1 += z * (y0$3 + y) / 2;
Z1$1 += z;
z = y0$3 * x - x0$3 * y;
X2$1 += z * (x0$3 + x);
Y2$1 += z * (y0$3 + y);
Z2$1 += z * 3;
centroidPoint$1(x0$3 = x, y0$3 = y);
}
function PathContext(context) {
this._context = context;
}
PathContext.prototype = {
_radius: 4.5,
pointRadius: function(_) {
return this._radius = _, this;
},
polygonStart: function() {
this._line = 0;
},
polygonEnd: function() {
this._line = NaN;
},
lineStart: function() {
this._point = 0;
},
lineEnd: function() {
if (this._line === 0) this._context.closePath();
this._point = NaN;
},
point: function(x, y) {
switch (this._point) {
case 0: {
this._context.moveTo(x, y);
this._point = 1;
break;
}
case 1: {
this._context.lineTo(x, y);
break;
}
default: {
this._context.moveTo(x + this._radius, y);
this._context.arc(x, y, this._radius, 0, tau$3);
break;
}
}
},
result: noop$1
};
var lengthSum$1 = adder();
var lengthRing;
var x00$2;
var y00$2;
var x0$4;
var y0$4;
var lengthStream$1 = {
point: noop$1,
lineStart: function() {
lengthStream$1.point = lengthPointFirst$1;
},
lineEnd: function() {
if (lengthRing) lengthPoint$1(x00$2, y00$2);
lengthStream$1.point = noop$1;
},
polygonStart: function() {
lengthRing = true;
},
polygonEnd: function() {
lengthRing = null;
},
result: function() {
var length = +lengthSum$1;
lengthSum$1.reset();
return length;
}
};
function lengthPointFirst$1(x, y) {
lengthStream$1.point = lengthPoint$1;
x00$2 = x0$4 = x, y00$2 = y0$4 = y;
}
function lengthPoint$1(x, y) {
x0$4 -= x, y0$4 -= y;
lengthSum$1.add(sqrt(x0$4 * x0$4 + y0$4 * y0$4));
x0$4 = x, y0$4 = y;
}
function PathString() {
this._string = [];
}
PathString.prototype = {
_radius: 4.5,
_circle: circle$1(4.5),
pointRadius: function(_) {
if ((_ = +_) !== this._radius) this._radius = _, this._circle = null;
return this;
},
polygonStart: function() {
this._line = 0;
},
polygonEnd: function() {
this._line = NaN;
},
lineStart: function() {
this._point = 0;
},
lineEnd: function() {
if (this._line === 0) this._string.push("Z");
this._point = NaN;
},
point: function(x, y) {
switch (this._point) {
case 0: {
this._string.push("M", x, ",", y);
this._point = 1;
break;
}
case 1: {
this._string.push("L", x, ",", y);
break;
}
default: {
if (this._circle == null) this._circle = circle$1(this._radius);
this._string.push("M", x, ",", y, this._circle);
break;
}
}
},
result: function() {
if (this._string.length) {
var result = this._string.join("");
this._string = [];
return result;
} else {
return null;
}
}
};
function circle$1(radius) {
return "m0," + radius
+ "a" + radius + "," + radius + " 0 1,1 0," + -2 * radius
+ "a" + radius + "," + radius + " 0 1,1 0," + 2 * radius
+ "z";
}
var index$1 = function(projection, context) {
var pointRadius = 4.5,
projectionStream,
contextStream;
function path(object) {
if (object) {
if (typeof pointRadius === "function") contextStream.pointRadius(+pointRadius.apply(this, arguments));
geoStream(object, projectionStream(contextStream));
}
return contextStream.result();
}
path.area = function(object) {
geoStream(object, projectionStream(areaStream$1));
return areaStream$1.result();
};
path.measure = function(object) {
geoStream(object, projectionStream(lengthStream$1));
return lengthStream$1.result();
};
path.bounds = function(object) {
geoStream(object, projectionStream(boundsStream$1));
return boundsStream$1.result();
};
path.centroid = function(object) {
geoStream(object, projectionStream(centroidStream$1));
return centroidStream$1.result();
};
path.projection = function(_) {
return arguments.length ? (projectionStream = _ == null ? (projection = null, identity$4) : (projection = _).stream, path) : projection;
};
path.context = function(_) {
if (!arguments.length) return context;
contextStream = _ == null ? (context = null, new PathString) : new PathContext(context = _);
if (typeof pointRadius !== "function") contextStream.pointRadius(pointRadius);
return path;
};
path.pointRadius = function(_) {
if (!arguments.length) return pointRadius;
pointRadius = typeof _ === "function" ? _ : (contextStream.pointRadius(+_), +_);
return path;
};
return path.projection(projection).context(context);
};
var clip = function(pointVisible, clipLine, interpolate, start) {
return function(rotate, sink) {
var line = clipLine(sink),
rotatedStart = rotate.invert(start[0], start[1]),
ringBuffer = clipBuffer(),
ringSink = clipLine(ringBuffer),
polygonStarted = false,
polygon,
segments,
ring;
var clip = {
point: point,
lineStart: lineStart,
lineEnd: lineEnd,
polygonStart: function() {
clip.point = pointRing;
clip.lineStart = ringStart;
clip.lineEnd = ringEnd;
segments = [];
polygon = [];
},
polygonEnd: function() {
clip.point = point;
clip.lineStart = lineStart;
clip.lineEnd = lineEnd;
segments = merge(segments);
var startInside = polygonContains(polygon, rotatedStart);
if (segments.length) {
if (!polygonStarted) sink.polygonStart(), polygonStarted = true;
clipPolygon(segments, compareIntersection, startInside, interpolate, sink);
} else if (startInside) {
if (!polygonStarted) sink.polygonStart(), polygonStarted = true;
sink.lineStart();
interpolate(null, null, 1, sink);
sink.lineEnd();
}
if (polygonStarted) sink.polygonEnd(), polygonStarted = false;
segments = polygon = null;
},
sphere: function() {
sink.polygonStart();
sink.lineStart();
interpolate(null, null, 1, sink);
sink.lineEnd();
sink.polygonEnd();
}
};
function point(lambda, phi) {
var point = rotate(lambda, phi);
if (pointVisible(lambda = point[0], phi = point[1])) sink.point(lambda, phi);
}
function pointLine(lambda, phi) {
var point = rotate(lambda, phi);
line.point(point[0], point[1]);
}
function lineStart() {
clip.point = pointLine;
line.lineStart();
}
function lineEnd() {
clip.point = point;
line.lineEnd();
}
function pointRing(lambda, phi) {
ring.push([lambda, phi]);
var point = rotate(lambda, phi);
ringSink.point(point[0], point[1]);
}
function ringStart() {
ringSink.lineStart();
ring = [];
}
function ringEnd() {
pointRing(ring[0][0], ring[0][1]);
ringSink.lineEnd();
var clean = ringSink.clean(),
ringSegments = ringBuffer.result(),
i, n = ringSegments.length, m,
segment,
point;
ring.pop();
polygon.push(ring);
ring = null;
if (!n) return;
// No intersections.
if (clean & 1) {
segment = ringSegments[0];
if ((m = segment.length - 1) > 0) {
if (!polygonStarted) sink.polygonStart(), polygonStarted = true;
sink.lineStart();
for (i = 0; i < m; ++i) sink.point((point = segment[i])[0], point[1]);
sink.lineEnd();
}
return;
}
// Rejoin connected segments.
// TODO reuse ringBuffer.rejoin()?
if (n > 1 && clean & 2) ringSegments.push(ringSegments.pop().concat(ringSegments.shift()));
segments.push(ringSegments.filter(validSegment));
}
return clip;
};
};
function validSegment(segment) {
return segment.length > 1;
}
// Intersections are sorted along the clip edge. For both antimeridian cutting
// and circle clipping, the same comparison is used.
function compareIntersection(a, b) {
return ((a = a.x)[0] < 0 ? a[1] - halfPi$2 - epsilon$2 : halfPi$2 - a[1])
- ((b = b.x)[0] < 0 ? b[1] - halfPi$2 - epsilon$2 : halfPi$2 - b[1]);
}
var clipAntimeridian = clip(
function() { return true; },
clipAntimeridianLine,
clipAntimeridianInterpolate,
[-pi$3, -halfPi$2]
);
// Takes a line and cuts into visible segments. Return values: 0 - there were
// intersections or the line was empty; 1 - no intersections; 2 - there were
// intersections, and the first and last segments should be rejoined.
function clipAntimeridianLine(stream) {
var lambda0 = NaN,
phi0 = NaN,
sign0 = NaN,
clean; // no intersections
return {
lineStart: function() {
stream.lineStart();
clean = 1;
},
point: function(lambda1, phi1) {
var sign1 = lambda1 > 0 ? pi$3 : -pi$3,
delta = abs(lambda1 - lambda0);
if (abs(delta - pi$3) < epsilon$2) { // line crosses a pole
stream.point(lambda0, phi0 = (phi0 + phi1) / 2 > 0 ? halfPi$2 : -halfPi$2);
stream.point(sign0, phi0);
stream.lineEnd();
stream.lineStart();
stream.point(sign1, phi0);
stream.point(lambda1, phi0);
clean = 0;
} else if (sign0 !== sign1 && delta >= pi$3) { // line crosses antimeridian
if (abs(lambda0 - sign0) < epsilon$2) lambda0 -= sign0 * epsilon$2; // handle degeneracies
if (abs(lambda1 - sign1) < epsilon$2) lambda1 -= sign1 * epsilon$2;
phi0 = clipAntimeridianIntersect(lambda0, phi0, lambda1, phi1);
stream.point(sign0, phi0);
stream.lineEnd();
stream.lineStart();
stream.point(sign1, phi0);
clean = 0;
}
stream.point(lambda0 = lambda1, phi0 = phi1);
sign0 = sign1;
},
lineEnd: function() {
stream.lineEnd();
lambda0 = phi0 = NaN;
},
clean: function() {
return 2 - clean; // if intersections, rejoin first and last segments
}
};
}
function clipAntimeridianIntersect(lambda0, phi0, lambda1, phi1) {
var cosPhi0,
cosPhi1,
sinLambda0Lambda1 = sin$1(lambda0 - lambda1);
return abs(sinLambda0Lambda1) > epsilon$2
? atan((sin$1(phi0) * (cosPhi1 = cos$1(phi1)) * sin$1(lambda1)
- sin$1(phi1) * (cosPhi0 = cos$1(phi0)) * sin$1(lambda0))
/ (cosPhi0 * cosPhi1 * sinLambda0Lambda1))
: (phi0 + phi1) / 2;
}
function clipAntimeridianInterpolate(from, to, direction, stream) {
var phi;
if (from == null) {
phi = direction * halfPi$2;
stream.point(-pi$3, phi);
stream.point(0, phi);
stream.point(pi$3, phi);
stream.point(pi$3, 0);
stream.point(pi$3, -phi);
stream.point(0, -phi);
stream.point(-pi$3, -phi);
stream.point(-pi$3, 0);
stream.point(-pi$3, phi);
} else if (abs(from[0] - to[0]) > epsilon$2) {
var lambda = from[0] < to[0] ? pi$3 : -pi$3;
phi = direction * lambda / 2;
stream.point(-lambda, phi);
stream.point(0, phi);
stream.point(lambda, phi);
} else {
stream.point(to[0], to[1]);
}
}
var clipCircle = function(radius, delta) {
var cr = cos$1(radius),
smallRadius = cr > 0,
notHemisphere = abs(cr) > epsilon$2; // TODO optimise for this common case
function interpolate(from, to, direction, stream) {
circleStream(stream, radius, delta, direction, from, to);
}
function visible(lambda, phi) {
return cos$1(lambda) * cos$1(phi) > cr;
}
// Takes a line and cuts into visible segments. Return values used for polygon
// clipping: 0 - there were intersections or the line was empty; 1 - no
// intersections 2 - there were intersections, and the first and last segments
// should be rejoined.
function clipLine(stream) {
var point0, // previous point
c0, // code for previous point
v0, // visibility of previous point
v00, // visibility of first point
clean; // no intersections
return {
lineStart: function() {
v00 = v0 = false;
clean = 1;
},
point: function(lambda, phi) {
var point1 = [lambda, phi],
point2,
v = visible(lambda, phi),
c = smallRadius
? v ? 0 : code(lambda, phi)
: v ? code(lambda + (lambda < 0 ? pi$3 : -pi$3), phi) : 0;
if (!point0 && (v00 = v0 = v)) stream.lineStart();
// Handle degeneracies.
// TODO ignore if not clipping polygons.
if (v !== v0) {
point2 = intersect(point0, point1);
if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2)) {
point1[0] += epsilon$2;
point1[1] += epsilon$2;
v = visible(point1[0], point1[1]);
}
}
if (v !== v0) {
clean = 0;
if (v) {
// outside going in
stream.lineStart();
point2 = intersect(point1, point0);
stream.point(point2[0], point2[1]);
} else {
// inside going out
point2 = intersect(point0, point1);
stream.point(point2[0], point2[1]);
stream.lineEnd();
}
point0 = point2;
} else if (notHemisphere && point0 && smallRadius ^ v) {
var t;
// If the codes for two points are different, or are both zero,
// and there this segment intersects with the small circle.
if (!(c & c0) && (t = intersect(point1, point0, true))) {
clean = 0;
if (smallRadius) {
stream.lineStart();
stream.point(t[0][0], t[0][1]);
stream.point(t[1][0], t[1][1]);
stream.lineEnd();
} else {
stream.point(t[1][0], t[1][1]);
stream.lineEnd();
stream.lineStart();
stream.point(t[0][0], t[0][1]);
}
}
}
if (v && (!point0 || !pointEqual(point0, point1))) {
stream.point(point1[0], point1[1]);
}
point0 = point1, v0 = v, c0 = c;
},
lineEnd: function() {
if (v0) stream.lineEnd();
point0 = null;
},
// Rejoin first and last segments if there were intersections and the first
// and last points were visible.
clean: function() {
return clean | ((v00 && v0) << 1);
}
};
}
// Intersects the great circle between a and b with the clip circle.
function intersect(a, b, two) {
var pa = cartesian(a),
pb = cartesian(b);
// We have two planes, n1.p = d1 and n2.p = d2.
// Find intersection line p(t) = c1 n1 + c2 n2 + t (n1 n2).
var n1 = [1, 0, 0], // normal
n2 = cartesianCross(pa, pb),
n2n2 = cartesianDot(n2, n2),
n1n2 = n2[0], // cartesianDot(n1, n2),
determinant = n2n2 - n1n2 * n1n2;
// Two polar points.
if (!determinant) return !two && a;
var c1 = cr * n2n2 / determinant,
c2 = -cr * n1n2 / determinant,
n1xn2 = cartesianCross(n1, n2),
A = cartesianScale(n1, c1),
B = cartesianScale(n2, c2);
cartesianAddInPlace(A, B);
// Solve |p(t)|^2 = 1.
var u = n1xn2,
w = cartesianDot(A, u),
uu = cartesianDot(u, u),
t2 = w * w - uu * (cartesianDot(A, A) - 1);
if (t2 < 0) return;
var t = sqrt(t2),
q = cartesianScale(u, (-w - t) / uu);
cartesianAddInPlace(q, A);
q = spherical(q);
if (!two) return q;
// Two intersection points.
var lambda0 = a[0],
lambda1 = b[0],
phi0 = a[1],
phi1 = b[1],
z;
if (lambda1 < lambda0) z = lambda0, lambda0 = lambda1, lambda1 = z;
var delta = lambda1 - lambda0,
polar = abs(delta - pi$3) < epsilon$2,
meridian = polar || delta < epsilon$2;
if (!polar && phi1 < phi0) z = phi0, phi0 = phi1, phi1 = z;
// Check that the first point is between a and b.
if (meridian
? polar
? phi0 + phi1 > 0 ^ q[1] < (abs(q[0] - lambda0) < epsilon$2 ? phi0 : phi1)
: phi0 <= q[1] && q[1] <= phi1
: delta > pi$3 ^ (lambda0 <= q[0] && q[0] <= lambda1)) {
var q1 = cartesianScale(u, (-w + t) / uu);
cartesianAddInPlace(q1, A);
return [q, spherical(q1)];
}
}
// Generates a 4-bit vector representing the location of a point relative to
// the small circle's bounding box.
function code(lambda, phi) {
var r = smallRadius ? radius : pi$3 - radius,
code = 0;
if (lambda < -r) code |= 1; // left
else if (lambda > r) code |= 2; // right
if (phi < -r) code |= 4; // below
else if (phi > r) code |= 8; // above
return code;
}
return clip(visible, clipLine, interpolate, smallRadius ? [0, -radius] : [-pi$3, radius - pi$3]);
};
var transform = function(methods) {
return {
stream: transformer(methods)
};
};
function transformer(methods) {
return function(stream) {
var s = new TransformStream;
for (var key in methods) s[key] = methods[key];
s.stream = stream;
return s;
};
}
function TransformStream() {}
TransformStream.prototype = {
constructor: TransformStream,
point: function(x, y) { this.stream.point(x, y); },
sphere: function() { this.stream.sphere(); },
lineStart: function() { this.stream.lineStart(); },
lineEnd: function() { this.stream.lineEnd(); },
polygonStart: function() { this.stream.polygonStart(); },
polygonEnd: function() { this.stream.polygonEnd(); }
};
function fitExtent(projection, extent, object) {
var w = extent[1][0] - extent[0][0],
h = extent[1][1] - extent[0][1],
clip = projection.clipExtent && projection.clipExtent();
projection
.scale(150)
.translate([0, 0]);
if (clip != null) projection.clipExtent(null);
geoStream(object, projection.stream(boundsStream$1));
var b = boundsStream$1.result(),
k = Math.min(w / (b[1][0] - b[0][0]), h / (b[1][1] - b[0][1])),
x = +extent[0][0] + (w - k * (b[1][0] + b[0][0])) / 2,
y = +extent[0][1] + (h - k * (b[1][1] + b[0][1])) / 2;
if (clip != null) projection.clipExtent(clip);
return projection
.scale(k * 150)
.translate([x, y]);
}
function fitSize(projection, size, object) {
return fitExtent(projection, [[0, 0], size], object);
}
var maxDepth = 16;
var cosMinDistance = cos$1(30 * radians); // cos(minimum angular distance)
var resample = function(project, delta2) {
return +delta2 ? resample$1(project, delta2) : resampleNone(project);
};
function resampleNone(project) {
return transformer({
point: function(x, y) {
x = project(x, y);
this.stream.point(x[0], x[1]);
}
});
}
function resample$1(project, delta2) {
function resampleLineTo(x0, y0, lambda0, a0, b0, c0, x1, y1, lambda1, a1, b1, c1, depth, stream) {
var dx = x1 - x0,
dy = y1 - y0,
d2 = dx * dx + dy * dy;
if (d2 > 4 * delta2 && depth--) {
var a = a0 + a1,
b = b0 + b1,
c = c0 + c1,
m = sqrt(a * a + b * b + c * c),
phi2 = asin(c /= m),
lambda2 = abs(abs(c) - 1) < epsilon$2 || abs(lambda0 - lambda1) < epsilon$2 ? (lambda0 + lambda1) / 2 : atan2(b, a),
p = project(lambda2, phi2),
x2 = p[0],
y2 = p[1],
dx2 = x2 - x0,
dy2 = y2 - y0,
dz = dy * dx2 - dx * dy2;
if (dz * dz / d2 > delta2 // perpendicular projected distance
|| abs((dx * dx2 + dy * dy2) / d2 - 0.5) > 0.3 // midpoint close to an end
|| a0 * a1 + b0 * b1 + c0 * c1 < cosMinDistance) { // angular distance
resampleLineTo(x0, y0, lambda0, a0, b0, c0, x2, y2, lambda2, a /= m, b /= m, c, depth, stream);
stream.point(x2, y2);
resampleLineTo(x2, y2, lambda2, a, b, c, x1, y1, lambda1, a1, b1, c1, depth, stream);
}
}
}
return function(stream) {
var lambda00, x00, y00, a00, b00, c00, // first point
lambda0, x0, y0, a0, b0, c0; // previous point
var resampleStream = {
point: point,
lineStart: lineStart,
lineEnd: lineEnd,
polygonStart: function() { stream.polygonStart(); resampleStream.lineStart = ringStart; },
polygonEnd: function() { stream.polygonEnd(); resampleStream.lineStart = lineStart; }
};
function point(x, y) {
x = project(x, y);
stream.point(x[0], x[1]);
}
function lineStart() {
x0 = NaN;
resampleStream.point = linePoint;
stream.lineStart();
}
function linePoint(lambda, phi) {
var c = cartesian([lambda, phi]), p = project(lambda, phi);
resampleLineTo(x0, y0, lambda0, a0, b0, c0, x0 = p[0], y0 = p[1], lambda0 = lambda, a0 = c[0], b0 = c[1], c0 = c[2], maxDepth, stream);
stream.point(x0, y0);
}
function lineEnd() {
resampleStream.point = point;
stream.lineEnd();
}
function ringStart() {
lineStart();
resampleStream.point = ringPoint;
resampleStream.lineEnd = ringEnd;
}
function ringPoint(lambda, phi) {
linePoint(lambda00 = lambda, phi), x00 = x0, y00 = y0, a00 = a0, b00 = b0, c00 = c0;
resampleStream.point = linePoint;
}
function ringEnd() {
resampleLineTo(x0, y0, lambda0, a0, b0, c0, x00, y00, lambda00, a00, b00, c00, maxDepth, stream);
resampleStream.lineEnd = lineEnd;
lineEnd();
}
return resampleStream;
};
}
var transformRadians = transformer({
point: function(x, y) {
this.stream.point(x * radians, y * radians);
}
});
function projection(project) {
return projectionMutator(function() { return project; })();
}
function projectionMutator(projectAt) {
var project,
k = 150, // scale
x = 480, y = 250, // translate
dx, dy, lambda = 0, phi = 0, // center
deltaLambda = 0, deltaPhi = 0, deltaGamma = 0, rotate, projectRotate, // rotate
theta = null, preclip = clipAntimeridian, // clip angle
x0 = null, y0, x1, y1, postclip = identity$4, // clip extent
delta2 = 0.5, projectResample = resample(projectTransform, delta2), // precision
cache,
cacheStream;
function projection(point) {
point = projectRotate(point[0] * radians, point[1] * radians);
return [point[0] * k + dx, dy - point[1] * k];
}
function invert(point) {
point = projectRotate.invert((point[0] - dx) / k, (dy - point[1]) / k);
return point && [point[0] * degrees$1, point[1] * degrees$1];
}
function projectTransform(x, y) {
return x = project(x, y), [x[0] * k + dx, dy - x[1] * k];
}
projection.stream = function(stream) {
return cache && cacheStream === stream ? cache : cache = transformRadians(preclip(rotate, projectResample(postclip(cacheStream = stream))));
};
projection.clipAngle = function(_) {
return arguments.length ? (preclip = +_ ? clipCircle(theta = _ * radians, 6 * radians) : (theta = null, clipAntimeridian), reset()) : theta * degrees$1;
};
projection.clipExtent = function(_) {
return arguments.length ? (postclip = _ == null ? (x0 = y0 = x1 = y1 = null, identity$4) : clipExtent(x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1]), reset()) : x0 == null ? null : [[x0, y0], [x1, y1]];
};
projection.scale = function(_) {
return arguments.length ? (k = +_, recenter()) : k;
};
projection.translate = function(_) {
return arguments.length ? (x = +_[0], y = +_[1], recenter()) : [x, y];
};
projection.center = function(_) {
return arguments.length ? (lambda = _[0] % 360 * radians, phi = _[1] % 360 * radians, recenter()) : [lambda * degrees$1, phi * degrees$1];
};
projection.rotate = function(_) {
return arguments.length ? (deltaLambda = _[0] % 360 * radians, deltaPhi = _[1] % 360 * radians, deltaGamma = _.length > 2 ? _[2] % 360 * radians : 0, recenter()) : [deltaLambda * degrees$1, deltaPhi * degrees$1, deltaGamma * degrees$1];
};
projection.precision = function(_) {
return arguments.length ? (projectResample = resample(projectTransform, delta2 = _ * _), reset()) : sqrt(delta2);
};
projection.fitExtent = function(extent, object) {
return fitExtent(projection, extent, object);
};
projection.fitSize = function(size, object) {
return fitSize(projection, size, object);
};
function recenter() {
projectRotate = compose(rotate = rotateRadians(deltaLambda, deltaPhi, deltaGamma), project);
var center = project(lambda, phi);
dx = x - center[0] * k;
dy = y + center[1] * k;
return reset();
}
function reset() {
cache = cacheStream = null;
return projection;
}
return function() {
project = projectAt.apply(this, arguments);
projection.invert = project.invert && invert;
return recenter();
};
}
function conicProjection(projectAt) {
var phi0 = 0,
phi1 = pi$3 / 3,
m = projectionMutator(projectAt),
p = m(phi0, phi1);
p.parallels = function(_) {
return arguments.length ? m(phi0 = _[0] * radians, phi1 = _[1] * radians) : [phi0 * degrees$1, phi1 * degrees$1];
};
return p;
}
function cylindricalEqualAreaRaw(phi0) {
var cosPhi0 = cos$1(phi0);
function forward(lambda, phi) {
return [lambda * cosPhi0, sin$1(phi) / cosPhi0];
}
forward.invert = function(x, y) {
return [x / cosPhi0, asin(y * cosPhi0)];
};
return forward;
}
function conicEqualAreaRaw(y0, y1) {
var sy0 = sin$1(y0), n = (sy0 + sin$1(y1)) / 2;
// Are the parallels symmetrical around the Equator?
if (abs(n) < epsilon$2) return cylindricalEqualAreaRaw(y0);
var c = 1 + sy0 * (2 * n - sy0), r0 = sqrt(c) / n;
function project(x, y) {
var r = sqrt(c - 2 * n * sin$1(y)) / n;
return [r * sin$1(x *= n), r0 - r * cos$1(x)];
}
project.invert = function(x, y) {
var r0y = r0 - y;
return [atan2(x, abs(r0y)) / n * sign(r0y), asin((c - (x * x + r0y * r0y) * n * n) / (2 * n))];
};
return project;
}
var conicEqualArea = function() {
return conicProjection(conicEqualAreaRaw)
.scale(155.424)
.center([0, 33.6442]);
};
var albers = function() {
return conicEqualArea()
.parallels([29.5, 45.5])
.scale(1070)
.translate([480, 250])
.rotate([96, 0])
.center([-0.6, 38.7]);
};
// The projections must have mutually exclusive clip regions on the sphere,
// as this will avoid emitting interleaving lines and polygons.
function multiplex(streams) {
var n = streams.length;
return {
point: function(x, y) { var i = -1; while (++i < n) streams[i].point(x, y); },
sphere: function() { var i = -1; while (++i < n) streams[i].sphere(); },
lineStart: function() { var i = -1; while (++i < n) streams[i].lineStart(); },
lineEnd: function() { var i = -1; while (++i < n) streams[i].lineEnd(); },
polygonStart: function() { var i = -1; while (++i < n) streams[i].polygonStart(); },
polygonEnd: function() { var i = -1; while (++i < n) streams[i].polygonEnd(); }
};
}
// A composite projection for the United States, configured by default for
// 960×500. The projection also works quite well at 960×600 if you change the
// scale to 1285 and adjust the translate accordingly. The set of standard
// parallels for each region comes from USGS, which is published here:
// http://egsc.usgs.gov/isb/pubs/MapProjections/projections.html#albers
var albersUsa = function() {
var cache,
cacheStream,
lower48 = albers(), lower48Point,
alaska = conicEqualArea().rotate([154, 0]).center([-2, 58.5]).parallels([55, 65]), alaskaPoint, // EPSG:3338
hawaii = conicEqualArea().rotate([157, 0]).center([-3, 19.9]).parallels([8, 18]), hawaiiPoint, // ESRI:102007
point, pointStream = {point: function(x, y) { point = [x, y]; }};
function albersUsa(coordinates) {
var x = coordinates[0], y = coordinates[1];
return point = null,
(lower48Point.point(x, y), point)
|| (alaskaPoint.point(x, y), point)
|| (hawaiiPoint.point(x, y), point);
}
albersUsa.invert = function(coordinates) {
var k = lower48.scale(),
t = lower48.translate(),
x = (coordinates[0] - t[0]) / k,
y = (coordinates[1] - t[1]) / k;
return (y >= 0.120 && y < 0.234 && x >= -0.425 && x < -0.214 ? alaska
: y >= 0.166 && y < 0.234 && x >= -0.214 && x < -0.115 ? hawaii
: lower48).invert(coordinates);
};
albersUsa.stream = function(stream) {
return cache && cacheStream === stream ? cache : cache = multiplex([lower48.stream(cacheStream = stream), alaska.stream(stream), hawaii.stream(stream)]);
};
albersUsa.precision = function(_) {
if (!arguments.length) return lower48.precision();
lower48.precision(_), alaska.precision(_), hawaii.precision(_);
return reset();
};
albersUsa.scale = function(_) {
if (!arguments.length) return lower48.scale();
lower48.scale(_), alaska.scale(_ * 0.35), hawaii.scale(_);
return albersUsa.translate(lower48.translate());
};
albersUsa.translate = function(_) {
if (!arguments.length) return lower48.translate();
var k = lower48.scale(), x = +_[0], y = +_[1];
lower48Point = lower48
.translate(_)
.clipExtent([[x - 0.455 * k, y - 0.238 * k], [x + 0.455 * k, y + 0.238 * k]])
.stream(pointStream);
alaskaPoint = alaska
.translate([x - 0.307 * k, y + 0.201 * k])
.clipExtent([[x - 0.425 * k + epsilon$2, y + 0.120 * k + epsilon$2], [x - 0.214 * k - epsilon$2, y + 0.234 * k - epsilon$2]])
.stream(pointStream);
hawaiiPoint = hawaii
.translate([x - 0.205 * k, y + 0.212 * k])
.clipExtent([[x - 0.214 * k + epsilon$2, y + 0.166 * k + epsilon$2], [x - 0.115 * k - epsilon$2, y + 0.234 * k - epsilon$2]])
.stream(pointStream);
return reset();
};
albersUsa.fitExtent = function(extent, object) {
return fitExtent(albersUsa, extent, object);
};
albersUsa.fitSize = function(size, object) {
return fitSize(albersUsa, size, object);
};
function reset() {
cache = cacheStream = null;
return albersUsa;
}
return albersUsa.scale(1070);
};
function azimuthalRaw(scale) {
return function(x, y) {
var cx = cos$1(x),
cy = cos$1(y),
k = scale(cx * cy);
return [
k * cy * sin$1(x),
k * sin$1(y)
];
}
}
function azimuthalInvert(angle) {
return function(x, y) {
var z = sqrt(x * x + y * y),
c = angle(z),
sc = sin$1(c),
cc = cos$1(c);
return [
atan2(x * sc, z * cc),
asin(z && y * sc / z)
];
}
}
var azimuthalEqualAreaRaw = azimuthalRaw(function(cxcy) {
return sqrt(2 / (1 + cxcy));
});
azimuthalEqualAreaRaw.invert = azimuthalInvert(function(z) {
return 2 * asin(z / 2);
});
var azimuthalEqualArea = function() {
return projection(azimuthalEqualAreaRaw)
.scale(124.75)
.clipAngle(180 - 1e-3);
};
var azimuthalEquidistantRaw = azimuthalRaw(function(c) {
return (c = acos(c)) && c / sin$1(c);
});
azimuthalEquidistantRaw.invert = azimuthalInvert(function(z) {
return z;
});
var azimuthalEquidistant = function() {
return projection(azimuthalEquidistantRaw)
.scale(79.4188)
.clipAngle(180 - 1e-3);
};
function mercatorRaw(lambda, phi) {
return [lambda, log(tan((halfPi$2 + phi) / 2))];
}
mercatorRaw.invert = function(x, y) {
return [x, 2 * atan(exp(y)) - halfPi$2];
};
var mercator = function() {
return mercatorProjection(mercatorRaw)
.scale(961 / tau$3);
};
function mercatorProjection(project) {
var m = projection(project),
center = m.center,
scale = m.scale,
translate = m.translate,
clipExtent = m.clipExtent,
x0 = null, y0, x1, y1; // clip extent
m.scale = function(_) {
return arguments.length ? (scale(_), reclip()) : scale();
};
m.translate = function(_) {
return arguments.length ? (translate(_), reclip()) : translate();
};
m.center = function(_) {
return arguments.length ? (center(_), reclip()) : center();
};
m.clipExtent = function(_) {
return arguments.length ? ((_ == null ? x0 = y0 = x1 = y1 = null : (x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1])), reclip()) : x0 == null ? null : [[x0, y0], [x1, y1]];
};
function reclip() {
var k = pi$3 * scale(),
t = m(rotation(m.rotate()).invert([0, 0]));
return clipExtent(x0 == null
? [[t[0] - k, t[1] - k], [t[0] + k, t[1] + k]] : project === mercatorRaw
? [[Math.max(t[0] - k, x0), y0], [Math.min(t[0] + k, x1), y1]]
: [[x0, Math.max(t[1] - k, y0)], [x1, Math.min(t[1] + k, y1)]]);
}
return reclip();
}
function tany(y) {
return tan((halfPi$2 + y) / 2);
}
function conicConformalRaw(y0, y1) {
var cy0 = cos$1(y0),
n = y0 === y1 ? sin$1(y0) : log(cy0 / cos$1(y1)) / log(tany(y1) / tany(y0)),
f = cy0 * pow(tany(y0), n) / n;
if (!n) return mercatorRaw;
function project(x, y) {
if (f > 0) { if (y < -halfPi$2 + epsilon$2) y = -halfPi$2 + epsilon$2; }
else { if (y > halfPi$2 - epsilon$2) y = halfPi$2 - epsilon$2; }
var r = f / pow(tany(y), n);
return [r * sin$1(n * x), f - r * cos$1(n * x)];
}
project.invert = function(x, y) {
var fy = f - y, r = sign(n) * sqrt(x * x + fy * fy);
return [atan2(x, abs(fy)) / n * sign(fy), 2 * atan(pow(f / r, 1 / n)) - halfPi$2];
};
return project;
}
var conicConformal = function() {
return conicProjection(conicConformalRaw)
.scale(109.5)
.parallels([30, 30]);
};
function equirectangularRaw(lambda, phi) {
return [lambda, phi];
}
equirectangularRaw.invert = equirectangularRaw;
var equirectangular = function() {
return projection(equirectangularRaw)
.scale(152.63);
};
function conicEquidistantRaw(y0, y1) {
var cy0 = cos$1(y0),
n = y0 === y1 ? sin$1(y0) : (cy0 - cos$1(y1)) / (y1 - y0),
g = cy0 / n + y0;
if (abs(n) < epsilon$2) return equirectangularRaw;
function project(x, y) {
var gy = g - y, nx = n * x;
return [gy * sin$1(nx), g - gy * cos$1(nx)];
}
project.invert = function(x, y) {
var gy = g - y;
return [atan2(x, abs(gy)) / n * sign(gy), g - sign(n) * sqrt(x * x + gy * gy)];
};
return project;
}
var conicEquidistant = function() {
return conicProjection(conicEquidistantRaw)
.scale(131.154)
.center([0, 13.9389]);
};
function gnomonicRaw(x, y) {
var cy = cos$1(y), k = cos$1(x) * cy;
return [cy * sin$1(x) / k, sin$1(y) / k];
}
gnomonicRaw.invert = azimuthalInvert(atan);
var gnomonic = function() {
return projection(gnomonicRaw)
.scale(144.049)
.clipAngle(60);
};
function scaleTranslate(kx, ky, tx, ty) {
return kx === 1 && ky === 1 && tx === 0 && ty === 0 ? identity$4 : transformer({
point: function(x, y) {
this.stream.point(x * kx + tx, y * ky + ty);
}
});
}
var identity$5 = function() {
var k = 1, tx = 0, ty = 0, sx = 1, sy = 1, transform = identity$4, // scale, translate and reflect
x0 = null, y0, x1, y1, clip = identity$4, // clip extent
cache,
cacheStream,
projection;
function reset() {
cache = cacheStream = null;
return projection;
}
return projection = {
stream: function(stream) {
return cache && cacheStream === stream ? cache : cache = transform(clip(cacheStream = stream));
},
clipExtent: function(_) {
return arguments.length ? (clip = _ == null ? (x0 = y0 = x1 = y1 = null, identity$4) : clipExtent(x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1]), reset()) : x0 == null ? null : [[x0, y0], [x1, y1]];
},
scale: function(_) {
return arguments.length ? (transform = scaleTranslate((k = +_) * sx, k * sy, tx, ty), reset()) : k;
},
translate: function(_) {
return arguments.length ? (transform = scaleTranslate(k * sx, k * sy, tx = +_[0], ty = +_[1]), reset()) : [tx, ty];
},
reflectX: function(_) {
return arguments.length ? (transform = scaleTranslate(k * (sx = _ ? -1 : 1), k * sy, tx, ty), reset()) : sx < 0;
},
reflectY: function(_) {
return arguments.length ? (transform = scaleTranslate(k * sx, k * (sy = _ ? -1 : 1), tx, ty), reset()) : sy < 0;
},
fitExtent: function(extent, object) {
return fitExtent(projection, extent, object);
},
fitSize: function(size, object) {
return fitSize(projection, size, object);
}
};
};
function orthographicRaw(x, y) {
return [cos$1(y) * sin$1(x), sin$1(y)];
}
orthographicRaw.invert = azimuthalInvert(asin);
var orthographic = function() {
return projection(orthographicRaw)
.scale(249.5)
.clipAngle(90 + epsilon$2);
};
function stereographicRaw(x, y) {
var cy = cos$1(y), k = 1 + cos$1(x) * cy;
return [cy * sin$1(x) / k, sin$1(y) / k];
}
stereographicRaw.invert = azimuthalInvert(function(z) {
return 2 * atan(z);
});
var stereographic = function() {
return projection(stereographicRaw)
.scale(250)
.clipAngle(142);
};
function transverseMercatorRaw(lambda, phi) {
return [log(tan((halfPi$2 + phi) / 2)), -lambda];
}
transverseMercatorRaw.invert = function(x, y) {
return [-y, 2 * atan(exp(x)) - halfPi$2];
};
var transverseMercator = function() {
var m = mercatorProjection(transverseMercatorRaw),
center = m.center,
rotate = m.rotate;
m.center = function(_) {
return arguments.length ? center([-_[1], _[0]]) : (_ = center(), [_[1], -_[0]]);
};
m.rotate = function(_) {
return arguments.length ? rotate([_[0], _[1], _.length > 2 ? _[2] + 90 : 90]) : (_ = rotate(), [_[0], _[1], _[2] - 90]);
};
return rotate([0, 0, 90])
.scale(159.155);
};
function defaultSeparation(a, b) {
return a.parent === b.parent ? 1 : 2;
}
function meanX(children) {
return children.reduce(meanXReduce, 0) / children.length;
}
function meanXReduce(x, c) {
return x + c.x;
}
function maxY(children) {
return 1 + children.reduce(maxYReduce, 0);
}
function maxYReduce(y, c) {
return Math.max(y, c.y);
}
function leafLeft(node) {
var children;
while (children = node.children) node = children[0];
return node;
}
function leafRight(node) {
var children;
while (children = node.children) node = children[children.length - 1];
return node;
}
var cluster = function() {
var separation = defaultSeparation,
dx = 1,
dy = 1,
nodeSize = false;
function cluster(root) {
var previousNode,
x = 0;
// First walk, computing the initial x & y values.
root.eachAfter(function(node) {
var children = node.children;
if (children) {
node.x = meanX(children);
node.y = maxY(children);
} else {
node.x = previousNode ? x += separation(node, previousNode) : 0;
node.y = 0;
previousNode = node;
}
});
var left = leafLeft(root),
right = leafRight(root),
x0 = left.x - separation(left, right) / 2,
x1 = right.x + separation(right, left) / 2;
// Second walk, normalizing x & y to the desired size.
return root.eachAfter(nodeSize ? function(node) {
node.x = (node.x - root.x) * dx;
node.y = (root.y - node.y) * dy;
} : function(node) {
node.x = (node.x - x0) / (x1 - x0) * dx;
node.y = (1 - (root.y ? node.y / root.y : 1)) * dy;
});
}
cluster.separation = function(x) {
return arguments.length ? (separation = x, cluster) : separation;
};
cluster.size = function(x) {
return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], cluster) : (nodeSize ? null : [dx, dy]);
};
cluster.nodeSize = function(x) {
return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], cluster) : (nodeSize ? [dx, dy] : null);
};
return cluster;
};
function count(node) {
var sum = 0,
children = node.children,
i = children && children.length;
if (!i) sum = 1;
else while (--i >= 0) sum += children[i].value;
node.value = sum;
}
var node_count = function() {
return this.eachAfter(count);
};
var node_each = function(callback) {
var node = this, current, next = [node], children, i, n;
do {
current = next.reverse(), next = [];
while (node = current.pop()) {
callback(node), children = node.children;
if (children) for (i = 0, n = children.length; i < n; ++i) {
next.push(children[i]);
}
}
} while (next.length);
return this;
};
var node_eachBefore = function(callback) {
var node = this, nodes = [node], children, i;
while (node = nodes.pop()) {
callback(node), children = node.children;
if (children) for (i = children.length - 1; i >= 0; --i) {
nodes.push(children[i]);
}
}
return this;
};
var node_eachAfter = function(callback) {
var node = this, nodes = [node], next = [], children, i, n;
while (node = nodes.pop()) {
next.push(node), children = node.children;
if (children) for (i = 0, n = children.length; i < n; ++i) {
nodes.push(children[i]);
}
}
while (node = next.pop()) {
callback(node);
}
return this;
};
var node_sum = function(value) {
return this.eachAfter(function(node) {
var sum = +value(node.data) || 0,
children = node.children,
i = children && children.length;
while (--i >= 0) sum += children[i].value;
node.value = sum;
});
};
var node_sort = function(compare) {
return this.eachBefore(function(node) {
if (node.children) {
node.children.sort(compare);
}
});
};
var node_path = function(end) {
var start = this,
ancestor = leastCommonAncestor(start, end),
nodes = [start];
while (start !== ancestor) {
start = start.parent;
nodes.push(start);
}
var k = nodes.length;
while (end !== ancestor) {
nodes.splice(k, 0, end);
end = end.parent;
}
return nodes;
};
function leastCommonAncestor(a, b) {
if (a === b) return a;
var aNodes = a.ancestors(),
bNodes = b.ancestors(),
c = null;
a = aNodes.pop();
b = bNodes.pop();
while (a === b) {
c = a;
a = aNodes.pop();
b = bNodes.pop();
}
return c;
}
var node_ancestors = function() {
var node = this, nodes = [node];
while (node = node.parent) {
nodes.push(node);
}
return nodes;
};
var node_descendants = function() {
var nodes = [];
this.each(function(node) {
nodes.push(node);
});
return nodes;
};
var node_leaves = function() {
var leaves = [];
this.eachBefore(function(node) {
if (!node.children) {
leaves.push(node);
}
});
return leaves;
};
var node_links = function() {
var root = this, links = [];
root.each(function(node) {
if (node !== root) { // Dont include the roots parent, if any.
links.push({source: node.parent, target: node});
}
});
return links;
};
function hierarchy(data, children) {
var root = new Node(data),
valued = +data.value && (root.value = data.value),
node,
nodes = [root],
child,
childs,
i,
n;
if (children == null) children = defaultChildren;
while (node = nodes.pop()) {
if (valued) node.value = +node.data.value;
if ((childs = children(node.data)) && (n = childs.length)) {
node.children = new Array(n);
for (i = n - 1; i >= 0; --i) {
nodes.push(child = node.children[i] = new Node(childs[i]));
child.parent = node;
child.depth = node.depth + 1;
}
}
}
return root.eachBefore(computeHeight);
}
function node_copy() {
return hierarchy(this).eachBefore(copyData);
}
function defaultChildren(d) {
return d.children;
}
function copyData(node) {
node.data = node.data.data;
}
function computeHeight(node) {
var height = 0;
do node.height = height;
while ((node = node.parent) && (node.height < ++height));
}
function Node(data) {
this.data = data;
this.depth =
this.height = 0;
this.parent = null;
}
Node.prototype = hierarchy.prototype = {
constructor: Node,
count: node_count,
each: node_each,
eachAfter: node_eachAfter,
eachBefore: node_eachBefore,
sum: node_sum,
sort: node_sort,
path: node_path,
ancestors: node_ancestors,
descendants: node_descendants,
leaves: node_leaves,
links: node_links,
copy: node_copy
};
function Node$2(value) {
this._ = value;
this.next = null;
}
var shuffle$1 = function(array) {
var i,
n = (array = array.slice()).length,
head = null,
node = head;
while (n) {
var next = new Node$2(array[n - 1]);
if (node) node = node.next = next;
else node = head = next;
array[i] = array[--n];
}
return {
head: head,
tail: node
};
};
var enclose = function(circles) {
return encloseN(shuffle$1(circles), []);
};
function encloses(a, b) {
var dx = b.x - a.x,
dy = b.y - a.y,
dr = a.r - b.r;
return dr * dr + 1e-6 > dx * dx + dy * dy;
}
// Returns the smallest circle that contains circles L and intersects circles B.
function encloseN(L, B) {
var circle,
l0 = null,
l1 = L.head,
l2,
p1;
switch (B.length) {
case 1: circle = enclose1(B[0]); break;
case 2: circle = enclose2(B[0], B[1]); break;
case 3: circle = enclose3(B[0], B[1], B[2]); break;
}
while (l1) {
p1 = l1._, l2 = l1.next;
if (!circle || !encloses(circle, p1)) {
// Temporarily truncate L before l1.
if (l0) L.tail = l0, l0.next = null;
else L.head = L.tail = null;
B.push(p1);
circle = encloseN(L, B); // Note: reorders L!
B.pop();
// Move l1 to the front of L and reconnect the truncated list L.
if (L.head) l1.next = L.head, L.head = l1;
else l1.next = null, L.head = L.tail = l1;
l0 = L.tail, l0.next = l2;
} else {
l0 = l1;
}
l1 = l2;
}
L.tail = l0;
return circle;
}
function enclose1(a) {
return {
x: a.x,
y: a.y,
r: a.r
};
}
function enclose2(a, b) {
var x1 = a.x, y1 = a.y, r1 = a.r,
x2 = b.x, y2 = b.y, r2 = b.r,
x21 = x2 - x1, y21 = y2 - y1, r21 = r2 - r1,
l = Math.sqrt(x21 * x21 + y21 * y21);
return {
x: (x1 + x2 + x21 / l * r21) / 2,
y: (y1 + y2 + y21 / l * r21) / 2,
r: (l + r1 + r2) / 2
};
}
function enclose3(a, b, c) {
var x1 = a.x, y1 = a.y, r1 = a.r,
x2 = b.x, y2 = b.y, r2 = b.r,
x3 = c.x, y3 = c.y, r3 = c.r,
a2 = 2 * (x1 - x2),
b2 = 2 * (y1 - y2),
c2 = 2 * (r2 - r1),
d2 = x1 * x1 + y1 * y1 - r1 * r1 - x2 * x2 - y2 * y2 + r2 * r2,
a3 = 2 * (x1 - x3),
b3 = 2 * (y1 - y3),
c3 = 2 * (r3 - r1),
d3 = x1 * x1 + y1 * y1 - r1 * r1 - x3 * x3 - y3 * y3 + r3 * r3,
ab = a3 * b2 - a2 * b3,
xa = (b2 * d3 - b3 * d2) / ab - x1,
xb = (b3 * c2 - b2 * c3) / ab,
ya = (a3 * d2 - a2 * d3) / ab - y1,
yb = (a2 * c3 - a3 * c2) / ab,
A = xb * xb + yb * yb - 1,
B = 2 * (xa * xb + ya * yb + r1),
C = xa * xa + ya * ya - r1 * r1,
r = (-B - Math.sqrt(B * B - 4 * A * C)) / (2 * A);
return {
x: xa + xb * r + x1,
y: ya + yb * r + y1,
r: r
};
}
function place(a, b, c) {
var ax = a.x,
ay = a.y,
da = b.r + c.r,
db = a.r + c.r,
dx = b.x - ax,
dy = b.y - ay,
dc = dx * dx + dy * dy;
if (dc) {
var x = 0.5 + ((db *= db) - (da *= da)) / (2 * dc),
y = Math.sqrt(Math.max(0, 2 * da * (db + dc) - (db -= dc) * db - da * da)) / (2 * dc);
c.x = ax + x * dx + y * dy;
c.y = ay + x * dy - y * dx;
} else {
c.x = ax + db;
c.y = ay;
}
}
function intersects(a, b) {
var dx = b.x - a.x,
dy = b.y - a.y,
dr = a.r + b.r;
return dr * dr - 1e-6 > dx * dx + dy * dy;
}
function distance2(node, x, y) {
var a = node._,
b = node.next._,
ab = a.r + b.r,
dx = (a.x * b.r + b.x * a.r) / ab - x,
dy = (a.y * b.r + b.y * a.r) / ab - y;
return dx * dx + dy * dy;
}
function Node$1(circle) {
this._ = circle;
this.next = null;
this.previous = null;
}
function packEnclose(circles) {
if (!(n = circles.length)) return 0;
var a, b, c, n;
// Place the first circle.
a = circles[0], a.x = 0, a.y = 0;
if (!(n > 1)) return a.r;
// Place the second circle.
b = circles[1], a.x = -b.r, b.x = a.r, b.y = 0;
if (!(n > 2)) return a.r + b.r;
// Place the third circle.
place(b, a, c = circles[2]);
// Initialize the weighted centroid.
var aa = a.r * a.r,
ba = b.r * b.r,
ca = c.r * c.r,
oa = aa + ba + ca,
ox = aa * a.x + ba * b.x + ca * c.x,
oy = aa * a.y + ba * b.y + ca * c.y,
cx, cy, i, j, k, sj, sk;
// Initialize the front-chain using the first three circles a, b and c.
a = new Node$1(a), b = new Node$1(b), c = new Node$1(c);
a.next = c.previous = b;
b.next = a.previous = c;
c.next = b.previous = a;
// Attempt to place each remaining circle…
pack: for (i = 3; i < n; ++i) {
place(a._, b._, c = circles[i]), c = new Node$1(c);
// Find the closest intersecting circle on the front-chain, if any.
// “Closeness” is determined by linear distance along the front-chain.
// “Ahead” or “behind” is likewise determined by linear distance.
j = b.next, k = a.previous, sj = b._.r, sk = a._.r;
do {
if (sj <= sk) {
if (intersects(j._, c._)) {
b = j, a.next = b, b.previous = a, --i;
continue pack;
}
sj += j._.r, j = j.next;
} else {
if (intersects(k._, c._)) {
a = k, a.next = b, b.previous = a, --i;
continue pack;
}
sk += k._.r, k = k.previous;
}
} while (j !== k.next);
// Success! Insert the new circle c between a and b.
c.previous = a, c.next = b, a.next = b.previous = b = c;
// Update the weighted centroid.
oa += ca = c._.r * c._.r;
ox += ca * c._.x;
oy += ca * c._.y;
// Compute the new closest circle pair to the centroid.
aa = distance2(a, cx = ox / oa, cy = oy / oa);
while ((c = c.next) !== b) {
if ((ca = distance2(c, cx, cy)) < aa) {
a = c, aa = ca;
}
}
b = a.next;
}
// Compute the enclosing circle of the front chain.
a = [b._], c = b; while ((c = c.next) !== b) a.push(c._); c = enclose(a);
// Translate the circles to put the enclosing circle around the origin.
for (i = 0; i < n; ++i) a = circles[i], a.x -= c.x, a.y -= c.y;
return c.r;
}
var siblings = function(circles) {
packEnclose(circles);
return circles;
};
function optional(f) {
return f == null ? null : required(f);
}
function required(f) {
if (typeof f !== "function") throw new Error;
return f;
}
function constantZero() {
return 0;
}
var constant$8 = function(x) {
return function() {
return x;
};
};
function defaultRadius$1(d) {
return Math.sqrt(d.value);
}
var index$2 = function() {
var radius = null,
dx = 1,
dy = 1,
padding = constantZero;
function pack(root) {
root.x = dx / 2, root.y = dy / 2;
if (radius) {
root.eachBefore(radiusLeaf(radius))
.eachAfter(packChildren(padding, 0.5))
.eachBefore(translateChild(1));
} else {
root.eachBefore(radiusLeaf(defaultRadius$1))
.eachAfter(packChildren(constantZero, 1))
.eachAfter(packChildren(padding, root.r / Math.min(dx, dy)))
.eachBefore(translateChild(Math.min(dx, dy) / (2 * root.r)));
}
return root;
}
pack.radius = function(x) {
return arguments.length ? (radius = optional(x), pack) : radius;
};
pack.size = function(x) {
return arguments.length ? (dx = +x[0], dy = +x[1], pack) : [dx, dy];
};
pack.padding = function(x) {
return arguments.length ? (padding = typeof x === "function" ? x : constant$8(+x), pack) : padding;
};
return pack;
};
function radiusLeaf(radius) {
return function(node) {
if (!node.children) {
node.r = Math.max(0, +radius(node) || 0);
}
};
}
function packChildren(padding, k) {
return function(node) {
if (children = node.children) {
var children,
i,
n = children.length,
r = padding(node) * k || 0,
e;
if (r) for (i = 0; i < n; ++i) children[i].r += r;
e = packEnclose(children);
if (r) for (i = 0; i < n; ++i) children[i].r -= r;
node.r = e + r;
}
};
}
function translateChild(k) {
return function(node) {
var parent = node.parent;
node.r *= k;
if (parent) {
node.x = parent.x + k * node.x;
node.y = parent.y + k * node.y;
}
};
}
var roundNode = function(node) {
node.x0 = Math.round(node.x0);
node.y0 = Math.round(node.y0);
node.x1 = Math.round(node.x1);
node.y1 = Math.round(node.y1);
};
var treemapDice = function(parent, x0, y0, x1, y1) {
var nodes = parent.children,
node,
i = -1,
n = nodes.length,
k = parent.value && (x1 - x0) / parent.value;
while (++i < n) {
node = nodes[i], node.y0 = y0, node.y1 = y1;
node.x0 = x0, node.x1 = x0 += node.value * k;
}
};
var partition = function() {
var dx = 1,
dy = 1,
padding = 0,
round = false;
function partition(root) {
var n = root.height + 1;
root.x0 =
root.y0 = padding;
root.x1 = dx;
root.y1 = dy / n;
root.eachBefore(positionNode(dy, n));
if (round) root.eachBefore(roundNode);
return root;
}
function positionNode(dy, n) {
return function(node) {
if (node.children) {
treemapDice(node, node.x0, dy * (node.depth + 1) / n, node.x1, dy * (node.depth + 2) / n);
}
var x0 = node.x0,
y0 = node.y0,
x1 = node.x1 - padding,
y1 = node.y1 - padding;
if (x1 < x0) x0 = x1 = (x0 + x1) / 2;
if (y1 < y0) y0 = y1 = (y0 + y1) / 2;
node.x0 = x0;
node.y0 = y0;
node.x1 = x1;
node.y1 = y1;
};
}
partition.round = function(x) {
return arguments.length ? (round = !!x, partition) : round;
};
partition.size = function(x) {
return arguments.length ? (dx = +x[0], dy = +x[1], partition) : [dx, dy];
};
partition.padding = function(x) {
return arguments.length ? (padding = +x, partition) : padding;
};
return partition;
};
var keyPrefix$1 = "$";
var preroot = {depth: -1};
var ambiguous = {};
function defaultId(d) {
return d.id;
}
function defaultParentId(d) {
return d.parentId;
}
var stratify = function() {
var id = defaultId,
parentId = defaultParentId;
function stratify(data) {
var d,
i,
n = data.length,
root,
parent,
node,
nodes = new Array(n),
nodeId,
nodeKey,
nodeByKey = {};
for (i = 0; i < n; ++i) {
d = data[i], node = nodes[i] = new Node(d);
if ((nodeId = id(d, i, data)) != null && (nodeId += "")) {
nodeKey = keyPrefix$1 + (node.id = nodeId);
nodeByKey[nodeKey] = nodeKey in nodeByKey ? ambiguous : node;
}
}
for (i = 0; i < n; ++i) {
node = nodes[i], nodeId = parentId(data[i], i, data);
if (nodeId == null || !(nodeId += "")) {
if (root) throw new Error("multiple roots");
root = node;
} else {
parent = nodeByKey[keyPrefix$1 + nodeId];
if (!parent) throw new Error("missing: " + nodeId);
if (parent === ambiguous) throw new Error("ambiguous: " + nodeId);
if (parent.children) parent.children.push(node);
else parent.children = [node];
node.parent = parent;
}
}
if (!root) throw new Error("no root");
root.parent = preroot;
root.eachBefore(function(node) { node.depth = node.parent.depth + 1; --n; }).eachBefore(computeHeight);
root.parent = null;
if (n > 0) throw new Error("cycle");
return root;
}
stratify.id = function(x) {
return arguments.length ? (id = required(x), stratify) : id;
};
stratify.parentId = function(x) {
return arguments.length ? (parentId = required(x), stratify) : parentId;
};
return stratify;
};
function defaultSeparation$1(a, b) {
return a.parent === b.parent ? 1 : 2;
}
// function radialSeparation(a, b) {
// return (a.parent === b.parent ? 1 : 2) / a.depth;
// }
// This function is used to traverse the left contour of a subtree (or
// subforest). It returns the successor of v on this contour. This successor is
// either given by the leftmost child of v or by the thread of v. The function
// returns null if and only if v is on the highest level of its subtree.
function nextLeft(v) {
var children = v.children;
return children ? children[0] : v.t;
}
// This function works analogously to nextLeft.
function nextRight(v) {
var children = v.children;
return children ? children[children.length - 1] : v.t;
}
// Shifts the current subtree rooted at w+. This is done by increasing
// prelim(w+) and mod(w+) by shift.
function moveSubtree(wm, wp, shift) {
var change = shift / (wp.i - wm.i);
wp.c -= change;
wp.s += shift;
wm.c += change;
wp.z += shift;
wp.m += shift;
}
// All other shifts, applied to the smaller subtrees between w- and w+, are
// performed by this function. To prepare the shifts, we have to adjust
// change(w+), shift(w+), and change(w-).
function executeShifts(v) {
var shift = 0,
change = 0,
children = v.children,
i = children.length,
w;
while (--i >= 0) {
w = children[i];
w.z += shift;
w.m += shift;
shift += w.s + (change += w.c);
}
}
// If vi-s ancestor is a sibling of v, returns vi-s ancestor. Otherwise,
// returns the specified (default) ancestor.
function nextAncestor(vim, v, ancestor) {
return vim.a.parent === v.parent ? vim.a : ancestor;
}
function TreeNode(node, i) {
this._ = node;
this.parent = null;
this.children = null;
this.A = null; // default ancestor
this.a = this; // ancestor
this.z = 0; // prelim
this.m = 0; // mod
this.c = 0; // change
this.s = 0; // shift
this.t = null; // thread
this.i = i; // number
}
TreeNode.prototype = Object.create(Node.prototype);
function treeRoot(root) {
var tree = new TreeNode(root, 0),
node,
nodes = [tree],
child,
children,
i,
n;
while (node = nodes.pop()) {
if (children = node._.children) {
node.children = new Array(n = children.length);
for (i = n - 1; i >= 0; --i) {
nodes.push(child = node.children[i] = new TreeNode(children[i], i));
child.parent = node;
}
}
}
(tree.parent = new TreeNode(null, 0)).children = [tree];
return tree;
}
// Node-link tree diagram using the Reingold-Tilford "tidy" algorithm
var tree = function() {
var separation = defaultSeparation$1,
dx = 1,
dy = 1,
nodeSize = null;
function tree(root) {
var t = treeRoot(root);
// Compute the layout using Buchheim et al.s algorithm.
t.eachAfter(firstWalk), t.parent.m = -t.z;
t.eachBefore(secondWalk);
// If a fixed node size is specified, scale x and y.
if (nodeSize) root.eachBefore(sizeNode);
// If a fixed tree size is specified, scale x and y based on the extent.
// Compute the left-most, right-most, and depth-most nodes for extents.
else {
var left = root,
right = root,
bottom = root;
root.eachBefore(function(node) {
if (node.x < left.x) left = node;
if (node.x > right.x) right = node;
if (node.depth > bottom.depth) bottom = node;
});
var s = left === right ? 1 : separation(left, right) / 2,
tx = s - left.x,
kx = dx / (right.x + s + tx),
ky = dy / (bottom.depth || 1);
root.eachBefore(function(node) {
node.x = (node.x + tx) * kx;
node.y = node.depth * ky;
});
}
return root;
}
// Computes a preliminary x-coordinate for v. Before that, FIRST WALK is
// applied recursively to the children of v, as well as the function
// APPORTION. After spacing out the children by calling EXECUTE SHIFTS, the
// node v is placed to the midpoint of its outermost children.
function firstWalk(v) {
var children = v.children,
siblings = v.parent.children,
w = v.i ? siblings[v.i - 1] : null;
if (children) {
executeShifts(v);
var midpoint = (children[0].z + children[children.length - 1].z) / 2;
if (w) {
v.z = w.z + separation(v._, w._);
v.m = v.z - midpoint;
} else {
v.z = midpoint;
}
} else if (w) {
v.z = w.z + separation(v._, w._);
}
v.parent.A = apportion(v, w, v.parent.A || siblings[0]);
}
// Computes all real x-coordinates by summing up the modifiers recursively.
function secondWalk(v) {
v._.x = v.z + v.parent.m;
v.m += v.parent.m;
}
// The core of the algorithm. Here, a new subtree is combined with the
// previous subtrees. Threads are used to traverse the inside and outside
// contours of the left and right subtree up to the highest common level. The
// vertices used for the traversals are vi+, vi-, vo-, and vo+, where the
// superscript o means outside and i means inside, the subscript - means left
// subtree and + means right subtree. For summing up the modifiers along the
// contour, we use respective variables si+, si-, so-, and so+. Whenever two
// nodes of the inside contours conflict, we compute the left one of the
// greatest uncommon ancestors using the function ANCESTOR and call MOVE
// SUBTREE to shift the subtree and prepare the shifts of smaller subtrees.
// Finally, we add a new thread (if necessary).
function apportion(v, w, ancestor) {
if (w) {
var vip = v,
vop = v,
vim = w,
vom = vip.parent.children[0],
sip = vip.m,
sop = vop.m,
sim = vim.m,
som = vom.m,
shift;
while (vim = nextRight(vim), vip = nextLeft(vip), vim && vip) {
vom = nextLeft(vom);
vop = nextRight(vop);
vop.a = v;
shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);
if (shift > 0) {
moveSubtree(nextAncestor(vim, v, ancestor), v, shift);
sip += shift;
sop += shift;
}
sim += vim.m;
sip += vip.m;
som += vom.m;
sop += vop.m;
}
if (vim && !nextRight(vop)) {
vop.t = vim;
vop.m += sim - sop;
}
if (vip && !nextLeft(vom)) {
vom.t = vip;
vom.m += sip - som;
ancestor = v;
}
}
return ancestor;
}
function sizeNode(node) {
node.x *= dx;
node.y = node.depth * dy;
}
tree.separation = function(x) {
return arguments.length ? (separation = x, tree) : separation;
};
tree.size = function(x) {
return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], tree) : (nodeSize ? null : [dx, dy]);
};
tree.nodeSize = function(x) {
return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], tree) : (nodeSize ? [dx, dy] : null);
};
return tree;
};
var treemapSlice = function(parent, x0, y0, x1, y1) {
var nodes = parent.children,
node,
i = -1,
n = nodes.length,
k = parent.value && (y1 - y0) / parent.value;
while (++i < n) {
node = nodes[i], node.x0 = x0, node.x1 = x1;
node.y0 = y0, node.y1 = y0 += node.value * k;
}
};
var phi = (1 + Math.sqrt(5)) / 2;
function squarifyRatio(ratio, parent, x0, y0, x1, y1) {
var rows = [],
nodes = parent.children,
row,
nodeValue,
i0 = 0,
i1 = 0,
n = nodes.length,
dx, dy,
value = parent.value,
sumValue,
minValue,
maxValue,
newRatio,
minRatio,
alpha,
beta;
while (i0 < n) {
dx = x1 - x0, dy = y1 - y0;
// Find the next non-empty node.
do sumValue = nodes[i1++].value; while (!sumValue && i1 < n);
minValue = maxValue = sumValue;
alpha = Math.max(dy / dx, dx / dy) / (value * ratio);
beta = sumValue * sumValue * alpha;
minRatio = Math.max(maxValue / beta, beta / minValue);
// Keep adding nodes while the aspect ratio maintains or improves.
for (; i1 < n; ++i1) {
sumValue += nodeValue = nodes[i1].value;
if (nodeValue < minValue) minValue = nodeValue;
if (nodeValue > maxValue) maxValue = nodeValue;
beta = sumValue * sumValue * alpha;
newRatio = Math.max(maxValue / beta, beta / minValue);
if (newRatio > minRatio) { sumValue -= nodeValue; break; }
minRatio = newRatio;
}
// Position and record the row orientation.
rows.push(row = {value: sumValue, dice: dx < dy, children: nodes.slice(i0, i1)});
if (row.dice) treemapDice(row, x0, y0, x1, value ? y0 += dy * sumValue / value : y1);
else treemapSlice(row, x0, y0, value ? x0 += dx * sumValue / value : x1, y1);
value -= sumValue, i0 = i1;
}
return rows;
}
var squarify = ((function custom(ratio) {
function squarify(parent, x0, y0, x1, y1) {
squarifyRatio(ratio, parent, x0, y0, x1, y1);
}
squarify.ratio = function(x) {
return custom((x = +x) > 1 ? x : 1);
};
return squarify;
}))(phi);
var index$3 = function() {
var tile = squarify,
round = false,
dx = 1,
dy = 1,
paddingStack = [0],
paddingInner = constantZero,
paddingTop = constantZero,
paddingRight = constantZero,
paddingBottom = constantZero,
paddingLeft = constantZero;
function treemap(root) {
root.x0 =
root.y0 = 0;
root.x1 = dx;
root.y1 = dy;
root.eachBefore(positionNode);
paddingStack = [0];
if (round) root.eachBefore(roundNode);
return root;
}
function positionNode(node) {
var p = paddingStack[node.depth],
x0 = node.x0 + p,
y0 = node.y0 + p,
x1 = node.x1 - p,
y1 = node.y1 - p;
if (x1 < x0) x0 = x1 = (x0 + x1) / 2;
if (y1 < y0) y0 = y1 = (y0 + y1) / 2;
node.x0 = x0;
node.y0 = y0;
node.x1 = x1;
node.y1 = y1;
if (node.children) {
p = paddingStack[node.depth + 1] = paddingInner(node) / 2;
x0 += paddingLeft(node) - p;
y0 += paddingTop(node) - p;
x1 -= paddingRight(node) - p;
y1 -= paddingBottom(node) - p;
if (x1 < x0) x0 = x1 = (x0 + x1) / 2;
if (y1 < y0) y0 = y1 = (y0 + y1) / 2;
tile(node, x0, y0, x1, y1);
}
}
treemap.round = function(x) {
return arguments.length ? (round = !!x, treemap) : round;
};
treemap.size = function(x) {
return arguments.length ? (dx = +x[0], dy = +x[1], treemap) : [dx, dy];
};
treemap.tile = function(x) {
return arguments.length ? (tile = required(x), treemap) : tile;
};
treemap.padding = function(x) {
return arguments.length ? treemap.paddingInner(x).paddingOuter(x) : treemap.paddingInner();
};
treemap.paddingInner = function(x) {
return arguments.length ? (paddingInner = typeof x === "function" ? x : constant$8(+x), treemap) : paddingInner;
};
treemap.paddingOuter = function(x) {
return arguments.length ? treemap.paddingTop(x).paddingRight(x).paddingBottom(x).paddingLeft(x) : treemap.paddingTop();
};
treemap.paddingTop = function(x) {
return arguments.length ? (paddingTop = typeof x === "function" ? x : constant$8(+x), treemap) : paddingTop;
};
treemap.paddingRight = function(x) {
return arguments.length ? (paddingRight = typeof x === "function" ? x : constant$8(+x), treemap) : paddingRight;
};
treemap.paddingBottom = function(x) {
return arguments.length ? (paddingBottom = typeof x === "function" ? x : constant$8(+x), treemap) : paddingBottom;
};
treemap.paddingLeft = function(x) {
return arguments.length ? (paddingLeft = typeof x === "function" ? x : constant$8(+x), treemap) : paddingLeft;
};
return treemap;
};
var binary = function(parent, x0, y0, x1, y1) {
var nodes = parent.children,
i, n = nodes.length,
sum, sums = new Array(n + 1);
for (sums[0] = sum = i = 0; i < n; ++i) {
sums[i + 1] = sum += nodes[i].value;
}
partition(0, n, parent.value, x0, y0, x1, y1);
function partition(i, j, value, x0, y0, x1, y1) {
if (i >= j - 1) {
var node = nodes[i];
node.x0 = x0, node.y0 = y0;
node.x1 = x1, node.y1 = y1;
return;
}
var valueOffset = sums[i],
valueTarget = (value / 2) + valueOffset,
k = i + 1,
hi = j - 1;
while (k < hi) {
var mid = k + hi >>> 1;
if (sums[mid] < valueTarget) k = mid + 1;
else hi = mid;
}
if ((valueTarget - sums[k - 1]) < (sums[k] - valueTarget) && i + 1 < k) --k;
var valueLeft = sums[k] - valueOffset,
valueRight = value - valueLeft;
if ((x1 - x0) > (y1 - y0)) {
var xk = (x0 * valueRight + x1 * valueLeft) / value;
partition(i, k, valueLeft, x0, y0, xk, y1);
partition(k, j, valueRight, xk, y0, x1, y1);
} else {
var yk = (y0 * valueRight + y1 * valueLeft) / value;
partition(i, k, valueLeft, x0, y0, x1, yk);
partition(k, j, valueRight, x0, yk, x1, y1);
}
}
};
var sliceDice = function(parent, x0, y0, x1, y1) {
(parent.depth & 1 ? treemapSlice : treemapDice)(parent, x0, y0, x1, y1);
};
var resquarify = ((function custom(ratio) {
function resquarify(parent, x0, y0, x1, y1) {
if ((rows = parent._squarify) && (rows.ratio === ratio)) {
var rows,
row,
nodes,
i,
j = -1,
n,
m = rows.length,
value = parent.value;
while (++j < m) {
row = rows[j], nodes = row.children;
for (i = row.value = 0, n = nodes.length; i < n; ++i) row.value += nodes[i].value;
if (row.dice) treemapDice(row, x0, y0, x1, y0 += (y1 - y0) * row.value / value);
else treemapSlice(row, x0, y0, x0 += (x1 - x0) * row.value / value, y1);
value -= row.value;
}
} else {
parent._squarify = rows = squarifyRatio(ratio, parent, x0, y0, x1, y1);
rows.ratio = ratio;
}
}
resquarify.ratio = function(x) {
return custom((x = +x) > 1 ? x : 1);
};
return resquarify;
}))(phi);
var area$1 = function(polygon) {
var i = -1,
n = polygon.length,
a,
b = polygon[n - 1],
area = 0;
while (++i < n) {
a = b;
b = polygon[i];
area += a[1] * b[0] - a[0] * b[1];
}
return area / 2;
};
var centroid$1 = function(polygon) {
var i = -1,
n = polygon.length,
x = 0,
y = 0,
a,
b = polygon[n - 1],
c,
k = 0;
while (++i < n) {
a = b;
b = polygon[i];
k += c = a[0] * b[1] - b[0] * a[1];
x += (a[0] + b[0]) * c;
y += (a[1] + b[1]) * c;
}
return k *= 3, [x / k, y / k];
};
// Returns the 2D cross product of AB and AC vectors, i.e., the z-component of
// the 3D cross product in a quadrant I Cartesian coordinate system (+x is
// right, +y is up). Returns a positive value if ABC is counter-clockwise,
// negative if clockwise, and zero if the points are collinear.
var cross$1 = function(a, b, c) {
return (b[0] - a[0]) * (c[1] - a[1]) - (b[1] - a[1]) * (c[0] - a[0]);
};
function lexicographicOrder(a, b) {
return a[0] - b[0] || a[1] - b[1];
}
// Computes the upper convex hull per the monotone chain algorithm.
// Assumes points.length >= 3, is sorted by x, unique in y.
// Returns an array of indices into points in left-to-right order.
function computeUpperHullIndexes(points) {
var n = points.length,
indexes = [0, 1],
size = 2;
for (var i = 2; i < n; ++i) {
while (size > 1 && cross$1(points[indexes[size - 2]], points[indexes[size - 1]], points[i]) <= 0) --size;
indexes[size++] = i;
}
return indexes.slice(0, size); // remove popped points
}
var hull = function(points) {
if ((n = points.length) < 3) return null;
var i,
n,
sortedPoints = new Array(n),
flippedPoints = new Array(n);
for (i = 0; i < n; ++i) sortedPoints[i] = [+points[i][0], +points[i][1], i];
sortedPoints.sort(lexicographicOrder);
for (i = 0; i < n; ++i) flippedPoints[i] = [sortedPoints[i][0], -sortedPoints[i][1]];
var upperIndexes = computeUpperHullIndexes(sortedPoints),
lowerIndexes = computeUpperHullIndexes(flippedPoints);
// Construct the hull polygon, removing possible duplicate endpoints.
var skipLeft = lowerIndexes[0] === upperIndexes[0],
skipRight = lowerIndexes[lowerIndexes.length - 1] === upperIndexes[upperIndexes.length - 1],
hull = [];
// Add upper hull in right-to-l order.
// Then add lower hull in left-to-right order.
for (i = upperIndexes.length - 1; i >= 0; --i) hull.push(points[sortedPoints[upperIndexes[i]][2]]);
for (i = +skipLeft; i < lowerIndexes.length - skipRight; ++i) hull.push(points[sortedPoints[lowerIndexes[i]][2]]);
return hull;
};
var contains$1 = function(polygon, point) {
var n = polygon.length,
p = polygon[n - 1],
x = point[0], y = point[1],
x0 = p[0], y0 = p[1],
x1, y1,
inside = false;
for (var i = 0; i < n; ++i) {
p = polygon[i], x1 = p[0], y1 = p[1];
if (((y1 > y) !== (y0 > y)) && (x < (x0 - x1) * (y - y1) / (y0 - y1) + x1)) inside = !inside;
x0 = x1, y0 = y1;
}
return inside;
};
var length$2 = function(polygon) {
var i = -1,
n = polygon.length,
b = polygon[n - 1],
xa,
ya,
xb = b[0],
yb = b[1],
perimeter = 0;
while (++i < n) {
xa = xb;
ya = yb;
b = polygon[i];
xb = b[0];
yb = b[1];
xa -= xb;
ya -= yb;
perimeter += Math.sqrt(xa * xa + ya * ya);
}
return perimeter;
};
var slice$3 = [].slice;
var noabort = {};
function Queue(size) {
this._size = size;
this._call =
this._error = null;
this._tasks = [];
this._data = [];
this._waiting =
this._active =
this._ended =
this._start = 0; // inside a synchronous task callback?
}
Queue.prototype = queue.prototype = {
constructor: Queue,
defer: function(callback) {
if (typeof callback !== "function") throw new Error("invalid callback");
if (this._call) throw new Error("defer after await");
if (this._error != null) return this;
var t = slice$3.call(arguments, 1);
t.push(callback);
++this._waiting, this._tasks.push(t);
poke$1(this);
return this;
},
abort: function() {
if (this._error == null) abort(this, new Error("abort"));
return this;
},
await: function(callback) {
if (typeof callback !== "function") throw new Error("invalid callback");
if (this._call) throw new Error("multiple await");
this._call = function(error, results) { callback.apply(null, [error].concat(results)); };
maybeNotify(this);
return this;
},
awaitAll: function(callback) {
if (typeof callback !== "function") throw new Error("invalid callback");
if (this._call) throw new Error("multiple await");
this._call = callback;
maybeNotify(this);
return this;
}
};
function poke$1(q) {
if (!q._start) {
try { start$1(q); } // let the current task complete
catch (e) {
if (q._tasks[q._ended + q._active - 1]) abort(q, e); // task errored synchronously
else if (!q._data) throw e; // await callback errored synchronously
}
}
}
function start$1(q) {
while (q._start = q._waiting && q._active < q._size) {
var i = q._ended + q._active,
t = q._tasks[i],
j = t.length - 1,
c = t[j];
t[j] = end(q, i);
--q._waiting, ++q._active;
t = c.apply(null, t);
if (!q._tasks[i]) continue; // task finished synchronously
q._tasks[i] = t || noabort;
}
}
function end(q, i) {
return function(e, r) {
if (!q._tasks[i]) return; // ignore multiple callbacks
--q._active, ++q._ended;
q._tasks[i] = null;
if (q._error != null) return; // ignore secondary errors
if (e != null) {
abort(q, e);
} else {
q._data[i] = r;
if (q._waiting) poke$1(q);
else maybeNotify(q);
}
};
}
function abort(q, e) {
var i = q._tasks.length, t;
q._error = e; // ignore active callbacks
q._data = undefined; // allow gc
q._waiting = NaN; // prevent starting
while (--i >= 0) {
if (t = q._tasks[i]) {
q._tasks[i] = null;
if (t.abort) {
try { t.abort(); }
catch (e) { /* ignore */ }
}
}
}
q._active = NaN; // allow notification
maybeNotify(q);
}
function maybeNotify(q) {
if (!q._active && q._call) {
var d = q._data;
q._data = undefined; // allow gc
q._call(q._error, d);
}
}
function queue(concurrency) {
if (concurrency == null) concurrency = Infinity;
else if (!((concurrency = +concurrency) >= 1)) throw new Error("invalid concurrency");
return new Queue(concurrency);
}
var defaultSource$1 = function() {
return Math.random();
};
var uniform = ((function sourceRandomUniform(source) {
function randomUniform(min, max) {
min = min == null ? 0 : +min;
max = max == null ? 1 : +max;
if (arguments.length === 1) max = min, min = 0;
else max -= min;
return function() {
return source() * max + min;
};
}
randomUniform.source = sourceRandomUniform;
return randomUniform;
}))(defaultSource$1);
var normal = ((function sourceRandomNormal(source) {
function randomNormal(mu, sigma) {
var x, r;
mu = mu == null ? 0 : +mu;
sigma = sigma == null ? 1 : +sigma;
return function() {
var y;
// If available, use the second previously-generated uniform random.
if (x != null) y = x, x = null;
// Otherwise, generate a new x and y.
else do {
x = source() * 2 - 1;
y = source() * 2 - 1;
r = x * x + y * y;
} while (!r || r > 1);
return mu + sigma * y * Math.sqrt(-2 * Math.log(r) / r);
};
}
randomNormal.source = sourceRandomNormal;
return randomNormal;
}))(defaultSource$1);
var logNormal = ((function sourceRandomLogNormal(source) {
function randomLogNormal() {
var randomNormal = normal.source(source).apply(this, arguments);
return function() {
return Math.exp(randomNormal());
};
}
randomLogNormal.source = sourceRandomLogNormal;
return randomLogNormal;
}))(defaultSource$1);
var irwinHall = ((function sourceRandomIrwinHall(source) {
function randomIrwinHall(n) {
return function() {
for (var sum = 0, i = 0; i < n; ++i) sum += source();
return sum;
};
}
randomIrwinHall.source = sourceRandomIrwinHall;
return randomIrwinHall;
}))(defaultSource$1);
var bates = ((function sourceRandomBates(source) {
function randomBates(n) {
var randomIrwinHall = irwinHall.source(source)(n);
return function() {
return randomIrwinHall() / n;
};
}
randomBates.source = sourceRandomBates;
return randomBates;
}))(defaultSource$1);
var exponential$1 = ((function sourceRandomExponential(source) {
function randomExponential(lambda) {
return function() {
return -Math.log(1 - source()) / lambda;
};
}
randomExponential.source = sourceRandomExponential;
return randomExponential;
}))(defaultSource$1);
var request = function(url, callback) {
var request,
event = dispatch("beforesend", "progress", "load", "error"),
mimeType,
headers = map$1(),
xhr = new XMLHttpRequest,
user = null,
password = null,
response,
responseType,
timeout = 0;
// If IE does not support CORS, use XDomainRequest.
if (typeof XDomainRequest !== "undefined"
&& !("withCredentials" in xhr)
&& /^(http(s)?:)?\/\//.test(url)) xhr = new XDomainRequest;
"onload" in xhr
? xhr.onload = xhr.onerror = xhr.ontimeout = respond
: xhr.onreadystatechange = function(o) { xhr.readyState > 3 && respond(o); };
function respond(o) {
var status = xhr.status, result;
if (!status && hasResponse(xhr)
|| status >= 200 && status < 300
|| status === 304) {
if (response) {
try {
result = response.call(request, xhr);
} catch (e) {
event.call("error", request, e);
return;
}
} else {
result = xhr;
}
event.call("load", request, result);
} else {
event.call("error", request, o);
}
}
xhr.onprogress = function(e) {
event.call("progress", request, e);
};
request = {
header: function(name, value) {
name = (name + "").toLowerCase();
if (arguments.length < 2) return headers.get(name);
if (value == null) headers.remove(name);
else headers.set(name, value + "");
return request;
},
// If mimeType is non-null and no Accept header is set, a default is used.
mimeType: function(value) {
if (!arguments.length) return mimeType;
mimeType = value == null ? null : value + "";
return request;
},
// Specifies what type the response value should take;
// for instance, arraybuffer, blob, document, or text.
responseType: function(value) {
if (!arguments.length) return responseType;
responseType = value;
return request;
},
timeout: function(value) {
if (!arguments.length) return timeout;
timeout = +value;
return request;
},
user: function(value) {
return arguments.length < 1 ? user : (user = value == null ? null : value + "", request);
},
password: function(value) {
return arguments.length < 1 ? password : (password = value == null ? null : value + "", request);
},
// Specify how to convert the response content to a specific type;
// changes the callback value on "load" events.
response: function(value) {
response = value;
return request;
},
// Alias for send("GET", …).
get: function(data, callback) {
return request.send("GET", data, callback);
},
// Alias for send("POST", …).
post: function(data, callback) {
return request.send("POST", data, callback);
},
// If callback is non-null, it will be used for error and load events.
send: function(method, data, callback) {
xhr.open(method, url, true, user, password);
if (mimeType != null && !headers.has("accept")) headers.set("accept", mimeType + ",*/*");
if (xhr.setRequestHeader) headers.each(function(value, name) { xhr.setRequestHeader(name, value); });
if (mimeType != null && xhr.overrideMimeType) xhr.overrideMimeType(mimeType);
if (responseType != null) xhr.responseType = responseType;
if (timeout > 0) xhr.timeout = timeout;
if (callback == null && typeof data === "function") callback = data, data = null;
if (callback != null && callback.length === 1) callback = fixCallback(callback);
if (callback != null) request.on("error", callback).on("load", function(xhr) { callback(null, xhr); });
event.call("beforesend", request, xhr);
xhr.send(data == null ? null : data);
return request;
},
abort: function() {
xhr.abort();
return request;
},
on: function() {
var value = event.on.apply(event, arguments);
return value === event ? request : value;
}
};
if (callback != null) {
if (typeof callback !== "function") throw new Error("invalid callback: " + callback);
return request.get(callback);
}
return request;
};
function fixCallback(callback) {
return function(error, xhr) {
callback(error == null ? xhr : null);
};
}
function hasResponse(xhr) {
var type = xhr.responseType;
return type && type !== "text"
? xhr.response // null on error
: xhr.responseText; // "" on error
}
var type$1 = function(defaultMimeType, response) {
return function(url, callback) {
var r = request(url).mimeType(defaultMimeType).response(response);
if (callback != null) {
if (typeof callback !== "function") throw new Error("invalid callback: " + callback);
return r.get(callback);
}
return r;
};
};
var html = type$1("text/html", function(xhr) {
return document.createRange().createContextualFragment(xhr.responseText);
});
var json = type$1("application/json", function(xhr) {
return JSON.parse(xhr.responseText);
});
var text = type$1("text/plain", function(xhr) {
return xhr.responseText;
});
var xml = type$1("application/xml", function(xhr) {
var xml = xhr.responseXML;
if (!xml) throw new Error("parse error");
return xml;
});
var dsv$1 = function(defaultMimeType, parse) {
return function(url, row, callback) {
if (arguments.length < 3) callback = row, row = null;
var r = request(url).mimeType(defaultMimeType);
r.row = function(_) { return arguments.length ? r.response(responseOf(parse, row = _)) : row; };
r.row(row);
return callback ? r.get(callback) : r;
};
};
function responseOf(parse, row) {
return function(request$$1) {
return parse(request$$1.responseText, row);
};
}
var csv$1 = dsv$1("text/csv", csvParse);
var tsv$1 = dsv$1("text/tab-separated-values", tsvParse);
var array$2 = Array.prototype;
var map$3 = array$2.map;
var slice$4 = array$2.slice;
var implicit = {name: "implicit"};
function ordinal(range) {
var index = map$1(),
domain = [],
unknown = implicit;
range = range == null ? [] : slice$4.call(range);
function scale(d) {
var key = d + "", i = index.get(key);
if (!i) {
if (unknown !== implicit) return unknown;
index.set(key, i = domain.push(d));
}
return range[(i - 1) % range.length];
}
scale.domain = function(_) {
if (!arguments.length) return domain.slice();
domain = [], index = map$1();
var i = -1, n = _.length, d, key;
while (++i < n) if (!index.has(key = (d = _[i]) + "")) index.set(key, domain.push(d));
return scale;
};
scale.range = function(_) {
return arguments.length ? (range = slice$4.call(_), scale) : range.slice();
};
scale.unknown = function(_) {
return arguments.length ? (unknown = _, scale) : unknown;
};
scale.copy = function() {
return ordinal()
.domain(domain)
.range(range)
.unknown(unknown);
};
return scale;
}
function band() {
var scale = ordinal().unknown(undefined),
domain = scale.domain,
ordinalRange = scale.range,
range$$1 = [0, 1],
step,
bandwidth,
round = false,
paddingInner = 0,
paddingOuter = 0,
align = 0.5;
delete scale.unknown;
function rescale() {
var n = domain().length,
reverse = range$$1[1] < range$$1[0],
start = range$$1[reverse - 0],
stop = range$$1[1 - reverse];
step = (stop - start) / Math.max(1, n - paddingInner + paddingOuter * 2);
if (round) step = Math.floor(step);
start += (stop - start - step * (n - paddingInner)) * align;
bandwidth = step * (1 - paddingInner);
if (round) start = Math.round(start), bandwidth = Math.round(bandwidth);
var values = sequence(n).map(function(i) { return start + step * i; });
return ordinalRange(reverse ? values.reverse() : values);
}
scale.domain = function(_) {
return arguments.length ? (domain(_), rescale()) : domain();
};
scale.range = function(_) {
return arguments.length ? (range$$1 = [+_[0], +_[1]], rescale()) : range$$1.slice();
};
scale.rangeRound = function(_) {
return range$$1 = [+_[0], +_[1]], round = true, rescale();
};
scale.bandwidth = function() {
return bandwidth;
};
scale.step = function() {
return step;
};
scale.round = function(_) {
return arguments.length ? (round = !!_, rescale()) : round;
};
scale.padding = function(_) {
return arguments.length ? (paddingInner = paddingOuter = Math.max(0, Math.min(1, _)), rescale()) : paddingInner;
};
scale.paddingInner = function(_) {
return arguments.length ? (paddingInner = Math.max(0, Math.min(1, _)), rescale()) : paddingInner;
};
scale.paddingOuter = function(_) {
return arguments.length ? (paddingOuter = Math.max(0, Math.min(1, _)), rescale()) : paddingOuter;
};
scale.align = function(_) {
return arguments.length ? (align = Math.max(0, Math.min(1, _)), rescale()) : align;
};
scale.copy = function() {
return band()
.domain(domain())
.range(range$$1)
.round(round)
.paddingInner(paddingInner)
.paddingOuter(paddingOuter)
.align(align);
};
return rescale();
}
function pointish(scale) {
var copy = scale.copy;
scale.padding = scale.paddingOuter;
delete scale.paddingInner;
delete scale.paddingOuter;
scale.copy = function() {
return pointish(copy());
};
return scale;
}
function point$1() {
return pointish(band().paddingInner(1));
}
var constant$9 = function(x) {
return function() {
return x;
};
};
var number$1 = function(x) {
return +x;
};
var unit = [0, 1];
function deinterpolateLinear(a, b) {
return (b -= (a = +a))
? function(x) { return (x - a) / b; }
: constant$9(b);
}
function deinterpolateClamp(deinterpolate) {
return function(a, b) {
var d = deinterpolate(a = +a, b = +b);
return function(x) { return x <= a ? 0 : x >= b ? 1 : d(x); };
};
}
function reinterpolateClamp(reinterpolate) {
return function(a, b) {
var r = reinterpolate(a = +a, b = +b);
return function(t) { return t <= 0 ? a : t >= 1 ? b : r(t); };
};
}
function bimap(domain, range$$1, deinterpolate, reinterpolate) {
var d0 = domain[0], d1 = domain[1], r0 = range$$1[0], r1 = range$$1[1];
if (d1 < d0) d0 = deinterpolate(d1, d0), r0 = reinterpolate(r1, r0);
else d0 = deinterpolate(d0, d1), r0 = reinterpolate(r0, r1);
return function(x) { return r0(d0(x)); };
}
function polymap(domain, range$$1, deinterpolate, reinterpolate) {
var j = Math.min(domain.length, range$$1.length) - 1,
d = new Array(j),
r = new Array(j),
i = -1;
// Reverse descending domains.
if (domain[j] < domain[0]) {
domain = domain.slice().reverse();
range$$1 = range$$1.slice().reverse();
}
while (++i < j) {
d[i] = deinterpolate(domain[i], domain[i + 1]);
r[i] = reinterpolate(range$$1[i], range$$1[i + 1]);
}
return function(x) {
var i = bisectRight(domain, x, 1, j) - 1;
return r[i](d[i](x));
};
}
function copy(source, target) {
return target
.domain(source.domain())
.range(source.range())
.interpolate(source.interpolate())
.clamp(source.clamp());
}
// deinterpolate(a, b)(x) takes a domain value x in [a,b] and returns the corresponding parameter t in [0,1].
// reinterpolate(a, b)(t) takes a parameter t in [0,1] and returns the corresponding domain value x in [a,b].
function continuous(deinterpolate, reinterpolate) {
var domain = unit,
range$$1 = unit,
interpolate$$1 = interpolateValue,
clamp = false,
piecewise,
output,
input;
function rescale() {
piecewise = Math.min(domain.length, range$$1.length) > 2 ? polymap : bimap;
output = input = null;
return scale;
}
function scale(x) {
return (output || (output = piecewise(domain, range$$1, clamp ? deinterpolateClamp(deinterpolate) : deinterpolate, interpolate$$1)))(+x);
}
scale.invert = function(y) {
return (input || (input = piecewise(range$$1, domain, deinterpolateLinear, clamp ? reinterpolateClamp(reinterpolate) : reinterpolate)))(+y);
};
scale.domain = function(_) {
return arguments.length ? (domain = map$3.call(_, number$1), rescale()) : domain.slice();
};
scale.range = function(_) {
return arguments.length ? (range$$1 = slice$4.call(_), rescale()) : range$$1.slice();
};
scale.rangeRound = function(_) {
return range$$1 = slice$4.call(_), interpolate$$1 = interpolateRound, rescale();
};
scale.clamp = function(_) {
return arguments.length ? (clamp = !!_, rescale()) : clamp;
};
scale.interpolate = function(_) {
return arguments.length ? (interpolate$$1 = _, rescale()) : interpolate$$1;
};
return rescale();
}
var tickFormat = function(domain, count, specifier) {
var start = domain[0],
stop = domain[domain.length - 1],
step = tickStep(start, stop, count == null ? 10 : count),
precision;
specifier = formatSpecifier(specifier == null ? ",f" : specifier);
switch (specifier.type) {
case "s": {
var value = Math.max(Math.abs(start), Math.abs(stop));
if (specifier.precision == null && !isNaN(precision = precisionPrefix(step, value))) specifier.precision = precision;
return exports.formatPrefix(specifier, value);
}
case "":
case "e":
case "g":
case "p":
case "r": {
if (specifier.precision == null && !isNaN(precision = precisionRound(step, Math.max(Math.abs(start), Math.abs(stop))))) specifier.precision = precision - (specifier.type === "e");
break;
}
case "f":
case "%": {
if (specifier.precision == null && !isNaN(precision = precisionFixed(step))) specifier.precision = precision - (specifier.type === "%") * 2;
break;
}
}
return exports.format(specifier);
};
function linearish(scale) {
var domain = scale.domain;
scale.ticks = function(count) {
var d = domain();
return ticks(d[0], d[d.length - 1], count == null ? 10 : count);
};
scale.tickFormat = function(count, specifier) {
return tickFormat(domain(), count, specifier);
};
scale.nice = function(count) {
if (count == null) count = 10;
var d = domain(),
i0 = 0,
i1 = d.length - 1,
start = d[i0],
stop = d[i1],
step;
if (stop < start) {
step = start, start = stop, stop = step;
step = i0, i0 = i1, i1 = step;
}
step = tickIncrement(start, stop, count);
if (step > 0) {
start = Math.floor(start / step) * step;
stop = Math.ceil(stop / step) * step;
step = tickIncrement(start, stop, count);
} else if (step < 0) {
start = Math.ceil(start * step) / step;
stop = Math.floor(stop * step) / step;
step = tickIncrement(start, stop, count);
}
if (step > 0) {
d[i0] = Math.floor(start / step) * step;
d[i1] = Math.ceil(stop / step) * step;
domain(d);
} else if (step < 0) {
d[i0] = Math.ceil(start * step) / step;
d[i1] = Math.floor(stop * step) / step;
domain(d);
}
return scale;
};
return scale;
}
function linear$2() {
var scale = continuous(deinterpolateLinear, reinterpolate);
scale.copy = function() {
return copy(scale, linear$2());
};
return linearish(scale);
}
function identity$6() {
var domain = [0, 1];
function scale(x) {
return +x;
}
scale.invert = scale;
scale.domain = scale.range = function(_) {
return arguments.length ? (domain = map$3.call(_, number$1), scale) : domain.slice();
};
scale.copy = function() {
return identity$6().domain(domain);
};
return linearish(scale);
}
var nice = function(domain, interval) {
domain = domain.slice();
var i0 = 0,
i1 = domain.length - 1,
x0 = domain[i0],
x1 = domain[i1],
t;
if (x1 < x0) {
t = i0, i0 = i1, i1 = t;
t = x0, x0 = x1, x1 = t;
}
domain[i0] = interval.floor(x0);
domain[i1] = interval.ceil(x1);
return domain;
};
function deinterpolate(a, b) {
return (b = Math.log(b / a))
? function(x) { return Math.log(x / a) / b; }
: constant$9(b);
}
function reinterpolate$1(a, b) {
return a < 0
? function(t) { return -Math.pow(-b, t) * Math.pow(-a, 1 - t); }
: function(t) { return Math.pow(b, t) * Math.pow(a, 1 - t); };
}
function pow10(x) {
return isFinite(x) ? +("1e" + x) : x < 0 ? 0 : x;
}
function powp(base) {
return base === 10 ? pow10
: base === Math.E ? Math.exp
: function(x) { return Math.pow(base, x); };
}
function logp(base) {
return base === Math.E ? Math.log
: base === 10 && Math.log10
|| base === 2 && Math.log2
|| (base = Math.log(base), function(x) { return Math.log(x) / base; });
}
function reflect(f) {
return function(x) {
return -f(-x);
};
}
function log$1() {
var scale = continuous(deinterpolate, reinterpolate$1).domain([1, 10]),
domain = scale.domain,
base = 10,
logs = logp(10),
pows = powp(10);
function rescale() {
logs = logp(base), pows = powp(base);
if (domain()[0] < 0) logs = reflect(logs), pows = reflect(pows);
return scale;
}
scale.base = function(_) {
return arguments.length ? (base = +_, rescale()) : base;
};
scale.domain = function(_) {
return arguments.length ? (domain(_), rescale()) : domain();
};
scale.ticks = function(count) {
var d = domain(),
u = d[0],
v = d[d.length - 1],
r;
if (r = v < u) i = u, u = v, v = i;
var i = logs(u),
j = logs(v),
p,
k,
t,
n = count == null ? 10 : +count,
z = [];
if (!(base % 1) && j - i < n) {
i = Math.round(i) - 1, j = Math.round(j) + 1;
if (u > 0) for (; i < j; ++i) {
for (k = 1, p = pows(i); k < base; ++k) {
t = p * k;
if (t < u) continue;
if (t > v) break;
z.push(t);
}
} else for (; i < j; ++i) {
for (k = base - 1, p = pows(i); k >= 1; --k) {
t = p * k;
if (t < u) continue;
if (t > v) break;
z.push(t);
}
}
} else {
z = ticks(i, j, Math.min(j - i, n)).map(pows);
}
return r ? z.reverse() : z;
};
scale.tickFormat = function(count, specifier) {
if (specifier == null) specifier = base === 10 ? ".0e" : ",";
if (typeof specifier !== "function") specifier = exports.format(specifier);
if (count === Infinity) return specifier;
if (count == null) count = 10;
var k = Math.max(1, base * count / scale.ticks().length); // TODO fast estimate?
return function(d) {
var i = d / pows(Math.round(logs(d)));
if (i * base < base - 0.5) i *= base;
return i <= k ? specifier(d) : "";
};
};
scale.nice = function() {
return domain(nice(domain(), {
floor: function(x) { return pows(Math.floor(logs(x))); },
ceil: function(x) { return pows(Math.ceil(logs(x))); }
}));
};
scale.copy = function() {
return copy(scale, log$1().base(base));
};
return scale;
}
function raise$1(x, exponent) {
return x < 0 ? -Math.pow(-x, exponent) : Math.pow(x, exponent);
}
function pow$1() {
var exponent = 1,
scale = continuous(deinterpolate, reinterpolate),
domain = scale.domain;
function deinterpolate(a, b) {
return (b = raise$1(b, exponent) - (a = raise$1(a, exponent)))
? function(x) { return (raise$1(x, exponent) - a) / b; }
: constant$9(b);
}
function reinterpolate(a, b) {
b = raise$1(b, exponent) - (a = raise$1(a, exponent));
return function(t) { return raise$1(a + b * t, 1 / exponent); };
}
scale.exponent = function(_) {
return arguments.length ? (exponent = +_, domain(domain())) : exponent;
};
scale.copy = function() {
return copy(scale, pow$1().exponent(exponent));
};
return linearish(scale);
}
function sqrt$1() {
return pow$1().exponent(0.5);
}
function quantile$$1() {
var domain = [],
range$$1 = [],
thresholds = [];
function rescale() {
var i = 0, n = Math.max(1, range$$1.length);
thresholds = new Array(n - 1);
while (++i < n) thresholds[i - 1] = threshold(domain, i / n);
return scale;
}
function scale(x) {
if (!isNaN(x = +x)) return range$$1[bisectRight(thresholds, x)];
}
scale.invertExtent = function(y) {
var i = range$$1.indexOf(y);
return i < 0 ? [NaN, NaN] : [
i > 0 ? thresholds[i - 1] : domain[0],
i < thresholds.length ? thresholds[i] : domain[domain.length - 1]
];
};
scale.domain = function(_) {
if (!arguments.length) return domain.slice();
domain = [];
for (var i = 0, n = _.length, d; i < n; ++i) if (d = _[i], d != null && !isNaN(d = +d)) domain.push(d);
domain.sort(ascending);
return rescale();
};
scale.range = function(_) {
return arguments.length ? (range$$1 = slice$4.call(_), rescale()) : range$$1.slice();
};
scale.quantiles = function() {
return thresholds.slice();
};
scale.copy = function() {
return quantile$$1()
.domain(domain)
.range(range$$1);
};
return scale;
}
function quantize$1() {
var x0 = 0,
x1 = 1,
n = 1,
domain = [0.5],
range$$1 = [0, 1];
function scale(x) {
if (x <= x) return range$$1[bisectRight(domain, x, 0, n)];
}
function rescale() {
var i = -1;
domain = new Array(n);
while (++i < n) domain[i] = ((i + 1) * x1 - (i - n) * x0) / (n + 1);
return scale;
}
scale.domain = function(_) {
return arguments.length ? (x0 = +_[0], x1 = +_[1], rescale()) : [x0, x1];
};
scale.range = function(_) {
return arguments.length ? (n = (range$$1 = slice$4.call(_)).length - 1, rescale()) : range$$1.slice();
};
scale.invertExtent = function(y) {
var i = range$$1.indexOf(y);
return i < 0 ? [NaN, NaN]
: i < 1 ? [x0, domain[0]]
: i >= n ? [domain[n - 1], x1]
: [domain[i - 1], domain[i]];
};
scale.copy = function() {
return quantize$1()
.domain([x0, x1])
.range(range$$1);
};
return linearish(scale);
}
function threshold$1() {
var domain = [0.5],
range$$1 = [0, 1],
n = 1;
function scale(x) {
if (x <= x) return range$$1[bisectRight(domain, x, 0, n)];
}
scale.domain = function(_) {
return arguments.length ? (domain = slice$4.call(_), n = Math.min(domain.length, range$$1.length - 1), scale) : domain.slice();
};
scale.range = function(_) {
return arguments.length ? (range$$1 = slice$4.call(_), n = Math.min(domain.length, range$$1.length - 1), scale) : range$$1.slice();
};
scale.invertExtent = function(y) {
var i = range$$1.indexOf(y);
return [domain[i - 1], domain[i]];
};
scale.copy = function() {
return threshold$1()
.domain(domain)
.range(range$$1);
};
return scale;
}
var t0$1 = new Date;
var t1$1 = new Date;
function newInterval(floori, offseti, count, field) {
function interval(date) {
return floori(date = new Date(+date)), date;
}
interval.floor = interval;
interval.ceil = function(date) {
return floori(date = new Date(date - 1)), offseti(date, 1), floori(date), date;
};
interval.round = function(date) {
var d0 = interval(date),
d1 = interval.ceil(date);
return date - d0 < d1 - date ? d0 : d1;
};
interval.offset = function(date, step) {
return offseti(date = new Date(+date), step == null ? 1 : Math.floor(step)), date;
};
interval.range = function(start, stop, step) {
var range = [];
start = interval.ceil(start);
step = step == null ? 1 : Math.floor(step);
if (!(start < stop) || !(step > 0)) return range; // also handles Invalid Date
do range.push(new Date(+start)); while (offseti(start, step), floori(start), start < stop)
return range;
};
interval.filter = function(test) {
return newInterval(function(date) {
if (date >= date) while (floori(date), !test(date)) date.setTime(date - 1);
}, function(date, step) {
if (date >= date) while (--step >= 0) while (offseti(date, 1), !test(date)) {} // eslint-disable-line no-empty
});
};
if (count) {
interval.count = function(start, end) {
t0$1.setTime(+start), t1$1.setTime(+end);
floori(t0$1), floori(t1$1);
return Math.floor(count(t0$1, t1$1));
};
interval.every = function(step) {
step = Math.floor(step);
return !isFinite(step) || !(step > 0) ? null
: !(step > 1) ? interval
: interval.filter(field
? function(d) { return field(d) % step === 0; }
: function(d) { return interval.count(0, d) % step === 0; });
};
}
return interval;
}
var millisecond = newInterval(function() {
// noop
}, function(date, step) {
date.setTime(+date + step);
}, function(start, end) {
return end - start;
});
// An optimized implementation for this simple case.
millisecond.every = function(k) {
k = Math.floor(k);
if (!isFinite(k) || !(k > 0)) return null;
if (!(k > 1)) return millisecond;
return newInterval(function(date) {
date.setTime(Math.floor(date / k) * k);
}, function(date, step) {
date.setTime(+date + step * k);
}, function(start, end) {
return (end - start) / k;
});
};
var milliseconds = millisecond.range;
var durationSecond$1 = 1e3;
var durationMinute$1 = 6e4;
var durationHour$1 = 36e5;
var durationDay$1 = 864e5;
var durationWeek$1 = 6048e5;
var second = newInterval(function(date) {
date.setTime(Math.floor(date / durationSecond$1) * durationSecond$1);
}, function(date, step) {
date.setTime(+date + step * durationSecond$1);
}, function(start, end) {
return (end - start) / durationSecond$1;
}, function(date) {
return date.getUTCSeconds();
});
var seconds = second.range;
var minute = newInterval(function(date) {
date.setTime(Math.floor(date / durationMinute$1) * durationMinute$1);
}, function(date, step) {
date.setTime(+date + step * durationMinute$1);
}, function(start, end) {
return (end - start) / durationMinute$1;
}, function(date) {
return date.getMinutes();
});
var minutes = minute.range;
var hour = newInterval(function(date) {
var offset = date.getTimezoneOffset() * durationMinute$1 % durationHour$1;
if (offset < 0) offset += durationHour$1;
date.setTime(Math.floor((+date - offset) / durationHour$1) * durationHour$1 + offset);
}, function(date, step) {
date.setTime(+date + step * durationHour$1);
}, function(start, end) {
return (end - start) / durationHour$1;
}, function(date) {
return date.getHours();
});
var hours = hour.range;
var day = newInterval(function(date) {
date.setHours(0, 0, 0, 0);
}, function(date, step) {
date.setDate(date.getDate() + step);
}, function(start, end) {
return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute$1) / durationDay$1;
}, function(date) {
return date.getDate() - 1;
});
var days = day.range;
function weekday(i) {
return newInterval(function(date) {
date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);
date.setHours(0, 0, 0, 0);
}, function(date, step) {
date.setDate(date.getDate() + step * 7);
}, function(start, end) {
return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute$1) / durationWeek$1;
});
}
var sunday = weekday(0);
var monday = weekday(1);
var tuesday = weekday(2);
var wednesday = weekday(3);
var thursday = weekday(4);
var friday = weekday(5);
var saturday = weekday(6);
var sundays = sunday.range;
var mondays = monday.range;
var tuesdays = tuesday.range;
var wednesdays = wednesday.range;
var thursdays = thursday.range;
var fridays = friday.range;
var saturdays = saturday.range;
var month = newInterval(function(date) {
date.setDate(1);
date.setHours(0, 0, 0, 0);
}, function(date, step) {
date.setMonth(date.getMonth() + step);
}, function(start, end) {
return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12;
}, function(date) {
return date.getMonth();
});
var months = month.range;
var year = newInterval(function(date) {
date.setMonth(0, 1);
date.setHours(0, 0, 0, 0);
}, function(date, step) {
date.setFullYear(date.getFullYear() + step);
}, function(start, end) {
return end.getFullYear() - start.getFullYear();
}, function(date) {
return date.getFullYear();
});
// An optimized implementation for this simple case.
year.every = function(k) {
return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : newInterval(function(date) {
date.setFullYear(Math.floor(date.getFullYear() / k) * k);
date.setMonth(0, 1);
date.setHours(0, 0, 0, 0);
}, function(date, step) {
date.setFullYear(date.getFullYear() + step * k);
});
};
var years = year.range;
var utcMinute = newInterval(function(date) {
date.setUTCSeconds(0, 0);
}, function(date, step) {
date.setTime(+date + step * durationMinute$1);
}, function(start, end) {
return (end - start) / durationMinute$1;
}, function(date) {
return date.getUTCMinutes();
});
var utcMinutes = utcMinute.range;
var utcHour = newInterval(function(date) {
date.setUTCMinutes(0, 0, 0);
}, function(date, step) {
date.setTime(+date + step * durationHour$1);
}, function(start, end) {
return (end - start) / durationHour$1;
}, function(date) {
return date.getUTCHours();
});
var utcHours = utcHour.range;
var utcDay = newInterval(function(date) {
date.setUTCHours(0, 0, 0, 0);
}, function(date, step) {
date.setUTCDate(date.getUTCDate() + step);
}, function(start, end) {
return (end - start) / durationDay$1;
}, function(date) {
return date.getUTCDate() - 1;
});
var utcDays = utcDay.range;
function utcWeekday(i) {
return newInterval(function(date) {
date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);
date.setUTCHours(0, 0, 0, 0);
}, function(date, step) {
date.setUTCDate(date.getUTCDate() + step * 7);
}, function(start, end) {
return (end - start) / durationWeek$1;
});
}
var utcSunday = utcWeekday(0);
var utcMonday = utcWeekday(1);
var utcTuesday = utcWeekday(2);
var utcWednesday = utcWeekday(3);
var utcThursday = utcWeekday(4);
var utcFriday = utcWeekday(5);
var utcSaturday = utcWeekday(6);
var utcSundays = utcSunday.range;
var utcMondays = utcMonday.range;
var utcTuesdays = utcTuesday.range;
var utcWednesdays = utcWednesday.range;
var utcThursdays = utcThursday.range;
var utcFridays = utcFriday.range;
var utcSaturdays = utcSaturday.range;
var utcMonth = newInterval(function(date) {
date.setUTCDate(1);
date.setUTCHours(0, 0, 0, 0);
}, function(date, step) {
date.setUTCMonth(date.getUTCMonth() + step);
}, function(start, end) {
return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12;
}, function(date) {
return date.getUTCMonth();
});
var utcMonths = utcMonth.range;
var utcYear = newInterval(function(date) {
date.setUTCMonth(0, 1);
date.setUTCHours(0, 0, 0, 0);
}, function(date, step) {
date.setUTCFullYear(date.getUTCFullYear() + step);
}, function(start, end) {
return end.getUTCFullYear() - start.getUTCFullYear();
}, function(date) {
return date.getUTCFullYear();
});
// An optimized implementation for this simple case.
utcYear.every = function(k) {
return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : newInterval(function(date) {
date.setUTCFullYear(Math.floor(date.getUTCFullYear() / k) * k);
date.setUTCMonth(0, 1);
date.setUTCHours(0, 0, 0, 0);
}, function(date, step) {
date.setUTCFullYear(date.getUTCFullYear() + step * k);
});
};
var utcYears = utcYear.range;
function localDate(d) {
if (0 <= d.y && d.y < 100) {
var date = new Date(-1, d.m, d.d, d.H, d.M, d.S, d.L);
date.setFullYear(d.y);
return date;
}
return new Date(d.y, d.m, d.d, d.H, d.M, d.S, d.L);
}
function utcDate(d) {
if (0 <= d.y && d.y < 100) {
var date = new Date(Date.UTC(-1, d.m, d.d, d.H, d.M, d.S, d.L));
date.setUTCFullYear(d.y);
return date;
}
return new Date(Date.UTC(d.y, d.m, d.d, d.H, d.M, d.S, d.L));
}
function newYear(y) {
return {y: y, m: 0, d: 1, H: 0, M: 0, S: 0, L: 0};
}
function formatLocale$1(locale) {
var locale_dateTime = locale.dateTime,
locale_date = locale.date,
locale_time = locale.time,
locale_periods = locale.periods,
locale_weekdays = locale.days,
locale_shortWeekdays = locale.shortDays,
locale_months = locale.months,
locale_shortMonths = locale.shortMonths;
var periodRe = formatRe(locale_periods),
periodLookup = formatLookup(locale_periods),
weekdayRe = formatRe(locale_weekdays),
weekdayLookup = formatLookup(locale_weekdays),
shortWeekdayRe = formatRe(locale_shortWeekdays),
shortWeekdayLookup = formatLookup(locale_shortWeekdays),
monthRe = formatRe(locale_months),
monthLookup = formatLookup(locale_months),
shortMonthRe = formatRe(locale_shortMonths),
shortMonthLookup = formatLookup(locale_shortMonths);
var formats = {
"a": formatShortWeekday,
"A": formatWeekday,
"b": formatShortMonth,
"B": formatMonth,
"c": null,
"d": formatDayOfMonth,
"e": formatDayOfMonth,
"H": formatHour24,
"I": formatHour12,
"j": formatDayOfYear,
"L": formatMilliseconds,
"m": formatMonthNumber,
"M": formatMinutes,
"p": formatPeriod,
"S": formatSeconds,
"U": formatWeekNumberSunday,
"w": formatWeekdayNumber,
"W": formatWeekNumberMonday,
"x": null,
"X": null,
"y": formatYear,
"Y": formatFullYear,
"Z": formatZone,
"%": formatLiteralPercent
};
var utcFormats = {
"a": formatUTCShortWeekday,
"A": formatUTCWeekday,
"b": formatUTCShortMonth,
"B": formatUTCMonth,
"c": null,
"d": formatUTCDayOfMonth,
"e": formatUTCDayOfMonth,
"H": formatUTCHour24,
"I": formatUTCHour12,
"j": formatUTCDayOfYear,
"L": formatUTCMilliseconds,
"m": formatUTCMonthNumber,
"M": formatUTCMinutes,
"p": formatUTCPeriod,
"S": formatUTCSeconds,
"U": formatUTCWeekNumberSunday,
"w": formatUTCWeekdayNumber,
"W": formatUTCWeekNumberMonday,
"x": null,
"X": null,
"y": formatUTCYear,
"Y": formatUTCFullYear,
"Z": formatUTCZone,
"%": formatLiteralPercent
};
var parses = {
"a": parseShortWeekday,
"A": parseWeekday,
"b": parseShortMonth,
"B": parseMonth,
"c": parseLocaleDateTime,
"d": parseDayOfMonth,
"e": parseDayOfMonth,
"H": parseHour24,
"I": parseHour24,
"j": parseDayOfYear,
"L": parseMilliseconds,
"m": parseMonthNumber,
"M": parseMinutes,
"p": parsePeriod,
"S": parseSeconds,
"U": parseWeekNumberSunday,
"w": parseWeekdayNumber,
"W": parseWeekNumberMonday,
"x": parseLocaleDate,
"X": parseLocaleTime,
"y": parseYear,
"Y": parseFullYear,
"Z": parseZone,
"%": parseLiteralPercent
};
// These recursive directive definitions must be deferred.
formats.x = newFormat(locale_date, formats);
formats.X = newFormat(locale_time, formats);
formats.c = newFormat(locale_dateTime, formats);
utcFormats.x = newFormat(locale_date, utcFormats);
utcFormats.X = newFormat(locale_time, utcFormats);
utcFormats.c = newFormat(locale_dateTime, utcFormats);
function newFormat(specifier, formats) {
return function(date) {
var string = [],
i = -1,
j = 0,
n = specifier.length,
c,
pad,
format;
if (!(date instanceof Date)) date = new Date(+date);
while (++i < n) {
if (specifier.charCodeAt(i) === 37) {
string.push(specifier.slice(j, i));
if ((pad = pads[c = specifier.charAt(++i)]) != null) c = specifier.charAt(++i);
else pad = c === "e" ? " " : "0";
if (format = formats[c]) c = format(date, pad);
string.push(c);
j = i + 1;
}
}
string.push(specifier.slice(j, i));
return string.join("");
};
}
function newParse(specifier, newDate) {
return function(string) {
var d = newYear(1900),
i = parseSpecifier(d, specifier, string += "", 0);
if (i != string.length) return null;
// The am-pm flag is 0 for AM, and 1 for PM.
if ("p" in d) d.H = d.H % 12 + d.p * 12;
// Convert day-of-week and week-of-year to day-of-year.
if ("W" in d || "U" in d) {
if (!("w" in d)) d.w = "W" in d ? 1 : 0;
var day$$1 = "Z" in d ? utcDate(newYear(d.y)).getUTCDay() : newDate(newYear(d.y)).getDay();
d.m = 0;
d.d = "W" in d ? (d.w + 6) % 7 + d.W * 7 - (day$$1 + 5) % 7 : d.w + d.U * 7 - (day$$1 + 6) % 7;
}
// If a time zone is specified, all fields are interpreted as UTC and then
// offset according to the specified time zone.
if ("Z" in d) {
d.H += d.Z / 100 | 0;
d.M += d.Z % 100;
return utcDate(d);
}
// Otherwise, all fields are in local time.
return newDate(d);
};
}
function parseSpecifier(d, specifier, string, j) {
var i = 0,
n = specifier.length,
m = string.length,
c,
parse;
while (i < n) {
if (j >= m) return -1;
c = specifier.charCodeAt(i++);
if (c === 37) {
c = specifier.charAt(i++);
parse = parses[c in pads ? specifier.charAt(i++) : c];
if (!parse || ((j = parse(d, string, j)) < 0)) return -1;
} else if (c != string.charCodeAt(j++)) {
return -1;
}
}
return j;
}
function parsePeriod(d, string, i) {
var n = periodRe.exec(string.slice(i));
return n ? (d.p = periodLookup[n[0].toLowerCase()], i + n[0].length) : -1;
}
function parseShortWeekday(d, string, i) {
var n = shortWeekdayRe.exec(string.slice(i));
return n ? (d.w = shortWeekdayLookup[n[0].toLowerCase()], i + n[0].length) : -1;
}
function parseWeekday(d, string, i) {
var n = weekdayRe.exec(string.slice(i));
return n ? (d.w = weekdayLookup[n[0].toLowerCase()], i + n[0].length) : -1;
}
function parseShortMonth(d, string, i) {
var n = shortMonthRe.exec(string.slice(i));
return n ? (d.m = shortMonthLookup[n[0].toLowerCase()], i + n[0].length) : -1;
}
function parseMonth(d, string, i) {
var n = monthRe.exec(string.slice(i));
return n ? (d.m = monthLookup[n[0].toLowerCase()], i + n[0].length) : -1;
}
function parseLocaleDateTime(d, string, i) {
return parseSpecifier(d, locale_dateTime, string, i);
}
function parseLocaleDate(d, string, i) {
return parseSpecifier(d, locale_date, string, i);
}
function parseLocaleTime(d, string, i) {
return parseSpecifier(d, locale_time, string, i);
}
function formatShortWeekday(d) {
return locale_shortWeekdays[d.getDay()];
}
function formatWeekday(d) {
return locale_weekdays[d.getDay()];
}
function formatShortMonth(d) {
return locale_shortMonths[d.getMonth()];
}
function formatMonth(d) {
return locale_months[d.getMonth()];
}
function formatPeriod(d) {
return locale_periods[+(d.getHours() >= 12)];
}
function formatUTCShortWeekday(d) {
return locale_shortWeekdays[d.getUTCDay()];
}
function formatUTCWeekday(d) {
return locale_weekdays[d.getUTCDay()];
}
function formatUTCShortMonth(d) {
return locale_shortMonths[d.getUTCMonth()];
}
function formatUTCMonth(d) {
return locale_months[d.getUTCMonth()];
}
function formatUTCPeriod(d) {
return locale_periods[+(d.getUTCHours() >= 12)];
}
return {
format: function(specifier) {
var f = newFormat(specifier += "", formats);
f.toString = function() { return specifier; };
return f;
},
parse: function(specifier) {
var p = newParse(specifier += "", localDate);
p.toString = function() { return specifier; };
return p;
},
utcFormat: function(specifier) {
var f = newFormat(specifier += "", utcFormats);
f.toString = function() { return specifier; };
return f;
},
utcParse: function(specifier) {
var p = newParse(specifier, utcDate);
p.toString = function() { return specifier; };
return p;
}
};
}
var pads = {"-": "", "_": " ", "0": "0"};
var numberRe = /^\s*\d+/;
var percentRe = /^%/;
var requoteRe = /[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;
function pad(value, fill, width) {
var sign = value < 0 ? "-" : "",
string = (sign ? -value : value) + "",
length = string.length;
return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string);
}
function requote(s) {
return s.replace(requoteRe, "\\$&");
}
function formatRe(names) {
return new RegExp("^(?:" + names.map(requote).join("|") + ")", "i");
}
function formatLookup(names) {
var map = {}, i = -1, n = names.length;
while (++i < n) map[names[i].toLowerCase()] = i;
return map;
}
function parseWeekdayNumber(d, string, i) {
var n = numberRe.exec(string.slice(i, i + 1));
return n ? (d.w = +n[0], i + n[0].length) : -1;
}
function parseWeekNumberSunday(d, string, i) {
var n = numberRe.exec(string.slice(i));
return n ? (d.U = +n[0], i + n[0].length) : -1;
}
function parseWeekNumberMonday(d, string, i) {
var n = numberRe.exec(string.slice(i));
return n ? (d.W = +n[0], i + n[0].length) : -1;
}
function parseFullYear(d, string, i) {
var n = numberRe.exec(string.slice(i, i + 4));
return n ? (d.y = +n[0], i + n[0].length) : -1;
}
function parseYear(d, string, i) {
var n = numberRe.exec(string.slice(i, i + 2));
return n ? (d.y = +n[0] + (+n[0] > 68 ? 1900 : 2000), i + n[0].length) : -1;
}
function parseZone(d, string, i) {
var n = /^(Z)|([+-]\d\d)(?:\:?(\d\d))?/.exec(string.slice(i, i + 6));
return n ? (d.Z = n[1] ? 0 : -(n[2] + (n[3] || "00")), i + n[0].length) : -1;
}
function parseMonthNumber(d, string, i) {
var n = numberRe.exec(string.slice(i, i + 2));
return n ? (d.m = n[0] - 1, i + n[0].length) : -1;
}
function parseDayOfMonth(d, string, i) {
var n = numberRe.exec(string.slice(i, i + 2));
return n ? (d.d = +n[0], i + n[0].length) : -1;
}
function parseDayOfYear(d, string, i) {
var n = numberRe.exec(string.slice(i, i + 3));
return n ? (d.m = 0, d.d = +n[0], i + n[0].length) : -1;
}
function parseHour24(d, string, i) {
var n = numberRe.exec(string.slice(i, i + 2));
return n ? (d.H = +n[0], i + n[0].length) : -1;
}
function parseMinutes(d, string, i) {
var n = numberRe.exec(string.slice(i, i + 2));
return n ? (d.M = +n[0], i + n[0].length) : -1;
}
function parseSeconds(d, string, i) {
var n = numberRe.exec(string.slice(i, i + 2));
return n ? (d.S = +n[0], i + n[0].length) : -1;
}
function parseMilliseconds(d, string, i) {
var n = numberRe.exec(string.slice(i, i + 3));
return n ? (d.L = +n[0], i + n[0].length) : -1;
}
function parseLiteralPercent(d, string, i) {
var n = percentRe.exec(string.slice(i, i + 1));
return n ? i + n[0].length : -1;
}
function formatDayOfMonth(d, p) {
return pad(d.getDate(), p, 2);
}
function formatHour24(d, p) {
return pad(d.getHours(), p, 2);
}
function formatHour12(d, p) {
return pad(d.getHours() % 12 || 12, p, 2);
}
function formatDayOfYear(d, p) {
return pad(1 + day.count(year(d), d), p, 3);
}
function formatMilliseconds(d, p) {
return pad(d.getMilliseconds(), p, 3);
}
function formatMonthNumber(d, p) {
return pad(d.getMonth() + 1, p, 2);
}
function formatMinutes(d, p) {
return pad(d.getMinutes(), p, 2);
}
function formatSeconds(d, p) {
return pad(d.getSeconds(), p, 2);
}
function formatWeekNumberSunday(d, p) {
return pad(sunday.count(year(d), d), p, 2);
}
function formatWeekdayNumber(d) {
return d.getDay();
}
function formatWeekNumberMonday(d, p) {
return pad(monday.count(year(d), d), p, 2);
}
function formatYear(d, p) {
return pad(d.getFullYear() % 100, p, 2);
}
function formatFullYear(d, p) {
return pad(d.getFullYear() % 10000, p, 4);
}
function formatZone(d) {
var z = d.getTimezoneOffset();
return (z > 0 ? "-" : (z *= -1, "+"))
+ pad(z / 60 | 0, "0", 2)
+ pad(z % 60, "0", 2);
}
function formatUTCDayOfMonth(d, p) {
return pad(d.getUTCDate(), p, 2);
}
function formatUTCHour24(d, p) {
return pad(d.getUTCHours(), p, 2);
}
function formatUTCHour12(d, p) {
return pad(d.getUTCHours() % 12 || 12, p, 2);
}
function formatUTCDayOfYear(d, p) {
return pad(1 + utcDay.count(utcYear(d), d), p, 3);
}
function formatUTCMilliseconds(d, p) {
return pad(d.getUTCMilliseconds(), p, 3);
}
function formatUTCMonthNumber(d, p) {
return pad(d.getUTCMonth() + 1, p, 2);
}
function formatUTCMinutes(d, p) {
return pad(d.getUTCMinutes(), p, 2);
}
function formatUTCSeconds(d, p) {
return pad(d.getUTCSeconds(), p, 2);
}
function formatUTCWeekNumberSunday(d, p) {
return pad(utcSunday.count(utcYear(d), d), p, 2);
}
function formatUTCWeekdayNumber(d) {
return d.getUTCDay();
}
function formatUTCWeekNumberMonday(d, p) {
return pad(utcMonday.count(utcYear(d), d), p, 2);
}
function formatUTCYear(d, p) {
return pad(d.getUTCFullYear() % 100, p, 2);
}
function formatUTCFullYear(d, p) {
return pad(d.getUTCFullYear() % 10000, p, 4);
}
function formatUTCZone() {
return "+0000";
}
function formatLiteralPercent() {
return "%";
}
var locale$2;
defaultLocale$1({
dateTime: "%x, %X",
date: "%-m/%-d/%Y",
time: "%-I:%M:%S %p",
periods: ["AM", "PM"],
days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
shortDays: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
shortMonths: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
});
function defaultLocale$1(definition) {
locale$2 = formatLocale$1(definition);
exports.timeFormat = locale$2.format;
exports.timeParse = locale$2.parse;
exports.utcFormat = locale$2.utcFormat;
exports.utcParse = locale$2.utcParse;
return locale$2;
}
var isoSpecifier = "%Y-%m-%dT%H:%M:%S.%LZ";
function formatIsoNative(date) {
return date.toISOString();
}
var formatIso = Date.prototype.toISOString
? formatIsoNative
: exports.utcFormat(isoSpecifier);
function parseIsoNative(string) {
var date = new Date(string);
return isNaN(date) ? null : date;
}
var parseIso = +new Date("2000-01-01T00:00:00.000Z")
? parseIsoNative
: exports.utcParse(isoSpecifier);
var durationSecond = 1000;
var durationMinute = durationSecond * 60;
var durationHour = durationMinute * 60;
var durationDay = durationHour * 24;
var durationWeek = durationDay * 7;
var durationMonth = durationDay * 30;
var durationYear = durationDay * 365;
function date$1(t) {
return new Date(t);
}
function number$2(t) {
return t instanceof Date ? +t : +new Date(+t);
}
function calendar(year$$1, month$$1, week, day$$1, hour$$1, minute$$1, second$$1, millisecond$$1, format) {
var scale = continuous(deinterpolateLinear, reinterpolate),
invert = scale.invert,
domain = scale.domain;
var formatMillisecond = format(".%L"),
formatSecond = format(":%S"),
formatMinute = format("%I:%M"),
formatHour = format("%I %p"),
formatDay = format("%a %d"),
formatWeek = format("%b %d"),
formatMonth = format("%B"),
formatYear = format("%Y");
var tickIntervals = [
[second$$1, 1, durationSecond],
[second$$1, 5, 5 * durationSecond],
[second$$1, 15, 15 * durationSecond],
[second$$1, 30, 30 * durationSecond],
[minute$$1, 1, durationMinute],
[minute$$1, 5, 5 * durationMinute],
[minute$$1, 15, 15 * durationMinute],
[minute$$1, 30, 30 * durationMinute],
[ hour$$1, 1, durationHour ],
[ hour$$1, 3, 3 * durationHour ],
[ hour$$1, 6, 6 * durationHour ],
[ hour$$1, 12, 12 * durationHour ],
[ day$$1, 1, durationDay ],
[ day$$1, 2, 2 * durationDay ],
[ week, 1, durationWeek ],
[ month$$1, 1, durationMonth ],
[ month$$1, 3, 3 * durationMonth ],
[ year$$1, 1, durationYear ]
];
function tickFormat(date) {
return (second$$1(date) < date ? formatMillisecond
: minute$$1(date) < date ? formatSecond
: hour$$1(date) < date ? formatMinute
: day$$1(date) < date ? formatHour
: month$$1(date) < date ? (week(date) < date ? formatDay : formatWeek)
: year$$1(date) < date ? formatMonth
: formatYear)(date);
}
function tickInterval(interval, start, stop, step) {
if (interval == null) interval = 10;
// If a desired tick count is specified, pick a reasonable tick interval
// based on the extent of the domain and a rough estimate of tick size.
// Otherwise, assume interval is already a time interval and use it.
if (typeof interval === "number") {
var target = Math.abs(stop - start) / interval,
i = bisector(function(i) { return i[2]; }).right(tickIntervals, target);
if (i === tickIntervals.length) {
step = tickStep(start / durationYear, stop / durationYear, interval);
interval = year$$1;
} else if (i) {
i = tickIntervals[target / tickIntervals[i - 1][2] < tickIntervals[i][2] / target ? i - 1 : i];
step = i[1];
interval = i[0];
} else {
step = tickStep(start, stop, interval);
interval = millisecond$$1;
}
}
return step == null ? interval : interval.every(step);
}
scale.invert = function(y) {
return new Date(invert(y));
};
scale.domain = function(_) {
return arguments.length ? domain(map$3.call(_, number$2)) : domain().map(date$1);
};
scale.ticks = function(interval, step) {
var d = domain(),
t0 = d[0],
t1 = d[d.length - 1],
r = t1 < t0,
t;
if (r) t = t0, t0 = t1, t1 = t;
t = tickInterval(interval, t0, t1, step);
t = t ? t.range(t0, t1 + 1) : []; // inclusive stop
return r ? t.reverse() : t;
};
scale.tickFormat = function(count, specifier) {
return specifier == null ? tickFormat : format(specifier);
};
scale.nice = function(interval, step) {
var d = domain();
return (interval = tickInterval(interval, d[0], d[d.length - 1], step))
? domain(nice(d, interval))
: scale;
};
scale.copy = function() {
return copy(scale, calendar(year$$1, month$$1, week, day$$1, hour$$1, minute$$1, second$$1, millisecond$$1, format));
};
return scale;
}
var time = function() {
return calendar(year, month, sunday, day, hour, minute, second, millisecond, exports.timeFormat).domain([new Date(2000, 0, 1), new Date(2000, 0, 2)]);
};
var utcTime = function() {
return calendar(utcYear, utcMonth, utcSunday, utcDay, utcHour, utcMinute, second, millisecond, exports.utcFormat).domain([Date.UTC(2000, 0, 1), Date.UTC(2000, 0, 2)]);
};
var colors = function(s) {
return s.match(/.{6}/g).map(function(x) {
return "#" + x;
});
};
var category10 = colors("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf");
var category20b = colors("393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6");
var category20c = colors("3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9");
var category20 = colors("1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5");
var cubehelix$3 = cubehelixLong(cubehelix(300, 0.5, 0.0), cubehelix(-240, 0.5, 1.0));
var warm = cubehelixLong(cubehelix(-100, 0.75, 0.35), cubehelix(80, 1.50, 0.8));
var cool = cubehelixLong(cubehelix(260, 0.75, 0.35), cubehelix(80, 1.50, 0.8));
var rainbow = cubehelix();
var rainbow$1 = function(t) {
if (t < 0 || t > 1) t -= Math.floor(t);
var ts = Math.abs(t - 0.5);
rainbow.h = 360 * t - 100;
rainbow.s = 1.5 - 1.5 * ts;
rainbow.l = 0.8 - 0.9 * ts;
return rainbow + "";
};
function ramp(range) {
var n = range.length;
return function(t) {
return range[Math.max(0, Math.min(n - 1, Math.floor(t * n)))];
};
}
var viridis = ramp(colors("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));
var magma = ramp(colors("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf"));
var inferno = ramp(colors("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4"));
var plasma = ramp(colors("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));
function sequential(interpolator) {
var x0 = 0,
x1 = 1,
clamp = false;
function scale(x) {
var t = (x - x0) / (x1 - x0);
return interpolator(clamp ? Math.max(0, Math.min(1, t)) : t);
}
scale.domain = function(_) {
return arguments.length ? (x0 = +_[0], x1 = +_[1], scale) : [x0, x1];
};
scale.clamp = function(_) {
return arguments.length ? (clamp = !!_, scale) : clamp;
};
scale.interpolator = function(_) {
return arguments.length ? (interpolator = _, scale) : interpolator;
};
scale.copy = function() {
return sequential(interpolator).domain([x0, x1]).clamp(clamp);
};
return linearish(scale);
}
var constant$10 = function(x) {
return function constant() {
return x;
};
};
var abs$1 = Math.abs;
var atan2$1 = Math.atan2;
var cos$2 = Math.cos;
var max$2 = Math.max;
var min$1 = Math.min;
var sin$2 = Math.sin;
var sqrt$2 = Math.sqrt;
var epsilon$3 = 1e-12;
var pi$4 = Math.PI;
var halfPi$3 = pi$4 / 2;
var tau$4 = 2 * pi$4;
function acos$1(x) {
return x > 1 ? 0 : x < -1 ? pi$4 : Math.acos(x);
}
function asin$1(x) {
return x >= 1 ? halfPi$3 : x <= -1 ? -halfPi$3 : Math.asin(x);
}
function arcInnerRadius(d) {
return d.innerRadius;
}
function arcOuterRadius(d) {
return d.outerRadius;
}
function arcStartAngle(d) {
return d.startAngle;
}
function arcEndAngle(d) {
return d.endAngle;
}
function arcPadAngle(d) {
return d && d.padAngle; // Note: optional!
}
function intersect(x0, y0, x1, y1, x2, y2, x3, y3) {
var x10 = x1 - x0, y10 = y1 - y0,
x32 = x3 - x2, y32 = y3 - y2,
t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / (y32 * x10 - x32 * y10);
return [x0 + t * x10, y0 + t * y10];
}
// Compute perpendicular offset line of length rc.
// http://mathworld.wolfram.com/Circle-LineIntersection.html
function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {
var x01 = x0 - x1,
y01 = y0 - y1,
lo = (cw ? rc : -rc) / sqrt$2(x01 * x01 + y01 * y01),
ox = lo * y01,
oy = -lo * x01,
x11 = x0 + ox,
y11 = y0 + oy,
x10 = x1 + ox,
y10 = y1 + oy,
x00 = (x11 + x10) / 2,
y00 = (y11 + y10) / 2,
dx = x10 - x11,
dy = y10 - y11,
d2 = dx * dx + dy * dy,
r = r1 - rc,
D = x11 * y10 - x10 * y11,
d = (dy < 0 ? -1 : 1) * sqrt$2(max$2(0, r * r * d2 - D * D)),
cx0 = (D * dy - dx * d) / d2,
cy0 = (-D * dx - dy * d) / d2,
cx1 = (D * dy + dx * d) / d2,
cy1 = (-D * dx + dy * d) / d2,
dx0 = cx0 - x00,
dy0 = cy0 - y00,
dx1 = cx1 - x00,
dy1 = cy1 - y00;
// Pick the closer of the two intersection points.
// TODO Is there a faster way to determine which intersection to use?
if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;
return {
cx: cx0,
cy: cy0,
x01: -ox,
y01: -oy,
x11: cx0 * (r1 / r - 1),
y11: cy0 * (r1 / r - 1)
};
}
var arc = function() {
var innerRadius = arcInnerRadius,
outerRadius = arcOuterRadius,
cornerRadius = constant$10(0),
padRadius = null,
startAngle = arcStartAngle,
endAngle = arcEndAngle,
padAngle = arcPadAngle,
context = null;
function arc() {
var buffer,
r,
r0 = +innerRadius.apply(this, arguments),
r1 = +outerRadius.apply(this, arguments),
a0 = startAngle.apply(this, arguments) - halfPi$3,
a1 = endAngle.apply(this, arguments) - halfPi$3,
da = abs$1(a1 - a0),
cw = a1 > a0;
if (!context) context = buffer = path();
// Ensure that the outer radius is always larger than the inner radius.
if (r1 < r0) r = r1, r1 = r0, r0 = r;
// Is it a point?
if (!(r1 > epsilon$3)) context.moveTo(0, 0);
// Or is it a circle or annulus?
else if (da > tau$4 - epsilon$3) {
context.moveTo(r1 * cos$2(a0), r1 * sin$2(a0));
context.arc(0, 0, r1, a0, a1, !cw);
if (r0 > epsilon$3) {
context.moveTo(r0 * cos$2(a1), r0 * sin$2(a1));
context.arc(0, 0, r0, a1, a0, cw);
}
}
// Or is it a circular or annular sector?
else {
var a01 = a0,
a11 = a1,
a00 = a0,
a10 = a1,
da0 = da,
da1 = da,
ap = padAngle.apply(this, arguments) / 2,
rp = (ap > epsilon$3) && (padRadius ? +padRadius.apply(this, arguments) : sqrt$2(r0 * r0 + r1 * r1)),
rc = min$1(abs$1(r1 - r0) / 2, +cornerRadius.apply(this, arguments)),
rc0 = rc,
rc1 = rc,
t0,
t1;
// Apply padding? Note that since r1 ≥ r0, da1 ≥ da0.
if (rp > epsilon$3) {
var p0 = asin$1(rp / r0 * sin$2(ap)),
p1 = asin$1(rp / r1 * sin$2(ap));
if ((da0 -= p0 * 2) > epsilon$3) p0 *= (cw ? 1 : -1), a00 += p0, a10 -= p0;
else da0 = 0, a00 = a10 = (a0 + a1) / 2;
if ((da1 -= p1 * 2) > epsilon$3) p1 *= (cw ? 1 : -1), a01 += p1, a11 -= p1;
else da1 = 0, a01 = a11 = (a0 + a1) / 2;
}
var x01 = r1 * cos$2(a01),
y01 = r1 * sin$2(a01),
x10 = r0 * cos$2(a10),
y10 = r0 * sin$2(a10);
// Apply rounded corners?
if (rc > epsilon$3) {
var x11 = r1 * cos$2(a11),
y11 = r1 * sin$2(a11),
x00 = r0 * cos$2(a00),
y00 = r0 * sin$2(a00);
// Restrict the corner radius according to the sector angle.
if (da < pi$4) {
var oc = da0 > epsilon$3 ? intersect(x01, y01, x00, y00, x11, y11, x10, y10) : [x10, y10],
ax = x01 - oc[0],
ay = y01 - oc[1],
bx = x11 - oc[0],
by = y11 - oc[1],
kc = 1 / sin$2(acos$1((ax * bx + ay * by) / (sqrt$2(ax * ax + ay * ay) * sqrt$2(bx * bx + by * by))) / 2),
lc = sqrt$2(oc[0] * oc[0] + oc[1] * oc[1]);
rc0 = min$1(rc, (r0 - lc) / (kc - 1));
rc1 = min$1(rc, (r1 - lc) / (kc + 1));
}
}
// Is the sector collapsed to a line?
if (!(da1 > epsilon$3)) context.moveTo(x01, y01);
// Does the sectors outer ring have rounded corners?
else if (rc1 > epsilon$3) {
t0 = cornerTangents(x00, y00, x01, y01, r1, rc1, cw);
t1 = cornerTangents(x11, y11, x10, y10, r1, rc1, cw);
context.moveTo(t0.cx + t0.x01, t0.cy + t0.y01);
// Have the corners merged?
if (rc1 < rc) context.arc(t0.cx, t0.cy, rc1, atan2$1(t0.y01, t0.x01), atan2$1(t1.y01, t1.x01), !cw);
// Otherwise, draw the two corners and the ring.
else {
context.arc(t0.cx, t0.cy, rc1, atan2$1(t0.y01, t0.x01), atan2$1(t0.y11, t0.x11), !cw);
context.arc(0, 0, r1, atan2$1(t0.cy + t0.y11, t0.cx + t0.x11), atan2$1(t1.cy + t1.y11, t1.cx + t1.x11), !cw);
context.arc(t1.cx, t1.cy, rc1, atan2$1(t1.y11, t1.x11), atan2$1(t1.y01, t1.x01), !cw);
}
}
// Or is the outer ring just a circular arc?
else context.moveTo(x01, y01), context.arc(0, 0, r1, a01, a11, !cw);
// Is there no inner ring, and its a circular sector?
// Or perhaps its an annular sector collapsed due to padding?
if (!(r0 > epsilon$3) || !(da0 > epsilon$3)) context.lineTo(x10, y10);
// Does the sectors inner ring (or point) have rounded corners?
else if (rc0 > epsilon$3) {
t0 = cornerTangents(x10, y10, x11, y11, r0, -rc0, cw);
t1 = cornerTangents(x01, y01, x00, y00, r0, -rc0, cw);
context.lineTo(t0.cx + t0.x01, t0.cy + t0.y01);
// Have the corners merged?
if (rc0 < rc) context.arc(t0.cx, t0.cy, rc0, atan2$1(t0.y01, t0.x01), atan2$1(t1.y01, t1.x01), !cw);
// Otherwise, draw the two corners and the ring.
else {
context.arc(t0.cx, t0.cy, rc0, atan2$1(t0.y01, t0.x01), atan2$1(t0.y11, t0.x11), !cw);
context.arc(0, 0, r0, atan2$1(t0.cy + t0.y11, t0.cx + t0.x11), atan2$1(t1.cy + t1.y11, t1.cx + t1.x11), cw);
context.arc(t1.cx, t1.cy, rc0, atan2$1(t1.y11, t1.x11), atan2$1(t1.y01, t1.x01), !cw);
}
}
// Or is the inner ring just a circular arc?
else context.arc(0, 0, r0, a10, a00, cw);
}
context.closePath();
if (buffer) return context = null, buffer + "" || null;
}
arc.centroid = function() {
var r = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2,
a = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - pi$4 / 2;
return [cos$2(a) * r, sin$2(a) * r];
};
arc.innerRadius = function(_) {
return arguments.length ? (innerRadius = typeof _ === "function" ? _ : constant$10(+_), arc) : innerRadius;
};
arc.outerRadius = function(_) {
return arguments.length ? (outerRadius = typeof _ === "function" ? _ : constant$10(+_), arc) : outerRadius;
};
arc.cornerRadius = function(_) {
return arguments.length ? (cornerRadius = typeof _ === "function" ? _ : constant$10(+_), arc) : cornerRadius;
};
arc.padRadius = function(_) {
return arguments.length ? (padRadius = _ == null ? null : typeof _ === "function" ? _ : constant$10(+_), arc) : padRadius;
};
arc.startAngle = function(_) {
return arguments.length ? (startAngle = typeof _ === "function" ? _ : constant$10(+_), arc) : startAngle;
};
arc.endAngle = function(_) {
return arguments.length ? (endAngle = typeof _ === "function" ? _ : constant$10(+_), arc) : endAngle;
};
arc.padAngle = function(_) {
return arguments.length ? (padAngle = typeof _ === "function" ? _ : constant$10(+_), arc) : padAngle;
};
arc.context = function(_) {
return arguments.length ? ((context = _ == null ? null : _), arc) : context;
};
return arc;
};
function Linear(context) {
this._context = context;
}
Linear.prototype = {
areaStart: function() {
this._line = 0;
},
areaEnd: function() {
this._line = NaN;
},
lineStart: function() {
this._point = 0;
},
lineEnd: function() {
if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();
this._line = 1 - this._line;
},
point: function(x, y) {
x = +x, y = +y;
switch (this._point) {
case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;
case 1: this._point = 2; // proceed
default: this._context.lineTo(x, y); break;
}
}
};
var curveLinear = function(context) {
return new Linear(context);
};
function x$3(p) {
return p[0];
}
function y$3(p) {
return p[1];
}
var line = function() {
var x$$1 = x$3,
y$$1 = y$3,
defined = constant$10(true),
context = null,
curve = curveLinear,
output = null;
function line(data) {
var i,
n = data.length,
d,
defined0 = false,
buffer;
if (context == null) output = curve(buffer = path());
for (i = 0; i <= n; ++i) {
if (!(i < n && defined(d = data[i], i, data)) === defined0) {
if (defined0 = !defined0) output.lineStart();
else output.lineEnd();
}
if (defined0) output.point(+x$$1(d, i, data), +y$$1(d, i, data));
}
if (buffer) return output = null, buffer + "" || null;
}
line.x = function(_) {
return arguments.length ? (x$$1 = typeof _ === "function" ? _ : constant$10(+_), line) : x$$1;
};
line.y = function(_) {
return arguments.length ? (y$$1 = typeof _ === "function" ? _ : constant$10(+_), line) : y$$1;
};
line.defined = function(_) {
return arguments.length ? (defined = typeof _ === "function" ? _ : constant$10(!!_), line) : defined;
};
line.curve = function(_) {
return arguments.length ? (curve = _, context != null && (output = curve(context)), line) : curve;
};
line.context = function(_) {
return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), line) : context;
};
return line;
};
var area$2 = function() {
var x0 = x$3,
x1 = null,
y0 = constant$10(0),
y1 = y$3,
defined = constant$10(true),
context = null,
curve = curveLinear,
output = null;
function area(data) {
var i,
j,
k,
n = data.length,
d,
defined0 = false,
buffer,
x0z = new Array(n),
y0z = new Array(n);
if (context == null) output = curve(buffer = path());
for (i = 0; i <= n; ++i) {
if (!(i < n && defined(d = data[i], i, data)) === defined0) {
if (defined0 = !defined0) {
j = i;
output.areaStart();
output.lineStart();
} else {
output.lineEnd();
output.lineStart();
for (k = i - 1; k >= j; --k) {
output.point(x0z[k], y0z[k]);
}
output.lineEnd();
output.areaEnd();
}
}
if (defined0) {
x0z[i] = +x0(d, i, data), y0z[i] = +y0(d, i, data);
output.point(x1 ? +x1(d, i, data) : x0z[i], y1 ? +y1(d, i, data) : y0z[i]);
}
}
if (buffer) return output = null, buffer + "" || null;
}
function arealine() {
return line().defined(defined).curve(curve).context(context);
}
area.x = function(_) {
return arguments.length ? (x0 = typeof _ === "function" ? _ : constant$10(+_), x1 = null, area) : x0;
};
area.x0 = function(_) {
return arguments.length ? (x0 = typeof _ === "function" ? _ : constant$10(+_), area) : x0;
};
area.x1 = function(_) {
return arguments.length ? (x1 = _ == null ? null : typeof _ === "function" ? _ : constant$10(+_), area) : x1;
};
area.y = function(_) {
return arguments.length ? (y0 = typeof _ === "function" ? _ : constant$10(+_), y1 = null, area) : y0;
};
area.y0 = function(_) {
return arguments.length ? (y0 = typeof _ === "function" ? _ : constant$10(+_), area) : y0;
};
area.y1 = function(_) {
return arguments.length ? (y1 = _ == null ? null : typeof _ === "function" ? _ : constant$10(+_), area) : y1;
};
area.lineX0 =
area.lineY0 = function() {
return arealine().x(x0).y(y0);
};
area.lineY1 = function() {
return arealine().x(x0).y(y1);
};
area.lineX1 = function() {
return arealine().x(x1).y(y0);
};
area.defined = function(_) {
return arguments.length ? (defined = typeof _ === "function" ? _ : constant$10(!!_), area) : defined;
};
area.curve = function(_) {
return arguments.length ? (curve = _, context != null && (output = curve(context)), area) : curve;
};
area.context = function(_) {
return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), area) : context;
};
return area;
};
var descending$1 = function(a, b) {
return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;
};
var identity$7 = function(d) {
return d;
};
var pie = function() {
var value = identity$7,
sortValues = descending$1,
sort = null,
startAngle = constant$10(0),
endAngle = constant$10(tau$4),
padAngle = constant$10(0);
function pie(data) {
var i,
n = data.length,
j,
k,
sum = 0,
index = new Array(n),
arcs = new Array(n),
a0 = +startAngle.apply(this, arguments),
da = Math.min(tau$4, Math.max(-tau$4, endAngle.apply(this, arguments) - a0)),
a1,
p = Math.min(Math.abs(da) / n, padAngle.apply(this, arguments)),
pa = p * (da < 0 ? -1 : 1),
v;
for (i = 0; i < n; ++i) {
if ((v = arcs[index[i] = i] = +value(data[i], i, data)) > 0) {
sum += v;
}
}
// Optionally sort the arcs by previously-computed values or by data.
if (sortValues != null) index.sort(function(i, j) { return sortValues(arcs[i], arcs[j]); });
else if (sort != null) index.sort(function(i, j) { return sort(data[i], data[j]); });
// Compute the arcs! They are stored in the original data's order.
for (i = 0, k = sum ? (da - n * pa) / sum : 0; i < n; ++i, a0 = a1) {
j = index[i], v = arcs[j], a1 = a0 + (v > 0 ? v * k : 0) + pa, arcs[j] = {
data: data[j],
index: i,
value: v,
startAngle: a0,
endAngle: a1,
padAngle: p
};
}
return arcs;
}
pie.value = function(_) {
return arguments.length ? (value = typeof _ === "function" ? _ : constant$10(+_), pie) : value;
};
pie.sortValues = function(_) {
return arguments.length ? (sortValues = _, sort = null, pie) : sortValues;
};
pie.sort = function(_) {
return arguments.length ? (sort = _, sortValues = null, pie) : sort;
};
pie.startAngle = function(_) {
return arguments.length ? (startAngle = typeof _ === "function" ? _ : constant$10(+_), pie) : startAngle;
};
pie.endAngle = function(_) {
return arguments.length ? (endAngle = typeof _ === "function" ? _ : constant$10(+_), pie) : endAngle;
};
pie.padAngle = function(_) {
return arguments.length ? (padAngle = typeof _ === "function" ? _ : constant$10(+_), pie) : padAngle;
};
return pie;
};
var curveRadialLinear = curveRadial(curveLinear);
function Radial(curve) {
this._curve = curve;
}
Radial.prototype = {
areaStart: function() {
this._curve.areaStart();
},
areaEnd: function() {
this._curve.areaEnd();
},
lineStart: function() {
this._curve.lineStart();
},
lineEnd: function() {
this._curve.lineEnd();
},
point: function(a, r) {
this._curve.point(r * Math.sin(a), r * -Math.cos(a));
}
};
function curveRadial(curve) {
function radial(context) {
return new Radial(curve(context));
}
radial._curve = curve;
return radial;
}
function radialLine(l) {
var c = l.curve;
l.angle = l.x, delete l.x;
l.radius = l.y, delete l.y;
l.curve = function(_) {
return arguments.length ? c(curveRadial(_)) : c()._curve;
};
return l;
}
var radialLine$1 = function() {
return radialLine(line().curve(curveRadialLinear));
};
var radialArea = function() {
var a = area$2().curve(curveRadialLinear),
c = a.curve,
x0 = a.lineX0,
x1 = a.lineX1,
y0 = a.lineY0,
y1 = a.lineY1;
a.angle = a.x, delete a.x;
a.startAngle = a.x0, delete a.x0;
a.endAngle = a.x1, delete a.x1;
a.radius = a.y, delete a.y;
a.innerRadius = a.y0, delete a.y0;
a.outerRadius = a.y1, delete a.y1;
a.lineStartAngle = function() { return radialLine(x0()); }, delete a.lineX0;
a.lineEndAngle = function() { return radialLine(x1()); }, delete a.lineX1;
a.lineInnerRadius = function() { return radialLine(y0()); }, delete a.lineY0;
a.lineOuterRadius = function() { return radialLine(y1()); }, delete a.lineY1;
a.curve = function(_) {
return arguments.length ? c(curveRadial(_)) : c()._curve;
};
return a;
};
var slice$5 = Array.prototype.slice;
var radialPoint = function(x, y) {
return [(y = +y) * Math.cos(x -= Math.PI / 2), y * Math.sin(x)];
};
function linkSource(d) {
return d.source;
}
function linkTarget(d) {
return d.target;
}
function link$2(curve) {
var source = linkSource,
target = linkTarget,
x$$1 = x$3,
y$$1 = y$3,
context = null;
function link() {
var buffer, argv = slice$5.call(arguments), s = source.apply(this, argv), t = target.apply(this, argv);
if (!context) context = buffer = path();
curve(context, +x$$1.apply(this, (argv[0] = s, argv)), +y$$1.apply(this, argv), +x$$1.apply(this, (argv[0] = t, argv)), +y$$1.apply(this, argv));
if (buffer) return context = null, buffer + "" || null;
}
link.source = function(_) {
return arguments.length ? (source = _, link) : source;
};
link.target = function(_) {
return arguments.length ? (target = _, link) : target;
};
link.x = function(_) {
return arguments.length ? (x$$1 = typeof _ === "function" ? _ : constant$10(+_), link) : x$$1;
};
link.y = function(_) {
return arguments.length ? (y$$1 = typeof _ === "function" ? _ : constant$10(+_), link) : y$$1;
};
link.context = function(_) {
return arguments.length ? ((context = _ == null ? null : _), link) : context;
};
return link;
}
function curveHorizontal(context, x0, y0, x1, y1) {
context.moveTo(x0, y0);
context.bezierCurveTo(x0 = (x0 + x1) / 2, y0, x0, y1, x1, y1);
}
function curveVertical(context, x0, y0, x1, y1) {
context.moveTo(x0, y0);
context.bezierCurveTo(x0, y0 = (y0 + y1) / 2, x1, y0, x1, y1);
}
function curveRadial$1(context, x0, y0, x1, y1) {
var p0 = radialPoint(x0, y0),
p1 = radialPoint(x0, y0 = (y0 + y1) / 2),
p2 = radialPoint(x1, y0),
p3 = radialPoint(x1, y1);
context.moveTo(p0[0], p0[1]);
context.bezierCurveTo(p1[0], p1[1], p2[0], p2[1], p3[0], p3[1]);
}
function linkHorizontal() {
return link$2(curveHorizontal);
}
function linkVertical() {
return link$2(curveVertical);
}
function linkRadial() {
var l = link$2(curveRadial$1);
l.angle = l.x, delete l.x;
l.radius = l.y, delete l.y;
return l;
}
var circle$2 = {
draw: function(context, size) {
var r = Math.sqrt(size / pi$4);
context.moveTo(r, 0);
context.arc(0, 0, r, 0, tau$4);
}
};
var cross$2 = {
draw: function(context, size) {
var r = Math.sqrt(size / 5) / 2;
context.moveTo(-3 * r, -r);
context.lineTo(-r, -r);
context.lineTo(-r, -3 * r);
context.lineTo(r, -3 * r);
context.lineTo(r, -r);
context.lineTo(3 * r, -r);
context.lineTo(3 * r, r);
context.lineTo(r, r);
context.lineTo(r, 3 * r);
context.lineTo(-r, 3 * r);
context.lineTo(-r, r);
context.lineTo(-3 * r, r);
context.closePath();
}
};
var tan30 = Math.sqrt(1 / 3);
var tan30_2 = tan30 * 2;
var diamond = {
draw: function(context, size) {
var y = Math.sqrt(size / tan30_2),
x = y * tan30;
context.moveTo(0, -y);
context.lineTo(x, 0);
context.lineTo(0, y);
context.lineTo(-x, 0);
context.closePath();
}
};
var ka = 0.89081309152928522810;
var kr = Math.sin(pi$4 / 10) / Math.sin(7 * pi$4 / 10);
var kx = Math.sin(tau$4 / 10) * kr;
var ky = -Math.cos(tau$4 / 10) * kr;
var star = {
draw: function(context, size) {
var r = Math.sqrt(size * ka),
x = kx * r,
y = ky * r;
context.moveTo(0, -r);
context.lineTo(x, y);
for (var i = 1; i < 5; ++i) {
var a = tau$4 * i / 5,
c = Math.cos(a),
s = Math.sin(a);
context.lineTo(s * r, -c * r);
context.lineTo(c * x - s * y, s * x + c * y);
}
context.closePath();
}
};
var square = {
draw: function(context, size) {
var w = Math.sqrt(size),
x = -w / 2;
context.rect(x, x, w, w);
}
};
var sqrt3 = Math.sqrt(3);
var triangle = {
draw: function(context, size) {
var y = -Math.sqrt(size / (sqrt3 * 3));
context.moveTo(0, y * 2);
context.lineTo(-sqrt3 * y, -y);
context.lineTo(sqrt3 * y, -y);
context.closePath();
}
};
var c = -0.5;
var s = Math.sqrt(3) / 2;
var k = 1 / Math.sqrt(12);
var a = (k / 2 + 1) * 3;
var wye = {
draw: function(context, size) {
var r = Math.sqrt(size / a),
x0 = r / 2,
y0 = r * k,
x1 = x0,
y1 = r * k + r,
x2 = -x1,
y2 = y1;
context.moveTo(x0, y0);
context.lineTo(x1, y1);
context.lineTo(x2, y2);
context.lineTo(c * x0 - s * y0, s * x0 + c * y0);
context.lineTo(c * x1 - s * y1, s * x1 + c * y1);
context.lineTo(c * x2 - s * y2, s * x2 + c * y2);
context.lineTo(c * x0 + s * y0, c * y0 - s * x0);
context.lineTo(c * x1 + s * y1, c * y1 - s * x1);
context.lineTo(c * x2 + s * y2, c * y2 - s * x2);
context.closePath();
}
};
var symbols = [
circle$2,
cross$2,
diamond,
square,
star,
triangle,
wye
];
var symbol = function() {
var type = constant$10(circle$2),
size = constant$10(64),
context = null;
function symbol() {
var buffer;
if (!context) context = buffer = path();
type.apply(this, arguments).draw(context, +size.apply(this, arguments));
if (buffer) return context = null, buffer + "" || null;
}
symbol.type = function(_) {
return arguments.length ? (type = typeof _ === "function" ? _ : constant$10(_), symbol) : type;
};
symbol.size = function(_) {
return arguments.length ? (size = typeof _ === "function" ? _ : constant$10(+_), symbol) : size;
};
symbol.context = function(_) {
return arguments.length ? (context = _ == null ? null : _, symbol) : context;
};
return symbol;
};
var noop$2 = function() {};
function point$2(that, x, y) {
that._context.bezierCurveTo(
(2 * that._x0 + that._x1) / 3,
(2 * that._y0 + that._y1) / 3,
(that._x0 + 2 * that._x1) / 3,
(that._y0 + 2 * that._y1) / 3,
(that._x0 + 4 * that._x1 + x) / 6,
(that._y0 + 4 * that._y1 + y) / 6
);
}
function Basis(context) {
this._context = context;
}
Basis.prototype = {
areaStart: function() {
this._line = 0;
},
areaEnd: function() {
this._line = NaN;
},
lineStart: function() {
this._x0 = this._x1 =
this._y0 = this._y1 = NaN;
this._point = 0;
},
lineEnd: function() {
switch (this._point) {
case 3: point$2(this, this._x1, this._y1); // proceed
case 2: this._context.lineTo(this._x1, this._y1); break;
}
if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();
this._line = 1 - this._line;
},
point: function(x, y) {
x = +x, y = +y;
switch (this._point) {
case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;
case 1: this._point = 2; break;
case 2: this._point = 3; this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6); // proceed
default: point$2(this, x, y); break;
}
this._x0 = this._x1, this._x1 = x;
this._y0 = this._y1, this._y1 = y;
}
};
var basis$2 = function(context) {
return new Basis(context);
};
function BasisClosed(context) {
this._context = context;
}
BasisClosed.prototype = {
areaStart: noop$2,
areaEnd: noop$2,
lineStart: function() {
this._x0 = this._x1 = this._x2 = this._x3 = this._x4 =
this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = NaN;
this._point = 0;
},
lineEnd: function() {
switch (this._point) {
case 1: {
this._context.moveTo(this._x2, this._y2);
this._context.closePath();
break;
}
case 2: {
this._context.moveTo((this._x2 + 2 * this._x3) / 3, (this._y2 + 2 * this._y3) / 3);
this._context.lineTo((this._x3 + 2 * this._x2) / 3, (this._y3 + 2 * this._y2) / 3);
this._context.closePath();
break;
}
case 3: {
this.point(this._x2, this._y2);
this.point(this._x3, this._y3);
this.point(this._x4, this._y4);
break;
}
}
},
point: function(x, y) {
x = +x, y = +y;
switch (this._point) {
case 0: this._point = 1; this._x2 = x, this._y2 = y; break;
case 1: this._point = 2; this._x3 = x, this._y3 = y; break;
case 2: this._point = 3; this._x4 = x, this._y4 = y; this._context.moveTo((this._x0 + 4 * this._x1 + x) / 6, (this._y0 + 4 * this._y1 + y) / 6); break;
default: point$2(this, x, y); break;
}
this._x0 = this._x1, this._x1 = x;
this._y0 = this._y1, this._y1 = y;
}
};
var basisClosed$1 = function(context) {
return new BasisClosed(context);
};
function BasisOpen(context) {
this._context = context;
}
BasisOpen.prototype = {
areaStart: function() {
this._line = 0;
},
areaEnd: function() {
this._line = NaN;
},
lineStart: function() {
this._x0 = this._x1 =
this._y0 = this._y1 = NaN;
this._point = 0;
},
lineEnd: function() {
if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();
this._line = 1 - this._line;
},
point: function(x, y) {
x = +x, y = +y;
switch (this._point) {
case 0: this._point = 1; break;
case 1: this._point = 2; break;
case 2: this._point = 3; var x0 = (this._x0 + 4 * this._x1 + x) / 6, y0 = (this._y0 + 4 * this._y1 + y) / 6; this._line ? this._context.lineTo(x0, y0) : this._context.moveTo(x0, y0); break;
case 3: this._point = 4; // proceed
default: point$2(this, x, y); break;
}
this._x0 = this._x1, this._x1 = x;
this._y0 = this._y1, this._y1 = y;
}
};
var basisOpen = function(context) {
return new BasisOpen(context);
};
function Bundle(context, beta) {
this._basis = new Basis(context);
this._beta = beta;
}
Bundle.prototype = {
lineStart: function() {
this._x = [];
this._y = [];
this._basis.lineStart();
},
lineEnd: function() {
var x = this._x,
y = this._y,
j = x.length - 1;
if (j > 0) {
var x0 = x[0],
y0 = y[0],
dx = x[j] - x0,
dy = y[j] - y0,
i = -1,
t;
while (++i <= j) {
t = i / j;
this._basis.point(
this._beta * x[i] + (1 - this._beta) * (x0 + t * dx),
this._beta * y[i] + (1 - this._beta) * (y0 + t * dy)
);
}
}
this._x = this._y = null;
this._basis.lineEnd();
},
point: function(x, y) {
this._x.push(+x);
this._y.push(+y);
}
};
var bundle = ((function custom(beta) {
function bundle(context) {
return beta === 1 ? new Basis(context) : new Bundle(context, beta);
}
bundle.beta = function(beta) {
return custom(+beta);
};
return bundle;
}))(0.85);
function point$3(that, x, y) {
that._context.bezierCurveTo(
that._x1 + that._k * (that._x2 - that._x0),
that._y1 + that._k * (that._y2 - that._y0),
that._x2 + that._k * (that._x1 - x),
that._y2 + that._k * (that._y1 - y),
that._x2,
that._y2
);
}
function Cardinal(context, tension) {
this._context = context;
this._k = (1 - tension) / 6;
}
Cardinal.prototype = {
areaStart: function() {
this._line = 0;
},
areaEnd: function() {
this._line = NaN;
},
lineStart: function() {
this._x0 = this._x1 = this._x2 =
this._y0 = this._y1 = this._y2 = NaN;
this._point = 0;
},
lineEnd: function() {
switch (this._point) {
case 2: this._context.lineTo(this._x2, this._y2); break;
case 3: point$3(this, this._x1, this._y1); break;
}
if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();
this._line = 1 - this._line;
},
point: function(x, y) {
x = +x, y = +y;
switch (this._point) {
case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;
case 1: this._point = 2; this._x1 = x, this._y1 = y; break;
case 2: this._point = 3; // proceed
default: point$3(this, x, y); break;
}
this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;
this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;
}
};
var cardinal = ((function custom(tension) {
function cardinal(context) {
return new Cardinal(context, tension);
}
cardinal.tension = function(tension) {
return custom(+tension);
};
return cardinal;
}))(0);
function CardinalClosed(context, tension) {
this._context = context;
this._k = (1 - tension) / 6;
}
CardinalClosed.prototype = {
areaStart: noop$2,
areaEnd: noop$2,
lineStart: function() {
this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 =
this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;
this._point = 0;
},
lineEnd: function() {
switch (this._point) {
case 1: {
this._context.moveTo(this._x3, this._y3);
this._context.closePath();
break;
}
case 2: {
this._context.lineTo(this._x3, this._y3);
this._context.closePath();
break;
}
case 3: {
this.point(this._x3, this._y3);
this.point(this._x4, this._y4);
this.point(this._x5, this._y5);
break;
}
}
},
point: function(x, y) {
x = +x, y = +y;
switch (this._point) {
case 0: this._point = 1; this._x3 = x, this._y3 = y; break;
case 1: this._point = 2; this._context.moveTo(this._x4 = x, this._y4 = y); break;
case 2: this._point = 3; this._x5 = x, this._y5 = y; break;
default: point$3(this, x, y); break;
}
this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;
this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;
}
};
var cardinalClosed = ((function custom(tension) {
function cardinal(context) {
return new CardinalClosed(context, tension);
}
cardinal.tension = function(tension) {
return custom(+tension);
};
return cardinal;
}))(0);
function CardinalOpen(context, tension) {
this._context = context;
this._k = (1 - tension) / 6;
}
CardinalOpen.prototype = {
areaStart: function() {
this._line = 0;
},
areaEnd: function() {
this._line = NaN;
},
lineStart: function() {
this._x0 = this._x1 = this._x2 =
this._y0 = this._y1 = this._y2 = NaN;
this._point = 0;
},
lineEnd: function() {
if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();
this._line = 1 - this._line;
},
point: function(x, y) {
x = +x, y = +y;
switch (this._point) {
case 0: this._point = 1; break;
case 1: this._point = 2; break;
case 2: this._point = 3; this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); break;
case 3: this._point = 4; // proceed
default: point$3(this, x, y); break;
}
this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;
this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;
}
};
var cardinalOpen = ((function custom(tension) {
function cardinal(context) {
return new CardinalOpen(context, tension);
}
cardinal.tension = function(tension) {
return custom(+tension);
};
return cardinal;
}))(0);
function point$4(that, x, y) {
var x1 = that._x1,
y1 = that._y1,
x2 = that._x2,
y2 = that._y2;
if (that._l01_a > epsilon$3) {
var a = 2 * that._l01_2a + 3 * that._l01_a * that._l12_a + that._l12_2a,
n = 3 * that._l01_a * (that._l01_a + that._l12_a);
x1 = (x1 * a - that._x0 * that._l12_2a + that._x2 * that._l01_2a) / n;
y1 = (y1 * a - that._y0 * that._l12_2a + that._y2 * that._l01_2a) / n;
}
if (that._l23_a > epsilon$3) {
var b = 2 * that._l23_2a + 3 * that._l23_a * that._l12_a + that._l12_2a,
m = 3 * that._l23_a * (that._l23_a + that._l12_a);
x2 = (x2 * b + that._x1 * that._l23_2a - x * that._l12_2a) / m;
y2 = (y2 * b + that._y1 * that._l23_2a - y * that._l12_2a) / m;
}
that._context.bezierCurveTo(x1, y1, x2, y2, that._x2, that._y2);
}
function CatmullRom(context, alpha) {
this._context = context;
this._alpha = alpha;
}
CatmullRom.prototype = {
areaStart: function() {
this._line = 0;
},
areaEnd: function() {
this._line = NaN;
},
lineStart: function() {
this._x0 = this._x1 = this._x2 =
this._y0 = this._y1 = this._y2 = NaN;
this._l01_a = this._l12_a = this._l23_a =
this._l01_2a = this._l12_2a = this._l23_2a =
this._point = 0;
},
lineEnd: function() {
switch (this._point) {
case 2: this._context.lineTo(this._x2, this._y2); break;
case 3: this.point(this._x2, this._y2); break;
}
if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();
this._line = 1 - this._line;
},
point: function(x, y) {
x = +x, y = +y;
if (this._point) {
var x23 = this._x2 - x,
y23 = this._y2 - y;
this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));
}
switch (this._point) {
case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;
case 1: this._point = 2; break;
case 2: this._point = 3; // proceed
default: point$4(this, x, y); break;
}
this._l01_a = this._l12_a, this._l12_a = this._l23_a;
this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;
this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;
this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;
}
};
var catmullRom = ((function custom(alpha) {
function catmullRom(context) {
return alpha ? new CatmullRom(context, alpha) : new Cardinal(context, 0);
}
catmullRom.alpha = function(alpha) {
return custom(+alpha);
};
return catmullRom;
}))(0.5);
function CatmullRomClosed(context, alpha) {
this._context = context;
this._alpha = alpha;
}
CatmullRomClosed.prototype = {
areaStart: noop$2,
areaEnd: noop$2,
lineStart: function() {
this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 =
this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;
this._l01_a = this._l12_a = this._l23_a =
this._l01_2a = this._l12_2a = this._l23_2a =
this._point = 0;
},
lineEnd: function() {
switch (this._point) {
case 1: {
this._context.moveTo(this._x3, this._y3);
this._context.closePath();
break;
}
case 2: {
this._context.lineTo(this._x3, this._y3);
this._context.closePath();
break;
}
case 3: {
this.point(this._x3, this._y3);
this.point(this._x4, this._y4);
this.point(this._x5, this._y5);
break;
}
}
},
point: function(x, y) {
x = +x, y = +y;
if (this._point) {
var x23 = this._x2 - x,
y23 = this._y2 - y;
this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));
}
switch (this._point) {
case 0: this._point = 1; this._x3 = x, this._y3 = y; break;
case 1: this._point = 2; this._context.moveTo(this._x4 = x, this._y4 = y); break;
case 2: this._point = 3; this._x5 = x, this._y5 = y; break;
default: point$4(this, x, y); break;
}
this._l01_a = this._l12_a, this._l12_a = this._l23_a;
this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;
this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;
this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;
}
};
var catmullRomClosed = ((function custom(alpha) {
function catmullRom(context) {
return alpha ? new CatmullRomClosed(context, alpha) : new CardinalClosed(context, 0);
}
catmullRom.alpha = function(alpha) {
return custom(+alpha);
};
return catmullRom;
}))(0.5);
function CatmullRomOpen(context, alpha) {
this._context = context;
this._alpha = alpha;
}
CatmullRomOpen.prototype = {
areaStart: function() {
this._line = 0;
},
areaEnd: function() {
this._line = NaN;
},
lineStart: function() {
this._x0 = this._x1 = this._x2 =
this._y0 = this._y1 = this._y2 = NaN;
this._l01_a = this._l12_a = this._l23_a =
this._l01_2a = this._l12_2a = this._l23_2a =
this._point = 0;
},
lineEnd: function() {
if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();
this._line = 1 - this._line;
},
point: function(x, y) {
x = +x, y = +y;
if (this._point) {
var x23 = this._x2 - x,
y23 = this._y2 - y;
this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));
}
switch (this._point) {
case 0: this._point = 1; break;
case 1: this._point = 2; break;
case 2: this._point = 3; this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); break;
case 3: this._point = 4; // proceed
default: point$4(this, x, y); break;
}
this._l01_a = this._l12_a, this._l12_a = this._l23_a;
this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;
this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;
this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;
}
};
var catmullRomOpen = ((function custom(alpha) {
function catmullRom(context) {
return alpha ? new CatmullRomOpen(context, alpha) : new CardinalOpen(context, 0);
}
catmullRom.alpha = function(alpha) {
return custom(+alpha);
};
return catmullRom;
}))(0.5);
function LinearClosed(context) {
this._context = context;
}
LinearClosed.prototype = {
areaStart: noop$2,
areaEnd: noop$2,
lineStart: function() {
this._point = 0;
},
lineEnd: function() {
if (this._point) this._context.closePath();
},
point: function(x, y) {
x = +x, y = +y;
if (this._point) this._context.lineTo(x, y);
else this._point = 1, this._context.moveTo(x, y);
}
};
var linearClosed = function(context) {
return new LinearClosed(context);
};
function sign$1(x) {
return x < 0 ? -1 : 1;
}
// Calculate the slopes of the tangents (Hermite-type interpolation) based on
// the following paper: Steffen, M. 1990. A Simple Method for Monotonic
// Interpolation in One Dimension. Astronomy and Astrophysics, Vol. 239, NO.
// NOV(II), P. 443, 1990.
function slope3(that, x2, y2) {
var h0 = that._x1 - that._x0,
h1 = x2 - that._x1,
s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0),
s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0),
p = (s0 * h1 + s1 * h0) / (h0 + h1);
return (sign$1(s0) + sign$1(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0;
}
// Calculate a one-sided slope.
function slope2(that, t) {
var h = that._x1 - that._x0;
return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;
}
// According to https://en.wikipedia.org/wiki/Cubic_Hermite_spline#Representations
// "you can express cubic Hermite interpolation in terms of cubic Bézier curves
// with respect to the four values p0, p0 + m0 / 3, p1 - m1 / 3, p1".
function point$5(that, t0, t1) {
var x0 = that._x0,
y0 = that._y0,
x1 = that._x1,
y1 = that._y1,
dx = (x1 - x0) / 3;
that._context.bezierCurveTo(x0 + dx, y0 + dx * t0, x1 - dx, y1 - dx * t1, x1, y1);
}
function MonotoneX(context) {
this._context = context;
}
MonotoneX.prototype = {
areaStart: function() {
this._line = 0;
},
areaEnd: function() {
this._line = NaN;
},
lineStart: function() {
this._x0 = this._x1 =
this._y0 = this._y1 =
this._t0 = NaN;
this._point = 0;
},
lineEnd: function() {
switch (this._point) {
case 2: this._context.lineTo(this._x1, this._y1); break;
case 3: point$5(this, this._t0, slope2(this, this._t0)); break;
}
if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();
this._line = 1 - this._line;
},
point: function(x, y) {
var t1 = NaN;
x = +x, y = +y;
if (x === this._x1 && y === this._y1) return; // Ignore coincident points.
switch (this._point) {
case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;
case 1: this._point = 2; break;
case 2: this._point = 3; point$5(this, slope2(this, t1 = slope3(this, x, y)), t1); break;
default: point$5(this, this._t0, t1 = slope3(this, x, y)); break;
}
this._x0 = this._x1, this._x1 = x;
this._y0 = this._y1, this._y1 = y;
this._t0 = t1;
}
};
function MonotoneY(context) {
this._context = new ReflectContext(context);
}
(MonotoneY.prototype = Object.create(MonotoneX.prototype)).point = function(x, y) {
MonotoneX.prototype.point.call(this, y, x);
};
function ReflectContext(context) {
this._context = context;
}
ReflectContext.prototype = {
moveTo: function(x, y) { this._context.moveTo(y, x); },
closePath: function() { this._context.closePath(); },
lineTo: function(x, y) { this._context.lineTo(y, x); },
bezierCurveTo: function(x1, y1, x2, y2, x, y) { this._context.bezierCurveTo(y1, x1, y2, x2, y, x); }
};
function monotoneX(context) {
return new MonotoneX(context);
}
function monotoneY(context) {
return new MonotoneY(context);
}
function Natural(context) {
this._context = context;
}
Natural.prototype = {
areaStart: function() {
this._line = 0;
},
areaEnd: function() {
this._line = NaN;
},
lineStart: function() {
this._x = [];
this._y = [];
},
lineEnd: function() {
var x = this._x,
y = this._y,
n = x.length;
if (n) {
this._line ? this._context.lineTo(x[0], y[0]) : this._context.moveTo(x[0], y[0]);
if (n === 2) {
this._context.lineTo(x[1], y[1]);
} else {
var px = controlPoints(x),
py = controlPoints(y);
for (var i0 = 0, i1 = 1; i1 < n; ++i0, ++i1) {
this._context.bezierCurveTo(px[0][i0], py[0][i0], px[1][i0], py[1][i0], x[i1], y[i1]);
}
}
}
if (this._line || (this._line !== 0 && n === 1)) this._context.closePath();
this._line = 1 - this._line;
this._x = this._y = null;
},
point: function(x, y) {
this._x.push(+x);
this._y.push(+y);
}
};
// See https://www.particleincell.com/2012/bezier-splines/ for derivation.
function controlPoints(x) {
var i,
n = x.length - 1,
m,
a = new Array(n),
b = new Array(n),
r = new Array(n);
a[0] = 0, b[0] = 2, r[0] = x[0] + 2 * x[1];
for (i = 1; i < n - 1; ++i) a[i] = 1, b[i] = 4, r[i] = 4 * x[i] + 2 * x[i + 1];
a[n - 1] = 2, b[n - 1] = 7, r[n - 1] = 8 * x[n - 1] + x[n];
for (i = 1; i < n; ++i) m = a[i] / b[i - 1], b[i] -= m, r[i] -= m * r[i - 1];
a[n - 1] = r[n - 1] / b[n - 1];
for (i = n - 2; i >= 0; --i) a[i] = (r[i] - a[i + 1]) / b[i];
b[n - 1] = (x[n] + a[n - 1]) / 2;
for (i = 0; i < n - 1; ++i) b[i] = 2 * x[i + 1] - a[i + 1];
return [a, b];
}
var natural = function(context) {
return new Natural(context);
};
function Step(context, t) {
this._context = context;
this._t = t;
}
Step.prototype = {
areaStart: function() {
this._line = 0;
},
areaEnd: function() {
this._line = NaN;
},
lineStart: function() {
this._x = this._y = NaN;
this._point = 0;
},
lineEnd: function() {
if (0 < this._t && this._t < 1 && this._point === 2) this._context.lineTo(this._x, this._y);
if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();
if (this._line >= 0) this._t = 1 - this._t, this._line = 1 - this._line;
},
point: function(x, y) {
x = +x, y = +y;
switch (this._point) {
case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;
case 1: this._point = 2; // proceed
default: {
if (this._t <= 0) {
this._context.lineTo(this._x, y);
this._context.lineTo(x, y);
} else {
var x1 = this._x * (1 - this._t) + x * this._t;
this._context.lineTo(x1, this._y);
this._context.lineTo(x1, y);
}
break;
}
}
this._x = x, this._y = y;
}
};
var step = function(context) {
return new Step(context, 0.5);
};
function stepBefore(context) {
return new Step(context, 0);
}
function stepAfter(context) {
return new Step(context, 1);
}
var none$1 = function(series, order) {
if (!((n = series.length) > 1)) return;
for (var i = 1, j, s0, s1 = series[order[0]], n, m = s1.length; i < n; ++i) {
s0 = s1, s1 = series[order[i]];
for (j = 0; j < m; ++j) {
s1[j][1] += s1[j][0] = isNaN(s0[j][1]) ? s0[j][0] : s0[j][1];
}
}
};
var none$2 = function(series) {
var n = series.length, o = new Array(n);
while (--n >= 0) o[n] = n;
return o;
};
function stackValue(d, key) {
return d[key];
}
var stack = function() {
var keys = constant$10([]),
order = none$2,
offset = none$1,
value = stackValue;
function stack(data) {
var kz = keys.apply(this, arguments),
i,
m = data.length,
n = kz.length,
sz = new Array(n),
oz;
for (i = 0; i < n; ++i) {
for (var ki = kz[i], si = sz[i] = new Array(m), j = 0, sij; j < m; ++j) {
si[j] = sij = [0, +value(data[j], ki, j, data)];
sij.data = data[j];
}
si.key = ki;
}
for (i = 0, oz = order(sz); i < n; ++i) {
sz[oz[i]].index = i;
}
offset(sz, oz);
return sz;
}
stack.keys = function(_) {
return arguments.length ? (keys = typeof _ === "function" ? _ : constant$10(slice$5.call(_)), stack) : keys;
};
stack.value = function(_) {
return arguments.length ? (value = typeof _ === "function" ? _ : constant$10(+_), stack) : value;
};
stack.order = function(_) {
return arguments.length ? (order = _ == null ? none$2 : typeof _ === "function" ? _ : constant$10(slice$5.call(_)), stack) : order;
};
stack.offset = function(_) {
return arguments.length ? (offset = _ == null ? none$1 : _, stack) : offset;
};
return stack;
};
var expand = function(series, order) {
if (!((n = series.length) > 0)) return;
for (var i, n, j = 0, m = series[0].length, y; j < m; ++j) {
for (y = i = 0; i < n; ++i) y += series[i][j][1] || 0;
if (y) for (i = 0; i < n; ++i) series[i][j][1] /= y;
}
none$1(series, order);
};
var diverging = function(series, order) {
if (!((n = series.length) > 1)) return;
for (var i, j = 0, d, dy, yp, yn, n, m = series[order[0]].length; j < m; ++j) {
for (yp = yn = 0, i = 0; i < n; ++i) {
if ((dy = (d = series[order[i]][j])[1] - d[0]) >= 0) {
d[0] = yp, d[1] = yp += dy;
} else if (dy < 0) {
d[1] = yn, d[0] = yn += dy;
} else {
d[0] = yp;
}
}
}
};
var silhouette = function(series, order) {
if (!((n = series.length) > 0)) return;
for (var j = 0, s0 = series[order[0]], n, m = s0.length; j < m; ++j) {
for (var i = 0, y = 0; i < n; ++i) y += series[i][j][1] || 0;
s0[j][1] += s0[j][0] = -y / 2;
}
none$1(series, order);
};
var wiggle = function(series, order) {
if (!((n = series.length) > 0) || !((m = (s0 = series[order[0]]).length) > 0)) return;
for (var y = 0, j = 1, s0, m, n; j < m; ++j) {
for (var i = 0, s1 = 0, s2 = 0; i < n; ++i) {
var si = series[order[i]],
sij0 = si[j][1] || 0,
sij1 = si[j - 1][1] || 0,
s3 = (sij0 - sij1) / 2;
for (var k = 0; k < i; ++k) {
var sk = series[order[k]],
skj0 = sk[j][1] || 0,
skj1 = sk[j - 1][1] || 0;
s3 += skj0 - skj1;
}
s1 += sij0, s2 += s3 * sij0;
}
s0[j - 1][1] += s0[j - 1][0] = y;
if (s1) y -= s2 / s1;
}
s0[j - 1][1] += s0[j - 1][0] = y;
none$1(series, order);
};
var ascending$2 = function(series) {
var sums = series.map(sum$2);
return none$2(series).sort(function(a, b) { return sums[a] - sums[b]; });
};
function sum$2(series) {
var s = 0, i = -1, n = series.length, v;
while (++i < n) if (v = +series[i][1]) s += v;
return s;
}
var descending$2 = function(series) {
return ascending$2(series).reverse();
};
var insideOut = function(series) {
var n = series.length,
i,
j,
sums = series.map(sum$2),
order = none$2(series).sort(function(a, b) { return sums[b] - sums[a]; }),
top = 0,
bottom = 0,
tops = [],
bottoms = [];
for (i = 0; i < n; ++i) {
j = order[i];
if (top < bottom) {
top += sums[j];
tops.push(j);
} else {
bottom += sums[j];
bottoms.push(j);
}
}
return bottoms.reverse().concat(tops);
};
var reverse = function(series) {
return none$2(series).reverse();
};
var constant$11 = function(x) {
return function() {
return x;
};
};
function x$4(d) {
return d[0];
}
function y$4(d) {
return d[1];
}
function RedBlackTree() {
this._ = null; // root node
}
function RedBlackNode(node) {
node.U = // parent node
node.C = // color - true for red, false for black
node.L = // left node
node.R = // right node
node.P = // previous node
node.N = null; // next node
}
RedBlackTree.prototype = {
constructor: RedBlackTree,
insert: function(after, node) {
var parent, grandpa, uncle;
if (after) {
node.P = after;
node.N = after.N;
if (after.N) after.N.P = node;
after.N = node;
if (after.R) {
after = after.R;
while (after.L) after = after.L;
after.L = node;
} else {
after.R = node;
}
parent = after;
} else if (this._) {
after = RedBlackFirst(this._);
node.P = null;
node.N = after;
after.P = after.L = node;
parent = after;
} else {
node.P = node.N = null;
this._ = node;
parent = null;
}
node.L = node.R = null;
node.U = parent;
node.C = true;
after = node;
while (parent && parent.C) {
grandpa = parent.U;
if (parent === grandpa.L) {
uncle = grandpa.R;
if (uncle && uncle.C) {
parent.C = uncle.C = false;
grandpa.C = true;
after = grandpa;
} else {
if (after === parent.R) {
RedBlackRotateLeft(this, parent);
after = parent;
parent = after.U;
}
parent.C = false;
grandpa.C = true;
RedBlackRotateRight(this, grandpa);
}
} else {
uncle = grandpa.L;
if (uncle && uncle.C) {
parent.C = uncle.C = false;
grandpa.C = true;
after = grandpa;
} else {
if (after === parent.L) {
RedBlackRotateRight(this, parent);
after = parent;
parent = after.U;
}
parent.C = false;
grandpa.C = true;
RedBlackRotateLeft(this, grandpa);
}
}
parent = after.U;
}
this._.C = false;
},
remove: function(node) {
if (node.N) node.N.P = node.P;
if (node.P) node.P.N = node.N;
node.N = node.P = null;
var parent = node.U,
sibling,
left = node.L,
right = node.R,
next,
red;
if (!left) next = right;
else if (!right) next = left;
else next = RedBlackFirst(right);
if (parent) {
if (parent.L === node) parent.L = next;
else parent.R = next;
} else {
this._ = next;
}
if (left && right) {
red = next.C;
next.C = node.C;
next.L = left;
left.U = next;
if (next !== right) {
parent = next.U;
next.U = node.U;
node = next.R;
parent.L = node;
next.R = right;
right.U = next;
} else {
next.U = parent;
parent = next;
node = next.R;
}
} else {
red = node.C;
node = next;
}
if (node) node.U = parent;
if (red) return;
if (node && node.C) { node.C = false; return; }
do {
if (node === this._) break;
if (node === parent.L) {
sibling = parent.R;
if (sibling.C) {
sibling.C = false;
parent.C = true;
RedBlackRotateLeft(this, parent);
sibling = parent.R;
}
if ((sibling.L && sibling.L.C)
|| (sibling.R && sibling.R.C)) {
if (!sibling.R || !sibling.R.C) {
sibling.L.C = false;
sibling.C = true;
RedBlackRotateRight(this, sibling);
sibling = parent.R;
}
sibling.C = parent.C;
parent.C = sibling.R.C = false;
RedBlackRotateLeft(this, parent);
node = this._;
break;
}
} else {
sibling = parent.L;
if (sibling.C) {
sibling.C = false;
parent.C = true;
RedBlackRotateRight(this, parent);
sibling = parent.L;
}
if ((sibling.L && sibling.L.C)
|| (sibling.R && sibling.R.C)) {
if (!sibling.L || !sibling.L.C) {
sibling.R.C = false;
sibling.C = true;
RedBlackRotateLeft(this, sibling);
sibling = parent.L;
}
sibling.C = parent.C;
parent.C = sibling.L.C = false;
RedBlackRotateRight(this, parent);
node = this._;
break;
}
}
sibling.C = true;
node = parent;
parent = parent.U;
} while (!node.C);
if (node) node.C = false;
}
};
function RedBlackRotateLeft(tree, node) {
var p = node,
q = node.R,
parent = p.U;
if (parent) {
if (parent.L === p) parent.L = q;
else parent.R = q;
} else {
tree._ = q;
}
q.U = parent;
p.U = q;
p.R = q.L;
if (p.R) p.R.U = p;
q.L = p;
}
function RedBlackRotateRight(tree, node) {
var p = node,
q = node.L,
parent = p.U;
if (parent) {
if (parent.L === p) parent.L = q;
else parent.R = q;
} else {
tree._ = q;
}
q.U = parent;
p.U = q;
p.L = q.R;
if (p.L) p.L.U = p;
q.R = p;
}
function RedBlackFirst(node) {
while (node.L) node = node.L;
return node;
}
function createEdge(left, right, v0, v1) {
var edge = [null, null],
index = edges.push(edge) - 1;
edge.left = left;
edge.right = right;
if (v0) setEdgeEnd(edge, left, right, v0);
if (v1) setEdgeEnd(edge, right, left, v1);
cells[left.index].halfedges.push(index);
cells[right.index].halfedges.push(index);
return edge;
}
function createBorderEdge(left, v0, v1) {
var edge = [v0, v1];
edge.left = left;
return edge;
}
function setEdgeEnd(edge, left, right, vertex) {
if (!edge[0] && !edge[1]) {
edge[0] = vertex;
edge.left = left;
edge.right = right;
} else if (edge.left === right) {
edge[1] = vertex;
} else {
edge[0] = vertex;
}
}
// LiangBarsky line clipping.
function clipEdge(edge, x0, y0, x1, y1) {
var a = edge[0],
b = edge[1],
ax = a[0],
ay = a[1],
bx = b[0],
by = b[1],
t0 = 0,
t1 = 1,
dx = bx - ax,
dy = by - ay,
r;
r = x0 - ax;
if (!dx && r > 0) return;
r /= dx;
if (dx < 0) {
if (r < t0) return;
if (r < t1) t1 = r;
} else if (dx > 0) {
if (r > t1) return;
if (r > t0) t0 = r;
}
r = x1 - ax;
if (!dx && r < 0) return;
r /= dx;
if (dx < 0) {
if (r > t1) return;
if (r > t0) t0 = r;
} else if (dx > 0) {
if (r < t0) return;
if (r < t1) t1 = r;
}
r = y0 - ay;
if (!dy && r > 0) return;
r /= dy;
if (dy < 0) {
if (r < t0) return;
if (r < t1) t1 = r;
} else if (dy > 0) {
if (r > t1) return;
if (r > t0) t0 = r;
}
r = y1 - ay;
if (!dy && r < 0) return;
r /= dy;
if (dy < 0) {
if (r > t1) return;
if (r > t0) t0 = r;
} else if (dy > 0) {
if (r < t0) return;
if (r < t1) t1 = r;
}
if (!(t0 > 0) && !(t1 < 1)) return true; // TODO Better check?
if (t0 > 0) edge[0] = [ax + t0 * dx, ay + t0 * dy];
if (t1 < 1) edge[1] = [ax + t1 * dx, ay + t1 * dy];
return true;
}
function connectEdge(edge, x0, y0, x1, y1) {
var v1 = edge[1];
if (v1) return true;
var v0 = edge[0],
left = edge.left,
right = edge.right,
lx = left[0],
ly = left[1],
rx = right[0],
ry = right[1],
fx = (lx + rx) / 2,
fy = (ly + ry) / 2,
fm,
fb;
if (ry === ly) {
if (fx < x0 || fx >= x1) return;
if (lx > rx) {
if (!v0) v0 = [fx, y0];
else if (v0[1] >= y1) return;
v1 = [fx, y1];
} else {
if (!v0) v0 = [fx, y1];
else if (v0[1] < y0) return;
v1 = [fx, y0];
}
} else {
fm = (lx - rx) / (ry - ly);
fb = fy - fm * fx;
if (fm < -1 || fm > 1) {
if (lx > rx) {
if (!v0) v0 = [(y0 - fb) / fm, y0];
else if (v0[1] >= y1) return;
v1 = [(y1 - fb) / fm, y1];
} else {
if (!v0) v0 = [(y1 - fb) / fm, y1];
else if (v0[1] < y0) return;
v1 = [(y0 - fb) / fm, y0];
}
} else {
if (ly < ry) {
if (!v0) v0 = [x0, fm * x0 + fb];
else if (v0[0] >= x1) return;
v1 = [x1, fm * x1 + fb];
} else {
if (!v0) v0 = [x1, fm * x1 + fb];
else if (v0[0] < x0) return;
v1 = [x0, fm * x0 + fb];
}
}
}
edge[0] = v0;
edge[1] = v1;
return true;
}
function clipEdges(x0, y0, x1, y1) {
var i = edges.length,
edge;
while (i--) {
if (!connectEdge(edge = edges[i], x0, y0, x1, y1)
|| !clipEdge(edge, x0, y0, x1, y1)
|| !(Math.abs(edge[0][0] - edge[1][0]) > epsilon$4
|| Math.abs(edge[0][1] - edge[1][1]) > epsilon$4)) {
delete edges[i];
}
}
}
function createCell(site) {
return cells[site.index] = {
site: site,
halfedges: []
};
}
function cellHalfedgeAngle(cell, edge) {
var site = cell.site,
va = edge.left,
vb = edge.right;
if (site === vb) vb = va, va = site;
if (vb) return Math.atan2(vb[1] - va[1], vb[0] - va[0]);
if (site === va) va = edge[1], vb = edge[0];
else va = edge[0], vb = edge[1];
return Math.atan2(va[0] - vb[0], vb[1] - va[1]);
}
function cellHalfedgeStart(cell, edge) {
return edge[+(edge.left !== cell.site)];
}
function cellHalfedgeEnd(cell, edge) {
return edge[+(edge.left === cell.site)];
}
function sortCellHalfedges() {
for (var i = 0, n = cells.length, cell, halfedges, j, m; i < n; ++i) {
if ((cell = cells[i]) && (m = (halfedges = cell.halfedges).length)) {
var index = new Array(m),
array = new Array(m);
for (j = 0; j < m; ++j) index[j] = j, array[j] = cellHalfedgeAngle(cell, edges[halfedges[j]]);
index.sort(function(i, j) { return array[j] - array[i]; });
for (j = 0; j < m; ++j) array[j] = halfedges[index[j]];
for (j = 0; j < m; ++j) halfedges[j] = array[j];
}
}
}
function clipCells(x0, y0, x1, y1) {
var nCells = cells.length,
iCell,
cell,
site,
iHalfedge,
halfedges,
nHalfedges,
start,
startX,
startY,
end,
endX,
endY,
cover = true;
for (iCell = 0; iCell < nCells; ++iCell) {
if (cell = cells[iCell]) {
site = cell.site;
halfedges = cell.halfedges;
iHalfedge = halfedges.length;
// Remove any dangling clipped edges.
while (iHalfedge--) {
if (!edges[halfedges[iHalfedge]]) {
halfedges.splice(iHalfedge, 1);
}
}
// Insert any border edges as necessary.
iHalfedge = 0, nHalfedges = halfedges.length;
while (iHalfedge < nHalfedges) {
end = cellHalfedgeEnd(cell, edges[halfedges[iHalfedge]]), endX = end[0], endY = end[1];
start = cellHalfedgeStart(cell, edges[halfedges[++iHalfedge % nHalfedges]]), startX = start[0], startY = start[1];
if (Math.abs(endX - startX) > epsilon$4 || Math.abs(endY - startY) > epsilon$4) {
halfedges.splice(iHalfedge, 0, edges.push(createBorderEdge(site, end,
Math.abs(endX - x0) < epsilon$4 && y1 - endY > epsilon$4 ? [x0, Math.abs(startX - x0) < epsilon$4 ? startY : y1]
: Math.abs(endY - y1) < epsilon$4 && x1 - endX > epsilon$4 ? [Math.abs(startY - y1) < epsilon$4 ? startX : x1, y1]
: Math.abs(endX - x1) < epsilon$4 && endY - y0 > epsilon$4 ? [x1, Math.abs(startX - x1) < epsilon$4 ? startY : y0]
: Math.abs(endY - y0) < epsilon$4 && endX - x0 > epsilon$4 ? [Math.abs(startY - y0) < epsilon$4 ? startX : x0, y0]
: null)) - 1);
++nHalfedges;
}
}
if (nHalfedges) cover = false;
}
}
// If there werent any edges, have the closest site cover the extent.
// It doesnt matter which corner of the extent we measure!
if (cover) {
var dx, dy, d2, dc = Infinity;
for (iCell = 0, cover = null; iCell < nCells; ++iCell) {
if (cell = cells[iCell]) {
site = cell.site;
dx = site[0] - x0;
dy = site[1] - y0;
d2 = dx * dx + dy * dy;
if (d2 < dc) dc = d2, cover = cell;
}
}
if (cover) {
var v00 = [x0, y0], v01 = [x0, y1], v11 = [x1, y1], v10 = [x1, y0];
cover.halfedges.push(
edges.push(createBorderEdge(site = cover.site, v00, v01)) - 1,
edges.push(createBorderEdge(site, v01, v11)) - 1,
edges.push(createBorderEdge(site, v11, v10)) - 1,
edges.push(createBorderEdge(site, v10, v00)) - 1
);
}
}
// Lastly delete any cells with no edges; these were entirely clipped.
for (iCell = 0; iCell < nCells; ++iCell) {
if (cell = cells[iCell]) {
if (!cell.halfedges.length) {
delete cells[iCell];
}
}
}
}
var circlePool = [];
var firstCircle;
function Circle() {
RedBlackNode(this);
this.x =
this.y =
this.arc =
this.site =
this.cy = null;
}
function attachCircle(arc) {
var lArc = arc.P,
rArc = arc.N;
if (!lArc || !rArc) return;
var lSite = lArc.site,
cSite = arc.site,
rSite = rArc.site;
if (lSite === rSite) return;
var bx = cSite[0],
by = cSite[1],
ax = lSite[0] - bx,
ay = lSite[1] - by,
cx = rSite[0] - bx,
cy = rSite[1] - by;
var d = 2 * (ax * cy - ay * cx);
if (d >= -epsilon2$2) return;
var ha = ax * ax + ay * ay,
hc = cx * cx + cy * cy,
x = (cy * ha - ay * hc) / d,
y = (ax * hc - cx * ha) / d;
var circle = circlePool.pop() || new Circle;
circle.arc = arc;
circle.site = cSite;
circle.x = x + bx;
circle.y = (circle.cy = y + by) + Math.sqrt(x * x + y * y); // y bottom
arc.circle = circle;
var before = null,
node = circles._;
while (node) {
if (circle.y < node.y || (circle.y === node.y && circle.x <= node.x)) {
if (node.L) node = node.L;
else { before = node.P; break; }
} else {
if (node.R) node = node.R;
else { before = node; break; }
}
}
circles.insert(before, circle);
if (!before) firstCircle = circle;
}
function detachCircle(arc) {
var circle = arc.circle;
if (circle) {
if (!circle.P) firstCircle = circle.N;
circles.remove(circle);
circlePool.push(circle);
RedBlackNode(circle);
arc.circle = null;
}
}
var beachPool = [];
function Beach() {
RedBlackNode(this);
this.edge =
this.site =
this.circle = null;
}
function createBeach(site) {
var beach = beachPool.pop() || new Beach;
beach.site = site;
return beach;
}
function detachBeach(beach) {
detachCircle(beach);
beaches.remove(beach);
beachPool.push(beach);
RedBlackNode(beach);
}
function removeBeach(beach) {
var circle = beach.circle,
x = circle.x,
y = circle.cy,
vertex = [x, y],
previous = beach.P,
next = beach.N,
disappearing = [beach];
detachBeach(beach);
var lArc = previous;
while (lArc.circle
&& Math.abs(x - lArc.circle.x) < epsilon$4
&& Math.abs(y - lArc.circle.cy) < epsilon$4) {
previous = lArc.P;
disappearing.unshift(lArc);
detachBeach(lArc);
lArc = previous;
}
disappearing.unshift(lArc);
detachCircle(lArc);
var rArc = next;
while (rArc.circle
&& Math.abs(x - rArc.circle.x) < epsilon$4
&& Math.abs(y - rArc.circle.cy) < epsilon$4) {
next = rArc.N;
disappearing.push(rArc);
detachBeach(rArc);
rArc = next;
}
disappearing.push(rArc);
detachCircle(rArc);
var nArcs = disappearing.length,
iArc;
for (iArc = 1; iArc < nArcs; ++iArc) {
rArc = disappearing[iArc];
lArc = disappearing[iArc - 1];
setEdgeEnd(rArc.edge, lArc.site, rArc.site, vertex);
}
lArc = disappearing[0];
rArc = disappearing[nArcs - 1];
rArc.edge = createEdge(lArc.site, rArc.site, null, vertex);
attachCircle(lArc);
attachCircle(rArc);
}
function addBeach(site) {
var x = site[0],
directrix = site[1],
lArc,
rArc,
dxl,
dxr,
node = beaches._;
while (node) {
dxl = leftBreakPoint(node, directrix) - x;
if (dxl > epsilon$4) node = node.L; else {
dxr = x - rightBreakPoint(node, directrix);
if (dxr > epsilon$4) {
if (!node.R) {
lArc = node;
break;
}
node = node.R;
} else {
if (dxl > -epsilon$4) {
lArc = node.P;
rArc = node;
} else if (dxr > -epsilon$4) {
lArc = node;
rArc = node.N;
} else {
lArc = rArc = node;
}
break;
}
}
}
createCell(site);
var newArc = createBeach(site);
beaches.insert(lArc, newArc);
if (!lArc && !rArc) return;
if (lArc === rArc) {
detachCircle(lArc);
rArc = createBeach(lArc.site);
beaches.insert(newArc, rArc);
newArc.edge = rArc.edge = createEdge(lArc.site, newArc.site);
attachCircle(lArc);
attachCircle(rArc);
return;
}
if (!rArc) { // && lArc
newArc.edge = createEdge(lArc.site, newArc.site);
return;
}
// else lArc !== rArc
detachCircle(lArc);
detachCircle(rArc);
var lSite = lArc.site,
ax = lSite[0],
ay = lSite[1],
bx = site[0] - ax,
by = site[1] - ay,
rSite = rArc.site,
cx = rSite[0] - ax,
cy = rSite[1] - ay,
d = 2 * (bx * cy - by * cx),
hb = bx * bx + by * by,
hc = cx * cx + cy * cy,
vertex = [(cy * hb - by * hc) / d + ax, (bx * hc - cx * hb) / d + ay];
setEdgeEnd(rArc.edge, lSite, rSite, vertex);
newArc.edge = createEdge(lSite, site, null, vertex);
rArc.edge = createEdge(site, rSite, null, vertex);
attachCircle(lArc);
attachCircle(rArc);
}
function leftBreakPoint(arc, directrix) {
var site = arc.site,
rfocx = site[0],
rfocy = site[1],
pby2 = rfocy - directrix;
if (!pby2) return rfocx;
var lArc = arc.P;
if (!lArc) return -Infinity;
site = lArc.site;
var lfocx = site[0],
lfocy = site[1],
plby2 = lfocy - directrix;
if (!plby2) return lfocx;
var hl = lfocx - rfocx,
aby2 = 1 / pby2 - 1 / plby2,
b = hl / plby2;
if (aby2) return (-b + Math.sqrt(b * b - 2 * aby2 * (hl * hl / (-2 * plby2) - lfocy + plby2 / 2 + rfocy - pby2 / 2))) / aby2 + rfocx;
return (rfocx + lfocx) / 2;
}
function rightBreakPoint(arc, directrix) {
var rArc = arc.N;
if (rArc) return leftBreakPoint(rArc, directrix);
var site = arc.site;
return site[1] === directrix ? site[0] : Infinity;
}
var epsilon$4 = 1e-6;
var epsilon2$2 = 1e-12;
var beaches;
var cells;
var circles;
var edges;
function triangleArea(a, b, c) {
return (a[0] - c[0]) * (b[1] - a[1]) - (a[0] - b[0]) * (c[1] - a[1]);
}
function lexicographic(a, b) {
return b[1] - a[1]
|| b[0] - a[0];
}
function Diagram(sites, extent) {
var site = sites.sort(lexicographic).pop(),
x,
y,
circle;
edges = [];
cells = new Array(sites.length);
beaches = new RedBlackTree;
circles = new RedBlackTree;
while (true) {
circle = firstCircle;
if (site && (!circle || site[1] < circle.y || (site[1] === circle.y && site[0] < circle.x))) {
if (site[0] !== x || site[1] !== y) {
addBeach(site);
x = site[0], y = site[1];
}
site = sites.pop();
} else if (circle) {
removeBeach(circle.arc);
} else {
break;
}
}
sortCellHalfedges();
if (extent) {
var x0 = +extent[0][0],
y0 = +extent[0][1],
x1 = +extent[1][0],
y1 = +extent[1][1];
clipEdges(x0, y0, x1, y1);
clipCells(x0, y0, x1, y1);
}
this.edges = edges;
this.cells = cells;
beaches =
circles =
edges =
cells = null;
}
Diagram.prototype = {
constructor: Diagram,
polygons: function() {
var edges = this.edges;
return this.cells.map(function(cell) {
var polygon = cell.halfedges.map(function(i) { return cellHalfedgeStart(cell, edges[i]); });
polygon.data = cell.site.data;
return polygon;
});
},
triangles: function() {
var triangles = [],
edges = this.edges;
this.cells.forEach(function(cell, i) {
if (!(m = (halfedges = cell.halfedges).length)) return;
var site = cell.site,
halfedges,
j = -1,
m,
s0,
e1 = edges[halfedges[m - 1]],
s1 = e1.left === site ? e1.right : e1.left;
while (++j < m) {
s0 = s1;
e1 = edges[halfedges[j]];
s1 = e1.left === site ? e1.right : e1.left;
if (s0 && s1 && i < s0.index && i < s1.index && triangleArea(site, s0, s1) < 0) {
triangles.push([site.data, s0.data, s1.data]);
}
}
});
return triangles;
},
links: function() {
return this.edges.filter(function(edge) {
return edge.right;
}).map(function(edge) {
return {
source: edge.left.data,
target: edge.right.data
};
});
},
find: function(x, y, radius) {
var that = this, i0, i1 = that._found || 0, n = that.cells.length, cell;
// Use the previously-found cell, or start with an arbitrary one.
while (!(cell = that.cells[i1])) if (++i1 >= n) return null;
var dx = x - cell.site[0], dy = y - cell.site[1], d2 = dx * dx + dy * dy;
// Traverse the half-edges to find a closer cell, if any.
do {
cell = that.cells[i0 = i1], i1 = null;
cell.halfedges.forEach(function(e) {
var edge = that.edges[e], v = edge.left;
if ((v === cell.site || !v) && !(v = edge.right)) return;
var vx = x - v[0], vy = y - v[1], v2 = vx * vx + vy * vy;
if (v2 < d2) d2 = v2, i1 = v.index;
});
} while (i1 !== null);
that._found = i0;
return radius == null || d2 <= radius * radius ? cell.site : null;
}
};
var voronoi = function() {
var x$$1 = x$4,
y$$1 = y$4,
extent = null;
function voronoi(data) {
return new Diagram(data.map(function(d, i) {
var s = [Math.round(x$$1(d, i, data) / epsilon$4) * epsilon$4, Math.round(y$$1(d, i, data) / epsilon$4) * epsilon$4];
s.index = i;
s.data = d;
return s;
}), extent);
}
voronoi.polygons = function(data) {
return voronoi(data).polygons();
};
voronoi.links = function(data) {
return voronoi(data).links();
};
voronoi.triangles = function(data) {
return voronoi(data).triangles();
};
voronoi.x = function(_) {
return arguments.length ? (x$$1 = typeof _ === "function" ? _ : constant$11(+_), voronoi) : x$$1;
};
voronoi.y = function(_) {
return arguments.length ? (y$$1 = typeof _ === "function" ? _ : constant$11(+_), voronoi) : y$$1;
};
voronoi.extent = function(_) {
return arguments.length ? (extent = _ == null ? null : [[+_[0][0], +_[0][1]], [+_[1][0], +_[1][1]]], voronoi) : extent && [[extent[0][0], extent[0][1]], [extent[1][0], extent[1][1]]];
};
voronoi.size = function(_) {
return arguments.length ? (extent = _ == null ? null : [[0, 0], [+_[0], +_[1]]], voronoi) : extent && [extent[1][0] - extent[0][0], extent[1][1] - extent[0][1]];
};
return voronoi;
};
var constant$12 = function(x) {
return function() {
return x;
};
};
function ZoomEvent(target, type, transform) {
this.target = target;
this.type = type;
this.transform = transform;
}
function Transform(k, x, y) {
this.k = k;
this.x = x;
this.y = y;
}
Transform.prototype = {
constructor: Transform,
scale: function(k) {
return k === 1 ? this : new Transform(this.k * k, this.x, this.y);
},
translate: function(x, y) {
return x === 0 & y === 0 ? this : new Transform(this.k, this.x + this.k * x, this.y + this.k * y);
},
apply: function(point) {
return [point[0] * this.k + this.x, point[1] * this.k + this.y];
},
applyX: function(x) {
return x * this.k + this.x;
},
applyY: function(y) {
return y * this.k + this.y;
},
invert: function(location) {
return [(location[0] - this.x) / this.k, (location[1] - this.y) / this.k];
},
invertX: function(x) {
return (x - this.x) / this.k;
},
invertY: function(y) {
return (y - this.y) / this.k;
},
rescaleX: function(x) {
return x.copy().domain(x.range().map(this.invertX, this).map(x.invert, x));
},
rescaleY: function(y) {
return y.copy().domain(y.range().map(this.invertY, this).map(y.invert, y));
},
toString: function() {
return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")";
}
};
var identity$8 = new Transform(1, 0, 0);
transform$1.prototype = Transform.prototype;
function transform$1(node) {
return node.__zoom || identity$8;
}
function nopropagation$2() {
exports.event.stopImmediatePropagation();
}
var noevent$2 = function() {
exports.event.preventDefault();
exports.event.stopImmediatePropagation();
};
// Ignore right-click, since that should open the context menu.
function defaultFilter$2() {
return !exports.event.button;
}
function defaultExtent$1() {
var e = this, w, h;
if (e instanceof SVGElement) {
e = e.ownerSVGElement || e;
w = e.width.baseVal.value;
h = e.height.baseVal.value;
} else {
w = e.clientWidth;
h = e.clientHeight;
}
return [[0, 0], [w, h]];
}
function defaultTransform() {
return this.__zoom || identity$8;
}
var zoom = function() {
var filter = defaultFilter$2,
extent = defaultExtent$1,
k0 = 0,
k1 = Infinity,
x0 = -k1,
x1 = k1,
y0 = x0,
y1 = x1,
duration = 250,
interpolate$$1 = interpolateZoom,
gestures = [],
listeners = dispatch("start", "zoom", "end"),
touchstarting,
touchending,
touchDelay = 500,
wheelDelay = 150,
clickDistance2 = 0;
function zoom(selection$$1) {
selection$$1
.on("wheel.zoom", wheeled)
.on("mousedown.zoom", mousedowned)
.on("dblclick.zoom", dblclicked)
.on("touchstart.zoom", touchstarted)
.on("touchmove.zoom", touchmoved)
.on("touchend.zoom touchcancel.zoom", touchended)
.style("-webkit-tap-highlight-color", "rgba(0,0,0,0)")
.property("__zoom", defaultTransform);
}
zoom.transform = function(collection, transform) {
var selection$$1 = collection.selection ? collection.selection() : collection;
selection$$1.property("__zoom", defaultTransform);
if (collection !== selection$$1) {
schedule(collection, transform);
} else {
selection$$1.interrupt().each(function() {
gesture(this, arguments)
.start()
.zoom(null, typeof transform === "function" ? transform.apply(this, arguments) : transform)
.end();
});
}
};
zoom.scaleBy = function(selection$$1, k) {
zoom.scaleTo(selection$$1, function() {
var k0 = this.__zoom.k,
k1 = typeof k === "function" ? k.apply(this, arguments) : k;
return k0 * k1;
});
};
zoom.scaleTo = function(selection$$1, k) {
zoom.transform(selection$$1, function() {
var e = extent.apply(this, arguments),
t0 = this.__zoom,
p0 = centroid(e),
p1 = t0.invert(p0),
k1 = typeof k === "function" ? k.apply(this, arguments) : k;
return constrain(translate(scale(t0, k1), p0, p1), e);
});
};
zoom.translateBy = function(selection$$1, x, y) {
zoom.transform(selection$$1, function() {
return constrain(this.__zoom.translate(
typeof x === "function" ? x.apply(this, arguments) : x,
typeof y === "function" ? y.apply(this, arguments) : y
), extent.apply(this, arguments));
});
};
function scale(transform, k) {
k = Math.max(k0, Math.min(k1, k));
return k === transform.k ? transform : new Transform(k, transform.x, transform.y);
}
function translate(transform, p0, p1) {
var x = p0[0] - p1[0] * transform.k, y = p0[1] - p1[1] * transform.k;
return x === transform.x && y === transform.y ? transform : new Transform(transform.k, x, y);
}
function constrain(transform, extent) {
var dx0 = transform.invertX(extent[0][0]) - x0,
dx1 = transform.invertX(extent[1][0]) - x1,
dy0 = transform.invertY(extent[0][1]) - y0,
dy1 = transform.invertY(extent[1][1]) - y1;
return transform.translate(
dx1 > dx0 ? (dx0 + dx1) / 2 : Math.min(0, dx0) || Math.max(0, dx1),
dy1 > dy0 ? (dy0 + dy1) / 2 : Math.min(0, dy0) || Math.max(0, dy1)
);
}
function centroid(extent) {
return [(+extent[0][0] + +extent[1][0]) / 2, (+extent[0][1] + +extent[1][1]) / 2];
}
function schedule(transition$$1, transform, center) {
transition$$1
.on("start.zoom", function() { gesture(this, arguments).start(); })
.on("interrupt.zoom end.zoom", function() { gesture(this, arguments).end(); })
.tween("zoom", function() {
var that = this,
args = arguments,
g = gesture(that, args),
e = extent.apply(that, args),
p = center || centroid(e),
w = Math.max(e[1][0] - e[0][0], e[1][1] - e[0][1]),
a = that.__zoom,
b = typeof transform === "function" ? transform.apply(that, args) : transform,
i = interpolate$$1(a.invert(p).concat(w / a.k), b.invert(p).concat(w / b.k));
return function(t) {
if (t === 1) t = b; // Avoid rounding error on end.
else { var l = i(t), k = w / l[2]; t = new Transform(k, p[0] - l[0] * k, p[1] - l[1] * k); }
g.zoom(null, t);
};
});
}
function gesture(that, args) {
for (var i = 0, n = gestures.length, g; i < n; ++i) {
if ((g = gestures[i]).that === that) {
return g;
}
}
return new Gesture(that, args);
}
function Gesture(that, args) {
this.that = that;
this.args = args;
this.index = -1;
this.active = 0;
this.extent = extent.apply(that, args);
}
Gesture.prototype = {
start: function() {
if (++this.active === 1) {
this.index = gestures.push(this) - 1;
this.emit("start");
}
return this;
},
zoom: function(key, transform) {
if (this.mouse && key !== "mouse") this.mouse[1] = transform.invert(this.mouse[0]);
if (this.touch0 && key !== "touch") this.touch0[1] = transform.invert(this.touch0[0]);
if (this.touch1 && key !== "touch") this.touch1[1] = transform.invert(this.touch1[0]);
this.that.__zoom = transform;
this.emit("zoom");
return this;
},
end: function() {
if (--this.active === 0) {
gestures.splice(this.index, 1);
this.index = -1;
this.emit("end");
}
return this;
},
emit: function(type) {
customEvent(new ZoomEvent(zoom, type, this.that.__zoom), listeners.apply, listeners, [type, this.that, this.args]);
}
};
function wheeled() {
if (!filter.apply(this, arguments)) return;
var g = gesture(this, arguments),
t = this.__zoom,
k = Math.max(k0, Math.min(k1, t.k * Math.pow(2, -exports.event.deltaY * (exports.event.deltaMode ? 120 : 1) / 500))),
p = mouse(this);
// If the mouse is in the same location as before, reuse it.
// If there were recent wheel events, reset the wheel idle timeout.
if (g.wheel) {
if (g.mouse[0][0] !== p[0] || g.mouse[0][1] !== p[1]) {
g.mouse[1] = t.invert(g.mouse[0] = p);
}
clearTimeout(g.wheel);
}
// If this wheel event wont trigger a transform change, ignore it.
else if (t.k === k) return;
// Otherwise, capture the mouse point and location at the start.
else {
g.mouse = [p, t.invert(p)];
interrupt(this);
g.start();
}
noevent$2();
g.wheel = setTimeout(wheelidled, wheelDelay);
g.zoom("mouse", constrain(translate(scale(t, k), g.mouse[0], g.mouse[1]), g.extent));
function wheelidled() {
g.wheel = null;
g.end();
}
}
function mousedowned() {
if (touchending || !filter.apply(this, arguments)) return;
var g = gesture(this, arguments),
v = select(exports.event.view).on("mousemove.zoom", mousemoved, true).on("mouseup.zoom", mouseupped, true),
p = mouse(this),
x0 = exports.event.clientX,
y0 = exports.event.clientY;
dragDisable(exports.event.view);
nopropagation$2();
g.mouse = [p, this.__zoom.invert(p)];
interrupt(this);
g.start();
function mousemoved() {
noevent$2();
if (!g.moved) {
var dx = exports.event.clientX - x0, dy = exports.event.clientY - y0;
g.moved = dx * dx + dy * dy > clickDistance2;
}
g.zoom("mouse", constrain(translate(g.that.__zoom, g.mouse[0] = mouse(g.that), g.mouse[1]), g.extent));
}
function mouseupped() {
v.on("mousemove.zoom mouseup.zoom", null);
yesdrag(exports.event.view, g.moved);
noevent$2();
g.end();
}
}
function dblclicked() {
if (!filter.apply(this, arguments)) return;
var t0 = this.__zoom,
p0 = mouse(this),
p1 = t0.invert(p0),
k1 = t0.k * (exports.event.shiftKey ? 0.5 : 2),
t1 = constrain(translate(scale(t0, k1), p0, p1), extent.apply(this, arguments));
noevent$2();
if (duration > 0) select(this).transition().duration(duration).call(schedule, t1, p0);
else select(this).call(zoom.transform, t1);
}
function touchstarted() {
if (!filter.apply(this, arguments)) return;
var g = gesture(this, arguments),
touches$$1 = exports.event.changedTouches,
started,
n = touches$$1.length, i, t, p;
nopropagation$2();
for (i = 0; i < n; ++i) {
t = touches$$1[i], p = touch(this, touches$$1, t.identifier);
p = [p, this.__zoom.invert(p), t.identifier];
if (!g.touch0) g.touch0 = p, started = true;
else if (!g.touch1) g.touch1 = p;
}
// If this is a dbltap, reroute to the (optional) dblclick.zoom handler.
if (touchstarting) {
touchstarting = clearTimeout(touchstarting);
if (!g.touch1) {
g.end();
p = select(this).on("dblclick.zoom");
if (p) p.apply(this, arguments);
return;
}
}
if (started) {
touchstarting = setTimeout(function() { touchstarting = null; }, touchDelay);
interrupt(this);
g.start();
}
}
function touchmoved() {
var g = gesture(this, arguments),
touches$$1 = exports.event.changedTouches,
n = touches$$1.length, i, t, p, l;
noevent$2();
if (touchstarting) touchstarting = clearTimeout(touchstarting);
for (i = 0; i < n; ++i) {
t = touches$$1[i], p = touch(this, touches$$1, t.identifier);
if (g.touch0 && g.touch0[2] === t.identifier) g.touch0[0] = p;
else if (g.touch1 && g.touch1[2] === t.identifier) g.touch1[0] = p;
}
t = g.that.__zoom;
if (g.touch1) {
var p0 = g.touch0[0], l0 = g.touch0[1],
p1 = g.touch1[0], l1 = g.touch1[1],
dp = (dp = p1[0] - p0[0]) * dp + (dp = p1[1] - p0[1]) * dp,
dl = (dl = l1[0] - l0[0]) * dl + (dl = l1[1] - l0[1]) * dl;
t = scale(t, Math.sqrt(dp / dl));
p = [(p0[0] + p1[0]) / 2, (p0[1] + p1[1]) / 2];
l = [(l0[0] + l1[0]) / 2, (l0[1] + l1[1]) / 2];
}
else if (g.touch0) p = g.touch0[0], l = g.touch0[1];
else return;
g.zoom("touch", constrain(translate(t, p, l), g.extent));
}
function touchended() {
var g = gesture(this, arguments),
touches$$1 = exports.event.changedTouches,
n = touches$$1.length, i, t;
nopropagation$2();
if (touchending) clearTimeout(touchending);
touchending = setTimeout(function() { touchending = null; }, touchDelay);
for (i = 0; i < n; ++i) {
t = touches$$1[i];
if (g.touch0 && g.touch0[2] === t.identifier) delete g.touch0;
else if (g.touch1 && g.touch1[2] === t.identifier) delete g.touch1;
}
if (g.touch1 && !g.touch0) g.touch0 = g.touch1, delete g.touch1;
if (g.touch0) g.touch0[1] = this.__zoom.invert(g.touch0[0]);
else g.end();
}
zoom.filter = function(_) {
return arguments.length ? (filter = typeof _ === "function" ? _ : constant$12(!!_), zoom) : filter;
};
zoom.extent = function(_) {
return arguments.length ? (extent = typeof _ === "function" ? _ : constant$12([[+_[0][0], +_[0][1]], [+_[1][0], +_[1][1]]]), zoom) : extent;
};
zoom.scaleExtent = function(_) {
return arguments.length ? (k0 = +_[0], k1 = +_[1], zoom) : [k0, k1];
};
zoom.translateExtent = function(_) {
return arguments.length ? (x0 = +_[0][0], x1 = +_[1][0], y0 = +_[0][1], y1 = +_[1][1], zoom) : [[x0, y0], [x1, y1]];
};
zoom.duration = function(_) {
return arguments.length ? (duration = +_, zoom) : duration;
};
zoom.interpolate = function(_) {
return arguments.length ? (interpolate$$1 = _, zoom) : interpolate$$1;
};
zoom.on = function() {
var value = listeners.on.apply(listeners, arguments);
return value === listeners ? zoom : value;
};
zoom.clickDistance = function(_) {
return arguments.length ? (clickDistance2 = (_ = +_) * _, zoom) : Math.sqrt(clickDistance2);
};
return zoom;
};
exports.version = version;
exports.bisect = bisectRight;
exports.bisectRight = bisectRight;
exports.bisectLeft = bisectLeft;
exports.ascending = ascending;
exports.bisector = bisector;
exports.cross = cross;
exports.descending = descending;
exports.deviation = deviation;
exports.extent = extent;
exports.histogram = histogram;
exports.thresholdFreedmanDiaconis = freedmanDiaconis;
exports.thresholdScott = scott;
exports.thresholdSturges = sturges;
exports.max = max;
exports.mean = mean;
exports.median = median;
exports.merge = merge;
exports.min = min;
exports.pairs = pairs;
exports.permute = permute;
exports.quantile = threshold;
exports.range = sequence;
exports.scan = scan;
exports.shuffle = shuffle;
exports.sum = sum;
exports.ticks = ticks;
exports.tickIncrement = tickIncrement;
exports.tickStep = tickStep;
exports.transpose = transpose;
exports.variance = variance;
exports.zip = zip;
exports.axisTop = axisTop;
exports.axisRight = axisRight;
exports.axisBottom = axisBottom;
exports.axisLeft = axisLeft;
exports.brush = brush;
exports.brushX = brushX;
exports.brushY = brushY;
exports.brushSelection = brushSelection;
exports.chord = chord;
exports.ribbon = ribbon;
exports.nest = nest;
exports.set = set$2;
exports.map = map$1;
exports.keys = keys;
exports.values = values;
exports.entries = entries;
exports.color = color;
exports.rgb = rgb;
exports.hsl = hsl;
exports.lab = lab;
exports.hcl = hcl;
exports.cubehelix = cubehelix;
exports.dispatch = dispatch;
exports.drag = drag;
exports.dragDisable = dragDisable;
exports.dragEnable = yesdrag;
exports.dsvFormat = dsv;
exports.csvParse = csvParse;
exports.csvParseRows = csvParseRows;
exports.csvFormat = csvFormat;
exports.csvFormatRows = csvFormatRows;
exports.tsvParse = tsvParse;
exports.tsvParseRows = tsvParseRows;
exports.tsvFormat = tsvFormat;
exports.tsvFormatRows = tsvFormatRows;
exports.easeLinear = linear$1;
exports.easeQuad = quadInOut;
exports.easeQuadIn = quadIn;
exports.easeQuadOut = quadOut;
exports.easeQuadInOut = quadInOut;
exports.easeCubic = cubicInOut;
exports.easeCubicIn = cubicIn;
exports.easeCubicOut = cubicOut;
exports.easeCubicInOut = cubicInOut;
exports.easePoly = polyInOut;
exports.easePolyIn = polyIn;
exports.easePolyOut = polyOut;
exports.easePolyInOut = polyInOut;
exports.easeSin = sinInOut;
exports.easeSinIn = sinIn;
exports.easeSinOut = sinOut;
exports.easeSinInOut = sinInOut;
exports.easeExp = expInOut;
exports.easeExpIn = expIn;
exports.easeExpOut = expOut;
exports.easeExpInOut = expInOut;
exports.easeCircle = circleInOut;
exports.easeCircleIn = circleIn;
exports.easeCircleOut = circleOut;
exports.easeCircleInOut = circleInOut;
exports.easeBounce = bounceOut;
exports.easeBounceIn = bounceIn;
exports.easeBounceOut = bounceOut;
exports.easeBounceInOut = bounceInOut;
exports.easeBack = backInOut;
exports.easeBackIn = backIn;
exports.easeBackOut = backOut;
exports.easeBackInOut = backInOut;
exports.easeElastic = elasticOut;
exports.easeElasticIn = elasticIn;
exports.easeElasticOut = elasticOut;
exports.easeElasticInOut = elasticInOut;
exports.forceCenter = center$1;
exports.forceCollide = collide;
exports.forceLink = link;
exports.forceManyBody = manyBody;
exports.forceSimulation = simulation;
exports.forceX = x$2;
exports.forceY = y$2;
exports.formatDefaultLocale = defaultLocale;
exports.formatLocale = formatLocale;
exports.formatSpecifier = formatSpecifier;
exports.precisionFixed = precisionFixed;
exports.precisionPrefix = precisionPrefix;
exports.precisionRound = precisionRound;
exports.geoArea = area;
exports.geoBounds = bounds;
exports.geoCentroid = centroid;
exports.geoCircle = circle;
exports.geoClipExtent = extent$1;
exports.geoContains = contains;
exports.geoDistance = distance;
exports.geoGraticule = graticule;
exports.geoGraticule10 = graticule10;
exports.geoInterpolate = interpolate$1;
exports.geoLength = length$1;
exports.geoPath = index$1;
exports.geoAlbers = albers;
exports.geoAlbersUsa = albersUsa;
exports.geoAzimuthalEqualArea = azimuthalEqualArea;
exports.geoAzimuthalEqualAreaRaw = azimuthalEqualAreaRaw;
exports.geoAzimuthalEquidistant = azimuthalEquidistant;
exports.geoAzimuthalEquidistantRaw = azimuthalEquidistantRaw;
exports.geoConicConformal = conicConformal;
exports.geoConicConformalRaw = conicConformalRaw;
exports.geoConicEqualArea = conicEqualArea;
exports.geoConicEqualAreaRaw = conicEqualAreaRaw;
exports.geoConicEquidistant = conicEquidistant;
exports.geoConicEquidistantRaw = conicEquidistantRaw;
exports.geoEquirectangular = equirectangular;
exports.geoEquirectangularRaw = equirectangularRaw;
exports.geoGnomonic = gnomonic;
exports.geoGnomonicRaw = gnomonicRaw;
exports.geoIdentity = identity$5;
exports.geoProjection = projection;
exports.geoProjectionMutator = projectionMutator;
exports.geoMercator = mercator;
exports.geoMercatorRaw = mercatorRaw;
exports.geoOrthographic = orthographic;
exports.geoOrthographicRaw = orthographicRaw;
exports.geoStereographic = stereographic;
exports.geoStereographicRaw = stereographicRaw;
exports.geoTransverseMercator = transverseMercator;
exports.geoTransverseMercatorRaw = transverseMercatorRaw;
exports.geoRotation = rotation;
exports.geoStream = geoStream;
exports.geoTransform = transform;
exports.cluster = cluster;
exports.hierarchy = hierarchy;
exports.pack = index$2;
exports.packSiblings = siblings;
exports.packEnclose = enclose;
exports.partition = partition;
exports.stratify = stratify;
exports.tree = tree;
exports.treemap = index$3;
exports.treemapBinary = binary;
exports.treemapDice = treemapDice;
exports.treemapSlice = treemapSlice;
exports.treemapSliceDice = sliceDice;
exports.treemapSquarify = squarify;
exports.treemapResquarify = resquarify;
exports.interpolate = interpolateValue;
exports.interpolateArray = array$1;
exports.interpolateBasis = basis$1;
exports.interpolateBasisClosed = basisClosed;
exports.interpolateDate = date;
exports.interpolateNumber = reinterpolate;
exports.interpolateObject = object;
exports.interpolateRound = interpolateRound;
exports.interpolateString = interpolateString;
exports.interpolateTransformCss = interpolateTransformCss;
exports.interpolateTransformSvg = interpolateTransformSvg;
exports.interpolateZoom = interpolateZoom;
exports.interpolateRgb = interpolateRgb;
exports.interpolateRgbBasis = rgbBasis;
exports.interpolateRgbBasisClosed = rgbBasisClosed;
exports.interpolateHsl = hsl$2;
exports.interpolateHslLong = hslLong;
exports.interpolateLab = lab$1;
exports.interpolateHcl = hcl$2;
exports.interpolateHclLong = hclLong;
exports.interpolateCubehelix = cubehelix$2;
exports.interpolateCubehelixLong = cubehelixLong;
exports.quantize = quantize;
exports.path = path;
exports.polygonArea = area$1;
exports.polygonCentroid = centroid$1;
exports.polygonHull = hull;
exports.polygonContains = contains$1;
exports.polygonLength = length$2;
exports.quadtree = quadtree;
exports.queue = queue;
exports.randomUniform = uniform;
exports.randomNormal = normal;
exports.randomLogNormal = logNormal;
exports.randomBates = bates;
exports.randomIrwinHall = irwinHall;
exports.randomExponential = exponential$1;
exports.request = request;
exports.html = html;
exports.json = json;
exports.text = text;
exports.xml = xml;
exports.csv = csv$1;
exports.tsv = tsv$1;
exports.scaleBand = band;
exports.scalePoint = point$1;
exports.scaleIdentity = identity$6;
exports.scaleLinear = linear$2;
exports.scaleLog = log$1;
exports.scaleOrdinal = ordinal;
exports.scaleImplicit = implicit;
exports.scalePow = pow$1;
exports.scaleSqrt = sqrt$1;
exports.scaleQuantile = quantile$$1;
exports.scaleQuantize = quantize$1;
exports.scaleThreshold = threshold$1;
exports.scaleTime = time;
exports.scaleUtc = utcTime;
exports.schemeCategory10 = category10;
exports.schemeCategory20b = category20b;
exports.schemeCategory20c = category20c;
exports.schemeCategory20 = category20;
exports.interpolateCubehelixDefault = cubehelix$3;
exports.interpolateRainbow = rainbow$1;
exports.interpolateWarm = warm;
exports.interpolateCool = cool;
exports.interpolateViridis = viridis;
exports.interpolateMagma = magma;
exports.interpolateInferno = inferno;
exports.interpolatePlasma = plasma;
exports.scaleSequential = sequential;
exports.creator = creator;
exports.local = local$1;
exports.matcher = matcher$1;
exports.mouse = mouse;
exports.namespace = namespace;
exports.namespaces = namespaces;
exports.select = select;
exports.selectAll = selectAll;
exports.selection = selection;
exports.selector = selector;
exports.selectorAll = selectorAll;
exports.style = styleValue;
exports.touch = touch;
exports.touches = touches;
exports.window = defaultView;
exports.customEvent = customEvent;
exports.arc = arc;
exports.area = area$2;
exports.line = line;
exports.pie = pie;
exports.radialArea = radialArea;
exports.radialLine = radialLine$1;
exports.linkHorizontal = linkHorizontal;
exports.linkVertical = linkVertical;
exports.linkRadial = linkRadial;
exports.symbol = symbol;
exports.symbols = symbols;
exports.symbolCircle = circle$2;
exports.symbolCross = cross$2;
exports.symbolDiamond = diamond;
exports.symbolSquare = square;
exports.symbolStar = star;
exports.symbolTriangle = triangle;
exports.symbolWye = wye;
exports.curveBasisClosed = basisClosed$1;
exports.curveBasisOpen = basisOpen;
exports.curveBasis = basis$2;
exports.curveBundle = bundle;
exports.curveCardinalClosed = cardinalClosed;
exports.curveCardinalOpen = cardinalOpen;
exports.curveCardinal = cardinal;
exports.curveCatmullRomClosed = catmullRomClosed;
exports.curveCatmullRomOpen = catmullRomOpen;
exports.curveCatmullRom = catmullRom;
exports.curveLinearClosed = linearClosed;
exports.curveLinear = curveLinear;
exports.curveMonotoneX = monotoneX;
exports.curveMonotoneY = monotoneY;
exports.curveNatural = natural;
exports.curveStep = step;
exports.curveStepAfter = stepAfter;
exports.curveStepBefore = stepBefore;
exports.stack = stack;
exports.stackOffsetExpand = expand;
exports.stackOffsetDiverging = diverging;
exports.stackOffsetNone = none$1;
exports.stackOffsetSilhouette = silhouette;
exports.stackOffsetWiggle = wiggle;
exports.stackOrderAscending = ascending$2;
exports.stackOrderDescending = descending$2;
exports.stackOrderInsideOut = insideOut;
exports.stackOrderNone = none$2;
exports.stackOrderReverse = reverse;
exports.timeInterval = newInterval;
exports.timeMillisecond = millisecond;
exports.timeMilliseconds = milliseconds;
exports.utcMillisecond = millisecond;
exports.utcMilliseconds = milliseconds;
exports.timeSecond = second;
exports.timeSeconds = seconds;
exports.utcSecond = second;
exports.utcSeconds = seconds;
exports.timeMinute = minute;
exports.timeMinutes = minutes;
exports.timeHour = hour;
exports.timeHours = hours;
exports.timeDay = day;
exports.timeDays = days;
exports.timeWeek = sunday;
exports.timeWeeks = sundays;
exports.timeSunday = sunday;
exports.timeSundays = sundays;
exports.timeMonday = monday;
exports.timeMondays = mondays;
exports.timeTuesday = tuesday;
exports.timeTuesdays = tuesdays;
exports.timeWednesday = wednesday;
exports.timeWednesdays = wednesdays;
exports.timeThursday = thursday;
exports.timeThursdays = thursdays;
exports.timeFriday = friday;
exports.timeFridays = fridays;
exports.timeSaturday = saturday;
exports.timeSaturdays = saturdays;
exports.timeMonth = month;
exports.timeMonths = months;
exports.timeYear = year;
exports.timeYears = years;
exports.utcMinute = utcMinute;
exports.utcMinutes = utcMinutes;
exports.utcHour = utcHour;
exports.utcHours = utcHours;
exports.utcDay = utcDay;
exports.utcDays = utcDays;
exports.utcWeek = utcSunday;
exports.utcWeeks = utcSundays;
exports.utcSunday = utcSunday;
exports.utcSundays = utcSundays;
exports.utcMonday = utcMonday;
exports.utcMondays = utcMondays;
exports.utcTuesday = utcTuesday;
exports.utcTuesdays = utcTuesdays;
exports.utcWednesday = utcWednesday;
exports.utcWednesdays = utcWednesdays;
exports.utcThursday = utcThursday;
exports.utcThursdays = utcThursdays;
exports.utcFriday = utcFriday;
exports.utcFridays = utcFridays;
exports.utcSaturday = utcSaturday;
exports.utcSaturdays = utcSaturdays;
exports.utcMonth = utcMonth;
exports.utcMonths = utcMonths;
exports.utcYear = utcYear;
exports.utcYears = utcYears;
exports.timeFormatDefaultLocale = defaultLocale$1;
exports.timeFormatLocale = formatLocale$1;
exports.isoFormat = formatIso;
exports.isoParse = parseIso;
exports.now = now;
exports.timer = timer;
exports.timerFlush = timerFlush;
exports.timeout = timeout$1;
exports.interval = interval$1;
exports.transition = transition;
exports.active = active;
exports.interrupt = interrupt;
exports.voronoi = voronoi;
exports.zoom = zoom;
exports.zoomTransform = transform$1;
exports.zoomIdentity = identity$8;
Object.defineProperty(exports, '__esModule', { value: true });
})));
/***/ }),
/* 424 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
module.exports = function () {
// https://mathiasbynens.be/notes/es-unicode-property-escapes#emoji
return (/\uD83D\uDC69(?:\u200D(?:(?:\uD83D\uDC69\u200D)?\uD83D\uDC67|(?:\uD83D\uDC69\u200D)?\uD83D\uDC66)|\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D(?:\uD83D\uDC69\u200D)?\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D(?:\uD83D\uDC69\u200D)?\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]\uFE0F|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC6F\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3C-\uDD3E\uDDD6-\uDDDF])\u200D[\u2640\u2642]\uFE0F|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F\u200D[\u2640\u2642]|(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642])\uFE0F|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2695\u2696\u2708]|\uD83D\uDC69\u200D[\u2695\u2696\u2708]|\uD83D\uDC68(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708]))\uFE0F|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83D\uDC69\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|\uD83D\uDC68(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:(?:\uD83D[\uDC68\uDC69])\u200D)?\uD83D\uDC66\u200D\uD83D\uDC66|(?:(?:\uD83D[\uDC68\uDC69])\u200D)?\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92])|(?:\uD83C[\uDFFB-\uDFFF])\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]))|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDD1-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\u200D(?:(?:(?:\uD83D[\uDC68\uDC69])\u200D)?\uD83D\uDC67|(?:(?:\uD83D[\uDC68\uDC69])\u200D)?\uD83D\uDC66)|\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC69\uDC6E\uDC70-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD18-\uDD1C\uDD1E\uDD1F\uDD26\uDD30-\uDD39\uDD3D\uDD3E\uDDD1-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])?|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDEEB\uDEEC\uDEF4-\uDEF8]|\uD83E[\uDD10-\uDD3A\uDD3C-\uDD3E\uDD40-\uDD45\uDD47-\uDD4C\uDD50-\uDD6B\uDD80-\uDD97\uDDC0\uDDD0-\uDDE6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u2660\u2663\u2665\u2666\u2668\u267B\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEF8]|\uD83E[\uDD10-\uDD3A\uDD3C-\uDD3E\uDD40-\uDD45\uDD47-\uDD4C\uDD50-\uDD6B\uDD80-\uDD97\uDDC0\uDDD0-\uDDE6])\uFE0F/g
);
};
/***/ }),
/* 425 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
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 _extendableBuiltin(cls) {
function ExtendableBuiltin() {
cls.apply(this, arguments);
}
ExtendableBuiltin.prototype = Object.create(cls.prototype, {
constructor: {
value: cls,
enumerable: false,
writable: true,
configurable: true
}
});
if (Object.setPrototypeOf) {
Object.setPrototypeOf(ExtendableBuiltin, cls);
} else {
ExtendableBuiltin.__proto__ = cls;
}
return ExtendableBuiltin;
}
var ExtendableError = function (_extendableBuiltin2) {
_inherits(ExtendableError, _extendableBuiltin2);
function ExtendableError() {
var message = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
_classCallCheck(this, ExtendableError);
// extending Error is weird and does not propagate `message`
var _this = _possibleConstructorReturn(this, (ExtendableError.__proto__ || Object.getPrototypeOf(ExtendableError)).call(this, message));
Object.defineProperty(_this, 'message', {
configurable: true,
enumerable: false,
value: message,
writable: true
});
Object.defineProperty(_this, 'name', {
configurable: true,
enumerable: false,
value: _this.constructor.name,
writable: true
});
if (Error.hasOwnProperty('captureStackTrace')) {
Error.captureStackTrace(_this, _this.constructor);
return _possibleConstructorReturn(_this);
}
Object.defineProperty(_this, 'stack', {
configurable: true,
enumerable: false,
value: new Error(message).stack,
writable: true
});
return _this;
}
return ExtendableError;
}(_extendableBuiltin(Error));
exports.default = ExtendableError;
module.exports = exports['default'];
/***/ }),
/* 426 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* Code refactored from Mozilla Developer Network:
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign
*/
function assign(target, firstSource) {
if (target === undefined || target === null) {
throw new TypeError('Cannot convert first argument to object');
}
var to = Object(target);
for (var i = 1; i < arguments.length; i++) {
var nextSource = arguments[i];
if (nextSource === undefined || nextSource === null) {
continue;
}
var keysArray = Object.keys(Object(nextSource));
for (var nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex++) {
var nextKey = keysArray[nextIndex];
var desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);
if (desc !== undefined && desc.enumerable) {
to[nextKey] = nextSource[nextKey];
}
}
}
return to;
}
function polyfill() {
if (!Object.assign) {
Object.defineProperty(Object, 'assign', {
enumerable: false,
configurable: true,
writable: true,
value: assign
});
}
}
module.exports = {
assign: assign,
polyfill: polyfill
};
/***/ }),
/* 427 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var hasOwn = Object.prototype.hasOwnProperty;
var toStr = Object.prototype.toString;
var isArray = function isArray(arr) {
if (typeof Array.isArray === 'function') {
return Array.isArray(arr);
}
return toStr.call(arr) === '[object Array]';
};
var isPlainObject = function isPlainObject(obj) {
if (!obj || toStr.call(obj) !== '[object Object]') {
return false;
}
var hasOwnConstructor = hasOwn.call(obj, 'constructor');
var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');
// Not own constructor property must be Object
if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {
return false;
}
// Own properties are enumerated firstly, so to speed up,
// if last one is own, then all properties are own.
var key;
for (key in obj) { /**/ }
return typeof key === 'undefined' || hasOwn.call(obj, key);
};
module.exports = function extend() {
var options, name, src, copy, copyIsArray, clone;
var target = arguments[0];
var i = 1;
var length = arguments.length;
var deep = false;
// Handle a deep copy situation
if (typeof target === 'boolean') {
deep = target;
target = arguments[1] || {};
// skip the boolean and the target
i = 2;
}
if (target == null || (typeof target !== 'object' && typeof target !== 'function')) {
target = {};
}
for (; i < length; ++i) {
options = arguments[i];
// Only deal with non-null/undefined values
if (options != null) {
// Extend the base object
for (name in options) {
src = target[name];
copy = options[name];
// Prevent never-ending loop
if (target !== copy) {
// Recurse if we're merging plain objects or arrays
if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {
if (copyIsArray) {
copyIsArray = false;
clone = src && isArray(src) ? src : [];
} else {
clone = src && isPlainObject(src) ? src : {};
}
// Never move original objects, clone them
target[name] = extend(deep, clone, copy);
// Don't bring in undefined values
} else if (typeof copy !== 'undefined') {
target[name] = copy;
}
}
}
}
}
// Return the modified object
return target;
};
/***/ }),
/* 428 */
/***/ (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 _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;
/***/ }),
/* 429 */
/***/ (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__(428);
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;
/***/ }),
/* 430 */
/***/ (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__(438);
/*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;
/***/ }),
/* 431 */
/***/ (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 invariant = __webpack_require__(2);
/**
* 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')) ? false ? invariant(false, 'toArray: Array-like object expected') : invariant(false) : void 0;
!(typeof length === 'number') ? false ? invariant(false, 'toArray: Object needs a length property') : invariant(false) : void 0;
!(length === 0 || length - 1 in obj) ? false ? invariant(false, 'toArray: Object should have keys for indices') : invariant(false) : void 0;
!(typeof obj.callee !== 'function') ? false ? 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;
/***/ }),
/* 432 */
/***/ (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
*/
/*eslint-disable fb-www/unsafe-html*/
var ExecutionEnvironment = __webpack_require__(15);
var createArrayFromMixed = __webpack_require__(431);
var getMarkupWrap = __webpack_require__(433);
var invariant = __webpack_require__(2);
/**
* 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 ? false ? 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 ? false ? 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;
/***/ }),
/* 433 */
/***/ (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.
*
*/
/*eslint-disable fb-www/unsafe-html */
var ExecutionEnvironment = __webpack_require__(15);
var invariant = __webpack_require__(2);
/**
* 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 ? false ? 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;
/***/ }),
/* 434 */
/***/ (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
*/
/**
* 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 && scrollable instanceof scrollable.Window) {
return {
x: scrollable.pageXOffset || scrollable.document.documentElement.scrollLeft,
y: scrollable.pageYOffset || scrollable.document.documentElement.scrollTop
};
}
return {
x: scrollable.scrollLeft,
y: scrollable.scrollTop
};
}
module.exports = getUnboundedScrollPosition;
/***/ }),
/* 435 */
/***/ (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 _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;
/***/ }),
/* 436 */
/***/ (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 hyphenate = __webpack_require__(435);
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;
/***/ }),
/* 437 */
/***/ (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
*/
/**
* @param {*} object The object to check.
* @return {boolean} Whether or not the object is a DOM node.
*/
function isNode(object) {
var doc = object ? object.ownerDocument || object : document;
var defaultView = doc.defaultView || window;
return !!(object && (typeof defaultView.Node === 'function' ? object instanceof defaultView.Node : typeof object === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string'));
}
module.exports = isNode;
/***/ }),
/* 438 */
/***/ (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__(437);
/**
* @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;
/***/ }),
/* 439 */
/***/ (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 static-only
*/
/**
* 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;
/***/ }),
/* 440 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__.p + "static/media/medium.8dbe90b7.eot";
/***/ }),
/* 441 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__.p + "static/media/medium.286ef983.svg";
/***/ }),
/* 442 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__.p + "static/media/medium.89fadac2.ttf";
/***/ }),
/* 443 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__.p + "static/media/medium.da132504.woff";
/***/ }),
/* 444 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__.p + "static/media/medium.466ee18a.woff2";
/***/ }),
/* 445 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__.p + "static/media/regular.9ce40dd3.eot";
/***/ }),
/* 446 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__.p + "static/media/regular.e2058e02.svg";
/***/ }),
/* 447 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__.p + "static/media/regular.6c5605c0.ttf";
/***/ }),
/* 448 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__.p + "static/media/regular.e3c367e4.woff";
/***/ }),
/* 449 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__.p + "static/media/regular.a3046d7b.woff2";
/***/ }),
/* 450 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__.p + "static/media/semibold.cd4fb6b2.eot";
/***/ }),
/* 451 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__.p + "static/media/semibold.5e465ab2.svg";
/***/ }),
/* 452 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__.p + "static/media/semibold.f596122f.ttf";
/***/ }),
/* 453 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__.p + "static/media/semibold.3ff7f918.woff";
/***/ }),
/* 454 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__.p + "static/media/semibold.cba28007.woff2";
/***/ }),
/* 455 */
/***/ (function(module, exports) {
var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
var slice = Array.prototype.slice;
var toStr = Object.prototype.toString;
var funcType = '[object Function]';
module.exports = function bind(that) {
var target = this;
if (typeof target !== 'function' || toStr.call(target) !== funcType) {
throw new TypeError(ERROR_MESSAGE + target);
}
var args = slice.call(arguments, 1);
var bound;
var binder = function () {
if (this instanceof bound) {
var result = target.apply(
this,
args.concat(slice.call(arguments))
);
if (Object(result) === result) {
return result;
}
return this;
} else {
return target.apply(
that,
args.concat(slice.call(arguments))
);
}
};
var boundLength = Math.max(0, target.length - args.length);
var boundArgs = [];
for (var i = 0; i < boundLength; i++) {
boundArgs.push('$' + i);
}
bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);
if (target.prototype) {
var Empty = function Empty() {};
Empty.prototype = target.prototype;
bound.prototype = new Empty();
Empty.prototype = null;
}
return bound;
};
/***/ }),
/* 456 */
/***/ (function(module, exports, __webpack_require__) {
var implementation = __webpack_require__(455);
module.exports = Function.prototype.bind || implementation;
/***/ }),
/* 457 */
/***/ (function(module, exports) {
(function() {
var fnNameMatchRegex = /^\s*function\s+([^\(\s]*)\s*/;
function _name() {
var match, name;
if (this === Function || this === Function.prototype.constructor) {
name = "Function";
}
else if (this !== Function.prototype) {
match = ("" + this).match(fnNameMatchRegex);
name = match && match[1];
}
return name || "";
}
// Inspect the polyfill-ability of this browser
var needsPolyfill = !("name" in Function.prototype && "name" in (function x() {}));
var canDefineProp = typeof Object.defineProperty === "function" &&
(function() {
var result;
try {
Object.defineProperty(Function.prototype, "_xyz", {
get: function() {
return "blah";
},
configurable: true
});
result = Function.prototype._xyz === "blah";
delete Function.prototype._xyz;
}
catch (e) {
result = false;
}
return result;
})();
var canDefineGetter = typeof Object.prototype.__defineGetter__ === "function" &&
(function() {
var result;
try {
Function.prototype.__defineGetter__("_abc", function() {
return "foo";
});
result = Function.prototype._abc === "foo";
delete Function.prototype._abc;
}
catch (e) {
result = false;
}
return result;
})();
// Add the "private" property for testing, even if the real property can be polyfilled
Function.prototype._name = _name;
// Polyfill it!
// For:
// * IE >=9 <12
// * Chrome <33
if (needsPolyfill) {
// For:
// * IE >=9 <12
// * Chrome >=5 <33
if (canDefineProp) {
Object.defineProperty(Function.prototype, "name", {
get: function() {
var name = _name.call(this);
// Since named function definitions have immutable names, also memoize the
// output by defining the `name` property directly on this Function
// instance so that this polyfill will not need to be invoked again
if (this !== Function.prototype) {
Object.defineProperty(this, "name", {
value: name,
configurable: true
});
}
return name;
},
configurable: true
});
}
// For:
// * Chrome <5
else if (canDefineGetter) {
// NOTE:
// The snippet:
//
// x.__defineGetter__('y', z);
//
// ...is essentially equivalent to:
//
// Object.defineProperty(x, 'y', {
// get: z,
// configurable: true, // <-- key difference #1
// enumerable: true // <-- key difference #2
// });
//
Function.prototype.__defineGetter__("name", function() {
var name = _name.call(this);
// Since named function definitions have immutable names, also memoize the
// output by defining the `name` property directly on this Function
// instance so that this polyfill will not need to be invoked again
if (this !== Function.prototype) {
this.__defineGetter__("name", function() { return name; });
}
return name;
});
}
}
})();
/***/ }),
/* 458 */
/***/ (function(module, exports, __webpack_require__) {
var emoji = __webpack_require__(424)
module.exports = BananaSlug
function BananaSlug () {
var self = this
if (!(self instanceof BananaSlug)) return new BananaSlug()
self.reset()
}
/**
* Generate a unique slug.
* @param {string} value String of text to slugify
* @return {string} A unique slug string
*/
BananaSlug.prototype.slug = function (value) {
var self = this
var slug = slugger(value)
var occurrences = self.occurrences[slug]
if (self.occurrences.hasOwnProperty(slug)) {
occurrences++
} else {
occurrences = 0
}
self.occurrences[slug] = occurrences
if (occurrences) {
slug = slug + '-' + occurrences
}
return slug
}
/**
* Reset - Forget all previous slugs
* @return void
*/
BananaSlug.prototype.reset = function () {
this.occurrences = {}
}
var whitespace = /\s/g
function lower (string) {
return string.toLowerCase()
}
function slugger (string) {
var re = /[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,.\/:;<=>?@\[\]^`{|}~]/g
var maintainCase = false
var replacement = '-'
if (typeof string !== 'string') return ''
if (!maintainCase) string = string.replace(/[A-Z]+/g, lower)
return string.trim()
.replace(re, '')
.replace(emoji(), '')
.replace(whitespace, replacement)
}
/***/ }),
/* 459 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _warning = __webpack_require__(22);
var _warning2 = _interopRequireDefault(_warning);
var _invariant = __webpack_require__(23);
var _invariant2 = _interopRequireDefault(_invariant);
var _LocationUtils = __webpack_require__(127);
var _PathUtils = __webpack_require__(69);
var _createTransitionManager = __webpack_require__(128);
var _createTransitionManager2 = _interopRequireDefault(_createTransitionManager);
var _DOMUtils = __webpack_require__(217);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var PopStateEvent = 'popstate';
var HashChangeEvent = 'hashchange';
var getHistoryState = function getHistoryState() {
try {
return window.history.state || {};
} catch (e) {
// IE 11 sometimes throws when accessing window.history.state
// See https://github.com/ReactTraining/history/pull/289
return {};
}
};
/**
* Creates a history object that uses the HTML5 history API including
* pushState, replaceState, and the popstate event.
*/
var createBrowserHistory = function createBrowserHistory() {
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
(0, _invariant2.default)(_DOMUtils.canUseDOM, 'Browser history needs a DOM');
var globalHistory = window.history;
var canUseHistory = (0, _DOMUtils.supportsHistory)();
var needsHashChangeListener = !(0, _DOMUtils.supportsPopStateOnHashChange)();
var _props$forceRefresh = props.forceRefresh,
forceRefresh = _props$forceRefresh === undefined ? false : _props$forceRefresh,
_props$getUserConfirm = props.getUserConfirmation,
getUserConfirmation = _props$getUserConfirm === undefined ? _DOMUtils.getConfirmation : _props$getUserConfirm,
_props$keyLength = props.keyLength,
keyLength = _props$keyLength === undefined ? 6 : _props$keyLength;
var basename = props.basename ? (0, _PathUtils.stripTrailingSlash)((0, _PathUtils.addLeadingSlash)(props.basename)) : '';
var getDOMLocation = function getDOMLocation(historyState) {
var _ref = historyState || {},
key = _ref.key,
state = _ref.state;
var _window$location = window.location,
pathname = _window$location.pathname,
search = _window$location.search,
hash = _window$location.hash;
var path = pathname + search + hash;
if (basename) path = (0, _PathUtils.stripPrefix)(path, basename);
return _extends({}, (0, _PathUtils.parsePath)(path), {
state: state,
key: key
});
};
var createKey = function createKey() {
return Math.random().toString(36).substr(2, keyLength);
};
var transitionManager = (0, _createTransitionManager2.default)();
var setState = function setState(nextState) {
_extends(history, nextState);
history.length = globalHistory.length;
transitionManager.notifyListeners(history.location, history.action);
};
var handlePopState = function handlePopState(event) {
// Ignore extraneous popstate events in WebKit.
if ((0, _DOMUtils.isExtraneousPopstateEvent)(event)) return;
handlePop(getDOMLocation(event.state));
};
var handleHashChange = function handleHashChange() {
handlePop(getDOMLocation(getHistoryState()));
};
var forceNextPop = false;
var handlePop = function handlePop(location) {
if (forceNextPop) {
forceNextPop = false;
setState();
} else {
var action = 'POP';
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
if (ok) {
setState({ action: action, location: location });
} else {
revertPop(location);
}
});
}
};
var revertPop = function revertPop(fromLocation) {
var toLocation = history.location;
// TODO: We could probably make this more reliable by
// keeping a list of keys we've seen in sessionStorage.
// Instead, we just default to 0 for keys we don't know.
var toIndex = allKeys.indexOf(toLocation.key);
if (toIndex === -1) toIndex = 0;
var fromIndex = allKeys.indexOf(fromLocation.key);
if (fromIndex === -1) fromIndex = 0;
var delta = toIndex - fromIndex;
if (delta) {
forceNextPop = true;
go(delta);
}
};
var initialLocation = getDOMLocation(getHistoryState());
var allKeys = [initialLocation.key];
// Public interface
var createHref = function createHref(location) {
return basename + (0, _PathUtils.createPath)(location);
};
var push = function push(path, state) {
(0, _warning2.default)(!((typeof path === 'undefined' ? 'undefined' : _typeof(path)) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored');
var action = 'PUSH';
var location = (0, _LocationUtils.createLocation)(path, state, createKey(), history.location);
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
if (!ok) return;
var href = createHref(location);
var key = location.key,
state = location.state;
if (canUseHistory) {
globalHistory.pushState({ key: key, state: state }, null, href);
if (forceRefresh) {
window.location.href = href;
} else {
var prevIndex = allKeys.indexOf(history.location.key);
var nextKeys = allKeys.slice(0, prevIndex === -1 ? 0 : prevIndex + 1);
nextKeys.push(location.key);
allKeys = nextKeys;
setState({ action: action, location: location });
}
} else {
(0, _warning2.default)(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history');
window.location.href = href;
}
});
};
var replace = function replace(path, state) {
(0, _warning2.default)(!((typeof path === 'undefined' ? 'undefined' : _typeof(path)) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored');
var action = 'REPLACE';
var location = (0, _LocationUtils.createLocation)(path, state, createKey(), history.location);
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
if (!ok) return;
var href = createHref(location);
var key = location.key,
state = location.state;
if (canUseHistory) {
globalHistory.replaceState({ key: key, state: state }, null, href);
if (forceRefresh) {
window.location.replace(href);
} else {
var prevIndex = allKeys.indexOf(history.location.key);
if (prevIndex !== -1) allKeys[prevIndex] = location.key;
setState({ action: action, location: location });
}
} else {
(0, _warning2.default)(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history');
window.location.replace(href);
}
});
};
var go = function go(n) {
globalHistory.go(n);
};
var goBack = function goBack() {
return go(-1);
};
var goForward = function goForward() {
return go(1);
};
var listenerCount = 0;
var checkDOMListeners = function checkDOMListeners(delta) {
listenerCount += delta;
if (listenerCount === 1) {
(0, _DOMUtils.addEventListener)(window, PopStateEvent, handlePopState);
if (needsHashChangeListener) (0, _DOMUtils.addEventListener)(window, HashChangeEvent, handleHashChange);
} else if (listenerCount === 0) {
(0, _DOMUtils.removeEventListener)(window, PopStateEvent, handlePopState);
if (needsHashChangeListener) (0, _DOMUtils.removeEventListener)(window, HashChangeEvent, handleHashChange);
}
};
var isBlocked = false;
var block = function block() {
var prompt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
var unblock = transitionManager.setPrompt(prompt);
if (!isBlocked) {
checkDOMListeners(1);
isBlocked = true;
}
return function () {
if (isBlocked) {
isBlocked = false;
checkDOMListeners(-1);
}
return unblock();
};
};
var listen = function listen(listener) {
var unlisten = transitionManager.appendListener(listener);
checkDOMListeners(1);
return function () {
checkDOMListeners(-1);
unlisten();
};
};
var history = {
length: globalHistory.length,
action: 'POP',
location: initialLocation,
createHref: createHref,
push: push,
replace: replace,
go: go,
goBack: goBack,
goForward: goForward,
block: block,
listen: listen
};
return history;
};
exports.default = createBrowserHistory;
/***/ }),
/* 460 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _warning = __webpack_require__(22);
var _warning2 = _interopRequireDefault(_warning);
var _invariant = __webpack_require__(23);
var _invariant2 = _interopRequireDefault(_invariant);
var _LocationUtils = __webpack_require__(127);
var _PathUtils = __webpack_require__(69);
var _createTransitionManager = __webpack_require__(128);
var _createTransitionManager2 = _interopRequireDefault(_createTransitionManager);
var _DOMUtils = __webpack_require__(217);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var HashChangeEvent = 'hashchange';
var HashPathCoders = {
hashbang: {
encodePath: function encodePath(path) {
return path.charAt(0) === '!' ? path : '!/' + (0, _PathUtils.stripLeadingSlash)(path);
},
decodePath: function decodePath(path) {
return path.charAt(0) === '!' ? path.substr(1) : path;
}
},
noslash: {
encodePath: _PathUtils.stripLeadingSlash,
decodePath: _PathUtils.addLeadingSlash
},
slash: {
encodePath: _PathUtils.addLeadingSlash,
decodePath: _PathUtils.addLeadingSlash
}
};
var getHashPath = function getHashPath() {
// We can't use window.location.hash here because it's not
// consistent across browsers - Firefox will pre-decode it!
var href = window.location.href;
var hashIndex = href.indexOf('#');
return hashIndex === -1 ? '' : href.substring(hashIndex + 1);
};
var pushHashPath = function pushHashPath(path) {
return window.location.hash = path;
};
var replaceHashPath = function replaceHashPath(path) {
var hashIndex = window.location.href.indexOf('#');
window.location.replace(window.location.href.slice(0, hashIndex >= 0 ? hashIndex : 0) + '#' + path);
};
var createHashHistory = function createHashHistory() {
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
(0, _invariant2.default)(_DOMUtils.canUseDOM, 'Hash history needs a DOM');
var globalHistory = window.history;
var canGoWithoutReload = (0, _DOMUtils.supportsGoWithoutReloadUsingHash)();
var _props$getUserConfirm = props.getUserConfirmation,
getUserConfirmation = _props$getUserConfirm === undefined ? _DOMUtils.getConfirmation : _props$getUserConfirm,
_props$hashType = props.hashType,
hashType = _props$hashType === undefined ? 'slash' : _props$hashType;
var basename = props.basename ? (0, _PathUtils.stripTrailingSlash)((0, _PathUtils.addLeadingSlash)(props.basename)) : '';
var _HashPathCoders$hashT = HashPathCoders[hashType],
encodePath = _HashPathCoders$hashT.encodePath,
decodePath = _HashPathCoders$hashT.decodePath;
var getDOMLocation = function getDOMLocation() {
var path = decodePath(getHashPath());
if (basename) path = (0, _PathUtils.stripPrefix)(path, basename);
return (0, _PathUtils.parsePath)(path);
};
var transitionManager = (0, _createTransitionManager2.default)();
var setState = function setState(nextState) {
_extends(history, nextState);
history.length = globalHistory.length;
transitionManager.notifyListeners(history.location, history.action);
};
var forceNextPop = false;
var ignorePath = null;
var handleHashChange = function handleHashChange() {
var path = getHashPath();
var encodedPath = encodePath(path);
if (path !== encodedPath) {
// Ensure we always have a properly-encoded hash.
replaceHashPath(encodedPath);
} else {
var location = getDOMLocation();
var prevLocation = history.location;
if (!forceNextPop && (0, _LocationUtils.locationsAreEqual)(prevLocation, location)) return; // A hashchange doesn't always == location change.
if (ignorePath === (0, _PathUtils.createPath)(location)) return; // Ignore this change; we already setState in push/replace.
ignorePath = null;
handlePop(location);
}
};
var handlePop = function handlePop(location) {
if (forceNextPop) {
forceNextPop = false;
setState();
} else {
var action = 'POP';
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
if (ok) {
setState({ action: action, location: location });
} else {
revertPop(location);
}
});
}
};
var revertPop = function revertPop(fromLocation) {
var toLocation = history.location;
// TODO: We could probably make this more reliable by
// keeping a list of paths we've seen in sessionStorage.
// Instead, we just default to 0 for paths we don't know.
var toIndex = allPaths.lastIndexOf((0, _PathUtils.createPath)(toLocation));
if (toIndex === -1) toIndex = 0;
var fromIndex = allPaths.lastIndexOf((0, _PathUtils.createPath)(fromLocation));
if (fromIndex === -1) fromIndex = 0;
var delta = toIndex - fromIndex;
if (delta) {
forceNextPop = true;
go(delta);
}
};
// Ensure the hash is encoded properly before doing anything else.
var path = getHashPath();
var encodedPath = encodePath(path);
if (path !== encodedPath) replaceHashPath(encodedPath);
var initialLocation = getDOMLocation();
var allPaths = [(0, _PathUtils.createPath)(initialLocation)];
// Public interface
var createHref = function createHref(location) {
return '#' + encodePath(basename + (0, _PathUtils.createPath)(location));
};
var push = function push(path, state) {
(0, _warning2.default)(state === undefined, 'Hash history cannot push state; it is ignored');
var action = 'PUSH';
var location = (0, _LocationUtils.createLocation)(path, undefined, undefined, history.location);
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
if (!ok) return;
var path = (0, _PathUtils.createPath)(location);
var encodedPath = encodePath(basename + path);
var hashChanged = getHashPath() !== encodedPath;
if (hashChanged) {
// We cannot tell if a hashchange was caused by a PUSH, so we'd
// rather setState here and ignore the hashchange. The caveat here
// is that other hash histories in the page will consider it a POP.
ignorePath = path;
pushHashPath(encodedPath);
var prevIndex = allPaths.lastIndexOf((0, _PathUtils.createPath)(history.location));
var nextPaths = allPaths.slice(0, prevIndex === -1 ? 0 : prevIndex + 1);
nextPaths.push(path);
allPaths = nextPaths;
setState({ action: action, location: location });
} else {
(0, _warning2.default)(false, 'Hash history cannot PUSH the same path; a new entry will not be added to the history stack');
setState();
}
});
};
var replace = function replace(path, state) {
(0, _warning2.default)(state === undefined, 'Hash history cannot replace state; it is ignored');
var action = 'REPLACE';
var location = (0, _LocationUtils.createLocation)(path, undefined, undefined, history.location);
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
if (!ok) return;
var path = (0, _PathUtils.createPath)(location);
var encodedPath = encodePath(basename + path);
var hashChanged = getHashPath() !== encodedPath;
if (hashChanged) {
// We cannot tell if a hashchange was caused by a REPLACE, so we'd
// rather setState here and ignore the hashchange. The caveat here
// is that other hash histories in the page will consider it a POP.
ignorePath = path;
replaceHashPath(encodedPath);
}
var prevIndex = allPaths.indexOf((0, _PathUtils.createPath)(history.location));
if (prevIndex !== -1) allPaths[prevIndex] = path;
setState({ action: action, location: location });
});
};
var go = function go(n) {
(0, _warning2.default)(canGoWithoutReload, 'Hash history go(n) causes a full page reload in this browser');
globalHistory.go(n);
};
var goBack = function goBack() {
return go(-1);
};
var goForward = function goForward() {
return go(1);
};
var listenerCount = 0;
var checkDOMListeners = function checkDOMListeners(delta) {
listenerCount += delta;
if (listenerCount === 1) {
(0, _DOMUtils.addEventListener)(window, HashChangeEvent, handleHashChange);
} else if (listenerCount === 0) {
(0, _DOMUtils.removeEventListener)(window, HashChangeEvent, handleHashChange);
}
};
var isBlocked = false;
var block = function block() {
var prompt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
var unblock = transitionManager.setPrompt(prompt);
if (!isBlocked) {
checkDOMListeners(1);
isBlocked = true;
}
return function () {
if (isBlocked) {
isBlocked = false;
checkDOMListeners(-1);
}
return unblock();
};
};
var listen = function listen(listener) {
var unlisten = transitionManager.appendListener(listener);
checkDOMListeners(1);
return function () {
checkDOMListeners(-1);
unlisten();
};
};
var history = {
length: globalHistory.length,
action: 'POP',
location: initialLocation,
createHref: createHref,
push: push,
replace: replace,
go: go,
goBack: goBack,
goForward: goForward,
block: block,
listen: listen
};
return history;
};
exports.default = createHashHistory;
/***/ }),
/* 461 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _warning = __webpack_require__(22);
var _warning2 = _interopRequireDefault(_warning);
var _PathUtils = __webpack_require__(69);
var _LocationUtils = __webpack_require__(127);
var _createTransitionManager = __webpack_require__(128);
var _createTransitionManager2 = _interopRequireDefault(_createTransitionManager);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var clamp = function clamp(n, lowerBound, upperBound) {
return Math.min(Math.max(n, lowerBound), upperBound);
};
/**
* Creates a history object that stores locations in memory.
*/
var createMemoryHistory = function createMemoryHistory() {
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var getUserConfirmation = props.getUserConfirmation,
_props$initialEntries = props.initialEntries,
initialEntries = _props$initialEntries === undefined ? ['/'] : _props$initialEntries,
_props$initialIndex = props.initialIndex,
initialIndex = _props$initialIndex === undefined ? 0 : _props$initialIndex,
_props$keyLength = props.keyLength,
keyLength = _props$keyLength === undefined ? 6 : _props$keyLength;
var transitionManager = (0, _createTransitionManager2.default)();
var setState = function setState(nextState) {
_extends(history, nextState);
history.length = history.entries.length;
transitionManager.notifyListeners(history.location, history.action);
};
var createKey = function createKey() {
return Math.random().toString(36).substr(2, keyLength);
};
var index = clamp(initialIndex, 0, initialEntries.length - 1);
var entries = initialEntries.map(function (entry) {
return typeof entry === 'string' ? (0, _LocationUtils.createLocation)(entry, undefined, createKey()) : (0, _LocationUtils.createLocation)(entry, undefined, entry.key || createKey());
});
// Public interface
var createHref = _PathUtils.createPath;
var push = function push(path, state) {
(0, _warning2.default)(!((typeof path === 'undefined' ? 'undefined' : _typeof(path)) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored');
var action = 'PUSH';
var location = (0, _LocationUtils.createLocation)(path, state, createKey(), history.location);
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
if (!ok) return;
var prevIndex = history.index;
var nextIndex = prevIndex + 1;
var nextEntries = history.entries.slice(0);
if (nextEntries.length > nextIndex) {
nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);
} else {
nextEntries.push(location);
}
setState({
action: action,
location: location,
index: nextIndex,
entries: nextEntries
});
});
};
var replace = function replace(path, state) {
(0, _warning2.default)(!((typeof path === 'undefined' ? 'undefined' : _typeof(path)) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored');
var action = 'REPLACE';
var location = (0, _LocationUtils.createLocation)(path, state, createKey(), history.location);
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
if (!ok) return;
history.entries[history.index] = location;
setState({ action: action, location: location });
});
};
var go = function go(n) {
var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);
var action = 'POP';
var location = history.entries[nextIndex];
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
if (ok) {
setState({
action: action,
location: location,
index: nextIndex
});
} else {
// Mimic the behavior of DOM histories by
// causing a render after a cancelled POP.
setState();
}
});
};
var goBack = function goBack() {
return go(-1);
};
var goForward = function goForward() {
return go(1);
};
var canGo = function canGo(n) {
var nextIndex = history.index + n;
return nextIndex >= 0 && nextIndex < history.entries.length;
};
var block = function block() {
var prompt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
return transitionManager.setPrompt(prompt);
};
var listen = function listen(listener) {
return transitionManager.appendListener(listener);
};
var history = {
length: entries.length,
action: 'POP',
location: entries[index],
index: index,
entries: entries,
createHref: createHref,
push: push,
replace: replace,
go: go,
goBack: goBack,
goForward: goForward,
canGo: canGo,
block: block,
listen: listen
};
return history;
};
exports.default = createMemoryHistory;
/***/ }),
/* 462 */
/***/ (function(module, exports) {
exports.read = function (buffer, offset, isLE, mLen, nBytes) {
var e, m
var eLen = nBytes * 8 - mLen - 1
var eMax = (1 << eLen) - 1
var eBias = eMax >> 1
var nBits = -7
var i = isLE ? (nBytes - 1) : 0
var d = isLE ? -1 : 1
var s = buffer[offset + i]
i += d
e = s & ((1 << (-nBits)) - 1)
s >>= (-nBits)
nBits += eLen
for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}
m = e & ((1 << (-nBits)) - 1)
e >>= (-nBits)
nBits += mLen
for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}
if (e === 0) {
e = 1 - eBias
} else if (e === eMax) {
return m ? NaN : ((s ? -1 : 1) * Infinity)
} else {
m = m + Math.pow(2, mLen)
e = e - eBias
}
return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
}
exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
var e, m, c
var eLen = nBytes * 8 - mLen - 1
var eMax = (1 << eLen) - 1
var eBias = eMax >> 1
var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
var i = isLE ? 0 : (nBytes - 1)
var d = isLE ? 1 : -1
var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
value = Math.abs(value)
if (isNaN(value) || value === Infinity) {
m = isNaN(value) ? 1 : 0
e = eMax
} else {
e = Math.floor(Math.log(value) / Math.LN2)
if (value * (c = Math.pow(2, -e)) < 1) {
e--
c *= 2
}
if (e + eBias >= 1) {
value += rt / c
} else {
value += rt * Math.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) * Math.pow(2, mLen)
e = e + eBias
} else {
m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
e = 0
}
}
for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
e = (e << mLen) | m
eLen += mLen
for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
buffer[offset + i - d] |= s * 128
}
/***/ }),
/* 463 */
/***/ (function(module, exports) {
if (typeof Object.create === 'function') {
// implementation from standard node.js 'util' module
module.exports = function inherits(ctor, superCtor) {
ctor.super_ = superCtor
ctor.prototype = Object.create(superCtor.prototype, {
constructor: {
value: ctor,
enumerable: false,
writable: true,
configurable: true
}
});
};
} else {
// old school shim for old browsers
module.exports = function inherits(ctor, superCtor) {
ctor.super_ = superCtor
var TempCtor = function () {}
TempCtor.prototype = superCtor.prototype
ctor.prototype = new TempCtor()
ctor.prototype.constructor = ctor
}
}
/***/ }),
/* 464 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2016 Titus Wormer
* @license MIT
* @module is-alphanumerical
* @fileoverview Check if a character is alphanumerical.
*/
/* eslint-env commonjs */
/* Dependencies. */
var alphabetical = __webpack_require__(218);
var decimal = __webpack_require__(83);
/* Expose. */
module.exports = alphanumerical;
/**
* Check whether the given character code, or the character
* code at the first character, is alphanumerical.
*
* @param {string|number} character
* @return {boolean} - Whether `character` is alphanumerical.
*/
function alphanumerical(character) {
return alphabetical(character) || decimal(character);
}
/***/ }),
/* 465 */
/***/ (function(module, exports) {
/*!
* Determine if an object is a Buffer
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT
*/
// The _isBuffer check is for Safari 5-7 support, because it's missing
// Object.prototype.constructor. Remove this eventually
module.exports = function (obj) {
return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)
}
function isBuffer (obj) {
return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
}
// For Node v0.10 support. Remove this eventually.
function isSlowBuffer (obj) {
return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))
}
/***/ }),
/* 466 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2016 Titus Wormer
* @license MIT
* @module is-hexadecimal
* @fileoverview Check if a character is hexadecimal.
*/
/* eslint-env commonjs */
/* Expose. */
module.exports = hexadecimal;
/**
* Check whether the given character code, or the character
* code at the first character, is hexadecimal.
*
* @param {string|number} character
* @return {boolean} - Whether `character` is hexadecimal.
*/
function hexadecimal(character) {
var code = typeof character === 'string' ?
character.charCodeAt(0) : character;
return (code >= 97 /* a */ && code <= 102 /* z */) ||
(code >= 65 /* A */ && code <= 70 /* Z */) ||
(code >= 48 /* A */ && code <= 57 /* Z */);
}
/***/ }),
/* 467 */
/***/ (function(module, exports, __webpack_require__) {
"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 isBrowser = exports.isBrowser = (typeof window === "undefined" ? "undefined" : _typeof(window)) === "object" && (typeof document === "undefined" ? "undefined" : _typeof(document)) === 'object' && document.nodeType === 9;
exports.default = isBrowser;
/***/ }),
/* 468 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var toString = Object.prototype.toString;
module.exports = function (x) {
var prototype;
return toString.call(x) === '[object Object]' && (prototype = Object.getPrototypeOf(x), prototype === null || prototype === Object.getPrototypeOf({}));
};
/***/ }),
/* 469 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2016 Titus Wormer
* @license MIT
* @module is-word-character
* @fileoverview Check if a character is a word character.
*/
/* eslint-env commonjs */
/* Expose. */
module.exports = wordCharacter;
/* Methods. */
var fromCode = String.fromCharCode;
/* Constants. */
var re = /\w/;
/**
* Check whether the given character code, or the character
* code at the first character, is a word character.
*
* @param {string|number} character
* @return {boolean} - Whether `character` is a word character.
*/
function wordCharacter(character) {
return re.test(
typeof character === 'number' ? fromCode(character) : character.charAt(0)
);
}
/***/ }),
/* 470 */
/***/ (function(module, exports) {
var toString = {}.toString;
module.exports = Array.isArray || function (arr) {
return toString.call(arr) == '[object Array]';
};
/***/ }),
/* 471 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = camelCase;
var regExp = /([A-Z])/g;
/**
* Replace a string passed from String#replace.
* @param {String} str
* @return {String}
*/
function replace(str) {
return "-" + str.toLowerCase();
}
/**
* Convert camel cased property names to dash separated.
*
* @param {Object} style
* @return {Object}
*/
function convertCase(style) {
var converted = Object.create(null);
for (var prop in style) {
converted[prop.replace(regExp, replace)] = style[prop];
}
if (style.fallbacks) {
if (Array.isArray(style.fallbacks)) converted.fallbacks = style.fallbacks.map(convertCase);else converted.fallbacks = convertCase(style.fallbacks);
}
return converted;
}
/**
* Allow camel cased property names by converting them back to dasherized.
*
* @param {Rule} rule
*/
function camelCase() {
function onProcessStyle(style) {
if (Array.isArray(style)) {
// Handle rules like @font-face, which can have multiple styles in an array
for (var index = 0; index < style.length; index++) {
style[index] = convertCase(style[index]);
}
return style;
}
return convertCase(style);
}
return { onProcessStyle: onProcessStyle };
}
/***/ }),
/* 472 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = jssCompose;
var _warning = __webpack_require__(22);
var _warning2 = _interopRequireDefault(_warning);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Set class name.
*
* @param {Object} original rule
* @param {String} compostion class string
* @return {Boolean} flag, indicating function was successfull or not
*/
function setClass(rule, composition) {
// Skip falsy values
if (!composition) return true;
if (Array.isArray(composition)) {
for (var index = 0; index < composition.length; index++) {
var isSetted = setClass(rule, composition[index]);
if (!isSetted) return false;
}
return true;
}
if (composition.indexOf(' ') > -1) {
return setClass(rule, composition.split(' '));
}
if (composition[0] === '$') {
var refRule = rule.options.sheet.getRule(composition.substr(1));
if (!refRule) {
(0, _warning2.default)(false, '[JSS] Referenced rule is not defined. \r\n%s', rule);
return false;
}
if (refRule === rule) {
(0, _warning2.default)(false, '[JSS] Cyclic composition detected. \r\n%s', rule);
return false;
}
setClass(rule, refRule.className);
return true;
}
var container = rule.options.parent;
rule.className += ' ' + composition;
container.classes[rule.name] = rule.className;
return true;
}
/**
* Convert compose property to additional class, remove property from original styles.
*
* @param {Rule} rule
* @api public
*/
function jssCompose() {
function onProcessStyle(style, rule) {
if (!style.composes) return style;
setClass(rule, style.composes);
// Remove composes property to prevent infinite loop.
delete style.composes;
return style;
}
return { onProcessStyle: onProcessStyle };
}
/***/ }),
/* 473 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
/**
* Generated jss-default-unit CSS property units
*
* @type object
*/
exports['default'] = {
'animation-delay': 'ms',
'animation-duration': 'ms',
'background-position': 'px',
'background-position-x': 'px',
'background-position-y': 'px',
'background-size': 'px',
border: 'px',
'border-bottom': 'px',
'border-bottom-left-radius': 'px',
'border-bottom-right-radius': 'px',
'border-bottom-width': 'px',
'border-left': 'px',
'border-left-width': 'px',
'border-radius': 'px',
'border-right': 'px',
'border-right-width': 'px',
'border-spacing': 'px',
'border-top': 'px',
'border-top-left-radius': 'px',
'border-top-right-radius': 'px',
'border-top-width': 'px',
'border-width': 'px',
'border-after-width': 'px',
'border-before-width': 'px',
'border-end-width': 'px',
'border-horizontal-spacing': 'px',
'border-start-width': 'px',
'border-vertical-spacing': 'px',
bottom: 'px',
'box-shadow': 'px',
'column-gap': 'px',
'column-rule': 'px',
'column-rule-width': 'px',
'column-width': 'px',
'flex-basis': 'px',
'font-size': 'px',
'font-size-delta': 'px',
height: 'px',
left: 'px',
'letter-spacing': 'px',
'logical-height': 'px',
'logical-width': 'px',
margin: 'px',
'margin-after': 'px',
'margin-before': 'px',
'margin-bottom': 'px',
'margin-left': 'px',
'margin-right': 'px',
'margin-top': 'px',
'max-height': 'px',
'max-width': 'px',
'margin-end': 'px',
'margin-start': 'px',
'mask-position-x': 'px',
'mask-position-y': 'px',
'mask-size': 'px',
'max-logical-height': 'px',
'max-logical-width': 'px',
'min-height': 'px',
'min-width': 'px',
'min-logical-height': 'px',
'min-logical-width': 'px',
motion: 'px',
'motion-offset': 'px',
outline: 'px',
'outline-offset': 'px',
'outline-width': 'px',
padding: 'px',
'padding-bottom': 'px',
'padding-left': 'px',
'padding-right': 'px',
'padding-top': 'px',
'padding-after': 'px',
'padding-before': 'px',
'padding-end': 'px',
'padding-start': 'px',
'perspective-origin-x': '%',
'perspective-origin-y': '%',
perspective: 'px',
right: 'px',
'shape-margin': 'px',
size: 'px',
'text-indent': 'px',
'text-stroke': 'px',
'text-stroke-width': 'px',
top: 'px',
'transform-origin': '%',
'transform-origin-x': '%',
'transform-origin-y': '%',
'transform-origin-z': '%',
'transition-delay': 'ms',
'transition-duration': 'ms',
'vertical-align': 'px',
width: 'px',
'word-spacing': 'px',
// Not existing properties.
// Used to avoid issues with jss-expand intergration.
'box-shadow-x': 'px',
'box-shadow-y': 'px',
'box-shadow-blur': 'px',
'box-shadow-spread': 'px',
'font-line-height': 'px',
'text-shadow-x': 'px',
'text-shadow-y': 'px',
'text-shadow-blur': 'px'
};
/***/ }),
/* 474 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = defaultUnit;
var _defaultUnits = __webpack_require__(473);
var _defaultUnits2 = _interopRequireDefault(_defaultUnits);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
/**
* Clones the object and adds a camel cased property version.
*/
function addCamelCasedVersion(obj) {
var regExp = /(-[a-z])/g;
var replace = function replace(str) {
return str[1].toUpperCase();
};
var newObj = {};
for (var key in obj) {
newObj[key] = obj[key];
newObj[key.replace(regExp, replace)] = obj[key];
}
return newObj;
}
var units = addCamelCasedVersion(_defaultUnits2['default']);
/**
* Recursive deep style passing function
*
* @param {String} current property
* @param {(Object|Array|Number|String)} property value
* @param {Object} options
* @return {(Object|Array|Number|String)} resulting value
*/
function iterate(prop, value, options) {
if (!value) return value;
var convertedValue = value;
switch (value.constructor) {
case Object:
if (prop === 'fallbacks') {
for (var innerProp in value) {
value[innerProp] = iterate(innerProp, value[innerProp], options);
}
break;
}
for (var _innerProp in value) {
value[_innerProp] = iterate(prop + '-' + _innerProp, value[_innerProp], options);
}
break;
case Array:
for (var i = 0; i < value.length; i++) {
value[i] = iterate(prop, value[i], options);
}
break;
case Number:
convertedValue = addUnit(prop, value, options);
break;
default:
break;
}
return convertedValue;
}
/**
* Check if default unit must be added
*
* @param {String} current property
* @param {(Object|Array|Number|String)} property value
* @param {Object} options
* @return {String} string with units
*/
function addUnit(prop, value, options) {
if (typeof value === 'number' && value !== 0) {
value += options[prop] || units[prop] || '';
}
return value;
}
/**
* Add unit to numeric values.
*
* @param {Rule} rule
* @api public
*/
function defaultUnit() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var camelCasedOptions = addCamelCasedVersion(options);
function onProcessStyle(style, rule) {
if (rule.type !== 'regular') return style;
for (var prop in style) {
style[prop] = iterate(prop, style[prop], camelCasedOptions);
}
return style;
}
function onChangeValue(value, prop) {
return iterate(prop, value, camelCasedOptions);
}
return { onProcessStyle: onProcessStyle, onChangeValue: onChangeValue };
}
/***/ }),
/* 475 */
/***/ (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; }; }();
exports['default'] = jssGlobal;
var _jss = __webpack_require__(85);
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var key = '@global';
var prefixKey = '@global ';
var GlobalContainerRule = function () {
function GlobalContainerRule(name, styles, options) {
_classCallCheck(this, GlobalContainerRule);
this.type = 'global';
this.name = name;
this.options = options;
this.rules = new _jss.RulesContainer(_extends({}, options, {
parent: this
}));
for (var selector in styles) {
this.rules.add(selector, styles[selector], {
generateClassName: null,
selector: selector
});
}
this.rules.process();
}
/**
* Get a rule.
*/
_createClass(GlobalContainerRule, [{
key: 'getRule',
value: function getRule(name) {
return this.rules.get(name);
}
/**
* Create and register rule, run plugins.
*/
}, {
key: 'addRule',
value: function addRule(name, style, options) {
var rule = this.rules.add(name, style, _extends({}, options, {
generateClassName: null
}));
this.options.jss.plugins.onProcessRule(rule);
return rule;
}
/**
* Get index of a rule.
*/
}, {
key: 'indexOf',
value: function indexOf(rule) {
return this.rules.indexOf(rule);
}
/**
* Generates a CSS string.
*/
}, {
key: 'toString',
value: function toString() {
return this.rules.toString();
}
}]);
return GlobalContainerRule;
}();
var GlobalPrefixedRule = function () {
function GlobalPrefixedRule(name, style, options) {
_classCallCheck(this, GlobalPrefixedRule);
this.name = name;
this.options = options;
var selector = name.substr(prefixKey.length);
this.rule = options.jss.createRule(selector, style, _extends({}, options, {
parent: this,
selector: selector,
generateClassName: null
}));
}
_createClass(GlobalPrefixedRule, [{
key: 'toString',
value: function toString(options) {
return this.rule.toString(options);
}
}]);
return GlobalPrefixedRule;
}();
var separatorRegExp = /\s*,\s*/g;
function addScope(selector, scope) {
var parts = selector.split(separatorRegExp);
var scoped = '';
for (var i = 0; i < parts.length; i++) {
scoped += scope + ' ' + parts[i].trim();
if (parts[i + 1]) scoped += ', ';
}
return scoped;
}
function handleNestedGlobalContainerRule(rule) {
var options = rule.options,
style = rule.style;
var rules = style[key];
if (!rules) return;
for (var name in rules) {
options.sheet.addRule(name, rules[name], _extends({}, options, {
selector: addScope(name, rule.selector),
generateClassName: null
}));
}
delete style[key];
}
function handlePrefixedGlobalRule(rule) {
var options = rule.options,
style = rule.style;
for (var prop in style) {
if (prop.substr(0, key.length) !== key) continue;
var selector = addScope(prop.substr(key.length), rule.selector);
options.sheet.addRule(selector, style[prop], _extends({}, options, {
selector: selector,
generateClassName: null
}));
delete style[prop];
}
}
/**
* Convert nested rules to separate, remove them from original styles.
*
* @param {Rule} rule
* @api public
*/
function jssGlobal() {
function onCreateRule(name, styles, options) {
if (name === key) {
return new GlobalContainerRule(name, styles, options);
}
if (name[0] === '@' && name.substr(0, prefixKey.length) === prefixKey) {
return new GlobalPrefixedRule(name, styles, options);
}
var parent = options.parent;
if (parent) {
if (parent.type === 'global' || parent.options.parent.type === 'global') {
options.global = true;
}
}
if (options.global) {
options.selector = name;
options.generateClassName = null;
}
return null;
}
function onProcessRule(rule) {
if (rule.type !== 'regular' || !rule.style) return;
handleNestedGlobalContainerRule(rule);
handlePrefixedGlobalRule(rule);
}
return { onCreateRule: onCreateRule, onProcessRule: onProcessRule };
}
/***/ }),
/* 476 */
/***/ (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 = jssNested;
var _warning = __webpack_require__(22);
var _warning2 = _interopRequireDefault(_warning);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
var separatorRegExp = /\s*,\s*/g;
var parentRegExp = /&/g;
var refRegExp = /\$([\w-]+)/g;
/**
* Convert nested rules to separate, remove them from original styles.
*
* @param {Rule} rule
* @api public
*/
function jssNested() {
// Get a function to be used for $ref replacement.
function getReplaceRef(container) {
return function (match, name) {
var rule = container.getRule(name);
if (rule) return rule.selector;
(0, _warning2.default)(false, '[JSS] Could not find the referenced rule %s in %s.', name, container.options.meta || container);
return name;
};
}
var hasAnd = function hasAnd(str) {
return str.indexOf('&') !== -1;
};
function replaceParentRefs(nestedProp, parentProp) {
var parentSelectors = parentProp.split(separatorRegExp);
var nestedSelectors = nestedProp.split(separatorRegExp);
var result = '';
for (var i = 0; i < parentSelectors.length; i++) {
var parent = parentSelectors[i];
for (var j = 0; j < nestedSelectors.length; j++) {
var nested = nestedSelectors[j];
if (result) result += ', ';
// Replace all & by the parent or prefix & with the parent.
result += hasAnd(nested) ? nested.replace(parentRegExp, parent) : parent + ' ' + nested;
}
}
return result;
}
function getOptions(rule, container, options) {
// Options has been already created, now we only increase index.
if (options) return _extends({}, options, { index: options.index + 1 });
var nestingLevel = rule.options.nestingLevel;
nestingLevel = nestingLevel === undefined ? 1 : nestingLevel + 1;
return _extends({}, rule.options, {
nestingLevel: nestingLevel,
index: container.indexOf(rule) + 1
});
}
function onProcessStyle(style, rule) {
if (rule.type !== 'regular') return style;
var container = rule.options.parent;
var options = void 0;
var replaceRef = void 0;
for (var prop in style) {
var isNested = hasAnd(prop);
var isNestedConditional = prop[0] === '@';
if (!isNested && !isNestedConditional) continue;
options = getOptions(rule, container, options);
if (isNested) {
var selector = replaceParentRefs(prop, rule.selector);
// Lazily create the ref replacer function just once for
// all nested rules within the sheet.
if (!replaceRef) replaceRef = getReplaceRef(container);
// Replace all $refs.
selector = selector.replace(refRegExp, replaceRef);
container.addRule(selector, style[prop], _extends({}, options, { selector: selector }));
} else if (isNestedConditional) {
// Place conditional right after the parent rule to ensure right ordering.
container.addRule(prop, _defineProperty({}, rule.name, style[prop]), options);
}
delete style[prop];
}
return style;
}
return { onProcessStyle: onProcessStyle };
}
/***/ }),
/* 477 */
/***/ (function(module, exports, __webpack_require__) {
"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 _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 _StyleSheet = __webpack_require__(479);
var _StyleSheet2 = _interopRequireDefault(_StyleSheet);
var _PluginsRegistry = __webpack_require__(478);
var _PluginsRegistry2 = _interopRequireDefault(_PluginsRegistry);
var _plugins = __webpack_require__(488);
var _plugins2 = _interopRequireDefault(_plugins);
var _sheets = __webpack_require__(131);
var _sheets2 = _interopRequireDefault(_sheets);
var _generateClassName = __webpack_require__(491);
var _generateClassName2 = _interopRequireDefault(_generateClassName);
var _createRule2 = __webpack_require__(220);
var _createRule3 = _interopRequireDefault(_createRule2);
var _findRenderer = __webpack_require__(221);
var _findRenderer2 = _interopRequireDefault(_findRenderer);
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"); } }
var Jss = function () {
function Jss(options) {
_classCallCheck(this, Jss);
this.version = "7.1.2";
this.plugins = new _PluginsRegistry2['default']();
// eslint-disable-next-line prefer-spread
this.use.apply(this, _plugins2['default']);
this.setup(options);
}
_createClass(Jss, [{
key: 'setup',
value: function setup() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
this.options = _extends({
generateClassName: options.generateClassName || _generateClassName2['default'],
insertionPoint: options.insertionPoint || 'jss'
}, options);
// eslint-disable-next-line prefer-spread
if (options.plugins) this.use.apply(this, options.plugins);
return this;
}
/**
* Create a Style Sheet.
*/
}, {
key: 'createStyleSheet',
value: function createStyleSheet(styles, options) {
var sheet = new _StyleSheet2['default'](styles, _extends({
jss: this,
generateClassName: this.options.generateClassName,
insertionPoint: this.options.insertionPoint
}, options));
this.plugins.onProcessSheet(sheet);
return sheet;
}
/**
* Detach the Style Sheet and remove it from the registry.
*/
}, {
key: 'removeStyleSheet',
value: function removeStyleSheet(sheet) {
sheet.detach();
_sheets2['default'].remove(sheet);
return this;
}
/**
* Create a rule without a Style Sheet.
*/
}, {
key: 'createRule',
value: function createRule(name) {
var style = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
// Enable rule without name for inline styles.
if ((typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') {
options = style;
style = name;
name = undefined;
}
if (!options.classes) options.classes = {};
if (!options.jss) options.jss = this;
if (!options.Renderer) options.Renderer = (0, _findRenderer2['default'])(options);
if (!options.generateClassName) {
options.generateClassName = this.options.generateClassName || _generateClassName2['default'];
}
var rule = (0, _createRule3['default'])(name, style, options);
this.plugins.onProcessRule(rule);
return rule;
}
/**
* Register plugin. Passed function will be invoked with a rule instance.
*/
}, {
key: 'use',
value: function use() {
var _this = this;
for (var _len = arguments.length, plugins = Array(_len), _key = 0; _key < _len; _key++) {
plugins[_key] = arguments[_key];
}
plugins.forEach(function (plugin) {
return _this.plugins.use(plugin);
});
return this;
}
}]);
return Jss;
}();
exports['default'] = Jss;
/***/ }),
/* 478 */
/***/ (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 _warning = __webpack_require__(22);
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"); } }
var PluginsRegistry = function () {
function PluginsRegistry() {
_classCallCheck(this, PluginsRegistry);
this.hooks = {
onCreateRule: [],
onProcessRule: [],
onProcessStyle: [],
onProcessSheet: [],
onChangeValue: []
};
}
_createClass(PluginsRegistry, [{
key: 'onCreateRule',
/**
* Call `onCreateRule` hooks and return an object if returned by a hook.
*/
value: function onCreateRule(name, decl, options) {
for (var i = 0; i < this.hooks.onCreateRule.length; i++) {
var rule = this.hooks.onCreateRule[i](name, decl, options);
if (rule) return rule;
}
return null;
}
/**
* Call `onProcessRule` hooks.
*/
}, {
key: 'onProcessRule',
value: function onProcessRule(rule) {
if (rule.isProcessed) return;
var sheet = rule.options.sheet;
for (var i = 0; i < this.hooks.onProcessRule.length; i++) {
this.hooks.onProcessRule[i](rule, sheet);
}
if (rule.style) this.onProcessStyle(rule.style, rule, sheet);
rule.isProcessed = true;
}
/**
* Call `onProcessStyle` hooks.
*/
}, {
key: 'onProcessStyle',
value: function onProcessStyle(style, rule, sheet) {
for (var i = 0; i < this.hooks.onProcessStyle.length; i++) {
rule.style = style = this.hooks.onProcessStyle[i](style, rule, sheet);
}
}
/**
* Call `onProcessSheet` hooks.
*/
}, {
key: 'onProcessSheet',
value: function onProcessSheet(sheet) {
for (var i = 0; i < this.hooks.onProcessSheet.length; i++) {
this.hooks.onProcessSheet[i](sheet);
}
}
/**
* Call `onChangeValue` hooks.
*/
}, {
key: 'onChangeValue',
value: function onChangeValue(value, prop, rule) {
var processedValue = value;
for (var i = 0; i < this.hooks.onChangeValue.length; i++) {
processedValue = this.hooks.onChangeValue[i](processedValue, prop, rule);
}
return processedValue;
}
/**
* Register a plugin.
* If function is passed, it is a shortcut for `{onProcessRule}`.
*/
}, {
key: 'use',
value: function use(plugin) {
for (var name in plugin) {
if (this.hooks[name]) this.hooks[name].push(plugin[name]);else (0, _warning2['default'])(false, '[JSS] Unknown hook "%s".', name);
}
}
}]);
return PluginsRegistry;
}();
exports['default'] = PluginsRegistry;
/***/ }),
/* 479 */
/***/ (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 _findRenderer = __webpack_require__(221);
var _findRenderer2 = _interopRequireDefault(_findRenderer);
var _RulesContainer = __webpack_require__(84);
var _RulesContainer2 = _interopRequireDefault(_RulesContainer);
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"); } }
var StyleSheet = function () {
function StyleSheet(styles, options) {
_classCallCheck(this, StyleSheet);
var Renderer = (0, _findRenderer2['default'])(options);
var index = typeof options.index === 'number' ? options.index : 0;
this.attached = false;
this.deployed = false;
this.linked = false;
this.classes = Object.create(null);
this.options = _extends({
sheet: this,
parent: this,
classes: this.classes,
index: index,
Renderer: Renderer
}, options);
this.renderer = new Renderer(this);
this.renderer.createElement();
this.rules = new _RulesContainer2['default'](this.options);
for (var name in styles) {
this.rules.add(name, styles[name]);
}
this.rules.process();
}
/**
* Attach renderable to the render tree.
*/
_createClass(StyleSheet, [{
key: 'attach',
value: function attach() {
if (this.attached) return this;
if (!this.deployed) this.deploy();
this.renderer.attach();
if (!this.linked && this.options.link) this.link();
this.attached = true;
return this;
}
/**
* Remove renderable from render tree.
*/
}, {
key: 'detach',
value: function detach() {
if (!this.attached) return this;
this.renderer.detach();
this.attached = false;
return this;
}
/**
* Add a rule to the current stylesheet.
* Will insert a rule also after the stylesheet has been rendered first time.
*/
}, {
key: 'addRule',
value: function addRule(name, decl, options) {
var queue = this.queue;
// Plugins can create rules.
// In order to preserve the right order, we need to queue all `.addRule` calls,
// which happen after the first `rules.add()` call.
if (this.attached && !queue) this.queue = [];
var rule = this.rules.add(name, decl, options);
this.options.jss.plugins.onProcessRule(rule);
if (this.attached) {
if (!this.deployed) return rule;
// Don't insert rule directly if there is no stringified version yet.
// It will be inserted all together when .attach is called.
if (queue) queue.push(rule);else {
var renderable = this.renderer.insertRule(rule);
if (renderable && this.options.link) rule.renderable = renderable;
if (this.queue) {
this.queue.forEach(this.renderer.insertRule, this.renderer);
this.queue = undefined;
}
}
return rule;
}
// We can't add rules to a detached style node.
// We will redeploy the sheet once user will attach it.
this.deployed = false;
return rule;
}
/**
* Create and add rules.
* Will render also after Style Sheet was rendered the first time.
*/
}, {
key: 'addRules',
value: function addRules(styles, options) {
var added = [];
for (var name in styles) {
added.push(this.addRule(name, styles[name], options));
}
return added;
}
/**
* Get a rule by name.
*/
}, {
key: 'getRule',
value: function getRule(name) {
return this.rules.get(name);
}
/**
* Delete a rule by name.
* Returns `true`: if rule has been deleted from the DOM.
*/
}, {
key: 'deleteRule',
value: function deleteRule(name) {
var rule = this.rules.get(name);
if (!rule) return false;
this.rules.remove(rule);
if (this.attached && rule.renderable) {
return this.renderer.deleteRule(rule.renderable);
}
return true;
}
/**
* Get index of a rule.
*/
}, {
key: 'indexOf',
value: function indexOf(rule) {
return this.rules.indexOf(rule);
}
/**
* Deploy pure CSS string to a renderable.
*/
}, {
key: 'deploy',
value: function deploy() {
this.renderer.deploy();
this.deployed = true;
return this;
}
/**
* Link renderable CSS rules with their corresponding models.
*/
}, {
key: 'link',
value: function link() {
var cssRules = this.renderer.getRules();
// Is undefined when VirtualRenderer is used.
if (cssRules) {
for (var i = 0; i < cssRules.length; i++) {
var CSSStyleRule = cssRules[i];
var rule = this.rules.get(CSSStyleRule.selectorText);
if (rule) rule.renderable = CSSStyleRule;
}
}
this.linked = true;
return this;
}
/**
* Update the function values with a new data.
*/
}, {
key: 'update',
value: function update(name, data) {
this.rules.update(name, data);
return this;
}
/**
* Convert rules to a CSS string.
*/
}, {
key: 'toString',
value: function toString(options) {
return this.rules.toString(options);
}
}]);
return StyleSheet;
}();
exports['default'] = StyleSheet;
/***/ }),
/* 480 */
/***/ (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 _warning = __webpack_require__(22);
var _warning2 = _interopRequireDefault(_warning);
var _sheets = __webpack_require__(131);
var _sheets2 = _interopRequireDefault(_sheets);
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"); } }
/**
* Get a style property.
*/
function getStyle(rule, prop) {
try {
return rule.style.getPropertyValue(prop);
} catch (err) {
// IE may throw if property is unknown.
return '';
}
}
/**
* Set a style property.
*/
function setStyle(rule, prop, value) {
try {
rule.style.setProperty(prop, value);
} catch (err) {
// IE may throw if property is unknown.
return false;
}
return true;
}
/**
* Get the selector.
*/
function getSelector(rule) {
return rule.selectorText;
}
/**
* Set the selector.
*/
function setSelector(rule, selectorText) {
rule.selectorText = selectorText;
// Return false if setter was not successful.
// Currently works in chrome only.
return rule.selectorText === selectorText;
}
/**
* Gets the `head` element upon the first call and caches it.
*/
var getHead = function () {
var head = void 0;
return function () {
if (!head) head = document.head || document.getElementsByTagName('head')[0];
return head;
};
}();
/**
* Find attached sheet with an index higher than the passed one.
*/
function findHigherSheet(registry, options) {
for (var i = 0; i < registry.length; i++) {
var sheet = registry[i];
if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {
return sheet;
}
}
return null;
}
/**
* Find attached sheet with the highest index.
*/
function findHighestSheet(registry, options) {
for (var i = registry.length - 1; i >= 0; i--) {
var sheet = registry[i];
if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {
return sheet;
}
}
return null;
}
/**
* Find a comment with "jss" inside.
*/
function findCommentNode(text) {
var head = getHead();
for (var i = 0; i < head.childNodes.length; i++) {
var node = head.childNodes[i];
if (node.nodeType === 8 && node.nodeValue.trim() === text) {
return node;
}
}
return null;
}
/**
* Find a node before which we can insert the sheet.
*/
function findPrevNode(options) {
var registry = _sheets2['default'].registry;
if (registry.length > 0) {
// Try to insert before the next higher sheet.
var sheet = findHigherSheet(registry, options);
if (sheet) return sheet.renderer.element;
// Otherwise insert after the last attached.
sheet = findHighestSheet(registry, options);
if (sheet) return sheet.renderer.element.nextElementSibling;
}
// Try to find a comment placeholder if registry is empty.
var comment = findCommentNode(options.insertionPoint);
if (comment) return comment.nextSibling;
return null;
}
var DomRenderer = function () {
function DomRenderer(sheet) {
_classCallCheck(this, DomRenderer);
this.getStyle = getStyle;
this.setStyle = setStyle;
this.setSelector = setSelector;
this.getSelector = getSelector;
this.hasInsertedRules = false;
this.sheet = sheet;
// There is no sheet when the renderer is used from a standalone RegularRule.
if (sheet) _sheets2['default'].add(sheet);
}
/**
* Create and ref style element.
*/
// HTMLStyleElement needs fixing https://github.com/facebook/flow/issues/2696
_createClass(DomRenderer, [{
key: 'createElement',
value: function createElement() {
var _ref = this.sheet ? this.sheet.options : {},
media = _ref.media,
meta = _ref.meta,
element = _ref.element;
this.element = element || document.createElement('style');
this.element.type = 'text/css';
this.element.setAttribute('data-jss', '');
if (media) this.element.setAttribute('media', media);
if (meta) this.element.setAttribute('data-meta', meta);
}
/**
* Insert style element into render tree.
*/
}, {
key: 'attach',
value: function attach() {
// In the case the element node is external and it is already in the DOM.
if (this.element.parentNode || !this.sheet) return;
// When rules are inserted using `insertRule` API, after `sheet.detach().attach()`
// browsers remove those rules.
// TODO figure out if its a bug and if it is known.
// Workaround is to redeploy the sheet before attaching as a string.
if (this.hasInsertedRules) {
this.deploy();
this.hasInsertedRules = false;
}
var prevNode = findPrevNode(this.sheet.options);
getHead().insertBefore(this.element, prevNode);
}
/**
* Remove style element from render tree.
*/
}, {
key: 'detach',
value: function detach() {
this.element.parentNode.removeChild(this.element);
}
/**
* Inject CSS string into element.
*/
}, {
key: 'deploy',
value: function deploy() {
if (!this.sheet) return;
this.element.textContent = '\n' + this.sheet.toString() + '\n';
}
/**
* Insert a rule into element.
*/
}, {
key: 'insertRule',
value: function insertRule(rule) {
var sheet = this.element.sheet;
var cssRules = sheet.cssRules;
var index = cssRules.length;
var str = rule.toString();
if (!str) return false;
try {
sheet.insertRule(str, index);
} catch (err) {
(0, _warning2['default'])(false, '[JSS] Can not insert an unsupported rule \n\r%s', rule);
return false;
}
this.hasInsertedRules = true;
return cssRules[index];
}
/**
* Delete a rule.
*/
}, {
key: 'deleteRule',
value: function deleteRule(rule) {
var sheet = this.element.sheet;
var cssRules = sheet.cssRules;
for (var _index = 0; _index < cssRules.length; _index++) {
if (rule === cssRules[_index]) {
sheet.deleteRule(_index);
return true;
}
}
return false;
}
/**
* Get all rules elements.
*/
}, {
key: 'getRules',
value: function getRules() {
return this.element.sheet.cssRules;
}
}]);
return DomRenderer;
}();
exports['default'] = DomRenderer;
/***/ }),
/* 481 */
/***/ (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; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
/* eslint-disable class-methods-use-this */
/**
* Rendering backend to do nothing in nodejs.
*/
var VirtualRenderer = function () {
function VirtualRenderer() {
_classCallCheck(this, VirtualRenderer);
}
_createClass(VirtualRenderer, [{
key: 'createElement',
value: function createElement() {}
}, {
key: 'setStyle',
value: function setStyle() {
return true;
}
}, {
key: 'getStyle',
value: function getStyle() {
return '';
}
}, {
key: 'setSelector',
value: function setSelector() {
return true;
}
}, {
key: 'getSelector',
value: function getSelector() {
return '';
}
}, {
key: 'attach',
value: function attach() {}
}, {
key: 'detach',
value: function detach() {}
}, {
key: 'deploy',
value: function deploy() {}
}, {
key: 'insertRule',
value: function insertRule() {
return true;
}
}, {
key: 'deleteRule',
value: function deleteRule() {
return true;
}
}, {
key: 'getRules',
value: function getRules() {}
}]);
return VirtualRenderer;
}();
exports['default'] = VirtualRenderer;
/***/ }),
/* 482 */
/***/ (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 _RulesContainer = __webpack_require__(84);
var _RulesContainer2 = _interopRequireDefault(_RulesContainer);
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"); } }
/**
* Conditional rule for @media, @supports
*/
var ConditionalRule = function () {
function ConditionalRule(selector, styles, options) {
_classCallCheck(this, ConditionalRule);
this.type = 'conditional';
this.selector = selector;
this.options = options;
this.rules = new _RulesContainer2['default'](_extends({}, options, { parent: this }));
for (var name in styles) {
this.rules.add(name, styles[name]);
}
this.rules.process();
}
/**
* Get a rule.
*/
_createClass(ConditionalRule, [{
key: 'getRule',
value: function getRule(name) {
return this.rules.get(name);
}
/**
* Get index of a rule.
*/
}, {
key: 'indexOf',
value: function indexOf(rule) {
return this.rules.indexOf(rule);
}
/**
* Create and register rule, run plugins.
*/
}, {
key: 'addRule',
value: function addRule(name, style, options) {
var rule = this.rules.add(name, style, options);
this.options.jss.plugins.onProcessRule(rule);
return rule;
}
/**
* Generates a CSS string.
*/
}, {
key: 'toString',
value: function toString() {
var inner = this.rules.toString({ indent: 1 });
return inner ? this.selector + ' {\n' + inner + '\n}' : '';
}
}]);
return ConditionalRule;
}();
exports['default'] = ConditionalRule;
/***/ }),
/* 483 */
/***/ (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 _toCss = __webpack_require__(132);
var _toCss2 = _interopRequireDefault(_toCss);
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"); } }
var FontFaceRule = function () {
function FontFaceRule(selector, style, options) {
_classCallCheck(this, FontFaceRule);
this.type = 'font-face';
this.selector = selector;
this.style = style;
this.options = options;
}
/**
* Generates a CSS string.
*/
_createClass(FontFaceRule, [{
key: 'toString',
value: function toString() {
if (Array.isArray(this.style)) {
var str = '';
for (var index = 0; index < this.style.length; index++) {
str += (0, _toCss2['default'])(this.selector, this.style[index]);
if (this.style[index + 1]) str += '\n';
}
return str;
}
return (0, _toCss2['default'])(this.selector, this.style);
}
}]);
return FontFaceRule;
}();
exports['default'] = FontFaceRule;
/***/ }),
/* 484 */
/***/ (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 _RulesContainer = __webpack_require__(84);
var _RulesContainer2 = _interopRequireDefault(_RulesContainer);
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"); } }
/**
* Rule for @keyframes
*/
var KeyframeRule = function () {
function KeyframeRule(selector, frames, options) {
_classCallCheck(this, KeyframeRule);
this.type = 'keyframe';
this.selector = selector;
this.options = options;
this.rules = new _RulesContainer2['default'](_extends({}, options, { parent: this }));
for (var name in frames) {
this.rules.add(name, frames[name], _extends({}, this.options, {
parent: this,
className: name,
selector: name
}));
}
this.rules.process();
}
/**
* Generates a CSS string.
*/
_createClass(KeyframeRule, [{
key: 'toString',
value: function toString() {
var inner = this.rules.toString({ indent: 1 });
if (inner) inner += '\n';
return this.selector + ' {\n' + inner + '}';
}
}]);
return KeyframeRule;
}();
exports['default'] = KeyframeRule;
/***/ }),
/* 485 */
/***/ (function(module, exports, __webpack_require__) {
"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 _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 _toCss = __webpack_require__(132);
var _toCss2 = _interopRequireDefault(_toCss);
var _toCssValue = __webpack_require__(222);
var _toCssValue2 = _interopRequireDefault(_toCssValue);
var _findClassNames = __webpack_require__(490);
var _findClassNames2 = _interopRequireDefault(_findClassNames);
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"); } }
var RegularRule = function () {
/**
* We expect `style` to be a plain object.
* To avoid original style object mutations, we clone it and hash it
* along the way.
* It is also the fastetst way.
* http://jsperf.com/lodash-deepclone-vs-jquery-extend-deep/6
*/
function RegularRule(name, style, options) {
_classCallCheck(this, RegularRule);
this.type = 'regular';
var generateClassName = options.generateClassName,
sheet = options.sheet,
Renderer = options.Renderer;
this.name = name;
this.className = '';
this.options = options;
this.style = style;
if (options.className) this.className = options.className;else if (generateClassName) this.className = generateClassName(this, options.sheet);
this.selectorText = options.selector || '.' + this.className;
if (sheet) this.renderer = sheet.renderer;else if (Renderer) this.renderer = new Renderer();
}
/**
* Set selector string.
* Attenition: use this with caution. Most browser didn't implement
* selectorText setter, so this may result in rerendering of entire Style Sheet.
*/
_createClass(RegularRule, [{
key: 'prop',
/**
* Get or set a style property.
*/
value: function prop(name, value) {
var $name = typeof this.style[name] === 'function' ? '$' + name : name;
var currValue = this.style[$name];
// Its a setter.
if (value != null) {
// Don't do anything if the value has not changed.
if (currValue !== value) {
var jss = this.options.jss;
var newValue = jss ? jss.plugins.onChangeValue(value, name, this) : value;
Object.defineProperty(this.style, $name, {
value: newValue,
writable: true
});
// Only defined if option linked is true.
if (this.renderable) this.renderer.setStyle(this.renderable, name, newValue);
}
return this;
}
// Its a getter, read the value from the DOM if its not cached.
if (this.renderable && currValue == null) {
currValue = this.renderer.getStyle(this.renderable, name);
// Cache the value after we have got it from the DOM first time.
this.prop(name, currValue);
}
return this.style[$name];
}
/**
* Apply rule to an element inline.
*/
}, {
key: 'applyTo',
value: function applyTo(renderable) {
var json = this.toJSON();
for (var prop in json) {
this.renderer.setStyle(renderable, prop, json[prop]);
}return this;
}
/**
* Returns JSON representation of the rule.
* Fallbacks are not supported.
* Useful for inline styles.
*/
}, {
key: 'toJSON',
value: function toJSON() {
var json = Object.create(null);
for (var prop in this.style) {
var value = this.style[prop];
var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);
if (type === 'function') json[prop] = this.style['$' + prop];else if (type !== 'object') json[prop] = value;else if (Array.isArray(value)) json[prop] = (0, _toCssValue2['default'])(value);
}
return json;
}
/**
* Generates a CSS string.
*/
}, {
key: 'toString',
value: function toString(options) {
return (0, _toCss2['default'])(this.selector, this.style, options);
}
}, {
key: 'selector',
set: function set(selector) {
var sheet = this.options.sheet;
// After we modify a selector, ref by old selector needs to be removed.
if (sheet) sheet.rules.unregister(this);
this.selectorText = selector;
this.className = (0, _findClassNames2['default'])(selector);
if (!this.renderable) {
// Register the rule with new selector.
if (sheet) sheet.rules.register(this);
return;
}
var changed = this.renderer.setSelector(this.renderable, selector);
if (changed && sheet) {
sheet.rules.register(this);
return;
}
// If selector setter is not implemented, rerender the sheet.
// We need to delete renderable from the rule, because when sheet.deploy()
// calls rule.toString, it will get the old selector.
delete this.renderable;
if (sheet) {
sheet.rules.register(this);
sheet.deploy().link();
}
}
/**
* Get selector string.
*/
,
get: function get() {
if (this.renderable) {
return this.renderer.getSelector(this.renderable);
}
return this.selectorText;
}
}]);
return RegularRule;
}();
exports['default'] = RegularRule;
/***/ }),
/* 486 */
/***/ (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; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var SimpleRule = function () {
function SimpleRule(name, value, options) {
_classCallCheck(this, SimpleRule);
this.type = 'simple';
this.name = name;
this.value = value;
this.options = options;
}
/**
* Generates a CSS string.
*/
_createClass(SimpleRule, [{
key: 'toString',
value: function toString() {
if (Array.isArray(this.value)) {
var str = '';
for (var index = 0; index < this.value.length; index++) {
str += this.name + ' ' + this.value[index] + ';';
if (this.value[index + 1]) str += '\n';
}
return str;
}
return this.name + ' ' + this.value + ';';
}
}]);
return SimpleRule;
}();
exports['default'] = SimpleRule;
/***/ }),
/* 487 */
/***/ (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 _toCss = __webpack_require__(132);
var _toCss2 = _interopRequireDefault(_toCss);
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"); } }
var ViewportRule = function () {
function ViewportRule(name, style, options) {
_classCallCheck(this, ViewportRule);
this.type = 'viewport';
this.name = name;
this.style = style;
this.options = options;
}
/**
* Generates a CSS string.
*/
_createClass(ViewportRule, [{
key: 'toString',
value: function toString() {
return (0, _toCss2['default'])(this.name, this.style);
}
}]);
return ViewportRule;
}();
exports['default'] = ViewportRule;
/***/ }),
/* 488 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _SimpleRule = __webpack_require__(486);
var _SimpleRule2 = _interopRequireDefault(_SimpleRule);
var _KeyframeRule = __webpack_require__(484);
var _KeyframeRule2 = _interopRequireDefault(_KeyframeRule);
var _ConditionalRule = __webpack_require__(482);
var _ConditionalRule2 = _interopRequireDefault(_ConditionalRule);
var _FontFaceRule = __webpack_require__(483);
var _FontFaceRule2 = _interopRequireDefault(_FontFaceRule);
var _ViewportRule = __webpack_require__(487);
var _ViewportRule2 = _interopRequireDefault(_ViewportRule);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var classes = {
'@charset': _SimpleRule2['default'],
'@import': _SimpleRule2['default'],
'@namespace': _SimpleRule2['default'],
'@keyframes': _KeyframeRule2['default'],
'@media': _ConditionalRule2['default'],
'@supports': _ConditionalRule2['default'],
'@font-face': _FontFaceRule2['default'],
'@viewport': _ViewportRule2['default'],
'@-ms-viewport': _ViewportRule2['default']
};
/**
* Generate plugins which will register all rules.
*/
exports['default'] = Object.keys(classes).map(function (key) {
// https://jsperf.com/indexof-vs-substr-vs-regex-at-the-beginning-3
var re = new RegExp('^' + key);
var onCreateRule = function onCreateRule(name, decl, options) {
return re.test(name) ? new classes[key](name, decl, options) : null;
};
return { onCreateRule: onCreateRule };
});
/***/ }),
/* 489 */
/***/ (function(module, exports, __webpack_require__) {
"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.default = cloneStyle;
var isArray = Array.isArray;
function cloneStyle(style) {
// Support empty values in case user ends up with them by accident.
if (style == null) return style;
// Support string value for SimpleRule.
var typeOfStyle = typeof style === 'undefined' ? 'undefined' : _typeof(style);
if (typeOfStyle === 'string' || typeOfStyle === 'number') return style;
// Support array for FontFaceRule.
if (isArray(style)) return style.map(cloneStyle);
var newStyle = {};
for (var name in style) {
var value = style[name];
if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object') {
newStyle[name] = cloneStyle(value);
continue;
}
newStyle[name] = value;
}
return newStyle;
}
/***/ }),
/* 490 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = findClassNames;
var dotsRegExp = /[.]/g;
var classesRegExp = /[.][^ ,]+/g;
/**
* Get class names from a selector.
*/
function findClassNames(selector) {
var classes = selector.match(classesRegExp);
if (!classes) return '';
return classes.join(' ').replace(dotsRegExp, '');
}
/***/ }),
/* 491 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(global) {
Object.defineProperty(exports, "__esModule", {
value: true
});
var globalRef = typeof window === 'undefined' ? global : window;
var namespace = '__JSS_VERSION_COUNTER__';
if (globalRef[namespace] == null) globalRef[namespace] = 0;
// In case we have more than one JSS version.
var jssCounter = globalRef[namespace]++;
var ruleCounter = 0;
/**
* Generates unique class names.
*/
exports['default'] = function (rule) {
return (
// There is no rule name if `jss.createRule(style)` was used.
(rule.name || 'jss') + '-' + jssCounter + '-' + ruleCounter++
);
};
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(16)))
/***/ }),
/* 492 */
/***/ (function(module, exports, __webpack_require__) {
"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; };
/**
* Extracts a styles object with only props that contain function values.
*/
exports['default'] = function (styles) {
// eslint-disable-next-line no-shadow
function extract(styles) {
var to = null;
for (var key in styles) {
var value = styles[key];
var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);
if (type === 'function') {
if (!to) to = {};
to[key] = value;
} else if (type === 'object' && value !== null && !Array.isArray(value)) {
var extracted = extract(value);
if (extracted) {
if (!to) to = {};
to[key] = extracted;
}
}
}
return to;
}
return extract(styles);
};
/***/ }),
/* 493 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = function (rule, data, RulesContainer) {
if (rule.type === 'regular') {
for (var prop in rule.style) {
var value = rule.style[prop];
if (typeof value === 'function') {
rule.prop(prop, value(data));
}
}
} else if (rule.rules instanceof RulesContainer) {
rule.rules.update(data);
}
};
/***/ }),
/* 494 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getNative_js__ = __webpack_require__(41);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__root_js__ = __webpack_require__(27);
/* Built-in method references that are verified to be native. */
var DataView = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__getNative_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__root_js__["a" /* default */], 'DataView');
/* harmony default export */ __webpack_exports__["a"] = (DataView);
/***/ }),
/* 495 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__hashClear_js__ = __webpack_require__(545);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__hashDelete_js__ = __webpack_require__(546);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__hashGet_js__ = __webpack_require__(547);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__hashHas_js__ = __webpack_require__(548);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__hashSet_js__ = __webpack_require__(549);
/**
* 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 = __WEBPACK_IMPORTED_MODULE_0__hashClear_js__["a" /* default */];
Hash.prototype['delete'] = __WEBPACK_IMPORTED_MODULE_1__hashDelete_js__["a" /* default */];
Hash.prototype.get = __WEBPACK_IMPORTED_MODULE_2__hashGet_js__["a" /* default */];
Hash.prototype.has = __WEBPACK_IMPORTED_MODULE_3__hashHas_js__["a" /* default */];
Hash.prototype.set = __WEBPACK_IMPORTED_MODULE_4__hashSet_js__["a" /* default */];
/* harmony default export */ __webpack_exports__["a"] = (Hash);
/***/ }),
/* 496 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getNative_js__ = __webpack_require__(41);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__root_js__ = __webpack_require__(27);
/* Built-in method references that are verified to be native. */
var Promise = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__getNative_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__root_js__["a" /* default */], 'Promise');
/* harmony default export */ __webpack_exports__["a"] = (Promise);
/***/ }),
/* 497 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getNative_js__ = __webpack_require__(41);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__root_js__ = __webpack_require__(27);
/* Built-in method references that are verified to be native. */
var Set = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__getNative_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__root_js__["a" /* default */], 'Set');
/* harmony default export */ __webpack_exports__["a"] = (Set);
/***/ }),
/* 498 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__MapCache_js__ = __webpack_require__(134);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__setCacheAdd_js__ = __webpack_require__(571);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__setCacheHas_js__ = __webpack_require__(572);
/**
*
* 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 __WEBPACK_IMPORTED_MODULE_0__MapCache_js__["a" /* default */];
while (++index < length) {
this.add(values[index]);
}
}
// Add methods to `SetCache`.
SetCache.prototype.add = SetCache.prototype.push = __WEBPACK_IMPORTED_MODULE_1__setCacheAdd_js__["a" /* default */];
SetCache.prototype.has = __WEBPACK_IMPORTED_MODULE_2__setCacheHas_js__["a" /* default */];
/* harmony default export */ __webpack_exports__["a"] = (SetCache);
/***/ }),
/* 499 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getNative_js__ = __webpack_require__(41);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__root_js__ = __webpack_require__(27);
/* Built-in method references that are verified to be native. */
var WeakMap = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__getNative_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__root_js__["a" /* default */], 'WeakMap');
/* harmony default export */ __webpack_exports__["a"] = (WeakMap);
/***/ }),
/* 500 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/**
* 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);
}
/* harmony default export */ __webpack_exports__["a"] = (apply);
/***/ }),
/* 501 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/**
* 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;
}
/* harmony default export */ __webpack_exports__["a"] = (arrayFilter);
/***/ }),
/* 502 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/**
* 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;
}
/* harmony default export */ __webpack_exports__["a"] = (arrayPush);
/***/ }),
/* 503 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/**
* 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;
}
/* harmony default export */ __webpack_exports__["a"] = (arraySome);
/***/ }),
/* 504 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__baseAssignValue_js__ = __webpack_require__(89);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__eq_js__ = __webpack_require__(71);
/** 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) && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__eq_js__["a" /* default */])(objValue, value)) ||
(value === undefined && !(key in object))) {
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__baseAssignValue_js__["a" /* default */])(object, key, value);
}
}
/* harmony default export */ __webpack_exports__["a"] = (assignValue);
/***/ }),
/* 505 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isObject_js__ = __webpack_require__(34);
/** 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 (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__isObject_js__["a" /* default */])(proto)) {
return {};
}
if (objectCreate) {
return objectCreate(proto);
}
object.prototype = proto;
var result = new object;
object.prototype = undefined;
return result;
};
}());
/* harmony default export */ __webpack_exports__["a"] = (baseCreate);
/***/ }),
/* 506 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__baseFor_js__ = __webpack_require__(227);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__keys_js__ = __webpack_require__(146);
/**
* 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 && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__baseFor_js__["a" /* default */])(object, iteratee, __WEBPACK_IMPORTED_MODULE_1__keys_js__["a" /* default */]);
}
/* harmony default export */ __webpack_exports__["a"] = (baseForOwn);
/***/ }),
/* 507 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__arrayPush_js__ = __webpack_require__(502);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArray_js__ = __webpack_require__(28);
/**
* 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 __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__isArray_js__["a" /* default */])(object) ? result : __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__arrayPush_js__["a" /* default */])(result, symbolsFunc(object));
}
/* harmony default export */ __webpack_exports__["a"] = (baseGetAllKeys);
/***/ }),
/* 508 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/**
* 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);
}
/* harmony default export */ __webpack_exports__["a"] = (baseHasIn);
/***/ }),
/* 509 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__baseGetTag_js__ = __webpack_require__(54);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isObjectLike_js__ = __webpack_require__(42);
/** `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 __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__isObjectLike_js__["a" /* default */])(value) && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__baseGetTag_js__["a" /* default */])(value) == argsTag;
}
/* harmony default export */ __webpack_exports__["a"] = (baseIsArguments);
/***/ }),
/* 510 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Stack_js__ = __webpack_require__(135);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__equalArrays_js__ = __webpack_require__(232);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__equalByTag_js__ = __webpack_require__(536);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__equalObjects_js__ = __webpack_require__(537);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__getTag_js__ = __webpack_require__(542);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__isArray_js__ = __webpack_require__(28);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__isBuffer_js__ = __webpack_require__(142);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__isTypedArray_js__ = __webpack_require__(145);
/** 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 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__isArray_js__["a" /* default */])(object),
othIsArr = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__isArray_js__["a" /* default */])(other),
objTag = objIsArr ? arrayTag : __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__getTag_js__["a" /* default */])(object),
othTag = othIsArr ? arrayTag : __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__getTag_js__["a" /* default */])(other);
objTag = objTag == argsTag ? objectTag : objTag;
othTag = othTag == argsTag ? objectTag : othTag;
var objIsObj = objTag == objectTag,
othIsObj = othTag == objectTag,
isSameTag = objTag == othTag;
if (isSameTag && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__isBuffer_js__["a" /* default */])(object)) {
if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__isBuffer_js__["a" /* default */])(other)) {
return false;
}
objIsArr = true;
objIsObj = false;
}
if (isSameTag && !objIsObj) {
stack || (stack = new __WEBPACK_IMPORTED_MODULE_0__Stack_js__["a" /* default */]);
return (objIsArr || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__isTypedArray_js__["a" /* default */])(object))
? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__equalArrays_js__["a" /* default */])(object, other, bitmask, customizer, equalFunc, stack)
: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__equalByTag_js__["a" /* default */])(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 __WEBPACK_IMPORTED_MODULE_0__Stack_js__["a" /* default */]);
return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
}
}
if (!isSameTag) {
return false;
}
stack || (stack = new __WEBPACK_IMPORTED_MODULE_0__Stack_js__["a" /* default */]);
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__equalObjects_js__["a" /* default */])(object, other, bitmask, customizer, equalFunc, stack);
}
/* harmony default export */ __webpack_exports__["a"] = (baseIsEqualDeep);
/***/ }),
/* 511 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Stack_js__ = __webpack_require__(135);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__baseIsEqual_js__ = __webpack_require__(136);
/** 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 __WEBPACK_IMPORTED_MODULE_0__Stack_js__["a" /* default */];
if (customizer) {
var result = customizer(objValue, srcValue, key, object, source, stack);
}
if (!(result === undefined
? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__baseIsEqual_js__["a" /* default */])(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
: result
)) {
return false;
}
}
}
return true;
}
/* harmony default export */ __webpack_exports__["a"] = (baseIsMatch);
/***/ }),
/* 512 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isFunction_js__ = __webpack_require__(143);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isMasked_js__ = __webpack_require__(553);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isObject_js__ = __webpack_require__(34);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__toSource_js__ = __webpack_require__(239);
/**
* 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 (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__isObject_js__["a" /* default */])(value) || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__isMasked_js__["a" /* default */])(value)) {
return false;
}
var pattern = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__isFunction_js__["a" /* default */])(value) ? reIsNative : reIsHostCtor;
return pattern.test(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__toSource_js__["a" /* default */])(value));
}
/* harmony default export */ __webpack_exports__["a"] = (baseIsNative);
/***/ }),
/* 513 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__baseGetTag_js__ = __webpack_require__(54);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isLength_js__ = __webpack_require__(144);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isObjectLike_js__ = __webpack_require__(42);
/** `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 __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__isObjectLike_js__["a" /* default */])(value) &&
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__isLength_js__["a" /* default */])(value.length) && !!typedArrayTags[__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__baseGetTag_js__["a" /* default */])(value)];
}
/* harmony default export */ __webpack_exports__["a"] = (baseIsTypedArray);
/***/ }),
/* 514 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__baseMatches_js__ = __webpack_require__(517);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__baseMatchesProperty_js__ = __webpack_require__(518);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__identity_js__ = __webpack_require__(140);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__isArray_js__ = __webpack_require__(28);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__property_js__ = __webpack_require__(587);
/**
* 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 __WEBPACK_IMPORTED_MODULE_2__identity_js__["a" /* default */];
}
if (typeof value == 'object') {
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__isArray_js__["a" /* default */])(value)
? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__baseMatchesProperty_js__["a" /* default */])(value[0], value[1])
: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__baseMatches_js__["a" /* default */])(value);
}
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__property_js__["a" /* default */])(value);
}
/* harmony default export */ __webpack_exports__["a"] = (baseIteratee);
/***/ }),
/* 515 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isPrototype_js__ = __webpack_require__(139);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__nativeKeys_js__ = __webpack_require__(566);
/** 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 (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__isPrototype_js__["a" /* default */])(object)) {
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__nativeKeys_js__["a" /* default */])(object);
}
var result = [];
for (var key in Object(object)) {
if (hasOwnProperty.call(object, key) && key != 'constructor') {
result.push(key);
}
}
return result;
}
/* harmony default export */ __webpack_exports__["a"] = (baseKeys);
/***/ }),
/* 516 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isObject_js__ = __webpack_require__(34);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isPrototype_js__ = __webpack_require__(139);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__nativeKeysIn_js__ = __webpack_require__(567);
/** 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 (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__isObject_js__["a" /* default */])(object)) {
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__nativeKeysIn_js__["a" /* default */])(object);
}
var isProto = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__isPrototype_js__["a" /* default */])(object),
result = [];
for (var key in object) {
if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
result.push(key);
}
}
return result;
}
/* harmony default export */ __webpack_exports__["a"] = (baseKeysIn);
/***/ }),
/* 517 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__baseIsMatch_js__ = __webpack_require__(511);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getMatchData_js__ = __webpack_require__(539);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__matchesStrictComparable_js__ = __webpack_require__(236);
/**
* 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 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__getMatchData_js__["a" /* default */])(source);
if (matchData.length == 1 && matchData[0][2]) {
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__matchesStrictComparable_js__["a" /* default */])(matchData[0][0], matchData[0][1]);
}
return function(object) {
return object === source || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__baseIsMatch_js__["a" /* default */])(object, source, matchData);
};
}
/* harmony default export */ __webpack_exports__["a"] = (baseMatches);
/***/ }),
/* 518 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__baseIsEqual_js__ = __webpack_require__(136);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__get_js__ = __webpack_require__(582);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__hasIn_js__ = __webpack_require__(583);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__isKey_js__ = __webpack_require__(138);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__isStrictComparable_js__ = __webpack_require__(235);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__matchesStrictComparable_js__ = __webpack_require__(236);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__toKey_js__ = __webpack_require__(70);
/** 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 (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__isKey_js__["a" /* default */])(path) && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__isStrictComparable_js__["a" /* default */])(srcValue)) {
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__matchesStrictComparable_js__["a" /* default */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__toKey_js__["a" /* default */])(path), srcValue);
}
return function(object) {
var objValue = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__get_js__["a" /* default */])(object, path);
return (objValue === undefined && objValue === srcValue)
? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__hasIn_js__["a" /* default */])(object, path)
: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__baseIsEqual_js__["a" /* default */])(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
};
}
/* harmony default export */ __webpack_exports__["a"] = (baseMatchesProperty);
/***/ }),
/* 519 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Stack_js__ = __webpack_require__(135);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__assignMergeValue_js__ = __webpack_require__(226);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__baseFor_js__ = __webpack_require__(227);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__baseMergeDeep_js__ = __webpack_require__(520);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__isObject_js__ = __webpack_require__(34);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__keysIn_js__ = __webpack_require__(241);
/**
* The base implementation of `_.merge` without support for multiple sources.
*
* @private
* @param {Object} object The destination object.
* @param {Object} source The source object.
* @param {number} srcIndex The index of `source`.
* @param {Function} [customizer] The function to customize merged values.
* @param {Object} [stack] Tracks traversed source values and their merged
* counterparts.
*/
function baseMerge(object, source, srcIndex, customizer, stack) {
if (object === source) {
return;
}
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__baseFor_js__["a" /* default */])(source, function(srcValue, key) {
if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__isObject_js__["a" /* default */])(srcValue)) {
stack || (stack = new __WEBPACK_IMPORTED_MODULE_0__Stack_js__["a" /* default */]);
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__baseMergeDeep_js__["a" /* default */])(object, source, key, srcIndex, baseMerge, customizer, stack);
}
else {
var newValue = customizer
? customizer(object[key], srcValue, (key + ''), object, source, stack)
: undefined;
if (newValue === undefined) {
newValue = srcValue;
}
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__assignMergeValue_js__["a" /* default */])(object, key, newValue);
}
}, __WEBPACK_IMPORTED_MODULE_5__keysIn_js__["a" /* default */]);
}
/* harmony default export */ __webpack_exports__["a"] = (baseMerge);
/***/ }),
/* 520 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__assignMergeValue_js__ = __webpack_require__(226);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__cloneBuffer_js__ = __webpack_require__(530);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__cloneTypedArray_js__ = __webpack_require__(531);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__copyArray_js__ = __webpack_require__(230);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__initCloneObject_js__ = __webpack_require__(550);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__isArguments_js__ = __webpack_require__(141);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__isArray_js__ = __webpack_require__(28);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__isArrayLikeObject_js__ = __webpack_require__(584);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__isBuffer_js__ = __webpack_require__(142);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__isFunction_js__ = __webpack_require__(143);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__isObject_js__ = __webpack_require__(34);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__isPlainObject_js__ = __webpack_require__(93);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__isTypedArray_js__ = __webpack_require__(145);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__toPlainObject_js__ = __webpack_require__(590);
/**
* A specialized version of `baseMerge` for arrays and objects which performs
* deep merges and tracks traversed objects enabling objects with circular
* references to be merged.
*
* @private
* @param {Object} object The destination object.
* @param {Object} source The source object.
* @param {string} key The key of the value to merge.
* @param {number} srcIndex The index of `source`.
* @param {Function} mergeFunc The function to merge values.
* @param {Function} [customizer] The function to customize assigned values.
* @param {Object} [stack] Tracks traversed source values and their merged
* counterparts.
*/
function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
var objValue = object[key],
srcValue = source[key],
stacked = stack.get(srcValue);
if (stacked) {
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__assignMergeValue_js__["a" /* default */])(object, key, stacked);
return;
}
var newValue = customizer
? customizer(objValue, srcValue, (key + ''), object, source, stack)
: undefined;
var isCommon = newValue === undefined;
if (isCommon) {
var isArr = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__isArray_js__["a" /* default */])(srcValue),
isBuff = !isArr && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8__isBuffer_js__["a" /* default */])(srcValue),
isTyped = !isArr && !isBuff && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_12__isTypedArray_js__["a" /* default */])(srcValue);
newValue = srcValue;
if (isArr || isBuff || isTyped) {
if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__isArray_js__["a" /* default */])(objValue)) {
newValue = objValue;
}
else if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__isArrayLikeObject_js__["a" /* default */])(objValue)) {
newValue = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__copyArray_js__["a" /* default */])(objValue);
}
else if (isBuff) {
isCommon = false;
newValue = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__cloneBuffer_js__["a" /* default */])(srcValue, true);
}
else if (isTyped) {
isCommon = false;
newValue = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__cloneTypedArray_js__["a" /* default */])(srcValue, true);
}
else {
newValue = [];
}
}
else if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_11__isPlainObject_js__["a" /* default */])(srcValue) || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__isArguments_js__["a" /* default */])(srcValue)) {
newValue = objValue;
if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__isArguments_js__["a" /* default */])(objValue)) {
newValue = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__toPlainObject_js__["a" /* default */])(objValue);
}
else if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_10__isObject_js__["a" /* default */])(objValue) || (srcIndex && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_9__isFunction_js__["a" /* default */])(objValue))) {
newValue = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__initCloneObject_js__["a" /* default */])(srcValue);
}
}
else {
isCommon = false;
}
}
if (isCommon) {
// Recursively merge objects and arrays (susceptible to call stack limits).
stack.set(srcValue, newValue);
mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
stack['delete'](srcValue);
}
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__assignMergeValue_js__["a" /* default */])(object, key, newValue);
}
/* harmony default export */ __webpack_exports__["a"] = (baseMergeDeep);
/***/ }),
/* 521 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/**
* 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];
};
}
/* harmony default export */ __webpack_exports__["a"] = (baseProperty);
/***/ }),
/* 522 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__baseGet_js__ = __webpack_require__(228);
/**
* 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 __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__baseGet_js__["a" /* default */])(object, path);
};
}
/* harmony default export */ __webpack_exports__["a"] = (basePropertyDeep);
/***/ }),
/* 523 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__identity_js__ = __webpack_require__(140);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__overRest_js__ = __webpack_require__(570);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__setToString_js__ = __webpack_require__(574);
/**
* 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 __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__setToString_js__["a" /* default */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__overRest_js__["a" /* default */])(func, start, __WEBPACK_IMPORTED_MODULE_0__identity_js__["a" /* default */]), func + '');
}
/* harmony default export */ __webpack_exports__["a"] = (baseRest);
/***/ }),
/* 524 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__constant_js__ = __webpack_require__(581);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__defineProperty_js__ = __webpack_require__(231);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__identity_js__ = __webpack_require__(140);
/**
* 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 = !__WEBPACK_IMPORTED_MODULE_1__defineProperty_js__["a" /* default */] ? __WEBPACK_IMPORTED_MODULE_2__identity_js__["a" /* default */] : function(func, string) {
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__defineProperty_js__["a" /* default */])(func, 'toString', {
'configurable': true,
'enumerable': false,
'value': __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__constant_js__["a" /* default */])(string),
'writable': true
});
};
/* harmony default export */ __webpack_exports__["a"] = (baseSetToString);
/***/ }),
/* 525 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/**
* 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;
}
/* harmony default export */ __webpack_exports__["a"] = (baseTimes);
/***/ }),
/* 526 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Symbol_js__ = __webpack_require__(87);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__arrayMap_js__ = __webpack_require__(225);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isArray_js__ = __webpack_require__(28);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__isSymbol_js__ = __webpack_require__(94);
/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0;
/** Used to convert symbols to primitives and strings. */
var symbolProto = __WEBPACK_IMPORTED_MODULE_0__Symbol_js__["a" /* default */] ? __WEBPACK_IMPORTED_MODULE_0__Symbol_js__["a" /* default */].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 (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__isArray_js__["a" /* default */])(value)) {
// Recursively convert values (susceptible to call stack limits).
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__arrayMap_js__["a" /* default */])(value, baseToString) + '';
}
if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__isSymbol_js__["a" /* default */])(value)) {
return symbolToString ? symbolToString.call(value) : '';
}
var result = (value + '');
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
}
/* harmony default export */ __webpack_exports__["a"] = (baseToString);
/***/ }),
/* 527 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/**
* 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);
};
}
/* harmony default export */ __webpack_exports__["a"] = (baseUnary);
/***/ }),
/* 528 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/**
* 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);
}
/* harmony default export */ __webpack_exports__["a"] = (cacheHas);
/***/ }),
/* 529 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Uint8Array_js__ = __webpack_require__(223);
/**
* 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 __WEBPACK_IMPORTED_MODULE_0__Uint8Array_js__["a" /* default */](result).set(new __WEBPACK_IMPORTED_MODULE_0__Uint8Array_js__["a" /* default */](arrayBuffer));
return result;
}
/* harmony default export */ __webpack_exports__["a"] = (cloneArrayBuffer);
/***/ }),
/* 530 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(module) {/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__root_js__ = __webpack_require__(27);
/** 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 ? __WEBPACK_IMPORTED_MODULE_0__root_js__["a" /* default */].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;
}
/* harmony default export */ __webpack_exports__["a"] = (cloneBuffer);
/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(192)(module)))
/***/ }),
/* 531 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cloneArrayBuffer_js__ = __webpack_require__(529);
/**
* 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 ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__cloneArrayBuffer_js__["a" /* default */])(typedArray.buffer) : typedArray.buffer;
return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
}
/* harmony default export */ __webpack_exports__["a"] = (cloneTypedArray);
/***/ }),
/* 532 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__assignValue_js__ = __webpack_require__(504);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__baseAssignValue_js__ = __webpack_require__(89);
/**
* 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) {
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__baseAssignValue_js__["a" /* default */])(object, key, newValue);
} else {
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__assignValue_js__["a" /* default */])(object, key, newValue);
}
}
return object;
}
/* harmony default export */ __webpack_exports__["a"] = (copyObject);
/***/ }),
/* 533 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__root_js__ = __webpack_require__(27);
/** Used to detect overreaching core-js shims. */
var coreJsData = __WEBPACK_IMPORTED_MODULE_0__root_js__["a" /* default */]['__core-js_shared__'];
/* harmony default export */ __webpack_exports__["a"] = (coreJsData);
/***/ }),
/* 534 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__baseRest_js__ = __webpack_require__(523);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isIterateeCall_js__ = __webpack_require__(551);
/**
* 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 __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__baseRest_js__["a" /* default */])(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 && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__isIterateeCall_js__["a" /* default */])(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;
});
}
/* harmony default export */ __webpack_exports__["a"] = (createAssigner);
/***/ }),
/* 535 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/**
* 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;
};
}
/* harmony default export */ __webpack_exports__["a"] = (createBaseFor);
/***/ }),
/* 536 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Symbol_js__ = __webpack_require__(87);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Uint8Array_js__ = __webpack_require__(223);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__eq_js__ = __webpack_require__(71);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__equalArrays_js__ = __webpack_require__(232);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__mapToArray_js__ = __webpack_require__(564);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__setToArray_js__ = __webpack_require__(573);
/** 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 = __WEBPACK_IMPORTED_MODULE_0__Symbol_js__["a" /* default */] ? __WEBPACK_IMPORTED_MODULE_0__Symbol_js__["a" /* default */].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 __WEBPACK_IMPORTED_MODULE_1__Uint8Array_js__["a" /* default */](object), new __WEBPACK_IMPORTED_MODULE_1__Uint8Array_js__["a" /* default */](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 __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__eq_js__["a" /* default */])(+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 = __WEBPACK_IMPORTED_MODULE_4__mapToArray_js__["a" /* default */];
case setTag:
var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
convert || (convert = __WEBPACK_IMPORTED_MODULE_5__setToArray_js__["a" /* default */]);
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 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__equalArrays_js__["a" /* default */])(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;
}
/* harmony default export */ __webpack_exports__["a"] = (equalByTag);
/***/ }),
/* 537 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getAllKeys_js__ = __webpack_require__(538);
/** 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 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__getAllKeys_js__["a" /* default */])(object),
objLength = objProps.length,
othProps = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__getAllKeys_js__["a" /* default */])(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;
}
/* harmony default export */ __webpack_exports__["a"] = (equalObjects);
/***/ }),
/* 538 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__baseGetAllKeys_js__ = __webpack_require__(507);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getSymbols_js__ = __webpack_require__(541);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__keys_js__ = __webpack_require__(146);
/**
* 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 __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__baseGetAllKeys_js__["a" /* default */])(object, __WEBPACK_IMPORTED_MODULE_2__keys_js__["a" /* default */], __WEBPACK_IMPORTED_MODULE_1__getSymbols_js__["a" /* default */]);
}
/* harmony default export */ __webpack_exports__["a"] = (getAllKeys);
/***/ }),
/* 539 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isStrictComparable_js__ = __webpack_require__(235);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__keys_js__ = __webpack_require__(146);
/**
* 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 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__keys_js__["a" /* default */])(object),
length = result.length;
while (length--) {
var key = result[length],
value = object[key];
result[length] = [key, value, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__isStrictComparable_js__["a" /* default */])(value)];
}
return result;
}
/* harmony default export */ __webpack_exports__["a"] = (getMatchData);
/***/ }),
/* 540 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Symbol_js__ = __webpack_require__(87);
/** 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 = __WEBPACK_IMPORTED_MODULE_0__Symbol_js__["a" /* default */] ? __WEBPACK_IMPORTED_MODULE_0__Symbol_js__["a" /* default */].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;
}
/* harmony default export */ __webpack_exports__["a"] = (getRawTag);
/***/ }),
/* 541 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__arrayFilter_js__ = __webpack_require__(501);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__stubArray_js__ = __webpack_require__(588);
/** 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 ? __WEBPACK_IMPORTED_MODULE_1__stubArray_js__["a" /* default */] : function(object) {
if (object == null) {
return [];
}
object = Object(object);
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__arrayFilter_js__["a" /* default */])(nativeGetSymbols(object), function(symbol) {
return propertyIsEnumerable.call(object, symbol);
});
};
/* harmony default export */ __webpack_exports__["a"] = (getSymbols);
/***/ }),
/* 542 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__DataView_js__ = __webpack_require__(494);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Map_js__ = __webpack_require__(133);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Promise_js__ = __webpack_require__(496);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Set_js__ = __webpack_require__(497);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__WeakMap_js__ = __webpack_require__(499);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__baseGetTag_js__ = __webpack_require__(54);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__toSource_js__ = __webpack_require__(239);
/** `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 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__toSource_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_0__DataView_js__["a" /* default */]),
mapCtorString = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__toSource_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__Map_js__["a" /* default */]),
promiseCtorString = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__toSource_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_2__Promise_js__["a" /* default */]),
setCtorString = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__toSource_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_3__Set_js__["a" /* default */]),
weakMapCtorString = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__toSource_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_4__WeakMap_js__["a" /* default */]);
/**
* Gets the `toStringTag` of `value`.
*
* @private
* @param {*} value The value to query.
* @returns {string} Returns the `toStringTag`.
*/
var getTag = __WEBPACK_IMPORTED_MODULE_5__baseGetTag_js__["a" /* default */];
// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
if ((__WEBPACK_IMPORTED_MODULE_0__DataView_js__["a" /* default */] && getTag(new __WEBPACK_IMPORTED_MODULE_0__DataView_js__["a" /* default */](new ArrayBuffer(1))) != dataViewTag) ||
(__WEBPACK_IMPORTED_MODULE_1__Map_js__["a" /* default */] && getTag(new __WEBPACK_IMPORTED_MODULE_1__Map_js__["a" /* default */]) != mapTag) ||
(__WEBPACK_IMPORTED_MODULE_2__Promise_js__["a" /* default */] && getTag(__WEBPACK_IMPORTED_MODULE_2__Promise_js__["a" /* default */].resolve()) != promiseTag) ||
(__WEBPACK_IMPORTED_MODULE_3__Set_js__["a" /* default */] && getTag(new __WEBPACK_IMPORTED_MODULE_3__Set_js__["a" /* default */]) != setTag) ||
(__WEBPACK_IMPORTED_MODULE_4__WeakMap_js__["a" /* default */] && getTag(new __WEBPACK_IMPORTED_MODULE_4__WeakMap_js__["a" /* default */]) != weakMapTag)) {
getTag = function(value) {
var result = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__baseGetTag_js__["a" /* default */])(value),
Ctor = result == objectTag ? value.constructor : undefined,
ctorString = Ctor ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__toSource_js__["a" /* default */])(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;
};
}
/* harmony default export */ __webpack_exports__["a"] = (getTag);
/***/ }),
/* 543 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/**
* 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];
}
/* harmony default export */ __webpack_exports__["a"] = (getValue);
/***/ }),
/* 544 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__castPath_js__ = __webpack_require__(229);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArguments_js__ = __webpack_require__(141);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isArray_js__ = __webpack_require__(28);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__isIndex_js__ = __webpack_require__(137);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__isLength_js__ = __webpack_require__(144);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__toKey_js__ = __webpack_require__(70);
/**
* 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 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__castPath_js__["a" /* default */])(path, object);
var index = -1,
length = path.length,
result = false;
while (++index < length) {
var key = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__toKey_js__["a" /* default */])(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 && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__isLength_js__["a" /* default */])(length) && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__isIndex_js__["a" /* default */])(key, length) &&
(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__isArray_js__["a" /* default */])(object) || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__isArguments_js__["a" /* default */])(object));
}
/* harmony default export */ __webpack_exports__["a"] = (hasPath);
/***/ }),
/* 545 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__nativeCreate_js__ = __webpack_require__(91);
/**
* Removes all key-value entries from the hash.
*
* @private
* @name clear
* @memberOf Hash
*/
function hashClear() {
this.__data__ = __WEBPACK_IMPORTED_MODULE_0__nativeCreate_js__["a" /* default */] ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__nativeCreate_js__["a" /* default */])(null) : {};
this.size = 0;
}
/* harmony default export */ __webpack_exports__["a"] = (hashClear);
/***/ }),
/* 546 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/**
* 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;
}
/* harmony default export */ __webpack_exports__["a"] = (hashDelete);
/***/ }),
/* 547 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__nativeCreate_js__ = __webpack_require__(91);
/** 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 (__WEBPACK_IMPORTED_MODULE_0__nativeCreate_js__["a" /* default */]) {
var result = data[key];
return result === HASH_UNDEFINED ? undefined : result;
}
return hasOwnProperty.call(data, key) ? data[key] : undefined;
}
/* harmony default export */ __webpack_exports__["a"] = (hashGet);
/***/ }),
/* 548 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__nativeCreate_js__ = __webpack_require__(91);
/** 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 __WEBPACK_IMPORTED_MODULE_0__nativeCreate_js__["a" /* default */] ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
}
/* harmony default export */ __webpack_exports__["a"] = (hashHas);
/***/ }),
/* 549 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__nativeCreate_js__ = __webpack_require__(91);
/** 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] = (__WEBPACK_IMPORTED_MODULE_0__nativeCreate_js__["a" /* default */] && value === undefined) ? HASH_UNDEFINED : value;
return this;
}
/* harmony default export */ __webpack_exports__["a"] = (hashSet);
/***/ }),
/* 550 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__baseCreate_js__ = __webpack_require__(505);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getPrototype_js__ = __webpack_require__(234);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isPrototype_js__ = __webpack_require__(139);
/**
* 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' && !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__isPrototype_js__["a" /* default */])(object))
? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__baseCreate_js__["a" /* default */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__getPrototype_js__["a" /* default */])(object))
: {};
}
/* harmony default export */ __webpack_exports__["a"] = (initCloneObject);
/***/ }),
/* 551 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__eq_js__ = __webpack_require__(71);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__ = __webpack_require__(92);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isIndex_js__ = __webpack_require__(137);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__isObject_js__ = __webpack_require__(34);
/**
* 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 (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__isObject_js__["a" /* default */])(object)) {
return false;
}
var type = typeof index;
if (type == 'number'
? (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__["a" /* default */])(object) && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__isIndex_js__["a" /* default */])(index, object.length))
: (type == 'string' && index in object)
) {
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__eq_js__["a" /* default */])(object[index], value);
}
return false;
}
/* harmony default export */ __webpack_exports__["a"] = (isIterateeCall);
/***/ }),
/* 552 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/**
* 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);
}
/* harmony default export */ __webpack_exports__["a"] = (isKeyable);
/***/ }),
/* 553 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__coreJsData_js__ = __webpack_require__(533);
/** Used to detect methods masquerading as native. */
var maskSrcKey = (function() {
var uid = /[^.]+$/.exec(__WEBPACK_IMPORTED_MODULE_0__coreJsData_js__["a" /* default */] && __WEBPACK_IMPORTED_MODULE_0__coreJsData_js__["a" /* default */].keys && __WEBPACK_IMPORTED_MODULE_0__coreJsData_js__["a" /* default */].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);
}
/* harmony default export */ __webpack_exports__["a"] = (isMasked);
/***/ }),
/* 554 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/**
* Removes all key-value entries from the list cache.
*
* @private
* @name clear
* @memberOf ListCache
*/
function listCacheClear() {
this.__data__ = [];
this.size = 0;
}
/* harmony default export */ __webpack_exports__["a"] = (listCacheClear);
/***/ }),
/* 555 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__assocIndexOf_js__ = __webpack_require__(88);
/** 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 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__assocIndexOf_js__["a" /* default */])(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;
}
/* harmony default export */ __webpack_exports__["a"] = (listCacheDelete);
/***/ }),
/* 556 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__assocIndexOf_js__ = __webpack_require__(88);
/**
* 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 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__assocIndexOf_js__["a" /* default */])(data, key);
return index < 0 ? undefined : data[index][1];
}
/* harmony default export */ __webpack_exports__["a"] = (listCacheGet);
/***/ }),
/* 557 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__assocIndexOf_js__ = __webpack_require__(88);
/**
* 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 __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__assocIndexOf_js__["a" /* default */])(this.__data__, key) > -1;
}
/* harmony default export */ __webpack_exports__["a"] = (listCacheHas);
/***/ }),
/* 558 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__assocIndexOf_js__ = __webpack_require__(88);
/**
* 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 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__assocIndexOf_js__["a" /* default */])(data, key);
if (index < 0) {
++this.size;
data.push([key, value]);
} else {
data[index][1] = value;
}
return this;
}
/* harmony default export */ __webpack_exports__["a"] = (listCacheSet);
/***/ }),
/* 559 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Hash_js__ = __webpack_require__(495);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__ListCache_js__ = __webpack_require__(86);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Map_js__ = __webpack_require__(133);
/**
* Removes all key-value entries from the map.
*
* @private
* @name clear
* @memberOf MapCache
*/
function mapCacheClear() {
this.size = 0;
this.__data__ = {
'hash': new __WEBPACK_IMPORTED_MODULE_0__Hash_js__["a" /* default */],
'map': new (__WEBPACK_IMPORTED_MODULE_2__Map_js__["a" /* default */] || __WEBPACK_IMPORTED_MODULE_1__ListCache_js__["a" /* default */]),
'string': new __WEBPACK_IMPORTED_MODULE_0__Hash_js__["a" /* default */]
};
}
/* harmony default export */ __webpack_exports__["a"] = (mapCacheClear);
/***/ }),
/* 560 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getMapData_js__ = __webpack_require__(90);
/**
* 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 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__getMapData_js__["a" /* default */])(this, key)['delete'](key);
this.size -= result ? 1 : 0;
return result;
}
/* harmony default export */ __webpack_exports__["a"] = (mapCacheDelete);
/***/ }),
/* 561 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getMapData_js__ = __webpack_require__(90);
/**
* 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 __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__getMapData_js__["a" /* default */])(this, key).get(key);
}
/* harmony default export */ __webpack_exports__["a"] = (mapCacheGet);
/***/ }),
/* 562 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getMapData_js__ = __webpack_require__(90);
/**
* 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 __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__getMapData_js__["a" /* default */])(this, key).has(key);
}
/* harmony default export */ __webpack_exports__["a"] = (mapCacheHas);
/***/ }),
/* 563 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getMapData_js__ = __webpack_require__(90);
/**
* 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 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__getMapData_js__["a" /* default */])(this, key),
size = data.size;
data.set(key, value);
this.size += data.size == size ? 0 : 1;
return this;
}
/* harmony default export */ __webpack_exports__["a"] = (mapCacheSet);
/***/ }),
/* 564 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/**
* 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;
}
/* harmony default export */ __webpack_exports__["a"] = (mapToArray);
/***/ }),
/* 565 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__memoize_js__ = __webpack_require__(585);
/** 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 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__memoize_js__["a" /* default */])(func, function(key) {
if (cache.size === MAX_MEMOIZE_SIZE) {
cache.clear();
}
return key;
});
var cache = result.cache;
return result;
}
/* harmony default export */ __webpack_exports__["a"] = (memoizeCapped);
/***/ }),
/* 566 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__overArg_js__ = __webpack_require__(237);
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeKeys = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__overArg_js__["a" /* default */])(Object.keys, Object);
/* harmony default export */ __webpack_exports__["a"] = (nativeKeys);
/***/ }),
/* 567 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/**
* 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;
}
/* harmony default export */ __webpack_exports__["a"] = (nativeKeysIn);
/***/ }),
/* 568 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(module) {/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__freeGlobal_js__ = __webpack_require__(233);
/** 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 && __WEBPACK_IMPORTED_MODULE_0__freeGlobal_js__["a" /* default */].process;
/** Used to access faster Node.js helpers. */
var nodeUtil = (function() {
try {
return freeProcess && freeProcess.binding && freeProcess.binding('util');
} catch (e) {}
}());
/* harmony default export */ __webpack_exports__["a"] = (nodeUtil);
/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(192)(module)))
/***/ }),
/* 569 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/** 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);
}
/* harmony default export */ __webpack_exports__["a"] = (objectToString);
/***/ }),
/* 570 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__apply_js__ = __webpack_require__(500);
/* 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 __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__apply_js__["a" /* default */])(func, this, otherArgs);
};
}
/* harmony default export */ __webpack_exports__["a"] = (overRest);
/***/ }),
/* 571 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/** 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;
}
/* harmony default export */ __webpack_exports__["a"] = (setCacheAdd);
/***/ }),
/* 572 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/**
* 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);
}
/* harmony default export */ __webpack_exports__["a"] = (setCacheHas);
/***/ }),
/* 573 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/**
* 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;
}
/* harmony default export */ __webpack_exports__["a"] = (setToArray);
/***/ }),
/* 574 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__baseSetToString_js__ = __webpack_require__(524);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__shortOut_js__ = __webpack_require__(575);
/**
* 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 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__shortOut_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_0__baseSetToString_js__["a" /* default */]);
/* harmony default export */ __webpack_exports__["a"] = (setToString);
/***/ }),
/* 575 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/** 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);
};
}
/* harmony default export */ __webpack_exports__["a"] = (shortOut);
/***/ }),
/* 576 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__ListCache_js__ = __webpack_require__(86);
/**
* Removes all key-value entries from the stack.
*
* @private
* @name clear
* @memberOf Stack
*/
function stackClear() {
this.__data__ = new __WEBPACK_IMPORTED_MODULE_0__ListCache_js__["a" /* default */];
this.size = 0;
}
/* harmony default export */ __webpack_exports__["a"] = (stackClear);
/***/ }),
/* 577 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/**
* 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;
}
/* harmony default export */ __webpack_exports__["a"] = (stackDelete);
/***/ }),
/* 578 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/**
* 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);
}
/* harmony default export */ __webpack_exports__["a"] = (stackGet);
/***/ }),
/* 579 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/**
* 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);
}
/* harmony default export */ __webpack_exports__["a"] = (stackHas);
/***/ }),
/* 580 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__ListCache_js__ = __webpack_require__(86);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Map_js__ = __webpack_require__(133);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__MapCache_js__ = __webpack_require__(134);
/** 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 __WEBPACK_IMPORTED_MODULE_0__ListCache_js__["a" /* default */]) {
var pairs = data.__data__;
if (!__WEBPACK_IMPORTED_MODULE_1__Map_js__["a" /* default */] || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
pairs.push([key, value]);
this.size = ++data.size;
return this;
}
data = this.__data__ = new __WEBPACK_IMPORTED_MODULE_2__MapCache_js__["a" /* default */](pairs);
}
data.set(key, value);
this.size = data.size;
return this;
}
/* harmony default export */ __webpack_exports__["a"] = (stackSet);
/***/ }),
/* 581 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/**
* 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;
};
}
/* harmony default export */ __webpack_exports__["a"] = (constant);
/***/ }),
/* 582 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__baseGet_js__ = __webpack_require__(228);
/**
* 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 : __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__baseGet_js__["a" /* default */])(object, path);
return result === undefined ? defaultValue : result;
}
/* harmony default export */ __webpack_exports__["a"] = (get);
/***/ }),
/* 583 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__baseHasIn_js__ = __webpack_require__(508);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__hasPath_js__ = __webpack_require__(544);
/**
* 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 && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__hasPath_js__["a" /* default */])(object, path, __WEBPACK_IMPORTED_MODULE_0__baseHasIn_js__["a" /* default */]);
}
/* harmony default export */ __webpack_exports__["a"] = (hasIn);
/***/ }),
/* 584 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(92);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isObjectLike_js__ = __webpack_require__(42);
/**
* 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 __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__isObjectLike_js__["a" /* default */])(value) && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" /* default */])(value);
}
/* harmony default export */ __webpack_exports__["a"] = (isArrayLikeObject);
/***/ }),
/* 585 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__MapCache_js__ = __webpack_require__(134);
/** 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 || __WEBPACK_IMPORTED_MODULE_0__MapCache_js__["a" /* default */]);
return memoized;
}
// Expose `MapCache`.
memoize.Cache = __WEBPACK_IMPORTED_MODULE_0__MapCache_js__["a" /* default */];
/* harmony default export */ __webpack_exports__["a"] = (memoize);
/***/ }),
/* 586 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__baseMerge_js__ = __webpack_require__(519);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__createAssigner_js__ = __webpack_require__(534);
/**
* This method is like `_.assign` except that it recursively merges own and
* inherited enumerable string keyed properties of source objects into the
* destination object. Source properties that resolve to `undefined` are
* skipped if a destination value exists. Array and plain object properties
* are merged recursively. Other objects and value types are overridden by
* assignment. Source objects are applied from left to right. Subsequent
* sources overwrite property assignments of previous sources.
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 0.5.0
* @category Object
* @param {Object} object The destination object.
* @param {...Object} [sources] The source objects.
* @returns {Object} Returns `object`.
* @example
*
* var object = {
* 'a': [{ 'b': 2 }, { 'd': 4 }]
* };
*
* var other = {
* 'a': [{ 'c': 3 }, { 'e': 5 }]
* };
*
* _.merge(object, other);
* // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
*/
var merge = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__createAssigner_js__["a" /* default */])(function(object, source, srcIndex) {
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__baseMerge_js__["a" /* default */])(object, source, srcIndex);
});
/* harmony default export */ __webpack_exports__["a"] = (merge);
/***/ }),
/* 587 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__baseProperty_js__ = __webpack_require__(521);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__basePropertyDeep_js__ = __webpack_require__(522);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isKey_js__ = __webpack_require__(138);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__toKey_js__ = __webpack_require__(70);
/**
* 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 __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__isKey_js__["a" /* default */])(path) ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__baseProperty_js__["a" /* default */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__toKey_js__["a" /* default */])(path)) : __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__basePropertyDeep_js__["a" /* default */])(path);
}
/* harmony default export */ __webpack_exports__["a"] = (property);
/***/ }),
/* 588 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/**
* 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 [];
}
/* harmony default export */ __webpack_exports__["a"] = (stubArray);
/***/ }),
/* 589 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/**
* 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;
}
/* harmony default export */ __webpack_exports__["a"] = (stubFalse);
/***/ }),
/* 590 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__copyObject_js__ = __webpack_require__(532);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__keysIn_js__ = __webpack_require__(241);
/**
* Converts `value` to a plain object flattening inherited enumerable string
* keyed properties of `value` to own properties of the plain object.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Lang
* @param {*} value The value to convert.
* @returns {Object} Returns the converted plain object.
* @example
*
* function Foo() {
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.assign({ 'a': 1 }, new Foo);
* // => { 'a': 1, 'b': 2 }
*
* _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
* // => { 'a': 1, 'b': 2, 'c': 3 }
*/
function toPlainObject(value) {
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__copyObject_js__["a" /* default */])(value, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__keysIn_js__["a" /* default */])(value));
}
/* harmony default export */ __webpack_exports__["a"] = (toPlainObject);
/***/ }),
/* 591 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {/**
* lodash (Custom Build) <https://lodash.com/>
* Build: `lodash modularize exports="npm" -o ./`
* Copyright jQuery Foundation and other contributors <https://jquery.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/
/** Used as the `TypeError` message for "Functions" methods. */
var FUNC_ERROR_TEXT = 'Expected a function';
/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';
/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0;
/** `Object#toString` result references. */
var funcTag = '[object Function]',
genTag = '[object GeneratorFunction]',
symbolTag = '[object Symbol]';
/** Used to match property names within property paths. */
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
reIsPlainProp = /^\w*$/,
reLeadingDot = /^\./,
rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
/**
* Used to match `RegExp`
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
*/
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
/** Used to match backslashes in property paths. */
var reEscapeChar = /\\(\\)?/g;
/** Used to detect host constructors (Safari). */
var reIsHostCtor = /^\[object .+?Constructor\]$/;
/** Detect free variable `global` from Node.js. */
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
/** Detect free variable `self`. */
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
/** Used as a reference to the global object. */
var root = freeGlobal || freeSelf || Function('return this')();
/**
* 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];
}
/**
* Checks if `value` is a host object in IE < 9.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a host object, else `false`.
*/
function isHostObject(value) {
// Many host objects are `Object` objects that can coerce to strings
// despite having improperly defined `toString` methods.
var result = false;
if (value != null && typeof value.toString != 'function') {
try {
result = !!(value + '');
} catch (e) {}
}
return result;
}
/** Used for built-in method references. */
var arrayProto = Array.prototype,
funcProto = Function.prototype,
objectProto = Object.prototype;
/** Used to detect overreaching core-js shims. */
var coreJsData = root['__core-js_shared__'];
/** 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) : '';
}());
/** 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 resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values.
*/
var objectToString = objectProto.toString;
/** Used to detect if a method is native. */
var reIsNative = RegExp('^' +
funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
);
/** Built-in value references. */
var Symbol = root.Symbol,
splice = arrayProto.splice;
/* Built-in method references that are verified to be native. */
var Map = getNative(root, 'Map'),
nativeCreate = getNative(Object, 'create');
/** Used to convert symbols to primitives and strings. */
var symbolProto = Symbol ? Symbol.prototype : undefined,
symbolToString = symbolProto ? symbolProto.toString : undefined;
/**
* Creates a hash object.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function Hash(entries) {
var index = -1,
length = entries ? entries.length : 0;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
/**
* Removes all key-value entries from the hash.
*
* @private
* @name clear
* @memberOf Hash
*/
function hashClear() {
this.__data__ = nativeCreate ? nativeCreate(null) : {};
}
/**
* 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) {
return this.has(key) && delete this.__data__[key];
}
/**
* 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;
}
/**
* 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);
}
/**
* 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__;
data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
return this;
}
// Add methods to `Hash`.
Hash.prototype.clear = hashClear;
Hash.prototype['delete'] = hashDelete;
Hash.prototype.get = hashGet;
Hash.prototype.has = hashHas;
Hash.prototype.set = hashSet;
/**
* Creates an list cache object.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function ListCache(entries) {
var index = -1,
length = entries ? entries.length : 0;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
/**
* Removes all key-value entries from the list cache.
*
* @private
* @name clear
* @memberOf ListCache
*/
function listCacheClear() {
this.__data__ = [];
}
/**
* 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);
}
return true;
}
/**
* 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];
}
/**
* 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;
}
/**
* 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) {
data.push([key, value]);
} else {
data[index][1] = value;
}
return this;
}
// Add methods to `ListCache`.
ListCache.prototype.clear = listCacheClear;
ListCache.prototype['delete'] = listCacheDelete;
ListCache.prototype.get = listCacheGet;
ListCache.prototype.has = listCacheHas;
ListCache.prototype.set = listCacheSet;
/**
* 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 ? entries.length : 0;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
/**
* Removes all key-value entries from the map.
*
* @private
* @name clear
* @memberOf MapCache
*/
function mapCacheClear() {
this.__data__ = {
'hash': new Hash,
'map': new (Map || ListCache),
'string': new Hash
};
}
/**
* 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) {
return getMapData(this, key)['delete'](key);
}
/**
* 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);
}
/**
* 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);
}
/**
* 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) {
getMapData(this, key).set(key, value);
return this;
}
// Add methods to `MapCache`.
MapCache.prototype.clear = mapCacheClear;
MapCache.prototype['delete'] = mapCacheDelete;
MapCache.prototype.get = mapCacheGet;
MapCache.prototype.has = mapCacheHas;
MapCache.prototype.set = mapCacheSet;
/**
* 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;
}
/**
* 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 = isKey(path, object) ? [path] : castPath(path);
var index = 0,
length = path.length;
while (object != null && index < length) {
object = object[toKey(path[index++])];
}
return (index && index == length) ? object : undefined;
}
/**
* 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) || isHostObject(value)) ? reIsNative : reIsHostCtor;
return pattern.test(toSource(value));
}
/**
* 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 (isSymbol(value)) {
return symbolToString ? symbolToString.call(value) : '';
}
var result = (value + '');
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
}
/**
* Casts `value` to a path array if it's not one.
*
* @private
* @param {*} value The value to inspect.
* @returns {Array} Returns the cast property path array.
*/
function castPath(value) {
return isArray(value) ? value : stringToPath(value);
}
/**
* 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;
}
/**
* 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;
}
/**
* 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));
}
/**
* 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);
}
/**
* 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);
}
/**
* Converts `string` to a property path array.
*
* @private
* @param {string} string The string to convert.
* @returns {Array} Returns the property path array.
*/
var stringToPath = memoize(function(string) {
string = toString(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;
});
/**
* 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;
}
/**
* Converts `func` to its source code.
*
* @private
* @param {Function} func The function to process.
* @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 '';
}
/**
* 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 `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 && 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);
return result;
};
memoized.cache = new (memoize.Cache || MapCache);
return memoized;
}
// Assign cache to `_.memoize`.
memoize.Cache = MapCache;
/**
* 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);
}
/**
* 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;
/**
* 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) {
// The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 8-9 which returns 'object' for typed array and other constructors.
var tag = isObject(value) ? objectToString.call(value) : '';
return tag == funcTag || tag == genTag;
}
/**
* Checks if `value` is the
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
* @example
*
* _.isObject({});
* // => true
*
* _.isObject([1, 2, 3]);
* // => true
*
* _.isObject(_.noop);
* // => true
*
* _.isObject(null);
* // => false
*/
function isObject(value) {
var type = typeof value;
return !!value && (type == 'object' || type == 'function');
}
/**
* Checks if `value` is object-like. A value is object-like if it's not `null`
* and has a `typeof` result of "object".
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
* @example
*
* _.isObjectLike({});
* // => true
*
* _.isObjectLike([1, 2, 3]);
* // => true
*
* _.isObjectLike(_.noop);
* // => false
*
* _.isObjectLike(null);
* // => false
*/
function isObjectLike(value) {
return !!value && typeof value == 'object';
}
/**
* Checks if `value` is classified as a `Symbol` primitive or object.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
* @example
*
* _.isSymbol(Symbol.iterator);
* // => true
*
* _.isSymbol('abc');
* // => false
*/
function isSymbol(value) {
return typeof value == 'symbol' ||
(isObjectLike(value) && objectToString.call(value) == symbolTag);
}
/**
* Converts `value` to a 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 process.
* @returns {string} Returns the string.
* @example
*
* _.toString(null);
* // => ''
*
* _.toString(-0);
* // => '-0'
*
* _.toString([1, 2, 3]);
* // => '1,2,3'
*/
function toString(value) {
return value == null ? '' : baseToString(value);
}
/**
* 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;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(16)))
/***/ }),
/* 592 */
/***/ (function(module, exports) {
/**
* lodash 4.0.1 (Custom Build) <https://lodash.com/>
* Build: `lodash modularize exports="npm" -o ./`
* Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
* Available under MIT license <https://lodash.com/license>
*/
/** `Object#toString` result references. */
var stringTag = '[object String]';
/** Used for built-in method references. */
var objectProto = Object.prototype;
/**
* Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
* of values.
*/
var objectToString = objectProto.toString;
/**
* Checks if `value` is classified as an `Array` object.
*
* @static
* @memberOf _
* @type Function
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
* @example
*
* _.isArray([1, 2, 3]);
* // => true
*
* _.isArray(document.body.children);
* // => false
*
* _.isArray('abc');
* // => false
*
* _.isArray(_.noop);
* // => false
*/
var isArray = Array.isArray;
/**
* 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 _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
* @example
*
* _.isObjectLike({});
* // => true
*
* _.isObjectLike([1, 2, 3]);
* // => true
*
* _.isObjectLike(_.noop);
* // => false
*
* _.isObjectLike(null);
* // => false
*/
function isObjectLike(value) {
return !!value && typeof value == 'object';
}
/**
* Checks if `value` is classified as a `String` primitive or object.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
* @example
*
* _.isString('abc');
* // => true
*
* _.isString(1);
* // => false
*/
function isString(value) {
return typeof value == 'string' ||
(!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag);
}
module.exports = isString;
/***/ }),
/* 593 */
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(44),
root = __webpack_require__(18);
/* Built-in method references that are verified to be native. */
var DataView = getNative(root, 'DataView');
module.exports = DataView;
/***/ }),
/* 594 */
/***/ (function(module, exports, __webpack_require__) {
var hashClear = __webpack_require__(646),
hashDelete = __webpack_require__(647),
hashGet = __webpack_require__(648),
hashHas = __webpack_require__(649),
hashSet = __webpack_require__(650);
/**
* 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;
/***/ }),
/* 595 */
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(44),
root = __webpack_require__(18);
/* Built-in method references that are verified to be native. */
var Promise = getNative(root, 'Promise');
module.exports = Promise;
/***/ }),
/* 596 */
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(44),
root = __webpack_require__(18);
/* Built-in method references that are verified to be native. */
var Set = getNative(root, 'Set');
module.exports = Set;
/***/ }),
/* 597 */
/***/ (function(module, exports, __webpack_require__) {
var MapCache = __webpack_require__(148),
setCacheAdd = __webpack_require__(672),
setCacheHas = __webpack_require__(673);
/**
*
* 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;
/***/ }),
/* 598 */
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(44),
root = __webpack_require__(18);
/* Built-in method references that are verified to be native. */
var WeakMap = getNative(root, 'WeakMap');
module.exports = WeakMap;
/***/ }),
/* 599 */
/***/ (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;
/***/ }),
/* 600 */
/***/ (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;
/***/ }),
/* 601 */
/***/ (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;
/***/ }),
/* 602 */
/***/ (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;
/***/ }),
/* 603 */
/***/ (function(module, exports, __webpack_require__) {
var baseAssignValue = __webpack_require__(99),
eq = __webpack_require__(72);
/** 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;
/***/ }),
/* 604 */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(30);
/** 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;
/***/ }),
/* 605 */
/***/ (function(module, exports, __webpack_require__) {
var baseForOwn = __webpack_require__(249),
createBaseEach = __webpack_require__(635);
/**
* 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;
/***/ }),
/* 606 */
/***/ (function(module, exports, __webpack_require__) {
var arrayPush = __webpack_require__(601),
isArray = __webpack_require__(29);
/**
* 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;
/***/ }),
/* 607 */
/***/ (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;
/***/ }),
/* 608 */
/***/ (function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(43),
isObjectLike = __webpack_require__(35);
/** `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;
/***/ }),
/* 609 */
/***/ (function(module, exports, __webpack_require__) {
var Stack = __webpack_require__(149),
equalArrays = __webpack_require__(255),
equalByTag = __webpack_require__(637),
equalObjects = __webpack_require__(638),
getTag = __webpack_require__(643),
isArray = __webpack_require__(29),
isBuffer = __webpack_require__(155),
isTypedArray = __webpack_require__(158);
/** 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;
/***/ }),
/* 610 */
/***/ (function(module, exports, __webpack_require__) {
var Stack = __webpack_require__(149),
baseIsEqual = __webpack_require__(251);
/** 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;
/***/ }),
/* 611 */
/***/ (function(module, exports, __webpack_require__) {
var isFunction = __webpack_require__(156),
isMasked = __webpack_require__(654),
isObject = __webpack_require__(30),
toSource = __webpack_require__(261);
/**
* 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;
/***/ }),
/* 612 */
/***/ (function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(43),
isLength = __webpack_require__(157),
isObjectLike = __webpack_require__(35);
/** `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;
/***/ }),
/* 613 */
/***/ (function(module, exports, __webpack_require__) {
var isPrototype = __webpack_require__(152),
nativeKeys = __webpack_require__(667);
/** 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;
/***/ }),
/* 614 */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(30),
isPrototype = __webpack_require__(152),
nativeKeysIn = __webpack_require__(668);
/** 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;
/***/ }),
/* 615 */
/***/ (function(module, exports, __webpack_require__) {
var baseEach = __webpack_require__(605),
isArrayLike = __webpack_require__(55);
/**
* 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;
/***/ }),
/* 616 */
/***/ (function(module, exports, __webpack_require__) {
var baseIsMatch = __webpack_require__(610),
getMatchData = __webpack_require__(640),
matchesStrictComparable = __webpack_require__(259);
/**
* 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;
/***/ }),
/* 617 */
/***/ (function(module, exports, __webpack_require__) {
var baseIsEqual = __webpack_require__(251),
get = __webpack_require__(684),
hasIn = __webpack_require__(685),
isKey = __webpack_require__(151),
isStrictComparable = __webpack_require__(258),
matchesStrictComparable = __webpack_require__(259),
toKey = __webpack_require__(102);
/** 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;
/***/ }),
/* 618 */
/***/ (function(module, exports, __webpack_require__) {
var Stack = __webpack_require__(149),
assignMergeValue = __webpack_require__(247),
baseFor = __webpack_require__(248),
baseMergeDeep = __webpack_require__(619),
isObject = __webpack_require__(30),
keysIn = __webpack_require__(262);
/**
* The base implementation of `_.merge` without support for multiple sources.
*
* @private
* @param {Object} object The destination object.
* @param {Object} source The source object.
* @param {number} srcIndex The index of `source`.
* @param {Function} [customizer] The function to customize merged values.
* @param {Object} [stack] Tracks traversed source values and their merged
* counterparts.
*/
function baseMerge(object, source, srcIndex, customizer, stack) {
if (object === source) {
return;
}
baseFor(source, function(srcValue, key) {
if (isObject(srcValue)) {
stack || (stack = new Stack);
baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
}
else {
var newValue = customizer
? customizer(object[key], srcValue, (key + ''), object, source, stack)
: undefined;
if (newValue === undefined) {
newValue = srcValue;
}
assignMergeValue(object, key, newValue);
}
}, keysIn);
}
module.exports = baseMerge;
/***/ }),
/* 619 */
/***/ (function(module, exports, __webpack_require__) {
var assignMergeValue = __webpack_require__(247),
cloneBuffer = __webpack_require__(629),
cloneTypedArray = __webpack_require__(630),
copyArray = __webpack_require__(631),
initCloneObject = __webpack_require__(651),
isArguments = __webpack_require__(154),
isArray = __webpack_require__(29),
isArrayLikeObject = __webpack_require__(686),
isBuffer = __webpack_require__(155),
isFunction = __webpack_require__(156),
isObject = __webpack_require__(30),
isPlainObject = __webpack_require__(690),
isTypedArray = __webpack_require__(158),
toPlainObject = __webpack_require__(699);
/**
* A specialized version of `baseMerge` for arrays and objects which performs
* deep merges and tracks traversed objects enabling objects with circular
* references to be merged.
*
* @private
* @param {Object} object The destination object.
* @param {Object} source The source object.
* @param {string} key The key of the value to merge.
* @param {number} srcIndex The index of `source`.
* @param {Function} mergeFunc The function to merge values.
* @param {Function} [customizer] The function to customize assigned values.
* @param {Object} [stack] Tracks traversed source values and their merged
* counterparts.
*/
function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
var objValue = object[key],
srcValue = source[key],
stacked = stack.get(srcValue);
if (stacked) {
assignMergeValue(object, key, stacked);
return;
}
var newValue = customizer
? customizer(objValue, srcValue, (key + ''), object, source, stack)
: undefined;
var isCommon = newValue === undefined;
if (isCommon) {
var isArr = isArray(srcValue),
isBuff = !isArr && isBuffer(srcValue),
isTyped = !isArr && !isBuff && isTypedArray(srcValue);
newValue = srcValue;
if (isArr || isBuff || isTyped) {
if (isArray(objValue)) {
newValue = objValue;
}
else if (isArrayLikeObject(objValue)) {
newValue = copyArray(objValue);
}
else if (isBuff) {
isCommon = false;
newValue = cloneBuffer(srcValue, true);
}
else if (isTyped) {
isCommon = false;
newValue = cloneTypedArray(srcValue, true);
}
else {
newValue = [];
}
}
else if (isPlainObject(srcValue) || isArguments(srcValue)) {
newValue = objValue;
if (isArguments(objValue)) {
newValue = toPlainObject(objValue);
}
else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) {
newValue = initCloneObject(srcValue);
}
}
else {
isCommon = false;
}
}
if (isCommon) {
// Recursively merge objects and arrays (susceptible to call stack limits).
stack.set(srcValue, newValue);
mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
stack['delete'](srcValue);
}
assignMergeValue(object, key, newValue);
}
module.exports = baseMergeDeep;
/***/ }),
/* 620 */
/***/ (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;
/***/ }),
/* 621 */
/***/ (function(module, exports, __webpack_require__) {
var baseGet = __webpack_require__(250);
/**
* 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;
/***/ }),
/* 622 */
/***/ (function(module, exports, __webpack_require__) {
var identity = __webpack_require__(153),
overRest = __webpack_require__(671),
setToString = __webpack_require__(675);
/**
* 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;
/***/ }),
/* 623 */
/***/ (function(module, exports, __webpack_require__) {
var constant = __webpack_require__(683),
defineProperty = __webpack_require__(254),
identity = __webpack_require__(153);
/**
* 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;
/***/ }),
/* 624 */
/***/ (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;
/***/ }),
/* 625 */
/***/ (function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__(97),
arrayMap = __webpack_require__(246),
isArray = __webpack_require__(29),
isSymbol = __webpack_require__(103);
/** 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;
/***/ }),
/* 626 */
/***/ (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;
/***/ }),
/* 627 */
/***/ (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;
/***/ }),
/* 628 */
/***/ (function(module, exports, __webpack_require__) {
var Uint8Array = __webpack_require__(244);
/**
* 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;
/***/ }),
/* 629 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__(18);
/** 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__(111)(module)))
/***/ }),
/* 630 */
/***/ (function(module, exports, __webpack_require__) {
var cloneArrayBuffer = __webpack_require__(628);
/**
* 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;
/***/ }),
/* 631 */
/***/ (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;
/***/ }),
/* 632 */
/***/ (function(module, exports, __webpack_require__) {
var assignValue = __webpack_require__(603),
baseAssignValue = __webpack_require__(99);
/**
* 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;
/***/ }),
/* 633 */
/***/ (function(module, exports, __webpack_require__) {
var root = __webpack_require__(18);
/** Used to detect overreaching core-js shims. */
var coreJsData = root['__core-js_shared__'];
module.exports = coreJsData;
/***/ }),
/* 634 */
/***/ (function(module, exports, __webpack_require__) {
var baseRest = __webpack_require__(622),
isIterateeCall = __webpack_require__(652);
/**
* 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;
/***/ }),
/* 635 */
/***/ (function(module, exports, __webpack_require__) {
var isArrayLike = __webpack_require__(55);
/**
* 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;
/***/ }),
/* 636 */
/***/ (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;
/***/ }),
/* 637 */
/***/ (function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__(97),
Uint8Array = __webpack_require__(244),
eq = __webpack_require__(72),
equalArrays = __webpack_require__(255),
mapToArray = __webpack_require__(665),
setToArray = __webpack_require__(674);
/** 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;
/***/ }),
/* 638 */
/***/ (function(module, exports, __webpack_require__) {
var getAllKeys = __webpack_require__(639);
/** 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;
/***/ }),
/* 639 */
/***/ (function(module, exports, __webpack_require__) {
var baseGetAllKeys = __webpack_require__(606),
getSymbols = __webpack_require__(642),
keys = __webpack_require__(159);
/**
* 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;
/***/ }),
/* 640 */
/***/ (function(module, exports, __webpack_require__) {
var isStrictComparable = __webpack_require__(258),
keys = __webpack_require__(159);
/**
* 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;
/***/ }),
/* 641 */
/***/ (function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__(97);
/** 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;
/***/ }),
/* 642 */
/***/ (function(module, exports, __webpack_require__) {
var arrayFilter = __webpack_require__(600),
stubArray = __webpack_require__(696);
/** 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;
/***/ }),
/* 643 */
/***/ (function(module, exports, __webpack_require__) {
var DataView = __webpack_require__(593),
Map = __webpack_require__(147),
Promise = __webpack_require__(595),
Set = __webpack_require__(596),
WeakMap = __webpack_require__(598),
baseGetTag = __webpack_require__(43),
toSource = __webpack_require__(261);
/** `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;
/***/ }),
/* 644 */
/***/ (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;
/***/ }),
/* 645 */
/***/ (function(module, exports, __webpack_require__) {
var castPath = __webpack_require__(253),
isArguments = __webpack_require__(154),
isArray = __webpack_require__(29),
isIndex = __webpack_require__(150),
isLength = __webpack_require__(157),
toKey = __webpack_require__(102);
/**
* 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;
/***/ }),
/* 646 */
/***/ (function(module, exports, __webpack_require__) {
var nativeCreate = __webpack_require__(101);
/**
* 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;
/***/ }),
/* 647 */
/***/ (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;
/***/ }),
/* 648 */
/***/ (function(module, exports, __webpack_require__) {
var nativeCreate = __webpack_require__(101);
/** 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;
/***/ }),
/* 649 */
/***/ (function(module, exports, __webpack_require__) {
var nativeCreate = __webpack_require__(101);
/** 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;
/***/ }),
/* 650 */
/***/ (function(module, exports, __webpack_require__) {
var nativeCreate = __webpack_require__(101);
/** 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;
/***/ }),
/* 651 */
/***/ (function(module, exports, __webpack_require__) {
var baseCreate = __webpack_require__(604),
getPrototype = __webpack_require__(257),
isPrototype = __webpack_require__(152);
/**
* 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;
/***/ }),
/* 652 */
/***/ (function(module, exports, __webpack_require__) {
var eq = __webpack_require__(72),
isArrayLike = __webpack_require__(55),
isIndex = __webpack_require__(150),
isObject = __webpack_require__(30);
/**
* 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;
/***/ }),
/* 653 */
/***/ (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;
/***/ }),
/* 654 */
/***/ (function(module, exports, __webpack_require__) {
var coreJsData = __webpack_require__(633);
/** 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;
/***/ }),
/* 655 */
/***/ (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;
/***/ }),
/* 656 */
/***/ (function(module, exports, __webpack_require__) {
var assocIndexOf = __webpack_require__(98);
/** 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;
/***/ }),
/* 657 */
/***/ (function(module, exports, __webpack_require__) {
var assocIndexOf = __webpack_require__(98);
/**
* 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;
/***/ }),
/* 658 */
/***/ (function(module, exports, __webpack_require__) {
var assocIndexOf = __webpack_require__(98);
/**
* 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;
/***/ }),
/* 659 */
/***/ (function(module, exports, __webpack_require__) {
var assocIndexOf = __webpack_require__(98);
/**
* 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;
/***/ }),
/* 660 */
/***/ (function(module, exports, __webpack_require__) {
var Hash = __webpack_require__(594),
ListCache = __webpack_require__(96),
Map = __webpack_require__(147);
/**
* 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;
/***/ }),
/* 661 */
/***/ (function(module, exports, __webpack_require__) {
var getMapData = __webpack_require__(100);
/**
* 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;
/***/ }),
/* 662 */
/***/ (function(module, exports, __webpack_require__) {
var getMapData = __webpack_require__(100);
/**
* 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;
/***/ }),
/* 663 */
/***/ (function(module, exports, __webpack_require__) {
var getMapData = __webpack_require__(100);
/**
* 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;
/***/ }),
/* 664 */
/***/ (function(module, exports, __webpack_require__) {
var getMapData = __webpack_require__(100);
/**
* 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;
/***/ }),
/* 665 */
/***/ (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;
/***/ }),
/* 666 */
/***/ (function(module, exports, __webpack_require__) {
var memoize = __webpack_require__(264);
/** 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;
/***/ }),
/* 667 */
/***/ (function(module, exports, __webpack_require__) {
var overArg = __webpack_require__(260);
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeKeys = overArg(Object.keys, Object);
module.exports = nativeKeys;
/***/ }),
/* 668 */
/***/ (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;
/***/ }),
/* 669 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(module) {var freeGlobal = __webpack_require__(256);
/** 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__(111)(module)))
/***/ }),
/* 670 */
/***/ (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;
/***/ }),
/* 671 */
/***/ (function(module, exports, __webpack_require__) {
var apply = __webpack_require__(599);
/* 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;
/***/ }),
/* 672 */
/***/ (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;
/***/ }),
/* 673 */
/***/ (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;
/***/ }),
/* 674 */
/***/ (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;
/***/ }),
/* 675 */
/***/ (function(module, exports, __webpack_require__) {
var baseSetToString = __webpack_require__(623),
shortOut = __webpack_require__(676);
/**
* 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;
/***/ }),
/* 676 */
/***/ (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;
/***/ }),
/* 677 */
/***/ (function(module, exports, __webpack_require__) {
var ListCache = __webpack_require__(96);
/**
* 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;
/***/ }),
/* 678 */
/***/ (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;
/***/ }),
/* 679 */
/***/ (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;
/***/ }),
/* 680 */
/***/ (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;
/***/ }),
/* 681 */
/***/ (function(module, exports, __webpack_require__) {
var ListCache = __webpack_require__(96),
Map = __webpack_require__(147),
MapCache = __webpack_require__(148);
/** 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;
/***/ }),
/* 682 */
/***/ (function(module, exports, __webpack_require__) {
var memoizeCapped = __webpack_require__(666);
/** 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;
/***/ }),
/* 683 */
/***/ (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;
/***/ }),
/* 684 */
/***/ (function(module, exports, __webpack_require__) {
var baseGet = __webpack_require__(250);
/**
* 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;
/***/ }),
/* 685 */
/***/ (function(module, exports, __webpack_require__) {
var baseHasIn = __webpack_require__(607),
hasPath = __webpack_require__(645);
/**
* 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;
/***/ }),
/* 686 */
/***/ (function(module, exports, __webpack_require__) {
var isArrayLike = __webpack_require__(55),
isObjectLike = __webpack_require__(35);
/**
* 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;
/***/ }),
/* 687 */
/***/ (function(module, exports, __webpack_require__) {
var root = __webpack_require__(18);
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeIsFinite = root.isFinite;
/**
* Checks if `value` is a finite primitive number.
*
* **Note:** This method is based on
* [`Number.isFinite`](https://mdn.io/Number/isFinite).
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
* @example
*
* _.isFinite(3);
* // => true
*
* _.isFinite(Number.MIN_VALUE);
* // => true
*
* _.isFinite(Infinity);
* // => false
*
* _.isFinite('3');
* // => false
*/
function isFinite(value) {
return typeof value == 'number' && nativeIsFinite(value);
}
module.exports = isFinite;
/***/ }),
/* 688 */
/***/ (function(module, exports, __webpack_require__) {
var isNumber = __webpack_require__(689);
/**
* Checks if `value` is `NaN`.
*
* **Note:** This method is based on
* [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
* global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
* `undefined` and other non-number values.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
* @example
*
* _.isNaN(NaN);
* // => true
*
* _.isNaN(new Number(NaN));
* // => true
*
* isNaN(undefined);
* // => true
*
* _.isNaN(undefined);
* // => false
*/
function isNaN(value) {
// An `NaN` primitive is the only value that is not equal to itself.
// Perform the `toStringTag` check first to avoid errors with some
// ActiveX objects in IE.
return isNumber(value) && value != +value;
}
module.exports = isNaN;
/***/ }),
/* 689 */
/***/ (function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(43),
isObjectLike = __webpack_require__(35);
/** `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;
/***/ }),
/* 690 */
/***/ (function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(43),
getPrototype = __webpack_require__(257),
isObjectLike = __webpack_require__(35);
/** `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;
/***/ }),
/* 691 */
/***/ (function(module, exports, __webpack_require__) {
var baseAssignValue = __webpack_require__(99),
baseForOwn = __webpack_require__(249),
baseIteratee = __webpack_require__(252);
/**
* 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;
/***/ }),
/* 692 */
/***/ (function(module, exports, __webpack_require__) {
var baseMerge = __webpack_require__(618),
createAssigner = __webpack_require__(634);
/**
* This method is like `_.assign` except that it recursively merges own and
* inherited enumerable string keyed properties of source objects into the
* destination object. Source properties that resolve to `undefined` are
* skipped if a destination value exists. Array and plain object properties
* are merged recursively. Other objects and value types are overridden by
* assignment. Source objects are applied from left to right. Subsequent
* sources overwrite property assignments of previous sources.
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 0.5.0
* @category Object
* @param {Object} object The destination object.
* @param {...Object} [sources] The source objects.
* @returns {Object} Returns `object`.
* @example
*
* var object = {
* 'a': [{ 'b': 2 }, { 'd': 4 }]
* };
*
* var other = {
* 'a': [{ 'c': 3 }, { 'e': 5 }]
* };
*
* _.merge(object, other);
* // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
*/
var merge = createAssigner(function(object, source, srcIndex) {
baseMerge(object, source, srcIndex);
});
module.exports = merge;
/***/ }),
/* 693 */
/***/ (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;
/***/ }),
/* 694 */
/***/ (function(module, exports, __webpack_require__) {
var root = __webpack_require__(18);
/**
* Gets the timestamp of the number of milliseconds that have elapsed since
* the Unix epoch (1 January 1970 00:00:00 UTC).
*
* @static
* @memberOf _
* @since 2.4.0
* @category Date
* @returns {number} Returns the timestamp.
* @example
*
* _.defer(function(stamp) {
* console.log(_.now() - stamp);
* }, _.now());
* // => Logs the number of milliseconds it took for the deferred invocation.
*/
var now = function() {
return root.Date.now();
};
module.exports = now;
/***/ }),
/* 695 */
/***/ (function(module, exports, __webpack_require__) {
var baseProperty = __webpack_require__(620),
basePropertyDeep = __webpack_require__(621),
isKey = __webpack_require__(151),
toKey = __webpack_require__(102);
/**
* 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;
/***/ }),
/* 696 */
/***/ (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;
/***/ }),
/* 697 */
/***/ (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;
/***/ }),
/* 698 */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(30),
isSymbol = __webpack_require__(103);
/** 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;
/***/ }),
/* 699 */
/***/ (function(module, exports, __webpack_require__) {
var copyObject = __webpack_require__(632),
keysIn = __webpack_require__(262);
/**
* Converts `value` to a plain object flattening inherited enumerable string
* keyed properties of `value` to own properties of the plain object.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Lang
* @param {*} value The value to convert.
* @returns {Object} Returns the converted plain object.
* @example
*
* function Foo() {
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.assign({ 'a': 1 }, new Foo);
* // => { 'a': 1, 'b': 2 }
*
* _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
* // => { 'a': 1, 'b': 2, 'c': 3 }
*/
function toPlainObject(value) {
return copyObject(value, keysIn(value));
}
module.exports = toPlainObject;
/***/ }),
/* 700 */
/***/ (function(module, exports, __webpack_require__) {
var baseToString = __webpack_require__(625);
/**
* 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;
/***/ }),
/* 701 */
/***/ (function(module, exports) {
/**
* Special language-specific overrides.
*
* Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt
*
* @type {Object}
*/
var LANGUAGES = {
tr: {
regexp: /\u0130|\u0049|\u0049\u0307/g,
map: {
'\u0130': '\u0069',
'\u0049': '\u0131',
'\u0049\u0307': '\u0069'
}
},
az: {
regexp: /[\u0130]/g,
map: {
'\u0130': '\u0069',
'\u0049': '\u0131',
'\u0049\u0307': '\u0069'
}
},
lt: {
regexp: /[\u0049\u004A\u012E\u00CC\u00CD\u0128]/g,
map: {
'\u0049': '\u0069\u0307',
'\u004A': '\u006A\u0307',
'\u012E': '\u012F\u0307',
'\u00CC': '\u0069\u0307\u0300',
'\u00CD': '\u0069\u0307\u0301',
'\u0128': '\u0069\u0307\u0303'
}
}
}
/**
* Lowercase a string.
*
* @param {String} str
* @return {String}
*/
module.exports = function (str, locale) {
var lang = LANGUAGES[locale]
str = str == null ? '' : String(str)
if (lang) {
str = str.replace(lang.regexp, function (m) { return lang.map[m] })
}
return str.toLowerCase()
}
/***/ }),
/* 702 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(Buffer) {
var vlq = __webpack_require__(1031);
function Chunk ( start, end, content ) {
this.start = start;
this.end = end;
this.original = content;
this.intro = '';
this.outro = '';
this.content = content;
this.storeName = false;
this.edited = false;
// we make these non-enumerable, for sanity while debugging
Object.defineProperties( this, {
previous: { writable: true, value: null },
next: { writable: true, value: null }
});
}
Chunk.prototype = {
append: function append ( content ) {
this.outro += content;
},
clone: function clone () {
var chunk = new Chunk( this.start, this.end, this.original );
chunk.intro = this.intro;
chunk.outro = this.outro;
chunk.content = this.content;
chunk.storeName = this.storeName;
chunk.edited = this.edited;
return chunk;
},
contains: function contains ( index ) {
return this.start < index && index < this.end;
},
eachNext: function eachNext ( fn ) {
var chunk = this;
while ( chunk ) {
fn( chunk );
chunk = chunk.next;
}
},
eachPrevious: function eachPrevious ( fn ) {
var chunk = this;
while ( chunk ) {
fn( chunk );
chunk = chunk.previous;
}
},
edit: function edit ( content, storeName ) {
this.content = content;
this.storeName = storeName;
this.edited = true;
return this;
},
prepend: function prepend ( content ) {
this.intro = content + this.intro;
},
split: function split ( index ) {
var sliceIndex = index - this.start;
var originalBefore = this.original.slice( 0, sliceIndex );
var originalAfter = this.original.slice( sliceIndex );
this.original = originalBefore;
var newChunk = new Chunk( index, this.end, originalAfter );
newChunk.outro = this.outro;
this.outro = '';
this.end = index;
if ( this.edited ) {
// TODO is this block necessary?...
newChunk.edit( '', false );
this.content = '';
} else {
this.content = originalBefore;
}
newChunk.next = this.next;
if ( newChunk.next ) newChunk.next.previous = newChunk;
newChunk.previous = this;
this.next = newChunk;
return newChunk;
},
toString: function toString () {
return this.intro + this.content + this.outro;
},
trimEnd: function trimEnd ( rx ) {
this.outro = this.outro.replace( rx, '' );
if ( this.outro.length ) return true;
var trimmed = this.content.replace( rx, '' );
if ( trimmed.length ) {
if ( trimmed !== this.content ) {
this.split( this.start + trimmed.length ).edit( '', false );
}
return true;
} else {
this.edit( '', false );
this.intro = this.intro.replace( rx, '' );
if ( this.intro.length ) return true;
}
},
trimStart: function trimStart ( rx ) {
this.intro = this.intro.replace( rx, '' );
if ( this.intro.length ) return true;
var trimmed = this.content.replace( rx, '' );
if ( trimmed.length ) {
if ( trimmed !== this.content ) {
this.split( this.end - trimmed.length );
this.edit( '', false );
}
return true;
} else {
this.edit( '', false );
this.outro = this.outro.replace( rx, '' );
if ( this.outro.length ) return true;
}
}
};
var _btoa;
if ( typeof window !== 'undefined' && typeof window.btoa === 'function' ) {
_btoa = window.btoa;
} else if ( typeof Buffer === 'function' ) {
_btoa = function ( str ) { return new Buffer( str ).toString( 'base64' ); };
} else {
_btoa = function () {
throw new Error( 'Unsupported environment: `window.btoa` or `Buffer` should be supported.' );
};
}
var btoa = _btoa;
function SourceMap ( properties ) {
this.version = 3;
this.file = properties.file;
this.sources = properties.sources;
this.sourcesContent = properties.sourcesContent;
this.names = properties.names;
this.mappings = properties.mappings;
}
SourceMap.prototype = {
toString: function toString () {
return JSON.stringify( this );
},
toUrl: function toUrl () {
return 'data:application/json;charset=utf-8;base64,' + btoa( this.toString() );
}
};
function guessIndent ( code ) {
var lines = code.split( '\n' );
var tabbed = lines.filter( function ( line ) { return /^\t+/.test( line ); } );
var spaced = lines.filter( function ( line ) { return /^ {2,}/.test( line ); } );
if ( tabbed.length === 0 && spaced.length === 0 ) {
return null;
}
// More lines tabbed than spaced? Assume tabs, and
// default to tabs in the case of a tie (or nothing
// to go on)
if ( tabbed.length >= spaced.length ) {
return '\t';
}
// Otherwise, we need to guess the multiple
var min = spaced.reduce( function ( previous, current ) {
var numSpaces = /^ +/.exec( current )[0].length;
return Math.min( numSpaces, previous );
}, Infinity );
return new Array( min + 1 ).join( ' ' );
}
function getLocator ( source ) {
var originalLines = source.split( '\n' );
var start = 0;
var lineRanges = originalLines.map( function ( line, i ) {
var end = start + line.length + 1;
var range = { start: start, end: end, line: i };
start = end;
return range;
});
var i = 0;
function rangeContains ( range, index ) {
return range.start <= index && index < range.end;
}
function getLocation ( range, index ) {
return { line: range.line, column: index - range.start };
}
return function locate ( index ) {
var range = lineRanges[i];
var d = index >= range.end ? 1 : -1;
while ( range ) {
if ( rangeContains( range, index ) ) return getLocation( range, index );
i += d;
range = lineRanges[i];
}
};
}
function encodeMappings ( original, intro, chunk, hires, sourcemapLocations, sourceIndex, offsets, names ) {
var rawLines = [];
var generatedCodeLine = intro.split( '\n' ).length - 1;
var rawSegments = rawLines[ generatedCodeLine ] = [];
var generatedCodeColumn = 0;
var locate = getLocator( original );
function addEdit ( content, original, loc, nameIndex, i ) {
if ( i || content.length ) {
rawSegments.push({
generatedCodeLine: generatedCodeLine,
generatedCodeColumn: generatedCodeColumn,
sourceCodeLine: loc.line,
sourceCodeColumn: loc.column,
sourceCodeName: nameIndex,
sourceIndex: sourceIndex
});
}
var lines = content.split( '\n' );
var lastLine = lines.pop();
if ( lines.length ) {
generatedCodeLine += lines.length;
rawLines[ generatedCodeLine ] = rawSegments = [];
generatedCodeColumn = lastLine.length;
} else {
generatedCodeColumn += lastLine.length;
}
lines = original.split( '\n' );
lastLine = lines.pop();
if ( lines.length ) {
loc.line += lines.length;
loc.column = lastLine.length;
} else {
loc.column += lastLine.length;
}
}
function addUneditedChunk ( chunk, loc ) {
var originalCharIndex = chunk.start;
var first = true;
while ( originalCharIndex < chunk.end ) {
if ( hires || first || sourcemapLocations[ originalCharIndex ] ) {
rawSegments.push({
generatedCodeLine: generatedCodeLine,
generatedCodeColumn: generatedCodeColumn,
sourceCodeLine: loc.line,
sourceCodeColumn: loc.column,
sourceCodeName: -1,
sourceIndex: sourceIndex
});
}
if ( original[ originalCharIndex ] === '\n' ) {
loc.line += 1;
loc.column = 0;
generatedCodeLine += 1;
rawLines[ generatedCodeLine ] = rawSegments = [];
generatedCodeColumn = 0;
} else {
loc.column += 1;
generatedCodeColumn += 1;
}
originalCharIndex += 1;
first = false;
}
}
while ( chunk ) {
var loc = locate( chunk.start );
if ( chunk.intro.length ) {
addEdit( chunk.intro, '', loc, -1, !!chunk.previous );
}
if ( chunk.edited ) {
addEdit( chunk.content, chunk.original, loc, chunk.storeName ? names.indexOf( chunk.original ) : -1, !!chunk.previous );
} else {
addUneditedChunk( chunk, loc );
}
if ( chunk.outro.length ) {
addEdit( chunk.outro, '', loc, -1, !!chunk.previous );
}
var nextChunk = chunk.next;
chunk = nextChunk;
}
offsets.sourceIndex = offsets.sourceIndex || 0;
offsets.sourceCodeLine = offsets.sourceCodeLine || 0;
offsets.sourceCodeColumn = offsets.sourceCodeColumn || 0;
offsets.sourceCodeName = offsets.sourceCodeName || 0;
var encoded = rawLines.map( function ( segments ) {
var generatedCodeColumn = 0;
return segments.map( function ( segment ) {
var arr = [
segment.generatedCodeColumn - generatedCodeColumn,
segment.sourceIndex - offsets.sourceIndex,
segment.sourceCodeLine - offsets.sourceCodeLine,
segment.sourceCodeColumn - offsets.sourceCodeColumn
];
generatedCodeColumn = segment.generatedCodeColumn;
offsets.sourceIndex = segment.sourceIndex;
offsets.sourceCodeLine = segment.sourceCodeLine;
offsets.sourceCodeColumn = segment.sourceCodeColumn;
if ( ~segment.sourceCodeName ) {
arr.push( segment.sourceCodeName - offsets.sourceCodeName );
offsets.sourceCodeName = segment.sourceCodeName;
}
return vlq.encode( arr );
}).join( ',' );
}).join( ';' );
return encoded;
}
function getRelativePath ( from, to ) {
var fromParts = from.split( /[\/\\]/ );
var toParts = to.split( /[\/\\]/ );
fromParts.pop(); // get dirname
while ( fromParts[0] === toParts[0] ) {
fromParts.shift();
toParts.shift();
}
if ( fromParts.length ) {
var i = fromParts.length;
while ( i-- ) fromParts[i] = '..';
}
return fromParts.concat( toParts ).join( '/' );
}
var toString = Object.prototype.toString;
function isObject ( thing ) {
return toString.call( thing ) === '[object Object]';
}
function MagicString ( string, options ) {
if ( options === void 0 ) options = {};
var chunk = new Chunk( 0, string.length, string );
Object.defineProperties( this, {
original: { writable: true, value: string },
outro: { writable: true, value: '' },
intro: { writable: true, value: '' },
firstChunk: { writable: true, value: chunk },
lastChunk: { writable: true, value: chunk },
lastSearchedChunk: { writable: true, value: chunk },
byStart: { writable: true, value: {} },
byEnd: { writable: true, value: {} },
filename: { writable: true, value: options.filename },
indentExclusionRanges: { writable: true, value: options.indentExclusionRanges },
sourcemapLocations: { writable: true, value: {} },
storedNames: { writable: true, value: {} },
indentStr: { writable: true, value: guessIndent( string ) }
});
if ( false ) {}
this.byStart[ 0 ] = chunk;
this.byEnd[ string.length ] = chunk;
}
MagicString.prototype = {
addSourcemapLocation: function addSourcemapLocation ( char ) {
this.sourcemapLocations[ char ] = true;
},
append: function append ( content ) {
if ( typeof content !== 'string' ) throw new TypeError( 'outro content must be a string' );
this.outro += content;
return this;
},
clone: function clone () {
var cloned = new MagicString( this.original, { filename: this.filename });
var originalChunk = this.firstChunk;
var clonedChunk = cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone();
while ( originalChunk ) {
cloned.byStart[ clonedChunk.start ] = clonedChunk;
cloned.byEnd[ clonedChunk.end ] = clonedChunk;
var nextOriginalChunk = originalChunk.next;
var nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone();
if ( nextClonedChunk ) {
clonedChunk.next = nextClonedChunk;
nextClonedChunk.previous = clonedChunk;
clonedChunk = nextClonedChunk;
}
originalChunk = nextOriginalChunk;
}
cloned.lastChunk = clonedChunk;
if ( this.indentExclusionRanges ) {
cloned.indentExclusionRanges = typeof this.indentExclusionRanges[0] === 'number' ?
[ this.indentExclusionRanges[0], this.indentExclusionRanges[1] ] :
this.indentExclusionRanges.map( function ( range ) { return [ range.start, range.end ]; } );
}
Object.keys( this.sourcemapLocations ).forEach( function ( loc ) {
cloned.sourcemapLocations[ loc ] = true;
});
return cloned;
},
generateMap: function generateMap ( options ) {
options = options || {};
var names = Object.keys( this.storedNames );
if ( false ) {}
var map = new SourceMap({
file: ( options.file ? options.file.split( /[\/\\]/ ).pop() : null ),
sources: [ options.source ? getRelativePath( options.file || '', options.source ) : null ],
sourcesContent: options.includeContent ? [ this.original ] : [ null ],
names: names,
mappings: this.getMappings( options.hires, 0, {}, names )
});
if ( false ) {}
return map;
},
getIndentString: function getIndentString () {
return this.indentStr === null ? '\t' : this.indentStr;
},
getMappings: function getMappings ( hires, sourceIndex, offsets, names ) {
return encodeMappings( this.original, this.intro, this.firstChunk, hires, this.sourcemapLocations, sourceIndex, offsets, names );
},
indent: function indent ( indentStr, options ) {
var this$1 = this;
var pattern = /^[^\r\n]/gm;
if ( isObject( indentStr ) ) {
options = indentStr;
indentStr = undefined;
}
indentStr = indentStr !== undefined ? indentStr : ( this.indentStr || '\t' );
if ( indentStr === '' ) return this; // noop
options = options || {};
// Process exclusion ranges
var isExcluded = {};
if ( options.exclude ) {
var exclusions = typeof options.exclude[0] === 'number' ? [ options.exclude ] : options.exclude;
exclusions.forEach( function ( exclusion ) {
for ( var i = exclusion[0]; i < exclusion[1]; i += 1 ) {
isExcluded[i] = true;
}
});
}
var shouldIndentNextCharacter = options.indentStart !== false;
var replacer = function ( match ) {
if ( shouldIndentNextCharacter ) return ("" + indentStr + match);
shouldIndentNextCharacter = true;
return match;
};
this.intro = this.intro.replace( pattern, replacer );
var charIndex = 0;
var chunk = this.firstChunk;
while ( chunk ) {
var end = chunk.end;
if ( chunk.edited ) {
if ( !isExcluded[ charIndex ] ) {
chunk.content = chunk.content.replace( pattern, replacer );
if ( chunk.content.length ) {
shouldIndentNextCharacter = chunk.content[ chunk.content.length - 1 ] === '\n';
}
}
} else {
charIndex = chunk.start;
while ( charIndex < end ) {
if ( !isExcluded[ charIndex ] ) {
var char = this$1.original[ charIndex ];
if ( char === '\n' ) {
shouldIndentNextCharacter = true;
} else if ( char !== '\r' && shouldIndentNextCharacter ) {
shouldIndentNextCharacter = false;
if ( charIndex === chunk.start ) {
chunk.prepend( indentStr );
} else {
var rhs = chunk.split( charIndex );
rhs.prepend( indentStr );
this$1.byStart[ charIndex ] = rhs;
this$1.byEnd[ charIndex ] = chunk;
chunk = rhs;
}
}
}
charIndex += 1;
}
}
charIndex = chunk.end;
chunk = chunk.next;
}
this.outro = this.outro.replace( pattern, replacer );
return this;
},
insert: function insert () {
throw new Error( 'magicString.insert(...) is deprecated. Use insertRight(...) or insertLeft(...)' );
},
insertLeft: function insertLeft ( index, content ) {
if ( typeof content !== 'string' ) throw new TypeError( 'inserted content must be a string' );
if ( false ) {}
this._split( index );
var chunk = this.byEnd[ index ];
if ( chunk ) {
chunk.append( content );
} else {
this.intro += content;
}
if ( false ) {}
return this;
},
insertRight: function insertRight ( index, content ) {
if ( typeof content !== 'string' ) throw new TypeError( 'inserted content must be a string' );
if ( false ) {}
this._split( index );
var chunk = this.byStart[ index ];
if ( chunk ) {
chunk.prepend( content );
} else {
this.outro += content;
}
if ( false ) {}
return this;
},
move: function move ( start, end, index ) {
if ( index >= start && index <= end ) throw new Error( 'Cannot move a selection inside itself' );
if ( false ) {}
this._split( start );
this._split( end );
this._split( index );
var first = this.byStart[ start ];
var last = this.byEnd[ end ];
var oldLeft = first.previous;
var oldRight = last.next;
var newRight = this.byStart[ index ];
if ( !newRight && last === this.lastChunk ) return this;
var newLeft = newRight ? newRight.previous : this.lastChunk;
if ( oldLeft ) oldLeft.next = oldRight;
if ( oldRight ) oldRight.previous = oldLeft;
if ( newLeft ) newLeft.next = first;
if ( newRight ) newRight.previous = last;
if ( !first.previous ) this.firstChunk = last.next;
if ( !last.next ) {
this.lastChunk = first.previous;
this.lastChunk.next = null;
}
first.previous = newLeft;
last.next = newRight;
if ( !newLeft ) this.firstChunk = first;
if ( !newRight ) this.lastChunk = last;
if ( false ) {}
return this;
},
overwrite: function overwrite ( start, end, content, storeName ) {
var this$1 = this;
if ( typeof content !== 'string' ) throw new TypeError( 'replacement content must be a string' );
while ( start < 0 ) start += this$1.original.length;
while ( end < 0 ) end += this$1.original.length;
if ( end > this.original.length ) throw new Error( 'end is out of bounds' );
if ( start === end ) throw new Error( 'Cannot overwrite a zero-length range use insertLeft or insertRight instead' );
if ( false ) {}
this._split( start );
this._split( end );
if ( storeName ) {
var original = this.original.slice( start, end );
this.storedNames[ original ] = true;
}
var first = this.byStart[ start ];
var last = this.byEnd[ end ];
if ( first ) {
first.edit( content, storeName );
if ( first !== last ) {
first.outro = '';
var chunk = first.next;
while ( chunk !== last ) {
chunk.edit( '', false );
chunk.intro = chunk.outro = '';
chunk = chunk.next;
}
chunk.edit( '', false );
chunk.intro = '';
}
}
else {
// must be inserting at the end
var newChunk = new Chunk( start, end, '' ).edit( content, storeName );
// TODO last chunk in the array may not be the last chunk, if it's moved...
last.next = newChunk;
newChunk.previous = last;
}
if ( false ) {}
return this;
},
prepend: function prepend ( content ) {
if ( typeof content !== 'string' ) throw new TypeError( 'outro content must be a string' );
this.intro = content + this.intro;
return this;
},
remove: function remove ( start, end ) {
var this$1 = this;
while ( start < 0 ) start += this$1.original.length;
while ( end < 0 ) end += this$1.original.length;
if ( start === end ) return this;
if ( start < 0 || end > this.original.length ) throw new Error( 'Character is out of bounds' );
if ( start > end ) throw new Error( 'end must be greater than start' );
return this.overwrite( start, end, '', false );
},
slice: function slice ( start, end ) {
var this$1 = this;
if ( start === void 0 ) start = 0;
if ( end === void 0 ) end = this.original.length;
while ( start < 0 ) start += this$1.original.length;
while ( end < 0 ) end += this$1.original.length;
var result = '';
// find start chunk
var chunk = this.firstChunk;
while ( chunk && ( chunk.start > start || chunk.end <= start ) ) {
// found end chunk before start
if ( chunk.start < end && chunk.end >= end ) {
return result;
}
chunk = chunk.next;
}
if ( chunk && chunk.edited && chunk.start !== start ) throw new Error(("Cannot use replaced character " + start + " as slice start anchor."));
var startChunk = chunk;
while ( chunk ) {
if ( chunk.intro && ( startChunk !== chunk || chunk.start === start ) ) {
result += chunk.intro;
}
var containsEnd = chunk.start < end && chunk.end >= end;
if ( containsEnd && chunk.edited && chunk.end !== end ) throw new Error(("Cannot use replaced character " + end + " as slice end anchor."));
var sliceStart = startChunk === chunk ? start - chunk.start : 0;
var sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length;
result += chunk.content.slice( sliceStart, sliceEnd );
if ( chunk.outro && ( !containsEnd || chunk.end === end ) ) {
result += chunk.outro;
}
if ( containsEnd ) {
break;
}
chunk = chunk.next;
}
return result;
},
// TODO deprecate this? not really very useful
snip: function snip ( start, end ) {
var clone = this.clone();
clone.remove( 0, start );
clone.remove( end, clone.original.length );
return clone;
},
_split: function _split ( index ) {
var this$1 = this;
if ( this.byStart[ index ] || this.byEnd[ index ] ) return;
if ( false ) {}
var chunk = this.lastSearchedChunk;
var searchForward = index > chunk.end;
while ( true ) {
if ( chunk.contains( index ) ) return this$1._splitChunk( chunk, index );
chunk = searchForward ?
this$1.byStart[ chunk.end ] :
this$1.byEnd[ chunk.start ];
}
},
_splitChunk: function _splitChunk ( chunk, index ) {
if ( chunk.edited && chunk.content.length ) { // zero-length edited chunks are a special case (overlapping replacements)
var loc = getLocator( this.original )( index );
throw new Error( ("Cannot split a chunk that has already been edited (" + (loc.line) + ":" + (loc.column) + " \"" + (chunk.original) + "\")") );
}
var newChunk = chunk.split( index );
this.byEnd[ index ] = chunk;
this.byStart[ index ] = newChunk;
this.byEnd[ newChunk.end ] = newChunk;
if ( chunk === this.lastChunk ) this.lastChunk = newChunk;
this.lastSearchedChunk = chunk;
if ( false ) {}
return true;
},
toString: function toString () {
var str = this.intro;
var chunk = this.firstChunk;
while ( chunk ) {
str += chunk.toString();
chunk = chunk.next;
}
return str + this.outro;
},
trimLines: function trimLines () {
return this.trim('[\\r\\n]');
},
trim: function trim ( charType ) {
return this.trimStart( charType ).trimEnd( charType );
},
trimEnd: function trimEnd ( charType ) {
var this$1 = this;
var rx = new RegExp( ( charType || '\\s' ) + '+$' );
this.outro = this.outro.replace( rx, '' );
if ( this.outro.length ) return this;
var chunk = this.lastChunk;
do {
var end = chunk.end;
var aborted = chunk.trimEnd( rx );
// if chunk was trimmed, we have a new lastChunk
if ( chunk.end !== end ) {
this$1.lastChunk = chunk.next;
this$1.byEnd[ chunk.end ] = chunk;
this$1.byStart[ chunk.next.start ] = chunk.next;
}
if ( aborted ) return this$1;
chunk = chunk.previous;
} while ( chunk );
return this;
},
trimStart: function trimStart ( charType ) {
var this$1 = this;
var rx = new RegExp( '^' + ( charType || '\\s' ) + '+' );
this.intro = this.intro.replace( rx, '' );
if ( this.intro.length ) return this;
var chunk = this.firstChunk;
do {
var end = chunk.end;
var aborted = chunk.trimStart( rx );
if ( chunk.end !== end ) {
// special case...
if ( chunk === this$1.lastChunk ) this$1.lastChunk = chunk.next;
this$1.byEnd[ chunk.end ] = chunk;
this$1.byStart[ chunk.next.start ] = chunk.next;
}
if ( aborted ) return this$1;
chunk = chunk.next;
} while ( chunk );
return this;
}
};
var hasOwnProp = Object.prototype.hasOwnProperty;
function Bundle ( options ) {
if ( options === void 0 ) options = {};
this.intro = options.intro || '';
this.separator = options.separator !== undefined ? options.separator : '\n';
this.sources = [];
this.uniqueSources = [];
this.uniqueSourceIndexByFilename = {};
}
Bundle.prototype = {
addSource: function addSource ( source ) {
if ( source instanceof MagicString ) {
return this.addSource({
content: source,
filename: source.filename,
separator: this.separator
});
}
if ( !isObject( source ) || !source.content ) {
throw new Error( 'bundle.addSource() takes an object with a `content` property, which should be an instance of MagicString, and an optional `filename`' );
}
[ 'filename', 'indentExclusionRanges', 'separator' ].forEach( function ( option ) {
if ( !hasOwnProp.call( source, option ) ) source[ option ] = source.content[ option ];
});
if ( source.separator === undefined ) { // TODO there's a bunch of this sort of thing, needs cleaning up
source.separator = this.separator;
}
if ( source.filename ) {
if ( !hasOwnProp.call( this.uniqueSourceIndexByFilename, source.filename ) ) {
this.uniqueSourceIndexByFilename[ source.filename ] = this.uniqueSources.length;
this.uniqueSources.push({ filename: source.filename, content: source.content.original });
} else {
var uniqueSource = this.uniqueSources[ this.uniqueSourceIndexByFilename[ source.filename ] ];
if ( source.content.original !== uniqueSource.content ) {
throw new Error( ("Illegal source: same filename (" + (source.filename) + "), different contents") );
}
}
}
this.sources.push( source );
return this;
},
append: function append ( str, options ) {
this.addSource({
content: new MagicString( str ),
separator: ( options && options.separator ) || ''
});
return this;
},
clone: function clone () {
var bundle = new Bundle({
intro: this.intro,
separator: this.separator
});
this.sources.forEach( function ( source ) {
bundle.addSource({
filename: source.filename,
content: source.content.clone(),
separator: source.separator
});
});
return bundle;
},
generateMap: function generateMap ( options ) {
var this$1 = this;
var offsets = {};
var names = [];
this.sources.forEach( function ( source ) {
Object.keys( source.content.storedNames ).forEach( function ( name ) {
if ( !~names.indexOf( name ) ) names.push( name );
});
});
var encoded = (
getSemis( this.intro ) +
this.sources.map( function ( source, i ) {
var prefix = ( i > 0 ) ? ( getSemis( source.separator ) || ',' ) : '';
var mappings;
// we don't bother encoding sources without a filename
if ( !source.filename ) {
mappings = getSemis( source.content.toString() );
} else {
var sourceIndex = this$1.uniqueSourceIndexByFilename[ source.filename ];
mappings = source.content.getMappings( options.hires, sourceIndex, offsets, names );
}
return prefix + mappings;
}).join( '' )
);
return new SourceMap({
file: ( options.file ? options.file.split( /[\/\\]/ ).pop() : null ),
sources: this.uniqueSources.map( function ( source ) {
return options.file ? getRelativePath( options.file, source.filename ) : source.filename;
}),
sourcesContent: this.uniqueSources.map( function ( source ) {
return options.includeContent ? source.content : null;
}),
names: names,
mappings: encoded
});
},
getIndentString: function getIndentString () {
var indentStringCounts = {};
this.sources.forEach( function ( source ) {
var indentStr = source.content.indentStr;
if ( indentStr === null ) return;
if ( !indentStringCounts[ indentStr ] ) indentStringCounts[ indentStr ] = 0;
indentStringCounts[ indentStr ] += 1;
});
return ( Object.keys( indentStringCounts ).sort( function ( a, b ) {
return indentStringCounts[a] - indentStringCounts[b];
})[0] ) || '\t';
},
indent: function indent ( indentStr ) {
var this$1 = this;
if ( !arguments.length ) {
indentStr = this.getIndentString();
}
if ( indentStr === '' ) return this; // noop
var trailingNewline = !this.intro || this.intro.slice( -1 ) === '\n';
this.sources.forEach( function ( source, i ) {
var separator = source.separator !== undefined ? source.separator : this$1.separator;
var indentStart = trailingNewline || ( i > 0 && /\r?\n$/.test( separator ) );
source.content.indent( indentStr, {
exclude: source.indentExclusionRanges,
indentStart: indentStart//: trailingNewline || /\r?\n$/.test( separator ) //true///\r?\n/.test( separator )
});
// TODO this is a very slow way to determine this
trailingNewline = source.content.toString().slice( 0, -1 ) === '\n';
});
if ( this.intro ) {
this.intro = indentStr + this.intro.replace( /^[^\n]/gm, function ( match, index ) {
return index > 0 ? indentStr + match : match;
});
}
return this;
},
prepend: function prepend ( str ) {
this.intro = str + this.intro;
return this;
},
toString: function toString () {
var this$1 = this;
var body = this.sources.map( function ( source, i ) {
var separator = source.separator !== undefined ? source.separator : this$1.separator;
var str = ( i > 0 ? separator : '' ) + source.content.toString();
return str;
}).join( '' );
return this.intro + body;
},
trimLines: function trimLines () {
return this.trim('[\\r\\n]');
},
trim: function trim ( charType ) {
return this.trimStart( charType ).trimEnd( charType );
},
trimStart: function trimStart ( charType ) {
var this$1 = this;
var rx = new RegExp( '^' + ( charType || '\\s' ) + '+' );
this.intro = this.intro.replace( rx, '' );
if ( !this.intro ) {
var source;
var i = 0;
do {
source = this$1.sources[i];
if ( !source ) {
break;
}
source.content.trimStart( charType );
i += 1;
} while ( source.content.toString() === '' ); // TODO faster way to determine non-empty source?
}
return this;
},
trimEnd: function trimEnd ( charType ) {
var this$1 = this;
var rx = new RegExp( ( charType || '\\s' ) + '+$' );
var source;
var i = this.sources.length - 1;
do {
source = this$1.sources[i];
if ( !source ) {
this$1.intro = this$1.intro.replace( rx, '' );
break;
}
source.content.trimEnd( charType );
i -= 1;
} while ( source.content.toString() === '' ); // TODO faster way to determine non-empty source?
return this;
}
};
function getSemis ( str ) {
return new Array( str.split( '\n' ).length ).join( ';' );
}
MagicString.Bundle = Bundle;
module.exports = MagicString;
//# sourceMappingURL=magic-string.cjs.js.map
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(708).Buffer))
/***/ }),
/* 703 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2016 Titus Wormer
* @license MIT
* @module markdown-escapes
* @fileoverview List of escapable characters in markdown.
*/
/* eslint-env commonjs */
/* Expose. */
module.exports = escapes;
/* Characters. */
var defaults = [
'\\',
'`',
'*',
'{',
'}',
'[',
']',
'(',
')',
'#',
'+',
'-',
'.',
'!',
'_',
'>'
];
var gfm = defaults.concat(['~', '|']);
var commonmark = gfm.concat([
'\n',
'"',
'$',
'%',
'&',
'\'',
',',
'/',
':',
';',
'<',
'=',
'?',
'@',
'^'
]);
/* Expose characters. */
escapes.default = defaults;
escapes.gfm = gfm;
escapes.commonmark = commonmark;
/**
* Get markdown escapes.
*
* @param {Object?} [options] - Configuration.
* @return {Array.<string>} - Escapes.
*/
function escapes(options) {
var settings = options || {};
if (settings.commonmark) {
return commonmark;
}
return settings.gfm ? gfm : defaults;
}
/***/ }),
/* 704 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony export (immutable) */ __webpack_exports__["compiler"] = compiler;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_lodash_get__ = __webpack_require__(591);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_lodash_get___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_lodash_get__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_unified__ = __webpack_require__(1024);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_unified___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_unified__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_remark_parse__ = __webpack_require__(970);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_remark_parse___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_remark_parse__);
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
function _toArray(arr) { return Array.isArray(arr) ? arr : Array.from(arr); }
var BLOCK_ELEMENT_TAGS = ['article', 'header', 'aside', 'hgroup', 'blockquote', 'hr', 'iframe', 'body', 'li', 'map', 'button', 'object', 'canvas', 'ol', 'caption', 'output', 'col', 'p', 'colgroup', 'pre', 'dd', 'progress', 'div', 'section', 'dl', 'table', 'td', 'dt', 'tbody', 'embed', 'textarea', 'fieldset', 'tfoot', 'figcaption', 'th', 'figure', 'thead', 'footer', 'tr', 'form', 'ul', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'video', 'script', 'style'];
var BLOCK_ELEMENT_REGEX = new RegExp('^<(' + BLOCK_ELEMENT_TAGS.join('|') + ')', 'i');
// [0] === tag, [...] = attribute pairs
var HTML_EXTRACTOR_REGEX = /([-A-Za-z0-9_]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g;
var SELF_CLOSING_ELEMENT_TAGS = ['area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr'];
var SELF_CLOSING_ELEMENT_REGEX = new RegExp('^<(' + SELF_CLOSING_ELEMENT_TAGS.join('|') + ')', 'i');
var TEXT_AST_TYPES = ['text', 'textNode'];
var ATTRIBUTE_TO_JSX_PROP_MAP = {
'accept-charset': 'acceptCharset',
'accesskey': 'accessKey',
'allowfullscreen': 'allowFullScreen',
'allowtransparency': 'allowTransparency',
'autocomplete': 'autoComplete',
'autofocus': 'autoFocus',
'autoplay': 'autoPlay',
'cellpadding': 'cellPadding',
'cellspacing': 'cellSpacing',
'charset': 'charSet',
'class': 'className',
'classid': 'classId',
'colspan': 'colSpan',
'contenteditable': 'contentEditable',
'contextmenu': 'contextMenu',
'crossorigin': 'crossOrigin',
'enctype': 'encType',
'for': 'htmlFor',
'formaction': 'formAction',
'formenctype': 'formEncType',
'formmethod': 'formMethod',
'formnovalidate': 'formNoValidate',
'formtarget': 'formTarget',
'frameborder': 'frameBorder',
'hreflang': 'hrefLang',
'http-equiv': 'httpEquiv',
'inputmode': 'inputMode',
'keyparams': 'keyParams',
'keytype': 'keyType',
'marginheight': 'marginHeight',
'marginwidth': 'marginWidth',
'maxlength': 'maxLength',
'mediagroup': 'mediaGroup',
'minlength': 'minLength',
'novalidate': 'noValidate',
'radiogroup': 'radioGroup',
'readonly': 'readOnly',
'rowspan': 'rowSpan',
'spellcheck': 'spellCheck',
'srcdoc': 'srcDoc',
'srclang': 'srcLang',
'srcset': 'srcSet',
'tabindex': 'tabIndex',
'usemap': 'useMap'
};
var getType = Object.prototype.toString;
function extractDefinitionsFromASTTree(ast, parser) {
function reducer(aggregator, node) {
if (node.type === 'definition' || node.type === 'footnoteDefinition') {
aggregator.definitions[node.identifier] = node;
if (node.type === 'footnoteDefinition') {
if (node.children && node.children.length === 1 && node.children[0].type === 'paragraph') {
node.children[0].children.unshift({
type: 'textNode',
value: '[' + node.identifier + ']: '
});
} /* package the prefix inside the first child */
aggregator.footnotes.push(__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
'div',
{ key: node.identifier, id: node.identifier },
node.value || node.children.map(parser)
));
}
}
return Array.isArray(node.children) ? node.children.reduce(reducer, aggregator) : aggregator;
};
return [ast].reduce(reducer, {
definitions: {},
footnotes: []
});
}
function formExtraPropsForHTMLNodeType() {
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var ast = arguments[1];
var definitions = arguments[2];
switch (ast.type) {
case 'footnoteReference':
return _extends({}, props, {
href: '#' + ast.identifier
});
case 'image':
return _extends({}, props, {
title: ast.title,
alt: ast.alt,
src: ast.url
});
case 'imageReference':
return _extends({}, props, {
title: __WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(definitions, '[\'' + ast.identifier + '\'].title'),
alt: ast.alt,
src: __WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(definitions, '[\'' + ast.identifier + '\'].url')
});
case 'link':
return _extends({}, props, {
title: ast.title,
href: ast.url
});
case 'linkReference':
return _extends({}, props, {
title: __WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(definitions, '[\'' + ast.identifier + '\'].title'),
href: __WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(definitions, '[\'' + ast.identifier + '\'].url')
});
case 'list':
return _extends({}, props, {
start: ast.start
});
case 'tableCell':
case 'th':
return _extends({}, props, {
style: { textAlign: ast.align }
});
}
return props;
}
function getHTMLNodeTypeFromASTNodeType(node) {
switch (node.type) {
case 'break':
return 'br';
case 'delete':
return 'del';
case 'emphasis':
return 'em';
case 'footnoteReference':
return 'a';
case 'heading':
return 'h' + node.depth;
case 'image':
case 'imageReference':
return 'img';
case 'inlineCode':
return 'code';
case 'link':
case 'linkReference':
return 'a';
case 'list':
return node.ordered ? 'ol' : 'ul';
case 'listItem':
return 'li';
case 'paragraph':
return 'p';
case 'root':
return 'div';
case 'tableHeader':
return 'thead';
case 'tableRow':
return 'tr';
case 'tableCell':
return 'td';
case 'thematicBreak':
return 'hr';
case 'definition':
case 'footnoteDefinition':
case 'yaml':
return null;
default:
return node.type;
}
}
function seekCellsAndAlignThemIfNecessary(root, alignmentValues) {
var mapper = function mapper(child, index) {
if (child.type === 'tableCell') {
return _extends({}, child, {
align: alignmentValues[index]
});
} else if (Array.isArray(child.children) && child.children.length) {
return child.children.map(mapper);
}
return child;
};
if (Array.isArray(root.children) && root.children.length) {
root.children = root.children.map(mapper);
}
return root;
}
function attributeValueToJSXPropValue(key, value) {
if (key === 'style') {
return value.split(/;\s?/).reduce(function (styles, kvPair) {
var key = kvPair.slice(0, kvPair.indexOf(':'));
// snake-case to camelCase
// also handles PascalCasing vendor prefixes
var camelCasedKey = key.replace(/(\-[a-z])/g, function (substr) {
return substr[1].toUpperCase();
});
// key.length + 1 to skip over the colon
styles[camelCasedKey] = kvPair.slice(key.length + 1).trim();
return styles;
}, {});
}
return value;
}
function isCoalesceableHTML(html) {
// ignore block-level elements
// ignore self-closing or non-content-bearing elements
return html.match(BLOCK_ELEMENT_REGEX) || html.match(SELF_CLOSING_ELEMENT_REGEX) ? false : true;
}
function coalesceInlineHTML(ast) {
function coalescer(node, index, siblings) {
if (node.type === 'html') {
if (!isCoalesceableHTML(node.value)) {
return;
}
// are there more html nodes directly after? if so, fold them into the current node
if (index < siblings.length - 1 && siblings[index + 1].type === 'html') {
// create a new coalescer context
coalescer(siblings[index + 1], index + 1, siblings);
}
var i = index + 1;
var end = void 0;
// where's the end tag?
while (end === undefined && i < siblings.length) {
if (siblings[i].type !== 'html' || siblings[i].type === 'html' && !isCoalesceableHTML(siblings[i].value)) {
i += 1;
continue;
}
end = siblings[i];
}
/* all interim elements now become children of the current node, and we splice them (including end tag)
out of the sibling array so they will not be iterated-over by forEach */
node.children = siblings.slice(index + 1, i);
siblings.splice(index + 1, i - index);
var _node$value$match = node.value.match(HTML_EXTRACTOR_REGEX),
_node$value$match2 = _toArray(_node$value$match),
tag = _node$value$match2[0],
attributePairs = _node$value$match2.slice(1);
// reassign the current node to whatever its tag is
node.type = tag.toLowerCase();
// make a best-effort conversion to JSX props
node.props = attributePairs.reduce(function (props, kvPair) {
var valueIndex = kvPair.indexOf('=');
var key = kvPair.slice(0, valueIndex === -1 ? undefined : valueIndex);
// ignoring inline event handlers at this time - they pose enough of a security risk that they're
// not worth preserving; there's a reason React calls it "dangerouslySetInnerHTML"!
if (key.indexOf('on') !== 0) {
var value = kvPair.slice(key.length + 1);
// strip the outermost single/double quote if it exists
if (value[0] === '"' || value[0] === '\'') {
value = value.slice(1, value.length - 1);
}
props[ATTRIBUTE_TO_JSX_PROP_MAP[key] || key] = attributeValueToJSXPropValue(key, value) || true;
}
return props;
}, {});
// null out .value or astToJSX() will set it as the child
node.value = null;
}
if (node.children) {
node.children.forEach(coalescer);
}
};
ast.children.forEach(coalescer);
}
function compiler(markdown) {
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
_ref$overrides = _ref.overrides,
overrides = _ref$overrides === undefined ? {} : _ref$overrides;
var definitions = void 0;
var footnotes = void 0;
function astToJSX(ast, index) {
/* `this` is the dictionary of definitions */
if (TEXT_AST_TYPES.indexOf(ast.type) !== -1) {
return ast.value;
}
var key = index || '0';
if (ast.type === 'code' && ast.value) {
var preProps = _extends({}, __WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(overrides, 'pre.props', {}), {
key: key
});
var langClassName = 'lang-' + ast.lang;
var codeBaseProps = __WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(overrides, 'code.props', {});
var codeProps = _extends({}, codeBaseProps, {
className: codeBaseProps.className ? codeBaseProps.className + ' ' + langClassName : langClassName
});
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(overrides, 'pre.component', 'pre'), preProps, __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(overrides, 'code.component', 'code'), codeProps, ast.value));
} /* Refers to fenced blocks, need to create a pre:code nested structure */
if (ast.type === 'list' && ast.loose === false) {
ast.children = ast.children.map(function (item) {
if (item.children.length === 1 && item.children[0].type === 'paragraph') {
return _extends({}, item, {
children: item.children[0].children
});
}
return item;
});
} /* tight list, remove the paragraph wrapper just inside the listItem */
if (ast.type === 'listItem') {
if (ast.checked === true || ast.checked === false) {
var liProps = _extends({}, __WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(overrides, 'li.props', {}), {
key: key
});
var inputProps = _extends({}, __WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(overrides, 'input.props', {}), {
key: 'checkbox',
type: 'checkbox',
checked: ast.checked,
readOnly: true
});
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(overrides, 'li.component', 'li'), liProps, [__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_2_lodash_get___default()(overrides, 'input.component', 'input'), inputProps), ast.children.map(astToJSX)]);
} /* gfm task list, need to add a checkbox */
}
if (ast.type === 'html') {
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement('div', { key: key, dangerouslySetInnerHTML: { __html: ast.value } });
} /* arbitrary HTML, do the gross thing for now */
if (ast.type === 'table') {
var tbody = { type: 'tbody', children: [] };
ast.children = ast.children.reduce(function (children, child, index) {
if (index === 0) {
/* manually marking the first row as tableHeader since that was removed in remark@4.x; it's important semantically. */
child.type = 'tableHeader';
children.unshift(seekCellsAndAlignThemIfNecessary(child, ast.align));
} else if (child.type === 'tableRow') {
tbody.children.push(seekCellsAndAlignThemIfNecessary(child, ast.align));
} else if (child.type === 'tableFooter') {
children.push(seekCellsAndAlignThemIfNecessary(child, ast.align));
}
return children;
}, [tbody]);
} /* React yells if things aren't in the proper structure, so need to
delve into the immediate children and wrap tablerow(s) in a tbody */
if (ast.type === 'tableFooter') {
ast.children = [{
type: 'tr',
children: ast.children
}];
} /* React yells if things aren't in the proper structure, so need to
delve into the immediate children and wrap the cells in a tablerow */
if (ast.type === 'tableHeader') {
ast.children = [{
type: 'tr',
children: ast.children.map(function (child) {
if (child.type === 'tableCell') {
child.type = 'th';
} /* et voila, a proper table header */
return child;
})
}];
} /* React yells if things aren't in the proper structure, so need to
delve into the immediate children and wrap the cells in a tablerow */
if (ast.type === 'footnoteReference') {
ast.children = [{ type: 'sup', value: ast.identifier }];
} /* place the identifier inside a superscript tag for the link */
var htmlNodeType = getHTMLNodeTypeFromASTNodeType(ast);
if (htmlNodeType === null) {
return null;
} /* bail out, not convertable to any HTML representation */
var props = _extends({ key: key }, ast.props);
if (Array.isArray(ast.children) && ast.children.length === 1 && ast.children[0].type === 'html') {
props.dangerouslySetInnerHTML = { __html: ast.children[0].value };
ast.children = null;
}
var override = overrides[htmlNodeType];
if (override) {
if (override.component) {
htmlNodeType = override.component;
} /* sub out the normal html tag name for the JSX / ReactFactory
passed in by the caller */
if (override.props) {
props = _extends({}, override.props, props);
} /* apply the prop overrides beneath the minimal set that are necessary
to have the markdown conversion work as expected */
}
/* their props + our props, with any duplicate keys overwritten by us
(necessary evil, file an issue if something comes up that needs
extra attention, only props specified in `formExtraPropsForHTMLNodeType`
will be overwritten on a key collision) */
var finalProps = formExtraPropsForHTMLNodeType(props, ast, definitions);
if (ast.children && ast.children.length === 1) {
if (TEXT_AST_TYPES.indexOf(ast.children[0].type) !== -1) {
ast.children = ast.children[0].value;
}
} /* solitary text children don't need full parsing or React will add a wrapper */
var children = Array.isArray(ast.children) ? ast.children.map(astToJSX) : ast.children;
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(htmlNodeType, finalProps, ast.value || children);
}
if (typeof markdown !== 'string') {
throw new Error('markdown-to-jsx: the first argument must be\n a string');
}
if (getType.call(overrides) !== '[object Object]') {
throw new Error('markdown-to-jsx: options.overrides (second argument property) must be\n undefined or an object literal with shape:\n {\n htmltagname: {\n component: string|ReactComponent(optional),\n props: object(optional)\n }\n }');
}
var remarkAST = __WEBPACK_IMPORTED_MODULE_3_unified___default()().data('settings', {
footnotes: true,
gfm: true,
position: false
}).use(__WEBPACK_IMPORTED_MODULE_4_remark_parse___default.a).parse(markdown);
var extracted = extractDefinitionsFromASTTree(remarkAST, astToJSX);
definitions = extracted.definitions;
footnotes = extracted.footnotes;
coalesceInlineHTML(remarkAST);
var jsx = astToJSX(remarkAST);
// discard the root <div> node if there is only one valid initial child
if (jsx.props.children && jsx.props.children.length === 1) {
jsx = jsx.props.children[0];
}
if (footnotes.length) {
jsx.props.children.push(__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
'footer',
{ key: 'footnotes' },
footnotes
));
}
return jsx;
};
/**
* A simple HOC for easy React use. Feed the markdown content as a direct child
* and the rest is taken care of automatically.
*
* @param {String} options.children must be a string
* @param {Object} options.options markdown-to-jsx options (arg 2 of the compiler)
*
* @return {ReactElement} the compiled JSX
*/
var Component = function Component(_ref2) {
var children = _ref2.children,
options = _ref2.options,
props = _objectWithoutProperties(_ref2, ['children', 'options']);
return compiler(children, options);
};
Component.propTypes = {
children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string.isRequired,
options: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object
};
/* harmony default export */ __webpack_exports__["default"] = (Component);
/***/ }),
/* 705 */
/***/ (function(module, exports) {
module.exports = /([a-z\xB5\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02AF\u0371\u0373\u0377\u037B-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0561-\u0587\u13F8-\u13FD\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2184\u2C30-\u2C5E\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7B\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F\uA771-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7B5\uA7B7\uA7FA\uAB30-\uAB5A\uAB60-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A0-9\xB2\xB3\xB9\xBC-\xBE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D66-\u0D75\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19])([A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2183\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AD\uA7B0-\uA7B4\uA7B6\uFF21-\uFF3A])/g
/***/ }),
/* 706 */
/***/ (function(module, exports) {
module.exports = /([A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2183\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AD\uA7B0-\uA7B4\uA7B6\uFF21-\uFF3A]+)([A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2183\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AD\uA7B0-\uA7B4\uA7B6\uFF21-\uFF3A][a-z\xB5\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02AF\u0371\u0373\u0377\u037B-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0561-\u0587\u13F8-\u13FD\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2184\u2C30-\u2C5E\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7B\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F\uA771-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7B5\uA7B7\uA7FA\uAB30-\uAB5A\uAB60-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A])/g
/***/ }),
/* 707 */
/***/ (function(module, exports) {
module.exports = /[^A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\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\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\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\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\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\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC0-9\xB2\xB3\xB9\xBC-\xBE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D66-\u0D75\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19]+/g
/***/ }),
/* 708 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(global) {/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT
*/
/* eslint-disable no-proto */
var base64 = __webpack_require__(415)
var ieee754 = __webpack_require__(462)
var isArray = __webpack_require__(470)
exports.Buffer = Buffer
exports.SlowBuffer = SlowBuffer
exports.INSPECT_MAX_BYTES = 50
/**
* If `Buffer.TYPED_ARRAY_SUPPORT`:
* === true Use Uint8Array implementation (fastest)
* === false Use Object implementation (most compatible, even IE6)
*
* Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
* Opera 11.6+, iOS 4.2+.
*
* Due to various browser bugs, sometimes the Object implementation will be used even
* when the browser supports typed arrays.
*
* Note:
*
* - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
* See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
*
* - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
*
* - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
* incorrect length in some situations.
* We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
* get the Object implementation, which is slower but behaves correctly.
*/
Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined
? global.TYPED_ARRAY_SUPPORT
: typedArraySupport()
/*
* Export kMaxLength after typed array support is determined.
*/
exports.kMaxLength = kMaxLength()
function typedArraySupport () {
try {
var arr = new Uint8Array(1)
arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}
return arr.foo() === 42 && // typed array instances can be augmented
typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`
arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`
} catch (e) {
return false
}
}
function kMaxLength () {
return Buffer.TYPED_ARRAY_SUPPORT
? 0x7fffffff
: 0x3fffffff
}
function createBuffer (that, length) {
if (kMaxLength() < length) {
throw new RangeError('Invalid typed array length')
}
if (Buffer.TYPED_ARRAY_SUPPORT) {
// Return an augmented `Uint8Array` instance, for best performance
that = new Uint8Array(length)
that.__proto__ = Buffer.prototype
} else {
// Fallback: Return an object instance of the Buffer class
if (that === null) {
that = new Buffer(length)
}
that.length = length
}
return that
}
/**
* The Buffer constructor returns instances of `Uint8Array` that have their
* prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
* `Uint8Array`, so the returned instances will have all the node `Buffer` methods
* and the `Uint8Array` methods. Square bracket notation works as expected -- it
* returns a single octet.
*
* The `Uint8Array` prototype remains unmodified.
*/
function Buffer (arg, encodingOrOffset, length) {
if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {
return new Buffer(arg, encodingOrOffset, length)
}
// Common case.
if (typeof arg === 'number') {
if (typeof encodingOrOffset === 'string') {
throw new Error(
'If encoding is specified then the first argument must be a string'
)
}
return allocUnsafe(this, arg)
}
return from(this, arg, encodingOrOffset, length)
}
Buffer.poolSize = 8192 // not used by this implementation
// TODO: Legacy, not needed anymore. Remove in next major version.
Buffer._augment = function (arr) {
arr.__proto__ = Buffer.prototype
return arr
}
function from (that, value, encodingOrOffset, length) {
if (typeof value === 'number') {
throw new TypeError('"value" argument must not be a number')
}
if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
return fromArrayBuffer(that, value, encodingOrOffset, length)
}
if (typeof value === 'string') {
return fromString(that, value, encodingOrOffset)
}
return fromObject(that, value)
}
/**
* Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
* if value is a number.
* Buffer.from(str[, encoding])
* Buffer.from(array)
* Buffer.from(buffer)
* Buffer.from(arrayBuffer[, byteOffset[, length]])
**/
Buffer.from = function (value, encodingOrOffset, length) {
return from(null, value, encodingOrOffset, length)
}
if (Buffer.TYPED_ARRAY_SUPPORT) {
Buffer.prototype.__proto__ = Uint8Array.prototype
Buffer.__proto__ = Uint8Array
if (typeof Symbol !== 'undefined' && Symbol.species &&
Buffer[Symbol.species] === Buffer) {
// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
Object.defineProperty(Buffer, Symbol.species, {
value: null,
configurable: true
})
}
}
function assertSize (size) {
if (typeof size !== 'number') {
throw new TypeError('"size" argument must be a number')
} else if (size < 0) {
throw new RangeError('"size" argument must not be negative')
}
}
function alloc (that, size, fill, encoding) {
assertSize(size)
if (size <= 0) {
return createBuffer(that, size)
}
if (fill !== undefined) {
// Only pay attention to encoding if it's a string. This
// prevents accidentally sending in a number that would
// be interpretted as a start offset.
return typeof encoding === 'string'
? createBuffer(that, size).fill(fill, encoding)
: createBuffer(that, size).fill(fill)
}
return createBuffer(that, size)
}
/**
* Creates a new filled Buffer instance.
* alloc(size[, fill[, encoding]])
**/
Buffer.alloc = function (size, fill, encoding) {
return alloc(null, size, fill, encoding)
}
function allocUnsafe (that, size) {
assertSize(size)
that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)
if (!Buffer.TYPED_ARRAY_SUPPORT) {
for (var i = 0; i < size; ++i) {
that[i] = 0
}
}
return that
}
/**
* Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
* */
Buffer.allocUnsafe = function (size) {
return allocUnsafe(null, size)
}
/**
* Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
*/
Buffer.allocUnsafeSlow = function (size) {
return allocUnsafe(null, size)
}
function fromString (that, string, encoding) {
if (typeof encoding !== 'string' || encoding === '') {
encoding = 'utf8'
}
if (!Buffer.isEncoding(encoding)) {
throw new TypeError('"encoding" must be a valid string encoding')
}
var length = byteLength(string, encoding) | 0
that = createBuffer(that, length)
var actual = that.write(string, encoding)
if (actual !== length) {
// Writing a hex string, for example, that contains invalid characters will
// cause everything after the first invalid character to be ignored. (e.g.
// 'abxxcd' will be treated as 'ab')
that = that.slice(0, actual)
}
return that
}
function fromArrayLike (that, array) {
var length = array.length < 0 ? 0 : checked(array.length) | 0
that = createBuffer(that, length)
for (var i = 0; i < length; i += 1) {
that[i] = array[i] & 255
}
return that
}
function fromArrayBuffer (that, array, byteOffset, length) {
array.byteLength // this throws if `array` is not a valid ArrayBuffer
if (byteOffset < 0 || array.byteLength < byteOffset) {
throw new RangeError('\'offset\' is out of bounds')
}
if (array.byteLength < byteOffset + (length || 0)) {
throw new RangeError('\'length\' is out of bounds')
}
if (byteOffset === undefined && length === undefined) {
array = new Uint8Array(array)
} else if (length === undefined) {
array = new Uint8Array(array, byteOffset)
} else {
array = new Uint8Array(array, byteOffset, length)
}
if (Buffer.TYPED_ARRAY_SUPPORT) {
// Return an augmented `Uint8Array` instance, for best performance
that = array
that.__proto__ = Buffer.prototype
} else {
// Fallback: Return an object instance of the Buffer class
that = fromArrayLike(that, array)
}
return that
}
function fromObject (that, obj) {
if (Buffer.isBuffer(obj)) {
var len = checked(obj.length) | 0
that = createBuffer(that, len)
if (that.length === 0) {
return that
}
obj.copy(that, 0, 0, len)
return that
}
if (obj) {
if ((typeof ArrayBuffer !== 'undefined' &&
obj.buffer instanceof ArrayBuffer) || 'length' in obj) {
if (typeof obj.length !== 'number' || isnan(obj.length)) {
return createBuffer(that, 0)
}
return fromArrayLike(that, obj)
}
if (obj.type === 'Buffer' && isArray(obj.data)) {
return fromArrayLike(that, obj.data)
}
}
throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')
}
function checked (length) {
// Note: cannot use `length < kMaxLength()` here because that fails when
// length is NaN (which is otherwise coerced to zero.)
if (length >= kMaxLength()) {
throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
'size: 0x' + kMaxLength().toString(16) + ' bytes')
}
return length | 0
}
function SlowBuffer (length) {
if (+length != length) { // eslint-disable-line eqeqeq
length = 0
}
return Buffer.alloc(+length)
}
Buffer.isBuffer = function isBuffer (b) {
return !!(b != null && b._isBuffer)
}
Buffer.compare = function compare (a, b) {
if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
throw new TypeError('Arguments must be Buffers')
}
if (a === b) return 0
var x = a.length
var y = b.length
for (var i = 0, len = Math.min(x, y); i < len; ++i) {
if (a[i] !== b[i]) {
x = a[i]
y = b[i]
break
}
}
if (x < y) return -1
if (y < x) return 1
return 0
}
Buffer.isEncoding = function isEncoding (encoding) {
switch (String(encoding).toLowerCase()) {
case 'hex':
case 'utf8':
case 'utf-8':
case 'ascii':
case 'latin1':
case 'binary':
case 'base64':
case 'ucs2':
case 'ucs-2':
case 'utf16le':
case 'utf-16le':
return true
default:
return false
}
}
Buffer.concat = function concat (list, length) {
if (!isArray(list)) {
throw new TypeError('"list" argument must be an Array of Buffers')
}
if (list.length === 0) {
return Buffer.alloc(0)
}
var i
if (length === undefined) {
length = 0
for (i = 0; i < list.length; ++i) {
length += list[i].length
}
}
var buffer = Buffer.allocUnsafe(length)
var pos = 0
for (i = 0; i < list.length; ++i) {
var buf = list[i]
if (!Buffer.isBuffer(buf)) {
throw new TypeError('"list" argument must be an Array of Buffers')
}
buf.copy(buffer, pos)
pos += buf.length
}
return buffer
}
function byteLength (string, encoding) {
if (Buffer.isBuffer(string)) {
return string.length
}
if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&
(ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {
return string.byteLength
}
if (typeof string !== 'string') {
string = '' + string
}
var len = string.length
if (len === 0) return 0
// Use a for loop to avoid recursion
var loweredCase = false
for (;;) {
switch (encoding) {
case 'ascii':
case 'latin1':
case 'binary':
return len
case 'utf8':
case 'utf-8':
case undefined:
return utf8ToBytes(string).length
case 'ucs2':
case 'ucs-2':
case 'utf16le':
case 'utf-16le':
return len * 2
case 'hex':
return len >>> 1
case 'base64':
return base64ToBytes(string).length
default:
if (loweredCase) return utf8ToBytes(string).length // assume utf8
encoding = ('' + encoding).toLowerCase()
loweredCase = true
}
}
}
Buffer.byteLength = byteLength
function slowToString (encoding, start, end) {
var loweredCase = false
// No need to verify that "this.length <= MAX_UINT32" since it's a read-only
// property of a typed array.
// This behaves neither like String nor Uint8Array in that we set start/end
// to their upper/lower bounds if the value passed is out of range.
// undefined is handled specially as per ECMA-262 6th Edition,
// Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
if (start === undefined || start < 0) {
start = 0
}
// Return early if start > this.length. Done here to prevent potential uint32
// coercion fail below.
if (start > this.length) {
return ''
}
if (end === undefined || end > this.length) {
end = this.length
}
if (end <= 0) {
return ''
}
// Force coersion to uint32. This will also coerce falsey/NaN values to 0.
end >>>= 0
start >>>= 0
if (end <= start) {
return ''
}
if (!encoding) encoding = 'utf8'
while (true) {
switch (encoding) {
case 'hex':
return hexSlice(this, start, end)
case 'utf8':
case 'utf-8':
return utf8Slice(this, start, end)
case 'ascii':
return asciiSlice(this, start, end)
case 'latin1':
case 'binary':
return latin1Slice(this, start, end)
case 'base64':
return base64Slice(this, start, end)
case 'ucs2':
case 'ucs-2':
case 'utf16le':
case 'utf-16le':
return utf16leSlice(this, start, end)
default:
if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
encoding = (encoding + '').toLowerCase()
loweredCase = true
}
}
}
// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect
// Buffer instances.
Buffer.prototype._isBuffer = true
function swap (b, n, m) {
var i = b[n]
b[n] = b[m]
b[m] = i
}
Buffer.prototype.swap16 = function swap16 () {
var len = this.length
if (len % 2 !== 0) {
throw new RangeError('Buffer size must be a multiple of 16-bits')
}
for (var i = 0; i < len; i += 2) {
swap(this, i, i + 1)
}
return this
}
Buffer.prototype.swap32 = function swap32 () {
var len = this.length
if (len % 4 !== 0) {
throw new RangeError('Buffer size must be a multiple of 32-bits')
}
for (var i = 0; i < len; i += 4) {
swap(this, i, i + 3)
swap(this, i + 1, i + 2)
}
return this
}
Buffer.prototype.swap64 = function swap64 () {
var len = this.length
if (len % 8 !== 0) {
throw new RangeError('Buffer size must be a multiple of 64-bits')
}
for (var i = 0; i < len; i += 8) {
swap(this, i, i + 7)
swap(this, i + 1, i + 6)
swap(this, i + 2, i + 5)
swap(this, i + 3, i + 4)
}
return this
}
Buffer.prototype.toString = function toString () {
var length = this.length | 0
if (length === 0) return ''
if (arguments.length === 0) return utf8Slice(this, 0, length)
return slowToString.apply(this, arguments)
}
Buffer.prototype.equals = function equals (b) {
if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
if (this === b) return true
return Buffer.compare(this, b) === 0
}
Buffer.prototype.inspect = function inspect () {
var str = ''
var max = exports.INSPECT_MAX_BYTES
if (this.length > 0) {
str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')
if (this.length > max) str += ' ... '
}
return '<Buffer ' + str + '>'
}
Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
if (!Buffer.isBuffer(target)) {
throw new TypeError('Argument must be a Buffer')
}
if (start === undefined) {
start = 0
}
if (end === undefined) {
end = target ? target.length : 0
}
if (thisStart === undefined) {
thisStart = 0
}
if (thisEnd === undefined) {
thisEnd = this.length
}
if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
throw new RangeError('out of range index')
}
if (thisStart >= thisEnd && start >= end) {
return 0
}
if (thisStart >= thisEnd) {
return -1
}
if (start >= end) {
return 1
}
start >>>= 0
end >>>= 0
thisStart >>>= 0
thisEnd >>>= 0
if (this === target) return 0
var x = thisEnd - thisStart
var y = end - start
var len = Math.min(x, y)
var thisCopy = this.slice(thisStart, thisEnd)
var targetCopy = target.slice(start, end)
for (var i = 0; i < len; ++i) {
if (thisCopy[i] !== targetCopy[i]) {
x = thisCopy[i]
y = targetCopy[i]
break
}
}
if (x < y) return -1
if (y < x) return 1
return 0
}
// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
// OR the last index of `val` in `buffer` at offset <= `byteOffset`.
//
// Arguments:
// - buffer - a Buffer to search
// - val - a string, Buffer, or number
// - byteOffset - an index into `buffer`; will be clamped to an int32
// - encoding - an optional encoding, relevant is val is a string
// - dir - true for indexOf, false for lastIndexOf
function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
// Empty buffer means no match
if (buffer.length === 0) return -1
// Normalize byteOffset
if (typeof byteOffset === 'string') {
encoding = byteOffset
byteOffset = 0
} else if (byteOffset > 0x7fffffff) {
byteOffset = 0x7fffffff
} else if (byteOffset < -0x80000000) {
byteOffset = -0x80000000
}
byteOffset = +byteOffset // Coerce to Number.
if (isNaN(byteOffset)) {
// byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
byteOffset = dir ? 0 : (buffer.length - 1)
}
// Normalize byteOffset: negative offsets start from the end of the buffer
if (byteOffset < 0) byteOffset = buffer.length + byteOffset
if (byteOffset >= buffer.length) {
if (dir) return -1
else byteOffset = buffer.length - 1
} else if (byteOffset < 0) {
if (dir) byteOffset = 0
else return -1
}
// Normalize val
if (typeof val === 'string') {
val = Buffer.from(val, encoding)
}
// Finally, search either indexOf (if dir is true) or lastIndexOf
if (Buffer.isBuffer(val)) {
// Special case: looking for empty string/buffer always fails
if (val.length === 0) {
return -1
}
return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
} else if (typeof val === 'number') {
val = val & 0xFF // Search for a byte value [0-255]
if (Buffer.TYPED_ARRAY_SUPPORT &&
typeof Uint8Array.prototype.indexOf === 'function') {
if (dir) {
return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
} else {
return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
}
}
return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
}
throw new TypeError('val must be string, number or Buffer')
}
function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
var indexSize = 1
var arrLength = arr.length
var valLength = val.length
if (encoding !== undefined) {
encoding = String(encoding).toLowerCase()
if (encoding === 'ucs2' || encoding === 'ucs-2' ||
encoding === 'utf16le' || encoding === 'utf-16le') {
if (arr.length < 2 || val.length < 2) {
return -1
}
indexSize = 2
arrLength /= 2
valLength /= 2
byteOffset /= 2
}
}
function read (buf, i) {
if (indexSize === 1) {
return buf[i]
} else {
return buf.readUInt16BE(i * indexSize)
}
}
var i
if (dir) {
var foundIndex = -1
for (i = byteOffset; i < arrLength; i++) {
if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
if (foundIndex === -1) foundIndex = i
if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
} else {
if (foundIndex !== -1) i -= i - foundIndex
foundIndex = -1
}
}
} else {
if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
for (i = byteOffset; i >= 0; i--) {
var found = true
for (var j = 0; j < valLength; j++) {
if (read(arr, i + j) !== read(val, j)) {
found = false
break
}
}
if (found) return i
}
}
return -1
}
Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
return this.indexOf(val, byteOffset, encoding) !== -1
}
Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
}
Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
}
function hexWrite (buf, string, offset, length) {
offset = Number(offset) || 0
var remaining = buf.length - offset
if (!length) {
length = remaining
} else {
length = Number(length)
if (length > remaining) {
length = remaining
}
}
// must be an even number of digits
var strLen = string.length
if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')
if (length > strLen / 2) {
length = strLen / 2
}
for (var i = 0; i < length; ++i) {
var parsed = parseInt(string.substr(i * 2, 2), 16)
if (isNaN(parsed)) return i
buf[offset + i] = parsed
}
return i
}
function utf8Write (buf, string, offset, length) {
return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
}
function asciiWrite (buf, string, offset, length) {
return blitBuffer(asciiToBytes(string), buf, offset, length)
}
function latin1Write (buf, string, offset, length) {
return asciiWrite(buf, string, offset, length)
}
function base64Write (buf, string, offset, length) {
return blitBuffer(base64ToBytes(string), buf, offset, length)
}
function ucs2Write (buf, string, offset, length) {
return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
}
Buffer.prototype.write = function write (string, offset, length, encoding) {
// Buffer#write(string)
if (offset === undefined) {
encoding = 'utf8'
length = this.length
offset = 0
// Buffer#write(string, encoding)
} else if (length === undefined && typeof offset === 'string') {
encoding = offset
length = this.length
offset = 0
// Buffer#write(string, offset[, length][, encoding])
} else if (isFinite(offset)) {
offset = offset | 0
if (isFinite(length)) {
length = length | 0
if (encoding === undefined) encoding = 'utf8'
} else {
encoding = length
length = undefined
}
// legacy write(string, encoding, offset, length) - remove in v0.13
} else {
throw new Error(
'Buffer.write(string, encoding, offset[, length]) is no longer supported'
)
}
var remaining = this.length - offset
if (length === undefined || length > remaining) length = remaining
if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
throw new RangeError('Attempt to write outside buffer bounds')
}
if (!encoding) encoding = 'utf8'
var loweredCase = false
for (;;) {
switch (encoding) {
case 'hex':
return hexWrite(this, string, offset, length)
case 'utf8':
case 'utf-8':
return utf8Write(this, string, offset, length)
case 'ascii':
return asciiWrite(this, string, offset, length)
case 'latin1':
case 'binary':
return latin1Write(this, string, offset, length)
case 'base64':
// Warning: maxLength not taken into account in base64Write
return base64Write(this, string, offset, length)
case 'ucs2':
case 'ucs-2':
case 'utf16le':
case 'utf-16le':
return ucs2Write(this, string, offset, length)
default:
if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
encoding = ('' + encoding).toLowerCase()
loweredCase = true
}
}
}
Buffer.prototype.toJSON = function toJSON () {
return {
type: 'Buffer',
data: Array.prototype.slice.call(this._arr || this, 0)
}
}
function base64Slice (buf, start, end) {
if (start === 0 && end === buf.length) {
return base64.fromByteArray(buf)
} else {
return base64.fromByteArray(buf.slice(start, end))
}
}
function utf8Slice (buf, start, end) {
end = Math.min(buf.length, end)
var res = []
var i = start
while (i < end) {
var firstByte = buf[i]
var codePoint = null
var bytesPerSequence = (firstByte > 0xEF) ? 4
: (firstByte > 0xDF) ? 3
: (firstByte > 0xBF) ? 2
: 1
if (i + bytesPerSequence <= end) {
var secondByte, thirdByte, fourthByte, tempCodePoint
switch (bytesPerSequence) {
case 1:
if (firstByte < 0x80) {
codePoint = firstByte
}
break
case 2:
secondByte = buf[i + 1]
if ((secondByte & 0xC0) === 0x80) {
tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
if (tempCodePoint > 0x7F) {
codePoint = tempCodePoint
}
}
break
case 3:
secondByte = buf[i + 1]
thirdByte = buf[i + 2]
if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
codePoint = tempCodePoint
}
}
break
case 4:
secondByte = buf[i + 1]
thirdByte = buf[i + 2]
fourthByte = buf[i + 3]
if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
codePoint = tempCodePoint
}
}
}
}
if (codePoint === null) {
// we did not generate a valid codePoint so insert a
// replacement char (U+FFFD) and advance only 1 byte
codePoint = 0xFFFD
bytesPerSequence = 1
} else if (codePoint > 0xFFFF) {
// encode to utf16 (surrogate pair dance)
codePoint -= 0x10000
res.push(codePoint >>> 10 & 0x3FF | 0xD800)
codePoint = 0xDC00 | codePoint & 0x3FF
}
res.push(codePoint)
i += bytesPerSequence
}
return decodeCodePointsArray(res)
}
// Based on http://stackoverflow.com/a/22747272/680742, the browser with
// the lowest limit is Chrome, with 0x10000 args.
// We go 1 magnitude less, for safety
var MAX_ARGUMENTS_LENGTH = 0x1000
function decodeCodePointsArray (codePoints) {
var len = codePoints.length
if (len <= MAX_ARGUMENTS_LENGTH) {
return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
}
// Decode in chunks to avoid "call stack size exceeded".
var res = ''
var i = 0
while (i < len) {
res += String.fromCharCode.apply(
String,
codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
)
}
return res
}
function asciiSlice (buf, start, end) {
var ret = ''
end = Math.min(buf.length, end)
for (var i = start; i < end; ++i) {
ret += String.fromCharCode(buf[i] & 0x7F)
}
return ret
}
function latin1Slice (buf, start, end) {
var ret = ''
end = Math.min(buf.length, end)
for (var i = start; i < end; ++i) {
ret += String.fromCharCode(buf[i])
}
return ret
}
function hexSlice (buf, start, end) {
var len = buf.length
if (!start || start < 0) start = 0
if (!end || end < 0 || end > len) end = len
var out = ''
for (var i = start; i < end; ++i) {
out += toHex(buf[i])
}
return out
}
function utf16leSlice (buf, start, end) {
var bytes = buf.slice(start, end)
var res = ''
for (var i = 0; i < bytes.length; i += 2) {
res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)
}
return res
}
Buffer.prototype.slice = function slice (start, end) {
var len = this.length
start = ~~start
end = end === undefined ? len : ~~end
if (start < 0) {
start += len
if (start < 0) start = 0
} else if (start > len) {
start = len
}
if (end < 0) {
end += len
if (end < 0) end = 0
} else if (end > len) {
end = len
}
if (end < start) end = start
var newBuf
if (Buffer.TYPED_ARRAY_SUPPORT) {
newBuf = this.subarray(start, end)
newBuf.__proto__ = Buffer.prototype
} else {
var sliceLen = end - start
newBuf = new Buffer(sliceLen, undefined)
for (var i = 0; i < sliceLen; ++i) {
newBuf[i] = this[i + start]
}
}
return newBuf
}
/*
* Need to make sure that buffer isn't trying to write out of bounds.
*/
function checkOffset (offset, ext, length) {
if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
}
Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
offset = offset | 0
byteLength = byteLength | 0
if (!noAssert) checkOffset(offset, byteLength, this.length)
var val = this[offset]
var mul = 1
var i = 0
while (++i < byteLength && (mul *= 0x100)) {
val += this[offset + i] * mul
}
return val
}
Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
offset = offset | 0
byteLength = byteLength | 0
if (!noAssert) {
checkOffset(offset, byteLength, this.length)
}
var val = this[offset + --byteLength]
var mul = 1
while (byteLength > 0 && (mul *= 0x100)) {
val += this[offset + --byteLength] * mul
}
return val
}
Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
if (!noAssert) checkOffset(offset, 1, this.length)
return this[offset]
}
Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 2, this.length)
return this[offset] | (this[offset + 1] << 8)
}
Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 2, this.length)
return (this[offset] << 8) | this[offset + 1]
}
Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 4, this.length)
return ((this[offset]) |
(this[offset + 1] << 8) |
(this[offset + 2] << 16)) +
(this[offset + 3] * 0x1000000)
}
Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 4, this.length)
return (this[offset] * 0x1000000) +
((this[offset + 1] << 16) |
(this[offset + 2] << 8) |
this[offset + 3])
}
Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
offset = offset | 0
byteLength = byteLength | 0
if (!noAssert) checkOffset(offset, byteLength, this.length)
var val = this[offset]
var mul = 1
var i = 0
while (++i < byteLength && (mul *= 0x100)) {
val += this[offset + i] * mul
}
mul *= 0x80
if (val >= mul) val -= Math.pow(2, 8 * byteLength)
return val
}
Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
offset = offset | 0
byteLength = byteLength | 0
if (!noAssert) checkOffset(offset, byteLength, this.length)
var i = byteLength
var mul = 1
var val = this[offset + --i]
while (i > 0 && (mul *= 0x100)) {
val += this[offset + --i] * mul
}
mul *= 0x80
if (val >= mul) val -= Math.pow(2, 8 * byteLength)
return val
}
Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
if (!noAssert) checkOffset(offset, 1, this.length)
if (!(this[offset] & 0x80)) return (this[offset])
return ((0xff - this[offset] + 1) * -1)
}
Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 2, this.length)
var val = this[offset] | (this[offset + 1] << 8)
return (val & 0x8000) ? val | 0xFFFF0000 : val
}
Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 2, this.length)
var val = this[offset + 1] | (this[offset] << 8)
return (val & 0x8000) ? val | 0xFFFF0000 : val
}
Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 4, this.length)
return (this[offset]) |
(this[offset + 1] << 8) |
(this[offset + 2] << 16) |
(this[offset + 3] << 24)
}
Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 4, this.length)
return (this[offset] << 24) |
(this[offset + 1] << 16) |
(this[offset + 2] << 8) |
(this[offset + 3])
}
Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 4, this.length)
return ieee754.read(this, offset, true, 23, 4)
}
Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 4, this.length)
return ieee754.read(this, offset, false, 23, 4)
}
Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 8, this.length)
return ieee754.read(this, offset, true, 52, 8)
}
Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 8, this.length)
return ieee754.read(this, offset, false, 52, 8)
}
function checkInt (buf, value, offset, ext, max, min) {
if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
if (offset + ext > buf.length) throw new RangeError('Index out of range')
}
Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
value = +value
offset = offset | 0
byteLength = byteLength | 0
if (!noAssert) {
var maxBytes = Math.pow(2, 8 * byteLength) - 1
checkInt(this, value, offset, byteLength, maxBytes, 0)
}
var mul = 1
var i = 0
this[offset] = value & 0xFF
while (++i < byteLength && (mul *= 0x100)) {
this[offset + i] = (value / mul) & 0xFF
}
return offset + byteLength
}
Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
value = +value
offset = offset | 0
byteLength = byteLength | 0
if (!noAssert) {
var maxBytes = Math.pow(2, 8 * byteLength) - 1
checkInt(this, value, offset, byteLength, maxBytes, 0)
}
var i = byteLength - 1
var mul = 1
this[offset + i] = value & 0xFF
while (--i >= 0 && (mul *= 0x100)) {
this[offset + i] = (value / mul) & 0xFF
}
return offset + byteLength
}
Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
this[offset] = (value & 0xff)
return offset + 1
}
function objectWriteUInt16 (buf, value, offset, littleEndian) {
if (value < 0) value = 0xffff + value + 1
for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {
buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
(littleEndian ? i : 1 - i) * 8
}
}
Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset] = (value & 0xff)
this[offset + 1] = (value >>> 8)
} else {
objectWriteUInt16(this, value, offset, true)
}
return offset + 2
}
Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset] = (value >>> 8)
this[offset + 1] = (value & 0xff)
} else {
objectWriteUInt16(this, value, offset, false)
}
return offset + 2
}
function objectWriteUInt32 (buf, value, offset, littleEndian) {
if (value < 0) value = 0xffffffff + value + 1
for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {
buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff
}
}
Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset + 3] = (value >>> 24)
this[offset + 2] = (value >>> 16)
this[offset + 1] = (value >>> 8)
this[offset] = (value & 0xff)
} else {
objectWriteUInt32(this, value, offset, true)
}
return offset + 4
}
Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset] = (value >>> 24)
this[offset + 1] = (value >>> 16)
this[offset + 2] = (value >>> 8)
this[offset + 3] = (value & 0xff)
} else {
objectWriteUInt32(this, value, offset, false)
}
return offset + 4
}
Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) {
var limit = Math.pow(2, 8 * byteLength - 1)
checkInt(this, value, offset, byteLength, limit - 1, -limit)
}
var i = 0
var mul = 1
var sub = 0
this[offset] = value & 0xFF
while (++i < byteLength && (mul *= 0x100)) {
if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
sub = 1
}
this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
}
return offset + byteLength
}
Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) {
var limit = Math.pow(2, 8 * byteLength - 1)
checkInt(this, value, offset, byteLength, limit - 1, -limit)
}
var i = byteLength - 1
var mul = 1
var sub = 0
this[offset + i] = value & 0xFF
while (--i >= 0 && (mul *= 0x100)) {
if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
sub = 1
}
this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
}
return offset + byteLength
}
Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
if (value < 0) value = 0xff + value + 1
this[offset] = (value & 0xff)
return offset + 1
}
Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset] = (value & 0xff)
this[offset + 1] = (value >>> 8)
} else {
objectWriteUInt16(this, value, offset, true)
}
return offset + 2
}
Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset] = (value >>> 8)
this[offset + 1] = (value & 0xff)
} else {
objectWriteUInt16(this, value, offset, false)
}
return offset + 2
}
Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset] = (value & 0xff)
this[offset + 1] = (value >>> 8)
this[offset + 2] = (value >>> 16)
this[offset + 3] = (value >>> 24)
} else {
objectWriteUInt32(this, value, offset, true)
}
return offset + 4
}
Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
if (value < 0) value = 0xffffffff + value + 1
if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset] = (value >>> 24)
this[offset + 1] = (value >>> 16)
this[offset + 2] = (value >>> 8)
this[offset + 3] = (value & 0xff)
} else {
objectWriteUInt32(this, value, offset, false)
}
return offset + 4
}
function checkIEEE754 (buf, value, offset, ext, max, min) {
if (offset + ext > buf.length) throw new RangeError('Index out of range')
if (offset < 0) throw new RangeError('Index out of range')
}
function writeFloat (buf, value, offset, littleEndian, noAssert) {
if (!noAssert) {
checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
}
ieee754.write(buf, value, offset, littleEndian, 23, 4)
return offset + 4
}
Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
return writeFloat(this, value, offset, true, noAssert)
}
Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
return writeFloat(this, value, offset, false, noAssert)
}
function writeDouble (buf, value, offset, littleEndian, noAssert) {
if (!noAssert) {
checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
}
ieee754.write(buf, value, offset, littleEndian, 52, 8)
return offset + 8
}
Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
return writeDouble(this, value, offset, true, noAssert)
}
Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
return writeDouble(this, value, offset, false, noAssert)
}
// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
Buffer.prototype.copy = function copy (target, targetStart, start, end) {
if (!start) start = 0
if (!end && end !== 0) end = this.length
if (targetStart >= target.length) targetStart = target.length
if (!targetStart) targetStart = 0
if (end > 0 && end < start) end = start
// Copy 0 bytes; we're done
if (end === start) return 0
if (target.length === 0 || this.length === 0) return 0
// Fatal error conditions
if (targetStart < 0) {
throw new RangeError('targetStart out of bounds')
}
if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
if (end < 0) throw new RangeError('sourceEnd out of bounds')
// Are we oob?
if (end > this.length) end = this.length
if (target.length - targetStart < end - start) {
end = target.length - targetStart + start
}
var len = end - start
var i
if (this === target && start < targetStart && targetStart < end) {
// descending copy from end
for (i = len - 1; i >= 0; --i) {
target[i + targetStart] = this[i + start]
}
} else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
// ascending copy from start
for (i = 0; i < len; ++i) {
target[i + targetStart] = this[i + start]
}
} else {
Uint8Array.prototype.set.call(
target,
this.subarray(start, start + len),
targetStart
)
}
return len
}
// Usage:
// buffer.fill(number[, offset[, end]])
// buffer.fill(buffer[, offset[, end]])
// buffer.fill(string[, offset[, end]][, encoding])
Buffer.prototype.fill = function fill (val, start, end, encoding) {
// Handle string cases:
if (typeof val === 'string') {
if (typeof start === 'string') {
encoding = start
start = 0
end = this.length
} else if (typeof end === 'string') {
encoding = end
end = this.length
}
if (val.length === 1) {
var code = val.charCodeAt(0)
if (code < 256) {
val = code
}
}
if (encoding !== undefined && typeof encoding !== 'string') {
throw new TypeError('encoding must be a string')
}
if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
throw new TypeError('Unknown encoding: ' + encoding)
}
} else if (typeof val === 'number') {
val = val & 255
}
// Invalid ranges are not set to a default, so can range check early.
if (start < 0 || this.length < start || this.length < end) {
throw new RangeError('Out of range index')
}
if (end <= start) {
return this
}
start = start >>> 0
end = end === undefined ? this.length : end >>> 0
if (!val) val = 0
var i
if (typeof val === 'number') {
for (i = start; i < end; ++i) {
this[i] = val
}
} else {
var bytes = Buffer.isBuffer(val)
? val
: utf8ToBytes(new Buffer(val, encoding).toString())
var len = bytes.length
for (i = 0; i < end - start; ++i) {
this[i + start] = bytes[i % len]
}
}
return this
}
// HELPER FUNCTIONS
// ================
var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g
function base64clean (str) {
// Node strips out invalid characters like \n and \t from the string, base64-js does not
str = stringtrim(str).replace(INVALID_BASE64_RE, '')
// Node converts strings with length < 2 to ''
if (str.length < 2) return ''
// Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
while (str.length % 4 !== 0) {
str = str + '='
}
return str
}
function stringtrim (str) {
if (str.trim) return str.trim()
return str.replace(/^\s+|\s+$/g, '')
}
function toHex (n) {
if (n < 16) return '0' + n.toString(16)
return n.toString(16)
}
function utf8ToBytes (string, units) {
units = units || Infinity
var codePoint
var length = string.length
var leadSurrogate = null
var bytes = []
for (var i = 0; i < length; ++i) {
codePoint = string.charCodeAt(i)
// is surrogate component
if (codePoint > 0xD7FF && codePoint < 0xE000) {
// last char was a lead
if (!leadSurrogate) {
// no lead yet
if (codePoint > 0xDBFF) {
// unexpected trail
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
continue
} else if (i + 1 === length) {
// unpaired lead
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
continue
}
// valid lead
leadSurrogate = codePoint
continue
}
// 2 leads in a row
if (codePoint < 0xDC00) {
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
leadSurrogate = codePoint
continue
}
// valid surrogate pair
codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
} else if (leadSurrogate) {
// valid bmp char, but last char was a lead
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
}
leadSurrogate = null
// encode utf8
if (codePoint < 0x80) {
if ((units -= 1) < 0) break
bytes.push(codePoint)
} else if (codePoint < 0x800) {
if ((units -= 2) < 0) break
bytes.push(
codePoint >> 0x6 | 0xC0,
codePoint & 0x3F | 0x80
)
} else if (codePoint < 0x10000) {
if ((units -= 3) < 0) break
bytes.push(
codePoint >> 0xC | 0xE0,
codePoint >> 0x6 & 0x3F | 0x80,
codePoint & 0x3F | 0x80
)
} else if (codePoint < 0x110000) {
if ((units -= 4) < 0) break
bytes.push(
codePoint >> 0x12 | 0xF0,
codePoint >> 0xC & 0x3F | 0x80,
codePoint >> 0x6 & 0x3F | 0x80,
codePoint & 0x3F | 0x80
)
} else {
throw new Error('Invalid code point')
}
}
return bytes
}
function asciiToBytes (str) {
var byteArray = []
for (var i = 0; i < str.length; ++i) {
// Node's code seems to be doing this and not & 0x7F..
byteArray.push(str.charCodeAt(i) & 0xFF)
}
return byteArray
}
function utf16leToBytes (str, units) {
var c, hi, lo
var byteArray = []
for (var i = 0; i < str.length; ++i) {
if ((units -= 2) < 0) break
c = str.charCodeAt(i)
hi = c >> 8
lo = c % 256
byteArray.push(lo)
byteArray.push(hi)
}
return byteArray
}
function base64ToBytes (str) {
return base64.toByteArray(base64clean(str))
}
function blitBuffer (src, dst, offset, length) {
for (var i = 0; i < length; ++i) {
if ((i + offset >= dst.length) || (i >= src.length)) break
dst[i + offset] = src[i]
}
return i
}
function isnan (val) {
return val !== val // eslint-disable-line no-self-compare
}
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(16)))
/***/ }),
/* 709 */
/***/ (function(module, exports, __webpack_require__) {
var isarray = __webpack_require__(710)
/**
* Expose `pathToRegexp`.
*/
module.exports = pathToRegexp
module.exports.parse = parse
module.exports.compile = compile
module.exports.tokensToFunction = tokensToFunction
module.exports.tokensToRegExp = tokensToRegExp
/**
* The main path matching regexp utility.
*
* @type {RegExp}
*/
var PATH_REGEXP = new RegExp([
// Match escaped characters that would otherwise appear in future matches.
// This allows the user to escape special characters that won't transform.
'(\\\\.)',
// Match Express-style parameters and un-named parameters with a prefix
// and optional suffixes. Matches appear as:
//
// "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?", undefined]
// "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined, undefined]
// "/*" => ["/", undefined, undefined, undefined, undefined, "*"]
'([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))'
].join('|'), 'g')
/**
* Parse a string for the raw tokens.
*
* @param {string} str
* @param {Object=} options
* @return {!Array}
*/
function parse (str, options) {
var tokens = []
var key = 0
var index = 0
var path = ''
var defaultDelimiter = options && options.delimiter || '/'
var res
while ((res = PATH_REGEXP.exec(str)) != null) {
var m = res[0]
var escaped = res[1]
var offset = res.index
path += str.slice(index, offset)
index = offset + m.length
// Ignore already escaped sequences.
if (escaped) {
path += escaped[1]
continue
}
var next = str[index]
var prefix = res[2]
var name = res[3]
var capture = res[4]
var group = res[5]
var modifier = res[6]
var asterisk = res[7]
// Push the current path onto the tokens.
if (path) {
tokens.push(path)
path = ''
}
var partial = prefix != null && next != null && next !== prefix
var repeat = modifier === '+' || modifier === '*'
var optional = modifier === '?' || modifier === '*'
var delimiter = res[2] || defaultDelimiter
var pattern = capture || group
tokens.push({
name: name || key++,
prefix: prefix || '',
delimiter: delimiter,
optional: optional,
repeat: repeat,
partial: partial,
asterisk: !!asterisk,
pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?')
})
}
// Match any characters still remaining.
if (index < str.length) {
path += str.substr(index)
}
// If the path exists, push it onto the end.
if (path) {
tokens.push(path)
}
return tokens
}
/**
* Compile a string to a template function for the path.
*
* @param {string} str
* @param {Object=} options
* @return {!function(Object=, Object=)}
*/
function compile (str, options) {
return tokensToFunction(parse(str, options))
}
/**
* Prettier encoding of URI path segments.
*
* @param {string}
* @return {string}
*/
function encodeURIComponentPretty (str) {
return encodeURI(str).replace(/[\/?#]/g, function (c) {
return '%' + c.charCodeAt(0).toString(16).toUpperCase()
})
}
/**
* Encode the asterisk parameter. Similar to `pretty`, but allows slashes.
*
* @param {string}
* @return {string}
*/
function encodeAsterisk (str) {
return encodeURI(str).replace(/[?#]/g, function (c) {
return '%' + c.charCodeAt(0).toString(16).toUpperCase()
})
}
/**
* Expose a method for transforming tokens into the path function.
*/
function tokensToFunction (tokens) {
// Compile all the tokens into regexps.
var matches = new Array(tokens.length)
// Compile all the patterns before compilation.
for (var i = 0; i < tokens.length; i++) {
if (typeof tokens[i] === 'object') {
matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$')
}
}
return function (obj, opts) {
var path = ''
var data = obj || {}
var options = opts || {}
var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent
for (var i = 0; i < tokens.length; i++) {
var token = tokens[i]
if (typeof token === 'string') {
path += token
continue
}
var value = data[token.name]
var segment
if (value == null) {
if (token.optional) {
// Prepend partial segment prefixes.
if (token.partial) {
path += token.prefix
}
continue
} else {
throw new TypeError('Expected "' + token.name + '" to be defined')
}
}
if (isarray(value)) {
if (!token.repeat) {
throw new TypeError('Expected "' + token.name + '" to not repeat, but received `' + JSON.stringify(value) + '`')
}
if (value.length === 0) {
if (token.optional) {
continue
} else {
throw new TypeError('Expected "' + token.name + '" to not be empty')
}
}
for (var j = 0; j < value.length; j++) {
segment = encode(value[j])
if (!matches[i].test(segment)) {
throw new TypeError('Expected all "' + token.name + '" to match "' + token.pattern + '", but received `' + JSON.stringify(segment) + '`')
}
path += (j === 0 ? token.prefix : token.delimiter) + segment
}
continue
}
segment = token.asterisk ? encodeAsterisk(value) : encode(value)
if (!matches[i].test(segment)) {
throw new TypeError('Expected "' + token.name + '" to match "' + token.pattern + '", but received "' + segment + '"')
}
path += token.prefix + segment
}
return path
}
}
/**
* Escape a regular expression string.
*
* @param {string} str
* @return {string}
*/
function escapeString (str) {
return str.replace(/([.+*?=^!:${}()[\]|\/\\])/g, '\\$1')
}
/**
* Escape the capturing group by escaping special characters and meaning.
*
* @param {string} group
* @return {string}
*/
function escapeGroup (group) {
return group.replace(/([=!:$\/()])/g, '\\$1')
}
/**
* Attach the keys as a property of the regexp.
*
* @param {!RegExp} re
* @param {Array} keys
* @return {!RegExp}
*/
function attachKeys (re, keys) {
re.keys = keys
return re
}
/**
* Get the flags for a regexp from the options.
*
* @param {Object} options
* @return {string}
*/
function flags (options) {
return options.sensitive ? '' : 'i'
}
/**
* Pull out keys from a regexp.
*
* @param {!RegExp} path
* @param {!Array} keys
* @return {!RegExp}
*/
function regexpToRegexp (path, keys) {
// Use a negative lookahead to match only capturing groups.
var groups = path.source.match(/\((?!\?)/g)
if (groups) {
for (var i = 0; i < groups.length; i++) {
keys.push({
name: i,
prefix: null,
delimiter: null,
optional: false,
repeat: false,
partial: false,
asterisk: false,
pattern: null
})
}
}
return attachKeys(path, keys)
}
/**
* Transform an array into a regexp.
*
* @param {!Array} path
* @param {Array} keys
* @param {!Object} options
* @return {!RegExp}
*/
function arrayToRegexp (path, keys, options) {
var parts = []
for (var i = 0; i < path.length; i++) {
parts.push(pathToRegexp(path[i], keys, options).source)
}
var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options))
return attachKeys(regexp, keys)
}
/**
* Create a path regexp from string input.
*
* @param {string} path
* @param {!Array} keys
* @param {!Object} options
* @return {!RegExp}
*/
function stringToRegexp (path, keys, options) {
return tokensToRegExp(parse(path, options), keys, options)
}
/**
* Expose a function for taking tokens and returning a RegExp.
*
* @param {!Array} tokens
* @param {(Array|Object)=} keys
* @param {Object=} options
* @return {!RegExp}
*/
function tokensToRegExp (tokens, keys, options) {
if (!isarray(keys)) {
options = /** @type {!Object} */ (keys || options)
keys = []
}
options = options || {}
var strict = options.strict
var end = options.end !== false
var route = ''
// Iterate over the tokens and create our regexp string.
for (var i = 0; i < tokens.length; i++) {
var token = tokens[i]
if (typeof token === 'string') {
route += escapeString(token)
} else {
var prefix = escapeString(token.prefix)
var capture = '(?:' + token.pattern + ')'
keys.push(token)
if (token.repeat) {
capture += '(?:' + prefix + capture + ')*'
}
if (token.optional) {
if (!token.partial) {
capture = '(?:' + prefix + '(' + capture + '))?'
} else {
capture = prefix + '(' + capture + ')?'
}
} else {
capture = prefix + '(' + capture + ')'
}
route += capture
}
}
var delimiter = escapeString(options.delimiter || '/')
var endsWithDelimiter = route.slice(-delimiter.length) === delimiter
// In non-strict mode we allow a slash at the end of match. If the path to
// match already ends with a slash, we remove it for consistency. The slash
// is valid at the end of a path match, not in the middle. This is important
// in non-ending mode, where "/test/" shouldn't match "/test//route".
if (!strict) {
route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?'
}
if (end) {
route += '$'
} else {
// In non-ending mode, we need the capturing groups to match as much as
// possible by using a positive lookahead to the end or next path segment.
route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)'
}
return attachKeys(new RegExp('^' + route, flags(options)), keys)
}
/**
* Normalize the given path string, returning a regular expression.
*
* An empty array can be passed in for the keys, which will hold the
* placeholder key descriptions. For example, using `/user/:id`, `keys` will
* contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.
*
* @param {(string|RegExp|Array)} path
* @param {(Array|Object)=} keys
* @param {Object=} options
* @return {!RegExp}
*/
function pathToRegexp (path, keys, options) {
if (!isarray(keys)) {
options = /** @type {!Object} */ (keys || options)
keys = []
}
options = options || {}
if (path instanceof RegExp) {
return regexpToRegexp(path, /** @type {!Array} */ (keys))
}
if (isarray(path)) {
return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options)
}
return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options)
}
/***/ }),
/* 710 */
/***/ (function(module, exports) {
module.exports = Array.isArray || function (arr) {
return Object.prototype.toString.call(arr) == '[object Array]';
};
/***/ }),
/* 711 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*/
if (false) {
var invariant = require('fbjs/lib/invariant');
var warning = require('fbjs/lib/warning');
var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');
var loggedTypeFailures = {};
}
/**
* Assert that the values match with the type specs.
* Error messages are memorized and will only be shown once.
*
* @param {object} typeSpecs Map of name to a ReactPropType
* @param {object} values Runtime values that need to be type-checked
* @param {string} location e.g. "prop", "context", "child context"
* @param {string} componentName Name of the component for error messages.
* @param {?Function} getStack Returns the component stack.
* @private
*/
function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
if (false) {
for (var typeSpecName in typeSpecs) {
if (typeSpecs.hasOwnProperty(typeSpecName)) {
var error;
// Prop type validation may throw. In case they do, we don't want to
// fail the render phase where it didn't fail before. So we log it.
// After these have been cleaned up, we'll let them throw.
try {
// This is intentionally an invariant that gets caught. It's the same
// behavior as without this statement except with a better message.
invariant(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', componentName || 'React class', location, typeSpecName);
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
} catch (ex) {
error = ex;
}
warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error);
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
// Only monitor this failure once because there tends to be a lot of the
// same error.
loggedTypeFailures[error.message] = true;
var stack = getStack ? getStack() : '';
warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '');
}
}
}
}
}
module.exports = checkPropTypes;
/***/ }),
/* 712 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*/
var emptyFunction = __webpack_require__(17);
var invariant = __webpack_require__(2);
var ReactPropTypesSecret = __webpack_require__(268);
module.exports = function() {
function shim(props, propName, componentName, location, propFullName, secret) {
if (secret === ReactPropTypesSecret) {
// It is still safe when called from React.
return;
}
invariant(
false,
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
'Use PropTypes.checkPropTypes() to call them. ' +
'Read more at http://fb.me/use-check-prop-types'
);
};
shim.isRequired = shim;
function getShim() {
return shim;
};
// Important!
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
var ReactPropTypes = {
array: shim,
bool: shim,
func: shim,
number: shim,
object: shim,
string: shim,
symbol: shim,
any: shim,
arrayOf: getShim,
element: shim,
instanceOf: getShim,
node: shim,
objectOf: getShim,
oneOf: getShim,
oneOfType: getShim,
shape: getShim
};
ReactPropTypes.checkPropTypes = emptyFunction;
ReactPropTypes.PropTypes = ReactPropTypes;
return ReactPropTypes;
};
/***/ }),
/* 713 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*/
var emptyFunction = __webpack_require__(17);
var invariant = __webpack_require__(2);
var warning = __webpack_require__(5);
var ReactPropTypesSecret = __webpack_require__(268);
var checkPropTypes = __webpack_require__(711);
module.exports = function(isValidElement, throwOnDirectAccess) {
/* global Symbol */
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
/**
* Returns the iterator method function contained on the iterable object.
*
* Be sure to invoke the function with the iterable as context:
*
* var iteratorFn = getIteratorFn(myIterable);
* if (iteratorFn) {
* var iterator = iteratorFn.call(myIterable);
* ...
* }
*
* @param {?object} maybeIterable
* @return {?function}
*/
function getIteratorFn(maybeIterable) {
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
if (typeof iteratorFn === 'function') {
return iteratorFn;
}
}
/**
* Collection of methods that allow declaration and validation of props that are
* supplied to React components. Example usage:
*
* var Props = require('ReactPropTypes');
* var MyArticle = React.createClass({
* propTypes: {
* // An optional string prop named "description".
* description: Props.string,
*
* // A required enum prop named "category".
* category: Props.oneOf(['News','Photos']).isRequired,
*
* // A prop named "dialog" that requires an instance of Dialog.
* dialog: Props.instanceOf(Dialog).isRequired
* },
* render: function() { ... }
* });
*
* A more formal specification of how these methods are used:
*
* type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
* decl := ReactPropTypes.{type}(.isRequired)?
*
* Each and every declaration produces a function with the same signature. This
* allows the creation of custom validation functions. For example:
*
* var MyLink = React.createClass({
* propTypes: {
* // An optional string or URI prop named "href".
* href: function(props, propName, componentName) {
* var propValue = props[propName];
* if (propValue != null && typeof propValue !== 'string' &&
* !(propValue instanceof URI)) {
* return new Error(
* 'Expected a string or an URI for ' + propName + ' in ' +
* componentName
* );
* }
* }
* },
* render: function() {...}
* });
*
* @internal
*/
var ANONYMOUS = '<<anonymous>>';
// Important!
// Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
var ReactPropTypes = {
array: createPrimitiveTypeChecker('array'),
bool: createPrimitiveTypeChecker('boolean'),
func: createPrimitiveTypeChecker('function'),
number: createPrimitiveTypeChecker('number'),
object: createPrimitiveTypeChecker('object'),
string: createPrimitiveTypeChecker('string'),
symbol: createPrimitiveTypeChecker('symbol'),
any: createAnyTypeChecker(),
arrayOf: createArrayOfTypeChecker,
element: createElementTypeChecker(),
instanceOf: createInstanceTypeChecker,
node: createNodeChecker(),
objectOf: createObjectOfTypeChecker,
oneOf: createEnumTypeChecker,
oneOfType: createUnionTypeChecker,
shape: createShapeTypeChecker
};
/**
* 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 (false) {
var manualPropTypeCallCache = {};
var manualPropTypeWarningCount = 0;
}
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
componentName = componentName || ANONYMOUS;
propFullName = propFullName || propName;
if (secret !== ReactPropTypesSecret) {
if (throwOnDirectAccess) {
// New behavior only for users of `prop-types` package
invariant(
false,
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
'Use `PropTypes.checkPropTypes()` to call them. ' +
'Read more at http://fb.me/use-check-prop-types'
);
} else if (false) {
// Old behavior for people using React.PropTypes
var cacheKey = componentName + ':' + propName;
if (
!manualPropTypeCallCache[cacheKey] &&
// Avoid spamming the console because they are often not actionable except for lib authors
manualPropTypeWarningCount < 3
) {
warning(
false,
'You are manually calling a React.PropTypes validation ' +
'function for the `%s` prop on `%s`. This is deprecated ' +
'and will throw in the standalone `prop-types` package. ' +
'You may be seeing this warning due to a third-party PropTypes ' +
'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.',
propFullName,
componentName
);
manualPropTypeCallCache[cacheKey] = true;
manualPropTypeWarningCount++;
}
}
}
if (props[propName] == null) {
if (isRequired) {
if (props[propName] === null) {
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
}
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
}
return null;
} else {
return validate(props, propName, componentName, location, propFullName);
}
}
var chainedCheckType = checkType.bind(null, false);
chainedCheckType.isRequired = checkType.bind(null, true);
return chainedCheckType;
}
function createPrimitiveTypeChecker(expectedType) {
function validate(props, propName, componentName, location, propFullName, secret) {
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== expectedType) {
// `propValue` being instance of, say, date/regexp, pass the 'object'
// check, but we can offer a more precise error message here rather than
// 'of type `object`'.
var preciseType = getPreciseType(propValue);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createAnyTypeChecker() {
return createChainableTypeChecker(emptyFunction.thatReturnsNull);
}
function createArrayOfTypeChecker(typeChecker) {
function validate(props, propName, componentName, location, propFullName) {
if (typeof typeChecker !== 'function') {
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
}
var propValue = props[propName];
if (!Array.isArray(propValue)) {
var propType = getPropType(propValue);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
}
for (var i = 0; i < propValue.length; i++) {
var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
if (error instanceof Error) {
return error;
}
}
return null;
}
return createChainableTypeChecker(validate);
}
function createElementTypeChecker() {
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
if (!isValidElement(propValue)) {
var propType = getPropType(propValue);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createInstanceTypeChecker(expectedClass) {
function validate(props, propName, componentName, location, propFullName) {
if (!(props[propName] instanceof expectedClass)) {
var expectedClassName = expectedClass.name || ANONYMOUS;
var actualClassName = getClassName(props[propName]);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createEnumTypeChecker(expectedValues) {
if (!Array.isArray(expectedValues)) {
false ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0;
return emptyFunction.thatReturnsNull;
}
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
for (var i = 0; i < expectedValues.length; i++) {
if (is(propValue, expectedValues[i])) {
return null;
}
}
var valuesString = JSON.stringify(expectedValues);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
}
return createChainableTypeChecker(validate);
}
function createObjectOfTypeChecker(typeChecker) {
function validate(props, propName, componentName, location, propFullName) {
if (typeof typeChecker !== 'function') {
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
}
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== 'object') {
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
}
for (var key in propValue) {
if (propValue.hasOwnProperty(key)) {
var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
if (error instanceof Error) {
return error;
}
}
}
return null;
}
return createChainableTypeChecker(validate);
}
function createUnionTypeChecker(arrayOfTypeCheckers) {
if (!Array.isArray(arrayOfTypeCheckers)) {
false ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
return emptyFunction.thatReturnsNull;
}
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
var checker = arrayOfTypeCheckers[i];
if (typeof checker !== 'function') {
warning(
false,
'Invalid argument supplid to oneOfType. Expected an array of check functions, but ' +
'received %s at index %s.',
getPostfixForTypeWarning(checker),
i
);
return emptyFunction.thatReturnsNull;
}
}
function validate(props, propName, componentName, location, propFullName) {
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
var checker = arrayOfTypeCheckers[i];
if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {
return null;
}
}
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
}
return createChainableTypeChecker(validate);
}
function createNodeChecker() {
function validate(props, propName, componentName, location, propFullName) {
if (!isNode(props[propName])) {
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createShapeTypeChecker(shapeTypes) {
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== 'object') {
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
}
for (var key in shapeTypes) {
var checker = shapeTypes[key];
if (!checker) {
continue;
}
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
if (error) {
return error;
}
}
return null;
}
return createChainableTypeChecker(validate);
}
function isNode(propValue) {
switch (typeof propValue) {
case 'number':
case 'string':
case 'undefined':
return true;
case 'boolean':
return !propValue;
case 'object':
if (Array.isArray(propValue)) {
return propValue.every(isNode);
}
if (propValue === null || isValidElement(propValue)) {
return true;
}
var iteratorFn = getIteratorFn(propValue);
if (iteratorFn) {
var iterator = iteratorFn.call(propValue);
var step;
if (iteratorFn !== propValue.entries) {
while (!(step = iterator.next()).done) {
if (!isNode(step.value)) {
return false;
}
}
} else {
// Iterator will provide entry [k,v] tuples rather than values.
while (!(step = iterator.next()).done) {
var entry = step.value;
if (entry) {
if (!isNode(entry[1])) {
return false;
}
}
}
}
} else {
return false;
}
return true;
default:
return false;
}
}
function isSymbol(propType, propValue) {
// Native Symbol.
if (propType === 'symbol') {
return true;
}
// 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
if (propValue['@@toStringTag'] === 'Symbol') {
return true;
}
// Fallback for non-spec compliant Symbols which are polyfilled.
if (typeof Symbol === 'function' && propValue instanceof Symbol) {
return true;
}
return false;
}
// Equivalent of `typeof` but with special handling for array and regexp.
function getPropType(propValue) {
var propType = typeof propValue;
if (Array.isArray(propValue)) {
return 'array';
}
if (propValue instanceof RegExp) {
// Old webkits (at least until Android 4.0) return 'function' rather than
// 'object' for typeof a RegExp. We'll normalize this here so that /bla/
// passes PropTypes.object.
return 'object';
}
if (isSymbol(propType, propValue)) {
return 'symbol';
}
return propType;
}
// This handles more types than `getPropType`. Only used for error messages.
// See `createPrimitiveTypeChecker`.
function getPreciseType(propValue) {
if (typeof propValue === 'undefined' || propValue === null) {
return '' + propValue;
}
var propType = getPropType(propValue);
if (propType === 'object') {
if (propValue instanceof Date) {
return 'date';
} else if (propValue instanceof RegExp) {
return 'regexp';
}
}
return propType;
}
// Returns a string that is postfixed to a warning about an invalid type.
// For example, "undefined" or "of type array"
function getPostfixForTypeWarning(value) {
var type = getPreciseType(value);
switch (type) {
case 'array':
case 'object':
return 'an ' + type;
case 'boolean':
case 'date':
case 'regexp':
return 'a ' + type;
default:
return type;
}
}
// Returns class name of the object, if any.
function getClassName(propValue) {
if (!propValue.constructor || !propValue.constructor.name) {
return ANONYMOUS;
}
return propValue.constructor.name;
}
ReactPropTypes.checkPropTypes = checkPropTypes;
ReactPropTypes.PropTypes = ReactPropTypes;
return ReactPropTypes;
};
/***/ }),
/* 714 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _invariant = __webpack_require__(23);
var _invariant2 = _interopRequireDefault(_invariant);
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
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 createBroadcast = function createBroadcast(initialValue) {
var listeners = [];
var currentValue = initialValue;
return {
publish: function publish(value) {
currentValue = value;
listeners.forEach(function (listener) {
return listener(currentValue);
});
},
subscribe: function subscribe(listener) {
listeners.push(listener);
// Publish to this subscriber once immediately.
listener(currentValue);
return function () {
return listeners = listeners.filter(function (item) {
return item !== listener;
});
};
}
};
};
/**
* A <Broadcast> provides a generic way for descendants to "subscribe"
* to some value that changes over time, bypassing any intermediate
* shouldComponentUpdate's in the hierarchy. It puts all subscription
* functions on context.broadcasts, keyed by "channel".
*
* To use it, a subscriber must opt-in to context.broadcasts. See the
* <Subscriber> component for a reference implementation.
*/
var Broadcast = function (_React$Component) {
_inherits(Broadcast, _React$Component);
function Broadcast() {
var _temp, _this, _ret;
_classCallCheck(this, Broadcast);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.broadcast = createBroadcast(_this.props.value), _temp), _possibleConstructorReturn(_this, _ret);
}
Broadcast.prototype.getBroadcastsContext = function getBroadcastsContext() {
var _extends2;
var channel = this.props.channel;
var broadcasts = this.context.broadcasts;
return _extends({}, broadcasts, (_extends2 = {}, _extends2[channel] = this.broadcast.subscribe, _extends2));
};
Broadcast.prototype.getChildContext = function getChildContext() {
return {
broadcasts: this.getBroadcastsContext()
};
};
Broadcast.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
!(this.props.channel === nextProps.channel) ? false ? (0, _invariant2.default)(false, 'You cannot change <Broadcast channel>') : (0, _invariant2.default)(false) : void 0;
if (this.props.value !== nextProps.value) this.broadcast.publish(nextProps.value);
};
Broadcast.prototype.render = function render() {
return _react2.default.Children.only(this.props.children);
};
return Broadcast;
}(_react2.default.Component);
Broadcast.contextTypes = {
broadcasts: _react.PropTypes.object
};
Broadcast.childContextTypes = {
broadcasts: _react.PropTypes.object.isRequired
};
if (false) {
Broadcast.propTypes = {
channel: _react.PropTypes.string.isRequired,
children: _react.PropTypes.node.isRequired,
value: _react.PropTypes.any
};
}
exports.default = Broadcast;
/***/ }),
/* 715 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
var _invariant = __webpack_require__(23);
var _invariant2 = _interopRequireDefault(_invariant);
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
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 <Subscriber> pulls the value for a channel off of context.broadcasts
* and passes it to its children function.
*/
var Subscriber = function (_React$Component) {
_inherits(Subscriber, _React$Component);
function Subscriber() {
var _temp, _this, _ret;
_classCallCheck(this, Subscriber);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = {
value: null
}, _temp), _possibleConstructorReturn(_this, _ret);
}
Subscriber.prototype.componentWillMount = function componentWillMount() {
var _this2 = this;
var channel = this.props.channel;
if (this.context.broadcasts) {
var subscribe = this.context.broadcasts[channel];
!(typeof subscribe === 'function') ? false ? (0, _invariant2.default)(false, '<Subscriber channel="%s"> must be rendered in the context of a <Broadcast channel="%s">', channel, channel) : (0, _invariant2.default)(false) : void 0;
this.unsubscribe = subscribe(function (value) {
// This function will be called once immediately.
_this2.setState({ value: value });
});
}
};
Subscriber.prototype.componentWillUnmount = function componentWillUnmount() {
if (this.unsubscribe) this.unsubscribe();
};
Subscriber.prototype.render = function render() {
return this.props.children(this.state.value);
};
return Subscriber;
}(_react2.default.Component);
Subscriber.contextTypes = {
broadcasts: _react2.default.PropTypes.object
};
if (false) {
Subscriber.propTypes = {
channel: _react.PropTypes.string.isRequired,
children: _react.PropTypes.func.isRequired
};
}
exports.default = Subscriber;
/***/ }),
/* 716 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
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;
/***/ }),
/* 717 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var ReactDOMComponentTree = __webpack_require__(11);
var focusNode = __webpack_require__(215);
var AutoFocusUtils = {
focusDOMComponent: function () {
focusNode(ReactDOMComponentTree.getNodeFromInstance(this));
}
};
module.exports = AutoFocusUtils;
/***/ }),
/* 718 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var EventPropagators = __webpack_require__(74);
var ExecutionEnvironment = __webpack_require__(15);
var FallbackCompositionState = __webpack_require__(724);
var SyntheticCompositionEvent = __webpack_require__(761);
var SyntheticInputEvent = __webpack_require__(764);
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;
/***/ }),
/* 719 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var CSSProperty = __webpack_require__(269);
var ExecutionEnvironment = __webpack_require__(15);
var ReactInstrumentation = __webpack_require__(25);
var camelizeStyleName = __webpack_require__(429);
var dangerousStyleValue = __webpack_require__(770);
var hyphenateStyleName = __webpack_require__(436);
var memoizeStringOnly = __webpack_require__(439);
var warning = __webpack_require__(5);
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 (false) {
// '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 (false) {
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 (false) {
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 (false) {
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;
/***/ }),
/* 720 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var EventPluginHub = __webpack_require__(73);
var EventPropagators = __webpack_require__(74);
var ExecutionEnvironment = __webpack_require__(15);
var ReactDOMComponentTree = __webpack_require__(11);
var ReactUpdates = __webpack_require__(31);
var SyntheticEvent = __webpack_require__(32);
var getEventTarget = __webpack_require__(173);
var isEventSupported = __webpack_require__(174);
var isTextInputElement = __webpack_require__(286);
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;
}
}
function handleControlledInputBlur(inst, node) {
// TODO: In IE, inst is occasionally null. Why?
if (inst == null) {
return;
}
// Fiber and ReactDOM keep wrapper state in separate places
var state = inst._wrapperState || node._wrapperState;
if (!state || !state.controlled || node.type !== 'number') {
return;
}
// If controlled, assign the value attribute to the current value on blur
var value = '' + node.value;
if (node.getAttribute('value') !== value) {
node.setAttribute('value', value);
}
}
/**
* 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);
}
// When blurring, set the value attribute for number inputs
if (topLevelType === 'topBlur') {
handleControlledInputBlur(targetInst, targetNode);
}
}
};
module.exports = ChangeEventPlugin;
/***/ }),
/* 721 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var _prodInvariant = __webpack_require__(7);
var DOMLazyTree = __webpack_require__(56);
var ExecutionEnvironment = __webpack_require__(15);
var createNodesFromMarkup = __webpack_require__(432);
var emptyFunction = __webpack_require__(17);
var invariant = __webpack_require__(2);
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 ? false ? 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 ? false ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Missing markup.') : _prodInvariant('57') : void 0;
!(oldChild.nodeName !== 'HTML') ? false ? 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;
/***/ }),
/* 722 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
/**
* 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;
/***/ }),
/* 723 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var EventPropagators = __webpack_require__(74);
var ReactDOMComponentTree = __webpack_require__(11);
var SyntheticMouseEvent = __webpack_require__(105);
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;
/***/ }),
/* 724 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var _assign = __webpack_require__(9);
var PooledClass = __webpack_require__(46);
var getTextContentAccessor = __webpack_require__(284);
/**
* 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;
/***/ }),
/* 725 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var DOMProperty = __webpack_require__(57);
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: {},
DOMMutationMethods: {
value: function (node, value) {
if (value == null) {
return node.removeAttribute('value');
}
// Number inputs get special treatment due to some edge cases in
// Chrome. Let everything else assign the value attribute as normal.
// https://github.com/facebook/react/issues/7253#issuecomment-236074326
if (node.type !== 'number' || node.hasAttribute('value') === false) {
node.setAttribute('value', '' + value);
} else if (node.validity && !node.validity.badInput && node.ownerDocument.activeElement !== node) {
// Don't assign an attribute if validation reports bad
// input. Chrome will clear the value. Additionally, don't
// operate on inputs that have focus, otherwise Chrome might
// strip off trailing decimal places and cause the user's
// cursor position to jump to the beginning of the input.
//
// In ReactDOMInput, we have an onBlur event that will trigger
// this function again when focus is lost.
node.setAttribute('value', '' + value);
}
}
}
};
module.exports = HTMLDOMPropertyConfig;
/***/ }),
/* 726 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* 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.
*
*/
var ReactReconciler = __webpack_require__(58);
var instantiateReactComponent = __webpack_require__(285);
var KeyEscapeUtils = __webpack_require__(165);
var shouldUpdateReactComponent = __webpack_require__(175);
var traverseAllChildren = __webpack_require__(288);
var warning = __webpack_require__(5);
var ReactComponentTreeHook;
if (typeof process !== 'undefined' && __webpack_require__.i({"NODE_ENV":"production"}) && "production" === '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__(306);
}
function instantiateChild(childInstances, child, name, selfDebugID) {
// We found a component instance.
var keyUnique = childInstances[name] === undefined;
if (false) {
if (!ReactComponentTreeHook) {
ReactComponentTreeHook = require('react/lib/ReactComponentTreeHook');
}
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 (false) {
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__(45)))
/***/ }),
/* 727 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var DOMChildrenOperations = __webpack_require__(161);
var ReactDOMIDOperations = __webpack_require__(734);
/**
* 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;
/***/ }),
/* 728 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var _prodInvariant = __webpack_require__(7),
_assign = __webpack_require__(9);
var React = __webpack_require__(60);
var ReactComponentEnvironment = __webpack_require__(167);
var ReactCurrentOwner = __webpack_require__(33);
var ReactErrorUtils = __webpack_require__(168);
var ReactInstanceMap = __webpack_require__(75);
var ReactInstrumentation = __webpack_require__(25);
var ReactNodeTypes = __webpack_require__(279);
var ReactReconciler = __webpack_require__(58);
if (false) {
var checkReactTypeSpec = require('./checkReactTypeSpec');
}
var emptyObject = __webpack_require__(67);
var invariant = __webpack_require__(2);
var shallowEqual = __webpack_require__(126);
var shouldUpdateReactComponent = __webpack_require__(175);
var warning = __webpack_require__(5);
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 (false) {
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 (false) {
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)) ? false ? 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 (false) {
// 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 (false) {
// 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)) ? false ? 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 (false) {
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 (false) {
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 (false) {
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 (false) {
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 (false) {
debugID = this._debugID;
}
if (inst.componentWillMount) {
if (false) {
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 (false) {
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 (false) {
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 (false) {
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 (false) {
ReactInstrumentation.debugTool.onBeginProcessingChildContext();
try {
childContext = inst.getChildContext();
} finally {
ReactInstrumentation.debugTool.onEndProcessingChildContext();
}
} else {
childContext = inst.getChildContext();
}
}
if (childContext) {
!(typeof Component.childContextTypes === 'object') ? false ? invariant(false, '%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().', this.getName() || 'ReactCompositeComponent') : _prodInvariant('107', this.getName() || 'ReactCompositeComponent') : void 0;
if (false) {
this._checkContextTypes(Component.childContextTypes, childContext, 'child context');
}
for (var name in childContext) {
!(name in Component.childContextTypes) ? false ? 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 (false) {
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) ? false ? 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 (false) {
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 (false) {
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 (false) {
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 (false) {
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 (false) {
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 (false) {
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 (false) {
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 (false) {
renderedElement = measureLifeCyclePerf(function () {
return inst.render();
}, this._debugID, 'render');
} else {
renderedElement = inst.render();
}
if (false) {
// 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 ("production" !== '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)) ? false ? 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) ? false ? invariant(false, 'Stateless function components cannot have refs.') : _prodInvariant('110') : void 0;
var publicComponentInstance = component.getPublicInstance();
if (false) {
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;
/***/ }),
/* 729 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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__*/
var ReactDOMComponentTree = __webpack_require__(11);
var ReactDefaultInjection = __webpack_require__(742);
var ReactMount = __webpack_require__(278);
var ReactReconciler = __webpack_require__(58);
var ReactUpdates = __webpack_require__(31);
var ReactVersion = __webpack_require__(755);
var findDOMNode = __webpack_require__(771);
var getHostComponentFromComposite = __webpack_require__(283);
var renderSubtreeIntoContainer = __webpack_require__(778);
var warning = __webpack_require__(5);
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 (false) {
var ExecutionEnvironment = require('fbjs/lib/ExecutionEnvironment');
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 (false) {
var ReactInstrumentation = require('./ReactInstrumentation');
var ReactDOMUnknownPropertyHook = require('./ReactDOMUnknownPropertyHook');
var ReactDOMNullInputValuePropHook = require('./ReactDOMNullInputValuePropHook');
var ReactDOMInvalidARIAHook = require('./ReactDOMInvalidARIAHook');
ReactInstrumentation.debugTool.addHook(ReactDOMUnknownPropertyHook);
ReactInstrumentation.debugTool.addHook(ReactDOMNullInputValuePropHook);
ReactInstrumentation.debugTool.addHook(ReactDOMInvalidARIAHook);
}
module.exports = ReactDOM;
/***/ }),
/* 730 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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 */
var _prodInvariant = __webpack_require__(7),
_assign = __webpack_require__(9);
var AutoFocusUtils = __webpack_require__(717);
var CSSPropertyOperations = __webpack_require__(719);
var DOMLazyTree = __webpack_require__(56);
var DOMNamespaces = __webpack_require__(162);
var DOMProperty = __webpack_require__(57);
var DOMPropertyOperations = __webpack_require__(271);
var EventPluginHub = __webpack_require__(73);
var EventPluginRegistry = __webpack_require__(163);
var ReactBrowserEventEmitter = __webpack_require__(104);
var ReactDOMComponentFlags = __webpack_require__(272);
var ReactDOMComponentTree = __webpack_require__(11);
var ReactDOMInput = __webpack_require__(735);
var ReactDOMOption = __webpack_require__(736);
var ReactDOMSelect = __webpack_require__(273);
var ReactDOMTextarea = __webpack_require__(739);
var ReactInstrumentation = __webpack_require__(25);
var ReactMultiChild = __webpack_require__(748);
var ReactServerRenderingTransaction = __webpack_require__(753);
var emptyFunction = __webpack_require__(17);
var escapeTextContentForBrowser = __webpack_require__(107);
var invariant = __webpack_require__(2);
var isEventSupported = __webpack_require__(174);
var shallowEqual = __webpack_require__(126);
var validateDOMNesting = __webpack_require__(176);
var warning = __webpack_require__(5);
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;
false ? 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) ? false ? 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) ? false ? invariant(false, 'Can only set one of `children` or `props.dangerouslySetInnerHTML`.') : _prodInvariant('60') : void 0;
!(typeof props.dangerouslySetInnerHTML === 'object' && HTML in props.dangerouslySetInnerHTML) ? false ? 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 (false) {
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') ? false ? 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 (false) {
// 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 (false) {
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 ? false ? invariant(false, 'Must be mounted to trap events') : _prodInvariant('63') : void 0;
var node = getNode(inst);
!node ? false ? 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) ? false ? 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 (false) {
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 (false) {
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 (false) {
// 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 (false) {
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 (false) {
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 (false) {
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 (false) {
ReactInstrumentation.debugTool.onSetChildren(this._debugID, []);
}
}
if (nextContent != null) {
if (lastContent !== nextContent) {
this.updateTextContent('' + nextContent);
if (false) {
setAndValidateContentChildDev.call(this, nextContent);
}
}
} else if (nextHtml != null) {
if (lastHtml !== nextHtml) {
this.updateMarkup('' + nextHtml);
}
if (false) {
ReactInstrumentation.debugTool.onSetChildren(this._debugID, []);
}
} else if (nextChildren != null) {
if (false) {
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 ? false ? 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 (false) {
setAndValidateContentChildDev.call(this, null);
}
},
getPublicInstance: function () {
return getNode(this);
}
};
_assign(ReactDOMComponent.prototype, ReactDOMComponent.Mixin, ReactMultiChild.Mixin);
module.exports = ReactDOMComponent;
/***/ }),
/* 731 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var validateDOMNesting = __webpack_require__(176);
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 (false) {
info._ancestorInfo = node ? validateDOMNesting.updatedAncestorInfo(null, info._tag, null) : null;
}
return info;
}
module.exports = ReactDOMContainerInfo;
/***/ }),
/* 732 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var _assign = __webpack_require__(9);
var DOMLazyTree = __webpack_require__(56);
var ReactDOMComponentTree = __webpack_require__(11);
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;
/***/ }),
/* 733 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var ReactDOMFeatureFlags = {
useCreateElement: true,
useFiber: false
};
module.exports = ReactDOMFeatureFlags;
/***/ }),
/* 734 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var DOMChildrenOperations = __webpack_require__(161);
var ReactDOMComponentTree = __webpack_require__(11);
/**
* 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;
/***/ }),
/* 735 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var _prodInvariant = __webpack_require__(7),
_assign = __webpack_require__(9);
var DOMPropertyOperations = __webpack_require__(271);
var LinkedValueUtils = __webpack_require__(166);
var ReactDOMComponentTree = __webpack_require__(11);
var ReactUpdates = __webpack_require__(31);
var invariant = __webpack_require__(2);
var warning = __webpack_require__(5);
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 (false) {
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),
controlled: isControlled(props)
};
},
updateWrapper: function (inst) {
var props = inst._currentElement.props;
if (false) {
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) {
if (value === 0 && node.value === '') {
node.value = '0';
// Note: IE9 reports a number inputs as 'text', so check props instead.
} else if (props.type === 'number') {
// Simulate `input.valueAsNumber`. IE9 does not support it
var valueAsNumber = parseFloat(node.value, 10) || 0;
// eslint-disable-next-line
if (value != valueAsNumber) {
// Cast `value` to a string to ensure the value is set correctly. While
// browsers typically do this as necessary, jsdom doesn't.
node.value = '' + value;
}
// eslint-disable-next-line
} else if (value != node.value) {
// Cast `value` to a string to ensure the value is set correctly. While
// browsers typically do this as necessary, jsdom doesn't.
node.value = '' + value;
}
} 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 ? false ? 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;
/***/ }),
/* 736 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var _assign = __webpack_require__(9);
var React = __webpack_require__(60);
var ReactDOMComponentTree = __webpack_require__(11);
var ReactDOMSelect = __webpack_require__(273);
var warning = __webpack_require__(5);
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;
false ? 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 (false) {
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;
/***/ }),
/* 737 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var ExecutionEnvironment = __webpack_require__(15);
var getNodeForCharacterOffset = __webpack_require__(775);
var getTextContentAccessor = __webpack_require__(284);
/**
* 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;
/***/ }),
/* 738 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var _prodInvariant = __webpack_require__(7),
_assign = __webpack_require__(9);
var DOMChildrenOperations = __webpack_require__(161);
var DOMLazyTree = __webpack_require__(56);
var ReactDOMComponentTree = __webpack_require__(11);
var escapeTextContentForBrowser = __webpack_require__(107);
var invariant = __webpack_require__(2);
var validateDOMNesting = __webpack_require__(176);
/**
* 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 (false) {
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) ? false ? 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;
/***/ }),
/* 739 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var _prodInvariant = __webpack_require__(7),
_assign = __webpack_require__(9);
var LinkedValueUtils = __webpack_require__(166);
var ReactDOMComponentTree = __webpack_require__(11);
var ReactUpdates = __webpack_require__(31);
var invariant = __webpack_require__(2);
var warning = __webpack_require__(5);
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) ? false ? 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 (false) {
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 (false) {
process.env.NODE_ENV !== 'production' ? warning(false, 'Use the `defaultValue` or `value` props instead of setting ' + 'children on <textarea>.') : void 0;
}
!(defaultValue == null) ? false ? invariant(false, 'If you supply `defaultValue` on a <textarea>, do not pass children.') : _prodInvariant('92') : void 0;
if (Array.isArray(children)) {
!(children.length <= 1) ? false ? 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;
/***/ }),
/* 740 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var _prodInvariant = __webpack_require__(7);
var invariant = __webpack_require__(2);
/**
* Return the lowest common ancestor of A and B, or null if they are in
* different trees.
*/
function getLowestCommonAncestor(instA, instB) {
!('_hostNode' in instA) ? false ? invariant(false, 'getNodeFromInstance: Invalid argument.') : _prodInvariant('33') : void 0;
!('_hostNode' in instB) ? false ? 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) ? false ? invariant(false, 'isAncestor: Invalid argument.') : _prodInvariant('35') : void 0;
!('_hostNode' in instB) ? false ? 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) ? false ? 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
};
/***/ }),
/* 741 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var _assign = __webpack_require__(9);
var ReactUpdates = __webpack_require__(31);
var Transaction = __webpack_require__(106);
var emptyFunction = __webpack_require__(17);
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;
/***/ }),
/* 742 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var ARIADOMPropertyConfig = __webpack_require__(716);
var BeforeInputEventPlugin = __webpack_require__(718);
var ChangeEventPlugin = __webpack_require__(720);
var DefaultEventPluginOrder = __webpack_require__(722);
var EnterLeaveEventPlugin = __webpack_require__(723);
var HTMLDOMPropertyConfig = __webpack_require__(725);
var ReactComponentBrowserEnvironment = __webpack_require__(727);
var ReactDOMComponent = __webpack_require__(730);
var ReactDOMComponentTree = __webpack_require__(11);
var ReactDOMEmptyComponent = __webpack_require__(732);
var ReactDOMTreeTraversal = __webpack_require__(740);
var ReactDOMTextComponent = __webpack_require__(738);
var ReactDefaultBatchingStrategy = __webpack_require__(741);
var ReactEventListener = __webpack_require__(745);
var ReactInjection = __webpack_require__(746);
var ReactReconcileTransaction = __webpack_require__(751);
var SVGDOMPropertyConfig = __webpack_require__(756);
var SelectEventPlugin = __webpack_require__(757);
var SimpleEventPlugin = __webpack_require__(758);
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
};
/***/ }),
/* 743 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*
*/
// 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;
/***/ }),
/* 744 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var EventPluginHub = __webpack_require__(73);
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;
/***/ }),
/* 745 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var _assign = __webpack_require__(9);
var EventListener = __webpack_require__(214);
var ExecutionEnvironment = __webpack_require__(15);
var PooledClass = __webpack_require__(46);
var ReactDOMComponentTree = __webpack_require__(11);
var ReactUpdates = __webpack_require__(31);
var getEventTarget = __webpack_require__(173);
var getUnboundedScrollPosition = __webpack_require__(434);
/**
* 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;
/***/ }),
/* 746 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var DOMProperty = __webpack_require__(57);
var EventPluginHub = __webpack_require__(73);
var EventPluginUtils = __webpack_require__(164);
var ReactComponentEnvironment = __webpack_require__(167);
var ReactEmptyComponent = __webpack_require__(274);
var ReactBrowserEventEmitter = __webpack_require__(104);
var ReactHostComponent = __webpack_require__(276);
var ReactUpdates = __webpack_require__(31);
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;
/***/ }),
/* 747 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var adler32 = __webpack_require__(769);
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;
/***/ }),
/* 748 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var _prodInvariant = __webpack_require__(7);
var ReactComponentEnvironment = __webpack_require__(167);
var ReactInstanceMap = __webpack_require__(75);
var ReactInstrumentation = __webpack_require__(25);
var ReactCurrentOwner = __webpack_require__(33);
var ReactReconciler = __webpack_require__(58);
var ReactChildReconciler = __webpack_require__(726);
var emptyFunction = __webpack_require__(17);
var flattenChildren = __webpack_require__(772);
var invariant = __webpack_require__(2);
/**
* 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 (false) {
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 (false) {
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 (false) {
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 (false) {
selfDebugID = getDebugID(this);
}
var mountImage = ReactReconciler.mountComponent(child, transaction, this, this._hostContainerInfo, context, selfDebugID);
child._mountIndex = index++;
mountImages.push(mountImage);
}
}
if (false) {
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 ? false ? 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 ? false ? 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 (false) {
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;
/***/ }),
/* 749 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*
*/
var _prodInvariant = __webpack_require__(7);
var invariant = __webpack_require__(2);
/**
* @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) ? false ? 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) ? false ? 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;
/***/ }),
/* 750 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*
*/
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
module.exports = ReactPropTypesSecret;
/***/ }),
/* 751 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var _assign = __webpack_require__(9);
var CallbackQueue = __webpack_require__(270);
var PooledClass = __webpack_require__(46);
var ReactBrowserEventEmitter = __webpack_require__(104);
var ReactInputSelection = __webpack_require__(277);
var ReactInstrumentation = __webpack_require__(25);
var Transaction = __webpack_require__(106);
var ReactUpdateQueue = __webpack_require__(169);
/**
* 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 (false) {
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;
/***/ }),
/* 752 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*
*/
var ReactOwner = __webpack_require__(749);
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;
/***/ }),
/* 753 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var _assign = __webpack_require__(9);
var PooledClass = __webpack_require__(46);
var Transaction = __webpack_require__(106);
var ReactInstrumentation = __webpack_require__(25);
var ReactServerUpdateQueue = __webpack_require__(754);
/**
* 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 (false) {
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;
/***/ }),
/* 754 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*
*/
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var ReactUpdateQueue = __webpack_require__(169);
var warning = __webpack_require__(5);
function warnNoop(publicInstance, callerName) {
if (false) {
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;
/***/ }),
/* 755 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
module.exports = '15.5.4';
/***/ }),
/* 756 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
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;
/***/ }),
/* 757 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var EventPropagators = __webpack_require__(74);
var ExecutionEnvironment = __webpack_require__(15);
var ReactDOMComponentTree = __webpack_require__(11);
var ReactInputSelection = __webpack_require__(277);
var SyntheticEvent = __webpack_require__(32);
var getActiveElement = __webpack_require__(216);
var isTextInputElement = __webpack_require__(286);
var shallowEqual = __webpack_require__(126);
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;
/***/ }),
/* 758 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*
*/
var _prodInvariant = __webpack_require__(7);
var EventListener = __webpack_require__(214);
var EventPropagators = __webpack_require__(74);
var ReactDOMComponentTree = __webpack_require__(11);
var SyntheticAnimationEvent = __webpack_require__(759);
var SyntheticClipboardEvent = __webpack_require__(760);
var SyntheticEvent = __webpack_require__(32);
var SyntheticFocusEvent = __webpack_require__(763);
var SyntheticKeyboardEvent = __webpack_require__(765);
var SyntheticMouseEvent = __webpack_require__(105);
var SyntheticDragEvent = __webpack_require__(762);
var SyntheticTouchEvent = __webpack_require__(766);
var SyntheticTransitionEvent = __webpack_require__(767);
var SyntheticUIEvent = __webpack_require__(76);
var SyntheticWheelEvent = __webpack_require__(768);
var emptyFunction = __webpack_require__(17);
var getEventCharCode = __webpack_require__(171);
var invariant = __webpack_require__(2);
/**
* 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 ? false ? 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;
/***/ }),
/* 759 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var SyntheticEvent = __webpack_require__(32);
/**
* @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;
/***/ }),
/* 760 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var SyntheticEvent = __webpack_require__(32);
/**
* @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;
/***/ }),
/* 761 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var SyntheticEvent = __webpack_require__(32);
/**
* @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;
/***/ }),
/* 762 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var SyntheticMouseEvent = __webpack_require__(105);
/**
* @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;
/***/ }),
/* 763 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var SyntheticUIEvent = __webpack_require__(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;
/***/ }),
/* 764 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var SyntheticEvent = __webpack_require__(32);
/**
* @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;
/***/ }),
/* 765 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var SyntheticUIEvent = __webpack_require__(76);
var getEventCharCode = __webpack_require__(171);
var getEventKey = __webpack_require__(773);
var getEventModifierState = __webpack_require__(172);
/**
* @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;
/***/ }),
/* 766 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var SyntheticUIEvent = __webpack_require__(76);
var getEventModifierState = __webpack_require__(172);
/**
* @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;
/***/ }),
/* 767 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var SyntheticEvent = __webpack_require__(32);
/**
* @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;
/***/ }),
/* 768 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var SyntheticMouseEvent = __webpack_require__(105);
/**
* @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;
/***/ }),
/* 769 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*
*/
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;
/***/ }),
/* 770 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var CSSProperty = __webpack_require__(269);
var warning = __webpack_require__(5);
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 (false) {
// 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;
/***/ }),
/* 771 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var _prodInvariant = __webpack_require__(7);
var ReactCurrentOwner = __webpack_require__(33);
var ReactDOMComponentTree = __webpack_require__(11);
var ReactInstanceMap = __webpack_require__(75);
var getHostComponentFromComposite = __webpack_require__(283);
var invariant = __webpack_require__(2);
var warning = __webpack_require__(5);
/**
* 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 (false) {
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 ? false ? invariant(false, 'findDOMNode was called on an unmounted component.') : _prodInvariant('44') : void 0;
} else {
true ? false ? 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;
/***/ }),
/* 772 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* 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.
*
*
*/
var KeyEscapeUtils = __webpack_require__(165);
var traverseAllChildren = __webpack_require__(288);
var warning = __webpack_require__(5);
var ReactComponentTreeHook;
if (typeof process !== 'undefined' && __webpack_require__.i({"NODE_ENV":"production"}) && "production" === '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__(306);
}
/**
* @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 (false) {
if (!ReactComponentTreeHook) {
ReactComponentTreeHook = require('react/lib/ReactComponentTreeHook');
}
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 (false) {
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__(45)))
/***/ }),
/* 773 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var getEventCharCode = __webpack_require__(171);
/**
* 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;
/***/ }),
/* 774 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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 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;
/***/ }),
/* 775 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
/**
* 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;
/***/ }),
/* 776 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var ExecutionEnvironment = __webpack_require__(15);
/**
* 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;
/***/ }),
/* 777 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var escapeTextContentForBrowser = __webpack_require__(107);
/**
* 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;
/***/ }),
/* 778 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var ReactMount = __webpack_require__(278);
module.exports = ReactMount.renderSubtreeIntoContainer;
/***/ }),
/* 779 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* unused harmony export createProvider */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__utils_PropTypes__ = __webpack_require__(292);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__utils_warning__ = __webpack_require__(177);
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;
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__utils_warning__["a" /* 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.');
}
function createProvider() {
var _Provider$childContex;
var storeKey = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'store';
var subKey = arguments[1];
var subscriptionKey = subKey || storeKey + 'Subscription';
var Provider = function (_Component) {
_inherits(Provider, _Component);
Provider.prototype.getChildContext = function getChildContext() {
var _ref;
return _ref = {}, _ref[storeKey] = this[storeKey], _ref[subscriptionKey] = null, _ref;
};
function Provider(props, context) {
_classCallCheck(this, Provider);
var _this = _possibleConstructorReturn(this, _Component.call(this, props, context));
_this[storeKey] = props.store;
return _this;
}
Provider.prototype.render = function render() {
return __WEBPACK_IMPORTED_MODULE_0_react__["Children"].only(this.props.children);
};
return Provider;
}(__WEBPACK_IMPORTED_MODULE_0_react__["Component"]);
if (false) {
Provider.prototype.componentWillReceiveProps = function (nextProps) {
if (this[storeKey] !== nextProps.store) {
warnAboutReceivingStore();
}
};
}
Provider.propTypes = {
store: __WEBPACK_IMPORTED_MODULE_2__utils_PropTypes__["a" /* storeShape */].isRequired,
children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.element.isRequired
};
Provider.childContextTypes = (_Provider$childContex = {}, _Provider$childContex[storeKey] = __WEBPACK_IMPORTED_MODULE_2__utils_PropTypes__["a" /* storeShape */].isRequired, _Provider$childContex[subscriptionKey] = __WEBPACK_IMPORTED_MODULE_2__utils_PropTypes__["b" /* subscriptionShape */], _Provider$childContex);
Provider.displayName = 'Provider';
return Provider;
}
/* unused harmony default export */ var _unused_webpack_default_export = (createProvider());
/***/ }),
/* 780 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* unused harmony export createConnect */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__ = __webpack_require__(290);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__ = __webpack_require__(787);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__ = __webpack_require__(781);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__ = __webpack_require__(782);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__mergeProps__ = __webpack_require__(783);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__selectorFactory__ = __webpack_require__(784);
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
/*
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 ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__["a" /* default */] : _ref$connectHOC,
_ref$mapStateToPropsF = _ref.mapStateToPropsFactories,
mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__["a" /* default */] : _ref$mapStateToPropsF,
_ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,
mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__["a" /* default */] : _ref$mapDispatchToPro,
_ref$mergePropsFactor = _ref.mergePropsFactories,
mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__["a" /* default */] : _ref$mergePropsFactor,
_ref$selectorFactory = _ref.selectorFactory,
selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__["a" /* 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 ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__["a" /* default */] : _ref2$areOwnPropsEqua,
_ref2$areStatePropsEq = _ref2.areStatePropsEqual,
areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__["a" /* default */] : _ref2$areStatePropsEq,
_ref2$areMergedPropsE = _ref2.areMergedPropsEqual,
areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__["a" /* 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));
};
}
/* harmony default export */ __webpack_exports__["a"] = (createConnect());
/***/ }),
/* 781 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* unused harmony export whenMapDispatchToPropsIsFunction */
/* unused harmony export whenMapDispatchToPropsIsMissing */
/* unused harmony export whenMapDispatchToPropsIsObject */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_redux__ = __webpack_require__(187);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__wrapMapToProps__ = __webpack_require__(291);
function whenMapDispatchToPropsIsFunction(mapDispatchToProps) {
return typeof mapDispatchToProps === 'function' ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__wrapMapToProps__["a" /* wrapMapToPropsFunc */])(mapDispatchToProps, 'mapDispatchToProps') : undefined;
}
function whenMapDispatchToPropsIsMissing(mapDispatchToProps) {
return !mapDispatchToProps ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__wrapMapToProps__["b" /* wrapMapToPropsConstant */])(function (dispatch) {
return { dispatch: dispatch };
}) : undefined;
}
function whenMapDispatchToPropsIsObject(mapDispatchToProps) {
return mapDispatchToProps && typeof mapDispatchToProps === 'object' ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__wrapMapToProps__["b" /* wrapMapToPropsConstant */])(function (dispatch) {
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_redux__["a" /* bindActionCreators */])(mapDispatchToProps, dispatch);
}) : undefined;
}
/* harmony default export */ __webpack_exports__["a"] = ([whenMapDispatchToPropsIsFunction, whenMapDispatchToPropsIsMissing, whenMapDispatchToPropsIsObject]);
/***/ }),
/* 782 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* unused harmony export whenMapStateToPropsIsFunction */
/* unused harmony export whenMapStateToPropsIsMissing */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__wrapMapToProps__ = __webpack_require__(291);
function whenMapStateToPropsIsFunction(mapStateToProps) {
return typeof mapStateToProps === 'function' ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__wrapMapToProps__["a" /* wrapMapToPropsFunc */])(mapStateToProps, 'mapStateToProps') : undefined;
}
function whenMapStateToPropsIsMissing(mapStateToProps) {
return !mapStateToProps ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__wrapMapToProps__["b" /* wrapMapToPropsConstant */])(function () {
return {};
}) : undefined;
}
/* harmony default export */ __webpack_exports__["a"] = ([whenMapStateToPropsIsFunction, whenMapStateToPropsIsMissing]);
/***/ }),
/* 783 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* unused harmony export defaultMergeProps */
/* unused harmony export wrapMergePropsFunc */
/* unused harmony export whenMergePropsIsFunction */
/* unused harmony export whenMergePropsIsOmitted */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils_verifyPlainObject__ = __webpack_require__(293);
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 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 (false) verifyPlainObject(mergedProps, displayName, 'mergeProps');
}
return mergedProps;
};
};
}
function whenMergePropsIsFunction(mergeProps) {
return typeof mergeProps === 'function' ? wrapMergePropsFunc(mergeProps) : undefined;
}
function whenMergePropsIsOmitted(mergeProps) {
return !mergeProps ? function () {
return defaultMergeProps;
} : undefined;
}
/* harmony default export */ __webpack_exports__["a"] = ([whenMergePropsIsFunction, whenMergePropsIsOmitted]);
/***/ }),
/* 784 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* unused harmony export impureFinalPropsSelectorFactory */
/* unused harmony export pureFinalPropsSelectorFactory */
/* harmony export (immutable) */ __webpack_exports__["a"] = finalPropsSelectorFactory;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__verifySubselectors__ = __webpack_require__(785);
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 (false) {
verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps, options.displayName);
}
var selectorFactory = options.pure ? pureFinalPropsSelectorFactory : impureFinalPropsSelectorFactory;
return selectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, options);
}
/***/ }),
/* 785 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* unused harmony export default */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils_warning__ = __webpack_require__(177);
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')) {
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils_warning__["a" /* 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);
}
/***/ }),
/* 786 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Subscription; });
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, onStateChange) {
_classCallCheck(this, Subscription);
this.store = store;
this.parentSub = parentSub;
this.onStateChange = onStateChange;
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.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;
}();
/***/ }),
/* 787 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = shallowEqual;
var hasOwn = Object.prototype.hasOwnProperty;
function is(x, y) {
if (x === y) {
return x !== 0 || y !== 0 || 1 / x === 1 / y;
} else {
return x !== x && y !== y;
}
}
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;
for (var i = 0; i < keysA.length; i++) {
if (!hasOwn.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {
return false;
}
}
return true;
}
/***/ }),
/* 788 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_history_createBrowserHistory__ = __webpack_require__(459);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_history_createBrowserHistory___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_history_createBrowserHistory__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_react_router__ = __webpack_require__(19);
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
/**
* The public API for a <Router> that uses HTML5 history.
*/
var BrowserRouter = function (_React$Component) {
_inherits(BrowserRouter, _React$Component);
function BrowserRouter() {
var _temp, _this, _ret;
_classCallCheck(this, BrowserRouter);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.history = __WEBPACK_IMPORTED_MODULE_2_history_createBrowserHistory___default()(_this.props), _temp), _possibleConstructorReturn(_this, _ret);
}
BrowserRouter.prototype.render = function render() {
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_3_react_router__["b" /* Router */], { history: this.history, children: this.props.children });
};
return BrowserRouter;
}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component);
BrowserRouter.propTypes = {
basename: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string,
forceRefresh: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool,
getUserConfirmation: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func,
keyLength: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.number,
children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node
};
/* unused harmony default export */ var _unused_webpack_default_export = (BrowserRouter);
/***/ }),
/* 789 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_history_createHashHistory__ = __webpack_require__(460);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_history_createHashHistory___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_history_createHashHistory__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_react_router__ = __webpack_require__(19);
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
/**
* The public API for a <Router> that uses window.location.hash.
*/
var HashRouter = function (_React$Component) {
_inherits(HashRouter, _React$Component);
function HashRouter() {
var _temp, _this, _ret;
_classCallCheck(this, HashRouter);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.history = __WEBPACK_IMPORTED_MODULE_2_history_createHashHistory___default()(_this.props), _temp), _possibleConstructorReturn(_this, _ret);
}
HashRouter.prototype.render = function render() {
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_3_react_router__["b" /* Router */], { history: this.history, children: this.props.children });
};
return HashRouter;
}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component);
HashRouter.propTypes = {
basename: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string,
getUserConfirmation: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func,
hashType: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOf(['hashbang', 'noslash', 'slash']),
children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node
};
/* unused harmony default export */ var _unused_webpack_default_export = (HashRouter);
/***/ }),
/* 790 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router__ = __webpack_require__(19);
/* unused harmony reexport default */
/***/ }),
/* 791 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react_router__ = __webpack_require__(19);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Link__ = __webpack_require__(294);
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
/**
* A <Link> wrapper that knows if it's "active" or not.
*/
var NavLink = function NavLink(_ref) {
var to = _ref.to,
exact = _ref.exact,
strict = _ref.strict,
location = _ref.location,
activeClassName = _ref.activeClassName,
className = _ref.className,
activeStyle = _ref.activeStyle,
style = _ref.style,
getIsActive = _ref.isActive,
rest = _objectWithoutProperties(_ref, ['to', 'exact', 'strict', 'location', 'activeClassName', 'className', 'activeStyle', 'style', 'isActive']);
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_2_react_router__["a" /* Route */], {
path: (typeof to === 'undefined' ? 'undefined' : _typeof(to)) === 'object' ? to.pathname : to,
exact: exact,
strict: strict,
location: location,
children: function children(_ref2) {
var location = _ref2.location,
match = _ref2.match;
var isActive = !!(getIsActive ? getIsActive(match, location) : match);
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_3__Link__["a" /* default */], _extends({
to: to,
className: isActive ? [activeClassName, className].filter(function (i) {
return i;
}).join(' ') : className,
style: isActive ? _extends({}, style, activeStyle) : style
}, rest));
}
});
};
NavLink.propTypes = {
to: __WEBPACK_IMPORTED_MODULE_3__Link__["a" /* default */].propTypes.to,
exact: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool,
strict: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool,
location: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object,
activeClassName: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string,
className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string,
activeStyle: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object,
style: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object,
isActive: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func
};
NavLink.defaultProps = {
activeClassName: 'active'
};
/* unused harmony default export */ var _unused_webpack_default_export = (NavLink);
/***/ }),
/* 792 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router__ = __webpack_require__(19);
/* unused harmony reexport default */
/***/ }),
/* 793 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router__ = __webpack_require__(19);
/* unused harmony reexport default */
/***/ }),
/* 794 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router__ = __webpack_require__(19);
/* unused harmony reexport default */
/***/ }),
/* 795 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router__ = __webpack_require__(19);
/* unused harmony reexport default */
/***/ }),
/* 796 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router__ = __webpack_require__(19);
/* unused harmony reexport default */
/***/ }),
/* 797 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router__ = __webpack_require__(19);
/* unused harmony reexport default */
/***/ }),
/* 798 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router__ = __webpack_require__(19);
/* unused harmony reexport default */
/***/ }),
/* 799 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router__ = __webpack_require__(19);
/* unused harmony reexport default */
/***/ }),
/* 800 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_history_createMemoryHistory__ = __webpack_require__(461);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_history_createMemoryHistory___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_history_createMemoryHistory__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Router__ = __webpack_require__(178);
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
/**
* The public API for a <Router> that stores location in memory.
*/
var MemoryRouter = function (_React$Component) {
_inherits(MemoryRouter, _React$Component);
function MemoryRouter() {
var _temp, _this, _ret;
_classCallCheck(this, MemoryRouter);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.history = __WEBPACK_IMPORTED_MODULE_2_history_createMemoryHistory___default()(_this.props), _temp), _possibleConstructorReturn(_this, _ret);
}
MemoryRouter.prototype.render = function render() {
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_3__Router__["a" /* default */], { history: this.history, children: this.props.children });
};
return MemoryRouter;
}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component);
MemoryRouter.propTypes = {
initialEntries: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.array,
initialIndex: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.number,
getUserConfirmation: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func,
keyLength: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.number,
children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node
};
/* unused harmony default export */ var _unused_webpack_default_export = (MemoryRouter);
/***/ }),
/* 801 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__);
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
/**
* The public API for prompting the user before navigating away
* from a screen with a component.
*/
var Prompt = function (_React$Component) {
_inherits(Prompt, _React$Component);
function Prompt() {
_classCallCheck(this, Prompt);
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
}
Prompt.prototype.enable = function enable(message) {
if (this.unblock) this.unblock();
this.unblock = this.context.router.history.block(message);
};
Prompt.prototype.disable = function disable() {
if (this.unblock) {
this.unblock();
this.unblock = null;
}
};
Prompt.prototype.componentWillMount = function componentWillMount() {
if (this.props.when) this.enable(this.props.message);
};
Prompt.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
if (nextProps.when) {
if (!this.props.when || this.props.message !== nextProps.message) this.enable(nextProps.message);
} else {
this.disable();
}
};
Prompt.prototype.componentWillUnmount = function componentWillUnmount() {
this.disable();
};
Prompt.prototype.render = function render() {
return null;
};
return Prompt;
}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component);
Prompt.propTypes = {
when: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool,
message: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]).isRequired
};
Prompt.defaultProps = {
when: true
};
Prompt.contextTypes = {
router: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({
history: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({
block: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired
}).isRequired
}).isRequired
};
/* unused harmony default export */ var _unused_webpack_default_export = (Prompt);
/***/ }),
/* 802 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__);
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
/**
* The public API for updating the location programatically
* with a component.
*/
var Redirect = function (_React$Component) {
_inherits(Redirect, _React$Component);
function Redirect() {
_classCallCheck(this, Redirect);
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
}
Redirect.prototype.isStatic = function isStatic() {
return this.context.router && this.context.router.staticContext;
};
Redirect.prototype.componentWillMount = function componentWillMount() {
if (this.isStatic()) this.perform();
};
Redirect.prototype.componentDidMount = function componentDidMount() {
if (!this.isStatic()) this.perform();
};
Redirect.prototype.perform = function perform() {
var history = this.context.router.history;
var _props = this.props,
push = _props.push,
to = _props.to;
if (push) {
history.push(to);
} else {
history.replace(to);
}
};
Redirect.prototype.render = function render() {
return null;
};
return Redirect;
}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component);
Redirect.propTypes = {
push: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool,
from: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string,
to: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object])
};
Redirect.defaultProps = {
push: false
};
Redirect.contextTypes = {
router: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({
history: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({
push: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired,
replace: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired
}).isRequired,
staticContext: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object
}).isRequired
};
/* unused harmony default export */ var _unused_webpack_default_export = (Redirect);
/***/ }),
/* 803 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_invariant__ = __webpack_require__(23);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_invariant___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_invariant__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_prop_types__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_prop_types__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_history_PathUtils__ = __webpack_require__(69);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_history_PathUtils___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_history_PathUtils__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__Router__ = __webpack_require__(178);
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var normalizeLocation = function normalizeLocation(object) {
var _object$pathname = object.pathname,
pathname = _object$pathname === undefined ? '/' : _object$pathname,
_object$search = object.search,
search = _object$search === undefined ? '' : _object$search,
_object$hash = object.hash,
hash = _object$hash === undefined ? '' : _object$hash;
return {
pathname: pathname,
search: search === '?' ? '' : search,
hash: hash === '#' ? '' : hash
};
};
var addBasename = function addBasename(basename, location) {
if (!basename) return location;
return _extends({}, location, {
pathname: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3_history_PathUtils__["addLeadingSlash"])(basename) + location.pathname
});
};
var stripBasename = function stripBasename(basename, location) {
if (!basename) return location;
var base = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3_history_PathUtils__["addLeadingSlash"])(basename);
if (location.pathname.indexOf(base) !== 0) return location;
return _extends({}, location, {
pathname: location.pathname.substr(base.length)
});
};
var createLocation = function createLocation(location) {
return typeof location === 'string' ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3_history_PathUtils__["parsePath"])(location) : normalizeLocation(location);
};
var createURL = function createURL(location) {
return typeof location === 'string' ? location : __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3_history_PathUtils__["createPath"])(location);
};
var staticHandler = function staticHandler(methodName) {
return function () {
__WEBPACK_IMPORTED_MODULE_0_invariant___default()(false, 'You cannot %s with <StaticRouter>', methodName);
};
};
var noop = function noop() {};
/**
* The public top-level API for a "static" <Router>, so-called because it
* can't actually change the current location. Instead, it just records
* location changes in a context object. Useful mainly in testing and
* server-rendering scenarios.
*/
var StaticRouter = function (_React$Component) {
_inherits(StaticRouter, _React$Component);
function StaticRouter() {
var _temp, _this, _ret;
_classCallCheck(this, StaticRouter);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.createHref = function (path) {
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3_history_PathUtils__["addLeadingSlash"])(_this.props.basename + createURL(path));
}, _this.handlePush = function (location) {
var _this$props = _this.props,
basename = _this$props.basename,
context = _this$props.context;
context.action = 'PUSH';
context.location = addBasename(basename, createLocation(location));
context.url = createURL(context.location);
}, _this.handleReplace = function (location) {
var _this$props2 = _this.props,
basename = _this$props2.basename,
context = _this$props2.context;
context.action = 'REPLACE';
context.location = addBasename(basename, createLocation(location));
context.url = createURL(context.location);
}, _this.handleListen = function () {
return noop;
}, _this.handleBlock = function () {
return noop;
}, _temp), _possibleConstructorReturn(_this, _ret);
}
StaticRouter.prototype.getChildContext = function getChildContext() {
return {
router: {
staticContext: this.props.context
}
};
};
StaticRouter.prototype.render = function render() {
var _props = this.props,
basename = _props.basename,
context = _props.context,
location = _props.location,
props = _objectWithoutProperties(_props, ['basename', 'context', 'location']);
var history = {
createHref: this.createHref,
action: 'POP',
location: stripBasename(basename, createLocation(location)),
push: this.handlePush,
replace: this.handleReplace,
go: staticHandler('go'),
goBack: staticHandler('goBack'),
goForward: staticHandler('goForward'),
listen: this.handleListen,
block: this.handleBlock
};
return __WEBPACK_IMPORTED_MODULE_1_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_4__Router__["a" /* default */], _extends({}, props, { history: history }));
};
return StaticRouter;
}(__WEBPACK_IMPORTED_MODULE_1_react___default.a.Component);
StaticRouter.propTypes = {
basename: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.string,
context: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.object.isRequired,
location: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.object])
};
StaticRouter.defaultProps = {
basename: '',
location: '/'
};
StaticRouter.childContextTypes = {
router: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.object.isRequired
};
/* unused harmony default export */ var _unused_webpack_default_export = (StaticRouter);
/***/ }),
/* 804 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_warning__ = __webpack_require__(22);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_warning___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_warning__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__matchPath__ = __webpack_require__(179);
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
/**
* The public API for rendering the first <Route> that matches.
*/
var Switch = function (_React$Component) {
_inherits(Switch, _React$Component);
function Switch() {
_classCallCheck(this, Switch);
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
}
Switch.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
__WEBPACK_IMPORTED_MODULE_2_warning___default()(!(nextProps.location && !this.props.location), '<Switch> elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.');
__WEBPACK_IMPORTED_MODULE_2_warning___default()(!(!nextProps.location && this.props.location), '<Switch> elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.');
};
Switch.prototype.render = function render() {
var route = this.context.router.route;
var children = this.props.children;
var location = this.props.location || route.location;
var match = void 0,
child = void 0;
__WEBPACK_IMPORTED_MODULE_0_react___default.a.Children.forEach(children, function (element) {
if (!__WEBPACK_IMPORTED_MODULE_0_react___default.a.isValidElement(element)) return;
var _element$props = element.props,
pathProp = _element$props.path,
exact = _element$props.exact,
strict = _element$props.strict,
from = _element$props.from;
var path = pathProp || from;
if (match == null) {
child = element;
match = path ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__matchPath__["a" /* default */])(location.pathname, { path: path, exact: exact, strict: strict }) : route.match;
}
});
return match ? __WEBPACK_IMPORTED_MODULE_0_react___default.a.cloneElement(child, { location: location, computedMatch: match }) : null;
};
return Switch;
}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component);
Switch.contextTypes = {
router: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({
route: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object.isRequired
}).isRequired
};
Switch.propTypes = {
children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node,
location: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object
};
/* unused harmony default export */ var _unused_webpack_default_export = (Switch);
/***/ }),
/* 805 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_hoist_non_react_statics__ = __webpack_require__(129);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_hoist_non_react_statics___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_hoist_non_react_statics__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Route__ = __webpack_require__(296);
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
/**
* A public higher-order component to access the imperative API
*/
var withRouter = function withRouter(Component) {
var C = function C(props) {
var wrappedComponentRef = props.wrappedComponentRef,
remainingProps = _objectWithoutProperties(props, ['wrappedComponentRef']);
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_3__Route__["a" /* default */], { render: function render(routeComponentProps) {
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Component, _extends({}, remainingProps, routeComponentProps, { ref: wrappedComponentRef }));
} });
};
C.displayName = 'withRouter(' + (Component.displayName || Component.name) + ')';
C.WrappedComponent = Component;
C.propTypes = {
wrappedComponentRef: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func
};
return __WEBPACK_IMPORTED_MODULE_2_hoist_non_react_statics___default()(C, Component);
};
/* unused harmony default export */ var _unused_webpack_default_export = (withRouter);
/***/ }),
/* 806 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.styles = undefined;
exports.ArgumentRenderer = ArgumentRenderer;
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(1);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _Styled = __webpack_require__(10);
var _Styled2 = _interopRequireDefault(_Styled);
var _Markdown = __webpack_require__(36);
var _Markdown2 = _interopRequireDefault(_Markdown);
var _Code = __webpack_require__(180);
var _Code2 = _interopRequireDefault(_Code);
var _Name = __webpack_require__(182);
var _Name2 = _interopRequireDefault(_Name);
var _reactGroup = __webpack_require__(289);
var _reactGroup2 = _interopRequireDefault(_reactGroup);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
var styles = exports.styles = function styles(_ref) {
var color = _ref.color;
return {
type: {
fontSize: 'inherit',
color: color.type
}
};
};
function ArgumentRenderer(_ref2) {
var classes = _ref2.classes,
name = _ref2.name,
type = _ref2.type,
description = _ref2.description,
returns = _ref2.returns,
props = _objectWithoutProperties(_ref2, ['classes', 'name', 'type', 'description', 'returns']);
return _react2.default.createElement(
_reactGroup2.default,
props,
returns && 'Returns',
name && _react2.default.createElement(
'span',
null,
_react2.default.createElement(_Name2.default, { name: name }),
type && ':'
),
type && _react2.default.createElement(
_Code2.default,
{ className: classes.type },
type.name
),
description && _react2.default.createElement(_Markdown2.default, { text: '\u2014 ' + description, inline: true })
);
}
ArgumentRenderer.propTypes = {
classes: _propTypes2.default.object.isRequired,
name: _propTypes2.default.string,
type: _propTypes2.default.object,
description: _propTypes2.default.string,
returns: _propTypes2.default.bool
};
exports.default = (0, _Styled2.default)(styles)(ArgumentRenderer);
/***/ }),
/* 807 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.styles = 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; };
exports.ArgumentsRenderer = ArgumentsRenderer;
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(1);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _Argument = __webpack_require__(297);
var _Argument2 = _interopRequireDefault(_Argument);
var _Styled = __webpack_require__(10);
var _Styled2 = _interopRequireDefault(_Styled);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var styles = exports.styles = function styles(_ref) {
var space = _ref.space;
return {
root: {
marginBottom: space[2],
fontSize: 'inherit'
}
};
};
function ArgumentsRenderer(_ref2) {
var classes = _ref2.classes,
args = _ref2.args;
if (args.length === 0) {
return null;
}
return _react2.default.createElement(
'div',
{ className: classes.root },
args.map(function (arg) {
return _react2.default.createElement(_Argument2.default, _extends({ key: arg.name }, arg));
})
);
}
ArgumentsRenderer.propTypes = {
classes: _propTypes2.default.object.isRequired,
args: _propTypes2.default.arrayOf(_propTypes2.default.shape({
name: _propTypes2.default.string.isRequired,
type: _propTypes2.default.object,
description: _propTypes2.default.string
})).isRequired
};
exports.default = (0, _Styled2.default)(styles)(ArgumentsRenderer);
/***/ }),
/* 808 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.CodeRenderer = CodeRenderer;
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(1);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _Styled = __webpack_require__(10);
var _Styled2 = _interopRequireDefault(_Styled);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var styles = function styles(_ref) {
var fontFamily = _ref.fontFamily;
return {
code: {
display: 'inline',
fontFamily: fontFamily.monospace,
fontSize: 'inherit',
color: 'inherit',
background: 'transparent'
}
};
};
function CodeRenderer(_ref2) {
var classes = _ref2.classes,
className = _ref2.className,
children = _ref2.children;
return _react2.default.createElement(
'span',
{ className: className },
_react2.default.createElement(
'code',
{ className: classes.code },
children
)
);
}
CodeRenderer.propTypes = {
classes: _propTypes2.default.object.isRequired,
className: _propTypes2.default.string,
children: _propTypes2.default.node
};
exports.default = (0, _Styled2.default)(styles)(CodeRenderer);
/***/ }),
/* 809 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = Components;
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(1);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _ReactComponent = __webpack_require__(840);
var _ReactComponent2 = _interopRequireDefault(_ReactComponent);
var _ComponentsRenderer = __webpack_require__(810);
var _ComponentsRenderer2 = _interopRequireDefault(_ComponentsRenderer);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function Components(_ref) {
var components = _ref.components;
return _react2.default.createElement(
_ComponentsRenderer2.default,
null,
components.map(function (component) {
return _react2.default.createElement(_ReactComponent2.default, {
key: component.filepath,
component: component
});
})
);
}
Components.propTypes = {
components: _propTypes2.default.array.isRequired
};
/***/ }),
/* 810 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = ComponentsRenderer;
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(1);
var _propTypes2 = _interopRequireDefault(_propTypes);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function ComponentsRenderer(_ref) {
var children = _ref.children;
return _react2.default.createElement(
'div',
null,
children
);
}
ComponentsRenderer.propTypes = {
children: _propTypes2.default.node.isRequired
};
/***/ }),
/* 811 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _Components = __webpack_require__(809);
Object.defineProperty(exports, 'default', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Components).default;
}
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/***/ }),
/* 812 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ComponentsListRenderer = ComponentsListRenderer;
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(1);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _classnames = __webpack_require__(37);
var _classnames2 = _interopRequireDefault(_classnames);
var _Link = __webpack_require__(109);
var _Link2 = _interopRequireDefault(_Link);
var _Styled = __webpack_require__(10);
var _Styled2 = _interopRequireDefault(_Styled);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
var styles = function styles(_ref) {
var color = _ref.color,
fontFamily = _ref.fontFamily,
fontSize = _ref.fontSize,
space = _ref.space,
mq = _ref.mq;
return {
list: {
margin: 0,
paddingLeft: space[2]
},
item: {
color: color.base,
display: 'block',
margin: [[space[1], 0, space[1], 0]],
fontFamily: fontFamily.base,
fontSize: fontSize.base,
listStyle: 'none',
overflow: 'hidden',
textOverflow: 'ellipsis'
},
isChild: _defineProperty({}, mq.small, {
display: 'inline-block',
margin: [[0, space[1], 0, 0]]
}),
heading: {
color: color.base,
marginTop: space[1],
fontFamily: fontFamily.base,
fontWeight: 'bold'
}
};
};
function ComponentsListRenderer(_ref2) {
var classes = _ref2.classes,
items = _ref2.items;
items = items.filter(function (item) {
return item.name;
});
if (!items.length) {
return null;
}
return _react2.default.createElement(
'ul',
{ className: classes.list },
items.map(function (_ref3) {
var heading = _ref3.heading,
name = _ref3.name,
slug = _ref3.slug,
content = _ref3.content;
return _react2.default.createElement(
'li',
{ className: (0, _classnames2.default)(classes.item, (!content || !content.props.items.length) && classes.isChild), key: name },
_react2.default.createElement(
_Link2.default,
{ className: (0, _classnames2.default)(heading && classes.heading), href: '#' + slug },
name
),
content
);
})
);
}
ComponentsListRenderer.propTypes = {
items: _propTypes2.default.array.isRequired,
classes: _propTypes2.default.object.isRequired
};
exports.default = (0, _Styled2.default)(styles)(ComponentsListRenderer);
/***/ }),
/* 813 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _ComponentsListRenderer = __webpack_require__(812);
Object.defineProperty(exports, 'default', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_ComponentsListRenderer).default;
}
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/***/ }),
/* 814 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _EditorLoaderRenderer = __webpack_require__(815);
var _EditorLoaderRenderer2 = _interopRequireDefault(_EditorLoaderRenderer);
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; }
/* istanbul ignore if */
// FIX: require.ensure polyfill for tests
// Cant make it work from tests, it shouldnt be in the app code.
if (false) {
require.ensure = function (d, c) {
return c(require);
};
}
var EditorLoader = function (_Component) {
_inherits(EditorLoader, _Component);
function EditorLoader() {
var _ref;
var _temp, _this, _ret;
_classCallCheck(this, EditorLoader);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = EditorLoader.__proto__ || Object.getPrototypeOf(EditorLoader)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
editor: null
}, _temp), _possibleConstructorReturn(_this, _ret);
}
_createClass(EditorLoader, [{
key: 'componentDidMount',
value: function componentDidMount() {
var _this2 = this;
__webpack_require__.e/* require.ensure */(0).then((function (require) {
_this2.setState({
editor: __webpack_require__(333).default
});
}).bind(null, __webpack_require__)).catch(__webpack_require__.oe);
}
}, {
key: 'render',
value: function render() {
var Editor = this.state.editor;
if (Editor) {
return _react2.default.createElement(Editor, this.props);
}
return _react2.default.createElement(_EditorLoaderRenderer2.default, null);
}
}]);
return EditorLoader;
}(_react.Component);
exports.default = EditorLoader;
/***/ }),
/* 815 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.EditorLoaderRenderer = EditorLoaderRenderer;
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(1);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _Styled = __webpack_require__(10);
var _Styled2 = _interopRequireDefault(_Styled);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var styles = function styles(_ref) {
var fontFamily = _ref.fontFamily,
color = _ref.color,
space = _ref.space,
fontSize = _ref.fontSize;
return {
root: {
padding: [[space[1], space[2], space[1], space[1]]],
fontFamily: fontFamily.base,
fontSize: fontSize.small,
color: color.light,
backgroundColor: color.codeBackground
},
// Tweak CodeMirror styles. Duplicate selectors are for increased specificity
'@global': {
'.CodeMirror.CodeMirror': {
fontFamily: fontFamily.monospace,
height: 'auto',
padding: [[space[0], space[2]]],
fontSize: fontSize.small
},
'.CodeMirror.CodeMirror pre': {
padding: 0
},
'.CodeMirror-scroll.CodeMirror-scroll': {
height: 'auto',
overflowY: 'hidden',
overflowX: 'auto'
},
'.cm-error.cm-error': {
background: 'none'
}
}
};
};
function EditorLoaderRenderer(_ref2) {
var classes = _ref2.classes;
return _react2.default.createElement(
'div',
{ className: classes.root },
'Loading\u2026'
);
}
EditorLoaderRenderer.propTypes = {
classes: _propTypes2.default.object.isRequired
};
exports.default = (0, _Styled2.default)(styles)(EditorLoaderRenderer);
/***/ }),
/* 816 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _EditorLoader = __webpack_require__(814);
Object.defineProperty(exports, 'default', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_EditorLoader).default;
}
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/***/ }),
/* 817 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = Examples;
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(1);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _Playground = __webpack_require__(830);
var _Playground2 = _interopRequireDefault(_Playground);
var _Markdown = __webpack_require__(36);
var _Markdown2 = _interopRequireDefault(_Markdown);
var _ExamplesRenderer = __webpack_require__(818);
var _ExamplesRenderer2 = _interopRequireDefault(_ExamplesRenderer);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function Examples(_ref, _ref2) {
var examples = _ref.examples,
name = _ref.name;
var codeKey = _ref2.codeKey;
return _react2.default.createElement(
_ExamplesRenderer2.default,
null,
examples.map(function (example, index) {
switch (example.type) {
case 'code':
return _react2.default.createElement(_Playground2.default, {
code: example.content,
evalInContext: example.evalInContext,
key: codeKey + '/' + index,
name: name,
index: index
});
case 'markdown':
return _react2.default.createElement(_Markdown2.default, {
text: example.content,
key: index
});
default:
return null;
}
})
);
}
Examples.propTypes = {
examples: _propTypes2.default.array.isRequired,
name: _propTypes2.default.string
};
Examples.contextTypes = {
codeKey: _propTypes2.default.number.isRequired
};
/***/ }),
/* 818 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ExamplesRenderer = ExamplesRenderer;
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(1);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _Styled = __webpack_require__(10);
var _Styled2 = _interopRequireDefault(_Styled);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var styles = function styles() {
return {
// Just default jss-isolate rules
root: {}
};
};
function ExamplesRenderer(_ref) {
var classes = _ref.classes,
children = _ref.children;
return _react2.default.createElement(
'article',
{ className: classes.root },
children
);
}
ExamplesRenderer.propTypes = {
classes: _propTypes2.default.object.isRequired,
children: _propTypes2.default.node
};
exports.default = (0, _Styled2.default)(styles)(ExamplesRenderer);
/***/ }),
/* 819 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.styles = 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; };
exports.HeadingRenderer = HeadingRenderer;
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(1);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _classnames = __webpack_require__(37);
var _classnames2 = _interopRequireDefault(_classnames);
var _Styled = __webpack_require__(10);
var _Styled2 = _interopRequireDefault(_Styled);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
var styles = exports.styles = function styles(_ref) {
var color = _ref.color,
space = _ref.space,
fontSize = _ref.fontSize;
return {
heading: {
color: color.base,
position: 'relative',
overflow: 'visible',
marginLeft: -space[4],
paddingLeft: space[4],
'&:hover > $anchor': {
isolate: false,
visibility: 'visible'
}
},
anchor: {
position: 'absolute',
top: '50%',
transform: 'translateY(-50%)',
left: space[1],
display: 'block',
color: color.link,
fontSize: fontSize.h3,
fontWeight: 'normal',
textDecoration: 'none',
visibility: 'hidden',
'&:hover, &:active': {
isolate: false,
color: color.linkHover,
cursor: 'pointer'
}
}
};
};
function HeadingRenderer(_ref2) {
var classes = _ref2.classes,
children = _ref2.children,
slug = _ref2.slug,
level = _ref2.level,
props = _objectWithoutProperties(_ref2, ['classes', 'children', 'slug', 'level']);
var Tag = 'h' + level;
return _react2.default.createElement(
Tag,
_extends({}, props, { id: slug, className: (0, _classnames2.default)(classes.heading, props.className) }),
_react2.default.createElement(
'a',
{ className: classes.anchor, href: '#' + slug, 'aria-hidden': true },
'#'
),
children
);
}
HeadingRenderer.propTypes = {
children: _propTypes2.default.node,
className: _propTypes2.default.string,
classes: _propTypes2.default.object.isRequired,
slug: _propTypes2.default.string.isRequired,
level: _propTypes2.default.oneOf([1, 2, 3, 4, 5, 6]).isRequired
};
exports.default = (0, _Styled2.default)(styles)(HeadingRenderer);
/***/ }),
/* 820 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getMarkdown = getMarkdown;
exports.default = JsDoc;
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(1);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _Markdown = __webpack_require__(36);
var _Markdown2 = _interopRequireDefault(_Markdown);
var _map = __webpack_require__(263);
var _map2 = _interopRequireDefault(_map);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var plural = function plural(array, caption) {
return array.length === 1 ? caption : caption + 's';
};
var list = function list(array) {
return array.map(function (item) {
return item.description;
}).join(', ');
};
var paragraphs = function paragraphs(array) {
return array.map(function (item) {
return item.description;
}).join('\n\n');
};
var fields = {
deprecated: function deprecated(value) {
return '**Deprecated:** ' + value[0].description;
},
see: function see(value) {
return paragraphs(value);
},
link: function link(value) {
return paragraphs(value);
},
author: function author(value) {
return plural(value, 'Author') + ': ' + list(value);
},
version: function version(value) {
return 'Version: ' + value[0].description;
},
since: function since(value) {
return 'Since: ' + value[0].description;
}
};
function getMarkdown(props) {
return (0, _map2.default)(fields, function (format, field) {
return props[field] && format(props[field]);
}).filter(Boolean).join('\n\n');
}
function JsDoc(props) {
var markdown = getMarkdown(props);
return markdown ? _react2.default.createElement(_Markdown2.default, { text: markdown }) : null;
}
JsDoc.propTypes = {
deprecated: _propTypes2.default.array,
see: _propTypes2.default.array,
link: _propTypes2.default.array,
author: _propTypes2.default.array,
version: _propTypes2.default.array,
since: _propTypes2.default.array
};
/***/ }),
/* 821 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.styles = 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; };
exports.LinkRenderer = LinkRenderer;
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(1);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _classnames = __webpack_require__(37);
var _classnames2 = _interopRequireDefault(_classnames);
var _Styled = __webpack_require__(10);
var _Styled2 = _interopRequireDefault(_Styled);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
var styles = exports.styles = function styles(_ref) {
var color = _ref.color;
return {
link: {
'&, &:link, &:visited': {
fontSize: 'inherit',
color: color.link,
textDecoration: 'none'
},
'&:hover, &:active': {
isolate: false,
color: color.linkHover,
cursor: 'pointer'
}
}
};
};
function LinkRenderer(_ref2) {
var classes = _ref2.classes,
children = _ref2.children,
props = _objectWithoutProperties(_ref2, ['classes', 'children']);
return _react2.default.createElement(
'a',
_extends({}, props, { className: (0, _classnames2.default)(classes.link, props.className) }),
children
);
}
LinkRenderer.propTypes = {
children: _propTypes2.default.node,
className: _propTypes2.default.string,
classes: _propTypes2.default.object.isRequired
};
exports.default = (0, _Styled2.default)(styles)(LinkRenderer);
/***/ }),
/* 822 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.LogoRenderer = LogoRenderer;
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(1);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _Styled = __webpack_require__(10);
var _Styled2 = _interopRequireDefault(_Styled);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var styles = function styles(_ref) {
var color = _ref.color,
fontFamily = _ref.fontFamily,
fontSize = _ref.fontSize;
return {
logo: {
color: color.base,
margin: 0,
fontFamily: fontFamily.base,
fontSize: fontSize.h4,
fontWeight: 'normal'
}
};
};
function LogoRenderer(_ref2) {
var classes = _ref2.classes,
children = _ref2.children;
return _react2.default.createElement(
'h1',
{ className: classes.logo },
children
);
}
LogoRenderer.propTypes = {
classes: _propTypes2.default.object.isRequired,
children: _propTypes2.default.node
};
exports.default = (0, _Styled2.default)(styles)(LogoRenderer);
/***/ }),
/* 823 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _LogoRenderer = __webpack_require__(822);
Object.defineProperty(exports, 'default', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_LogoRenderer).default;
}
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/***/ }),
/* 824 */
/***/ (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; };
// import memoize from 'lodash/memoize';
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(1);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _markdownToJsx = __webpack_require__(704);
var _mapValues = __webpack_require__(691);
var _mapValues2 = _interopRequireDefault(_mapValues);
var _Styled = __webpack_require__(10);
var _Styled2 = _interopRequireDefault(_Styled);
var _Link = __webpack_require__(109);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// Were explicitly specifying Webpack loaders here so we could skip specifying them in Webpack configuration.
// That way we could avoid clashes between our loaders and user loaders.
__webpack_require__(886);
// Temporary disable memoization to fix: https://github.com/styleguidist/react-styleguidist/issues/348
// TODO: Remove after merge: https://github.com/probablyup/markdown-to-jsx/pull/96
var memoize = function memoize(a) {
return a;
};
// Code blocks with server-side syntax highlight
function Code(_ref) {
var children = _ref.children,
className = _ref.className;
var isHighlighted = className && className.indexOf('lang-') !== -1;
if (isHighlighted) {
return _react2.default.createElement('code', { className: className, dangerouslySetInnerHTML: { __html: children } });
}
return _react2.default.createElement(
'code',
{ className: className },
children
);
}
Code.propTypes = {
children: _propTypes2.default.node,
className: _propTypes2.default.string
};
// Custom CSS classes for each tag: <em> → <em className={s.em}> + custom components
var getBaseOverrides = memoize(function (classes) {
var styleOverrides = (0, _mapValues2.default)(classes, function (value) {
return {
props: {
className: value
}
};
});
return _extends({}, styleOverrides, {
code: {
component: Code,
props: {
className: classes.code
}
}
});
}, function () {
return 'getBaseOverrides';
});
// Inline mode: replace <p> (usual root component) with <span>
var getInlineOverrides = memoize(function (classes) {
var overrides = getBaseOverrides(classes);
return _extends({}, overrides, {
p: {
component: 'span',
props: {
className: classes.base
}
}
});
}, function () {
return 'getInlineOverrides';
});
var styles = function styles(_ref2) {
var space = _ref2.space,
fontFamily = _ref2.fontFamily,
fontSize = _ref2.fontSize,
color = _ref2.color,
borderRadius = _ref2.borderRadius;
return {
base: {
color: color.base,
fontFamily: fontFamily.base,
fontSize: 'inherit'
},
para: {
color: color.base,
fontFamily: fontFamily.base,
fontSize: 'inherit',
margin: [[0, 0, space[2], 0]],
lineHeight: 1.5
},
a: (0, _Link.styles)({ color: color }).link,
h1: {
composes: '$para',
fontSize: fontSize.h1,
fontWeight: 'normal'
},
h2: {
composes: '$para',
fontSize: fontSize.h2,
fontWeight: 'normal'
},
h3: {
composes: '$para',
fontSize: fontSize.h3,
fontWeight: 'normal'
},
h4: {
composes: '$para',
fontSize: fontSize.h4,
fontWeight: 'normal'
},
h5: {
composes: '$para',
fontSize: fontSize.h5,
fontWeight: 'normal'
},
h6: {
composes: '$para',
fontSize: fontSize.h6,
fontWeight: 'normal',
fontStyle: 'italic'
},
p: {
composes: '$para'
},
ul: {
composes: '$para',
paddingLeft: space[3]
},
ol: {
composes: '$para',
listStyleType: 'decimal',
paddingLeft: space[3]
},
li: {
composes: '$base',
listStyleType: 'inherit'
},
input: {
color: color.base,
display: 'inline-block',
margin: [[0, '0.35em', '0.25em', '-1.2em']],
verticalAlign: 'middle'
},
blockquote: {
composes: '$para',
fontSize: fontSize.base,
margin: [[space[2], space[4]]],
padding: 0
},
hr: {
composes: '$para',
borderWidth: [[0, 0, 1, 0]],
borderColor: color.border,
borderStyle: 'solid'
},
em: {
composes: '$base',
fontStyle: 'italic'
},
strong: {
composes: '$base',
fontWeight: 'bold'
},
code: {
fontFamily: fontFamily.monospace,
fontSize: 'inherit',
color: 'inherit',
background: 'transparent',
whiteSpace: 'inherit'
},
pre: {
composes: '$para',
backgroundColor: color.codeBackground,
border: [[1, color.border, 'solid']],
padding: [[space[1], space[2]]],
fontSize: fontSize.small,
borderRadius: borderRadius,
whiteSpace: 'pre'
},
table: {
composes: '$para',
borderCollapse: 'collapse'
},
thead: {
composes: '$hr'
},
tbody: {},
td: {
fontFamily: fontFamily.base,
padding: [[space[0], space[2], space[0], 0]],
fontSize: fontSize.base
},
th: {
composes: '$td',
fontWeight: 'bold'
},
tr: {}
};
};
function Markdown(_ref3) {
var classes = _ref3.classes,
text = _ref3.text,
inline = _ref3.inline;
var overrides = inline ? getInlineOverrides(classes) : getBaseOverrides(classes);
return (0, _markdownToJsx.compiler)(text, { overrides: overrides });
}
Markdown.propTypes = {
classes: _propTypes2.default.object.isRequired,
text: _propTypes2.default.string.isRequired,
inline: _propTypes2.default.bool
};
exports.default = (0, _Styled2.default)(styles)(Markdown);
/***/ }),
/* 825 */
/***/ (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.MethodsRenderer = MethodsRenderer;
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(1);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _Markdown = __webpack_require__(36);
var _Markdown2 = _interopRequireDefault(_Markdown);
var _Argument = __webpack_require__(297);
var _Argument2 = _interopRequireDefault(_Argument);
var _Arguments = __webpack_require__(298);
var _Arguments2 = _interopRequireDefault(_Arguments);
var _Name = __webpack_require__(182);
var _Name2 = _interopRequireDefault(_Name);
var _JsDoc = __webpack_require__(181);
var _JsDoc2 = _interopRequireDefault(_JsDoc);
var _Styled = __webpack_require__(10);
var _Styled2 = _interopRequireDefault(_Styled);
var _classnames = __webpack_require__(37);
var _classnames2 = _interopRequireDefault(_classnames);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var styles = function styles(_ref) {
var space = _ref.space,
color = _ref.color,
fontFamily = _ref.fontFamily,
fontSize = _ref.fontSize;
return {
table: {
width: '100%',
borderCollapse: 'collapse'
},
tableHead: {
borderBottom: [[1, color.border, 'solid']]
},
cell: {
color: color.base,
paddingRight: space[2],
paddingTop: space[1],
verticalAlign: 'top',
fontFamily: fontFamily.base,
fontSize: fontSize.small
},
cellHeading: {
color: color.base,
paddingRight: space[2],
paddingBottom: space[1],
textAlign: 'left',
fontFamily: fontFamily.base,
fontWeight: 'bold',
fontSize: fontSize.small
},
cellDesc: {
width: '70%',
paddingLeft: space[2],
paddingRight: 0
},
para: {
marginBottom: space[2],
fontSize: fontSize.small
}
};
};
function MethodsRenderer(_ref2) {
var classes = _ref2.classes,
methods = _ref2.methods;
function renderRow(method) {
var name = method.name,
description = method.description,
returns = method.returns,
_method$params = method.params,
params = _method$params === undefined ? [] : _method$params,
_method$tags = method.tags,
tags = _method$tags === undefined ? {} : _method$tags;
return _react2.default.createElement(
'tr',
{ key: name },
_react2.default.createElement(
'td',
{ className: classes.cell },
_react2.default.createElement(_Name2.default, { name: name + '()', deprecated: tags.deprecated })
),
_react2.default.createElement(
'td',
{ className: classes.cell },
_react2.default.createElement(_Arguments2.default, { args: params })
),
_react2.default.createElement(
'td',
{ className: (0, _classnames2.default)(classes.cell, classes.cellDesc) },
description && _react2.default.createElement(_Markdown2.default, { text: description }),
returns && _react2.default.createElement(_Argument2.default, _extends({ className: classes.para, returns: true }, returns)),
_react2.default.createElement(_JsDoc2.default, tags)
)
);
}
return _react2.default.createElement(
'table',
{ className: classes.table },
_react2.default.createElement(
'thead',
{ className: classes.tableHead },
_react2.default.createElement(
'tr',
null,
_react2.default.createElement(
'th',
{ className: classes.cellHeading },
'Name'
),
_react2.default.createElement(
'th',
{ className: classes.cellHeading },
'Parameters'
),
_react2.default.createElement(
'th',
{ className: (0, _classnames2.default)(classes.cellHeading, classes.cellDesc) },
'Description'
)
)
),
_react2.default.createElement(
'tbody',
null,
methods.map(renderRow)
)
);
}
MethodsRenderer.propTypes = {
classes: _propTypes2.default.object.isRequired,
methods: _propTypes2.default.arrayOf(_propTypes2.default.shape({
name: _propTypes2.default.string.isRequired,
description: _propTypes2.default.string,
returns: _propTypes2.default.object,
params: _propTypes2.default.array,
tags: _propTypes2.default.object
})).isRequired
};
exports.default = (0, _Styled2.default)(styles)(MethodsRenderer);
/***/ }),
/* 826 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _MethodsRenderer = __webpack_require__(825);
Object.defineProperty(exports, 'default', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_MethodsRenderer).default;
}
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/***/ }),
/* 827 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.NameRenderer = NameRenderer;
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(1);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _Code = __webpack_require__(180);
var _Code2 = _interopRequireDefault(_Code);
var _Styled = __webpack_require__(10);
var _Styled2 = _interopRequireDefault(_Styled);
var _classnames = __webpack_require__(37);
var _classnames2 = _interopRequireDefault(_classnames);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
var styles = function styles(_ref) {
var fontFamily = _ref.fontFamily,
fontSize = _ref.fontSize,
color = _ref.color;
return {
name: {
fontFamily: fontFamily.monospace,
fontSize: fontSize.small,
color: color.name
},
isDeprecated: {
color: color.light,
textDecoration: 'line-through'
}
};
};
function NameRenderer(_ref2) {
var classes = _ref2.classes,
name = _ref2.name,
deprecated = _ref2.deprecated;
var classNames = (0, _classnames2.default)(classes.name, _defineProperty({}, classes.isDeprecated, deprecated));
return _react2.default.createElement(
_Code2.default,
{ className: classNames },
name
);
}
NameRenderer.propTypes = {
classes: _propTypes2.default.object.isRequired,
name: _propTypes2.default.string.isRequired,
deprecated: _propTypes2.default.bool
};
exports.default = (0, _Styled2.default)(styles)(NameRenderer);
/***/ }),
/* 828 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(1);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _debounce = __webpack_require__(332);
var _debounce2 = _interopRequireDefault(_debounce);
var _PlaygroundRenderer = __webpack_require__(829);
var _PlaygroundRenderer2 = _interopRequireDefault(_PlaygroundRenderer);
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 Playground = function (_Component) {
_inherits(Playground, _Component);
function Playground(props, context) {
_classCallCheck(this, Playground);
var _this = _possibleConstructorReturn(this, (Playground.__proto__ || Object.getPrototypeOf(Playground)).call(this, props, context));
var code = props.code;
var showCode = context.config.showCode;
_this.state = {
code: code,
showCode: showCode
};
return _this;
}
_createClass(Playground, [{
key: 'componentWillReceiveProps',
value: function componentWillReceiveProps(nextProps) {
var code = nextProps.code;
this.setState({
code: code
});
}
}, {
key: 'shouldComponentUpdate',
value: function shouldComponentUpdate(nextProps, nextState) {
return nextState.code !== this.state.code || nextState.showCode !== this.state.showCode;
}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {
// clear pending changes before unmount
if (this.queuedChange) {
this.queuedChange.cancel();
}
}
}, {
key: 'handleChange',
value: function handleChange(code) {
var _this2 = this;
// clear pending changes before proceed
if (this.queuedChange) {
this.queuedChange.cancel();
}
// stored update action
var queuedChange = function queuedChange() {
return _this2.setState({
code: code
});
};
var previewDelay = this.context.config.previewDelay;
if (previewDelay) {
// if previewDelay is enabled debounce the code
this.queuedChange = (0, _debounce2.default)(queuedChange, previewDelay);
this.queuedChange();
} else {
// otherwise execute it
queuedChange();
}
}
}, {
key: 'handleCodeToggle',
value: function handleCodeToggle() {
this.setState({
showCode: !this.state.showCode
});
}
}, {
key: 'render',
value: function render() {
var _this3 = this;
var _state = this.state,
code = _state.code,
showCode = _state.showCode;
var _props = this.props,
evalInContext = _props.evalInContext,
index = _props.index,
name = _props.name;
var isolatedExample = this.context.isolatedExample;
return _react2.default.createElement(_PlaygroundRenderer2.default, {
code: code,
showCode: showCode,
index: index,
name: name,
isolatedExample: isolatedExample,
evalInContext: evalInContext,
onChange: function onChange(code) {
return _this3.handleChange(code);
},
onCodeToggle: function onCodeToggle() {
return _this3.handleCodeToggle();
}
});
}
}]);
return Playground;
}(_react.Component);
Playground.propTypes = {
code: _propTypes2.default.string.isRequired,
evalInContext: _propTypes2.default.func.isRequired,
index: _propTypes2.default.number.isRequired,
name: _propTypes2.default.string
};
Playground.contextTypes = {
config: _propTypes2.default.object.isRequired,
isolatedExample: _propTypes2.default.bool
};
exports.default = Playground;
/***/ }),
/* 829 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.PlaygroundRenderer = PlaygroundRenderer;
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(1);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _Editor = __webpack_require__(816);
var _Editor2 = _interopRequireDefault(_Editor);
var _Link = __webpack_require__(109);
var _Link2 = _interopRequireDefault(_Link);
var _Preview = __webpack_require__(834);
var _Preview2 = _interopRequireDefault(_Preview);
var _Styled = __webpack_require__(10);
var _Styled2 = _interopRequireDefault(_Styled);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var styles = function styles(_ref) {
var space = _ref.space,
color = _ref.color,
fontFamily = _ref.fontFamily,
fontSize = _ref.fontSize,
borderRadius = _ref.borderRadius;
return {
root: {
color: color.base,
position: 'relative',
marginBottom: space[4],
border: [[1, color.border, 'solid']],
borderRadius: [[borderRadius, borderRadius, 0, borderRadius]],
marginTop: space[0],
'&:hover $isolatedLink': {
isolate: false,
opacity: 1
}
},
preview: {
marginBottom: space[0],
padding: space[2]
},
codeToggle: {
position: 'absolute',
right: -1,
margin: 0,
padding: [[space[0], space[1]]],
fontFamily: fontFamily.base,
fontSize: fontSize.base,
lineHeight: 1,
color: color.link,
border: [[1, color.border, 'solid']],
borderTop: 0,
borderBottomLeftRadius: borderRadius,
borderBottomRightRadius: borderRadius,
cursor: 'pointer',
'&:hover, &:active': {
isolate: false,
color: color.linkHover
}
},
showCode: {
composes: '$codeToggle',
backgroundColor: color.baseBackground
},
hideCode: {
composes: '$codeToggle',
backgroundColor: color.codeBackground
},
isolatedLink: {
position: 'absolute',
top: 0,
right: 0,
padding: [[space[0], space[1]]],
fontFamily: fontFamily.base,
fontSize: fontSize.base,
opacity: 0,
transition: 'opacity ease-in-out .15s .2s'
}
};
};
function PlaygroundRenderer(_ref2) {
var classes = _ref2.classes,
code = _ref2.code,
showCode = _ref2.showCode,
name = _ref2.name,
index = _ref2.index,
isolatedExample = _ref2.isolatedExample,
evalInContext = _ref2.evalInContext,
onChange = _ref2.onChange,
onCodeToggle = _ref2.onCodeToggle;
return _react2.default.createElement(
'div',
{ className: classes.root },
_react2.default.createElement(
'div',
{ className: classes.preview, 'data-preview': name ? name : '' },
_react2.default.createElement(
'div',
{ className: classes.isolatedLink },
name && (isolatedExample ? _react2.default.createElement(
_Link2.default,
{ href: '#!/' + name },
'\u21FD Exit Isolation'
) : _react2.default.createElement(
_Link2.default,
{ href: '#!/' + name + '/' + index },
'Open isolated \u21E2'
))
),
_react2.default.createElement(_Preview2.default, { code: code, evalInContext: evalInContext })
),
showCode ? _react2.default.createElement(
'div',
null,
_react2.default.createElement(_Editor2.default, { code: code, onChange: onChange }),
_react2.default.createElement(
'button',
{ type: 'button', className: classes.hideCode, onClick: onCodeToggle },
'Hide code'
)
) : _react2.default.createElement(
'button',
{ type: 'button', className: classes.showCode, onClick: onCodeToggle },
'Show code'
)
);
}
PlaygroundRenderer.propTypes = {
classes: _propTypes2.default.object.isRequired,
code: _propTypes2.default.string.isRequired,
showCode: _propTypes2.default.bool.isRequired,
index: _propTypes2.default.number.isRequired,
evalInContext: _propTypes2.default.func.isRequired,
onChange: _propTypes2.default.func.isRequired,
onCodeToggle: _propTypes2.default.func.isRequired,
name: _propTypes2.default.string,
isolatedExample: _propTypes2.default.bool
};
exports.default = (0, _Styled2.default)(styles)(PlaygroundRenderer);
/***/ }),
/* 830 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _Playground = __webpack_require__(828);
Object.defineProperty(exports, 'default', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Playground).default;
}
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/***/ }),
/* 831 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.PlaygroundErrorRenderer = PlaygroundErrorRenderer;
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(1);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _Styled = __webpack_require__(10);
var _Styled2 = _interopRequireDefault(_Styled);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var styles = function styles(_ref) {
var fontFamily = _ref.fontFamily,
fontSize = _ref.fontSize,
color = _ref.color,
space = _ref.space;
return {
root: {
margin: [[-space[2], -space[2], -(space[2] + space[0])]],
padding: space[2],
lineHeight: 1.2,
fontSize: fontSize.small,
fontFamily: fontFamily.monospace,
color: color.error,
backgroundColor: color.errorBackground,
whiteSpace: 'pre'
}
};
};
function PlaygroundErrorRenderer(_ref2) {
var classes = _ref2.classes,
message = _ref2.message;
return _react2.default.createElement(
'pre',
{ className: classes.root },
message
);
}
PlaygroundErrorRenderer.propTypes = {
classes: _propTypes2.default.object.isRequired,
message: _propTypes2.default.string.isRequired
};
exports.default = (0, _Styled2.default)(styles)(PlaygroundErrorRenderer);
/***/ }),
/* 832 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _PlaygroundErrorRenderer = __webpack_require__(831);
Object.defineProperty(exports, 'default', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_PlaygroundErrorRenderer).default;
}
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/***/ }),
/* 833 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(1);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _reactDom = __webpack_require__(194);
var _reactDom2 = _interopRequireDefault(_reactDom);
var _noop = __webpack_require__(693);
var _noop2 = _interopRequireDefault(_noop);
var _buble = __webpack_require__(416);
var _PlaygroundError = __webpack_require__(832);
var _PlaygroundError2 = _interopRequireDefault(_PlaygroundError);
var _Wrapper = __webpack_require__(399);
var _Wrapper2 = _interopRequireDefault(_Wrapper);
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 react/no-multi-comp */
var _compileCode = function _compileCode(code, config) {
return (0, _buble.transform)(code, config).code;
};
// Wrap everything in a React component to leverage the state management of this component
var PreviewComponent = function (_Component) {
_inherits(PreviewComponent, _Component);
function PreviewComponent() {
_classCallCheck(this, PreviewComponent);
var _this = _possibleConstructorReturn(this, (PreviewComponent.__proto__ || Object.getPrototypeOf(PreviewComponent)).call(this));
_this.state = {};
_this.setState = _this.setState.bind(_this);
_this.setInitialState = _this.setInitialState.bind(_this);
return _this;
}
// Synchronously set initial state, so it will be ready before first render
// Ignore all consequent calls
_createClass(PreviewComponent, [{
key: 'setInitialState',
value: function setInitialState(initialState) {
Object.assign(this.state, initialState);
this.setInitialState = _noop2.default;
}
}, {
key: 'render',
value: function render() {
return this.props.component(this.state, this.setState, this.setInitialState);
}
}]);
return PreviewComponent;
}(_react.Component);
PreviewComponent.propTypes = {
component: _propTypes2.default.func.isRequired
};
var Preview = function (_Component2) {
_inherits(Preview, _Component2);
function Preview() {
var _ref;
var _temp, _this2, _ret;
_classCallCheck(this, Preview);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this2 = _possibleConstructorReturn(this, (_ref = Preview.__proto__ || Object.getPrototypeOf(Preview)).call.apply(_ref, [this].concat(args))), _this2), _this2.state = {
error: null
}, _temp), _possibleConstructorReturn(_this2, _ret);
}
_createClass(Preview, [{
key: 'componentDidMount',
value: function componentDidMount() {
this.executeCode();
}
}, {
key: 'shouldComponentUpdate',
value: function shouldComponentUpdate(nextProps, nextState) {
return this.state.error !== nextState.error || this.props.code !== nextProps.code;
}
}, {
key: 'componentDidUpdate',
value: function componentDidUpdate(prevProps) {
if (this.props.code !== prevProps.code) {
this.executeCode();
}
}
}, {
key: 'executeCode',
value: function executeCode() {
var _this3 = this;
this.setState({
error: null
});
var code = this.props.code;
if (!code) {
return;
}
var compiledCode = this.compileCode(code);
if (!compiledCode) {
return;
}
var exampleComponent = this.evalInContext(compiledCode);
var wrappedComponent = _react2.default.createElement(
_Wrapper2.default,
null,
_react2.default.createElement(PreviewComponent, { component: exampleComponent })
);
window.requestAnimationFrame(function () {
try {
_reactDom2.default.render(wrappedComponent, _this3.mountNode);
} catch (err) {
_this3.handleError(err);
}
});
}
}, {
key: 'compileCode',
value: function compileCode(code) {
try {
return _compileCode(code, this.context.config.compilerConfig);
} catch (err) {
this.handleError(err);
}
return false;
}
}, {
key: 'evalInContext',
value: function evalInContext(compiledCode) {
// 1. Use setter/with to call our callback function when user write `initialState = {...}`
// 2. Wrap code in JSON.stringify/eval to catch the component and return it
var exampleComponentCode = '\n\t\t\tvar stateWrapper = {\n\t\t\t\tset initialState(value) {\n\t\t\t\t\t__setInitialState(value)\n\t\t\t\t},\n\t\t\t}\n\t\t\twith (stateWrapper) {\n\t\t\t\treturn eval(' + JSON.stringify(compiledCode) + ')\n\t\t\t}\n\t\t';
return this.props.evalInContext(exampleComponentCode);
}
}, {
key: 'handleError',
value: function handleError(err) {
if (this.mountNode) {
_reactDom2.default.unmountComponentAtNode(this.mountNode);
}
this.setState({
error: err.toString()
});
console.error(err); // eslint-disable-line no-console
}
}, {
key: 'render',
value: function render() {
var _this4 = this;
var error = this.state.error;
return _react2.default.createElement(
'div',
null,
_react2.default.createElement('div', { ref: function ref(_ref2) {
return _this4.mountNode = _ref2;
} }),
error && _react2.default.createElement(_PlaygroundError2.default, { message: error })
);
}
}]);
return Preview;
}(_react.Component);
Preview.propTypes = {
code: _propTypes2.default.string.isRequired,
evalInContext: _propTypes2.default.func.isRequired
};
Preview.contextTypes = {
config: _propTypes2.default.object.isRequired
};
exports.default = Preview;
/***/ }),
/* 834 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _Preview = __webpack_require__(833);
Object.defineProperty(exports, 'default', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Preview).default;
}
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/***/ }),
/* 835 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.PropsRenderer = PropsRenderer;
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(1);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _reactGroup = __webpack_require__(289);
var _reactGroup2 = _interopRequireDefault(_reactGroup);
var _Arguments = __webpack_require__(298);
var _Arguments2 = _interopRequireDefault(_Arguments);
var _Code = __webpack_require__(180);
var _Code2 = _interopRequireDefault(_Code);
var _JsDoc = __webpack_require__(181);
var _JsDoc2 = _interopRequireDefault(_JsDoc);
var _Markdown = __webpack_require__(36);
var _Markdown2 = _interopRequireDefault(_Markdown);
var _Name = __webpack_require__(182);
var _Name2 = _interopRequireDefault(_Name);
var _Styled = __webpack_require__(10);
var _Styled2 = _interopRequireDefault(_Styled);
var _map = __webpack_require__(263);
var _map2 = _interopRequireDefault(_map);
var _util = __webpack_require__(837);
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 styles = function styles(_ref) {
var space = _ref.space,
color = _ref.color,
fontFamily = _ref.fontFamily,
fontSize = _ref.fontSize;
return {
table: {
width: '100%',
borderCollapse: 'collapse'
},
tableHead: {
borderBottom: [[1, color.border, 'solid']]
},
cell: {
color: color.base,
paddingRight: space[2],
paddingTop: space[1],
verticalAlign: 'top',
fontFamily: fontFamily.base,
fontSize: fontSize.small
},
cellHeading: {
color: color.base,
paddingRight: space[2],
paddingBottom: space[1],
textAlign: 'left',
fontFamily: fontFamily.base,
fontWeight: 'bold',
fontSize: fontSize.small
},
cellDesc: {
color: color.base,
width: '99%',
paddingLeft: space[2],
paddingRight: 0
},
required: {
fontFamily: fontFamily.base,
fontSize: fontSize.small,
color: color.light
},
name: {
fontSize: fontSize.small,
color: color.name
},
type: {
fontSize: fontSize.small,
color: color.type
},
function: {
fontFamily: fontFamily.base,
fontSize: fontSize.small,
color: color.light,
borderBottom: [[1, 'dotted', color.lightest]]
},
heading: {
marginBottom: 3,
fontWeight: 'bold',
fontSize: 13
},
para: {
marginBottom: 15,
fontSize: 13
}
};
};
function renderType(type) {
if (!type) {
return 'unknown';
}
var name = type.name;
switch (name) {
case 'arrayOf':
return type.value.name + '[]';
case 'objectOf':
return '{' + renderType(type.value) + '}';
case 'instanceOf':
return type.value;
default:
return name;
}
}
function renderEnum(prop) {
if (!Array.isArray((0, _util.getType)(prop).value)) {
return _react2.default.createElement(
'span',
null,
(0, _util.getType)(prop).value
);
}
var values = (0, _util.getType)(prop).value.map(function (_ref2) {
var value = _ref2.value;
return _react2.default.createElement(
_Code2.default,
{ key: value },
(0, _util.showSpaces)((0, _util.unquote)(value))
);
});
return _react2.default.createElement(
'span',
null,
'One of: ',
_react2.default.createElement(
_reactGroup2.default,
{ separator: ', ', inline: true },
values
)
);
}
function PropsRenderer(_ref3) {
var classes = _ref3.classes,
props = _ref3.props;
function renderRow(prop, name) {
var deprecated = !!(prop.tags && prop.tags.deprecated);
return _react2.default.createElement(
'tr',
{ key: name },
_react2.default.createElement(
'td',
{ className: classes.cell },
_react2.default.createElement(_Name2.default, { name: name, deprecated: deprecated })
),
_react2.default.createElement(
'td',
{ className: classes.cell },
_react2.default.createElement(
_Code2.default,
{ className: classes.type },
renderType((0, _util.getType)(prop))
)
),
_react2.default.createElement(
'td',
{ className: classes.cell },
renderDefault(prop)
),
_react2.default.createElement(
'td',
{ className: classes.cell + ' ' + classes.cellDesc },
renderDescription(prop)
)
);
}
function renderDefault(prop) {
if (prop.required) {
return _react2.default.createElement(
'span',
{ className: classes.required },
'Required'
);
} else if (prop.defaultValue) {
if (prop.type && prop.type.name === 'func') {
return _react2.default.createElement(
'span',
{ className: classes.function, title: (0, _util.showSpaces)((0, _util.unquote)(prop.defaultValue.value)) },
'Function'
);
}
return _react2.default.createElement(
_Code2.default,
null,
(0, _util.showSpaces)((0, _util.unquote)(prop.defaultValue.value))
);
}
return '';
}
function renderDescription(prop) {
var description = prop.description,
_prop$tags = prop.tags,
tags = _prop$tags === undefined ? {} : _prop$tags;
var extra = renderExtra(prop);
var args = [].concat(_toConsumableArray(tags.arg || []), _toConsumableArray(tags.argument || []), _toConsumableArray(tags.param || []));
return _react2.default.createElement(
'div',
null,
description && _react2.default.createElement(_Markdown2.default, { text: description }),
extra && _react2.default.createElement(
'div',
{ className: classes.para },
extra
),
_react2.default.createElement(_JsDoc2.default, tags),
args.length > 0 && _react2.default.createElement(
'div',
null,
_react2.default.createElement(
'h4',
{ className: classes.heading },
'Arguments'
),
_react2.default.createElement(_Arguments2.default, { args: args })
)
);
}
function renderExtra(prop) {
var type = (0, _util.getType)(prop);
if (!type) {
return null;
}
switch (type.name) {
case 'enum':
return renderEnum(prop);
case 'union':
return renderUnion(prop);
case 'shape':
return renderShape(prop.type.value);
case 'arrayOf':
if (type.value.name === 'shape') {
return renderShape(prop.type.value.value);
}
return null;
case 'objectOf':
if (type.value.name === 'shape') {
return renderShape(prop.type.value.value);
}
return null;
default:
return null;
}
}
function renderUnion(prop) {
if (!Array.isArray((0, _util.getType)(prop).value)) {
return _react2.default.createElement(
'span',
null,
(0, _util.getType)(prop).value
);
}
var values = (0, _util.getType)(prop).value.map(function (value) {
return _react2.default.createElement(
_Code2.default,
{ key: value.name, className: classes.type },
renderType(value)
);
});
return _react2.default.createElement(
'span',
null,
'One of type: ',
_react2.default.createElement(
_reactGroup2.default,
{ separator: ', ', inline: true },
values
)
);
}
function renderShape(props) {
var rows = [];
for (var name in props) {
var prop = props[name];
var defaultValue = renderDefault(prop);
var description = prop.description;
rows.push(_react2.default.createElement(
'div',
{ key: name },
_react2.default.createElement(
_Code2.default,
{ className: classes.name },
name
),
': ',
_react2.default.createElement(
_Code2.default,
{ className: classes.type },
renderType(prop)
),
defaultValue && ' — ',
defaultValue,
description && ' — ',
description && _react2.default.createElement(_Markdown2.default, { text: description, inline: true })
));
}
return rows;
}
return _react2.default.createElement(
'table',
{ className: classes.table },
_react2.default.createElement(
'thead',
{ className: classes.tableHead },
_react2.default.createElement(
'tr',
null,
_react2.default.createElement(
'th',
{ className: classes.cellHeading },
'Name'
),
_react2.default.createElement(
'th',
{ className: classes.cellHeading },
'Type'
),
_react2.default.createElement(
'th',
{ className: classes.cellHeading },
'Default'
),
_react2.default.createElement(
'th',
{ className: classes.cellHeading + ' ' + classes.cellDesc },
'Description'
)
)
),
_react2.default.createElement(
'tbody',
null,
(0, _map2.default)(props, renderRow)
)
);
}
PropsRenderer.propTypes = {
classes: _propTypes2.default.object.isRequired,
props: _propTypes2.default.object.isRequired
};
exports.default = (0, _Styled2.default)(styles)(PropsRenderer);
/***/ }),
/* 836 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _PropsRenderer = __webpack_require__(835);
Object.defineProperty(exports, 'default', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_PropsRenderer).default;
}
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/***/ }),
/* 837 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.unquote = unquote;
exports.getType = getType;
exports.showSpaces = showSpaces;
/**
* Remove quotes around given string.
*
* @param {string} string
* @returns {string}
*/
function unquote(string) {
return string.replace(/^['"]|['"]$/g, '');
}
/**
* Return prop type object.
*
* @param {object} prop
* @returns {object}
*/
function getType(prop) {
return prop.flowType || prop.type;
}
/**
* Show starting and ending whitespace around given string.
*
* @param {string} string
* @returns {string}
*/
function showSpaces(string) {
return string.replace(/^\s|\s$/g, '␣');
}
/***/ }),
/* 838 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = ReactComponent;
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(1);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _Props = __webpack_require__(836);
var _Props2 = _interopRequireDefault(_Props);
var _Methods = __webpack_require__(826);
var _Methods2 = _interopRequireDefault(_Methods);
var _Examples = __webpack_require__(299);
var _Examples2 = _interopRequireDefault(_Examples);
var _ReactComponentRenderer = __webpack_require__(839);
var _ReactComponentRenderer2 = _interopRequireDefault(_ReactComponentRenderer);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var ExamplePlaceholder = false ? require('rsg-components/ExamplePlaceholder').default : function () {
return _react2.default.createElement('div', null);
};
function ReactComponent(_ref, _ref2) {
var component = _ref.component;
var _ref2$isolatedCompone = _ref2.isolatedComponent,
isolatedComponent = _ref2$isolatedCompone === undefined ? false : _ref2$isolatedCompone;
var name = component.name,
slug = component.slug,
pathLine = component.pathLine;
var _component$props = component.props,
description = _component$props.description,
props = _component$props.props,
examples = _component$props.examples,
methods = _component$props.methods,
tags = _component$props.tags;
if (!name) {
return null;
}
return _react2.default.createElement(_ReactComponentRenderer2.default, {
name: name,
slug: slug,
pathLine: pathLine,
description: description,
props: props && _react2.default.createElement(_Props2.default, { props: props }),
methods: methods.length > 0 && _react2.default.createElement(_Methods2.default, { methods: methods }),
examples: examples.length > 0 ? _react2.default.createElement(_Examples2.default, { examples: examples, name: name }) : _react2.default.createElement(ExamplePlaceholder, { name: name }),
isolated: isolatedComponent,
tags: tags
});
}
ReactComponent.propTypes = {
component: _propTypes2.default.object.isRequired
};
ReactComponent.contextTypes = {
isolatedComponent: _propTypes2.default.bool
};
/***/ }),
/* 839 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ReactComponentRenderer = ReactComponentRenderer;
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(1);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _Link = __webpack_require__(109);
var _Link2 = _interopRequireDefault(_Link);
var _Heading = __webpack_require__(300);
var _Heading2 = _interopRequireDefault(_Heading);
var _Markdown = __webpack_require__(36);
var _Markdown2 = _interopRequireDefault(_Markdown);
var _JsDoc = __webpack_require__(181);
var _JsDoc2 = _interopRequireDefault(_JsDoc);
var _Styled = __webpack_require__(10);
var _Styled2 = _interopRequireDefault(_Styled);
var _classnames = __webpack_require__(37);
var _classnames2 = _interopRequireDefault(_classnames);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
var styles = function styles(_ref) {
var color = _ref.color,
fontSize = _ref.fontSize,
fontFamily = _ref.fontFamily,
space = _ref.space;
return {
root: {
marginBottom: space[6],
fontSize: fontSize.text,
'&:hover $isolatedLink': {
isolate: false,
opacity: 1
}
},
header: {
position: 'relative',
marginBottom: space[3]
},
isolatedLink: {
position: 'absolute',
top: 0,
right: 0,
fontFamily: fontFamily.base,
fontSize: fontSize.base,
opacity: 0,
transition: 'opacity ease-in-out .15s .2s'
},
primaryHeading: {
color: color.base,
position: 'relative',
marginTop: 0,
marginBottom: space[1],
fontFamily: fontFamily.base,
fontSize: fontSize.h2,
fontWeight: 'normal'
},
heading: {
color: color.base,
margin: [[0, 0, space[1]]],
fontFamily: fontFamily.base,
fontSize: fontSize.h4,
fontWeight: 'normal'
},
pathLine: {
fontFamily: fontFamily.monospace,
color: color.light,
fontSize: fontSize.small
},
description: {
color: color.base,
marginBottom: space[3],
fontSize: fontSize.text
},
subsection: {
marginBottom: space[4]
},
isDeprecated: {
textDecoration: 'line-through',
color: color.light
}
};
};
function ReactComponentRenderer(_ref2) {
var classes = _ref2.classes,
name = _ref2.name,
slug = _ref2.slug,
pathLine = _ref2.pathLine,
description = _ref2.description,
props = _ref2.props,
methods = _ref2.methods,
tags = _ref2.tags,
examples = _ref2.examples,
_ref2$isolated = _ref2.isolated,
isolated = _ref2$isolated === undefined ? false : _ref2$isolated;
var headingClasses = (0, _classnames2.default)(classes.primaryHeading, _defineProperty({}, classes.isDeprecated, tags.deprecated));
return _react2.default.createElement(
'div',
{ className: classes.root, id: name + '-container' },
_react2.default.createElement(
'header',
{ className: classes.header },
_react2.default.createElement(
_Heading2.default,
{ level: 2, className: headingClasses, slug: slug },
name
),
_react2.default.createElement(
'div',
{ className: classes.pathLine },
pathLine
),
_react2.default.createElement(
'div',
{ className: classes.isolatedLink },
isolated ? _react2.default.createElement(
_Link2.default,
{ href: '/' },
'\u2190 Back'
) : _react2.default.createElement(
_Link2.default,
{ href: '#!/' + name },
'Open isolated \u21E2'
)
)
),
_react2.default.createElement(
'div',
{ className: classes.description },
description && _react2.default.createElement(_Markdown2.default, { text: description }),
_react2.default.createElement(_JsDoc2.default, tags)
),
props && _react2.default.createElement(
'div',
{ className: classes.subsection },
_react2.default.createElement(
'h3',
{ className: classes.heading },
'Props'
),
props
),
methods && _react2.default.createElement(
'div',
{ className: classes.subsection },
_react2.default.createElement(
'h3',
{ className: classes.heading },
'Methods'
),
methods
),
examples
);
}
ReactComponentRenderer.propTypes = {
classes: _propTypes2.default.object.isRequired,
tags: _propTypes2.default.object,
name: _propTypes2.default.string.isRequired,
slug: _propTypes2.default.string.isRequired,
pathLine: _propTypes2.default.string.isRequired,
description: _propTypes2.default.string,
props: _propTypes2.default.node,
methods: _propTypes2.default.node,
examples: _propTypes2.default.node,
isolated: _propTypes2.default.bool
};
ReactComponentRenderer.defaultProps = {
tags: {}
};
exports.default = (0, _Styled2.default)(styles)(ReactComponentRenderer);
/***/ }),
/* 840 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _ReactComponent = __webpack_require__(838);
Object.defineProperty(exports, 'default', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_ReactComponent).default;
}
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/***/ }),
/* 841 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = Section;
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(1);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _Examples = __webpack_require__(299);
var _Examples2 = _interopRequireDefault(_Examples);
var _Components = __webpack_require__(811);
var _Components2 = _interopRequireDefault(_Components);
var _Sections = __webpack_require__(301);
var _Sections2 = _interopRequireDefault(_Sections);
var _SectionRenderer = __webpack_require__(842);
var _SectionRenderer2 = _interopRequireDefault(_SectionRenderer);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function Section(_ref) {
var section = _ref.section;
var name = section.name,
slug = section.slug,
content = section.content,
components = section.components,
sections = section.sections;
var contentJsx = content && _react2.default.createElement(_Examples2.default, { examples: content });
var componentsJsx = components && _react2.default.createElement(_Components2.default, {
components: components
});
var sectionsJsx = sections && _react2.default.createElement(_Sections2.default, {
sections: sections
});
return _react2.default.createElement(_SectionRenderer2.default, {
name: name,
slug: slug,
content: contentJsx,
components: componentsJsx,
sections: sectionsJsx
});
}
Section.propTypes = {
section: _propTypes2.default.object.isRequired
};
/***/ }),
/* 842 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.SectionRenderer = SectionRenderer;
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(1);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _Styled = __webpack_require__(10);
var _Styled2 = _interopRequireDefault(_Styled);
var _Heading = __webpack_require__(300);
var _Heading2 = _interopRequireDefault(_Heading);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var styles = function styles(_ref) {
var space = _ref.space,
fontFamily = _ref.fontFamily,
fontSize = _ref.fontSize;
return {
root: {
marginBottom: space[4]
},
heading: {
margin: [[0, 0, space[2]]],
fontFamily: fontFamily.base,
fontSize: fontSize.h1
}
};
};
function SectionRenderer(_ref2) {
var classes = _ref2.classes,
name = _ref2.name,
slug = _ref2.slug,
content = _ref2.content,
components = _ref2.components,
sections = _ref2.sections;
return _react2.default.createElement(
'section',
{ className: classes.root },
name && _react2.default.createElement(
_Heading2.default,
{ level: 1, slug: slug, className: classes.heading },
name
),
content,
components,
sections
);
}
SectionRenderer.propTypes = {
classes: _propTypes2.default.object.isRequired,
name: _propTypes2.default.string,
slug: _propTypes2.default.string,
content: _propTypes2.default.node,
components: _propTypes2.default.node,
sections: _propTypes2.default.node
};
exports.default = (0, _Styled2.default)(styles)(SectionRenderer);
/***/ }),
/* 843 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _Section = __webpack_require__(841);
Object.defineProperty(exports, 'default', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Section).default;
}
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/***/ }),
/* 844 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = Sections;
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(1);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _Section = __webpack_require__(843);
var _Section2 = _interopRequireDefault(_Section);
var _SectionsRenderer = __webpack_require__(845);
var _SectionsRenderer2 = _interopRequireDefault(_SectionsRenderer);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function Sections(_ref) {
var sections = _ref.sections;
return _react2.default.createElement(
_SectionsRenderer2.default,
null,
sections.map(function (section, idx) {
return _react2.default.createElement(_Section2.default, {
key: idx,
section: section
});
})
);
}
Sections.propTypes = {
sections: _propTypes2.default.array.isRequired
};
/***/ }),
/* 845 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.SectionsRenderer = SectionsRenderer;
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(1);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _Styled = __webpack_require__(10);
var _Styled2 = _interopRequireDefault(_Styled);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var styles = function styles() {
return {
// Just default jss-isolate rules
root: {}
};
};
function SectionsRenderer(_ref) {
var classes = _ref.classes,
children = _ref.children;
return _react2.default.createElement(
'section',
{ className: classes.root },
children
);
}
SectionsRenderer.propTypes = {
classes: _propTypes2.default.object.isRequired,
children: _propTypes2.default.node
};
exports.default = (0, _Styled2.default)(styles)(SectionsRenderer);
/***/ }),
/* 846 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(1);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _TableOfContents = __webpack_require__(852);
var _TableOfContents2 = _interopRequireDefault(_TableOfContents);
var _StyleGuideRenderer = __webpack_require__(847);
var _StyleGuideRenderer2 = _interopRequireDefault(_StyleGuideRenderer);
var _Sections = __webpack_require__(301);
var _Sections2 = _interopRequireDefault(_Sections);
var _Welcome = __webpack_require__(854);
var _Welcome2 = _interopRequireDefault(_Welcome);
var _consts = __webpack_require__(305);
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 StyleGuide = function (_Component) {
_inherits(StyleGuide, _Component);
function StyleGuide() {
_classCallCheck(this, StyleGuide);
return _possibleConstructorReturn(this, (StyleGuide.__proto__ || Object.getPrototypeOf(StyleGuide)).apply(this, arguments));
}
_createClass(StyleGuide, [{
key: 'getChildContext',
value: function getChildContext() {
return {
codeKey: this.props.codeKey,
config: this.props.config,
isolatedComponent: this.props.isolatedComponent,
isolatedExample: this.props.isolatedExample
};
}
}, {
key: 'render',
value: function render() {
var _props = this.props,
config = _props.config,
sections = _props.sections,
welcomeScreen = _props.welcomeScreen,
patterns = _props.patterns,
isolatedComponent = _props.isolatedComponent;
if (welcomeScreen) {
return _react2.default.createElement(_Welcome2.default, { patterns: patterns });
}
return _react2.default.createElement(
_StyleGuideRenderer2.default,
{
title: config.title,
homepageUrl: _consts.HOMEPAGE,
toc: _react2.default.createElement(_TableOfContents2.default, { sections: sections }),
hasSidebar: config.showSidebar && !isolatedComponent
},
_react2.default.createElement(_Sections2.default, { sections: sections })
);
}
}]);
return StyleGuide;
}(_react.Component);
StyleGuide.propTypes = {
codeKey: _propTypes2.default.number.isRequired,
config: _propTypes2.default.object.isRequired,
sections: _propTypes2.default.array.isRequired,
welcomeScreen: _propTypes2.default.bool,
patterns: _propTypes2.default.array,
isolatedComponent: _propTypes2.default.bool,
isolatedExample: _propTypes2.default.bool
};
StyleGuide.childContextTypes = {
codeKey: _propTypes2.default.number.isRequired,
config: _propTypes2.default.object.isRequired,
isolatedComponent: _propTypes2.default.bool,
isolatedExample: _propTypes2.default.bool
};
StyleGuide.defaultProps = {
isolatedComponent: false
};
exports.default = StyleGuide;
/***/ }),
/* 847 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.StyleGuideRenderer = StyleGuideRenderer;
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(1);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _Logo = __webpack_require__(823);
var _Logo2 = _interopRequireDefault(_Logo);
var _Markdown = __webpack_require__(36);
var _Markdown2 = _interopRequireDefault(_Markdown);
var _Styled = __webpack_require__(10);
var _Styled2 = _interopRequireDefault(_Styled);
var _classnames = __webpack_require__(37);
var _classnames2 = _interopRequireDefault(_classnames);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
var styles = function styles(_ref) {
var _content;
var color = _ref.color,
fontFamily = _ref.fontFamily,
fontSize = _ref.fontSize,
sidebarWidth = _ref.sidebarWidth,
mq = _ref.mq,
space = _ref.space,
maxWidth = _ref.maxWidth;
return {
root: {
color: color.base,
backgroundColor: color.baseBackground
},
hasSidebar: _defineProperty({
paddingLeft: sidebarWidth
}, mq.small, {
paddingLeft: 0
}),
content: (_content = {
maxWidth: maxWidth,
padding: [[space[2], space[4]]],
margin: [[0, 'auto']]
}, _defineProperty(_content, mq.small, {
padding: space[2]
}), _defineProperty(_content, 'display', 'block'), _content),
sidebar: _defineProperty({
backgroundColor: color.sidebarBackground,
border: [[color.border, 'solid']],
borderWidth: [[0, 1, 0, 0]],
position: 'fixed',
top: 0,
left: 0,
bottom: 0,
width: sidebarWidth,
overflow: 'auto'
}, mq.small, {
position: 'static',
width: 'auto',
borderWidth: [[1, 0, 0, 0]],
paddingBottom: space[0]
}),
logo: {
padding: space[2],
borderBottom: [[1, color.border, 'solid']]
},
footer: {
display: 'block',
color: color.light,
fontFamily: fontFamily.base,
fontSize: fontSize.small
}
};
};
function StyleGuideRenderer(_ref2) {
var classes = _ref2.classes,
title = _ref2.title,
homepageUrl = _ref2.homepageUrl,
children = _ref2.children,
toc = _ref2.toc,
hasSidebar = _ref2.hasSidebar;
return _react2.default.createElement(
'div',
{ className: (0, _classnames2.default)(classes.root, hasSidebar && classes.hasSidebar) },
_react2.default.createElement(
'main',
{ className: classes.content },
children,
_react2.default.createElement(
'footer',
{ className: classes.footer },
_react2.default.createElement(_Markdown2.default, { text: 'Generated with [React Styleguidist](' + homepageUrl + ')' })
)
),
hasSidebar && _react2.default.createElement(
'div',
{ className: classes.sidebar },
_react2.default.createElement(
'div',
{ className: classes.logo },
_react2.default.createElement(
_Logo2.default,
null,
title
)
),
toc
)
);
}
StyleGuideRenderer.propTypes = {
classes: _propTypes2.default.object.isRequired,
title: _propTypes2.default.string.isRequired,
homepageUrl: _propTypes2.default.string.isRequired,
children: _propTypes2.default.node.isRequired,
toc: _propTypes2.default.node.isRequired,
hasSidebar: _propTypes2.default.bool
};
exports.default = (0, _Styled2.default)(styles)(StyleGuideRenderer);
/***/ }),
/* 848 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _StyleGuide = __webpack_require__(846);
Object.defineProperty(exports, 'default', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_StyleGuide).default;
}
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/***/ }),
/* 849 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(1);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _addStyles = __webpack_require__(855);
var _addStyles2 = _interopRequireDefault(_addStyles);
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; }
exports.default = function (styles) {
return function (WrappedComponent) {
var _class, _temp;
return _temp = _class = function (_Component) {
_inherits(_class, _Component);
function _class() {
_classCallCheck(this, _class);
return _possibleConstructorReturn(this, (_class.__proto__ || Object.getPrototypeOf(_class)).apply(this, arguments));
}
_createClass(_class, [{
key: 'componentWillMount',
value: function componentWillMount() {
var componentName = WrappedComponent.name.replace(/Renderer$/, '');
this.classes = (0, _addStyles2.default)(styles, this.context.config || {}, componentName);
}
}, {
key: 'render',
value: function render() {
return _react2.default.createElement(WrappedComponent, _extends({}, this.props, { classes: this.classes }));
}
}]);
return _class;
}(_react.Component), _class.contextTypes = {
config: _propTypes2.default.object
}, _temp;
};
};
/***/ }),
/* 850 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(1);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _utils = __webpack_require__(303);
var _ComponentsList = __webpack_require__(813);
var _ComponentsList2 = _interopRequireDefault(_ComponentsList);
var _TableOfContentsRenderer = __webpack_require__(851);
var _TableOfContentsRenderer2 = _interopRequireDefault(_TableOfContentsRenderer);
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; }
var TableOfContents = function (_Component) {
_inherits(TableOfContents, _Component);
function TableOfContents() {
var _ref;
var _temp, _this, _ret;
_classCallCheck(this, TableOfContents);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = TableOfContents.__proto__ || Object.getPrototypeOf(TableOfContents)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
searchTerm: ''
}, _temp), _possibleConstructorReturn(_this, _ret);
}
_createClass(TableOfContents, [{
key: 'renderLevel',
value: function renderLevel(sections) {
var _this2 = this;
var items = sections.map(function (section) {
var children = [].concat(_toConsumableArray(section.sections || []), _toConsumableArray(section.components || []));
return Object.assign({}, section, {
heading: !!section.name && children.length > 0,
content: children.length > 0 && _this2.renderLevel(children)
});
});
return _react2.default.createElement(_ComponentsList2.default, { items: items });
}
}, {
key: 'renderSections',
value: function renderSections() {
var searchTerm = this.state.searchTerm;
var sections = this.props.sections;
// If there is only one section, we treat it as a root section
// In this case the name of the section won't be rendered and it won't get left padding
var firstLevel = sections.length === 1 ? sections[0].components : sections;
var filtered = (0, _utils.filterSectionsByName)(firstLevel, searchTerm);
return this.renderLevel(filtered);
}
}, {
key: 'render',
value: function render() {
var _this3 = this;
var searchTerm = this.state.searchTerm;
return _react2.default.createElement(
_TableOfContentsRenderer2.default,
{
searchTerm: searchTerm,
onSearchTermChange: function onSearchTermChange(searchTerm) {
return _this3.setState({ searchTerm: searchTerm });
}
},
this.renderSections()
);
}
}]);
return TableOfContents;
}(_react.Component);
TableOfContents.propTypes = {
sections: _propTypes2.default.array.isRequired
};
exports.default = TableOfContents;
/***/ }),
/* 851 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.TableOfContentsRenderer = TableOfContentsRenderer;
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(1);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _Styled = __webpack_require__(10);
var _Styled2 = _interopRequireDefault(_Styled);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var styles = function styles(_ref) {
var space = _ref.space,
color = _ref.color,
fontFamily = _ref.fontFamily,
fontSize = _ref.fontSize,
borderRadius = _ref.borderRadius;
return {
root: {
fontFamily: fontFamily.base
},
search: {
padding: space[2]
},
input: {
display: 'block',
width: '100%',
padding: space[1],
color: color.base,
backgroundColor: color.baseBackground,
fontFamily: fontFamily.base,
fontSize: fontSize.base,
border: [[1, color.border, 'solid']],
borderRadius: borderRadius,
transition: 'border-color ease-in-out .15s',
'&:focus': {
isolate: false,
borderColor: color.link,
outline: 0
}
}
};
};
function TableOfContentsRenderer(_ref2) {
var classes = _ref2.classes,
children = _ref2.children,
searchTerm = _ref2.searchTerm,
onSearchTermChange = _ref2.onSearchTermChange;
return _react2.default.createElement(
'div',
null,
_react2.default.createElement(
'div',
{ className: classes.root },
_react2.default.createElement(
'div',
{ className: classes.search },
_react2.default.createElement('input', {
value: searchTerm,
className: classes.input,
placeholder: 'Filter by name',
onChange: function onChange(event) {
return onSearchTermChange(event.target.value);
}
})
),
children
)
);
}
TableOfContentsRenderer.propTypes = {
classes: _propTypes2.default.object.isRequired,
children: _propTypes2.default.node,
searchTerm: _propTypes2.default.string.isRequired,
onSearchTermChange: _propTypes2.default.func.isRequired
};
exports.default = (0, _Styled2.default)(styles)(TableOfContentsRenderer);
/***/ }),
/* 852 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _TableOfContents = __webpack_require__(850);
Object.defineProperty(exports, 'default', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_TableOfContents).default;
}
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/***/ }),
/* 853 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.WelcomeRenderer = WelcomeRenderer;
var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(1);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _Markdown = __webpack_require__(36);
var _Markdown2 = _interopRequireDefault(_Markdown);
var _Styled = __webpack_require__(10);
var _Styled2 = _interopRequireDefault(_Styled);
var _consts = __webpack_require__(305);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var styles = function styles(_ref) {
var space = _ref.space,
maxWidth = _ref.maxWidth;
return {
root: {
maxWidth: maxWidth,
margin: [[0, 'auto']],
padding: space[4]
}
};
};
function WelcomeRenderer(_ref2) {
var classes = _ref2.classes,
patterns = _ref2.patterns;
return _react2.default.createElement(
'div',
{ className: classes.root },
_react2.default.createElement(_Markdown2.default, {
text: '\n# Welcome to React Styleguidist!\n\n**We couldn\u2019t find any components** using these patterns:\n\n' + patterns.map(function (p) {
return '- `' + p + '`';
}).join('\n') + '\n\nCreate **styleguide.config.js** file in your project root directory like this:\n\n module.exports = {\n components: \'src/components/**/*.js\'\n };\n\nRead more in the [locating components guide](' + _consts.DOCS_COMPONENTS + ').\n\t\t\t\t'
})
);
}
WelcomeRenderer.propTypes = {
classes: _propTypes2.default.object.isRequired,
patterns: _propTypes2.default.array.isRequired
};
exports.default = (0, _Styled2.default)(styles)(WelcomeRenderer);
/***/ }),
/* 854 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _WelcomeRenderer = __webpack_require__(853);
Object.defineProperty(exports, 'default', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_WelcomeRenderer).default;
}
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/***/ }),
/* 855 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _jss = __webpack_require__(85);
var _jss2 = _interopRequireDefault(_jss);
var _merge = __webpack_require__(692);
var _merge2 = _interopRequireDefault(_merge);
var _memoize = __webpack_require__(264);
var _memoize2 = _interopRequireDefault(_memoize);
var _theme = __webpack_require__(861);
var theme = _interopRequireWildcard(_theme);
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.default = (0, _memoize2.default)(function (styles, config, componentName) {
var mergedTheme = (0, _merge2.default)(theme, config.theme);
var mergedStyles = (0, _merge2.default)(styles(mergedTheme), config.styles && config.styles[componentName]);
return _jss2.default.createStyleSheet(mergedStyles, { meta: componentName }).attach().classes;
});
/***/ }),
/* 856 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
__webpack_require__(859);
__webpack_require__(860);
/***/ }),
/* 857 */
/***/ (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; }; /* eslint-disable */
exports.default = jssIsolate;
var _inherited = __webpack_require__(858);
var _inherited2 = _interopRequireDefault(_inherited);
var _noninherited = __webpack_require__(302);
var _noninherited2 = _interopRequireDefault(_noninherited);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var debounce = function debounce(fn) {
var timeoutId = void 0;
return function () {
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
clearTimeout(timeoutId);
timeoutId = setTimeout(function () {
return fn.apply(undefined, args);
});
};
};
var setSelector = debounce(function (rule, selectors) {
rule.selector = selectors.join(',\n');
});
var getReset = function getReset() {
var option = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'inherited';
switch (option) {
case 'inherited':
return _inherited2.default;
case 'nonInherited':
return _noninherited2.default;
case 'all':
return _extends({}, _inherited2.default, _noninherited2.default);
default:
// If option is an object, merge it with the `inherited` props.
return _extends({}, _inherited2.default, option);
}
};
function jssIsolate() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var globalIsolate = options.isolate == null ? true : options.isolate;
var selectors = [];
var resetSheet = null;
var resetRule = void 0;
function onProcessRule(rule, sheet) {
if (rule.type !== 'regular' || !sheet || sheet === resetSheet || !rule.style) {
return;
}
var parent = rule.options.parent;
if (parent && (parent.type === 'keyframe' || parent.type === 'conditional')) {
return;
}
var isolate = globalIsolate;
if (sheet.options.isolate != null) {
isolate = sheet.options.isolate;
}
if (rule.style.isolate != null) {
isolate = rule.style.isolate;
delete rule.style.isolate;
}
if (isolate === false) {
return;
}
// Option `isolate` may be for e.g. `{isolate: 'root'}`.
// In this case it must match the rule name in order to isolate it.
if (isolate !== rule.name && typeof isolate === 'string') {
return;
}
// Create a separate style sheet once and use it for all rules.
if (!resetSheet && rule.options.jss) {
resetSheet = rule.options.jss.createStyleSheet({}, {
link: true,
meta: 'jss-isolate',
// Lets make it always the first one in sheets for testing
// and specificity.
index: -Infinity
});
resetRule = resetSheet.addRule('reset', getReset(options.reset));
resetSheet.attach();
}
if (selectors.indexOf(rule.selector) === -1) {
selectors.push(rule.selector);
}
setSelector(resetRule, selectors);
};
return { onProcessRule: onProcessRule };
}
/***/ }),
/* 858 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
/* eslint-disable */
/**
* List of inheritable properties.
*
* Borrowed from https://github.com/suitcss/preprocessor/blob/master/lib/encapsulation.js
*/
exports.default = {
'border-collapse': 'separate',
'border-spacing': 0,
'caption-side': 'top',
'color': 'initial',
'cursor': 'auto',
'direction': 'initial',
'empty-cells': 'show',
'font': 'initial',
'font-size-adjust': 'none',
'font-family': 'initial',
'font-size': 'medium',
'font-style': 'normal',
'font-stretch': 'normal',
'font-variant': 'normal',
'font-weight': 'normal',
'letter-spacing': 'normal',
'line-height': 'normal',
'list-style-image': 'none',
'list-style-position': 'outside',
'list-style-type': 'disc',
'list-style': 'initial',
'orphans': 2,
'quotes': 'initial',
'tab-size': 8,
'text-align': 'initial',
'text-align-last': 'auto',
'text-decoration-color': 'initial',
'text-indent': 0,
'text-justify': 'auto',
'text-shadow': 'none',
'text-transform': 'none',
'visibility': 'visible',
'white-space': 'normal',
'widows': 2,
'word-break': 'normal',
'word-spacing': 'normal',
'word-wrap': 'normal'
};
/***/ }),
/* 859 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
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; };
// XXX: Waiting for release:
// https://github.com/cssinjs/jss-isolate/commit/c09c9355dfa02374971b8d929d13e651ac301990
// https://github.com/cssinjs/jss-isolate/pull/9
var _jss = __webpack_require__(85);
var _jss2 = _interopRequireDefault(_jss);
var _jssIsolate = __webpack_require__(857);
var _jssIsolate2 = _interopRequireDefault(_jssIsolate);
var _noninherited = __webpack_require__(302);
var _noninherited2 = _interopRequireDefault(_noninherited);
var _jssNested = __webpack_require__(476);
var _jssNested2 = _interopRequireDefault(_jssNested);
var _jssCamelCase = __webpack_require__(471);
var _jssCamelCase2 = _interopRequireDefault(_jssCamelCase);
var _jssDefaultUnit = __webpack_require__(474);
var _jssDefaultUnit2 = _interopRequireDefault(_jssDefaultUnit);
var _jssCompose = __webpack_require__(472);
var _jssCompose2 = _interopRequireDefault(_jssCompose);
var _jssGlobal = __webpack_require__(475);
var _jssGlobal2 = _interopRequireDefault(_jssGlobal);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
_jss2.default.setup({
plugins: [(0, _jssGlobal2.default)(), (0, _jssIsolate2.default)({
reset: _extends({}, _noninherited2.default, {
// “Global” styles for all components
boxSizing: 'border-box',
// Allow inheritance because it may be set on body and should be available for user components
fontFamily: 'inherit'
})
}), (0, _jssNested2.default)(), (0, _jssCamelCase2.default)(), (0, _jssDefaultUnit2.default)(), (0, _jssCompose2.default)()]
});
/***/ }),
/* 860 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _jss = __webpack_require__(85);
var _jss2 = _interopRequireDefault(_jss);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var styles = {
// Global styles
body: {
isolate: false,
margin: 0,
padding: 0,
border: 0
}
};
// Attach styles to body
var body = _jss2.default.createStyleSheet(styles).attach().classes.body;
document.body.classList.add(body);
/***/ }),
/* 861 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var spaceFactor = exports.spaceFactor = 8;
var space = exports.space = [spaceFactor / 2, // 4
spaceFactor, // 8
spaceFactor * 2, // 16
spaceFactor * 3, // 24
spaceFactor * 4, // 32
spaceFactor * 5, // 40
spaceFactor * 6];
var color = exports.color = {
base: '#333',
light: '#999',
lightest: '#ccc',
link: '#1978c8',
linkHover: '#f28a25',
border: '#e8e8e8',
name: '#7f9a44',
type: '#b77daa',
error: '#fff',
baseBackground: '#fff',
errorBackground: '#c00',
codeBackground: '#f5f5f5',
sidebarBackground: '#f5f5f5'
};
var fontFamily = exports.fontFamily = {
base: ['-apple-system', 'BlinkMacSystemFont', '"Segoe UI"', '"Roboto"', '"Oxygen"', '"Ubuntu"', '"Cantarell"', '"Fira Sans"', '"Droid Sans"', '"Helvetica Neue"', 'sans-serif'],
monospace: ['Consolas', '"Liberation Mono"', 'Menlo', 'monospace']
};
var fontSize = exports.fontSize = {
base: 15,
text: 16,
small: 13,
h1: 48,
h2: 36,
h3: 24,
h4: 18,
h5: 16,
h6: 16
};
var mq = exports.mq = {
small: '@media (max-width: 600px)'
};
var borderRadius = exports.borderRadius = 3;
var maxWidth = exports.maxWidth = 1000;
var sidebarWidth = exports.sidebarWidth = 200;
/***/ }),
/* 862 */
/***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__(330)(undefined);
// imports
// module
exports.push([module.i, "/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */\n\n/* Tomorrow Comment */\n.hljs-comment,\n.hljs-quote {\n color: #8e908c;\n}\n\n/* Tomorrow Red */\n.hljs-variable,\n.hljs-template-variable,\n.hljs-tag,\n.hljs-name,\n.hljs-selector-id,\n.hljs-selector-class,\n.hljs-regexp,\n.hljs-deletion {\n color: #c82829;\n}\n\n/* Tomorrow Orange */\n.hljs-number,\n.hljs-built_in,\n.hljs-builtin-name,\n.hljs-literal,\n.hljs-type,\n.hljs-params,\n.hljs-meta,\n.hljs-link {\n color: #f5871f;\n}\n\n/* Tomorrow Yellow */\n.hljs-attribute {\n color: #eab700;\n}\n\n/* Tomorrow Green */\n.hljs-string,\n.hljs-symbol,\n.hljs-bullet,\n.hljs-addition {\n color: #718c00;\n}\n\n/* Tomorrow Blue */\n.hljs-title,\n.hljs-section {\n color: #4271ae;\n}\n\n/* Tomorrow Purple */\n.hljs-keyword,\n.hljs-selector-tag {\n color: #8959a8;\n}\n\n.hljs {\n display: block;\n overflow-x: auto;\n background: white;\n color: #4d4d4c;\n padding: 0.5em;\n}\n\n.hljs-emphasis {\n font-style: italic;\n}\n\n.hljs-strong {\n font-weight: bold;\n}\n", ""]);
// exports
/***/ }),
/* 863 */
/***/ (function(module, exports, __webpack_require__) {
if (false) {
module.hot.accept([])
}
var requireMap = { 'react': __webpack_require__(0) };
var requireInRuntimeBase = __webpack_require__(21);
var requireInRuntime = requireInRuntimeBase.bind(null, requireMap);
var evalInContextBase = __webpack_require__(20);
var evalInContext = evalInContextBase.bind(null, "var React = require('react');", requireInRuntime);
module.exports = [
{
'type': 'code',
'content': '<Anchor>Inspire the lazy</Anchor>',
'evalInContext': evalInContext
},
{
'type': 'code',
'content': '<span style={{\'background-color\': \'#343434\'}}>\n <Anchor secondary>Inspire the lazy secondary</Anchor>\n</span>',
'evalInContext': evalInContext
}
]
/***/ }),
/* 864 */
/***/ (function(module, exports, __webpack_require__) {
if (false) {
module.hot.accept([])
}
var requireMap = {
'../button': __webpack_require__(121),
'react': __webpack_require__(0)
};
var requireInRuntimeBase = __webpack_require__(21);
var requireInRuntime = requireInRuntimeBase.bind(null, requireMap);
var evalInContextBase = __webpack_require__(20);
var evalInContext = evalInContextBase.bind(null, "var React = require('react');", requireInRuntime);
module.exports = [
{
'type': 'markdown',
'content': 'In the mockups, the spacing between elements is done through a baseline grid.\n\nWhat that means is that spacing is measured in `units` over a `base`. I.e. `1.5 unit` where the base is `6px` corresponds to `9px`.\n\n{insert image from sketch}\n\nTo allow a declarative way of defining spacing in every component in our UI framework, a composer was written that styles each component instance with based on the props passed to it. E.g.:\n\n```html\n<span class="hljs-tag">&lt;<span class="hljs-name">Button</span> <span class="hljs-attr">margin</span>=<span class="hljs-string">\'2\'</span>&gt;</span>Hello World<span class="hljs-tag">&lt;/<span class="hljs-name">Button</span>&gt;</span>\n```\n\nIs going to translate into a `<Button />` that has `12px` of margin.\n\nWhat enables this is the [`Baseline` composer](https://github.com/yldio/joyent-portal/blob/a5774063ed8caf2569aff2905af2d7dca7a01a52/ui/src/shared/composers/index.js#L51). \n\nThe Baseline composer is essentially an [HOC](https://medium.com/@dan_abramov/mixins-are-dead-long-live-higher-order-components-94a0d2f9e750): It exposes a function that accepts a Component as a parameter. That component is then wrapped in a [styled-component](https://github.com/styled-components/styled-components#overriding-component-styles). \n\nThe `styled-component` that wraps the Component just goes through a list of supported rules - see list below. From each rule it does the match to the corresponding prop and calculates the `rem`.\n\nList of supported props:\n\n- `border`\n- `margin`\n- `marginTop`\n- `marginRight`\n- `marginBottom`\n- `marginLeft`\n- `padding`\n- `paddingTop`\n- `paddingRight`\n- `paddingBottom`\n- `paddingLeft`\n- `borderTopWidth`\n- `borderRightWidth`\n- `borderBottomWidth`\n- `borderLeftWidth`\n\nTo use this composer, you just do it as you would with any other HOC:\n\n```js\n<span class="hljs-comment">// component implementation</span>\n<span class="hljs-keyword">const</span> Button = <span class="hljs-function">(<span class="hljs-params">props</span>) =&gt;</span> (\n <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">button</span>&gt;</span>my button<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span></span>\n);\n\n<span class="hljs-comment">// export Button wrapped</span>\n<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> Baseline(Button);\n```\n\nWhoever required that `<Button />`, will be able to declare any of the properties especified above and have the style of the component be applied accordingly.\n\n#### examples'
},
{
'type': 'code',
'content': 'const Button = require(\'../button\').default;\n\n<span>\n <Button marginRight=\'1\'>margin-right: 1</Button>\n <Button marginRight=\'2\'>margin-right: 2</Button>\n <Button marginRight=\'3\'>margin-right: 3</Button>\n <Button marginRight=\'4\'>margin-right: 4</Button>\n <Button>hello</Button>\n</span>',
'evalInContext': evalInContext
}
]
/***/ }),
/* 865 */
/***/ (function(module, exports, __webpack_require__) {
if (false) {
module.hot.accept([])
}
var requireMap = { 'react': __webpack_require__(0) };
var requireInRuntimeBase = __webpack_require__(21);
var requireInRuntime = requireInRuntimeBase.bind(null, requireMap);
var evalInContextBase = __webpack_require__(20);
var evalInContext = evalInContextBase.bind(null, "var React = require('react');", requireInRuntime);
module.exports = [
{
'type': 'markdown',
'content': '### with text'
},
{
'type': 'code',
'content': '<span>\n <Button>Inspire the lazy</Button>\n <span> </span>\n <Button href=\'#1\'>Inspire the lazy (anchor)</Button>\n</span>',
'evalInContext': evalInContext
},
{
'type': 'markdown',
'content': '### secondary'
},
{
'type': 'code',
'content': '<span>\n <Button secondary>Inspire the brave</Button>\n <span> </span>\n <Button href=\'#2\' secondary>Inspire the brave (anchor)</Button>\n</span>',
'evalInContext': evalInContext
},
{
'type': 'markdown',
'content': '### tertiary'
},
{
'type': 'code',
'content': '<span>\n <Button tertiary>Inspire the tertiary</Button>\n <span> </span>\n <Button href=\'#3\' tertiary>Inspire the tertiary (anchor)</Button>\n</span>',
'evalInContext': evalInContext
},
{
'type': 'markdown',
'content': '### disabled'
},
{
'type': 'code',
'content': '<span>\n <Button disabled>Inspire the liars</Button>\n <span> </span>\n <Button href=\'#4\' disabled>Inspire the liars (anchor)</Button>\n</span>',
'evalInContext': evalInContext
}
]
/***/ }),
/* 866 */
/***/ (function(module, exports, __webpack_require__) {
if (false) {
module.hot.accept([])
}
var requireMap = {
'./': __webpack_require__(390),
'react': __webpack_require__(0)
};
var requireInRuntimeBase = __webpack_require__(21);
var requireInRuntime = requireInRuntimeBase.bind(null, requireMap);
var evalInContextBase = __webpack_require__(20);
var evalInContext = evalInContextBase.bind(null, "var React = require('react');", requireInRuntime);
module.exports = [
{
'type': 'code',
'content': 'const {\n CardDescription,\n CardHeader,\n CardMeta,\n CardOptions,\n CardOutlet,\n CardSubTitle,\n CardTitle,\n CardView,\n CardGroupView\n} = require(\'./\');\n\n<Card>\n <CardView>\n <CardMeta>\n <CardTitle>Title</CardTitle>\n <CardSubTitle>Subtitle</CardSubTitle>\n <CardDescription>Description</CardDescription>\n </CardMeta>\n <CardOutlet>Outlet</CardOutlet>\n </CardView>\n <CardOptions />\n</Card>',
'evalInContext': evalInContext
},
{
'type': 'markdown',
'content': '#### `collapsed`'
},
{
'type': 'code',
'content': 'const {\n CardDescription,\n CardHeader,\n CardMeta,\n CardOptions,\n CardOutlet,\n CardSubTitle,\n CardTitle,\n CardView,\n CardGroupView\n} = require(\'./\');\n\n<Card collapsed>\n <CardView>\n <CardMeta>\n <CardTitle>Title</CardTitle>\n <CardSubTitle>Subtitle</CardSubTitle>\n <CardDescription>Description</CardDescription>\n </CardMeta>\n <CardOutlet>Outlet</CardOutlet>\n </CardView>\n <CardOptions />\n</Card>',
'evalInContext': evalInContext
},
{
'type': 'markdown',
'content': '#### `headed`'
},
{
'type': 'code',
'content': 'const {\n CardDescription,\n CardHeader,\n CardMeta,\n CardOptions,\n CardOutlet,\n CardSubTitle,\n CardTitle,\n CardView,\n CardGroupView\n} = require(\'./\');\n\n<Card headed>\n <CardHeader>\n <CardMeta>\n <CardTitle>Title</CardTitle>\n <CardSubTitle>Subtitle</CardSubTitle>\n <CardDescription>Description</CardDescription>\n </CardMeta>\n <CardOptions />\n </CardHeader>\n <CardView>\n <CardMeta>\n <CardDescription>Description</CardDescription>\n </CardMeta>\n <CardOutlet>Outlet</CardOutlet>\n </CardView>\n</Card>',
'evalInContext': evalInContext
},
{
'type': 'markdown',
'content': '#### `headed` and `collapsed`'
},
{
'type': 'code',
'content': 'const {\n CardDescription,\n CardHeader,\n CardMeta,\n CardOptions,\n CardOutlet,\n CardSubTitle,\n CardTitle,\n CardView,\n CardGroupView\n} = require(\'./\');\n\n<Card collapsed headed>\n <CardHeader>\n <CardMeta>\n <CardTitle>Title</CardTitle>\n <CardSubTitle>Subtitle</CardSubTitle>\n <CardDescription>Description</CardDescription>\n </CardMeta>\n <CardOptions />\n </CardHeader>\n <CardView>\n <CardMeta>\n <CardDescription>Description</CardDescription>\n </CardMeta>\n <CardOutlet>Outlet</CardOutlet>\n </CardView>\n</Card>',
'evalInContext': evalInContext
},
{
'type': 'markdown',
'content': '#### `stacked`'
},
{
'type': 'code',
'content': 'const {\n CardDescription,\n CardHeader,\n CardMeta,\n CardOptions,\n CardOutlet,\n CardSubTitle,\n CardTitle,\n CardView,\n CardGroupView\n} = require(\'./\');\n\n<Card stacked>\n <CardView>\n <CardMeta>\n <CardTitle>Title</CardTitle>\n <CardSubTitle>Subtitle</CardSubTitle>\n <CardDescription>Description</CardDescription>\n </CardMeta>\n <CardOutlet>Outlet</CardOutlet>\n </CardView>\n <CardOptions />\n</Card>',
'evalInContext': evalInContext
},
{
'type': 'markdown',
'content': '#### group'
},
{
'type': 'code',
'content': 'const {\n CardDescription,\n CardHeader,\n CardMeta,\n CardOptions,\n CardOutlet,\n CardSubTitle,\n CardTitle,\n CardView,\n CardGroupView\n} = require(\'./\');\n\n<Card headed>\n <CardHeader>\n <CardMeta>\n <CardTitle>Title</CardTitle>\n <CardSubTitle>Subtitle</CardSubTitle>\n <CardDescription>Description</CardDescription>\n </CardMeta>\n <CardOptions />\n </CardHeader>\n <CardGroupView>\n <Card flat>\n <CardView>\n <CardMeta>\n <CardTitle>Title</CardTitle>\n </CardMeta>\n <CardOutlet>Outlet</CardOutlet>\n </CardView>\n </Card>\n <Card flat>\n <CardView>\n <CardMeta>\n <CardTitle>Title</CardTitle>\n <CardSubTitle>Subtitle</CardSubTitle>\n <CardDescription>Description</CardDescription>\n </CardMeta>\n <CardOutlet>Outlet</CardOutlet>\n </CardView>\n </Card>\n <Card flat stacked>\n <CardView>\n <CardMeta>\n <CardTitle>Title</CardTitle>\n <CardSubTitle>Subtitle</CardSubTitle>\n </CardMeta>\n <CardOutlet>Outlet</CardOutlet>\n </CardView>\n </Card>\n </CardGroupView>\n</Card>',
'evalInContext': evalInContext
}
]
/***/ }),
/* 867 */
/***/ (function(module, exports, __webpack_require__) {
if (false) {
module.hot.accept([])
}
var requireMap = {
'./group': __webpack_require__(66),
'./label': __webpack_require__(81),
'./meta': __webpack_require__(82),
'react-styled-flexboxgrid': __webpack_require__(59),
'react': __webpack_require__(0)
};
var requireInRuntimeBase = __webpack_require__(21);
var requireInRuntime = requireInRuntimeBase.bind(null, requireMap);
var evalInContextBase = __webpack_require__(20);
var evalInContext = evalInContextBase.bind(null, "var React = require('react');", requireInRuntime);
module.exports = [
{
'type': 'code',
'content': 'const FormGroup = require(\'./group\').default;\nconst Label = require(\'./label\').default;\n\n<FormGroup>\n <Checkbox />\n <Label>Check this out!</Label>\n</FormGroup>',
'evalInContext': evalInContext
},
{
'type': 'markdown',
'content': '#### `checked`'
},
{
'type': 'code',
'content': 'const FormGroup = require(\'./group\').default;\nconst Label = require(\'./label\').default;\n\n<FormGroup>\n <Checkbox checked />\n <Label>Check this out!</Label>\n</FormGroup>',
'evalInContext': evalInContext
},
{
'type': 'markdown',
'content': '#### `disabled`'
},
{
'type': 'code',
'content': 'const FormGroup = require(\'./group\').default;\nconst Label = require(\'./label\').default;\n\n<FormGroup>\n <Checkbox disabled />\n <Label>Check this out!</Label>\n</FormGroup>',
'evalInContext': evalInContext
},
{
'type': 'markdown',
'content': '#### label before'
},
{
'type': 'code',
'content': 'const FormGroup = require(\'./group\').default;\nconst Label = require(\'./label\').default;\n\n<FormGroup>\n <Label>Check this out!</Label>\n <Checkbox />\n</FormGroup>',
'evalInContext': evalInContext
},
{
'type': 'markdown',
'content': '#### warning'
},
{
'type': 'code',
'content': 'const FormMeta = require(\'./meta\').default;\nconst FormGroup = require(\'./group\').default;\nconst Label = require(\'./label\').default;\n\n<div>\n <FormGroup meta={{warning: \'Unexpected meta warning!\'}}>\n <Checkbox />\n <Label>Check this out!</Label>\n <FormMeta left />\n </FormGroup>\n <FormGroup warning=\'Unexpected group warning!\'>\n <Checkbox />\n <Label>Check this out!</Label>\n <FormMeta left />\n </FormGroup>\n <FormGroup>\n <Checkbox />\n <Label>Check this out!</Label>\n <FormMeta left warning>\n Unexpected children warning!\n </FormMeta>\n </FormGroup>\n <FormGroup>\n <Checkbox />\n <Label>Check this out!</Label>\n <FormMeta left warning=\'Unexpected inline warning!\' />\n </FormGroup>\n</div>',
'evalInContext': evalInContext
},
{
'type': 'markdown',
'content': '#### error'
},
{
'type': 'code',
'content': 'const FormMeta = require(\'./meta\').default;\nconst FormGroup = require(\'./group\').default;\nconst Label = require(\'./label\').default;\n\n<div>\n <FormGroup meta={{error: \'Unexpected meta error!\'}}>\n <Checkbox />\n <Label>Check this out!</Label>\n <FormMeta left />\n </FormGroup>\n <FormGroup error=\'Unexpected group error!\'>\n <Checkbox />\n <Label>Check this out!</Label>\n <FormMeta left />\n </FormGroup>\n <FormGroup>\n <Checkbox />\n <Label>Check this out!</Label>\n <FormMeta left error>\n Unexpected children error!\n </FormMeta>\n </FormGroup>\n <FormGroup>\n <Checkbox />\n <Label>Check this out!</Label>\n <FormMeta left error=\'Unexpected inline error!\' />\n </FormGroup>\n</div>',
'evalInContext': evalInContext
},
{
'type': 'markdown',
'content': '#### success'
},
{
'type': 'code',
'content': 'const FormMeta = require(\'./meta\').default;\nconst FormGroup = require(\'./group\').default;\nconst Label = require(\'./label\').default;\n\n<div>\n <FormGroup meta={{success: \'Unexpected meta success!\'}}>\n <Checkbox />\n <Label>Check this out!</Label>\n <FormMeta left />\n </FormGroup>\n <FormGroup success=\'Unexpected group success!\'>\n <Checkbox />\n <Label>Check this out!</Label>\n <FormMeta left />\n </FormGroup>\n <FormGroup>\n <Checkbox />\n <Label>Check this out!</Label>\n <FormMeta left success>\n Unexpected children success!\n </FormMeta>\n </FormGroup>\n <FormGroup>\n <Checkbox />\n <Label>Check this out!</Label>\n <FormMeta left success=\'Unexpected inline success!\' />\n </FormGroup>\n</div>',
'evalInContext': evalInContext
},
{
'type': 'markdown',
'content': '#### label before with status'
},
{
'type': 'code',
'content': 'const FormMeta = require(\'./meta\').default;\nconst FormGroup = require(\'./group\').default;\nconst Label = require(\'./label\').default;\n\n<FormGroup>\n <Label>Check this out!</Label>\n <Checkbox />\n <FormMeta success left>\n Thanks for ticking, you are a star!\n </FormMeta>\n</FormGroup>',
'evalInContext': evalInContext
},
{
'type': 'markdown',
'content': '#### multiple with meta'
},
{
'type': 'code',
'content': 'const { Col, Row } = require(\'react-styled-flexboxgrid\');\nconst FormMeta = require(\'./meta\').default;\nconst FormGroup = require(\'./group\').default;\nconst Label = require(\'./label\').default;\n\n<Row>\n <Col md={6}>\n <FormGroup>\n <Row>\n <Col>\n <Label>Check this out!</Label>\n <Checkbox />\n </Col>\n </Row>\n <Row>\n <Col>\n <FormMeta success left>\n Thanks for ticking, you are a star!\n </FormMeta>\n </Col>\n </Row>\n </FormGroup>\n </Col>\n <Col md={6}>\n <FormGroup>\n <Row>\n <Col>\n <FormMeta success left>\n Thanks for ticking, you are a star!\n </FormMeta>\n </Col>\n </Row>\n <Row>\n <Col>\n <Label>Check this out!</Label>\n <Checkbox />\n </Col>\n </Row>\n </FormGroup>\n </Col>\n</Row>',
'evalInContext': evalInContext
}
]
/***/ }),
/* 868 */
/***/ (function(module, exports, __webpack_require__) {
if (false) {
module.hot.accept([])
}
var requireMap = {
'./group': __webpack_require__(66),
'./label': __webpack_require__(81),
'../text/small': __webpack_require__(401),
'./meta': __webpack_require__(82),
'react': __webpack_require__(0)
};
var requireInRuntimeBase = __webpack_require__(21);
var requireInRuntime = requireInRuntimeBase.bind(null, requireMap);
var evalInContextBase = __webpack_require__(20);
var evalInContext = evalInContextBase.bind(null, "var React = require('react');", requireInRuntime);
module.exports = [
{
'type': 'code',
'content': '<Input placeholder=\'I am the placeholder\' />',
'evalInContext': evalInContext
},
{
'type': 'markdown',
'content': '#### `type`'
},
{
'type': 'code',
'content': 'const FormGroup = require(\'./group\').default;\nconst Label = require(\'./label\').default;\nconst Small = require(\'../text/small\').default;\n\n<FormGroup>\n <Label>Email Address</Label>\n <Input placeholder=\'Enter email\' type=\'email\' />\n <Small>We&apos;ll never share your email with anyone else.</Small>\n</FormGroup>',
'evalInContext': evalInContext
},
{
'type': 'markdown',
'content': '#### error'
},
{
'type': 'code',
'content': 'const FormGroup = require(\'./group\').default;\nconst Label = require(\'./label\').default;\nconst FormMeta = require(\'./meta\').default;\n\n<div>\n <FormGroup>\n <Label>Email Address</Label>\n <Input placeholder=\'Enter email\' type=\'email\' />\n <FormMeta error=\'Unexpected inline error!\' />\n </FormGroup>\n <FormGroup error=\'Unexpected group error!\'>\n <Label>Email Address</Label>\n <Input placeholder=\'Enter email\' type=\'email\' />\n <FormMeta />\n </FormGroup>\n <FormGroup meta={{error: \'Unexpected meta error!\'}}>\n <Label>Email Address</Label>\n <Input placeholder=\'Enter email\' type=\'email\' />\n <FormMeta />\n </FormGroup>\n <FormGroup>\n <Label>Email Address</Label>\n <Input placeholder=\'Enter email\' type=\'email\' />\n <FormMeta error>\n Unexpected children error!\n </FormMeta>\n </FormGroup>\n</div>',
'evalInContext': evalInContext
},
{
'type': 'markdown',
'content': '#### warning'
},
{
'type': 'code',
'content': 'const FormGroup = require(\'./group\').default;\nconst Label = require(\'./label\').default;\nconst FormMeta = require(\'./meta\').default;\n\n<div>\n <FormGroup>\n <Label>Email Address</Label>\n <Input placeholder=\'Enter email\' type=\'email\' />\n <FormMeta warning=\'Unexpected inline warning!\' />\n </FormGroup>\n <FormGroup warning=\'Unexpected group warning!\'>\n <Label>Email Address</Label>\n <Input placeholder=\'Enter email\' type=\'email\' />\n <FormMeta />\n </FormGroup>\n <FormGroup meta={{warning: \'Unexpected meta warning!\'}}>\n <Label>Email Address</Label>\n <Input placeholder=\'Enter email\' type=\'email\' />\n <FormMeta />\n </FormGroup>\n <FormGroup>\n <Label>Email Address</Label>\n <Input placeholder=\'Enter email\' type=\'email\' />\n <FormMeta warning>\n Unexpected children warning!\n </FormMeta>\n </FormGroup>\n</div>',
'evalInContext': evalInContext
},
{
'type': 'markdown',
'content': '#### success'
},
{
'type': 'code',
'content': 'const FormGroup = require(\'./group\').default;\nconst Label = require(\'./label\').default;\nconst FormMeta = require(\'./meta\').default;\n\n<div>\n <FormGroup>\n <Label>Email Address</Label>\n <Input placeholder=\'Enter email\' type=\'email\' />\n <FormMeta success=\'Unexpected inline success!\' />\n </FormGroup>\n <FormGroup success=\'Unexpected group success!\'>\n <Label>Email Address</Label>\n <Input placeholder=\'Enter email\' type=\'email\' />\n <FormMeta />\n </FormGroup>\n <FormGroup meta={{success: \'Unexpected meta success!\'}}>\n <Label>Email Address</Label>\n <Input placeholder=\'Enter email\' type=\'email\' />\n <FormMeta />\n </FormGroup>\n <FormGroup>\n <Label>Email Address</Label>\n <Input placeholder=\'Enter email\' type=\'email\' />\n <FormMeta success>\n Unexpected children success!\n </FormMeta>\n </FormGroup>\n</div>',
'evalInContext': evalInContext
},
{
'type': 'markdown',
'content': '#### meta'
},
{
'type': 'code',
'content': 'const FormGroup = require(\'./group\').default;\nconst Label = require(\'./label\').default;\nconst FormMeta = require(\'./meta\').default;\n\n<FormGroup>\n <Label>Email Address</Label>\n <Input placeholder=\'Enter email\' type=\'email\' />\n <FormMeta>I&#39;m a children of meta</FormMeta>\n</FormGroup>',
'evalInContext': evalInContext
}
]
/***/ }),
/* 869 */
/***/ (function(module, exports, __webpack_require__) {
if (false) {
module.hot.accept([])
}
var requireMap = {
'./radio': __webpack_require__(204),
'./group': __webpack_require__(66),
'./label': __webpack_require__(81),
'./legend': __webpack_require__(203),
'./meta': __webpack_require__(82),
'react': __webpack_require__(0)
};
var requireInRuntimeBase = __webpack_require__(21);
var requireInRuntime = requireInRuntimeBase.bind(null, requireMap);
var evalInContextBase = __webpack_require__(20);
var evalInContext = evalInContextBase.bind(null, "var React = require('react');", requireInRuntime);
module.exports = [
{
'type': 'code',
'content': 'const { RadioList } = require(\'./radio\');\nconst FormGroup = require(\'./group\').default;\nconst Label = require(\'./label\').default;\nconst Legend = require(\'./legend\').default;\n\n<FormGroup name=\'who-killed\'>\n <Legend>Who killed the radio star?</Legend>\n <RadioList>\n <Radio value=\'video\' checked>\n <Label>Video</Label>\n </Radio>\n <Radio value=\'tv\'>\n <Label>TV</Label>\n </Radio>\n <Radio value=\'netflix\'>\n <Label>Netflix</Label>\n </Radio>\n </RadioList>\n</FormGroup>',
'evalInContext': evalInContext
},
{
'type': 'markdown',
'content': '#### `disabled`'
},
{
'type': 'code',
'content': 'const { RadioList } = require(\'./radio\');\nconst FormGroup = require(\'./group\').default;\nconst Legend = require(\'./legend\').default;\n\n<FormGroup name=\'who-killed\' disabled>\n <Legend>Who killed the radio star?</Legend>\n <RadioList>\n <Radio value=\'video\'>Video</Radio>\n <Radio value=\'tv\'>TV</Radio>\n <Radio value=\'netflix\'>Netflix</Radio>\n </RadioList>\n</FormGroup>',
'evalInContext': evalInContext
},
{
'type': 'markdown',
'content': '#### error'
},
{
'type': 'code',
'content': 'const { RadioList } = require(\'./radio\');\nconst FormGroup = require(\'./group\').default;\nconst Legend = require(\'./legend\').default;\nconst FormMeta = require(\'./meta\').default;\n\n<div>\n <FormGroup name=\'who-killed\'>\n <Legend>Who killed the radio star?</Legend>\n <FormMeta error=\'Unexpected inline error!\' left />\n <RadioList>\n <Radio value=\'video\'>Video</Radio>\n <Radio value=\'tv\'>TV</Radio>\n <Radio value=\'netflix\'>Netflix</Radio>\n </RadioList>\n </FormGroup>\n <FormGroup name=\'who-killed\' error=\'Unexpected group error!\'>\n <Legend>Who killed the radio star?</Legend>\n <FormMeta left />\n <RadioList>\n <Radio value=\'video\'>Video</Radio>\n <Radio value=\'tv\'>TV</Radio>\n <Radio value=\'netflix\'>Netflix</Radio>\n </RadioList>\n </FormGroup>\n <FormGroup name=\'who-killed\' meta={{error: \'Unexpected meta error!\'}} margin-bottom=\'1\'>\n <Legend>Who killed the radio star?</Legend>\n <FormMeta left />\n <RadioList>\n <Radio value=\'video\'>Video</Radio>\n <Radio value=\'tv\'>TV</Radio>\n <Radio value=\'netflix\'>Netflix</Radio>\n </RadioList>\n </FormGroup>\n <FormGroup name=\'who-killed\'>\n <Legend>Who killed the radio star?</Legend>\n <FormMeta error left>\n Unexpected children error!\n </FormMeta>\n <RadioList>\n <Radio value=\'video\'>Video</Radio>\n <Radio value=\'tv\'>TV</Radio>\n <Radio value=\'netflix\'>Netflix</Radio>\n </RadioList>\n </FormGroup>\n</div>',
'evalInContext': evalInContext
},
{
'type': 'markdown',
'content': '#### warning'
},
{
'type': 'code',
'content': 'const { RadioList } = require(\'./radio\');\nconst FormGroup = require(\'./group\').default;\nconst Legend = require(\'./legend\').default;\nconst FormMeta = require(\'./meta\').default;\n\n<div>\n <FormGroup name=\'who-killed\'>\n <Legend>Who killed the radio star?</Legend>\n <FormMeta warning=\'Unexpected inline warning!\' left />\n <RadioList>\n <Radio value=\'video\'>Video</Radio>\n <Radio value=\'tv\'>TV</Radio>\n <Radio value=\'netflix\'>Netflix</Radio>\n </RadioList>\n </FormGroup>\n <FormGroup name=\'who-killed\' warning=\'Unexpected group warning!\'>\n <Legend>Who killed the radio star?</Legend>\n <FormMeta left />\n <RadioList>\n <Radio value=\'video\'>Video</Radio>\n <Radio value=\'tv\'>TV</Radio>\n <Radio value=\'netflix\'>Netflix</Radio>\n </RadioList>\n </FormGroup>\n <FormGroup name=\'who-killed\' meta={{warning: \'Unexpected meta warning!\'}}>\n <Legend>Who killed the radio star?</Legend>\n <FormMeta left />\n <RadioList>\n <Radio value=\'video\'>Video</Radio>\n <Radio value=\'tv\'>TV</Radio>\n <Radio value=\'netflix\'>Netflix</Radio>\n </RadioList>\n </FormGroup>\n <FormGroup name=\'who-killed\'>\n <Legend>Who killed the radio star?</Legend>\n <FormMeta left warning>\n Unexpected children warning!\n </FormMeta>\n <RadioList>\n <Radio value=\'video\'>Video</Radio>\n <Radio value=\'tv\'>TV</Radio>\n <Radio value=\'netflix\'>Netflix</Radio>\n </RadioList>\n </FormGroup>\n</div>',
'evalInContext': evalInContext
},
{
'type': 'markdown',
'content': '#### success'
},
{
'type': 'code',
'content': 'const { RadioList } = require(\'./radio\');\nconst FormGroup = require(\'./group\').default;\nconst Legend = require(\'./legend\').default;\nconst FormMeta = require(\'./meta\').default;\n\n<div>\n <FormGroup name=\'who-killed\'>\n <Legend>Who killed the radio star?</Legend>\n <FormMeta success=\'Unexpected inline success!\' left />\n <RadioList>\n <Radio value=\'video\'>Video</Radio>\n <Radio value=\'tv\'>TV</Radio>\n <Radio value=\'netflix\'>Netflix</Radio>\n </RadioList>\n </FormGroup>\n <FormGroup name=\'who-killed\' success=\'Unexpected group success!\'>\n <Legend>Who killed the radio star?</Legend>\n <FormMeta left />\n <RadioList>\n <Radio value=\'video\'>Video</Radio>\n <Radio value=\'tv\'>TV</Radio>\n <Radio value=\'netflix\'>Netflix</Radio>\n </RadioList>\n </FormGroup>\n <FormGroup name=\'who-killed\' meta={{success: \'Unexpected meta success!\'}}>\n <Legend>Who killed the radio star?</Legend>\n <FormMeta left />\n <RadioList>\n <Radio value=\'video\'>Video</Radio>\n <Radio value=\'tv\'>TV</Radio>\n <Radio value=\'netflix\'>Netflix</Radio>\n </RadioList>\n </FormGroup>\n <FormGroup name=\'who-killed\'>\n <Legend>Who killed the radio star?</Legend>\n <FormMeta left success>\n Unexpected children success!\n </FormMeta>\n <RadioList>\n <Radio value=\'video\'>Video</Radio>\n <Radio value=\'tv\'>TV</Radio>\n <Radio value=\'netflix\'>Netflix</Radio>\n </RadioList>\n </FormGroup>\n</div>',
'evalInContext': evalInContext
},
{
'type': 'markdown',
'content': '#### meta before'
},
{
'type': 'code',
'content': 'const { RadioList } = require(\'./radio\');\nconst FormGroup = require(\'./group\').default;\nconst Legend = require(\'./legend\').default;\nconst FormMeta = require(\'./meta\').default;\n\n<FormGroup name=\'who-killed\'>\n <Legend>Who killed the radio star?</Legend>\n <FormMeta left>I&#39;m a children of meta</FormMeta>\n <RadioList>\n <Radio value=\'video\'>Video</Radio>\n <Radio value=\'tv\'>TV</Radio>\n <Radio value=\'netflix\'>Netflix</Radio>\n </RadioList>\n</FormGroup>',
'evalInContext': evalInContext
}
]
/***/ }),
/* 870 */
/***/ (function(module, exports, __webpack_require__) {
if (false) {
module.hot.accept([])
}
var requireMap = {
'./group': __webpack_require__(66),
'./label': __webpack_require__(81),
'./meta': __webpack_require__(82),
'react': __webpack_require__(0)
};
var requireInRuntimeBase = __webpack_require__(21);
var requireInRuntime = requireInRuntimeBase.bind(null, requireMap);
var evalInContextBase = __webpack_require__(20);
var evalInContext = evalInContextBase.bind(null, "var React = require('react');", requireInRuntime);
module.exports = [
{
'type': 'code',
'content': 'const FormGroup = require(\'./group\').default;\nconst Label = require(\'./label\').default;\n\n<FormGroup>\n <Label>Your location</Label>\n <Select placeholder=\'Select Location\'>\n <option value=\'1\'>Amsterdam, EU</option>\n <option>San Francisco, USA</option>\n <option>Seoul, South Korea</option>\n <option>Tokyo, Japan</option>\n </Select>\n</FormGroup>',
'evalInContext': evalInContext
},
{
'type': 'markdown',
'content': '#### placeholder'
},
{
'type': 'code',
'content': '<Select>\n <option selected disabled>Select a datacenter</option>\n <option>Amsterdam, EU</option>\n <option>San Francisco, USA</option>\n <option>Seoul, South Korea</option>\n <option>Tokyo, Japan</option>\n</Select>',
'evalInContext': evalInContext
},
{
'type': 'markdown',
'content': '#### `disabled`'
},
{
'type': 'code',
'content': 'const FormGroup = require(\'./group\').default;\nconst Label = require(\'./label\').default;\n\n<FormGroup>\n <Label>Your location</Label>\n <Select disabled>\n <option selected disabled>Select Location</option>\n <option value=\'1\'>Amsterdam, EU</option>\n <option>San Francisco, USA</option>\n <option>Seoul, South Korea</option>\n <option>Tokyo, Japan</option>\n </Select>\n</FormGroup>',
'evalInContext': evalInContext
},
{
'type': 'markdown',
'content': '#### selected'
},
{
'type': 'code',
'content': 'const FormGroup = require(\'./group\').default;\nconst Label = require(\'./label\').default;\n\n<FormGroup>\n <Label>Your location</Label>\n <Select>\n <option selected disabled>Select Location</option>\n <option value=\'1\'>Amsterdam, EU</option>\n <option>San Francisco, USA</option>\n <option>Seoul, South Korea</option>\n <option>Tokyo, Japan</option>\n </Select>\n</FormGroup>',
'evalInContext': evalInContext
},
{
'type': 'markdown',
'content': '#### multiple'
},
{
'type': 'code',
'content': 'const FormGroup = require(\'./group\').default;\nconst Label = require(\'./label\').default;\n\n<FormGroup>\n <Label>Your location</Label>\n <Select multiple>\n <option>Amsterdam, EU</option>\n <option>San Francisco, USA</option>\n <option>Seoul, South Korea</option>\n <option>Tokyo, Japan</option>\n </Select>\n</FormGroup>',
'evalInContext': evalInContext
},
{
'type': 'markdown',
'content': '#### warning'
},
{
'type': 'code',
'content': 'const FormMeta = require(\'./meta\').default;\nconst FormGroup = require(\'./group\').default;\nconst Label = require(\'./label\').default;\n\n<div>\n <FormGroup>\n <Label>Your location</Label>\n <Select>\n <option>Amsterdam, EU</option>\n <option>San Francisco, USA</option>\n <option>Seoul, South Korea</option>\n <option>Tokyo, Japan</option>\n </Select>\n <FormMeta warning=\'Unexpected inline warning!\' />\n </FormGroup>\n <FormGroup warning=\'Unexpected group warning!\'>\n <Label>Your location</Label>\n <Select>\n <option>Amsterdam, EU</option>\n <option>San Francisco, USA</option>\n <option>Seoul, South Korea</option>\n <option>Tokyo, Japan</option>\n </Select>\n <FormMeta />\n </FormGroup>\n <FormGroup meta={{warning: \'Unexpected meta warning!\'}}>\n <Label>Your location</Label>\n <Select>\n <option>Amsterdam, EU</option>\n <option>San Francisco, USA</option>\n <option>Seoul, South Korea</option>\n <option>Tokyo, Japan</option>\n </Select>\n <FormMeta />\n </FormGroup>\n <FormGroup>\n <Label>Your location</Label>\n <Select>\n <option>Amsterdam, EU</option>\n <option>San Francisco, USA</option>\n <option>Seoul, South Korea</option>\n <option>Tokyo, Japan</option>\n </Select>\n <FormMeta warning>\n Unexpected children warning!\n </FormMeta>\n </FormGroup>\n</div>',
'evalInContext': evalInContext
},
{
'type': 'markdown',
'content': '#### error'
},
{
'type': 'code',
'content': 'const FormMeta = require(\'./meta\').default;\nconst FormGroup = require(\'./group\').default;\nconst Label = require(\'./label\').default;\n\n<div>\n <FormGroup>\n <Label>Your location</Label>\n <Select>\n <option>Amsterdam, EU</option>\n <option>San Francisco, USA</option>\n <option>Seoul, South Korea</option>\n <option>Tokyo, Japan</option>\n </Select>\n <FormMeta error=\'Unexpected inline error!\' />\n </FormGroup>\n <FormGroup error=\'Unexpected group error!\'>\n <Label>Your location</Label>\n <Select>\n <option>Amsterdam, EU</option>\n <option>San Francisco, USA</option>\n <option>Seoul, South Korea</option>\n <option>Tokyo, Japan</option>\n </Select>\n <FormMeta />\n </FormGroup>\n <FormGroup meta={{error: \'Unexpected meta error!\'}}>\n <Label>Your location</Label>\n <Select>\n <option>Amsterdam, EU</option>\n <option>San Francisco, USA</option>\n <option>Seoul, South Korea</option>\n <option>Tokyo, Japan</option>\n </Select>\n <FormMeta />\n </FormGroup>\n <FormGroup>\n <Label>Your location</Label>\n <Select>\n <option>Amsterdam, EU</option>\n <option>San Francisco, USA</option>\n <option>Seoul, South Korea</option>\n <option>Tokyo, Japan</option>\n </Select>\n <FormMeta error>\n Unexpected children error!\n </FormMeta>\n </FormGroup>\n</div>',
'evalInContext': evalInContext
},
{
'type': 'markdown',
'content': '#### success'
},
{
'type': 'code',
'content': 'const FormMeta = require(\'./meta\').default;\nconst FormGroup = require(\'./group\').default;\nconst Label = require(\'./label\').default;\n\n<div>\n <FormGroup>\n <Label>Your location</Label>\n <Select>\n <option>Amsterdam, EU</option>\n <option>San Francisco, USA</option>\n <option>Seoul, South Korea</option>\n <option>Tokyo, Japan</option>\n </Select>\n <FormMeta success=\'Unexpected inline success!\' />\n </FormGroup>\n <FormGroup success=\'Unexpected group success!\'>\n <Label>Your location</Label>\n <Select>\n <option>Amsterdam, EU</option>\n <option>San Francisco, USA</option>\n <option>Seoul, South Korea</option>\n <option>Tokyo, Japan</option>\n </Select>\n <FormMeta />\n </FormGroup>\n <FormGroup meta={{success: \'Unexpected meta success!\'}}>\n <Label>Your location</Label>\n <Select>\n <option>Amsterdam, EU</option>\n <option>San Francisco, USA</option>\n <option>Seoul, South Korea</option>\n <option>Tokyo, Japan</option>\n </Select>\n <FormMeta />\n </FormGroup>\n <FormGroup>\n <Label>Your location</Label>\n <Select>\n <option>Amsterdam, EU</option>\n <option>San Francisco, USA</option>\n <option>Seoul, South Korea</option>\n <option>Tokyo, Japan</option>\n </Select>\n <FormMeta success>\n Unexpected children success!\n </FormMeta>\n </FormGroup>\n</div>',
'evalInContext': evalInContext
},
{
'type': 'markdown',
'content': '#### meta'
},
{
'type': 'code',
'content': 'const FormMeta = require(\'./meta\').default;\nconst FormGroup = require(\'./group\').default;\nconst Label = require(\'./label\').default;\n\n<FormGroup>\n <Label>Your location</Label>\n <Select>\n <option>Amsterdam, EU</option>\n <option>San Francisco, USA</option>\n <option>Seoul, South Korea</option>\n <option>Tokyo, Japan</option>\n </Select>\n <FormMeta>\n I&#39;m a children of meta!\n </FormMeta>\n</FormGroup>',
'evalInContext': evalInContext
}
]
/***/ }),
/* 871 */
/***/ (function(module, exports, __webpack_require__) {
if (false) {
module.hot.accept([])
}
var requireMap = {
'./toggle': __webpack_require__(205),
'./group': __webpack_require__(66),
'./legend': __webpack_require__(203),
'react': __webpack_require__(0)
};
var requireInRuntimeBase = __webpack_require__(21);
var requireInRuntime = requireInRuntimeBase.bind(null, requireMap);
var evalInContextBase = __webpack_require__(20);
var evalInContext = evalInContextBase.bind(null, "var React = require('react');", requireInRuntime);
module.exports = [
{
'type': 'code',
'content': 'const { ToggleList } = require(\'./toggle\');\nconst FormGroup = require(\'./group\').default;\nconst Legend = require(\'./legend\').default;\n\n<FormGroup name=\'who-killed\'>\n <Legend>Who killed the radio star?</Legend>\n <ToggleList>\n <Toggle value=\'video\'>Video</Toggle>\n <Toggle value=\'tv\'>TV</Toggle>\n <Toggle value=\'netflix\'>Netflix</Toggle>\n </ToggleList>\n</FormGroup>',
'evalInContext': evalInContext
},
{
'type': 'markdown',
'content': '#### selected'
},
{
'type': 'code',
'content': 'const { ToggleList } = require(\'./toggle\');\nconst FormGroup = require(\'./group\').default;\nconst Legend = require(\'./legend\').default;\n\n<FormGroup name=\'who-killed\'>\n <Legend>Who killed the radio star?</Legend>\n <ToggleList>\n <Toggle value=\'video\' checked>Video</Toggle>\n <Toggle value=\'tv\'>TV</Toggle>\n <Toggle value=\'netflix\'>Netflix</Toggle>\n </ToggleList>\n</FormGroup>',
'evalInContext': evalInContext
},
{
'type': 'markdown',
'content': '#### two items'
},
{
'type': 'code',
'content': 'const { ToggleList } = require(\'./toggle\');\nconst FormGroup = require(\'./group\').default;\nconst Legend = require(\'./legend\').default;\n\n<FormGroup name=\'who-killed\'>\n <Legend>Who killed the radio star?</Legend>\n <ToggleList>\n <Toggle value=\'tv\' checked>TV</Toggle>\n <Toggle value=\'netflix\'>Netflix</Toggle>\n </ToggleList>\n</FormGroup>',
'evalInContext': evalInContext
},
{
'type': 'markdown',
'content': '#### `disabled`'
},
{
'type': 'code',
'content': 'const { ToggleList } = require(\'./toggle\');\nconst FormGroup = require(\'./group\').default;\nconst Legend = require(\'./legend\').default;\n\n<FormGroup name=\'who-killed\' disabled>\n <Legend>Who killed the radio star?</Legend>\n <ToggleList>\n <Toggle value=\'video\'>Video</Toggle>\n <Toggle value=\'tv\'>TV</Toggle>\n <Toggle value=\'netflix\'>Netflix</Toggle>\n </ToggleList>\n</FormGroup>',
'evalInContext': evalInContext
}
]
/***/ }),
/* 872 */
/***/ (function(module, exports, __webpack_require__) {
if (false) {
module.hot.accept([])
}
var requireMap = {
'./colors': __webpack_require__(402),
'react': __webpack_require__(0)
};
var requireInRuntimeBase = __webpack_require__(21);
var requireInRuntime = requireInRuntimeBase.bind(null, requireMap);
var evalInContextBase = __webpack_require__(20);
var evalInContext = evalInContextBase.bind(null, "var React = require('react');", requireInRuntime);
module.exports = [{
'type': 'code',
'content': 'const Colors = require(\'./colors\').default;\n\n<Colors />',
'evalInContext': evalInContext
}]
/***/ }),
/* 873 */
/***/ (function(module, exports, __webpack_require__) {
if (false) {
module.hot.accept([])
}
var requireMap = {
'./data/wp.json': __webpack_require__(1033),
'react': __webpack_require__(0)
};
var requireInRuntimeBase = __webpack_require__(21);
var requireInRuntime = requireInRuntimeBase.bind(null, requireMap);
var evalInContextBase = __webpack_require__(20);
var evalInContext = evalInContextBase.bind(null, "var React = require('react');", requireInRuntime);
module.exports = [{
'type': 'code',
'content': 'const data = require(\'./data/wp.json\');\n<Topology services={data} />',
'evalInContext': evalInContext
}]
/***/ }),
/* 874 */
/***/ (function(module, exports, __webpack_require__) {
if (false) {
module.hot.accept([])
}
module.exports = {
'description': '\n',
'methods': [],
'displayName': 'Anchor',
'props': {
'children': {
'type': { 'name': 'node' },
'required': false,
'description': 'The `<a>` text',
'tags': {}
},
'secondary': {
'type': { 'name': 'bool' },
'required': false,
'description': '',
'defaultValue': {
'value': 'false',
'computed': false
},
'tags': {}
}
},
'doclets': {},
'tags': {
'example': [{
'title': 'example',
'description': './usage.md'
}]
},
'example': __webpack_require__(863),
'examples': []
}
/***/ }),
/* 875 */
/***/ (function(module, exports, __webpack_require__) {
if (false) {
module.hot.accept([])
}
module.exports = {
'description': '\n',
'methods': [],
'displayName': 'Button',
'props': {
'children': {
'type': { 'name': 'node' },
'required': false,
'description': 'The `<button>`/`<a>`/`<Link>` text',
'tags': {}
},
'href': {
'type': { 'name': 'string' },
'required': false,
'description': 'When used, it will render an `<a>` with the givern href',
'tags': {}
},
'to': {
'type': { 'name': 'string' },
'required': false,
'description': 'When used, it will render a `<Link>` with the givern to',
'tags': {}
},
'primary': {
'type': { 'name': 'bool' },
'required': false,
'description': '',
'defaultValue': {
'value': 'true',
'computed': false
},
'tags': {}
},
'secondary': {
'type': { 'name': 'bool' },
'required': false,
'description': '',
'tags': {}
},
'tertiary': {
'type': { 'name': 'bool' },
'required': false,
'description': '',
'tags': {}
}
},
'doclets': {},
'tags': {
'example': [{
'title': 'example',
'description': './usage.md'
}]
},
'example': __webpack_require__(865),
'examples': []
}
/***/ }),
/* 876 */
/***/ (function(module, exports, __webpack_require__) {
if (false) {
module.hot.accept([])
}
module.exports = {
'description': '\n',
'methods': [],
'displayName': 'Card',
'props': {
'children': {
'type': { 'name': 'node' },
'required': false,
'description': '',
'tags': {}
},
'collapsed': {
'type': { 'name': 'bool' },
'required': false,
'description': '',
'defaultValue': {
'value': 'false',
'computed': false
},
'tags': {}
},
'headed': {
'type': { 'name': 'bool' },
'required': false,
'description': '',
'defaultValue': {
'value': 'false',
'computed': false
},
'tags': {}
},
'flat': {
'type': { 'name': 'bool' },
'required': false,
'description': '',
'tags': {}
},
'stacked': {
'type': { 'name': 'bool' },
'required': false,
'description': '',
'tags': {}
}
},
'doclets': {},
'tags': {
'example': [{
'title': 'example',
'description': './usage.md'
}]
},
'example': __webpack_require__(866),
'examples': []
}
/***/ }),
/* 877 */
/***/ (function(module, exports, __webpack_require__) {
if (false) {
module.hot.accept([])
}
module.exports = {
'description': '\n',
'methods': [],
'displayName': 'Checkbox',
'doclets': {},
'tags': {
'example': [{
'title': 'example',
'description': './usage-checkbox.md'
}]
},
'example': __webpack_require__(867),
'examples': []
}
/***/ }),
/* 878 */
/***/ (function(module, exports, __webpack_require__) {
if (false) {
module.hot.accept([])
}
module.exports = {
'description': '\n',
'methods': [],
'displayName': 'Input',
'doclets': {},
'tags': {
'example': [{
'title': 'example',
'description': './usage-input.md'
}]
},
'example': __webpack_require__(868),
'examples': []
}
/***/ }),
/* 879 */
/***/ (function(module, exports, __webpack_require__) {
if (false) {
module.hot.accept([])
}
module.exports = {
'description': '\n',
'methods': [],
'displayName': 'Radio',
'doclets': {},
'tags': {
'example': [{
'title': 'example',
'description': './usage-radio.md'
}]
},
'example': __webpack_require__(869),
'examples': []
}
/***/ }),
/* 880 */
/***/ (function(module, exports, __webpack_require__) {
if (false) {
module.hot.accept([])
}
module.exports = {
'description': '\n',
'methods': [],
'displayName': 'Select',
'doclets': {},
'tags': {
'example': [{
'title': 'example',
'description': './usage-select.md'
}]
},
'example': __webpack_require__(870),
'examples': []
}
/***/ }),
/* 881 */
/***/ (function(module, exports, __webpack_require__) {
if (false) {
module.hot.accept([])
}
module.exports = {
'description': '\n',
'methods': [],
'displayName': 'Toggle',
'doclets': {},
'tags': {
'example': [{
'title': 'example',
'description': './usage-toggle.md'
}]
},
'example': __webpack_require__(871),
'examples': []
}
/***/ }),
/* 882 */
/***/ (function(module, exports, __webpack_require__) {
if (false) {
module.hot.accept([])
}
module.exports = {
'description': '\n',
'methods': [],
'displayName': 'Li',
'doclets': {},
'tags': {
'example': [{
'title': 'example',
'description': './usage.md'
}]
},
'example': __webpack_require__(304),
'examples': []
}
/***/ }),
/* 883 */
/***/ (function(module, exports, __webpack_require__) {
if (false) {
module.hot.accept([])
}
module.exports = {
'description': '\n',
'methods': [],
'displayName': 'Ul',
'doclets': {},
'tags': {
'example': [{
'title': 'example',
'description': './usage.md'
}]
},
'example': __webpack_require__(304),
'examples': []
}
/***/ }),
/* 884 */
/***/ (function(module, exports, __webpack_require__) {
if (false) {
module.hot.accept([])
}
module.exports = {
'description': '',
'methods': [],
'displayName': 'Tooltip',
'doclets': {},
'examples': []
}
/***/ }),
/* 885 */
/***/ (function(module, exports, __webpack_require__) {
if (false) {
module.hot.accept([])
}
module.exports = {
'description': '\n',
'methods': [],
'displayName': 'Topology',
'props': {
'onQuickActions': {
'type': { 'name': 'func' },
'required': false,
'description': '',
'tags': {}
},
'onNodeTitleClick': {
'type': { 'name': 'func' },
'required': false,
'description': '',
'tags': {}
},
'services': {
'type': { 'name': 'array' },
'required': false,
'description': '',
'tags': {}
}
},
'doclets': {},
'tags': {
'example': [{
'title': 'example',
'description': './usage.md'
}]
},
'example': __webpack_require__(873),
'examples': []
}
/***/ }),
/* 886 */
/***/ (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__(862);
if(typeof content === 'string') content = [[module.i, content, '']];
// Prepare cssTransformation
var transform;
var options = {}
options.transform = transform
// add the styles to the DOM
var update = __webpack_require__(331)(content, options);
if(content.locals) module.exports = content.locals;
// Hot Module Replacement
if(false) {
// When the styles change, update the <style> tags
if(!content.locals) {
module.hot.accept("!!../../react-styleguidist/loaders/css-loader.js!./tomorrow.css", function() {
var newContent = require("!!../../react-styleguidist/loaders/css-loader.js!./tomorrow.css");
if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
update(newContent);
});
}
// When the module is disposed, remove the <style> tags
module.hot.dispose(function() { update(); });
}
/***/ }),
/* 887 */
/***/ (function(module, exports, __webpack_require__) {
if (false) {
module.hot.accept([])
}
module.exports = {
'config': {
'title': 'UI Toolkit',
'highlightTheme': 'base16-light',
'showCode': false,
'showSidebar': true,
'previewDelay': 500,
'theme': {},
'styles': {},
'compilerConfig': { 'objectAssign': 'Object.assign' }
},
'welcomeScreen': false,
'patterns': void 0,
'sections': [
{
'name': 'Theme',
'components': [],
'sections': [],
'content': __webpack_require__(872)
},
{
'name': 'Components',
'components': [
{
'filepath': 'src/anchor/index.js',
'pathLine': 'src/anchor/index.js',
'module': __webpack_require__(383),
'props': __webpack_require__(874),
'hasExamples': false
},
{
'filepath': 'src/button/index.js',
'pathLine': 'src/button/index.js',
'module': __webpack_require__(121),
'props': __webpack_require__(875),
'hasExamples': false
},
{
'filepath': 'src/card/card.js',
'pathLine': 'src/card/card.js',
'module': __webpack_require__(122),
'props': __webpack_require__(876),
'hasExamples': false
},
{
'filepath': 'src/form/input.js',
'pathLine': 'src/form/input.js',
'module': __webpack_require__(397),
'props': __webpack_require__(878),
'hasExamples': false
},
{
'filepath': 'src/form/checkbox.js',
'pathLine': 'src/form/checkbox.js',
'module': __webpack_require__(395),
'props': __webpack_require__(877),
'hasExamples': false
},
{
'filepath': 'src/form/radio.js',
'pathLine': 'src/form/radio.js',
'module': __webpack_require__(204),
'props': __webpack_require__(879),
'hasExamples': false
},
{
'filepath': 'src/form/select.js',
'pathLine': 'src/form/select.js',
'module': __webpack_require__(398),
'props': __webpack_require__(880),
'hasExamples': false
},
{
'filepath': 'src/form/toggle.js',
'pathLine': 'src/form/toggle.js',
'module': __webpack_require__(205),
'props': __webpack_require__(881),
'hasExamples': false
},
{
'filepath': 'src/list/ul.js',
'pathLine': 'src/list/ul.js',
'module': __webpack_require__(208),
'props': __webpack_require__(883),
'hasExamples': false
},
{
'filepath': 'src/list/li.js',
'pathLine': 'src/list/li.js',
'module': __webpack_require__(207),
'props': __webpack_require__(882),
'hasExamples': false
},
{
'filepath': 'src/topology/index.js',
'pathLine': 'src/topology/index.js',
'module': __webpack_require__(404),
'props': __webpack_require__(885),
'hasExamples': false
},
{
'filepath': 'src/tooltip/index.js',
'pathLine': 'src/tooltip/index.js',
'module': __webpack_require__(403),
'props': __webpack_require__(884),
'hasExamples': false
}
],
'sections': [],
'content': void 0
},
{
'name': 'Baseline',
'components': [],
'sections': [],
'content': __webpack_require__(864)
}
]
}
/***/ }),
/* 888 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*
*/
/**
* 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;
/***/ }),
/* 889 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*
*/
var _prodInvariant = __webpack_require__(62);
var invariant = __webpack_require__(2);
/**
* 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) ? false ? 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;
/***/ }),
/* 890 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var PooledClass = __webpack_require__(889);
var ReactElement = __webpack_require__(61);
var emptyFunction = __webpack_require__(17);
var traverseAllChildren = __webpack_require__(900);
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;
/***/ }),
/* 891 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var _prodInvariant = __webpack_require__(62),
_assign = __webpack_require__(9);
var ReactComponent = __webpack_require__(183);
var ReactElement = __webpack_require__(61);
var ReactPropTypeLocationNames = __webpack_require__(893);
var ReactNoopUpdateQueue = __webpack_require__(184);
var emptyObject = __webpack_require__(67);
var invariant = __webpack_require__(2);
var warning = __webpack_require__(5);
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}
* @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 (false) {
validateTypeDef(Constructor, childContextTypes, 'childContext');
}
Constructor.childContextTypes = _assign({}, Constructor.childContextTypes, childContextTypes);
},
contextTypes: function (Constructor, contextTypes) {
if (false) {
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 (false) {
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__
false ? 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') ? false ? 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') ? false ? 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 (false) {
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') ? false ? 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) ? false ? 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')) ? false ? 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 (false) {
// 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 ? false ? 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 ? false ? 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') ? false ? invariant(false, 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.') : _prodInvariant('80') : void 0;
for (var key in two) {
if (two.hasOwnProperty(key)) {
!(one[key] === undefined) ? false ? 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 (false) {
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);
var didWarnDeprecated = false;
/**
* 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) {
if (false) {
process.env.NODE_ENV !== 'production' ? warning(didWarnDeprecated, '%s: React.createClass is deprecated and will be removed in version 16. ' + 'Use plain JavaScript classes instead. If you\'re not yet ready to ' + 'migrate, create-react-class is available on npm as a ' + 'drop-in replacement.', spec && spec.displayName || 'A Component') : void 0;
didWarnDeprecated = true;
}
// 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 (false) {
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 (false) {
// 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)) ? false ? 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 (false) {
// 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 ? false ? invariant(false, 'createClass(...): Class specification must implement a `render` method.') : _prodInvariant('83') : void 0;
if (false) {
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;
/***/ }),
/* 892 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var ReactElement = __webpack_require__(61);
/**
* Create a factory that creates HTML tag elements.
*
* @private
*/
var createDOMFactory = ReactElement.createFactory;
if (false) {
var ReactElementValidator = require('./ReactElementValidator');
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;
/***/ }),
/* 893 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*
*/
var ReactPropTypeLocationNames = {};
if (false) {
ReactPropTypeLocationNames = {
prop: 'prop',
context: 'context',
childContext: 'child context'
};
}
module.exports = ReactPropTypeLocationNames;
/***/ }),
/* 894 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var _require = __webpack_require__(61),
isValidElement = _require.isValidElement;
var factory = __webpack_require__(267);
module.exports = factory(isValidElement);
/***/ }),
/* 895 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var _assign = __webpack_require__(9);
var ReactComponent = __webpack_require__(183);
var ReactNoopUpdateQueue = __webpack_require__(184);
var emptyObject = __webpack_require__(67);
/**
* 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;
/***/ }),
/* 896 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
module.exports = '15.5.4';
/***/ }),
/* 897 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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 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;
/***/ }),
/* 898 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*
*/
var nextDebugID = 1;
function getNextDebugID() {
return nextDebugID++;
}
module.exports = getNextDebugID;
/***/ }),
/* 899 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var _prodInvariant = __webpack_require__(62);
var ReactElement = __webpack_require__(61);
var invariant = __webpack_require__(2);
/**
* 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) ? false ? invariant(false, 'React.Children.only expected to receive a single React element child.') : _prodInvariant('143') : void 0;
return children;
}
module.exports = onlyChild;
/***/ }),
/* 900 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* 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.
*
*/
var _prodInvariant = __webpack_require__(62);
var ReactCurrentOwner = __webpack_require__(33);
var REACT_ELEMENT_TYPE = __webpack_require__(307);
var getIteratorFn = __webpack_require__(897);
var invariant = __webpack_require__(2);
var KeyEscapeUtils = __webpack_require__(888);
var warning = __webpack_require__(5);
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 (false) {
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 (false) {
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 ? false ? 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;
/***/ }),
/* 901 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react_redux__ = __webpack_require__(77);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__createFieldProps__ = __webpack_require__(311);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__events_onChangeValue__ = __webpack_require__(315);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util_eventConsts__ = __webpack_require__(964);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__structure_plain__ = __webpack_require__(6);
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; }; }();
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 propsToNotUpdateFor = ['_reduxForm'];
var createConnectedField = function createConnectedField(_ref) {
var deepEqual = _ref.deepEqual,
getIn = _ref.getIn,
toJS = _ref.toJS;
var getSyncError = function getSyncError(syncErrors, name) {
var error = __WEBPACK_IMPORTED_MODULE_6__structure_plain__["a" /* default */].getIn(syncErrors, name);
// Because the error for this field might not be at a level in the error structure where
// it can be set directly, it might need to be unwrapped from the _error property
return error && error._error ? error._error : error;
};
var getSyncWarning = function getSyncWarning(syncWarnings, name) {
var warning = getIn(syncWarnings, name);
// Because the warning for this field might not be at a level in the warning structure where
// it can be set directly, it might need to be unwrapped from the _warning property
return warning && warning._warning ? warning._warning : warning;
};
var ConnectedField = function (_Component) {
_inherits(ConnectedField, _Component);
function ConnectedField(props) {
_classCallCheck(this, ConnectedField);
var _this = _possibleConstructorReturn(this, (ConnectedField.__proto__ || Object.getPrototypeOf(ConnectedField)).call(this, props));
_this.handleChange = _this.handleChange.bind(_this);
_this.handleFocus = _this.handleFocus.bind(_this);
_this.handleBlur = _this.handleBlur.bind(_this);
_this.handleDragStart = _this.handleDragStart.bind(_this);
_this.handleDrop = _this.handleDrop.bind(_this);
return _this;
}
_createClass(ConnectedField, [{
key: 'shouldComponentUpdate',
value: function shouldComponentUpdate(nextProps) {
var _this2 = this;
var nextPropsKeys = Object.keys(nextProps);
var thisPropsKeys = Object.keys(this.props);
return nextPropsKeys.length !== thisPropsKeys.length || nextPropsKeys.some(function (prop) {
return !~propsToNotUpdateFor.indexOf(prop) && !deepEqual(_this2.props[prop], nextProps[prop]);
});
}
}, {
key: 'isPristine',
value: function isPristine() {
return this.props.pristine;
}
}, {
key: 'getValue',
value: function getValue() {
return this.props.value;
}
}, {
key: 'getRenderedComponent',
value: function getRenderedComponent() {
return this.refs.renderedComponent;
}
}, {
key: 'handleChange',
value: function handleChange(event) {
var _props = this.props,
name = _props.name,
dispatch = _props.dispatch,
parse = _props.parse,
normalize = _props.normalize,
onChange = _props.onChange,
_reduxForm = _props._reduxForm,
previousValue = _props.value;
var newValue = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__events_onChangeValue__["a" /* default */])(event, { name: name, parse: parse, normalize: normalize });
var defaultPrevented = false;
if (onChange) {
onChange(_extends({}, event, {
preventDefault: function preventDefault() {
defaultPrevented = true;
return event.preventDefault();
}
}), newValue, previousValue);
}
if (!defaultPrevented) {
// dispatch change action
dispatch(_reduxForm.change(name, newValue));
}
}
}, {
key: 'handleFocus',
value: function handleFocus(event) {
var _props2 = this.props,
name = _props2.name,
dispatch = _props2.dispatch,
onFocus = _props2.onFocus,
_reduxForm = _props2._reduxForm;
var defaultPrevented = false;
if (onFocus) {
onFocus(_extends({}, event, {
preventDefault: function preventDefault() {
defaultPrevented = true;
return event.preventDefault();
}
}));
}
if (!defaultPrevented) {
dispatch(_reduxForm.focus(name));
}
}
}, {
key: 'handleBlur',
value: function handleBlur(event) {
var _props3 = this.props,
name = _props3.name,
dispatch = _props3.dispatch,
parse = _props3.parse,
normalize = _props3.normalize,
onBlur = _props3.onBlur,
_reduxForm = _props3._reduxForm,
_value = _props3._value,
previousValue = _props3.value;
var newValue = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__events_onChangeValue__["a" /* default */])(event, { name: name, parse: parse, normalize: normalize });
// for checkbox and radio, if the value property of checkbox or radio equals
// the value passed by blur event, then fire blur action with previousValue.
if (newValue === _value && _value !== undefined) {
newValue = previousValue;
}
var defaultPrevented = false;
if (onBlur) {
onBlur(_extends({}, event, {
preventDefault: function preventDefault() {
defaultPrevented = true;
return event.preventDefault();
}
}), newValue, previousValue);
}
if (!defaultPrevented) {
// dispatch blur action
dispatch(_reduxForm.blur(name, newValue));
// call post-blur callback
if (_reduxForm.asyncValidate) {
_reduxForm.asyncValidate(name, newValue);
}
}
}
}, {
key: 'handleDragStart',
value: function handleDragStart(event) {
var _props4 = this.props,
onDragStart = _props4.onDragStart,
value = _props4.value;
event.dataTransfer.setData(__WEBPACK_IMPORTED_MODULE_5__util_eventConsts__["a" /* dataKey */], value == null ? '' : value);
if (onDragStart) {
onDragStart(event);
}
}
}, {
key: 'handleDrop',
value: function handleDrop(event) {
var _props5 = this.props,
name = _props5.name,
dispatch = _props5.dispatch,
onDrop = _props5.onDrop,
_reduxForm = _props5._reduxForm,
previousValue = _props5.value;
var newValue = event.dataTransfer.getData(__WEBPACK_IMPORTED_MODULE_5__util_eventConsts__["a" /* dataKey */]);
var defaultPrevented = false;
if (onDrop) {
onDrop(_extends({}, event, {
preventDefault: function preventDefault() {
defaultPrevented = true;
return event.preventDefault();
}
}), newValue, previousValue);
}
if (!defaultPrevented) {
// dispatch change action
dispatch(_reduxForm.change(name, newValue));
event.preventDefault();
}
}
}, {
key: 'render',
value: function render() {
var _props6 = this.props,
component = _props6.component,
withRef = _props6.withRef,
name = _props6.name,
_reduxForm = _props6._reduxForm,
normalize = _props6.normalize,
onBlur = _props6.onBlur,
onChange = _props6.onChange,
onFocus = _props6.onFocus,
onDragStart = _props6.onDragStart,
onDrop = _props6.onDrop,
rest = _objectWithoutProperties(_props6, ['component', 'withRef', 'name', '_reduxForm', 'normalize', 'onBlur', 'onChange', 'onFocus', 'onDragStart', 'onDrop']);
var _createFieldProps = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__createFieldProps__["a" /* default */])({ getIn: getIn, toJS: toJS }, name, _extends({}, rest, {
form: _reduxForm.form,
onBlur: this.handleBlur,
onChange: this.handleChange,
onDrop: this.handleDrop,
onDragStart: this.handleDragStart,
onFocus: this.handleFocus
})),
custom = _createFieldProps.custom,
props = _objectWithoutProperties(_createFieldProps, ['custom']);
if (withRef) {
custom.ref = 'renderedComponent';
}
if (typeof component === 'string') {
var input = props.input,
meta = props.meta; // eslint-disable-line no-unused-vars
// flatten input into other props
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_react__["createElement"])(component, _extends({}, input, custom));
} else {
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_react__["createElement"])(component, _extends({}, props, custom));
}
}
}]);
return ConnectedField;
}(__WEBPACK_IMPORTED_MODULE_0_react__["Component"]);
ConnectedField.propTypes = {
component: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]).isRequired,
props: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object
};
var connector = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2_react_redux__["a" /* connect */])(function (state, ownProps) {
var name = ownProps.name,
_ownProps$_reduxForm = ownProps._reduxForm,
initialValues = _ownProps$_reduxForm.initialValues,
getFormState = _ownProps$_reduxForm.getFormState;
var formState = getFormState(state);
var initialState = getIn(formState, 'initial.' + name);
var initial = initialState !== undefined ? initialState : initialValues && getIn(initialValues, name);
var value = getIn(formState, 'values.' + name);
var submitting = getIn(formState, 'submitting');
var syncError = getSyncError(getIn(formState, 'syncErrors'), name);
var syncWarning = getSyncWarning(getIn(formState, 'syncWarnings'), name);
var pristine = deepEqual(value, initial);
return {
asyncError: getIn(formState, 'asyncErrors.' + name),
asyncValidating: getIn(formState, 'asyncValidating') === name,
dirty: !pristine,
pristine: pristine,
state: getIn(formState, 'fields.' + name),
submitError: getIn(formState, 'submitErrors.' + name),
submitFailed: getIn(formState, 'submitFailed'),
submitting: submitting,
syncError: syncError,
syncWarning: syncWarning,
initial: initial,
value: value,
_value: ownProps.value // save value passed in (for checkboxes)
};
}, undefined, undefined, { withRef: true });
return connector(ConnectedField);
};
/* harmony default export */ __webpack_exports__["a"] = (createConnectedField);
/***/ }),
/* 902 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_es_mapValues__ = __webpack_require__(242);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_prop_types__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_prop_types__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_react_redux__ = __webpack_require__(77);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_redux__ = __webpack_require__(187);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__createFieldArrayProps__ = __webpack_require__(912);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__structure_plain__ = __webpack_require__(6);
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; }; }();
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 propsToNotUpdateFor = ['_reduxForm', 'value'];
var createConnectedFieldArray = function createConnectedFieldArray(_ref) {
var deepEqual = _ref.deepEqual,
getIn = _ref.getIn,
size = _ref.size;
var getSyncError = function getSyncError(syncErrors, name) {
// For an array, the error can _ONLY_ be under _error.
// This is why this getSyncError is not the same as the
// one in Field.
return __WEBPACK_IMPORTED_MODULE_6__structure_plain__["a" /* default */].getIn(syncErrors, name + '._error');
};
var getSyncWarning = function getSyncWarning(syncWarnings, name) {
// For an array, the warning can _ONLY_ be under _warning.
// This is why this getSyncError is not the same as the
// one in Field.
return getIn(syncWarnings, name + '._warning');
};
var ConnectedFieldArray = function (_Component) {
_inherits(ConnectedFieldArray, _Component);
function ConnectedFieldArray() {
_classCallCheck(this, ConnectedFieldArray);
var _this = _possibleConstructorReturn(this, (ConnectedFieldArray.__proto__ || Object.getPrototypeOf(ConnectedFieldArray)).call(this));
_this.getValue = _this.getValue.bind(_this);
return _this;
}
_createClass(ConnectedFieldArray, [{
key: 'shouldComponentUpdate',
value: function shouldComponentUpdate(nextProps) {
var _this2 = this;
// Update if the elements of the value array was updated.
var thisValue = this.props.value;
var nextValue = nextProps.value;
if (thisValue && nextValue) {
if (thisValue.length !== nextValue.length || thisValue.every(function (val) {
return nextValue.some(function (next) {
return deepEqual(val, next);
});
})) {
return true;
}
}
var nextPropsKeys = Object.keys(nextProps);
var thisPropsKeys = Object.keys(this.props);
return nextPropsKeys.length !== thisPropsKeys.length || nextPropsKeys.some(function (prop) {
// useful to debug rerenders
// if (!plain.deepEqual(this.props[ prop ], nextProps[ prop ])) {
// console.info(prop, 'changed', this.props[ prop ], '==>', nextProps[ prop ])
// }
return !~propsToNotUpdateFor.indexOf(prop) && !deepEqual(_this2.props[prop], nextProps[prop]);
});
}
}, {
key: 'getRenderedComponent',
value: function getRenderedComponent() {
return this.refs.renderedComponent;
}
}, {
key: 'getValue',
value: function getValue(index) {
return this.props.value && getIn(this.props.value, index);
}
}, {
key: 'render',
value: function render() {
var _props = this.props,
component = _props.component,
withRef = _props.withRef,
name = _props.name,
_reduxForm = _props._reduxForm,
validate = _props.validate,
warn = _props.warn,
rest = _objectWithoutProperties(_props, ['component', 'withRef', 'name', '_reduxForm', 'validate', 'warn']);
var props = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__createFieldArrayProps__["a" /* default */])(getIn, name, _reduxForm.form, _reduxForm.sectionPrefix, this.getValue, rest);
if (withRef) {
props.ref = 'renderedComponent';
}
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1_react__["createElement"])(component, props);
}
}, {
key: 'dirty',
get: function get() {
return this.props.dirty;
}
}, {
key: 'pristine',
get: function get() {
return this.props.pristine;
}
}, {
key: 'value',
get: function get() {
return this.props.value;
}
}]);
return ConnectedFieldArray;
}(__WEBPACK_IMPORTED_MODULE_1_react__["Component"]);
ConnectedFieldArray.propTypes = {
component: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.string]).isRequired,
props: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.object
};
ConnectedFieldArray.contextTypes = {
_reduxForm: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.object
};
var connector = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3_react_redux__["a" /* connect */])(function (state, ownProps) {
var name = ownProps.name,
_ownProps$_reduxForm = ownProps._reduxForm,
initialValues = _ownProps$_reduxForm.initialValues,
getFormState = _ownProps$_reduxForm.getFormState;
var formState = getFormState(state);
var initial = getIn(formState, 'initial.' + name) || initialValues && getIn(initialValues, name);
var value = getIn(formState, 'values.' + name);
var submitting = getIn(formState, 'submitting');
var syncError = getSyncError(getIn(formState, 'syncErrors'), name);
var syncWarning = getSyncWarning(getIn(formState, 'syncWarnings'), name);
var pristine = deepEqual(value, initial);
return {
asyncError: getIn(formState, 'asyncErrors.' + name + '._error'),
dirty: !pristine,
pristine: pristine,
state: getIn(formState, 'fields.' + name),
submitError: getIn(formState, 'submitErrors.' + name + '._error'),
submitFailed: getIn(formState, 'submitFailed'),
submitting: submitting,
syncError: syncError,
syncWarning: syncWarning,
value: value,
length: size(value)
};
}, function (dispatch, ownProps) {
var name = ownProps.name,
_reduxForm = ownProps._reduxForm;
var arrayInsert = _reduxForm.arrayInsert,
arrayMove = _reduxForm.arrayMove,
arrayPop = _reduxForm.arrayPop,
arrayPush = _reduxForm.arrayPush,
arrayRemove = _reduxForm.arrayRemove,
arrayRemoveAll = _reduxForm.arrayRemoveAll,
arrayShift = _reduxForm.arrayShift,
arraySplice = _reduxForm.arraySplice,
arraySwap = _reduxForm.arraySwap,
arrayUnshift = _reduxForm.arrayUnshift;
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_lodash_es_mapValues__["a" /* default */])({
arrayInsert: arrayInsert,
arrayMove: arrayMove,
arrayPop: arrayPop,
arrayPush: arrayPush,
arrayRemove: arrayRemove,
arrayRemoveAll: arrayRemoveAll,
arrayShift: arrayShift,
arraySplice: arraySplice,
arraySwap: arraySwap,
arrayUnshift: arrayUnshift
}, function (actionCreator) {
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4_redux__["a" /* bindActionCreators */])(actionCreator.bind(null, name), dispatch);
});
}, undefined, { withRef: true });
return connector(ConnectedFieldArray);
};
/* harmony default export */ __webpack_exports__["a"] = (createConnectedFieldArray);
/***/ }),
/* 903 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react_redux__ = __webpack_require__(77);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__createFieldProps__ = __webpack_require__(311);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__structure_plain__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__events_onChangeValue__ = __webpack_require__(315);
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; }; }();
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 propsToNotUpdateFor = ['_reduxForm'];
var createConnectedFields = function createConnectedFields(_ref) {
var deepEqual = _ref.deepEqual,
getIn = _ref.getIn,
toJS = _ref.toJS,
size = _ref.size;
var getSyncError = function getSyncError(syncErrors, name) {
// Because the error for this field might not be at a level in the error structure where
// it can be set directly, it might need to be unwrapped from the _error property
return __WEBPACK_IMPORTED_MODULE_4__structure_plain__["a" /* default */].getIn(syncErrors, name + '._error') || __WEBPACK_IMPORTED_MODULE_4__structure_plain__["a" /* default */].getIn(syncErrors, name);
};
var getSyncWarning = function getSyncWarning(syncWarnings, name) {
var warning = getIn(syncWarnings, name);
// Because the warning for this field might not be at a level in the warning structure where
// it can be set directly, it might need to be unwrapped from the _warning property
return warning && warning._warning ? warning._warning : warning;
};
var ConnectedFields = function (_Component) {
_inherits(ConnectedFields, _Component);
function ConnectedFields(props) {
_classCallCheck(this, ConnectedFields);
var _this = _possibleConstructorReturn(this, (ConnectedFields.__proto__ || Object.getPrototypeOf(ConnectedFields)).call(this, props));
_this.handleChange = _this.handleChange.bind(_this);
_this.handleFocus = _this.handleFocus.bind(_this);
_this.handleBlur = _this.handleBlur.bind(_this);
_this.onChangeFns = props.names.reduce(function (acc, name) {
acc[name] = function (event) {
return _this.handleChange(name, event);
};
return acc;
}, {});
_this.onFocusFns = props.names.reduce(function (acc, name) {
acc[name] = function () {
return _this.handleFocus(name);
};
return acc;
}, {});
_this.onBlurFns = props.names.reduce(function (acc, name) {
acc[name] = function (event) {
return _this.handleBlur(name, event);
};
return acc;
}, {});
return _this;
}
_createClass(ConnectedFields, [{
key: 'componentWillReceiveProps',
value: function componentWillReceiveProps(nextProps) {
var _this2 = this;
if (this.props.names !== nextProps.names && (size(this.props.names) !== size(nextProps.names) || nextProps.names.some(function (nextName) {
return !_this2.props._fields[nextName];
}))) {
// names is changed. The cached event handlers need to be updated
this.onChangeFns = nextProps.names.reduce(function (acc, name) {
acc[name] = function (event) {
return _this2.handleChange(name, event);
};
return acc;
}, {});
this.onFocusFns = nextProps.names.reduce(function (acc, name) {
acc[name] = function () {
return _this2.handleFocus(name);
};
return acc;
}, {});
this.onBlurFns = nextProps.names.reduce(function (acc, name) {
acc[name] = function (event) {
return _this2.handleBlur(name, event);
};
return acc;
}, {});
}
}
}, {
key: 'shouldComponentUpdate',
value: function shouldComponentUpdate(nextProps) {
var _this3 = this;
var nextPropsKeys = Object.keys(nextProps);
var thisPropsKeys = Object.keys(this.props);
return nextPropsKeys.length !== thisPropsKeys.length || nextPropsKeys.some(function (prop) {
return !~propsToNotUpdateFor.indexOf(prop) && !deepEqual(_this3.props[prop], nextProps[prop]);
});
}
}, {
key: 'isDirty',
value: function isDirty() {
var _fields = this.props._fields;
return Object.keys(_fields).some(function (name) {
return _fields[name].dirty;
});
}
}, {
key: 'getValues',
value: function getValues() {
var _fields = this.props._fields;
return Object.keys(_fields).reduce(function (accumulator, name) {
return __WEBPACK_IMPORTED_MODULE_4__structure_plain__["a" /* default */].setIn(accumulator, name, _fields[name].value);
}, {});
}
}, {
key: 'getRenderedComponent',
value: function getRenderedComponent() {
return this.refs.renderedComponent;
}
}, {
key: 'handleChange',
value: function handleChange(name, event) {
var _props = this.props,
dispatch = _props.dispatch,
parse = _props.parse,
normalize = _props.normalize,
_reduxForm = _props._reduxForm;
var value = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__events_onChangeValue__["a" /* default */])(event, { name: name, parse: parse, normalize: normalize });
dispatch(_reduxForm.change(name, value));
}
}, {
key: 'handleFocus',
value: function handleFocus(name) {
var _props2 = this.props,
dispatch = _props2.dispatch,
_reduxForm = _props2._reduxForm;
dispatch(_reduxForm.focus(name));
}
}, {
key: 'handleBlur',
value: function handleBlur(name, event) {
var _props3 = this.props,
dispatch = _props3.dispatch,
parse = _props3.parse,
normalize = _props3.normalize,
_reduxForm = _props3._reduxForm;
var value = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__events_onChangeValue__["a" /* default */])(event, { name: name, parse: parse, normalize: normalize });
// dispatch blur action
dispatch(_reduxForm.blur(name, value));
// call post-blur callback
if (_reduxForm.asyncValidate) {
_reduxForm.asyncValidate(name, value);
}
}
}, {
key: 'render',
value: function render() {
var _this4 = this;
var _props4 = this.props,
component = _props4.component,
withRef = _props4.withRef,
_fields = _props4._fields,
_reduxForm = _props4._reduxForm,
rest = _objectWithoutProperties(_props4, ['component', 'withRef', '_fields', '_reduxForm']);
var sectionPrefix = _reduxForm.sectionPrefix,
form = _reduxForm.form;
var _Object$keys$reduce = Object.keys(_fields).reduce(function (accumulator, name) {
var connectedProps = _fields[name];
var _createFieldProps = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__createFieldProps__["a" /* default */])({ getIn: getIn, toJS: toJS }, name, _extends({}, connectedProps, rest, {
form: form,
onBlur: _this4.onBlurFns[name],
onChange: _this4.onChangeFns[name],
onFocus: _this4.onFocusFns[name]
})),
custom = _createFieldProps.custom,
fieldProps = _objectWithoutProperties(_createFieldProps, ['custom']);
accumulator.custom = custom;
var fieldName = sectionPrefix ? name.replace(sectionPrefix + '.', '') : name;
return __WEBPACK_IMPORTED_MODULE_4__structure_plain__["a" /* default */].setIn(accumulator, fieldName, fieldProps);
}, {}),
custom = _Object$keys$reduce.custom,
props = _objectWithoutProperties(_Object$keys$reduce, ['custom']);
if (withRef) {
props.ref = 'renderedComponent';
}
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_react__["createElement"])(component, _extends({}, props, custom));
}
}]);
return ConnectedFields;
}(__WEBPACK_IMPORTED_MODULE_0_react__["Component"]);
ConnectedFields.propTypes = {
component: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]).isRequired,
_fields: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object.isRequired,
props: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object
};
var connector = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2_react_redux__["a" /* connect */])(function (state, ownProps) {
var names = ownProps.names,
_ownProps$_reduxForm = ownProps._reduxForm,
initialValues = _ownProps$_reduxForm.initialValues,
getFormState = _ownProps$_reduxForm.getFormState;
var formState = getFormState(state);
return {
_fields: names.reduce(function (accumulator, name) {
var initialState = getIn(formState, 'initial.' + name);
var initial = initialState !== undefined ? initialState : initialValues && getIn(initialValues, name);
var value = getIn(formState, 'values.' + name);
var syncError = getSyncError(getIn(formState, 'syncErrors'), name);
var syncWarning = getSyncWarning(getIn(formState, 'syncWarnings'), name);
var submitting = getIn(formState, 'submitting');
var pristine = value === initial;
accumulator[name] = {
asyncError: getIn(formState, 'asyncErrors.' + name),
asyncValidating: getIn(formState, 'asyncValidating') === name,
dirty: !pristine,
pristine: pristine,
state: getIn(formState, 'fields.' + name),
submitError: getIn(formState, 'submitErrors.' + name),
submitFailed: getIn(formState, 'submitFailed'),
submitting: submitting,
syncError: syncError,
syncWarning: syncWarning,
value: value,
_value: ownProps.value // save value passed in (for checkboxes)
};
return accumulator;
}, {})
};
}, undefined, undefined, { withRef: true });
return connector(ConnectedFields);
};
/* harmony default export */ __webpack_exports__["a"] = (createConnectedFields);
/***/ }),
/* 904 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createField__ = __webpack_require__(910);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__structure_plain__ = __webpack_require__(6);
/* harmony default export */ __webpack_exports__["a"] = (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__createField__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__structure_plain__["a" /* default */]));
/***/ }),
/* 905 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createFieldArray__ = __webpack_require__(911);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__structure_plain__ = __webpack_require__(6);
/* unused harmony default export */ var _unused_webpack_default_export = (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__createFieldArray__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__structure_plain__["a" /* default */]));
/***/ }),
/* 906 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createFields__ = __webpack_require__(913);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__structure_plain__ = __webpack_require__(6);
/* unused harmony default export */ var _unused_webpack_default_export = (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__createFields__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__structure_plain__["a" /* default */]));
/***/ }),
/* 907 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__);
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; }; }();
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 Form = function (_Component) {
_inherits(Form, _Component);
function Form(props, context) {
_classCallCheck(this, Form);
var _this = _possibleConstructorReturn(this, (Form.__proto__ || Object.getPrototypeOf(Form)).call(this, props, context));
if (!context._reduxForm) {
throw new Error('Form must be inside a component decorated with reduxForm()');
}
return _this;
}
_createClass(Form, [{
key: 'componentWillMount',
value: function componentWillMount() {
this.context._reduxForm.registerInnerOnSubmit(this.props.onSubmit);
}
}, {
key: 'render',
value: function render() {
return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement('form', this.props);
}
}]);
return Form;
}(__WEBPACK_IMPORTED_MODULE_0_react__["Component"]);
Form.propTypes = {
onSubmit: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired
};
Form.contextTypes = {
_reduxForm: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object
};
/* unused harmony default export */ var _unused_webpack_default_export = (Form);
/***/ }),
/* 908 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_prefixName__ = __webpack_require__(110);
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; }; }();
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 FormSection = function (_Component) {
_inherits(FormSection, _Component);
function FormSection(props, context) {
_classCallCheck(this, FormSection);
var _this = _possibleConstructorReturn(this, (FormSection.__proto__ || Object.getPrototypeOf(FormSection)).call(this, props, context));
if (!context._reduxForm) {
throw new Error('FormSection must be inside a component decorated with reduxForm()');
}
return _this;
}
_createClass(FormSection, [{
key: 'getChildContext',
value: function getChildContext() {
var context = this.context,
name = this.props.name;
return {
_reduxForm: _extends({}, context._reduxForm, {
sectionPrefix: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_prefixName__["a" /* default */])(context, name)
})
};
}
}, {
key: 'render',
value: function render() {
var _props = this.props,
children = _props.children,
name = _props.name,
component = _props.component,
rest = _objectWithoutProperties(_props, ['children', 'name', 'component']);
if (__WEBPACK_IMPORTED_MODULE_0_react___default.a.isValidElement(children)) {
return children;
}
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_react__["createElement"])(component, _extends({}, rest, {
children: children
}));
}
}]);
return FormSection;
}(__WEBPACK_IMPORTED_MODULE_0_react__["Component"]);
FormSection.propTypes = {
name: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string.isRequired,
component: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string])
};
FormSection.defaultProps = {
component: 'div'
};
FormSection.childContextTypes = {
_reduxForm: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object.isRequired
};
FormSection.contextTypes = {
_reduxForm: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object
};
/* unused harmony default export */ var _unused_webpack_default_export = (FormSection);
/***/ }),
/* 909 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_is_promise__ = __webpack_require__(130);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_is_promise___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_is_promise__);
var asyncValidation = function asyncValidation(fn, start, stop, field) {
start(field);
var promise = fn();
if (!__WEBPACK_IMPORTED_MODULE_0_is_promise___default()(promise)) {
throw new Error('asyncValidate function passed to reduxForm must return a promise');
}
var handleErrors = function handleErrors(rejected) {
return function (errors) {
if (errors && Object.keys(errors).length) {
stop(errors);
return errors;
} else if (rejected) {
stop();
throw new Error('Asynchronous validation promise was rejected without errors.');
}
stop();
return Promise.resolve();
};
};
return promise.then(handleErrors(false), handleErrors(true));
};
/* harmony default export */ __webpack_exports__["a"] = (asyncValidation);
/***/ }),
/* 910 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_invariant__ = __webpack_require__(23);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_invariant___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_invariant__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__ConnectedField__ = __webpack_require__(901);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_shallowCompare__ = __webpack_require__(318);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util_prefixName__ = __webpack_require__(110);
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; }; }();
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 createField = function createField(_ref) {
var deepEqual = _ref.deepEqual,
getIn = _ref.getIn,
setIn = _ref.setIn,
toJS = _ref.toJS;
var ConnectedField = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__ConnectedField__["a" /* default */])({
deepEqual: deepEqual,
getIn: getIn,
toJS: toJS
});
var Field = function (_Component) {
_inherits(Field, _Component);
function Field(props, context) {
_classCallCheck(this, Field);
var _this = _possibleConstructorReturn(this, (Field.__proto__ || Object.getPrototypeOf(Field)).call(this, props, context));
if (!context._reduxForm) {
throw new Error('Field must be inside a component decorated with reduxForm()');
}
_this.normalize = _this.normalize.bind(_this);
return _this;
}
_createClass(Field, [{
key: 'shouldComponentUpdate',
value: function shouldComponentUpdate(nextProps, nextState) {
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util_shallowCompare__["a" /* default */])(this, nextProps, nextState);
}
}, {
key: 'componentWillMount',
value: function componentWillMount() {
var _this2 = this;
this.context._reduxForm.register(this.name, 'Field', function () {
return _this2.props.validate;
}, function () {
return _this2.props.warn;
});
}
}, {
key: 'componentWillReceiveProps',
value: function componentWillReceiveProps(nextProps) {
if (this.props.name !== nextProps.name) {
// unregister old name
this.context._reduxForm.unregister(this.name);
// register new name
this.context._reduxForm.register(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__util_prefixName__["a" /* default */])(this.context, nextProps.name), 'Field');
}
}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {
this.context._reduxForm.unregister(this.name);
}
}, {
key: 'getRenderedComponent',
value: function getRenderedComponent() {
__WEBPACK_IMPORTED_MODULE_2_invariant___default()(this.props.withRef, 'If you want to access getRenderedComponent(), ' + 'you must specify a withRef prop to Field');
return this.refs.connected.getWrappedInstance().getRenderedComponent();
}
}, {
key: 'normalize',
value: function normalize(name, value) {
var normalize = this.props.normalize;
if (!normalize) {
return value;
}
var previousValues = this.context._reduxForm.getValues();
var previousValue = this.value;
var nextValues = setIn(previousValues, name, value);
return normalize(value, previousValue, nextValues, previousValues);
}
}, {
key: 'render',
value: function render() {
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_react__["createElement"])(ConnectedField, _extends({}, this.props, {
name: this.name,
normalize: this.normalize,
_reduxForm: this.context._reduxForm,
ref: 'connected'
}));
}
}, {
key: 'name',
get: function get() {
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__util_prefixName__["a" /* default */])(this.context, this.props.name);
}
}, {
key: 'dirty',
get: function get() {
return !this.pristine;
}
}, {
key: 'pristine',
get: function get() {
return this.refs.connected.getWrappedInstance().isPristine();
}
}, {
key: 'value',
get: function get() {
return this.refs.connected && this.refs.connected.getWrappedInstance().getValue();
}
}]);
return Field;
}(__WEBPACK_IMPORTED_MODULE_0_react__["Component"]);
Field.propTypes = {
name: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string.isRequired,
component: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]).isRequired,
format: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func,
normalize: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func,
onBlur: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func,
onChange: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func,
onFocus: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func,
onDragStart: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func,
onDrop: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func,
parse: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func,
props: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object,
validate: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.arrayOf(__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func)]),
warn: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.arrayOf(__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func)]),
withRef: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool
};
Field.contextTypes = {
_reduxForm: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object
};
return Field;
};
/* harmony default export */ __webpack_exports__["a"] = (createField);
/***/ }),
/* 911 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_invariant__ = __webpack_require__(23);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_invariant___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_invariant__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__ConnectedFieldArray__ = __webpack_require__(902);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_prefixName__ = __webpack_require__(110);
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; }; }();
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 toArray = function toArray(value) {
return Array.isArray(value) ? value : [value];
};
var wrapError = function wrapError(fn, key) {
return fn && function () {
var validators = toArray(fn);
for (var i = 0; i < validators.length; i++) {
var result = validators[i].apply(validators, arguments);
if (result) {
return _defineProperty({}, key, result);
}
}
};
};
var createFieldArray = function createFieldArray(_ref2) {
var deepEqual = _ref2.deepEqual,
getIn = _ref2.getIn,
size = _ref2.size;
var ConnectedFieldArray = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__ConnectedFieldArray__["a" /* default */])({
deepEqual: deepEqual,
getIn: getIn,
size: size
});
var FieldArray = function (_Component) {
_inherits(FieldArray, _Component);
function FieldArray(props, context) {
_classCallCheck(this, FieldArray);
var _this = _possibleConstructorReturn(this, (FieldArray.__proto__ || Object.getPrototypeOf(FieldArray)).call(this, props, context));
if (!context._reduxForm) {
throw new Error('FieldArray must be inside a component decorated with reduxForm()');
}
return _this;
}
_createClass(FieldArray, [{
key: 'componentWillMount',
value: function componentWillMount() {
var _this2 = this;
this.context._reduxForm.register(this.name, 'FieldArray', function () {
return wrapError(_this2.props.validate, '_error');
}, function () {
return wrapError(_this2.props.warn, '_warning');
});
}
}, {
key: 'componentWillReceiveProps',
value: function componentWillReceiveProps(nextProps) {
if (this.props.name !== nextProps.name) {
// unregister old name
this.context._reduxForm.unregister(this.name);
// register new name
this.context._reduxForm.register(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util_prefixName__["a" /* default */])(this.context, nextProps.name), 'FieldArray');
}
}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {
this.context._reduxForm.unregister(this.name);
}
}, {
key: 'getRenderedComponent',
value: function getRenderedComponent() {
__WEBPACK_IMPORTED_MODULE_2_invariant___default()(this.props.withRef, 'If you want to access getRenderedComponent(), ' + 'you must specify a withRef prop to FieldArray');
return this.refs.connected.getWrappedInstance().getRenderedComponent();
}
}, {
key: 'render',
value: function render() {
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_react__["createElement"])(ConnectedFieldArray, _extends({}, this.props, {
name: this.name,
syncError: this.syncError,
syncWarning: this.syncWarning,
_reduxForm: this.context._reduxForm,
ref: 'connected'
}));
}
}, {
key: 'name',
get: function get() {
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util_prefixName__["a" /* default */])(this.context, this.props.name);
}
}, {
key: 'dirty',
get: function get() {
return this.refs.connected.getWrappedInstance().dirty;
}
}, {
key: 'pristine',
get: function get() {
return this.refs.connected.getWrappedInstance().pristine;
}
}, {
key: 'value',
get: function get() {
return this.refs.connected.getWrappedInstance().value;
}
}]);
return FieldArray;
}(__WEBPACK_IMPORTED_MODULE_0_react__["Component"]);
FieldArray.propTypes = {
name: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string.isRequired,
component: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired,
props: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object,
validate: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.arrayOf(__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func)]),
warn: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.arrayOf(__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func)]),
withRef: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool
};
FieldArray.contextTypes = {
_reduxForm: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object
};
return FieldArray;
};
/* harmony default export */ __webpack_exports__["a"] = (createFieldArray);
/***/ }),
/* 912 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
var createFieldArrayProps = function createFieldArrayProps(getIn, name, form, sectionPrefix, getValue, _ref) {
var arrayInsert = _ref.arrayInsert,
arrayMove = _ref.arrayMove,
arrayPop = _ref.arrayPop,
arrayPush = _ref.arrayPush,
arrayRemove = _ref.arrayRemove,
arrayRemoveAll = _ref.arrayRemoveAll,
arrayShift = _ref.arrayShift,
arraySplice = _ref.arraySplice,
arraySwap = _ref.arraySwap,
arrayUnshift = _ref.arrayUnshift,
asyncError = _ref.asyncError,
dirty = _ref.dirty,
length = _ref.length,
pristine = _ref.pristine,
submitError = _ref.submitError,
state = _ref.state,
submitFailed = _ref.submitFailed,
submitting = _ref.submitting,
syncError = _ref.syncError,
syncWarning = _ref.syncWarning,
value = _ref.value,
props = _ref.props,
rest = _objectWithoutProperties(_ref, ['arrayInsert', 'arrayMove', 'arrayPop', 'arrayPush', 'arrayRemove', 'arrayRemoveAll', 'arrayShift', 'arraySplice', 'arraySwap', 'arrayUnshift', 'asyncError', 'dirty', 'length', 'pristine', 'submitError', 'state', 'submitFailed', 'submitting', 'syncError', 'syncWarning', 'value', 'props']);
var error = syncError || asyncError || submitError;
var warning = syncWarning;
var fieldName = sectionPrefix ? name.replace(sectionPrefix + '.', '') : name;
var finalProps = _extends({
fields: {
_isFieldArray: true,
forEach: function forEach(callback) {
return (value || []).forEach(function (item, index) {
return callback(fieldName + '[' + index + ']', index, finalProps.fields);
});
},
get: getValue,
getAll: function getAll() {
return value;
},
insert: arrayInsert,
length: length,
map: function map(callback) {
return (value || []).map(function (item, index) {
return callback(fieldName + '[' + index + ']', index, finalProps.fields);
});
},
move: arrayMove,
name: name,
pop: function pop() {
arrayPop();
return getIn(value, length - 1);
},
push: arrayPush,
reduce: function reduce(callback, initial) {
return (value || []).reduce(function (accumulator, item, index) {
return callback(accumulator, fieldName + '[' + index + ']', index, finalProps.fields);
}, initial);
},
remove: arrayRemove,
removeAll: arrayRemoveAll,
shift: function shift() {
arrayShift();
return getIn(value, 0);
},
swap: arraySwap,
unshift: arrayUnshift
},
meta: {
dirty: dirty,
error: error,
form: form,
warning: warning,
invalid: !!error,
pristine: pristine,
submitting: submitting,
submitFailed: submitFailed,
valid: !error
}
}, props, rest);
return finalProps;
};
/* harmony default export */ __webpack_exports__["a"] = (createFieldArrayProps);
/***/ }),
/* 913 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_invariant__ = __webpack_require__(23);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_invariant___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_invariant__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__ConnectedFields__ = __webpack_require__(903);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_shallowCompare__ = __webpack_require__(318);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__structure_plain__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__util_prefixName__ = __webpack_require__(110);
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; }; }();
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 validateNameProp = function validateNameProp(prop) {
if (!prop) {
return new Error('No "names" prop was specified <Fields/>');
}
if (!Array.isArray(prop) && !prop._isFieldArray) {
return new Error('Invalid prop "names" supplied to <Fields/>. Must be either an array of strings or the fields array generated by FieldArray.');
}
};
var createFields = function createFields(_ref) {
var deepEqual = _ref.deepEqual,
getIn = _ref.getIn,
toJS = _ref.toJS,
size = _ref.size;
var ConnectedFields = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__ConnectedFields__["a" /* default */])({
deepEqual: deepEqual,
getIn: getIn,
toJS: toJS,
size: size
});
var Fields = function (_Component) {
_inherits(Fields, _Component);
function Fields(props, context) {
_classCallCheck(this, Fields);
var _this = _possibleConstructorReturn(this, (Fields.__proto__ || Object.getPrototypeOf(Fields)).call(this, props, context));
if (!context._reduxForm) {
throw new Error('Fields must be inside a component decorated with reduxForm()');
}
return _this;
}
_createClass(Fields, [{
key: 'shouldComponentUpdate',
value: function shouldComponentUpdate(nextProps, nextState) {
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util_shallowCompare__["a" /* default */])(this, nextProps, nextState);
}
}, {
key: 'componentWillMount',
value: function componentWillMount() {
var error = validateNameProp(this.props.names);
if (error) {
throw error;
}
var context = this.context;
var register = context._reduxForm.register;
this.names.forEach(function (name) {
return register(name, 'Field');
});
}
}, {
key: 'componentWillReceiveProps',
value: function componentWillReceiveProps(nextProps) {
if (!__WEBPACK_IMPORTED_MODULE_5__structure_plain__["a" /* default */].deepEqual(this.props.names, nextProps.names)) {
var context = this.context;
var _context$_reduxForm = context._reduxForm,
register = _context$_reduxForm.register,
unregister = _context$_reduxForm.unregister;
// unregister old name
this.props.names.forEach(function (name) {
return unregister(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__util_prefixName__["a" /* default */])(context, name));
});
// register new name
nextProps.names.forEach(function (name) {
return register(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__util_prefixName__["a" /* default */])(context, name), 'Field');
});
}
}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {
var context = this.context;
var unregister = context._reduxForm.unregister;
this.props.names.forEach(function (name) {
return unregister(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__util_prefixName__["a" /* default */])(context, name));
});
}
}, {
key: 'getRenderedComponent',
value: function getRenderedComponent() {
__WEBPACK_IMPORTED_MODULE_2_invariant___default()(this.props.withRef, 'If you want to access getRenderedComponent(), ' + 'you must specify a withRef prop to Fields');
return this.refs.connected.getWrappedInstance().getRenderedComponent();
}
}, {
key: 'render',
value: function render() {
var context = this.context;
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_react__["createElement"])(ConnectedFields, _extends({}, this.props, {
names: this.props.names.map(function (name) {
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__util_prefixName__["a" /* default */])(context, name);
}),
_reduxForm: this.context._reduxForm,
ref: 'connected'
}));
}
}, {
key: 'names',
get: function get() {
var context = this.context;
return this.props.names.map(function (name) {
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__util_prefixName__["a" /* default */])(context, name);
});
}
}, {
key: 'dirty',
get: function get() {
return this.refs.connected.getWrappedInstance().isDirty();
}
}, {
key: 'pristine',
get: function get() {
return !this.dirty;
}
}, {
key: 'values',
get: function get() {
return this.refs.connected && this.refs.connected.getWrappedInstance().getValues();
}
}]);
return Fields;
}(__WEBPACK_IMPORTED_MODULE_0_react__["Component"]);
Fields.propTypes = {
names: function names(props, propName) {
return validateNameProp(props[propName]);
},
component: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]).isRequired,
format: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func,
parse: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func,
props: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object,
withRef: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool
};
Fields.contextTypes = {
_reduxForm: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object
};
return Fields;
};
/* harmony default export */ __webpack_exports__["a"] = (createFields);
/***/ }),
/* 914 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_invariant__ = __webpack_require__(23);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_invariant___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_invariant__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__structure_plain__ = __webpack_require__(6);
var createFormValueSelector = function createFormValueSelector(_ref) {
var getIn = _ref.getIn;
return function (form) {
var getFormState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (state) {
return getIn(state, 'form');
};
__WEBPACK_IMPORTED_MODULE_0_invariant___default()(form, 'Form value must be specified');
return function (state) {
for (var _len = arguments.length, fields = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
fields[_key - 1] = arguments[_key];
}
__WEBPACK_IMPORTED_MODULE_0_invariant___default()(fields.length, 'No fields specified');
return fields.length === 1 ? // only selecting one field, so return its value
getIn(getFormState(state), form + '.values.' + fields[0]) : // selecting many fields, so return an object of field values
fields.reduce(function (accumulator, field) {
var value = getIn(getFormState(state), form + '.values.' + field);
return value === undefined ? accumulator : __WEBPACK_IMPORTED_MODULE_1__structure_plain__["a" /* default */].setIn(accumulator, field, value);
}, {});
};
};
};
/* harmony default export */ __webpack_exports__["a"] = (createFormValueSelector);
/***/ }),
/* 915 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__actionTypes__ = __webpack_require__(185);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__deleteInWithCleanUp__ = __webpack_require__(918);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__structure_plain__ = __webpack_require__(6);
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
var isReduxFormAction = function isReduxFormAction(action) {
return action && action.type && action.type.length > __WEBPACK_IMPORTED_MODULE_0__actionTypes__["prefix"].length && action.type.substring(0, __WEBPACK_IMPORTED_MODULE_0__actionTypes__["prefix"].length) === __WEBPACK_IMPORTED_MODULE_0__actionTypes__["prefix"];
};
var createReducer = function createReducer(structure) {
var _behaviors;
var deepEqual = structure.deepEqual,
empty = structure.empty,
getIn = structure.getIn,
setIn = structure.setIn,
deleteIn = structure.deleteIn,
fromJS = structure.fromJS,
keys = structure.keys,
size = structure.size,
splice = structure.splice;
var deleteInWithCleanUp = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__deleteInWithCleanUp__["a" /* default */])(structure);
var doSplice = function doSplice(state, key, field, index, removeNum, value, force) {
var existing = getIn(state, key + '.' + field);
return existing || force ? setIn(state, key + '.' + field, splice(existing, index, removeNum, value)) : state;
};
var doPlainSplice = function doPlainSplice(state, key, field, index, removeNum, value, force) {
var slice = getIn(state, key);
var existing = __WEBPACK_IMPORTED_MODULE_2__structure_plain__["a" /* default */].getIn(slice, field);
return existing || force ? setIn(state, key, __WEBPACK_IMPORTED_MODULE_2__structure_plain__["a" /* default */].setIn(slice, field, __WEBPACK_IMPORTED_MODULE_2__structure_plain__["a" /* default */].splice(existing, index, removeNum, value))) : state;
};
var rootKeys = ['values', 'fields', 'submitErrors', 'asyncErrors'];
var arraySplice = function arraySplice(state, field, index, removeNum, value) {
var result = state;
var nonValuesValue = value != null ? empty : undefined;
result = doSplice(result, 'values', field, index, removeNum, value, true);
result = doSplice(result, 'fields', field, index, removeNum, nonValuesValue);
result = doPlainSplice(result, 'syncErrors', field, index, removeNum, undefined);
result = doPlainSplice(result, 'syncWarnings', field, index, removeNum, undefined);
result = doSplice(result, 'submitErrors', field, index, removeNum, undefined);
result = doSplice(result, 'asyncErrors', field, index, removeNum, undefined);
return result;
};
var behaviors = (_behaviors = {}, _defineProperty(_behaviors, __WEBPACK_IMPORTED_MODULE_0__actionTypes__["ARRAY_INSERT"], function (state, _ref) {
var _ref$meta = _ref.meta,
field = _ref$meta.field,
index = _ref$meta.index,
payload = _ref.payload;
return arraySplice(state, field, index, 0, payload);
}), _defineProperty(_behaviors, __WEBPACK_IMPORTED_MODULE_0__actionTypes__["ARRAY_MOVE"], function (state, _ref2) {
var _ref2$meta = _ref2.meta,
field = _ref2$meta.field,
from = _ref2$meta.from,
to = _ref2$meta.to;
var array = getIn(state, 'values.' + field);
var length = array ? size(array) : 0;
var result = state;
if (length) {
rootKeys.forEach(function (key) {
var path = key + '.' + field;
if (getIn(result, path)) {
var value = getIn(result, path + '[' + from + ']');
result = setIn(result, path, splice(getIn(result, path), from, 1)); // remove
result = setIn(result, path, splice(getIn(result, path), to, 0, value)); // insert
}
});
}
return result;
}), _defineProperty(_behaviors, __WEBPACK_IMPORTED_MODULE_0__actionTypes__["ARRAY_POP"], function (state, _ref3) {
var field = _ref3.meta.field;
var array = getIn(state, 'values.' + field);
var length = array ? size(array) : 0;
return length ? arraySplice(state, field, length - 1, 1) : state;
}), _defineProperty(_behaviors, __WEBPACK_IMPORTED_MODULE_0__actionTypes__["ARRAY_PUSH"], function (state, _ref4) {
var field = _ref4.meta.field,
payload = _ref4.payload;
var array = getIn(state, 'values.' + field);
var length = array ? size(array) : 0;
return arraySplice(state, field, length, 0, payload);
}), _defineProperty(_behaviors, __WEBPACK_IMPORTED_MODULE_0__actionTypes__["ARRAY_REMOVE"], function (state, _ref5) {
var _ref5$meta = _ref5.meta,
field = _ref5$meta.field,
index = _ref5$meta.index;
return arraySplice(state, field, index, 1);
}), _defineProperty(_behaviors, __WEBPACK_IMPORTED_MODULE_0__actionTypes__["ARRAY_REMOVE_ALL"], function (state, _ref6) {
var field = _ref6.meta.field;
var array = getIn(state, 'values.' + field);
var length = array ? size(array) : 0;
return length ? arraySplice(state, field, 0, length) : state;
}), _defineProperty(_behaviors, __WEBPACK_IMPORTED_MODULE_0__actionTypes__["ARRAY_SHIFT"], function (state, _ref7) {
var field = _ref7.meta.field;
return arraySplice(state, field, 0, 1);
}), _defineProperty(_behaviors, __WEBPACK_IMPORTED_MODULE_0__actionTypes__["ARRAY_SPLICE"], function (state, _ref8) {
var _ref8$meta = _ref8.meta,
field = _ref8$meta.field,
index = _ref8$meta.index,
removeNum = _ref8$meta.removeNum,
payload = _ref8.payload;
return arraySplice(state, field, index, removeNum, payload);
}), _defineProperty(_behaviors, __WEBPACK_IMPORTED_MODULE_0__actionTypes__["ARRAY_SWAP"], function (state, _ref9) {
var _ref9$meta = _ref9.meta,
field = _ref9$meta.field,
indexA = _ref9$meta.indexA,
indexB = _ref9$meta.indexB;
var result = state;
rootKeys.forEach(function (key) {
var valueA = getIn(result, key + '.' + field + '[' + indexA + ']');
var valueB = getIn(result, key + '.' + field + '[' + indexB + ']');
if (valueA !== undefined || valueB !== undefined) {
result = setIn(result, key + '.' + field + '[' + indexA + ']', valueB);
result = setIn(result, key + '.' + field + '[' + indexB + ']', valueA);
}
});
return result;
}), _defineProperty(_behaviors, __WEBPACK_IMPORTED_MODULE_0__actionTypes__["ARRAY_UNSHIFT"], function (state, _ref10) {
var field = _ref10.meta.field,
payload = _ref10.payload;
return arraySplice(state, field, 0, 0, payload);
}), _defineProperty(_behaviors, __WEBPACK_IMPORTED_MODULE_0__actionTypes__["AUTOFILL"], function (state, _ref11) {
var field = _ref11.meta.field,
payload = _ref11.payload;
var result = state;
result = deleteInWithCleanUp(result, 'asyncErrors.' + field);
result = deleteInWithCleanUp(result, 'submitErrors.' + field);
result = setIn(result, 'fields.' + field + '.autofilled', true);
result = setIn(result, 'values.' + field, payload);
return result;
}), _defineProperty(_behaviors, __WEBPACK_IMPORTED_MODULE_0__actionTypes__["BLUR"], function (state, _ref12) {
var _ref12$meta = _ref12.meta,
field = _ref12$meta.field,
touch = _ref12$meta.touch,
payload = _ref12.payload;
var result = state;
var initial = getIn(result, 'initial.' + field);
if (initial === undefined && payload === '') {
result = deleteInWithCleanUp(result, 'values.' + field);
} else if (payload !== undefined) {
result = setIn(result, 'values.' + field, payload);
}
if (field === getIn(result, 'active')) {
result = deleteIn(result, 'active');
}
result = deleteIn(result, 'fields.' + field + '.active');
if (touch) {
result = setIn(result, 'fields.' + field + '.touched', true);
result = setIn(result, 'anyTouched', true);
}
return result;
}), _defineProperty(_behaviors, __WEBPACK_IMPORTED_MODULE_0__actionTypes__["CHANGE"], function (state, _ref13) {
var _ref13$meta = _ref13.meta,
field = _ref13$meta.field,
touch = _ref13$meta.touch,
persistentSubmitErrors = _ref13$meta.persistentSubmitErrors,
payload = _ref13.payload;
var result = state;
var initial = getIn(result, 'initial.' + field);
if (initial === undefined && payload === '') {
result = deleteInWithCleanUp(result, 'values.' + field);
} else if (payload !== undefined) {
result = setIn(result, 'values.' + field, payload);
}
result = deleteInWithCleanUp(result, 'asyncErrors.' + field);
if (!persistentSubmitErrors) {
result = deleteInWithCleanUp(result, 'submitErrors.' + field);
}
result = deleteInWithCleanUp(result, 'fields.' + field + '.autofilled');
if (touch) {
result = setIn(result, 'fields.' + field + '.touched', true);
result = setIn(result, 'anyTouched', true);
}
return result;
}), _defineProperty(_behaviors, __WEBPACK_IMPORTED_MODULE_0__actionTypes__["CLEAR_SUBMIT"], function (state) {
return deleteIn(state, 'triggerSubmit');
}), _defineProperty(_behaviors, __WEBPACK_IMPORTED_MODULE_0__actionTypes__["CLEAR_SUBMIT_ERRORS"], function (state) {
return deleteInWithCleanUp(state, 'submitErrors');
}), _defineProperty(_behaviors, __WEBPACK_IMPORTED_MODULE_0__actionTypes__["CLEAR_ASYNC_ERROR"], function (state, _ref14) {
var field = _ref14.meta.field;
return deleteIn(state, 'asyncErrors.' + field);
}), _defineProperty(_behaviors, __WEBPACK_IMPORTED_MODULE_0__actionTypes__["FOCUS"], function (state, _ref15) {
var field = _ref15.meta.field;
var result = state;
var previouslyActive = getIn(state, 'active');
result = deleteIn(result, 'fields.' + previouslyActive + '.active');
result = setIn(result, 'fields.' + field + '.visited', true);
result = setIn(result, 'fields.' + field + '.active', true);
result = setIn(result, 'active', field);
return result;
}), _defineProperty(_behaviors, __WEBPACK_IMPORTED_MODULE_0__actionTypes__["INITIALIZE"], function (state, _ref16) {
var payload = _ref16.payload,
_ref16$meta = _ref16.meta,
keepDirty = _ref16$meta.keepDirty,
keepSubmitSucceeded = _ref16$meta.keepSubmitSucceeded;
var mapData = fromJS(payload);
var result = empty; // clean all field state
// persist old warnings, they will get recalculated if the new form values are different from the old values
var warning = getIn(state, 'warning');
if (warning) {
result = setIn(result, 'warning', warning);
}
var syncWarnings = getIn(state, 'syncWarnings');
if (syncWarnings) {
result = setIn(result, 'syncWarnings', syncWarnings);
}
// persist old errors, they will get recalculated if the new form values are different from the old values
var error = getIn(state, 'error');
if (error) {
result = setIn(result, 'error', error);
}
var syncErrors = getIn(state, 'syncErrors');
if (syncErrors) {
result = setIn(result, 'syncErrors', syncErrors);
}
var registeredFields = getIn(state, 'registeredFields');
if (registeredFields) {
result = setIn(result, 'registeredFields', registeredFields);
}
var newValues = mapData;
if (keepDirty && registeredFields) {
//
// Keep the value of dirty fields while updating the value of
// pristine fields. This way, apps can reinitialize forms while
// avoiding stomping on user edits.
//
// Note 1: The initialize action replaces all initial values
// regardless of keepDirty.
//
// Note 2: When a field is dirty, keepDirty is enabled, and the field
// value is the same as the new initial value for the field, the
// initialize action causes the field to become pristine. That effect
// is what we want.
//
var previousValues = getIn(state, 'values');
var previousInitialValues = getIn(state, 'initial');
keys(registeredFields).forEach(function (name) {
var previousInitialValue = getIn(previousInitialValues, name);
var previousValue = getIn(previousValues, name);
if (!deepEqual(previousValue, previousInitialValue)) {
// This field was dirty. Restore the dirty value.
newValues = setIn(newValues, name, previousValue);
}
});
}
if (keepSubmitSucceeded && getIn(state, 'submitSucceeded')) {
result = setIn(result, 'submitSucceeded', true);
}
result = setIn(result, 'values', newValues);
result = setIn(result, 'initial', mapData);
return result;
}), _defineProperty(_behaviors, __WEBPACK_IMPORTED_MODULE_0__actionTypes__["REGISTER_FIELD"], function (state, _ref17) {
var _ref17$payload = _ref17.payload,
name = _ref17$payload.name,
type = _ref17$payload.type;
var key = 'registeredFields[\'' + name + '\']';
var field = getIn(state, key);
if (field) {
var count = getIn(field, 'count') + 1;
field = setIn(field, 'count', count);
} else {
field = fromJS({ name: name, type: type, count: 1 });
}
return setIn(state, key, field);
}), _defineProperty(_behaviors, __WEBPACK_IMPORTED_MODULE_0__actionTypes__["RESET"], function (state) {
var result = empty;
var registeredFields = getIn(state, 'registeredFields');
if (registeredFields) {
result = setIn(result, 'registeredFields', registeredFields);
}
var values = getIn(state, 'initial');
if (values) {
result = setIn(result, 'values', values);
result = setIn(result, 'initial', values);
}
return result;
}), _defineProperty(_behaviors, __WEBPACK_IMPORTED_MODULE_0__actionTypes__["SUBMIT"], function (state) {
return setIn(state, 'triggerSubmit', true);
}), _defineProperty(_behaviors, __WEBPACK_IMPORTED_MODULE_0__actionTypes__["START_ASYNC_VALIDATION"], function (state, _ref18) {
var field = _ref18.meta.field;
return setIn(state, 'asyncValidating', field || true);
}), _defineProperty(_behaviors, __WEBPACK_IMPORTED_MODULE_0__actionTypes__["START_SUBMIT"], function (state) {
return setIn(state, 'submitting', true);
}), _defineProperty(_behaviors, __WEBPACK_IMPORTED_MODULE_0__actionTypes__["STOP_ASYNC_VALIDATION"], function (state, _ref19) {
var payload = _ref19.payload;
var result = state;
result = deleteIn(result, 'asyncValidating');
if (payload && Object.keys(payload).length) {
var _error = payload._error,
fieldErrors = _objectWithoutProperties(payload, ['_error']);
if (_error) {
result = setIn(result, 'error', _error);
}
if (Object.keys(fieldErrors).length) {
result = setIn(result, 'asyncErrors', fromJS(fieldErrors));
} else {
result = deleteIn(result, 'asyncErrors');
}
} else {
result = deleteIn(result, 'error');
result = deleteIn(result, 'asyncErrors');
}
return result;
}), _defineProperty(_behaviors, __WEBPACK_IMPORTED_MODULE_0__actionTypes__["STOP_SUBMIT"], function (state, _ref20) {
var payload = _ref20.payload;
var result = state;
result = deleteIn(result, 'submitting');
result = deleteIn(result, 'submitFailed');
result = deleteIn(result, 'submitSucceeded');
if (payload && Object.keys(payload).length) {
var _error = payload._error,
fieldErrors = _objectWithoutProperties(payload, ['_error']);
if (_error) {
result = setIn(result, 'error', _error);
} else {
result = deleteIn(result, 'error');
}
if (Object.keys(fieldErrors).length) {
result = setIn(result, 'submitErrors', fromJS(fieldErrors));
} else {
result = deleteIn(result, 'submitErrors');
}
result = setIn(result, 'submitFailed', true);
} else {
result = setIn(result, 'submitSucceeded', true);
result = deleteIn(result, 'error');
result = deleteIn(result, 'submitErrors');
}
return result;
}), _defineProperty(_behaviors, __WEBPACK_IMPORTED_MODULE_0__actionTypes__["SET_SUBMIT_FAILED"], function (state, _ref21) {
var fields = _ref21.meta.fields;
var result = state;
result = setIn(result, 'submitFailed', true);
result = deleteIn(result, 'submitSucceeded');
result = deleteIn(result, 'submitting');
fields.forEach(function (field) {
return result = setIn(result, 'fields.' + field + '.touched', true);
});
if (fields.length) {
result = setIn(result, 'anyTouched', true);
}
return result;
}), _defineProperty(_behaviors, __WEBPACK_IMPORTED_MODULE_0__actionTypes__["SET_SUBMIT_SUCCEEDED"], function (state) {
var result = state;
result = deleteIn(result, 'submitFailed');
result = setIn(result, 'submitSucceeded', true);
return result;
}), _defineProperty(_behaviors, __WEBPACK_IMPORTED_MODULE_0__actionTypes__["TOUCH"], function (state, _ref22) {
var fields = _ref22.meta.fields;
var result = state;
fields.forEach(function (field) {
return result = setIn(result, 'fields.' + field + '.touched', true);
});
result = setIn(result, 'anyTouched', true);
return result;
}), _defineProperty(_behaviors, __WEBPACK_IMPORTED_MODULE_0__actionTypes__["UNREGISTER_FIELD"], function (state, _ref23) {
var _ref23$payload = _ref23.payload,
name = _ref23$payload.name,
destroyOnUnmount = _ref23$payload.destroyOnUnmount;
var result = state;
var key = 'registeredFields[\'' + name + '\']';
var field = getIn(result, key);
if (!field) {
return result;
}
var count = getIn(field, 'count') - 1;
if (count <= 0 && destroyOnUnmount) {
// Note: Cannot use deleteWithCleanUp here because of the flat nature of registeredFields
result = deleteIn(result, key);
if (deepEqual(getIn(result, 'registeredFields'), empty)) {
result = deleteIn(result, 'registeredFields');
}
} else {
field = setIn(field, 'count', count);
result = setIn(result, key, field);
}
if (destroyOnUnmount) {
result = deleteInWithCleanUp(result, 'syncErrors.' + name);
result = deleteInWithCleanUp(result, 'submitErrors.' + name);
result = deleteInWithCleanUp(result, 'asyncErrors.' + name);
result = deleteInWithCleanUp(result, 'syncWarnings.' + name);
}
return result;
}), _defineProperty(_behaviors, __WEBPACK_IMPORTED_MODULE_0__actionTypes__["UNTOUCH"], function (state, _ref24) {
var fields = _ref24.meta.fields;
var result = state;
fields.forEach(function (field) {
return result = deleteIn(result, 'fields.' + field + '.touched');
});
var anyTouched = keys(getIn(result, 'registeredFields')).some(function (key) {
return getIn(result, 'fields.' + key + '.touched');
});
result = anyTouched ? setIn(result, 'anyTouched', true) : deleteIn(result, 'anyTouched');
return result;
}), _defineProperty(_behaviors, __WEBPACK_IMPORTED_MODULE_0__actionTypes__["UPDATE_SYNC_ERRORS"], function (state, _ref25) {
var _ref25$payload = _ref25.payload,
syncErrors = _ref25$payload.syncErrors,
error = _ref25$payload.error;
var result = state;
if (error) {
result = setIn(result, 'error', error);
result = setIn(result, 'syncError', true);
} else {
result = deleteIn(result, 'error');
result = deleteIn(result, 'syncError');
}
if (Object.keys(syncErrors).length) {
result = setIn(result, 'syncErrors', syncErrors);
} else {
result = deleteIn(result, 'syncErrors');
}
return result;
}), _defineProperty(_behaviors, __WEBPACK_IMPORTED_MODULE_0__actionTypes__["UPDATE_SYNC_WARNINGS"], function (state, _ref26) {
var _ref26$payload = _ref26.payload,
syncWarnings = _ref26$payload.syncWarnings,
warning = _ref26$payload.warning;
var result = state;
if (warning) {
result = setIn(result, 'warning', warning);
} else {
result = deleteIn(result, 'warning');
}
if (Object.keys(syncWarnings).length) {
result = setIn(result, 'syncWarnings', syncWarnings);
} else {
result = deleteIn(result, 'syncWarnings');
}
return result;
}), _behaviors);
var reducer = function reducer() {
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : empty;
var action = arguments[1];
var behavior = behaviors[action.type];
return behavior ? behavior(state, action) : state;
};
var byForm = function byForm(reducer) {
return function () {
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : empty;
var action = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var form = action && action.meta && action.meta.form;
if (!form || !isReduxFormAction(action)) {
return state;
}
if (action.type === __WEBPACK_IMPORTED_MODULE_0__actionTypes__["DESTROY"]) {
return action.meta.form.reduce(function (result, form) {
return deleteInWithCleanUp(result, form);
}, state);
}
var formState = getIn(state, form);
var result = reducer(formState, action);
return result === formState ? state : setIn(state, form, result);
};
};
/**
* Adds additional functionality to the reducer
*/
function decorate(target) {
target.plugin = function plugin(reducers) {
var _this = this;
// use 'function' keyword to enable 'this'
return decorate(function () {
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : empty;
var action = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
return Object.keys(reducers).reduce(function (accumulator, key) {
var previousState = getIn(accumulator, key);
var nextState = reducers[key](previousState, action, getIn(state, key));
return nextState === previousState ? accumulator : setIn(accumulator, key, nextState);
}, _this(state, action));
});
};
return target;
}
return decorate(byForm(reducer));
};
/* harmony default export */ __webpack_exports__["a"] = (createReducer);
/***/ }),
/* 916 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_es_merge__ = __webpack_require__(586);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash_es_mapValues__ = __webpack_require__(242);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_hoist_non_react_statics__ = __webpack_require__(129);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_hoist_non_react_statics___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_hoist_non_react_statics__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_is_promise__ = __webpack_require__(130);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_is_promise___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_is_promise__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_prop_types__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_prop_types__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react_redux__ = __webpack_require__(77);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_redux__ = __webpack_require__(187);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__actions__ = __webpack_require__(310);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__asyncValidation__ = __webpack_require__(909);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__defaultShouldAsyncValidate__ = __webpack_require__(312);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__defaultShouldValidate__ = __webpack_require__(313);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__events_silenceEvent__ = __webpack_require__(316);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__events_silenceEvents__ = __webpack_require__(920);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__generateValidator__ = __webpack_require__(922);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__handleSubmit__ = __webpack_require__(931);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__selectors_isValid__ = __webpack_require__(186);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__structure_plain__ = __webpack_require__(6);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__util_getDisplayName__ = __webpack_require__(965);
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 _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _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); } }
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 isClassComponent = function isClassComponent(Component) {
return Boolean(Component && Component.prototype && _typeof(Component.prototype.isReactComponent) === 'object');
};
// extract field-specific actions
var arrayInsert = __WEBPACK_IMPORTED_MODULE_8__actions__["arrayInsert"],
arrayMove = __WEBPACK_IMPORTED_MODULE_8__actions__["arrayMove"],
arrayPop = __WEBPACK_IMPORTED_MODULE_8__actions__["arrayPop"],
arrayPush = __WEBPACK_IMPORTED_MODULE_8__actions__["arrayPush"],
arrayRemove = __WEBPACK_IMPORTED_MODULE_8__actions__["arrayRemove"],
arrayRemoveAll = __WEBPACK_IMPORTED_MODULE_8__actions__["arrayRemoveAll"],
arrayShift = __WEBPACK_IMPORTED_MODULE_8__actions__["arrayShift"],
arraySplice = __WEBPACK_IMPORTED_MODULE_8__actions__["arraySplice"],
arraySwap = __WEBPACK_IMPORTED_MODULE_8__actions__["arraySwap"],
arrayUnshift = __WEBPACK_IMPORTED_MODULE_8__actions__["arrayUnshift"],
blur = __WEBPACK_IMPORTED_MODULE_8__actions__["blur"],
change = __WEBPACK_IMPORTED_MODULE_8__actions__["change"],
focus = __WEBPACK_IMPORTED_MODULE_8__actions__["focus"],
formActions = _objectWithoutProperties(__WEBPACK_IMPORTED_MODULE_8__actions__, ['arrayInsert', 'arrayMove', 'arrayPop', 'arrayPush', 'arrayRemove', 'arrayRemoveAll', 'arrayShift', 'arraySplice', 'arraySwap', 'arrayUnshift', 'blur', 'change', 'focus']);
var arrayActions = {
arrayInsert: arrayInsert,
arrayMove: arrayMove,
arrayPop: arrayPop,
arrayPush: arrayPush,
arrayRemove: arrayRemove,
arrayRemoveAll: arrayRemoveAll,
arrayShift: arrayShift,
arraySplice: arraySplice,
arraySwap: arraySwap,
arrayUnshift: arrayUnshift
};
var propsToNotUpdateFor = [].concat(_toConsumableArray(Object.keys(__WEBPACK_IMPORTED_MODULE_8__actions__)), ['array', 'asyncErrors', 'initialValues', 'syncErrors', 'syncWarnings', 'values', 'registeredFields']);
var checkSubmit = function checkSubmit(submit) {
if (!submit || typeof submit !== 'function') {
throw new Error('You must either pass handleSubmit() an onSubmit function or pass onSubmit as a prop');
}
return submit;
};
/**
* The decorator that is the main API to redux-form
*/
var createReduxForm = function createReduxForm(structure) {
var deepEqual = structure.deepEqual,
empty = structure.empty,
getIn = structure.getIn,
setIn = structure.setIn,
keys = structure.keys,
fromJS = structure.fromJS;
var isValid = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_16__selectors_isValid__["a" /* default */])(structure);
return function (initialConfig) {
var config = _extends({
touchOnBlur: true,
touchOnChange: false,
persistentSubmitErrors: false,
destroyOnUnmount: true,
shouldAsyncValidate: __WEBPACK_IMPORTED_MODULE_10__defaultShouldAsyncValidate__["a" /* default */],
shouldValidate: __WEBPACK_IMPORTED_MODULE_11__defaultShouldValidate__["a" /* default */],
enableReinitialize: false,
keepDirtyOnReinitialize: false,
getFormState: function getFormState(state) {
return getIn(state, 'form');
},
pure: true,
forceUnregisterOnUnmount: false
}, initialConfig);
return function (WrappedComponent) {
var Form = function (_Component) {
_inherits(Form, _Component);
function Form(props) {
_classCallCheck(this, Form);
var _this = _possibleConstructorReturn(this, (Form.__proto__ || Object.getPrototypeOf(Form)).call(this, props));
_this.submit = _this.submit.bind(_this);
_this.reset = _this.reset.bind(_this);
_this.asyncValidate = _this.asyncValidate.bind(_this);
_this.getValues = _this.getValues.bind(_this);
_this.register = _this.register.bind(_this);
_this.unregister = _this.unregister.bind(_this);
_this.submitCompleted = _this.submitCompleted.bind(_this);
_this.submitFailed = _this.submitFailed.bind(_this);
_this.fieldValidators = {};
_this.lastFieldValidatorKeys = [];
_this.fieldWarners = {};
_this.lastFieldWarnerKeys = [];
return _this;
}
_createClass(Form, [{
key: 'getChildContext',
value: function getChildContext() {
var _this2 = this;
return {
_reduxForm: _extends({}, this.props, {
getFormState: function getFormState(state) {
return getIn(_this2.props.getFormState(state), _this2.props.form);
},
asyncValidate: this.asyncValidate,
getValues: this.getValues,
sectionPrefix: undefined,
register: this.register,
unregister: this.unregister,
registerInnerOnSubmit: function registerInnerOnSubmit(innerOnSubmit) {
return _this2.innerOnSubmit = innerOnSubmit;
}
})
};
}
}, {
key: 'initIfNeeded',
value: function initIfNeeded(nextProps) {
var enableReinitialize = this.props.enableReinitialize;
if (nextProps) {
if ((enableReinitialize || !nextProps.initialized) && !deepEqual(this.props.initialValues, nextProps.initialValues)) {
var keepDirty = nextProps.initialized && this.props.keepDirtyOnReinitialize;
this.props.initialize(nextProps.initialValues, keepDirty, {
lastInitialValues: this.props.initialValues
});
}
} else if (this.props.initialValues && (!this.props.initialized || enableReinitialize)) {
this.props.initialize(this.props.initialValues, this.props.keepDirtyOnReinitialize);
}
}
}, {
key: 'updateSyncErrorsIfNeeded',
value: function updateSyncErrorsIfNeeded(nextSyncErrors, nextError, lastSyncErrors) {
var _props = this.props,
error = _props.error,
updateSyncErrors = _props.updateSyncErrors;
var noErrors = (!lastSyncErrors || !Object.keys(lastSyncErrors).length) && !error;
var nextNoErrors = (!nextSyncErrors || !Object.keys(nextSyncErrors).length) && !nextError;
if (!(noErrors && nextNoErrors) && (!__WEBPACK_IMPORTED_MODULE_17__structure_plain__["a" /* default */].deepEqual(lastSyncErrors, nextSyncErrors) || !__WEBPACK_IMPORTED_MODULE_17__structure_plain__["a" /* default */].deepEqual(error, nextError))) {
updateSyncErrors(nextSyncErrors, nextError);
}
}
}, {
key: 'clearSubmitPromiseIfNeeded',
value: function clearSubmitPromiseIfNeeded(nextProps) {
var submitting = this.props.submitting;
if (this.submitPromise && submitting && !nextProps.submitting) {
delete this.submitPromise;
}
}
}, {
key: 'submitIfNeeded',
value: function submitIfNeeded(nextProps) {
var _props2 = this.props,
clearSubmit = _props2.clearSubmit,
triggerSubmit = _props2.triggerSubmit;
if (!triggerSubmit && nextProps.triggerSubmit) {
clearSubmit();
this.submit();
}
}
}, {
key: 'validateIfNeeded',
value: function validateIfNeeded(nextProps) {
var _props3 = this.props,
shouldValidate = _props3.shouldValidate,
validate = _props3.validate,
values = _props3.values;
var fieldLevelValidate = this.generateValidator();
if (validate || fieldLevelValidate) {
var initialRender = nextProps === undefined;
var fieldValidatorKeys = Object.keys(this.getValidators());
var shouldValidateResult = shouldValidate({
values: values,
nextProps: nextProps,
props: this.props,
initialRender: initialRender,
lastFieldValidatorKeys: this.lastFieldValidatorKeys,
fieldValidatorKeys: fieldValidatorKeys,
structure: structure
});
if (shouldValidateResult) {
var propsToValidate = initialRender ? this.props : nextProps;
var _merge2 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_lodash_es_merge__["a" /* default */])(validate ? validate(propsToValidate.values, propsToValidate) || {} : {}, fieldLevelValidate ? fieldLevelValidate(propsToValidate.values, propsToValidate) || {} : {}),
_error = _merge2._error,
nextSyncErrors = _objectWithoutProperties(_merge2, ['_error']);
this.lastFieldValidatorKeys = fieldValidatorKeys;
this.updateSyncErrorsIfNeeded(nextSyncErrors, _error, propsToValidate.syncErrors);
}
}
}
}, {
key: 'updateSyncWarningsIfNeeded',
value: function updateSyncWarningsIfNeeded(nextSyncWarnings, nextWarning, lastSyncWarnings) {
var _props4 = this.props,
warning = _props4.warning,
syncWarnings = _props4.syncWarnings,
updateSyncWarnings = _props4.updateSyncWarnings;
var noWarnings = (!syncWarnings || !Object.keys(syncWarnings).length) && !warning;
var nextNoWarnings = (!nextSyncWarnings || !Object.keys(nextSyncWarnings).length) && !nextWarning;
if (!(noWarnings && nextNoWarnings) && (!__WEBPACK_IMPORTED_MODULE_17__structure_plain__["a" /* default */].deepEqual(lastSyncWarnings, nextSyncWarnings) || !__WEBPACK_IMPORTED_MODULE_17__structure_plain__["a" /* default */].deepEqual(warning, nextWarning))) {
updateSyncWarnings(nextSyncWarnings, nextWarning);
}
}
}, {
key: 'warnIfNeeded',
value: function warnIfNeeded(nextProps) {
var _props5 = this.props,
shouldValidate = _props5.shouldValidate,
warn = _props5.warn,
values = _props5.values;
var fieldLevelWarn = this.generateWarner();
if (warn || fieldLevelWarn) {
var initialRender = nextProps === undefined;
var fieldWarnerKeys = Object.keys(this.getWarners());
var shouldWarnResult = shouldValidate({
values: values,
nextProps: nextProps,
props: this.props,
initialRender: initialRender,
lastFieldValidatorKeys: this.lastFieldWarnerKeys,
fieldValidatorKeys: fieldWarnerKeys,
structure: structure
});
if (shouldWarnResult) {
var propsToWarn = initialRender ? this.props : nextProps;
var _merge3 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_lodash_es_merge__["a" /* default */])(warn ? warn(propsToWarn.values, propsToWarn) : {}, fieldLevelWarn ? fieldLevelWarn(propsToWarn.values, propsToWarn) : {}),
_warning = _merge3._warning,
nextSyncWarnings = _objectWithoutProperties(_merge3, ['_warning']);
this.lastFieldWarnerKeys = fieldWarnerKeys;
this.updateSyncWarningsIfNeeded(nextSyncWarnings, _warning, propsToWarn.syncWarnings);
}
}
}
}, {
key: 'componentWillMount',
value: function componentWillMount() {
this.initIfNeeded();
this.validateIfNeeded();
this.warnIfNeeded();
}
}, {
key: 'componentWillReceiveProps',
value: function componentWillReceiveProps(nextProps) {
this.initIfNeeded(nextProps);
this.validateIfNeeded(nextProps);
this.warnIfNeeded(nextProps);
this.clearSubmitPromiseIfNeeded(nextProps);
this.submitIfNeeded(nextProps);
if (nextProps.onChange) {
if (!deepEqual(nextProps.values, this.props.values)) {
nextProps.onChange(nextProps.values, nextProps.dispatch, nextProps);
}
}
}
}, {
key: 'shouldComponentUpdate',
value: function shouldComponentUpdate(nextProps) {
var _this3 = this;
if (!this.props.pure) return true;
return Object.keys(nextProps).some(function (prop) {
// useful to debug rerenders
// if (!plain.deepEqual(this.props[ prop ], nextProps[ prop ])) {
// console.info(prop, 'changed', this.props[ prop ], '==>', nextProps[ prop ])
// }
return !~propsToNotUpdateFor.indexOf(prop) && !deepEqual(_this3.props[prop], nextProps[prop]);
});
}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {
var _props6 = this.props,
destroyOnUnmount = _props6.destroyOnUnmount,
destroy = _props6.destroy;
if (destroyOnUnmount) {
this.destroyed = true;
destroy();
}
}
}, {
key: 'getValues',
value: function getValues() {
return this.props.values;
}
}, {
key: 'isValid',
value: function isValid() {
return this.props.valid;
}
}, {
key: 'isPristine',
value: function isPristine() {
return this.props.pristine;
}
}, {
key: 'register',
value: function register(name, type, getValidator, getWarner) {
this.props.registerField(name, type);
if (getValidator) {
this.fieldValidators[name] = getValidator;
}
if (getWarner) {
this.fieldWarners[name] = getWarner;
}
}
}, {
key: 'unregister',
value: function unregister(name) {
if (!this.destroyed) {
if (this.props.destroyOnUnmount || this.props.forceUnregisterOnUnmount) {
this.props.unregisterField(name);
delete this.fieldValidators[name];
delete this.fieldWarners[name];
} else {
this.props.unregisterField(name, false);
}
}
}
}, {
key: 'getFieldList',
value: function getFieldList(options) {
var registeredFields = this.props.registeredFields;
var list = [];
if (!registeredFields) {
return list;
}
var keySeq = keys(registeredFields);
if (options && options.excludeFieldArray) {
keySeq = keySeq.filter(function (name) {
return getIn(registeredFields, '[\'' + name + '\'].type') !== 'FieldArray';
});
}
return fromJS(keySeq.reduce(function (acc, key) {
acc.push(key);
return acc;
}, list));
}
}, {
key: 'getValidators',
value: function getValidators() {
var _this4 = this;
var validators = {};
Object.keys(this.fieldValidators).forEach(function (name) {
var validator = _this4.fieldValidators[name]();
if (validator) {
validators[name] = validator;
}
});
return validators;
}
}, {
key: 'generateValidator',
value: function generateValidator() {
var validators = this.getValidators();
return Object.keys(validators).length ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_14__generateValidator__["a" /* default */])(validators, structure) : undefined;
}
}, {
key: 'getWarners',
value: function getWarners() {
var _this5 = this;
var warners = {};
Object.keys(this.fieldWarners).forEach(function (name) {
var warner = _this5.fieldWarners[name]();
if (warner) {
warners[name] = warner;
}
});
return warners;
}
}, {
key: 'generateWarner',
value: function generateWarner() {
var warners = this.getWarners();
return Object.keys(warners).length ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_14__generateValidator__["a" /* default */])(warners, structure) : undefined;
}
}, {
key: 'asyncValidate',
value: function asyncValidate(name, value) {
var _this6 = this;
var _props7 = this.props,
asyncBlurFields = _props7.asyncBlurFields,
asyncErrors = _props7.asyncErrors,
asyncValidate = _props7.asyncValidate,
dispatch = _props7.dispatch,
initialized = _props7.initialized,
pristine = _props7.pristine,
shouldAsyncValidate = _props7.shouldAsyncValidate,
startAsyncValidation = _props7.startAsyncValidation,
stopAsyncValidation = _props7.stopAsyncValidation,
syncErrors = _props7.syncErrors,
values = _props7.values;
var submitting = !name;
if (asyncValidate) {
var valuesToValidate = submitting ? values : setIn(values, name, value);
var syncValidationPasses = submitting || !getIn(syncErrors, name);
var isBlurredField = !submitting && (!asyncBlurFields || ~asyncBlurFields.indexOf(name.replace(/\[[0-9]+\]/g, '[]')));
if ((isBlurredField || submitting) && shouldAsyncValidate({
asyncErrors: asyncErrors,
initialized: initialized,
trigger: submitting ? 'submit' : 'blur',
blurredField: name,
pristine: pristine,
syncValidationPasses: syncValidationPasses
})) {
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_9__asyncValidation__["a" /* default */])(function () {
return asyncValidate(valuesToValidate, dispatch, _this6.props, name);
}, startAsyncValidation, stopAsyncValidation, name);
}
}
}
}, {
key: 'submitCompleted',
value: function submitCompleted(result) {
delete this.submitPromise;
return result;
}
}, {
key: 'submitFailed',
value: function submitFailed(error) {
delete this.submitPromise;
throw error;
}
}, {
key: 'listenToSubmit',
value: function listenToSubmit(promise) {
if (!__WEBPACK_IMPORTED_MODULE_3_is_promise___default()(promise)) {
return promise;
}
this.submitPromise = promise;
return promise.then(this.submitCompleted, this.submitFailed);
}
}, {
key: 'submit',
value: function submit(submitOrEvent) {
var _this7 = this;
var _props8 = this.props,
onSubmit = _props8.onSubmit,
blur = _props8.blur,
change = _props8.change,
dispatch = _props8.dispatch;
if (!submitOrEvent || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_12__events_silenceEvent__["a" /* default */])(submitOrEvent)) {
// submitOrEvent is an event: fire submit if not already submitting
if (!this.submitPromise) {
if (this.innerOnSubmit) {
// will call "submitOrEvent is the submit function" block below
return this.innerOnSubmit();
} else {
return this.listenToSubmit(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_15__handleSubmit__["a" /* default */])(checkSubmit(onSubmit), _extends({}, this.props, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7_redux__["a" /* bindActionCreators */])({ blur: blur, change: change }, dispatch)), this.props.validExceptSubmit, this.asyncValidate, this.getFieldList({ excludeFieldArray: true })));
}
}
} else {
// submitOrEvent is the submit function: return deferred submit thunk
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_13__events_silenceEvents__["a" /* default */])(function () {
return !_this7.submitPromise && _this7.listenToSubmit(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_15__handleSubmit__["a" /* default */])(checkSubmit(submitOrEvent), _extends({}, _this7.props, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7_redux__["a" /* bindActionCreators */])({ blur: blur, change: change }, dispatch)), _this7.props.validExceptSubmit, _this7.asyncValidate, _this7.getFieldList({ excludeFieldArray: true })));
});
}
}
}, {
key: 'reset',
value: function reset() {
this.props.reset();
}
}, {
key: 'render',
value: function render() {
// remove some redux-form config-only props
/* eslint-disable no-unused-vars */
var _props9 = this.props,
anyTouched = _props9.anyTouched,
arrayInsert = _props9.arrayInsert,
arrayMove = _props9.arrayMove,
arrayPop = _props9.arrayPop,
arrayPush = _props9.arrayPush,
arrayRemove = _props9.arrayRemove,
arrayRemoveAll = _props9.arrayRemoveAll,
arrayShift = _props9.arrayShift,
arraySplice = _props9.arraySplice,
arraySwap = _props9.arraySwap,
arrayUnshift = _props9.arrayUnshift,
asyncErrors = _props9.asyncErrors,
asyncValidate = _props9.asyncValidate,
asyncValidating = _props9.asyncValidating,
blur = _props9.blur,
change = _props9.change,
destroy = _props9.destroy,
destroyOnUnmount = _props9.destroyOnUnmount,
forceUnregisterOnUnmount = _props9.forceUnregisterOnUnmount,
dirty = _props9.dirty,
dispatch = _props9.dispatch,
enableReinitialize = _props9.enableReinitialize,
error = _props9.error,
focus = _props9.focus,
form = _props9.form,
getFormState = _props9.getFormState,
initialize = _props9.initialize,
initialized = _props9.initialized,
initialValues = _props9.initialValues,
invalid = _props9.invalid,
keepDirtyOnReinitialize = _props9.keepDirtyOnReinitialize,
pristine = _props9.pristine,
propNamespace = _props9.propNamespace,
registeredFields = _props9.registeredFields,
registerField = _props9.registerField,
reset = _props9.reset,
setSubmitFailed = _props9.setSubmitFailed,
setSubmitSucceeded = _props9.setSubmitSucceeded,
shouldAsyncValidate = _props9.shouldAsyncValidate,
shouldValidate = _props9.shouldValidate,
startAsyncValidation = _props9.startAsyncValidation,
startSubmit = _props9.startSubmit,
stopAsyncValidation = _props9.stopAsyncValidation,
stopSubmit = _props9.stopSubmit,
submitting = _props9.submitting,
submitFailed = _props9.submitFailed,
submitSucceeded = _props9.submitSucceeded,
touch = _props9.touch,
touchOnBlur = _props9.touchOnBlur,
touchOnChange = _props9.touchOnChange,
persistentSubmitErrors = _props9.persistentSubmitErrors,
syncErrors = _props9.syncErrors,
syncWarnings = _props9.syncWarnings,
unregisterField = _props9.unregisterField,
untouch = _props9.untouch,
updateSyncErrors = _props9.updateSyncErrors,
updateSyncWarnings = _props9.updateSyncWarnings,
valid = _props9.valid,
validExceptSubmit = _props9.validExceptSubmit,
values = _props9.values,
warning = _props9.warning,
rest = _objectWithoutProperties(_props9, ['anyTouched', 'arrayInsert', 'arrayMove', 'arrayPop', 'arrayPush', 'arrayRemove', 'arrayRemoveAll', 'arrayShift', 'arraySplice', 'arraySwap', 'arrayUnshift', 'asyncErrors', 'asyncValidate', 'asyncValidating', 'blur', 'change', 'destroy', 'destroyOnUnmount', 'forceUnregisterOnUnmount', 'dirty', 'dispatch', 'enableReinitialize', 'error', 'focus', 'form', 'getFormState', 'initialize', 'initialized', 'initialValues', 'invalid', 'keepDirtyOnReinitialize', 'pristine', 'propNamespace', 'registeredFields', 'registerField', 'reset', 'setSubmitFailed', 'setSubmitSucceeded', 'shouldAsyncValidate', 'shouldValidate', 'startAsyncValidation', 'startSubmit', 'stopAsyncValidation', 'stopSubmit', 'submitting', 'submitFailed', 'submitSucceeded', 'touch', 'touchOnBlur', 'touchOnChange', 'persistentSubmitErrors', 'syncErrors', 'syncWarnings', 'unregisterField', 'untouch', 'updateSyncErrors', 'updateSyncWarnings', 'valid', 'validExceptSubmit', 'values', 'warning']);
/* eslint-enable no-unused-vars */
var reduxFormProps = _extends({
anyTouched: anyTouched,
asyncValidate: this.asyncValidate,
asyncValidating: asyncValidating
}, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7_redux__["a" /* bindActionCreators */])({ blur: blur, change: change }, dispatch), {
destroy: destroy,
dirty: dirty,
dispatch: dispatch,
error: error,
form: form,
handleSubmit: this.submit,
initialize: initialize,
initialized: initialized,
initialValues: initialValues,
invalid: invalid,
pristine: pristine,
reset: reset,
submitting: submitting,
submitFailed: submitFailed,
submitSucceeded: submitSucceeded,
touch: touch,
untouch: untouch,
valid: valid,
warning: warning
});
var propsToPass = _extends({}, propNamespace ? _defineProperty({}, propNamespace, reduxFormProps) : reduxFormProps, rest);
if (isClassComponent(WrappedComponent)) {
propsToPass.ref = 'wrapped';
}
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5_react__["createElement"])(WrappedComponent, propsToPass);
}
}]);
return Form;
}(__WEBPACK_IMPORTED_MODULE_5_react__["Component"]);
Form.displayName = 'Form(' + __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_18__util_getDisplayName__["a" /* default */])(WrappedComponent) + ')';
Form.WrappedComponent = WrappedComponent;
Form.childContextTypes = {
_reduxForm: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.object.isRequired
};
Form.propTypes = {
destroyOnUnmount: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.bool,
forceUnregisterOnUnmount: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.bool,
form: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.string.isRequired,
initialValues: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.object,
getFormState: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.func,
onSubmitFail: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.func,
onSubmitSuccess: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.func,
propNameSpace: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.string,
validate: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.func,
warn: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.func,
touchOnBlur: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.bool,
touchOnChange: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.bool,
triggerSubmit: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.bool,
persistentSubmitErrors: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.bool,
registeredFields: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.any
};
var connector = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6_react_redux__["a" /* connect */])(function (state, props) {
var form = props.form,
getFormState = props.getFormState,
initialValues = props.initialValues,
enableReinitialize = props.enableReinitialize,
keepDirtyOnReinitialize = props.keepDirtyOnReinitialize;
var formState = getIn(getFormState(state) || empty, form) || empty;
var stateInitial = getIn(formState, 'initial');
var initialized = !!stateInitial;
var shouldUpdateInitialValues = enableReinitialize && initialized && !deepEqual(initialValues, stateInitial);
var shouldResetValues = shouldUpdateInitialValues && !keepDirtyOnReinitialize;
var initial = initialValues || stateInitial || empty;
if (shouldUpdateInitialValues) {
initial = stateInitial || empty;
}
var values = getIn(formState, 'values') || initial;
if (shouldResetValues) {
values = initial;
}
var pristine = shouldResetValues || deepEqual(initial, values);
var asyncErrors = getIn(formState, 'asyncErrors');
var syncErrors = getIn(formState, 'syncErrors') || {};
var syncWarnings = getIn(formState, 'syncWarnings') || {};
var registeredFields = getIn(formState, 'registeredFields');
var valid = isValid(form, getFormState, false)(state);
var validExceptSubmit = isValid(form, getFormState, true)(state);
var anyTouched = !!getIn(formState, 'anyTouched');
var submitting = !!getIn(formState, 'submitting');
var submitFailed = !!getIn(formState, 'submitFailed');
var submitSucceeded = !!getIn(formState, 'submitSucceeded');
var error = getIn(formState, 'error');
var warning = getIn(formState, 'warning');
var triggerSubmit = getIn(formState, 'triggerSubmit');
return {
anyTouched: anyTouched,
asyncErrors: asyncErrors,
asyncValidating: getIn(formState, 'asyncValidating') || false,
dirty: !pristine,
error: error,
initialized: initialized,
invalid: !valid,
pristine: pristine,
registeredFields: registeredFields,
submitting: submitting,
submitFailed: submitFailed,
submitSucceeded: submitSucceeded,
syncErrors: syncErrors,
syncWarnings: syncWarnings,
triggerSubmit: triggerSubmit,
values: values,
valid: valid,
validExceptSubmit: validExceptSubmit,
warning: warning
};
}, function (dispatch, initialProps) {
var bindForm = function bindForm(actionCreator) {
return actionCreator.bind(null, initialProps.form);
};
// Bind the first parameter on `props.form`
var boundFormACs = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1_lodash_es_mapValues__["a" /* default */])(formActions, bindForm);
var boundArrayACs = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1_lodash_es_mapValues__["a" /* default */])(arrayActions, bindForm);
var boundBlur = function boundBlur(field, value) {
return blur(initialProps.form, field, value, !!initialProps.touchOnBlur);
};
var boundChange = function boundChange(field, value) {
return change(initialProps.form, field, value, !!initialProps.touchOnChange, !!initialProps.persistentSubmitErrors);
};
var boundFocus = bindForm(focus);
// Wrap action creators with `dispatch`
var connectedFormACs = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7_redux__["a" /* bindActionCreators */])(boundFormACs, dispatch);
var connectedArrayACs = {
insert: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7_redux__["a" /* bindActionCreators */])(boundArrayACs.arrayInsert, dispatch),
move: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7_redux__["a" /* bindActionCreators */])(boundArrayACs.arrayMove, dispatch),
pop: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7_redux__["a" /* bindActionCreators */])(boundArrayACs.arrayPop, dispatch),
push: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7_redux__["a" /* bindActionCreators */])(boundArrayACs.arrayPush, dispatch),
remove: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7_redux__["a" /* bindActionCreators */])(boundArrayACs.arrayRemove, dispatch),
removeAll: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7_redux__["a" /* bindActionCreators */])(boundArrayACs.arrayRemoveAll, dispatch),
shift: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7_redux__["a" /* bindActionCreators */])(boundArrayACs.arrayShift, dispatch),
splice: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7_redux__["a" /* bindActionCreators */])(boundArrayACs.arraySplice, dispatch),
swap: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7_redux__["a" /* bindActionCreators */])(boundArrayACs.arraySwap, dispatch),
unshift: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7_redux__["a" /* bindActionCreators */])(boundArrayACs.arrayUnshift, dispatch)
};
var computedActions = _extends({}, connectedFormACs, boundArrayACs, {
blur: boundBlur,
change: boundChange,
array: connectedArrayACs,
focus: boundFocus,
dispatch: dispatch
});
return function () {
return computedActions;
};
}, undefined, { withRef: true });
var ConnectedForm = __WEBPACK_IMPORTED_MODULE_2_hoist_non_react_statics___default()(connector(Form), WrappedComponent);
ConnectedForm.defaultProps = config;
// build outer component to expose instance api
return function (_Component2) {
_inherits(ReduxForm, _Component2);
function ReduxForm() {
_classCallCheck(this, ReduxForm);
return _possibleConstructorReturn(this, (ReduxForm.__proto__ || Object.getPrototypeOf(ReduxForm)).apply(this, arguments));
}
_createClass(ReduxForm, [{
key: 'submit',
value: function submit() {
return this.refs.wrapped.getWrappedInstance().submit();
}
}, {
key: 'reset',
value: function reset() {
return this.refs.wrapped.getWrappedInstance().reset();
}
}, {
key: 'render',
value: function render() {
var _props10 = this.props,
initialValues = _props10.initialValues,
rest = _objectWithoutProperties(_props10, ['initialValues']);
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5_react__["createElement"])(ConnectedForm, _extends({}, rest, {
ref: 'wrapped',
// convert initialValues if need to
initialValues: fromJS(initialValues)
}));
}
}, {
key: 'valid',
get: function get() {
return this.refs.wrapped.getWrappedInstance().isValid();
}
}, {
key: 'invalid',
get: function get() {
return !this.valid;
}
}, {
key: 'pristine',
get: function get() {
return this.refs.wrapped.getWrappedInstance().isPristine();
}
}, {
key: 'dirty',
get: function get() {
return !this.pristine;
}
}, {
key: 'values',
get: function get() {
return this.refs.wrapped.getWrappedInstance().getValues();
}
}, {
key: 'fieldList',
get: function get() {
// mainly provided for testing
return this.refs.wrapped.getWrappedInstance().getFieldList();
}
}, {
key: 'wrappedInstance',
get: function get() {
// for testine
return this.refs.wrapped.getWrappedInstance().refs.wrapped;
}
}]);
return ReduxForm;
}(__WEBPACK_IMPORTED_MODULE_5_react__["Component"]);
};
};
};
/* harmony default export */ __webpack_exports__["a"] = (createReduxForm);
/***/ }),
/* 917 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_redux__ = __webpack_require__(77);
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 _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 createValues = function createValues(_ref) {
var getIn = _ref.getIn;
return function (config) {
var _prop$getFormState$co = _extends({
prop: 'values',
getFormState: function getFormState(state) {
return getIn(state, 'form');
}
}, config),
form = _prop$getFormState$co.form,
prop = _prop$getFormState$co.prop,
getFormState = _prop$getFormState$co.getFormState;
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_react_redux__["a" /* connect */])(function (state) {
return _defineProperty({}, prop, getIn(getFormState(state), form + '.values'));
}, function () {
return {};
} // ignore dispatch
);
};
};
/* harmony default export */ __webpack_exports__["a"] = (createValues);
/***/ }),
/* 918 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_es_toPath__ = __webpack_require__(95);
var createDeleteInWithCleanUp = function createDeleteInWithCleanUp(_ref) {
var deepEqual = _ref.deepEqual,
empty = _ref.empty,
getIn = _ref.getIn,
deleteIn = _ref.deleteIn,
setIn = _ref.setIn;
var deleteInWithCleanUp = function deleteInWithCleanUp(state, path) {
if (path[path.length - 1] === ']') {
// array path
var pathTokens = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_lodash_es_toPath__["a" /* default */])(path);
pathTokens.pop();
var parent = getIn(state, pathTokens.join('.'));
return parent ? setIn(state, path, undefined) : state;
}
var result = state;
if (getIn(state, path) !== undefined) {
result = deleteIn(state, path);
}
var dotIndex = path.lastIndexOf('.');
if (dotIndex > 0) {
var parentPath = path.substring(0, dotIndex);
if (parentPath[parentPath.length - 1] !== ']') {
var _parent = getIn(result, parentPath);
if (deepEqual(_parent, empty)) {
return deleteInWithCleanUp(result, parentPath);
}
}
}
return result;
};
return deleteInWithCleanUp;
};
/* harmony default export */ __webpack_exports__["a"] = (createDeleteInWithCleanUp);
/***/ }),
/* 919 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isEvent__ = __webpack_require__(314);
var getSelectedValues = function getSelectedValues(options) {
var result = [];
if (options) {
for (var index = 0; index < options.length; index++) {
var option = options[index];
if (option.selected) {
result.push(option.value);
}
}
}
return result;
};
var getValue = function getValue(event, isReactNative) {
if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__isEvent__["a" /* default */])(event)) {
if (!isReactNative && event.nativeEvent && event.nativeEvent.text !== undefined) {
return event.nativeEvent.text;
}
if (isReactNative && event.nativeEvent !== undefined) {
return event.nativeEvent.text;
}
var _event$target = event.target,
type = _event$target.type,
value = _event$target.value,
checked = _event$target.checked,
files = _event$target.files,
dataTransfer = event.dataTransfer;
if (type === 'checkbox') {
return checked || '';
}
if (type === 'file') {
return files || dataTransfer && dataTransfer.files;
}
if (type === 'select-multiple') {
return getSelectedValues(event.target.options);
}
return value;
}
return event;
};
/* harmony default export */ __webpack_exports__["a"] = (getValue);
/***/ }),
/* 920 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__silenceEvent__ = __webpack_require__(316);
var silenceEvents = function silenceEvents(fn) {
return function (event) {
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__silenceEvent__["a" /* default */])(event) ? fn.apply(undefined, args) : fn.apply(undefined, [event].concat(args));
};
};
/* harmony default export */ __webpack_exports__["a"] = (silenceEvents);
/***/ }),
/* 921 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createFormValueSelector__ = __webpack_require__(914);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__structure_plain__ = __webpack_require__(6);
/* unused harmony default export */ var _unused_webpack_default_export = (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__createFormValueSelector__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__structure_plain__["a" /* default */]));
/***/ }),
/* 922 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__structure_plain__ = __webpack_require__(6);
var toArray = function toArray(value) {
return Array.isArray(value) ? value : [value];
};
var getError = function getError(value, values, props, validators) {
var array = toArray(validators);
for (var i = 0; i < array.length; i++) {
var error = array[i](value, values, props);
if (error) {
return error;
}
}
};
var generateValidator = function generateValidator(validators, _ref) {
var getIn = _ref.getIn;
return function (values, props) {
var errors = {};
Object.keys(validators).forEach(function (name) {
var value = getIn(values, name);
var error = getError(value, values, props, validators[name]);
if (error) {
errors = __WEBPACK_IMPORTED_MODULE_0__structure_plain__["a" /* default */].setIn(errors, name, error);
}
});
return errors;
};
};
/* harmony default export */ __webpack_exports__["a"] = (generateValidator);
/***/ }),
/* 923 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__selectors_getFormAsyncErrors__ = __webpack_require__(945);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__structure_plain__ = __webpack_require__(6);
/* unused harmony default export */ var _unused_webpack_default_export = (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__selectors_getFormAsyncErrors__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__structure_plain__["a" /* default */]));
/***/ }),
/* 924 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__selectors_getFormInitialValues__ = __webpack_require__(946);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__structure_plain__ = __webpack_require__(6);
/* unused harmony default export */ var _unused_webpack_default_export = (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__selectors_getFormInitialValues__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__structure_plain__["a" /* default */]));
/***/ }),
/* 925 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__selectors_getFormMeta__ = __webpack_require__(947);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__structure_plain__ = __webpack_require__(6);
/* unused harmony default export */ var _unused_webpack_default_export = (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__selectors_getFormMeta__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__structure_plain__["a" /* default */]));
/***/ }),
/* 926 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__selectors_getFormNames__ = __webpack_require__(948);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__structure_plain__ = __webpack_require__(6);
/* unused harmony default export */ var _unused_webpack_default_export = (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__selectors_getFormNames__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__structure_plain__["a" /* default */]));
/***/ }),
/* 927 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__selectors_getFormSubmitErrors__ = __webpack_require__(949);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__structure_plain__ = __webpack_require__(6);
/* unused harmony default export */ var _unused_webpack_default_export = (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__selectors_getFormSubmitErrors__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__structure_plain__["a" /* default */]));
/***/ }),
/* 928 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__selectors_getFormSyncErrors__ = __webpack_require__(950);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__structure_plain__ = __webpack_require__(6);
/* unused harmony default export */ var _unused_webpack_default_export = (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__selectors_getFormSyncErrors__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__structure_plain__["a" /* default */]));
/***/ }),
/* 929 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__selectors_getFormSyncWarnings__ = __webpack_require__(951);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__structure_plain__ = __webpack_require__(6);
/* unused harmony default export */ var _unused_webpack_default_export = (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__selectors_getFormSyncWarnings__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__structure_plain__["a" /* default */]));
/***/ }),
/* 930 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__selectors_getFormValues__ = __webpack_require__(952);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__structure_plain__ = __webpack_require__(6);
/* unused harmony default export */ var _unused_webpack_default_export = (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__selectors_getFormValues__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__structure_plain__["a" /* default */]));
/***/ }),
/* 931 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_is_promise__ = __webpack_require__(130);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_is_promise___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_is_promise__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__SubmissionError__ = __webpack_require__(309);
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 handleSubmit = function handleSubmit(submit, props, valid, asyncValidate, fields) {
var dispatch = props.dispatch,
onSubmitFail = props.onSubmitFail,
onSubmitSuccess = props.onSubmitSuccess,
startSubmit = props.startSubmit,
stopSubmit = props.stopSubmit,
setSubmitFailed = props.setSubmitFailed,
setSubmitSucceeded = props.setSubmitSucceeded,
syncErrors = props.syncErrors,
touch = props.touch,
values = props.values,
persistentSubmitErrors = props.persistentSubmitErrors;
touch.apply(undefined, _toConsumableArray(fields)); // mark all fields as touched
if (valid || persistentSubmitErrors) {
var doSubmit = function doSubmit() {
var result = void 0;
try {
result = submit(values, dispatch, props);
} catch (submitError) {
var error = submitError instanceof __WEBPACK_IMPORTED_MODULE_1__SubmissionError__["a" /* default */] ? submitError.errors : undefined;
stopSubmit(error);
setSubmitFailed.apply(undefined, _toConsumableArray(fields));
if (onSubmitFail) {
onSubmitFail(error, dispatch, submitError, props);
}
if (error || onSubmitFail) {
// if you've provided an onSubmitFail callback, don't re-throw the error
return error;
} else {
throw submitError;
}
}
if (__WEBPACK_IMPORTED_MODULE_0_is_promise___default()(result)) {
startSubmit();
return result.then(function (submitResult) {
stopSubmit();
setSubmitSucceeded();
if (onSubmitSuccess) {
onSubmitSuccess(submitResult, dispatch, props);
}
return submitResult;
}, function (submitError) {
var error = submitError instanceof __WEBPACK_IMPORTED_MODULE_1__SubmissionError__["a" /* default */] ? submitError.errors : undefined;
stopSubmit(error);
setSubmitFailed.apply(undefined, _toConsumableArray(fields));
if (onSubmitFail) {
onSubmitFail(error, dispatch, submitError, props);
}
if (error || onSubmitFail) {
// if you've provided an onSubmitFail callback, don't re-throw the error
return error;
} else {
throw submitError;
}
});
} else {
setSubmitSucceeded();
if (onSubmitSuccess) {
onSubmitSuccess(result, dispatch, props);
}
}
return result;
};
var asyncValidateResult = asyncValidate && asyncValidate();
if (asyncValidateResult) {
return asyncValidateResult.then(function (asyncErrors) {
if (asyncErrors) {
throw asyncErrors;
}
return doSubmit();
}).catch(function (asyncErrors) {
setSubmitFailed.apply(undefined, _toConsumableArray(fields));
if (onSubmitFail) {
onSubmitFail(asyncErrors, dispatch, null, props);
}
return Promise.reject(asyncErrors);
});
} else {
return doSubmit();
}
} else {
setSubmitFailed.apply(undefined, _toConsumableArray(fields));
if (onSubmitFail) {
onSubmitFail(syncErrors, dispatch, null, props);
}
return syncErrors;
}
};
/* harmony default export */ __webpack_exports__["a"] = (handleSubmit);
/***/ }),
/* 932 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
var getErrorKeys = function getErrorKeys(name, type) {
switch (type) {
case 'Field':
return [name, name + '._error'];
case 'FieldArray':
return [name + '._error'];
default:
throw new Error('Unknown field type');
}
};
var createHasError = function createHasError(_ref) {
var getIn = _ref.getIn;
var hasError = function hasError(field, syncErrors, asyncErrors, submitErrors) {
if (!syncErrors && !asyncErrors && !submitErrors) {
return false;
}
var name = getIn(field, 'name');
var type = getIn(field, 'type');
return getErrorKeys(name, type).some(function (key) {
return getIn(syncErrors, key) || getIn(asyncErrors, key) || getIn(submitErrors, key);
});
};
return hasError;
};
/* harmony default export */ __webpack_exports__["a"] = (createHasError);
/***/ }),
/* 933 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__selectors_hasSubmitFailed__ = __webpack_require__(953);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__structure_plain__ = __webpack_require__(6);
/* unused harmony default export */ var _unused_webpack_default_export = (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__selectors_hasSubmitFailed__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__structure_plain__["a" /* default */]));
/***/ }),
/* 934 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__selectors_hasSubmitSucceeded__ = __webpack_require__(954);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__structure_plain__ = __webpack_require__(6);
/* unused harmony default export */ var _unused_webpack_default_export = (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__selectors_hasSubmitSucceeded__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__structure_plain__["a" /* default */]));
/***/ }),
/* 935 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* unused harmony export actionTypes */
/* unused harmony export actions */
/* unused harmony export arrayInsert */
/* unused harmony export arrayMove */
/* unused harmony export arrayPop */
/* unused harmony export arrayPush */
/* unused harmony export arrayRemove */
/* unused harmony export arrayRemoveAll */
/* unused harmony export arrayShift */
/* unused harmony export arraySplice */
/* unused harmony export arraySwap */
/* unused harmony export arrayUnshift */
/* unused harmony export autofill */
/* unused harmony export blur */
/* unused harmony export change */
/* unused harmony export clearSubmitErrors */
/* unused harmony export destroy */
/* unused harmony export focus */
/* unused harmony export initialize */
/* unused harmony export registerField */
/* unused harmony export reset */
/* unused harmony export setSubmitFailed */
/* unused harmony export setSubmitSucceeded */
/* unused harmony export startAsyncValidation */
/* unused harmony export startSubmit */
/* unused harmony export stopAsyncValidation */
/* unused harmony export stopSubmit */
/* unused harmony export submit */
/* unused harmony export touch */
/* unused harmony export unregisterField */
/* unused harmony export untouch */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__actions__ = __webpack_require__(310);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__defaultShouldAsyncValidate__ = __webpack_require__(312);
/* unused harmony reexport defaultShouldAsyncValidate */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__defaultShouldValidate__ = __webpack_require__(313);
/* unused harmony reexport defaultShouldValidate */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Form__ = __webpack_require__(907);
/* unused harmony reexport Form */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__FormSection__ = __webpack_require__(908);
/* unused harmony reexport FormSection */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__SubmissionError__ = __webpack_require__(309);
/* unused harmony reexport SubmissionError */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__propTypes__ = __webpack_require__(942);
/* unused harmony reexport propTypes */
/* unused harmony reexport fieldInputPropTypes */
/* unused harmony reexport fieldMetaPropTypes */
/* unused harmony reexport fieldPropTypes */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__Field__ = __webpack_require__(904);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_7__Field__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__Fields__ = __webpack_require__(906);
/* unused harmony reexport Fields */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__FieldArray__ = __webpack_require__(905);
/* unused harmony reexport FieldArray */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__formValueSelector__ = __webpack_require__(921);
/* unused harmony reexport formValueSelector */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__getFormNames__ = __webpack_require__(926);
/* unused harmony reexport getFormNames */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__getFormValues__ = __webpack_require__(930);
/* unused harmony reexport getFormValues */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__getFormInitialValues__ = __webpack_require__(924);
/* unused harmony reexport getFormInitialValues */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__getFormSyncErrors__ = __webpack_require__(928);
/* unused harmony reexport getFormSyncErrors */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__getFormMeta__ = __webpack_require__(925);
/* unused harmony reexport getFormMeta */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__getFormAsyncErrors__ = __webpack_require__(923);
/* unused harmony reexport getFormAsyncErrors */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__getFormSyncWarnings__ = __webpack_require__(929);
/* unused harmony reexport getFormSyncWarnings */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__getFormSubmitErrors__ = __webpack_require__(927);
/* unused harmony reexport getFormSubmitErrors */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__isDirty__ = __webpack_require__(936);
/* unused harmony reexport isDirty */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__isInvalid__ = __webpack_require__(937);
/* unused harmony reexport isInvalid */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_21__isPristine__ = __webpack_require__(938);
/* unused harmony reexport isPristine */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_22__isValid__ = __webpack_require__(941);
/* unused harmony reexport isValid */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_23__isSubmitting__ = __webpack_require__(940);
/* unused harmony reexport isSubmitting */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_24__hasSubmitSucceeded__ = __webpack_require__(934);
/* unused harmony reexport hasSubmitSucceeded */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_25__hasSubmitFailed__ = __webpack_require__(933);
/* unused harmony reexport hasSubmitFailed */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_26__reduxForm__ = __webpack_require__(944);
/* unused harmony reexport reduxForm */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_27__reducer__ = __webpack_require__(943);
/* unused harmony reexport reducer */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_28__values__ = __webpack_require__(966);
/* unused harmony reexport values */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_29__actionTypes__ = __webpack_require__(185);
var actionTypes = __WEBPACK_IMPORTED_MODULE_29__actionTypes__;
var actions = __WEBPACK_IMPORTED_MODULE_0__actions__;
var arrayInsert = __WEBPACK_IMPORTED_MODULE_0__actions__["arrayInsert"],
arrayMove = __WEBPACK_IMPORTED_MODULE_0__actions__["arrayMove"],
arrayPop = __WEBPACK_IMPORTED_MODULE_0__actions__["arrayPop"],
arrayPush = __WEBPACK_IMPORTED_MODULE_0__actions__["arrayPush"],
arrayRemove = __WEBPACK_IMPORTED_MODULE_0__actions__["arrayRemove"],
arrayRemoveAll = __WEBPACK_IMPORTED_MODULE_0__actions__["arrayRemoveAll"],
arrayShift = __WEBPACK_IMPORTED_MODULE_0__actions__["arrayShift"],
arraySplice = __WEBPACK_IMPORTED_MODULE_0__actions__["arraySplice"],
arraySwap = __WEBPACK_IMPORTED_MODULE_0__actions__["arraySwap"],
arrayUnshift = __WEBPACK_IMPORTED_MODULE_0__actions__["arrayUnshift"],
autofill = __WEBPACK_IMPORTED_MODULE_0__actions__["autofill"],
blur = __WEBPACK_IMPORTED_MODULE_0__actions__["blur"],
change = __WEBPACK_IMPORTED_MODULE_0__actions__["change"],
clearSubmitErrors = __WEBPACK_IMPORTED_MODULE_0__actions__["clearSubmitErrors"],
destroy = __WEBPACK_IMPORTED_MODULE_0__actions__["destroy"],
focus = __WEBPACK_IMPORTED_MODULE_0__actions__["focus"],
initialize = __WEBPACK_IMPORTED_MODULE_0__actions__["initialize"],
registerField = __WEBPACK_IMPORTED_MODULE_0__actions__["registerField"],
reset = __WEBPACK_IMPORTED_MODULE_0__actions__["reset"],
setSubmitFailed = __WEBPACK_IMPORTED_MODULE_0__actions__["setSubmitFailed"],
setSubmitSucceeded = __WEBPACK_IMPORTED_MODULE_0__actions__["setSubmitSucceeded"],
startAsyncValidation = __WEBPACK_IMPORTED_MODULE_0__actions__["startAsyncValidation"],
startSubmit = __WEBPACK_IMPORTED_MODULE_0__actions__["startSubmit"],
stopAsyncValidation = __WEBPACK_IMPORTED_MODULE_0__actions__["stopAsyncValidation"],
stopSubmit = __WEBPACK_IMPORTED_MODULE_0__actions__["stopSubmit"],
submit = __WEBPACK_IMPORTED_MODULE_0__actions__["submit"],
touch = __WEBPACK_IMPORTED_MODULE_0__actions__["touch"],
unregisterField = __WEBPACK_IMPORTED_MODULE_0__actions__["unregisterField"],
untouch = __WEBPACK_IMPORTED_MODULE_0__actions__["untouch"];
/***/ }),
/* 936 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__selectors_isDirty__ = __webpack_require__(955);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__structure_plain__ = __webpack_require__(6);
/* unused harmony default export */ var _unused_webpack_default_export = (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__selectors_isDirty__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__structure_plain__["a" /* default */]));
/***/ }),
/* 937 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__selectors_isInvalid__ = __webpack_require__(956);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__structure_plain__ = __webpack_require__(6);
/* unused harmony default export */ var _unused_webpack_default_export = (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__selectors_isInvalid__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__structure_plain__["a" /* default */]));
/***/ }),
/* 938 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__selectors_isPristine__ = __webpack_require__(317);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__structure_plain__ = __webpack_require__(6);
/* unused harmony default export */ var _unused_webpack_default_export = (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__selectors_isPristine__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__structure_plain__["a" /* default */]));
/***/ }),
/* 939 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
var isReactNative = typeof window !== 'undefined' && window.navigator && window.navigator.product && window.navigator.product === 'ReactNative';
/* harmony default export */ __webpack_exports__["a"] = (isReactNative);
/***/ }),
/* 940 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__selectors_isSubmitting__ = __webpack_require__(957);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__structure_plain__ = __webpack_require__(6);
/* unused harmony default export */ var _unused_webpack_default_export = (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__selectors_isSubmitting__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__structure_plain__["a" /* default */]));
/***/ }),
/* 941 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__selectors_isValid__ = __webpack_require__(186);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__structure_plain__ = __webpack_require__(6);
/* unused harmony default export */ var _unused_webpack_default_export = (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__selectors_isValid__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__structure_plain__["a" /* default */]));
/***/ }),
/* 942 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* unused harmony export fieldInputPropTypes */
/* unused harmony export fieldMetaPropTypes */
/* unused harmony export fieldPropTypes */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_prop_types__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_prop_types__);
var any = __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.any,
bool = __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.bool,
func = __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.func,
shape = __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.shape,
string = __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.string,
oneOfType = __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.oneOfType,
object = __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.object;
var propTypes = {
// State:
anyTouched: bool.isRequired, // true if any of the fields have been marked as touched
asyncValidating: oneOfType([bool, string]).isRequired, // true if async validation is running, a string if a field triggered async validation
dirty: bool.isRequired, // true if any values are different from initialValues
error: any, // form-wide error from '_error' key in validation result
form: string.isRequired, // the name of the form
invalid: bool.isRequired, // true if there are any validation errors
initialized: bool.isRequired, // true if the form has been initialized
initialValues: object, // the initialValues object passed to reduxForm
pristine: bool.isRequired, // true if the values are the same as initialValues
pure: bool.isRequired, // if true, implements shouldComponentUpdate
submitting: bool.isRequired, // true if the form is in the process of being submitted
submitFailed: bool.isRequired, // true if the form was submitted and failed for any reason
submitSucceeded: bool.isRequired, // true if the form was successfully submitted
valid: bool.isRequired, // true if there are no validation errors
warning: any, // form-wide warning from '_warning' key in validation result
// Actions:
array: shape({
insert: func.isRequired, // function to insert a value into an array field
move: func.isRequired, // function to move a value within an array field
pop: func.isRequired, // function to pop a value off of an array field
push: func.isRequired, // function to push a value onto an array field
remove: func.isRequired, // function to remove a value from an array field
removeAll: func.isRequired, // function to remove all the values from an array field
shift: func.isRequired, // function to shift a value out of an array field
splice: func.isRequired, // function to splice a value into an array field
swap: func.isRequired, // function to swap values in an array field
unshift: func.isRequired // function to unshift a value into an array field
}),
asyncValidate: func.isRequired, // function to trigger async validation
autofill: func.isRequired, // action to set a value of a field and mark it as autofilled
blur: func.isRequired, // action to mark a field as blurred
change: func.isRequired, // action to change the value of a field
clearAsyncError: func.isRequired, // action to clear the async error of a field
destroy: func.isRequired, // action to destroy the form's data in Redux
dispatch: func.isRequired, // the Redux dispatch action
handleSubmit: func.isRequired, // function to submit the form
initialize: func.isRequired, // action to initialize form data
reset: func.isRequired, // action to reset the form data to previously initialized values
touch: func.isRequired, // action to mark fields as touched
submit: func.isRequired, // action to trigger a submission of the specified form
untouch: func.isRequired, // action to mark fields as untouched
// triggerSubmit
triggerSubmit: bool, // if true, submits the form on componentWillReceiveProps
clearSubmit: func.isRequired // called before a triggered submit, by default clears triggerSubmit
};
var fieldInputPropTypes = {
checked: bool,
name: string.isRequired,
onBlur: func.isRequired,
onChange: func.isRequired,
onDragStart: func.isRequired,
onDrop: func.isRequired,
onFocus: func.isRequired,
value: any
};
var fieldMetaPropTypes = {
active: bool.isRequired,
asyncValidating: bool.isRequired,
autofilled: bool.isRequired,
dirty: bool.isRequired,
dispatch: func.isRequired,
error: string,
form: string.isRequired,
invalid: bool.isRequired,
pristine: bool.isRequired,
submitting: bool.isRequired,
submitFailed: bool.isRequired,
touched: bool.isRequired,
valid: bool.isRequired,
visited: bool.isRequired,
warning: string
};
var fieldPropTypes = {
input: fieldInputPropTypes.isRequired,
meta: fieldMetaPropTypes.isRequired,
custom: object.isRequired
};
/* unused harmony default export */ var _unused_webpack_default_export = (propTypes);
/***/ }),
/* 943 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createReducer__ = __webpack_require__(915);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__structure_plain__ = __webpack_require__(6);
/* unused harmony default export */ var _unused_webpack_default_export = (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__createReducer__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__structure_plain__["a" /* default */]));
/***/ }),
/* 944 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createReduxForm__ = __webpack_require__(916);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__structure_plain__ = __webpack_require__(6);
/* unused harmony default export */ var _unused_webpack_default_export = (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__createReduxForm__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__structure_plain__["a" /* default */]));
/***/ }),
/* 945 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
var createGetFormAsyncErrors = function createGetFormAsyncErrors(_ref) {
var getIn = _ref.getIn;
return function (form) {
var getFormState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (state) {
return getIn(state, 'form');
};
return function (state) {
return getIn(getFormState(state), form + '.asyncErrors');
};
};
};
/* harmony default export */ __webpack_exports__["a"] = (createGetFormAsyncErrors);
/***/ }),
/* 946 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
var createGetFormInitialValues = function createGetFormInitialValues(_ref) {
var getIn = _ref.getIn;
return function (form) {
var getFormState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (state) {
return getIn(state, 'form');
};
return function (state) {
return getIn(getFormState(state), form + '.initial');
};
};
};
/* harmony default export */ __webpack_exports__["a"] = (createGetFormInitialValues);
/***/ }),
/* 947 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
var createGetFormMeta = function createGetFormMeta(_ref) {
var getIn = _ref.getIn;
return function (form) {
var getFormState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (state) {
return getIn(state, 'form');
};
return function (state) {
return getIn(getFormState(state), form + '.fields');
};
};
};
/* harmony default export */ __webpack_exports__["a"] = (createGetFormMeta);
/***/ }),
/* 948 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
var createGetFormNames = function createGetFormNames(_ref) {
var getIn = _ref.getIn,
keys = _ref.keys;
return function () {
var getFormState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (state) {
return getIn(state, 'form');
};
return function (state) {
return keys(getFormState(state));
};
};
};
/* harmony default export */ __webpack_exports__["a"] = (createGetFormNames);
/***/ }),
/* 949 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
var createGetFormSubmitErrors = function createGetFormSubmitErrors(_ref) {
var getIn = _ref.getIn;
return function (form) {
var getFormState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (state) {
return getIn(state, 'form');
};
return function (state) {
return getIn(getFormState(state), form + '.submitErrors');
};
};
};
/* harmony default export */ __webpack_exports__["a"] = (createGetFormSubmitErrors);
/***/ }),
/* 950 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
var createGetFormSyncErrors = function createGetFormSyncErrors(_ref) {
var getIn = _ref.getIn;
return function (form) {
var getFormState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (state) {
return getIn(state, 'form');
};
return function (state) {
return getIn(getFormState(state), form + '.syncErrors');
};
};
};
/* harmony default export */ __webpack_exports__["a"] = (createGetFormSyncErrors);
/***/ }),
/* 951 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
var createGetFormSyncWarnings = function createGetFormSyncWarnings(_ref) {
var getIn = _ref.getIn;
return function (form) {
var getFormState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (state) {
return getIn(state, 'form');
};
return function (state) {
return getIn(getFormState(state), form + '.syncWarnings');
};
};
};
/* harmony default export */ __webpack_exports__["a"] = (createGetFormSyncWarnings);
/***/ }),
/* 952 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
var createGetFormValues = function createGetFormValues(_ref) {
var getIn = _ref.getIn;
return function (form) {
var getFormState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (state) {
return getIn(state, 'form');
};
return function (state) {
return getIn(getFormState(state), form + '.values');
};
};
};
/* harmony default export */ __webpack_exports__["a"] = (createGetFormValues);
/***/ }),
/* 953 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
var createHasSubmitFailed = function createHasSubmitFailed(_ref) {
var getIn = _ref.getIn;
return function (form) {
var getFormState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (state) {
return getIn(state, 'form');
};
return function (state) {
var formState = getFormState(state);
return getIn(formState, form + '.submitFailed') || false;
};
};
};
/* harmony default export */ __webpack_exports__["a"] = (createHasSubmitFailed);
/***/ }),
/* 954 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
var createHasSubmitSucceeded = function createHasSubmitSucceeded(_ref) {
var getIn = _ref.getIn;
return function (form) {
var getFormState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (state) {
return getIn(state, 'form');
};
return function (state) {
var formState = getFormState(state);
return getIn(formState, form + '.submitSucceeded') || false;
};
};
};
/* harmony default export */ __webpack_exports__["a"] = (createHasSubmitSucceeded);
/***/ }),
/* 955 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isPristine__ = __webpack_require__(317);
var createIsDirty = function createIsDirty(structure) {
return function (form, getFormState) {
var isPristine = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__isPristine__["a" /* default */])(structure)(form, getFormState);
return function (state) {
return !isPristine(state);
};
};
};
/* harmony default export */ __webpack_exports__["a"] = (createIsDirty);
/***/ }),
/* 956 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isValid__ = __webpack_require__(186);
var createIsInvalid = function createIsInvalid(structure) {
return function (form, getFormState) {
var isValid = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__isValid__["a" /* default */])(structure)(form, getFormState);
return function (state) {
return !isValid(state);
};
};
};
/* harmony default export */ __webpack_exports__["a"] = (createIsInvalid);
/***/ }),
/* 957 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
var createIsSubmitting = function createIsSubmitting(_ref) {
var getIn = _ref.getIn;
return function (form) {
var getFormState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (state) {
return getIn(state, 'form');
};
return function (state) {
var formState = getFormState(state);
return getIn(formState, form + '.submitting') || false;
};
};
};
/* harmony default export */ __webpack_exports__["a"] = (createIsSubmitting);
/***/ }),
/* 958 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_es_isEqualWith__ = __webpack_require__(240);
var customizer = function customizer(obj, other) {
if (obj === other) return true;
if ((obj == null || obj === '' || obj === false) && (other == null || other === '' || other === false)) return true;
if (obj && other && obj._error !== other._error) return false;
if (obj && other && obj._warning !== other._warning) return false;
};
var deepEqual = function deepEqual(a, b) {
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_lodash_es_isEqualWith__["a" /* default */])(a, b, customizer);
};
/* harmony default export */ __webpack_exports__["a"] = (deepEqual);
/***/ }),
/* 959 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_es_toPath__ = __webpack_require__(95);
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 _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _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 deleteInWithPath = function deleteInWithPath(state, first) {
for (var _len = arguments.length, rest = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
rest[_key - 2] = arguments[_key];
}
if (state === undefined || first === undefined) {
return state;
}
if (rest.length) {
if (Array.isArray(state)) {
if (first < state.length) {
var result = deleteInWithPath.apply(undefined, [state && state[first]].concat(rest));
if (result !== state[first]) {
var copy = [].concat(_toConsumableArray(state));
copy[first] = result;
return copy;
}
}
return state;
}
if (first in state) {
var _result = deleteInWithPath.apply(undefined, [state && state[first]].concat(rest));
return state[first] === _result ? state : _extends({}, state, _defineProperty({}, first, _result));
}
return state;
}
if (Array.isArray(state)) {
if (isNaN(first)) {
throw new Error('Cannot delete non-numerical index from an array');
}
if (first < state.length) {
var _copy = [].concat(_toConsumableArray(state));
_copy.splice(first, 1);
return _copy;
}
return state;
}
if (first in state) {
var _copy2 = _extends({}, state);
delete _copy2[first];
return _copy2;
}
return state;
};
var deleteIn = function deleteIn(state, field) {
return deleteInWithPath.apply(undefined, [state].concat(_toConsumableArray(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_lodash_es_toPath__["a" /* default */])(field))));
};
/* harmony default export */ __webpack_exports__["a"] = (deleteIn);
/***/ }),
/* 960 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_es_toPath__ = __webpack_require__(95);
var getIn = function getIn(state, field) {
if (!state) {
return state;
}
var path = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_lodash_es_toPath__["a" /* default */])(field);
var length = path.length;
if (!length) {
return undefined;
}
var result = state;
for (var i = 0; i < length && !!result; ++i) {
result = result[path[i]];
}
return result;
};
/* harmony default export */ __webpack_exports__["a"] = (getIn);
/***/ }),
/* 961 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
var keys = function keys(value) {
return value ? Object.keys(value) : [];
};
/* harmony default export */ __webpack_exports__["a"] = (keys);
/***/ }),
/* 962 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_es_toPath__ = __webpack_require__(95);
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 _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 setInWithPath = function setInWithPath(state, value, path, pathIndex) {
if (pathIndex >= path.length) {
return value;
}
var first = path[pathIndex];
var next = setInWithPath(state && state[first], value, path, pathIndex + 1);
if (!state) {
var initialized = isNaN(first) ? {} : [];
initialized[first] = next;
return initialized;
}
if (Array.isArray(state)) {
var copy = [].concat(state);
copy[first] = next;
return copy;
}
return _extends({}, state, _defineProperty({}, first, next));
};
var setIn = function setIn(state, field, value) {
return setInWithPath(state, value, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_lodash_es_toPath__["a" /* default */])(field), 0);
};
/* harmony default export */ __webpack_exports__["a"] = (setIn);
/***/ }),
/* 963 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"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; } else { return Array.from(arr); } }
var splice = function splice(array, index, removeNum, value) {
array = array || [];
if (index < array.length) {
if (value === undefined && !removeNum) {
// inserting undefined
var _copy2 = [].concat(_toConsumableArray(array));
_copy2.splice(index, 0, null);
_copy2[index] = undefined;
return _copy2;
}
if (value != null) {
var _copy3 = [].concat(_toConsumableArray(array));
_copy3.splice(index, removeNum, value); // removing and adding
return _copy3;
}
var _copy = [].concat(_toConsumableArray(array));
_copy.splice(index, removeNum); // removing
return _copy;
}
if (removeNum) {
// trying to remove non-existant item: return original array
return array;
}
// trying to add outside of range: just set value
var copy = [].concat(_toConsumableArray(array));
copy[index] = value;
return copy;
};
/* harmony default export */ __webpack_exports__["a"] = (splice);
/***/ }),
/* 964 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return dataKey; });
var dataKey = 'text';
/***/ }),
/* 965 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
var getDisplayName = function getDisplayName(Comp) {
return Comp.displayName || Comp.name || 'Component';
};
/* harmony default export */ __webpack_exports__["a"] = (getDisplayName);
/***/ }),
/* 966 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createValues__ = __webpack_require__(917);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__structure_plain__ = __webpack_require__(6);
/* unused harmony default export */ var _unused_webpack_default_export = (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__createValues__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__structure_plain__["a" /* default */]));
/***/ }),
/* 967 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* unused harmony export default */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__compose__ = __webpack_require__(319);
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; };
/**
* 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 = __WEBPACK_IMPORTED_MODULE_0__compose__["a" /* default */].apply(undefined, chain)(store.dispatch);
return _extends({}, store, {
dispatch: _dispatch
});
};
};
}
/***/ }),
/* 968 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = 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;
}
/***/ }),
/* 969 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* unused harmony export default */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createStore__ = __webpack_require__(320);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash_es_isPlainObject__ = __webpack_require__(93);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__utils_warning__ = __webpack_require__(321);
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 === __WEBPACK_IMPORTED_MODULE_0__createStore__["a" /* 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 (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1_lodash_es_isPlainObject__["a" /* 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: __WEBPACK_IMPORTED_MODULE_0__createStore__["a" /* 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 ' + __WEBPACK_IMPORTED_MODULE_0__createStore__["a" /* 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 (false) {
if (typeof reducers[key] === 'undefined') {
warning('No reducer provided for key "' + key + '"');
}
}
if (typeof reducers[key] === 'function') {
finalReducers[key] = reducers[key];
}
}
var finalReducerKeys = Object.keys(finalReducers);
if (false) {
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 (false) {
var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);
if (warningMessage) {
warning(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;
};
}
/***/ }),
/* 970 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var unherit = __webpack_require__(1023);
var xtend = __webpack_require__(78);
var Parser = __webpack_require__(981);
module.exports = parse;
parse.Parser = Parser;
function parse(options) {
var Local = unherit(Parser);
Local.prototype.options = xtend(Local.prototype.options, this.data('settings'), options);
this.Parser = Local;
}
/***/ }),
/* 971 */
/***/ (function(module, exports) {
module.exports = [
"address",
"article",
"aside",
"base",
"basefont",
"blockquote",
"body",
"caption",
"center",
"col",
"colgroup",
"dd",
"details",
"dialog",
"dir",
"div",
"dl",
"dt",
"fieldset",
"figcaption",
"figure",
"footer",
"form",
"frame",
"frameset",
"h1",
"h2",
"h3",
"h4",
"h5",
"h6",
"head",
"header",
"hgroup",
"hr",
"html",
"iframe",
"legend",
"li",
"link",
"main",
"menu",
"menuitem",
"meta",
"nav",
"noframes",
"ol",
"optgroup",
"option",
"p",
"param",
"pre",
"section",
"source",
"title",
"summary",
"table",
"tbody",
"td",
"tfoot",
"th",
"thead",
"title",
"tr",
"track",
"ul"
];
/***/ }),
/* 972 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module remark:parse:decode
* @fileoverview Decode entities.
*/
var entities = __webpack_require__(160);
module.exports = factory;
/* Factory to create an entity decoder. */
function factory(ctx) {
decoder.raw = decodeRaw;
return decoder;
/* Normalize `position` to add an `indent`. */
function normalize(position) {
var offsets = ctx.offset;
var line = position.line;
var result = [];
while (++line) {
if (!(line in offsets)) {
break;
}
result.push((offsets[line] || 0) + 1);
}
return {
start: position,
indent: result
};
}
/* Handle a warning.
* See https://github.com/wooorm/parse-entities
* for the warnings. */
function handleWarning(reason, position, code) {
if (code === 3) {
return;
}
ctx.file.message(reason, position);
}
/* Decode `value` (at `position`) into text-nodes. */
function decoder(value, position, handler) {
entities(value, {
position: normalize(position),
warning: handleWarning,
text: handler,
reference: handler,
textContext: ctx,
referenceContext: ctx
});
}
/* Decode `value` (at `position`) into a string. */
function decodeRaw(value, position) {
return entities(value, {
position: normalize(position),
warning: handleWarning
});
}
}
/***/ }),
/* 973 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module remark:parse:locate:break
* @fileoverview Locate a break.
*/
module.exports = locate;
function locate(value, fromIndex) {
var index = value.indexOf('\n', fromIndex);
while (index > fromIndex) {
if (value.charAt(index - 1) !== ' ') {
break;
}
index--;
}
return index;
}
/***/ }),
/* 974 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module remark:parse:locate:code-inline
* @fileoverview Locate inline code.
*/
module.exports = locate;
function locate(value, fromIndex) {
return value.indexOf('`', fromIndex);
}
/***/ }),
/* 975 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module remark:parse:locate:delete
* @fileoverview Locate strikethrough.
*/
module.exports = locate;
function locate(value, fromIndex) {
return value.indexOf('~~', fromIndex);
}
/***/ }),
/* 976 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module remark:parse:locate:emphasis
* @fileoverview Locate italics / emphasis.
*/
module.exports = locate;
function locate(value, fromIndex) {
var asterisk = value.indexOf('*', fromIndex);
var underscore = value.indexOf('_', fromIndex);
if (underscore === -1) {
return asterisk;
}
if (asterisk === -1) {
return underscore;
}
return underscore < asterisk ? underscore : asterisk;
}
/***/ }),
/* 977 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module remark:parse:locate:escape
* @fileoverview Locate an escape.
*/
module.exports = locate;
function locate(value, fromIndex) {
return value.indexOf('\\', fromIndex);
}
/***/ }),
/* 978 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module remark:parse:locate:strong
* @fileoverview Locate bold / strong / importance.
*/
module.exports = locate;
function locate(value, fromIndex) {
var asterisk = value.indexOf('**', fromIndex);
var underscore = value.indexOf('__', fromIndex);
if (underscore === -1) {
return asterisk;
}
if (asterisk === -1) {
return underscore;
}
return underscore < asterisk ? underscore : asterisk;
}
/***/ }),
/* 979 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module remark:parse:locate:url
* @fileoverview Locate a URL.
*/
module.exports = locate;
var PROTOCOLS = ['https://', 'http://', 'mailto:'];
function locate(value, fromIndex) {
var length = PROTOCOLS.length;
var index = -1;
var min = -1;
var position;
if (!this.options.gfm) {
return -1;
}
while (++index < length) {
position = value.indexOf(PROTOCOLS[index], fromIndex);
if (position !== -1 && (position < min || min === -1)) {
min = position;
}
}
return min;
}
/***/ }),
/* 980 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module remark:parse:parse
* @fileoverview Parse the document
*/
var xtend = __webpack_require__(78);
var removePosition = __webpack_require__(1025);
module.exports = parse;
var C_NEWLINE = '\n';
var EXPRESSION_LINE_BREAKS = /\r\n|\r/g;
/* Parse the bound file. */
function parse() {
var self = this;
var value = String(self.file);
var start = {line: 1, column: 1, offset: 0};
var content = xtend(start);
var node;
/* Clean non-unix newlines: `\r\n` and `\r` are all
* changed to `\n`. This should not affect positional
* information. */
value = value.replace(EXPRESSION_LINE_BREAKS, C_NEWLINE);
if (value.charCodeAt(0) === 0xFEFF) {
value = value.slice(1);
content.column++;
content.offset++;
}
node = {
type: 'root',
children: self.tokenizeBlock(value, content),
position: {
start: start,
end: self.eof || xtend(start)
}
};
if (!self.options.position) {
removePosition(node, true);
}
return node;
}
/***/ }),
/* 981 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module remark:parse
* @fileoverview Markdown parser.
*/
var xtend = __webpack_require__(78);
var toggle = __webpack_require__(1014);
var vfileLocation = __webpack_require__(1029);
var unescape = __webpack_require__(1010);
var decode = __webpack_require__(972);
var tokenizer = __webpack_require__(1009);
module.exports = Parser;
/* Construct a new parser. */
function Parser(doc, file) {
this.file = file;
this.offset = {};
this.options = xtend(this.options);
this.setOptions({});
this.inList = false;
this.inBlock = false;
this.inLink = false;
this.atStart = true;
this.toOffset = vfileLocation(file).toOffset;
this.unescape = unescape(this, 'escape');
this.decode = decode(this);
}
/* Prototype. */
var proto = Parser.prototype;
/* Expose core. */
proto.setOptions = __webpack_require__(982);
proto.parse = __webpack_require__(980);
/* Expose `defaults`. */
proto.options = __webpack_require__(322);
/* Enter and exit helpers. */
proto.exitStart = toggle('atStart', true);
proto.enterList = toggle('inList', false);
proto.enterLink = toggle('inLink', false);
proto.enterBlock = toggle('inBlock', false);
/* Nodes that can interupt a paragraph:
*
* ```markdown
* A paragraph, followed by a thematic break.
* ___
* ```
*
* In the above example, the thematic break “interupts”
* the paragraph. */
proto.interruptParagraph = [
['thematicBreak'],
['atxHeading'],
['fencedCode'],
['blockquote'],
['html'],
['setextHeading', {commonmark: false}],
['definition', {commonmark: false}],
['footnote', {commonmark: false}]
];
/* Nodes that can interupt a list:
*
* ```markdown
* - One
* ___
* ```
*
* In the above example, the thematic break “interupts”
* the list. */
proto.interruptList = [
['fencedCode', {pedantic: false}],
['thematicBreak', {pedantic: false}],
['definition', {commonmark: false}],
['footnote', {commonmark: false}]
];
/* Nodes that can interupt a blockquote:
*
* ```markdown
* > A paragraph.
* ___
* ```
*
* In the above example, the thematic break “interupts”
* the blockquote. */
proto.interruptBlockquote = [
['indentedCode', {commonmark: true}],
['fencedCode', {commonmark: true}],
['atxHeading', {commonmark: true}],
['setextHeading', {commonmark: true}],
['thematicBreak', {commonmark: true}],
['html', {commonmark: true}],
['list', {commonmark: true}],
['definition', {commonmark: false}],
['footnote', {commonmark: false}]
];
/* Handlers. */
proto.blockTokenizers = {
yamlFrontMatter: __webpack_require__(1008),
newline: __webpack_require__(1000),
indentedCode: __webpack_require__(987),
fencedCode: __webpack_require__(986),
blockquote: __webpack_require__(984),
atxHeading: __webpack_require__(994),
thematicBreak: __webpack_require__(1006),
list: __webpack_require__(999),
setextHeading: __webpack_require__(995),
html: __webpack_require__(996),
footnote: __webpack_require__(993),
definition: __webpack_require__(989),
table: __webpack_require__(1004),
paragraph: __webpack_require__(1001)
};
proto.inlineTokenizers = {
escape: __webpack_require__(992),
autoLink: __webpack_require__(983),
url: __webpack_require__(1007),
html: __webpack_require__(997),
link: __webpack_require__(998),
reference: __webpack_require__(1002),
strong: __webpack_require__(1003),
emphasis: __webpack_require__(991),
deletion: __webpack_require__(990),
code: __webpack_require__(988),
break: __webpack_require__(985),
text: __webpack_require__(1005)
};
/* Expose precedence. */
proto.blockMethods = keys(proto.blockTokenizers);
proto.inlineMethods = keys(proto.inlineTokenizers);
/* Tokenizers. */
proto.tokenizeBlock = tokenizer('block');
proto.tokenizeInline = tokenizer('inline');
proto.tokenizeFactory = tokenizer;
/* Get all keys in `value`. */
function keys(value) {
var result = [];
var key;
for (key in value) {
result.push(key);
}
return result;
}
/***/ }),
/* 982 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module remark:parse
* @fileoverview Markdown parser.
*/
var xtend = __webpack_require__(78);
var escapes = __webpack_require__(703);
var defaults = __webpack_require__(322);
module.exports = setOptions;
/* Set options. */
function setOptions(options) {
var self = this;
var current = self.options;
var key;
var value;
if (options == null) {
options = {};
} else if (typeof options === 'object') {
options = xtend(options);
} else {
throw new Error(
'Invalid value `' + options + '` ' +
'for setting `options`'
);
}
for (key in defaults) {
value = options[key];
if (value == null) {
value = current[key];
}
if (
(key !== 'blocks' && typeof value !== 'boolean') ||
(key === 'blocks' && typeof value !== 'object')
) {
throw new Error(
'Invalid value `' + value + '` ' +
'for setting `options.' + key + '`'
);
}
options[key] = value;
}
self.options = options;
self.escape = escapes(options);
return self;
}
/***/ }),
/* 983 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module remark:parse:tokenize:auto-link
* @fileoverview Tokenise an auto-link.
*/
var decode = __webpack_require__(160);
var locate = __webpack_require__(324);
module.exports = autoLink;
autoLink.locator = locate;
autoLink.notInLink = true;
var C_LT = '<';
var C_GT = '>';
var C_AT_SIGN = '@';
var C_SLASH = '/';
var MAILTO = 'mailto:';
var MAILTO_LENGTH = MAILTO.length;
/* Tokenise a link. */
function autoLink(eat, value, silent) {
var self;
var subvalue;
var length;
var index;
var queue;
var character;
var hasAtCharacter;
var link;
var now;
var content;
var tokenize;
var exit;
if (value.charAt(0) !== C_LT) {
return;
}
self = this;
subvalue = '';
length = value.length;
index = 0;
queue = '';
hasAtCharacter = false;
link = '';
index++;
subvalue = C_LT;
while (index < length) {
character = value.charAt(index);
if (
character === ' ' ||
character === C_GT ||
character === C_AT_SIGN ||
(character === ':' && value.charAt(index + 1) === C_SLASH)
) {
break;
}
queue += character;
index++;
}
if (!queue) {
return;
}
link += queue;
queue = '';
character = value.charAt(index);
link += character;
index++;
if (character === C_AT_SIGN) {
hasAtCharacter = true;
} else {
if (
character !== ':' ||
value.charAt(index + 1) !== C_SLASH
) {
return;
}
link += C_SLASH;
index++;
}
while (index < length) {
character = value.charAt(index);
if (character === ' ' || character === C_GT) {
break;
}
queue += character;
index++;
}
character = value.charAt(index);
if (!queue || character !== C_GT) {
return;
}
/* istanbul ignore if - never used (yet) */
if (silent) {
return true;
}
link += queue;
content = link;
subvalue += link + character;
now = eat.now();
now.column++;
now.offset++;
if (hasAtCharacter) {
if (link.slice(0, MAILTO_LENGTH).toLowerCase() === MAILTO) {
content = content.substr(MAILTO_LENGTH);
now.column += MAILTO_LENGTH;
now.offset += MAILTO_LENGTH;
} else {
link = MAILTO + link;
}
}
/* Temporarily remove support for escapes in autolinks. */
tokenize = self.inlineTokenizers.escape;
self.inlineTokenizers.escape = null;
exit = self.enterLink();
content = self.tokenizeInline(content, now);
self.inlineTokenizers.escape = tokenize;
exit();
return eat(subvalue)({
type: 'link',
title: null,
url: decode(link),
children: content
});
}
/***/ }),
/* 984 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module remark:parse:tokenize:blockquote
* @fileoverview Tokenise blockquote.
*/
var trim = __webpack_require__(63);
var interrupt = __webpack_require__(188);
module.exports = blockquote;
var C_NEWLINE = '\n';
var C_TAB = '\t';
var C_SPACE = ' ';
var C_GT = '>';
/* Tokenise a blockquote. */
function blockquote(eat, value, silent) {
var self = this;
var offsets = self.offset;
var tokenizers = self.blockTokenizers;
var interruptors = self.interruptBlockquote;
var now = eat.now();
var currentLine = now.line;
var length = value.length;
var values = [];
var contents = [];
var indents = [];
var add;
var index = 0;
var character;
var rest;
var nextIndex;
var content;
var line;
var startIndex;
var prefixed;
var exit;
while (index < length) {
character = value.charAt(index);
if (character !== C_SPACE && character !== C_TAB) {
break;
}
index++;
}
if (value.charAt(index) !== C_GT) {
return;
}
if (silent) {
return true;
}
index = 0;
while (index < length) {
nextIndex = value.indexOf(C_NEWLINE, index);
startIndex = index;
prefixed = false;
if (nextIndex === -1) {
nextIndex = length;
}
while (index < length) {
character = value.charAt(index);
if (character !== C_SPACE && character !== C_TAB) {
break;
}
index++;
}
if (value.charAt(index) === C_GT) {
index++;
prefixed = true;
if (value.charAt(index) === C_SPACE) {
index++;
}
} else {
index = startIndex;
}
content = value.slice(index, nextIndex);
if (!prefixed && !trim(content)) {
index = startIndex;
break;
}
if (!prefixed) {
rest = value.slice(index);
/* Check if the following code contains a possible
* block. */
if (interrupt(interruptors, tokenizers, self, [eat, rest, true])) {
break;
}
}
line = startIndex === index ? content : value.slice(startIndex, nextIndex);
indents.push(index - startIndex);
values.push(line);
contents.push(content);
index = nextIndex + 1;
}
index = -1;
length = indents.length;
add = eat(values.join(C_NEWLINE));
while (++index < length) {
offsets[currentLine] = (offsets[currentLine] || 0) + indents[index];
currentLine++;
}
exit = self.enterBlock();
contents = self.tokenizeBlock(contents.join(C_NEWLINE), now);
exit();
return add({
type: 'blockquote',
children: contents
});
}
/***/ }),
/* 985 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module remark:parse:tokenize:break
* @fileoverview Tokenise a break.
*/
var locate = __webpack_require__(973);
module.exports = hardBreak;
hardBreak.locator = locate;
var MIN_BREAK_LENGTH = 2;
/* Tokenise a break. */
function hardBreak(eat, value, silent) {
var self = this;
var breaks = self.options.breaks;
var length = value.length;
var index = -1;
var queue = '';
var character;
while (++index < length) {
character = value.charAt(index);
if (character === '\n') {
if (!breaks && index < MIN_BREAK_LENGTH) {
return;
}
/* istanbul ignore if - never used (yet) */
if (silent) {
return true;
}
queue += character;
return eat(queue)({type: 'break'});
}
if (character !== ' ') {
return;
}
queue += character;
}
}
/***/ }),
/* 986 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module remark:parse:tokenize:code-fenced
* @fileoverview Tokenise fenced code.
*/
var trim = __webpack_require__(191);
module.exports = fencedCode;
var C_NEWLINE = '\n';
var C_TAB = '\t';
var C_SPACE = ' ';
var C_TILDE = '~';
var C_TICK = '`';
var MIN_FENCE_COUNT = 3;
var CODE_INDENT_COUNT = 4;
/* Tokenise fenced code. */
function fencedCode(eat, value, silent) {
var self = this;
var settings = self.options;
var length = value.length + 1;
var index = 0;
var subvalue = '';
var fenceCount;
var marker;
var character;
var flag;
var queue;
var content;
var exdentedContent;
var closing;
var exdentedClosing;
var indent;
var now;
if (!settings.gfm) {
return;
}
/* Eat initial spacing. */
while (index < length) {
character = value.charAt(index);
if (character !== C_SPACE && character !== C_TAB) {
break;
}
subvalue += character;
index++;
}
indent = index;
/* Eat the fence. */
character = value.charAt(index);
if (character !== C_TILDE && character !== C_TICK) {
return;
}
index++;
marker = character;
fenceCount = 1;
subvalue += character;
while (index < length) {
character = value.charAt(index);
if (character !== marker) {
break;
}
subvalue += character;
fenceCount++;
index++;
}
if (fenceCount < MIN_FENCE_COUNT) {
return;
}
/* Eat spacing before flag. */
while (index < length) {
character = value.charAt(index);
if (character !== C_SPACE && character !== C_TAB) {
break;
}
subvalue += character;
index++;
}
/* Eat flag. */
flag = '';
queue = '';
while (index < length) {
character = value.charAt(index);
if (
character === C_NEWLINE ||
character === C_TILDE ||
character === C_TICK
) {
break;
}
if (character === C_SPACE || character === C_TAB) {
queue += character;
} else {
flag += queue + character;
queue = '';
}
index++;
}
character = value.charAt(index);
if (character && character !== C_NEWLINE) {
return;
}
if (silent) {
return true;
}
now = eat.now();
now.column += subvalue.length;
now.offset += subvalue.length;
subvalue += flag;
flag = self.decode.raw(self.unescape(flag), now);
if (queue) {
subvalue += queue;
}
queue = '';
closing = '';
exdentedClosing = '';
content = '';
exdentedContent = '';
/* Eat content. */
while (index < length) {
character = value.charAt(index);
content += closing;
exdentedContent += exdentedClosing;
closing = '';
exdentedClosing = '';
if (character !== C_NEWLINE) {
content += character;
exdentedClosing += character;
index++;
continue;
}
/* Add the newline to `subvalue` if its the first
* character. Otherwise, add it to the `closing`
* queue. */
if (content) {
closing += character;
exdentedClosing += character;
} else {
subvalue += character;
}
queue = '';
index++;
while (index < length) {
character = value.charAt(index);
if (character !== C_SPACE) {
break;
}
queue += character;
index++;
}
closing += queue;
exdentedClosing += queue.slice(indent);
if (queue.length >= CODE_INDENT_COUNT) {
continue;
}
queue = '';
while (index < length) {
character = value.charAt(index);
if (character !== marker) {
break;
}
queue += character;
index++;
}
closing += queue;
exdentedClosing += queue;
if (queue.length < fenceCount) {
continue;
}
queue = '';
while (index < length) {
character = value.charAt(index);
if (character !== C_SPACE && character !== C_TAB) {
break;
}
closing += character;
exdentedClosing += character;
index++;
}
if (!character || character === C_NEWLINE) {
break;
}
}
subvalue += content + closing;
return eat(subvalue)({
type: 'code',
lang: flag || null,
value: trim(exdentedContent)
});
}
/***/ }),
/* 987 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module remark:parse:tokenize:code-indented
* @fileoverview Tokenise indented code.
*/
var repeat = __webpack_require__(190);
var trim = __webpack_require__(191);
module.exports = indentedCode;
var C_NEWLINE = '\n';
var C_TAB = '\t';
var C_SPACE = ' ';
var CODE_INDENT_COUNT = 4;
var CODE_INDENT = repeat(C_SPACE, CODE_INDENT_COUNT);
/* Tokenise indented code. */
function indentedCode(eat, value, silent) {
var index = -1;
var length = value.length;
var subvalue = '';
var content = '';
var subvalueQueue = '';
var contentQueue = '';
var character;
var blankQueue;
var indent;
while (++index < length) {
character = value.charAt(index);
if (indent) {
indent = false;
subvalue += subvalueQueue;
content += contentQueue;
subvalueQueue = '';
contentQueue = '';
if (character === C_NEWLINE) {
subvalueQueue = character;
contentQueue = character;
} else {
subvalue += character;
content += character;
while (++index < length) {
character = value.charAt(index);
if (!character || character === C_NEWLINE) {
contentQueue = character;
subvalueQueue = character;
break;
}
subvalue += character;
content += character;
}
}
} else if (
character === C_SPACE &&
value.charAt(index + 1) === character &&
value.charAt(index + 2) === character &&
value.charAt(index + 3) === character
) {
subvalueQueue += CODE_INDENT;
index += 3;
indent = true;
} else if (character === C_TAB) {
subvalueQueue += character;
indent = true;
} else {
blankQueue = '';
while (character === C_TAB || character === C_SPACE) {
blankQueue += character;
character = value.charAt(++index);
}
if (character !== C_NEWLINE) {
break;
}
subvalueQueue += blankQueue + character;
contentQueue += character;
}
}
if (content) {
if (silent) {
return true;
}
return eat(subvalue)({
type: 'code',
lang: null,
value: trim(content)
});
}
}
/***/ }),
/* 988 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module remark:parse:tokenize:code-inline
* @fileoverview Tokenise inline code.
*/
var whitespace = __webpack_require__(24);
var locate = __webpack_require__(974);
module.exports = inlineCode;
inlineCode.locator = locate;
var C_TICK = '`';
/* Tokenise inline code. */
function inlineCode(eat, value, silent) {
var length = value.length;
var index = 0;
var queue = '';
var tickQueue = '';
var contentQueue;
var subqueue;
var count;
var openingCount;
var subvalue;
var character;
var found;
var next;
while (index < length) {
if (value.charAt(index) !== C_TICK) {
break;
}
queue += C_TICK;
index++;
}
if (!queue) {
return;
}
subvalue = queue;
openingCount = index;
queue = '';
next = value.charAt(index);
count = 0;
while (index < length) {
character = next;
next = value.charAt(index + 1);
if (character === C_TICK) {
count++;
tickQueue += character;
} else {
count = 0;
queue += character;
}
if (count && next !== C_TICK) {
if (count === openingCount) {
subvalue += queue + tickQueue;
found = true;
break;
}
queue += tickQueue;
tickQueue = '';
}
index++;
}
if (!found) {
if (openingCount % 2 !== 0) {
return;
}
queue = '';
}
/* istanbul ignore if - never used (yet) */
if (silent) {
return true;
}
contentQueue = '';
subqueue = '';
length = queue.length;
index = -1;
while (++index < length) {
character = queue.charAt(index);
if (whitespace(character)) {
subqueue += character;
continue;
}
if (subqueue) {
if (contentQueue) {
contentQueue += subqueue;
}
subqueue = '';
}
contentQueue += character;
}
return eat(subvalue)({
type: 'inlineCode',
value: contentQueue
});
}
/***/ }),
/* 989 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module remark:parse:tokenize:definition
* @fileoverview Tokenise a definition.
*/
var whitespace = __webpack_require__(24);
var normalize = __webpack_require__(189);
module.exports = definition;
definition.notInList = true;
definition.notInBlock = true;
var C_DOUBLE_QUOTE = '"';
var C_SINGLE_QUOTE = '\'';
var C_BACKSLASH = '\\';
var C_NEWLINE = '\n';
var C_TAB = '\t';
var C_SPACE = ' ';
var C_BRACKET_OPEN = '[';
var C_BRACKET_CLOSE = ']';
var C_PAREN_OPEN = '(';
var C_PAREN_CLOSE = ')';
var C_COLON = ':';
var C_LT = '<';
var C_GT = '>';
/* Tokenise a definition. */
function definition(eat, value, silent) {
var self = this;
var commonmark = self.options.commonmark;
var index = 0;
var length = value.length;
var subvalue = '';
var beforeURL;
var beforeTitle;
var queue;
var character;
var test;
var identifier;
var url;
var title;
while (index < length) {
character = value.charAt(index);
if (character !== C_SPACE && character !== C_TAB) {
break;
}
subvalue += character;
index++;
}
character = value.charAt(index);
if (character !== C_BRACKET_OPEN) {
return;
}
index++;
subvalue += character;
queue = '';
while (index < length) {
character = value.charAt(index);
if (character === C_BRACKET_CLOSE) {
break;
} else if (character === C_BACKSLASH) {
queue += character;
index++;
character = value.charAt(index);
}
queue += character;
index++;
}
if (
!queue ||
value.charAt(index) !== C_BRACKET_CLOSE ||
value.charAt(index + 1) !== C_COLON
) {
return;
}
identifier = queue;
subvalue += queue + C_BRACKET_CLOSE + C_COLON;
index = subvalue.length;
queue = '';
while (index < length) {
character = value.charAt(index);
if (
character !== C_TAB &&
character !== C_SPACE &&
character !== C_NEWLINE
) {
break;
}
subvalue += character;
index++;
}
character = value.charAt(index);
queue = '';
beforeURL = subvalue;
if (character === C_LT) {
index++;
while (index < length) {
character = value.charAt(index);
if (!isEnclosedURLCharacter(character)) {
break;
}
queue += character;
index++;
}
character = value.charAt(index);
if (character === isEnclosedURLCharacter.delimiter) {
subvalue += C_LT + queue + character;
index++;
} else {
if (commonmark) {
return;
}
index -= queue.length + 1;
queue = '';
}
}
if (!queue) {
while (index < length) {
character = value.charAt(index);
if (!isUnclosedURLCharacter(character)) {
break;
}
queue += character;
index++;
}
subvalue += queue;
}
if (!queue) {
return;
}
url = queue;
queue = '';
while (index < length) {
character = value.charAt(index);
if (
character !== C_TAB &&
character !== C_SPACE &&
character !== C_NEWLINE
) {
break;
}
queue += character;
index++;
}
character = value.charAt(index);
test = null;
if (character === C_DOUBLE_QUOTE) {
test = C_DOUBLE_QUOTE;
} else if (character === C_SINGLE_QUOTE) {
test = C_SINGLE_QUOTE;
} else if (character === C_PAREN_OPEN) {
test = C_PAREN_CLOSE;
}
if (!test) {
queue = '';
index = subvalue.length;
} else if (queue) {
subvalue += queue + character;
index = subvalue.length;
queue = '';
while (index < length) {
character = value.charAt(index);
if (character === test) {
break;
}
if (character === C_NEWLINE) {
index++;
character = value.charAt(index);
if (character === C_NEWLINE || character === test) {
return;
}
queue += C_NEWLINE;
}
queue += character;
index++;
}
character = value.charAt(index);
if (character !== test) {
return;
}
beforeTitle = subvalue;
subvalue += queue + character;
index++;
title = queue;
queue = '';
} else {
return;
}
while (index < length) {
character = value.charAt(index);
if (character !== C_TAB && character !== C_SPACE) {
break;
}
subvalue += character;
index++;
}
character = value.charAt(index);
if (!character || character === C_NEWLINE) {
if (silent) {
return true;
}
beforeURL = eat(beforeURL).test().end;
url = self.decode.raw(self.unescape(url), beforeURL);
if (title) {
beforeTitle = eat(beforeTitle).test().end;
title = self.decode.raw(self.unescape(title), beforeTitle);
}
return eat(subvalue)({
type: 'definition',
identifier: normalize(identifier),
title: title || null,
url: url
});
}
}
/* Check if `character` can be inside an enclosed URI. */
function isEnclosedURLCharacter(character) {
return character !== C_GT &&
character !== C_BRACKET_OPEN &&
character !== C_BRACKET_CLOSE;
}
isEnclosedURLCharacter.delimiter = C_GT;
/* Check if `character` can be inside an unclosed URI. */
function isUnclosedURLCharacter(character) {
return character !== C_BRACKET_OPEN &&
character !== C_BRACKET_CLOSE &&
!whitespace(character);
}
/***/ }),
/* 990 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module remark:parse:tokenize:delete
* @fileoverview Tokenise strikethrough.
*/
var whitespace = __webpack_require__(24);
var locate = __webpack_require__(975);
module.exports = strikethrough;
strikethrough.locator = locate;
var C_TILDE = '~';
var DOUBLE = '~~';
/* Tokenise strikethrough. */
function strikethrough(eat, value, silent) {
var self = this;
var character = '';
var previous = '';
var preceding = '';
var subvalue = '';
var index;
var length;
var now;
if (
!self.options.gfm ||
value.charAt(0) !== C_TILDE ||
value.charAt(1) !== C_TILDE ||
whitespace(value.charAt(2))
) {
return;
}
index = 1;
length = value.length;
now = eat.now();
now.column += 2;
now.offset += 2;
while (++index < length) {
character = value.charAt(index);
if (
character === C_TILDE &&
previous === C_TILDE &&
(!preceding || !whitespace(preceding))
) {
/* istanbul ignore if - never used (yet) */
if (silent) {
return true;
}
return eat(DOUBLE + subvalue + DOUBLE)({
type: 'delete',
children: self.tokenizeInline(subvalue, now)
});
}
subvalue += previous;
preceding = previous;
previous = character;
}
}
/***/ }),
/* 991 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module remark:parse:tokenize:emphasis
* @fileoverview Tokenise emphasis.
*/
var trim = __webpack_require__(63);
var word = __webpack_require__(469);
var whitespace = __webpack_require__(24);
var locate = __webpack_require__(976);
module.exports = emphasis;
emphasis.locator = locate;
var C_ASTERISK = '*';
var C_UNDERSCORE = '_';
/* Tokenise emphasis. */
function emphasis(eat, value, silent) {
var self = this;
var index = 0;
var character = value.charAt(index);
var now;
var pedantic;
var marker;
var queue;
var subvalue;
var length;
var prev;
if (character !== C_ASTERISK && character !== C_UNDERSCORE) {
return;
}
pedantic = self.options.pedantic;
subvalue = character;
marker = character;
length = value.length;
index++;
queue = '';
character = '';
if (pedantic && whitespace(value.charAt(index))) {
return;
}
while (index < length) {
prev = character;
character = value.charAt(index);
if (character === marker && (!pedantic || !whitespace(prev))) {
character = value.charAt(++index);
if (character !== marker) {
if (!trim(queue) || prev === marker) {
return;
}
if (!pedantic && marker === C_UNDERSCORE && word(character)) {
queue += marker;
continue;
}
/* istanbul ignore if - never used (yet) */
if (silent) {
return true;
}
now = eat.now();
now.column++;
now.offset++;
return eat(subvalue + queue + marker)({
type: 'emphasis',
children: self.tokenizeInline(queue, now)
});
}
queue += marker;
}
if (!pedantic && character === '\\') {
queue += character;
character = value.charAt(++index);
}
queue += character;
index++;
}
}
/***/ }),
/* 992 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module remark:parse:tokenize:escape
* @fileoverview Tokenise an escape.
*/
var locate = __webpack_require__(977);
module.exports = escape;
escape.locator = locate;
/* Tokenise an escape. */
function escape(eat, value, silent) {
var self = this;
var character;
var node;
if (value.charAt(0) === '\\') {
character = value.charAt(1);
if (self.escape.indexOf(character) !== -1) {
/* istanbul ignore if - never used (yet) */
if (silent) {
return true;
}
if (character === '\n') {
node = {type: 'break'};
} else {
node = {
type: 'text',
value: character
};
}
return eat('\\' + character)(node);
}
}
}
/***/ }),
/* 993 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module remark:parse:tokenize:footnote-definition
* @fileoverview Tokenise footnote definition.
*/
var whitespace = __webpack_require__(24);
var normalize = __webpack_require__(189);
module.exports = footnoteDefinition;
footnoteDefinition.notInList = true;
footnoteDefinition.notInBlock = true;
var C_BACKSLASH = '\\';
var C_NEWLINE = '\n';
var C_TAB = '\t';
var C_SPACE = ' ';
var C_BRACKET_OPEN = '[';
var C_BRACKET_CLOSE = ']';
var C_CARET = '^';
var C_COLON = ':';
var EXPRESSION_INITIAL_TAB = /^( {4}|\t)?/gm;
/* Tokenise a footnote definition. */
function footnoteDefinition(eat, value, silent) {
var self = this;
var offsets = self.offset;
var index;
var length;
var subvalue;
var now;
var currentLine;
var content;
var queue;
var subqueue;
var character;
var identifier;
var add;
var exit;
if (!self.options.footnotes) {
return;
}
index = 0;
length = value.length;
subvalue = '';
now = eat.now();
currentLine = now.line;
while (index < length) {
character = value.charAt(index);
if (!whitespace(character)) {
break;
}
subvalue += character;
index++;
}
if (
value.charAt(index) !== C_BRACKET_OPEN ||
value.charAt(index + 1) !== C_CARET
) {
return;
}
subvalue += C_BRACKET_OPEN + C_CARET;
index = subvalue.length;
queue = '';
while (index < length) {
character = value.charAt(index);
if (character === C_BRACKET_CLOSE) {
break;
} else if (character === C_BACKSLASH) {
queue += character;
index++;
character = value.charAt(index);
}
queue += character;
index++;
}
if (
!queue ||
value.charAt(index) !== C_BRACKET_CLOSE ||
value.charAt(index + 1) !== C_COLON
) {
return;
}
if (silent) {
return true;
}
identifier = normalize(queue);
subvalue += queue + C_BRACKET_CLOSE + C_COLON;
index = subvalue.length;
while (index < length) {
character = value.charAt(index);
if (character !== C_TAB && character !== C_SPACE) {
break;
}
subvalue += character;
index++;
}
now.column += subvalue.length;
now.offset += subvalue.length;
queue = '';
content = '';
subqueue = '';
while (index < length) {
character = value.charAt(index);
if (character === C_NEWLINE) {
subqueue = character;
index++;
while (index < length) {
character = value.charAt(index);
if (character !== C_NEWLINE) {
break;
}
subqueue += character;
index++;
}
queue += subqueue;
subqueue = '';
while (index < length) {
character = value.charAt(index);
if (character !== C_SPACE) {
break;
}
subqueue += character;
index++;
}
if (subqueue.length === 0) {
break;
}
queue += subqueue;
}
if (queue) {
content += queue;
queue = '';
}
content += character;
index++;
}
subvalue += content;
content = content.replace(EXPRESSION_INITIAL_TAB, function (line) {
offsets[currentLine] = (offsets[currentLine] || 0) + line.length;
currentLine++;
return '';
});
add = eat(subvalue);
exit = self.enterBlock();
content = self.tokenizeBlock(content, now);
exit();
return add({
type: 'footnoteDefinition',
identifier: identifier,
children: content
});
}
/***/ }),
/* 994 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module remark:parse:tokenize:heading-atx
* @fileoverview Tokenise an ATX-style heading.
*/
module.exports = atxHeading;
var C_NEWLINE = '\n';
var C_TAB = '\t';
var C_SPACE = ' ';
var C_HASH = '#';
var MAX_ATX_COUNT = 6;
/* Tokenise an ATX-style heading. */
function atxHeading(eat, value, silent) {
var self = this;
var settings = self.options;
var length = value.length + 1;
var index = -1;
var now = eat.now();
var subvalue = '';
var content = '';
var character;
var queue;
var depth;
/* Eat initial spacing. */
while (++index < length) {
character = value.charAt(index);
if (character !== C_SPACE && character !== C_TAB) {
index--;
break;
}
subvalue += character;
}
/* Eat hashes. */
depth = 0;
while (++index <= length) {
character = value.charAt(index);
if (character !== C_HASH) {
index--;
break;
}
subvalue += character;
depth++;
}
if (depth > MAX_ATX_COUNT) {
return;
}
if (
!depth ||
(!settings.pedantic && value.charAt(index + 1) === C_HASH)
) {
return;
}
length = value.length + 1;
/* Eat intermediate white-space. */
queue = '';
while (++index < length) {
character = value.charAt(index);
if (character !== C_SPACE && character !== C_TAB) {
index--;
break;
}
queue += character;
}
/* Exit when not in pedantic mode without spacing. */
if (
!settings.pedantic &&
queue.length === 0 &&
character &&
character !== C_NEWLINE
) {
return;
}
if (silent) {
return true;
}
/* Eat content. */
subvalue += queue;
queue = '';
content = '';
while (++index < length) {
character = value.charAt(index);
if (!character || character === C_NEWLINE) {
break;
}
if (
character !== C_SPACE &&
character !== C_TAB &&
character !== C_HASH
) {
content += queue + character;
queue = '';
continue;
}
while (character === C_SPACE || character === C_TAB) {
queue += character;
character = value.charAt(++index);
}
while (character === C_HASH) {
queue += character;
character = value.charAt(++index);
}
while (character === C_SPACE || character === C_TAB) {
queue += character;
character = value.charAt(++index);
}
index--;
}
now.column += subvalue.length;
now.offset += subvalue.length;
subvalue += content + queue;
return eat(subvalue)({
type: 'heading',
depth: depth,
children: self.tokenizeInline(content, now)
});
}
/***/ }),
/* 995 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module remark:parse:tokenize:heading-setext
* @fileoverview Tokenise an setext-style heading.
*/
module.exports = setextHeading;
var C_NEWLINE = '\n';
var C_TAB = '\t';
var C_SPACE = ' ';
var C_EQUALS = '=';
var C_DASH = '-';
var MAX_HEADING_INDENT = 3;
/* Map of characters which can be used to mark setext
* headers, mapping to their corresponding depth. */
var SETEXT_MARKERS = {};
SETEXT_MARKERS[C_EQUALS] = 1;
SETEXT_MARKERS[C_DASH] = 2;
/* Tokenise an setext-style heading. */
function setextHeading(eat, value, silent) {
var self = this;
var now = eat.now();
var length = value.length;
var index = -1;
var subvalue = '';
var content;
var queue;
var character;
var marker;
var depth;
/* Eat initial indentation. */
while (++index < length) {
character = value.charAt(index);
if (character !== C_SPACE || index >= MAX_HEADING_INDENT) {
index--;
break;
}
subvalue += character;
}
/* Eat content. */
content = '';
queue = '';
while (++index < length) {
character = value.charAt(index);
if (character === C_NEWLINE) {
index--;
break;
}
if (character === C_SPACE || character === C_TAB) {
queue += character;
} else {
content += queue + character;
queue = '';
}
}
now.column += subvalue.length;
now.offset += subvalue.length;
subvalue += content + queue;
/* Ensure the content is followed by a newline and a
* valid marker. */
character = value.charAt(++index);
marker = value.charAt(++index);
if (character !== C_NEWLINE || !SETEXT_MARKERS[marker]) {
return;
}
subvalue += character;
/* Eat Setext-line. */
queue = marker;
depth = SETEXT_MARKERS[marker];
while (++index < length) {
character = value.charAt(index);
if (character !== marker) {
if (character !== C_NEWLINE) {
return;
}
index--;
break;
}
queue += character;
}
if (silent) {
return true;
}
return eat(subvalue + queue)({
type: 'heading',
depth: depth,
children: self.tokenizeInline(content, now)
});
}
/***/ }),
/* 996 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module remark:parse:tokenize:html-block
* @fileoverview Tokenise block HTML.
*/
var openCloseTag = __webpack_require__(326).openCloseTag;
module.exports = blockHTML;
var C_TAB = '\t';
var C_SPACE = ' ';
var C_NEWLINE = '\n';
var C_LT = '<';
/* Tokenise block HTML. */
function blockHTML(eat, value, silent) {
var self = this;
var blocks = self.options.blocks;
var length = value.length;
var index = 0;
var next;
var line;
var offset;
var character;
var count;
var sequence;
var subvalue;
var sequences = [
[/^<(script|pre|style)(?=(\s|>|$))/i, /<\/(script|pre|style)>/i, true],
[/^<!--/, /-->/, true],
[/^<\?/, /\?>/, true],
[/^<![A-Za-z]/, />/, true],
[/^<!\[CDATA\[/, /\]\]>/, true],
[new RegExp('^</?(' + blocks.join('|') + ')(?=(\\s|/?>|$))', 'i'), /^$/, true],
[new RegExp(openCloseTag.source + '\\s*$'), /^$/, false]
];
/* Eat initial spacing. */
while (index < length) {
character = value.charAt(index);
if (character !== C_TAB && character !== C_SPACE) {
break;
}
index++;
}
if (value.charAt(index) !== C_LT) {
return;
}
next = value.indexOf(C_NEWLINE, index + 1);
next = next === -1 ? length : next;
line = value.slice(index, next);
offset = -1;
count = sequences.length;
while (++offset < count) {
if (sequences[offset][0].test(line)) {
sequence = sequences[offset];
break;
}
}
if (!sequence) {
return;
}
if (silent) {
return sequence[2];
}
index = next;
if (!sequence[1].test(line)) {
while (index < length) {
next = value.indexOf(C_NEWLINE, index + 1);
next = next === -1 ? length : next;
line = value.slice(index + 1, next);
if (sequence[1].test(line)) {
if (line) {
index = next;
}
break;
}
index = next;
}
}
subvalue = value.slice(0, index);
return eat(subvalue)({type: 'html', value: subvalue});
}
/***/ }),
/* 997 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module remark:parse:tokenize:html-inline
* @fileoverview Tokenise inline HTML.
*/
var alphabetical = __webpack_require__(218);
var locate = __webpack_require__(324);
var tag = __webpack_require__(326).tag;
module.exports = inlineHTML;
inlineHTML.locator = locate;
var EXPRESSION_HTML_LINK_OPEN = /^<a /i;
var EXPRESSION_HTML_LINK_CLOSE = /^<\/a>/i;
/* Tokenise inline HTML. */
function inlineHTML(eat, value, silent) {
var self = this;
var length = value.length;
var character;
var subvalue;
if (value.charAt(0) !== '<' || length < 3) {
return;
}
character = value.charAt(1);
if (
!alphabetical(character) &&
character !== '?' &&
character !== '!' &&
character !== '/'
) {
return;
}
subvalue = value.match(tag);
if (!subvalue) {
return;
}
/* istanbul ignore if - not used yet. */
if (silent) {
return true;
}
subvalue = subvalue[0];
if (!self.inLink && EXPRESSION_HTML_LINK_OPEN.test(subvalue)) {
self.inLink = true;
} else if (self.inLink && EXPRESSION_HTML_LINK_CLOSE.test(subvalue)) {
self.inLink = false;
}
return eat(subvalue)({type: 'html', value: subvalue});
}
/***/ }),
/* 998 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module remark:parse:tokenize:link
* @fileoverview Tokenise a link.
*/
var has = __webpack_require__(68);
var whitespace = __webpack_require__(24);
var locate = __webpack_require__(323);
module.exports = link;
link.locator = locate;
var C_BACKSLASH = '\\';
var C_BRACKET_OPEN = '[';
var C_BRACKET_CLOSE = ']';
var C_PAREN_OPEN = '(';
var C_PAREN_CLOSE = ')';
var C_LT = '<';
var C_GT = '>';
var C_TICK = '`';
var C_DOUBLE_QUOTE = '"';
var C_SINGLE_QUOTE = '\'';
/* Map of characters, which can be used to mark link
* and image titles. */
var LINK_MARKERS = {};
LINK_MARKERS[C_DOUBLE_QUOTE] = C_DOUBLE_QUOTE;
LINK_MARKERS[C_SINGLE_QUOTE] = C_SINGLE_QUOTE;
/* Map of characters, which can be used to mark link
* and image titles in commonmark-mode. */
var COMMONMARK_LINK_MARKERS = {};
COMMONMARK_LINK_MARKERS[C_DOUBLE_QUOTE] = C_DOUBLE_QUOTE;
COMMONMARK_LINK_MARKERS[C_SINGLE_QUOTE] = C_SINGLE_QUOTE;
COMMONMARK_LINK_MARKERS[C_PAREN_OPEN] = C_PAREN_CLOSE;
/* Tokenise a link. */
function link(eat, value, silent) {
var self = this;
var subvalue = '';
var index = 0;
var character = value.charAt(0);
var commonmark = self.options.commonmark;
var gfm = self.options.gfm;
var closed;
var count;
var opening;
var beforeURL;
var beforeTitle;
var subqueue;
var hasMarker;
var markers;
var isImage;
var content;
var marker;
var length;
var title;
var depth;
var queue;
var url;
var now;
var exit;
var node;
/* Detect whether this is an image. */
if (character === '!') {
isImage = true;
subvalue = character;
character = value.charAt(++index);
}
/* Eat the opening. */
if (character !== C_BRACKET_OPEN) {
return;
}
/* Exit when this is a link and were already inside
* a link. */
if (!isImage && self.inLink) {
return;
}
subvalue += character;
queue = '';
index++;
/* Eat the content. */
length = value.length;
now = eat.now();
depth = 0;
now.column += index;
now.offset += index;
while (index < length) {
character = value.charAt(index);
subqueue = character;
if (character === C_TICK) {
/* Inline-code in link content. */
count = 1;
while (value.charAt(index + 1) === C_TICK) {
subqueue += character;
index++;
count++;
}
if (!opening) {
opening = count;
} else if (count >= opening) {
opening = 0;
}
} else if (character === C_BACKSLASH) {
/* Allow brackets to be escaped. */
index++;
subqueue += value.charAt(index);
/* In GFM mode, brackets in code still count.
* In all other modes, they dont. This empty
* block prevents the next statements are
* entered. */
} else if ((!opening || gfm) && character === C_BRACKET_OPEN) {
depth++;
} else if ((!opening || gfm) && character === C_BRACKET_CLOSE) {
if (depth) {
depth--;
} else {
/* Allow white-space between content and
* url in GFM mode. */
if (gfm) {
while (index < length) {
character = value.charAt(index + 1);
if (!whitespace(character)) {
break;
}
subqueue += character;
index++;
}
}
if (value.charAt(index + 1) !== C_PAREN_OPEN) {
return;
}
subqueue += C_PAREN_OPEN;
closed = true;
index++;
break;
}
}
queue += subqueue;
subqueue = '';
index++;
}
/* Eat the content closing. */
if (!closed) {
return;
}
content = queue;
subvalue += queue + subqueue;
index++;
/* Eat white-space. */
while (index < length) {
character = value.charAt(index);
if (!whitespace(character)) {
break;
}
subvalue += character;
index++;
}
/* Eat the URL. */
character = value.charAt(index);
markers = commonmark ? COMMONMARK_LINK_MARKERS : LINK_MARKERS;
queue = '';
beforeURL = subvalue;
if (character === C_LT) {
index++;
beforeURL += C_LT;
while (index < length) {
character = value.charAt(index);
if (character === C_GT) {
break;
}
if (commonmark && character === '\n') {
return;
}
queue += character;
index++;
}
if (value.charAt(index) !== C_GT) {
return;
}
subvalue += C_LT + queue + C_GT;
url = queue;
index++;
} else {
character = null;
subqueue = '';
while (index < length) {
character = value.charAt(index);
if (subqueue && has(markers, character)) {
break;
}
if (whitespace(character)) {
if (commonmark) {
break;
}
subqueue += character;
} else {
if (character === C_PAREN_OPEN) {
depth++;
} else if (character === C_PAREN_CLOSE) {
if (depth === 0) {
break;
}
depth--;
}
queue += subqueue;
subqueue = '';
if (character === C_BACKSLASH) {
queue += C_BACKSLASH;
character = value.charAt(++index);
}
queue += character;
}
index++;
}
subvalue += queue;
url = queue;
index = subvalue.length;
}
/* Eat white-space. */
queue = '';
while (index < length) {
character = value.charAt(index);
if (!whitespace(character)) {
break;
}
queue += character;
index++;
}
character = value.charAt(index);
subvalue += queue;
/* Eat the title. */
if (queue && has(markers, character)) {
index++;
subvalue += character;
queue = '';
marker = markers[character];
beforeTitle = subvalue;
/* In commonmark-mode, things are pretty easy: the
* marker cannot occur inside the title.
*
* Non-commonmark does, however, support nested
* delimiters. */
if (commonmark) {
while (index < length) {
character = value.charAt(index);
if (character === marker) {
break;
}
if (character === C_BACKSLASH) {
queue += C_BACKSLASH;
character = value.charAt(++index);
}
index++;
queue += character;
}
character = value.charAt(index);
if (character !== marker) {
return;
}
title = queue;
subvalue += queue + character;
index++;
while (index < length) {
character = value.charAt(index);
if (!whitespace(character)) {
break;
}
subvalue += character;
index++;
}
} else {
subqueue = '';
while (index < length) {
character = value.charAt(index);
if (character === marker) {
if (hasMarker) {
queue += marker + subqueue;
subqueue = '';
}
hasMarker = true;
} else if (!hasMarker) {
queue += character;
} else if (character === C_PAREN_CLOSE) {
subvalue += queue + marker + subqueue;
title = queue;
break;
} else if (whitespace(character)) {
subqueue += character;
} else {
queue += marker + subqueue + character;
subqueue = '';
hasMarker = false;
}
index++;
}
}
}
if (value.charAt(index) !== C_PAREN_CLOSE) {
return;
}
/* istanbul ignore if - never used (yet) */
if (silent) {
return true;
}
subvalue += C_PAREN_CLOSE;
url = self.decode.raw(self.unescape(url), eat(beforeURL).test().end);
if (title) {
beforeTitle = eat(beforeTitle).test().end;
title = self.decode.raw(self.unescape(title), beforeTitle);
}
node = {
type: isImage ? 'image' : 'link',
title: title || null,
url: url
};
if (isImage) {
node.alt = self.decode.raw(self.unescape(content), now) || null;
} else {
exit = self.enterLink();
node.children = self.tokenizeInline(content, now);
exit();
}
return eat(subvalue)(node);
}
/***/ }),
/* 999 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module remark:parse:tokenize:list
* @fileoverview Tokenise a list.
*/
/* eslint-disable max-params */
var trim = __webpack_require__(63);
var repeat = __webpack_require__(190);
var decimal = __webpack_require__(83);
var getIndent = __webpack_require__(325);
var removeIndent = __webpack_require__(1011);
var interrupt = __webpack_require__(188);
module.exports = list;
var C_ASTERISK = '*';
var C_UNDERSCORE = '_';
var C_PLUS = '+';
var C_DASH = '-';
var C_DOT = '.';
var C_SPACE = ' ';
var C_NEWLINE = '\n';
var C_TAB = '\t';
var C_PAREN_CLOSE = ')';
var C_X_LOWER = 'x';
var TAB_SIZE = 4;
var EXPRESSION_LOOSE_LIST_ITEM = /\n\n(?!\s*$)/;
var EXPRESSION_TASK_ITEM = /^\[([ \t]|x|X)][ \t]/;
var EXPRESSION_BULLET = /^([ \t]*)([*+-]|\d+[.)])( {1,4}(?! )| |\t|$|(?=\n))([^\n]*)/;
var EXPRESSION_PEDANTIC_BULLET = /^([ \t]*)([*+-]|\d+[.)])([ \t]+)/;
var EXPRESSION_INITIAL_INDENT = /^( {1,4}|\t)?/gm;
/* Map of characters which can be used to mark
* list-items. */
var LIST_UNORDERED_MARKERS = {};
LIST_UNORDERED_MARKERS[C_ASTERISK] = true;
LIST_UNORDERED_MARKERS[C_PLUS] = true;
LIST_UNORDERED_MARKERS[C_DASH] = true;
/* Map of characters which can be used to mark
* list-items after a digit. */
var LIST_ORDERED_MARKERS = {};
LIST_ORDERED_MARKERS[C_DOT] = true;
/* Map of characters which can be used to mark
* list-items after a digit. */
var LIST_ORDERED_COMMONMARK_MARKERS = {};
LIST_ORDERED_COMMONMARK_MARKERS[C_DOT] = true;
LIST_ORDERED_COMMONMARK_MARKERS[C_PAREN_CLOSE] = true;
/* Tokenise a list. */
function list(eat, value, silent) {
var self = this;
var commonmark = self.options.commonmark;
var pedantic = self.options.pedantic;
var tokenizers = self.blockTokenizers;
var interuptors = self.interruptList;
var markers;
var index = 0;
var length = value.length;
var start = null;
var size = 0;
var queue;
var ordered;
var character;
var marker;
var nextIndex;
var startIndex;
var prefixed;
var currentMarker;
var content;
var line;
var prevEmpty;
var empty;
var items;
var allLines;
var emptyLines;
var item;
var enterTop;
var exitBlockquote;
var isLoose;
var node;
var now;
var end;
var indented;
while (index < length) {
character = value.charAt(index);
if (character === C_TAB) {
size += TAB_SIZE - (size % TAB_SIZE);
} else if (character === C_SPACE) {
size++;
} else {
break;
}
index++;
}
if (size >= TAB_SIZE) {
return;
}
character = value.charAt(index);
markers = commonmark ?
LIST_ORDERED_COMMONMARK_MARKERS :
LIST_ORDERED_MARKERS;
if (LIST_UNORDERED_MARKERS[character] === true) {
marker = character;
ordered = false;
} else {
ordered = true;
queue = '';
while (index < length) {
character = value.charAt(index);
if (!decimal(character)) {
break;
}
queue += character;
index++;
}
character = value.charAt(index);
if (!queue || markers[character] !== true) {
return;
}
start = parseInt(queue, 10);
marker = character;
}
character = value.charAt(++index);
if (character !== C_SPACE && character !== C_TAB) {
return;
}
if (silent) {
return true;
}
index = 0;
items = [];
allLines = [];
emptyLines = [];
while (index < length) {
nextIndex = value.indexOf(C_NEWLINE, index);
startIndex = index;
prefixed = false;
indented = false;
if (nextIndex === -1) {
nextIndex = length;
}
end = index + TAB_SIZE;
size = 0;
while (index < length) {
character = value.charAt(index);
if (character === C_TAB) {
size += TAB_SIZE - (size % TAB_SIZE);
} else if (character === C_SPACE) {
size++;
} else {
break;
}
index++;
}
if (size >= TAB_SIZE) {
indented = true;
}
if (item && size >= item.indent) {
indented = true;
}
character = value.charAt(index);
currentMarker = null;
if (!indented) {
if (LIST_UNORDERED_MARKERS[character] === true) {
currentMarker = character;
index++;
size++;
} else {
queue = '';
while (index < length) {
character = value.charAt(index);
if (!decimal(character)) {
break;
}
queue += character;
index++;
}
character = value.charAt(index);
index++;
if (queue && markers[character] === true) {
currentMarker = character;
size += queue.length + 1;
}
}
if (currentMarker) {
character = value.charAt(index);
if (character === C_TAB) {
size += TAB_SIZE - (size % TAB_SIZE);
index++;
} else if (character === C_SPACE) {
end = index + TAB_SIZE;
while (index < end) {
if (value.charAt(index) !== C_SPACE) {
break;
}
index++;
size++;
}
if (index === end && value.charAt(index) === C_SPACE) {
index -= TAB_SIZE - 1;
size -= TAB_SIZE - 1;
}
} else if (character !== C_NEWLINE && character !== '') {
currentMarker = null;
}
}
}
if (currentMarker) {
if (!pedantic && marker !== currentMarker) {
break;
}
prefixed = true;
} else {
if (!commonmark && !indented && value.charAt(startIndex) === C_SPACE) {
indented = true;
} else if (commonmark && item) {
indented = size >= item.indent || size > TAB_SIZE;
}
prefixed = false;
index = startIndex;
}
line = value.slice(startIndex, nextIndex);
content = startIndex === index ? line : value.slice(index, nextIndex);
if (
currentMarker === C_ASTERISK ||
currentMarker === C_UNDERSCORE ||
currentMarker === C_DASH
) {
if (tokenizers.thematicBreak.call(self, eat, line, true)) {
break;
}
}
prevEmpty = empty;
empty = !trim(content).length;
if (indented && item) {
item.value = item.value.concat(emptyLines, line);
allLines = allLines.concat(emptyLines, line);
emptyLines = [];
} else if (prefixed) {
if (emptyLines.length !== 0) {
item.value.push('');
item.trail = emptyLines.concat();
}
item = {
value: [line],
indent: size,
trail: []
};
items.push(item);
allLines = allLines.concat(emptyLines, line);
emptyLines = [];
} else if (empty) {
if (prevEmpty) {
break;
}
emptyLines.push(line);
} else {
if (prevEmpty) {
break;
}
if (interrupt(interuptors, tokenizers, self, [eat, line, true])) {
break;
}
item.value = item.value.concat(emptyLines, line);
allLines = allLines.concat(emptyLines, line);
emptyLines = [];
}
index = nextIndex + 1;
}
node = eat(allLines.join(C_NEWLINE)).reset({
type: 'list',
ordered: ordered,
start: start,
loose: null,
children: []
});
enterTop = self.enterList();
exitBlockquote = self.enterBlock();
isLoose = false;
index = -1;
length = items.length;
while (++index < length) {
item = items[index].value.join(C_NEWLINE);
now = eat.now();
item = eat(item)(listItem(self, item, now), node);
if (item.loose) {
isLoose = true;
}
item = items[index].trail.join(C_NEWLINE);
if (index !== length - 1) {
item += C_NEWLINE;
}
eat(item);
}
enterTop();
exitBlockquote();
node.loose = isLoose;
return node;
}
/**
* Create a list-item node.
*
* @example
* listItem('- _foo_', now());
*
* @param {Object} ctx - Parser.
* @param {Object} value - List-item.
* @param {Object} position - List-item location.
* @return {Object} - `listItem` node.
*/
function listItem(ctx, value, position) {
var offsets = ctx.offset;
var fn = ctx.options.pedantic ? pedanticListItem : normalListItem;
var checked = null;
var task;
var indent;
value = fn.apply(null, arguments);
if (ctx.options.gfm) {
task = value.match(EXPRESSION_TASK_ITEM);
if (task) {
indent = task[0].length;
checked = task[1].toLowerCase() === C_X_LOWER;
offsets[position.line] += indent;
value = value.slice(indent);
}
}
return {
type: 'listItem',
loose: EXPRESSION_LOOSE_LIST_ITEM.test(value) ||
value.charAt(value.length - 1) === C_NEWLINE,
checked: checked,
children: ctx.tokenizeBlock(value, position)
};
}
/* Create a list-item using overly simple mechanics. */
function pedanticListItem(ctx, value, position) {
var offsets = ctx.offset;
var line = position.line;
/* Remove the list-items bullet. */
value = value.replace(EXPRESSION_PEDANTIC_BULLET, replacer);
/* The initial line was also matched by the below, so
* we reset the `line`. */
line = position.line;
return value.replace(EXPRESSION_INITIAL_INDENT, replacer);
/* A simple replacer which removed all matches,
* and adds their length to `offset`. */
function replacer($0) {
offsets[line] = (offsets[line] || 0) + $0.length;
line++;
return '';
}
}
/* Create a list-item using sane mechanics. */
function normalListItem(ctx, value, position) {
var offsets = ctx.offset;
var line = position.line;
var max;
var bullet;
var rest;
var lines;
var trimmedLines;
var index;
var length;
/* Remove the list-items bullet. */
value = value.replace(EXPRESSION_BULLET, replacer);
lines = value.split(C_NEWLINE);
trimmedLines = removeIndent(value, getIndent(max).indent).split(C_NEWLINE);
/* We replaced the initial bullet with something
* else above, which was used to trick
* `removeIndentation` into removing some more
* characters when possible. However, that could
* result in the initial line to be stripped more
* than it should be. */
trimmedLines[0] = rest;
offsets[line] = (offsets[line] || 0) + bullet.length;
line++;
index = 0;
length = lines.length;
while (++index < length) {
offsets[line] = (offsets[line] || 0) +
lines[index].length - trimmedLines[index].length;
line++;
}
return trimmedLines.join(C_NEWLINE);
function replacer($0, $1, $2, $3, $4) {
bullet = $1 + $2 + $3;
rest = $4;
/* Make sure that the first nine numbered list items
* can indent with an extra space. That is, when
* the bullet did not receive an extra final space. */
if (Number($2) < 10 && bullet.length % 2 === 1) {
$2 = C_SPACE + $2;
}
max = $1 + repeat(C_SPACE, $2.length) + $3;
return max + rest;
}
}
/***/ }),
/* 1000 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module remark:parse:tokenize:newline
* @fileoverview Tokenise a newline.
*/
var whitespace = __webpack_require__(24);
module.exports = newline;
/* Tokenise newline. */
function newline(eat, value, silent) {
var character = value.charAt(0);
var length;
var subvalue;
var queue;
var index;
if (character !== '\n') {
return;
}
/* istanbul ignore if - never used (yet) */
if (silent) {
return true;
}
index = 1;
length = value.length;
subvalue = character;
queue = '';
while (index < length) {
character = value.charAt(index);
if (!whitespace(character)) {
break;
}
queue += character;
if (character === '\n') {
subvalue += queue;
queue = '';
}
index++;
}
eat(subvalue);
}
/***/ }),
/* 1001 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module remark:parse:tokenize:paragraph
* @fileoverview Tokenise a paragraph.
*/
var trim = __webpack_require__(63);
var decimal = __webpack_require__(83);
var trimTrailingLines = __webpack_require__(191);
var interrupt = __webpack_require__(188);
module.exports = paragraph;
var C_NEWLINE = '\n';
var C_TAB = '\t';
var C_SPACE = ' ';
var TAB_SIZE = 4;
/* Tokenise paragraph. */
function paragraph(eat, value, silent) {
var self = this;
var settings = self.options;
var commonmark = settings.commonmark;
var gfm = settings.gfm;
var tokenizers = self.blockTokenizers;
var interruptors = self.interruptParagraph;
var index = value.indexOf(C_NEWLINE);
var length = value.length;
var position;
var subvalue;
var character;
var size;
var now;
while (index < length) {
/* Eat everything if theres no following newline. */
if (index === -1) {
index = length;
break;
}
/* Stop if the next character is NEWLINE. */
if (value.charAt(index + 1) === C_NEWLINE) {
break;
}
/* In commonmark-mode, following indented lines
* are part of the paragraph. */
if (commonmark) {
size = 0;
position = index + 1;
while (position < length) {
character = value.charAt(position);
if (character === C_TAB) {
size = TAB_SIZE;
break;
} else if (character === C_SPACE) {
size++;
} else {
break;
}
position++;
}
if (size >= TAB_SIZE) {
index = value.indexOf(C_NEWLINE, index + 1);
continue;
}
}
subvalue = value.slice(index + 1);
/* Check if the following code contains a possible
* block. */
if (interrupt(interruptors, tokenizers, self, [eat, subvalue, true])) {
break;
}
/* Break if the following line starts a list, when
* already in a list, or when in commonmark, or when
* in gfm mode and the bullet is *not* numeric. */
if (
tokenizers.list.call(self, eat, subvalue, true) &&
(
self.inList ||
commonmark ||
(gfm && !decimal(trim.left(subvalue).charAt(0)))
)
) {
break;
}
position = index;
index = value.indexOf(C_NEWLINE, index + 1);
if (index !== -1 && trim(value.slice(position, index)) === '') {
index = position;
break;
}
}
subvalue = value.slice(0, index);
if (trim(subvalue) === '') {
eat(subvalue);
return null;
}
/* istanbul ignore if - never used (yet) */
if (silent) {
return true;
}
now = eat.now();
subvalue = trimTrailingLines(subvalue);
return eat(subvalue)({
type: 'paragraph',
children: self.tokenizeInline(subvalue, now)
});
}
/***/ }),
/* 1002 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module remark:parse:tokenize:reference
* @fileoverview Tokenise a reference.
*/
var whitespace = __webpack_require__(24);
var locate = __webpack_require__(323);
var normalize = __webpack_require__(189);
module.exports = reference;
reference.locator = locate;
var T_LINK = 'link';
var T_IMAGE = 'image';
var T_FOOTNOTE = 'footnote';
var REFERENCE_TYPE_SHORTCUT = 'shortcut';
var REFERENCE_TYPE_COLLAPSED = 'collapsed';
var REFERENCE_TYPE_FULL = 'full';
var C_CARET = '^';
var C_BACKSLASH = '\\';
var C_BRACKET_OPEN = '[';
var C_BRACKET_CLOSE = ']';
/* Tokenise a reference. */
function reference(eat, value, silent) {
var self = this;
var character = value.charAt(0);
var index = 0;
var length = value.length;
var subvalue = '';
var intro = '';
var type = T_LINK;
var referenceType = REFERENCE_TYPE_SHORTCUT;
var content;
var identifier;
var now;
var node;
var exit;
var queue;
var bracketed;
var depth;
/* Check whether were eating an image. */
if (character === '!') {
type = T_IMAGE;
intro = character;
character = value.charAt(++index);
}
if (character !== C_BRACKET_OPEN) {
return;
}
index++;
intro += character;
queue = '';
/* Check whether were eating a footnote. */
if (
self.options.footnotes &&
type === T_LINK &&
value.charAt(index) === C_CARET
) {
intro += C_CARET;
index++;
type = T_FOOTNOTE;
}
/* Eat the text. */
depth = 0;
while (index < length) {
character = value.charAt(index);
if (character === C_BRACKET_OPEN) {
bracketed = true;
depth++;
} else if (character === C_BRACKET_CLOSE) {
if (!depth) {
break;
}
depth--;
}
if (character === C_BACKSLASH) {
queue += C_BACKSLASH;
character = value.charAt(++index);
}
queue += character;
index++;
}
subvalue = queue;
content = queue;
character = value.charAt(index);
if (character !== C_BRACKET_CLOSE) {
return;
}
index++;
subvalue += character;
queue = '';
while (index < length) {
character = value.charAt(index);
if (!whitespace(character)) {
break;
}
queue += character;
index++;
}
character = value.charAt(index);
if (character === C_BRACKET_OPEN) {
identifier = '';
queue += character;
index++;
while (index < length) {
character = value.charAt(index);
if (character === C_BRACKET_OPEN || character === C_BRACKET_CLOSE) {
break;
}
if (character === C_BACKSLASH) {
identifier += C_BACKSLASH;
character = value.charAt(++index);
}
identifier += character;
index++;
}
character = value.charAt(index);
if (character === C_BRACKET_CLOSE) {
referenceType = identifier ? REFERENCE_TYPE_FULL : REFERENCE_TYPE_COLLAPSED;
queue += identifier + character;
index++;
} else {
identifier = '';
}
subvalue += queue;
queue = '';
} else {
if (!content) {
return;
}
identifier = content;
}
/* Brackets cannot be inside the identifier. */
if (referenceType !== REFERENCE_TYPE_FULL && bracketed) {
return;
}
/* Inline footnotes cannot have an identifier. */
if (type === T_FOOTNOTE && referenceType !== REFERENCE_TYPE_SHORTCUT) {
type = T_LINK;
intro = C_BRACKET_OPEN + C_CARET;
content = C_CARET + content;
}
subvalue = intro + subvalue;
if (type === T_LINK && self.inLink) {
return null;
}
/* istanbul ignore if - never used (yet) */
if (silent) {
return true;
}
if (type === T_FOOTNOTE && content.indexOf(' ') !== -1) {
return eat(subvalue)({
type: 'footnote',
children: this.tokenizeInline(content, eat.now())
});
}
now = eat.now();
now.column += intro.length;
now.offset += intro.length;
identifier = referenceType === REFERENCE_TYPE_FULL ? identifier : content;
node = {
type: type + 'Reference',
identifier: normalize(identifier)
};
if (type === T_LINK || type === T_IMAGE) {
node.referenceType = referenceType;
}
if (type === T_LINK) {
exit = self.enterLink();
node.children = self.tokenizeInline(content, now);
exit();
} else if (type === T_IMAGE) {
node.alt = self.decode.raw(self.unescape(content), now) || null;
}
return eat(subvalue)(node);
}
/***/ }),
/* 1003 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module remark:parse:tokenize:strong
* @fileoverview Tokenise strong.
*/
var trim = __webpack_require__(63);
var whitespace = __webpack_require__(24);
var locate = __webpack_require__(978);
module.exports = strong;
strong.locator = locate;
var C_ASTERISK = '*';
var C_UNDERSCORE = '_';
/* Tokenise strong. */
function strong(eat, value, silent) {
var self = this;
var index = 0;
var character = value.charAt(index);
var now;
var pedantic;
var marker;
var queue;
var subvalue;
var length;
var prev;
if (
(character !== C_ASTERISK && character !== C_UNDERSCORE) ||
value.charAt(++index) !== character
) {
return;
}
pedantic = self.options.pedantic;
marker = character;
subvalue = marker + marker;
length = value.length;
index++;
queue = '';
character = '';
if (pedantic && whitespace(value.charAt(index))) {
return;
}
while (index < length) {
prev = character;
character = value.charAt(index);
if (
character === marker &&
value.charAt(index + 1) === marker &&
(!pedantic || !whitespace(prev))
) {
character = value.charAt(index + 2);
if (character !== marker) {
if (!trim(queue)) {
return;
}
/* istanbul ignore if - never used (yet) */
if (silent) {
return true;
}
now = eat.now();
now.column += 2;
now.offset += 2;
return eat(subvalue + queue + subvalue)({
type: 'strong',
children: self.tokenizeInline(queue, now)
});
}
}
if (!pedantic && character === '\\') {
queue += character;
character = value.charAt(++index);
}
queue += character;
index++;
}
}
/***/ }),
/* 1004 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module remark:parse:tokenize:table
* @fileoverview Tokenise a table.
*/
var whitespace = __webpack_require__(24);
module.exports = table;
table.notInList = true;
var C_BACKSLASH = '\\';
var C_TICK = '`';
var C_DASH = '-';
var C_PIPE = '|';
var C_COLON = ':';
var C_SPACE = ' ';
var C_NEWLINE = '\n';
var C_TAB = '\t';
var MIN_TABLE_COLUMNS = 1;
var MIN_TABLE_ROWS = 2;
var TABLE_ALIGN_LEFT = 'left';
var TABLE_ALIGN_CENTER = 'center';
var TABLE_ALIGN_RIGHT = 'right';
var TABLE_ALIGN_NONE = null;
/* Tokenise a table. */
function table(eat, value, silent) {
var self = this;
var index;
var alignments;
var alignment;
var subvalue;
var row;
var length;
var lines;
var queue;
var character;
var hasDash;
var align;
var cell;
var preamble;
var count;
var opening;
var now;
var position;
var lineCount;
var line;
var rows;
var table;
var lineIndex;
var pipeIndex;
var first;
/* Exit when not in gfm-mode. */
if (!self.options.gfm) {
return;
}
/* Get the rows.
* Detecting tables soon is hard, so there are some
* checks for performance here, such as the minimum
* number of rows, and allowed characters in the
* alignment row. */
index = 0;
lineCount = 0;
length = value.length + 1;
lines = [];
while (index < length) {
lineIndex = value.indexOf(C_NEWLINE, index);
pipeIndex = value.indexOf(C_PIPE, index + 1);
if (lineIndex === -1) {
lineIndex = value.length;
}
if (pipeIndex === -1 || pipeIndex > lineIndex) {
if (lineCount < MIN_TABLE_ROWS) {
return;
}
break;
}
lines.push(value.slice(index, lineIndex));
lineCount++;
index = lineIndex + 1;
}
/* Parse the alignment row. */
subvalue = lines.join(C_NEWLINE);
alignments = lines.splice(1, 1)[0] || [];
index = 0;
length = alignments.length;
lineCount--;
alignment = false;
align = [];
while (index < length) {
character = alignments.charAt(index);
if (character === C_PIPE) {
hasDash = null;
if (alignment === false) {
if (first === false) {
return;
}
} else {
align.push(alignment);
alignment = false;
}
first = false;
} else if (character === C_DASH) {
hasDash = true;
alignment = alignment || TABLE_ALIGN_NONE;
} else if (character === C_COLON) {
if (alignment === TABLE_ALIGN_LEFT) {
alignment = TABLE_ALIGN_CENTER;
} else if (hasDash && alignment === TABLE_ALIGN_NONE) {
alignment = TABLE_ALIGN_RIGHT;
} else {
alignment = TABLE_ALIGN_LEFT;
}
} else if (!whitespace(character)) {
return;
}
index++;
}
if (alignment !== false) {
align.push(alignment);
}
/* Exit when without enough columns. */
if (align.length < MIN_TABLE_COLUMNS) {
return;
}
/* istanbul ignore if - never used (yet) */
if (silent) {
return true;
}
/* Parse the rows. */
position = -1;
rows = [];
table = eat(subvalue).reset({
type: 'table',
align: align,
children: rows
});
while (++position < lineCount) {
line = lines[position];
row = {type: 'tableRow', children: []};
/* Eat a newline character when this is not the
* first row. */
if (position) {
eat(C_NEWLINE);
}
/* Eat the row. */
eat(line).reset(row, table);
length = line.length + 1;
index = 0;
queue = '';
cell = '';
preamble = true;
count = null;
opening = null;
while (index < length) {
character = line.charAt(index);
if (character === C_TAB || character === C_SPACE) {
if (cell) {
queue += character;
} else {
eat(character);
}
index++;
continue;
}
if (character === '' || character === C_PIPE) {
if (preamble) {
eat(character);
} else {
if (character && opening) {
queue += character;
index++;
continue;
}
if ((cell || character) && !preamble) {
subvalue = cell;
if (queue.length > 1) {
if (character) {
subvalue += queue.slice(0, queue.length - 1);
queue = queue.charAt(queue.length - 1);
} else {
subvalue += queue;
queue = '';
}
}
now = eat.now();
eat(subvalue)({
type: 'tableCell',
children: self.tokenizeInline(cell, now)
}, row);
}
eat(queue + character);
queue = '';
cell = '';
}
} else {
if (queue) {
cell += queue;
queue = '';
}
cell += character;
if (character === C_BACKSLASH && index !== length - 2) {
cell += line.charAt(index + 1);
index++;
}
if (character === C_TICK) {
count = 1;
while (line.charAt(index + 1) === character) {
cell += character;
index++;
count++;
}
if (!opening) {
opening = count;
} else if (count >= opening) {
opening = 0;
}
}
}
preamble = false;
index++;
}
/* Eat the alignment row. */
if (!position) {
eat(C_NEWLINE + alignments);
}
}
return table;
}
/***/ }),
/* 1005 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module remark:parse:tokenize:text
* @fileoverview Tokenise text.
*/
module.exports = text;
/* Tokenise text. */
function text(eat, value, silent) {
var self = this;
var methods;
var tokenizers;
var index;
var length;
var subvalue;
var position;
var tokenizer;
var name;
var min;
var now;
/* istanbul ignore if - never used (yet) */
if (silent) {
return true;
}
methods = self.inlineMethods;
length = methods.length;
tokenizers = self.inlineTokenizers;
index = -1;
min = value.length;
while (++index < length) {
name = methods[index];
if (name === 'text' || !tokenizers[name]) {
continue;
}
tokenizer = tokenizers[name].locator;
if (!tokenizer) {
eat.file.fail('Missing locator: `' + name + '`');
}
position = tokenizer.call(self, value, 1);
if (position !== -1 && position < min) {
min = position;
}
}
subvalue = value.slice(0, min);
now = eat.now();
self.decode(subvalue, now, function (content, position, source) {
eat(source || content)({
type: 'text',
value: content
});
});
}
/***/ }),
/* 1006 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module remark:parse:tokenize:thematic-break
* @fileoverview Tokenise a thematic break.
*/
module.exports = thematicBreak;
var C_NEWLINE = '\n';
var C_TAB = '\t';
var C_SPACE = ' ';
var C_ASTERISK = '*';
var C_UNDERSCORE = '_';
var C_DASH = '-';
var THEMATIC_BREAK_MARKER_COUNT = 3;
/* Tokenise a thematic break. */
function thematicBreak(eat, value, silent) {
var index = -1;
var length = value.length + 1;
var subvalue = '';
var character;
var marker;
var markerCount;
var queue;
while (++index < length) {
character = value.charAt(index);
if (character !== C_TAB && character !== C_SPACE) {
break;
}
subvalue += character;
}
if (
character !== C_ASTERISK &&
character !== C_DASH &&
character !== C_UNDERSCORE
) {
return;
}
marker = character;
subvalue += character;
markerCount = 1;
queue = '';
while (++index < length) {
character = value.charAt(index);
if (character === marker) {
markerCount++;
subvalue += queue + marker;
queue = '';
} else if (character === C_SPACE) {
queue += character;
} else if (
markerCount >= THEMATIC_BREAK_MARKER_COUNT &&
(!character || character === C_NEWLINE)
) {
subvalue += queue;
if (silent) {
return true;
}
return eat(subvalue)({type: 'thematicBreak'});
} else {
return;
}
}
}
/***/ }),
/* 1007 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module remark:parse:tokenize:url
* @fileoverview Tokenise a URL.
*/
var decode = __webpack_require__(160);
var whitespace = __webpack_require__(24);
var locate = __webpack_require__(979);
module.exports = url;
url.locator = locate;
url.notInLink = true;
var C_BRACKET_OPEN = '[';
var C_BRACKET_CLOSE = ']';
var C_PAREN_OPEN = '(';
var C_PAREN_CLOSE = ')';
var C_LT = '<';
var C_AT_SIGN = '@';
var HTTP_PROTOCOL = 'http://';
var HTTPS_PROTOCOL = 'https://';
var MAILTO_PROTOCOL = 'mailto:';
var PROTOCOLS = [
HTTP_PROTOCOL,
HTTPS_PROTOCOL,
MAILTO_PROTOCOL
];
var PROTOCOLS_LENGTH = PROTOCOLS.length;
/* Tokenise a URL. */
function url(eat, value, silent) {
var self = this;
var subvalue;
var content;
var character;
var index;
var position;
var protocol;
var match;
var length;
var queue;
var parenCount;
var nextCharacter;
var exit;
if (!self.options.gfm) {
return;
}
subvalue = '';
index = -1;
length = PROTOCOLS_LENGTH;
while (++index < length) {
protocol = PROTOCOLS[index];
match = value.slice(0, protocol.length);
if (match.toLowerCase() === protocol) {
subvalue = match;
break;
}
}
if (!subvalue) {
return;
}
index = subvalue.length;
length = value.length;
queue = '';
parenCount = 0;
while (index < length) {
character = value.charAt(index);
if (whitespace(character) || character === C_LT) {
break;
}
if (
character === '.' ||
character === ',' ||
character === ':' ||
character === ';' ||
character === '"' ||
character === '\'' ||
character === ')' ||
character === ']'
) {
nextCharacter = value.charAt(index + 1);
if (!nextCharacter || whitespace(nextCharacter)) {
break;
}
}
if (character === C_PAREN_OPEN || character === C_BRACKET_OPEN) {
parenCount++;
}
if (character === C_PAREN_CLOSE || character === C_BRACKET_CLOSE) {
parenCount--;
if (parenCount < 0) {
break;
}
}
queue += character;
index++;
}
if (!queue) {
return;
}
subvalue += queue;
content = subvalue;
if (protocol === MAILTO_PROTOCOL) {
position = queue.indexOf(C_AT_SIGN);
if (position === -1 || position === length - 1) {
return;
}
content = content.substr(MAILTO_PROTOCOL.length);
}
/* istanbul ignore if - never used (yet) */
if (silent) {
return true;
}
exit = self.enterLink();
content = self.tokenizeInline(content, eat.now());
exit();
return eat(subvalue)({
type: 'link',
title: null,
url: decode(subvalue),
children: content
});
}
/***/ }),
/* 1008 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module remark:parse:tokenize:yaml
* @fileoverview Tokenise YAML.
*/
module.exports = yaml;
yaml.onlyAtStart = true;
var FENCE = '---';
var C_DASH = '-';
var C_NEWLINE = '\n';
/* Tokenise YAML. */
function yaml(eat, value, silent) {
var self = this;
var subvalue;
var content;
var index;
var length;
var character;
var queue;
if (
!self.options.yaml ||
value.charAt(0) !== C_DASH ||
value.charAt(1) !== C_DASH ||
value.charAt(2) !== C_DASH ||
value.charAt(3) !== C_NEWLINE
) {
return;
}
subvalue = FENCE + C_NEWLINE;
content = '';
queue = '';
index = 3;
length = value.length;
while (++index < length) {
character = value.charAt(index);
if (
character === C_DASH &&
(queue || !content) &&
value.charAt(index + 1) === C_DASH &&
value.charAt(index + 2) === C_DASH
) {
/* istanbul ignore if - never used (yet) */
if (silent) {
return true;
}
subvalue += queue + FENCE;
return eat(subvalue)({
type: 'yaml',
value: content
});
}
if (character === C_NEWLINE) {
queue += character;
} else {
subvalue += queue + character;
content += queue + character;
queue = '';
}
}
}
/***/ }),
/* 1009 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module remark:parse:tokenizer
* @fileoverview Markdown tokenizer.
*/
module.exports = factory;
var MERGEABLE_NODES = {
text: mergeText,
blockquote: mergeBlockquote
};
/* Check whether a node is mergeable with adjacent nodes. */
function mergeable(node) {
var start;
var end;
if (node.type !== 'text' || !node.position) {
return true;
}
start = node.position.start;
end = node.position.end;
/* Only merge nodes which occupy the same size as their
* `value`. */
return start.line !== end.line ||
end.column - start.column === node.value.length;
}
/* Merge two text nodes: `node` into `prev`. */
function mergeText(prev, node) {
prev.value += node.value;
return prev;
}
/* Merge two blockquotes: `node` into `prev`, unless in
* CommonMark mode. */
function mergeBlockquote(prev, node) {
if (this.options.commonmark) {
return node;
}
prev.children = prev.children.concat(node.children);
return prev;
}
/* Construct a tokenizer. This creates both
* `tokenizeInline` and `tokenizeBlock`. */
function factory(type) {
return tokenize;
/* Tokenizer for a bound `type`. */
function tokenize(value, location) {
var self = this;
var offset = self.offset;
var tokens = [];
var methods = self[type + 'Methods'];
var tokenizers = self[type + 'Tokenizers'];
var line = location.line;
var column = location.column;
var index;
var length;
var method;
var name;
var matched;
var valueLength;
/* Trim white space only lines. */
if (!value) {
return tokens;
}
/* Expose on `eat`. */
eat.now = now;
eat.file = self.file;
/* Sync initial offset. */
updatePosition('');
/* Iterate over `value`, and iterate over all
* tokenizers. When one eats something, re-iterate
* with the remaining value. If no tokenizer eats,
* something failed (should not happen) and an
* exception is thrown. */
while (value) {
index = -1;
length = methods.length;
matched = false;
while (++index < length) {
name = methods[index];
method = tokenizers[name];
if (
method &&
(!method.onlyAtStart || self.atStart) &&
(!method.notInList || !self.inList) &&
(!method.notInBlock || !self.inBlock) &&
(!method.notInLink || !self.inLink)
) {
valueLength = value.length;
method.apply(self, [eat, value]);
matched = valueLength !== value.length;
if (matched) {
break;
}
}
}
/* istanbul ignore if */
if (!matched) {
self.file.fail(new Error('Infinite loop'), eat.now());
}
}
self.eof = now();
return tokens;
/**
* Update line, column, and offset based on
* `value`.
*
* @example
* updatePosition('foo');
*
* @param {string} subvalue - Subvalue to eat.
*/
function updatePosition(subvalue) {
var lastIndex = -1;
var index = subvalue.indexOf('\n');
while (index !== -1) {
line++;
lastIndex = index;
index = subvalue.indexOf('\n', index + 1);
}
if (lastIndex === -1) {
column += subvalue.length;
} else {
column = subvalue.length - lastIndex;
}
if (line in offset) {
if (lastIndex !== -1) {
column += offset[line];
} else if (column <= offset[line]) {
column = offset[line] + 1;
}
}
}
/**
* Get offset. Called before the first character is
* eaten to retrieve the range's offsets.
*
* @return {Function} - `done`, to be called when
* the last character is eaten.
*/
function getOffset() {
var indentation = [];
var pos = line + 1;
/**
* Done. Called when the last character is
* eaten to retrieve the ranges offsets.
*
* @return {Array.<number>} - Offset.
*/
return function () {
var last = line + 1;
while (pos < last) {
indentation.push((offset[pos] || 0) + 1);
pos++;
}
return indentation;
};
}
/**
* Get the current position.
*
* @example
* position = now(); // {line: 1, column: 1, offset: 0}
*
* @return {Object} - Current Position.
*/
function now() {
var pos = {line: line, column: column};
pos.offset = self.toOffset(pos);
return pos;
}
/**
* Store position information for a node.
*
* @example
* start = now();
* updatePosition('foo');
* location = new Position(start);
* // {
* // start: {line: 1, column: 1, offset: 0},
* // end: {line: 1, column: 3, offset: 2}
* // }
*
* @param {Object} start - Starting position.
*/
function Position(start) {
this.start = start;
this.end = now();
}
/**
* Throw when a value is incorrectly eaten.
* This shouldnt happen but will throw on new,
* incorrect rules.
*
* @example
* // When the current value is set to `foo bar`.
* validateEat('foo');
* eat('foo');
*
* validateEat('bar');
* // throws, because the space is not eaten.
*
* @param {string} subvalue - Value to be eaten.
* @throws {Error} - When `subvalue` cannot be eaten.
*/
function validateEat(subvalue) {
/* istanbul ignore if */
if (value.substring(0, subvalue.length) !== subvalue) {
/* Capture stack-trace. */
self.file.fail(
new Error(
'Incorrectly eaten value: please report this ' +
'warning on http://git.io/vg5Ft'
),
now()
);
}
}
/**
* Mark position and patch `node.position`.
*
* @example
* var update = position();
* updatePosition('foo');
* update({});
* // {
* // position: {
* // start: {line: 1, column: 1, offset: 0},
* // end: {line: 1, column: 3, offset: 2}
* // }
* // }
*
* @returns {Function} - Updater.
*/
function position() {
var before = now();
return update;
/**
* Add the position to a node.
*
* @example
* update({type: 'text', value: 'foo'});
*
* @param {Node} node - Node to attach position
* on.
* @param {Array} [indent] - Indentation for
* `node`.
* @return {Node} - `node`.
*/
function update(node, indent) {
var prev = node.position;
var start = prev ? prev.start : before;
var combined = [];
var n = prev && prev.end.line;
var l = before.line;
node.position = new Position(start);
/* If there was already a `position`, this
* node was merged. Fixing `start` wasnt
* hard, but the indent is different.
* Especially because some information, the
* indent between `n` and `l` wasnt
* tracked. Luckily, that space is
* (should be?) empty, so we can safely
* check for it now. */
if (prev && indent && prev.indent) {
combined = prev.indent;
if (n < l) {
while (++n < l) {
combined.push((offset[n] || 0) + 1);
}
combined.push(before.column);
}
indent = combined.concat(indent);
}
node.position.indent = indent || [];
return node;
}
}
/**
* Add `node` to `parent`s children or to `tokens`.
* Performs merges where possible.
*
* @example
* add({});
*
* add({}, {children: []});
*
* @param {Object} node - Node to add.
* @param {Object} [parent] - Parent to insert into.
* @return {Object} - Added or merged into node.
*/
function add(node, parent) {
var children = parent ? parent.children : tokens;
var prev = children[children.length - 1];
if (
prev &&
node.type === prev.type &&
node.type in MERGEABLE_NODES &&
mergeable(prev) &&
mergeable(node)
) {
node = MERGEABLE_NODES[node.type].call(self, prev, node);
}
if (node !== prev) {
children.push(node);
}
if (self.atStart && tokens.length !== 0) {
self.exitStart();
}
return node;
}
/**
* Remove `subvalue` from `value`.
* `subvalue` must be at the start of `value`.
*
* @example
* eat('foo')({type: 'text', value: 'foo'});
*
* @param {string} subvalue - Removed from `value`,
* and passed to `updatePosition`.
* @return {Function} - Wrapper around `add`, which
* also adds `position` to node.
*/
function eat(subvalue) {
var indent = getOffset();
var pos = position();
var current = now();
validateEat(subvalue);
apply.reset = reset;
reset.test = test;
apply.test = test;
value = value.substring(subvalue.length);
updatePosition(subvalue);
indent = indent();
return apply;
/**
* Add the given arguments, add `position` to
* the returned node, and return the node.
*
* @param {Object} node - Node to add.
* @param {Object} [parent] - Node to insert into.
* @return {Node} - Added node.
*/
function apply(node, parent) {
return pos(add(pos(node), parent), indent);
}
/**
* Functions just like apply, but resets the
* content: the line and column are reversed,
* and the eaten value is re-added.
*
* This is useful for nodes with a single
* type of content, such as lists and tables.
*
* See `apply` above for what parameters are
* expected.
*
* @return {Node} - Added node.
*/
function reset() {
var node = apply.apply(null, arguments);
line = current.line;
column = current.column;
value = subvalue + value;
return node;
}
/**
* Test the position, after eating, and reverse
* to a not-eaten state.
*
* @return {Position} - Position after eating `subvalue`.
*/
function test() {
var result = pos({});
line = current.line;
column = current.column;
value = subvalue + value;
return result.position;
}
}
}
}
/***/ }),
/* 1010 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module remark:parse:unescape
* @fileoverview Unescape escapes.
*/
/* Expose. */
module.exports = factory;
/* Factory to de-escape a value, based on a list at `key`
* in `ctx`. */
function factory(ctx, key) {
return unescape;
/* De-escape a string using the expression at `key`
* in `ctx`. */
function unescape(value) {
var prev = 0;
var index = value.indexOf('\\');
var escape = ctx[key];
var queue = [];
var character;
while (index !== -1) {
queue.push(value.slice(prev, index));
prev = index + 1;
character = value.charAt(prev);
/* If the following character is not a valid escape,
* add the slash. */
if (!character || escape.indexOf(character) === -1) {
queue.push('\\');
}
index = value.indexOf('\\', prev);
}
queue.push(value.slice(prev));
return queue.join('');
}
}
/***/ }),
/* 1011 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module remark:parse:util:remove-indentation
* @fileoverview Remove indentation.
*/
/* Dependencies. */
var trim = __webpack_require__(63);
var repeat = __webpack_require__(190);
var getIndent = __webpack_require__(325);
/* Expose. */
module.exports = indentation;
/* Characters. */
var C_SPACE = ' ';
var C_NEWLINE = '\n';
var C_TAB = '\t';
/**
* Remove the minimum indent from every line in `value`.
* Supports both tab, spaced, and mixed indentation (as
* well as possible).
*
* @example
* removeIndentation(' foo'); // 'foo'
* removeIndentation(' foo', 2); // ' foo'
* removeIndentation('\tfoo', 2); // ' foo'
* removeIndentation(' foo\n bar'); // ' foo\n bar'
*
* @param {string} value - Value to trim.
* @param {number?} [maximum] - Maximum indentation
* to remove.
* @return {string} - Unindented `value`.
*/
function indentation(value, maximum) {
var values = value.split(C_NEWLINE);
var position = values.length + 1;
var minIndent = Infinity;
var matrix = [];
var index;
var indentation;
var stops;
var padding;
values.unshift(repeat(C_SPACE, maximum) + '!');
while (position--) {
indentation = getIndent(values[position]);
matrix[position] = indentation.stops;
if (trim(values[position]).length === 0) {
continue;
}
if (indentation.indent) {
if (indentation.indent > 0 && indentation.indent < minIndent) {
minIndent = indentation.indent;
}
} else {
minIndent = Infinity;
break;
}
}
if (minIndent !== Infinity) {
position = values.length;
while (position--) {
stops = matrix[position];
index = minIndent;
while (index && !(index in stops)) {
index--;
}
if (
trim(values[position]).length !== 0 &&
minIndent &&
index !== minIndent
) {
padding = C_TAB;
} else {
padding = '';
}
values[position] = padding + values[position].slice(
index in stops ? stops[index] + 1 : 0
);
}
}
values.shift();
return values.join(C_NEWLINE);
}
/***/ }),
/* 1012 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var path = __webpack_require__(266);
function replaceExt(npath, ext) {
if (typeof npath !== 'string') {
return npath;
}
if (npath.length === 0) {
return npath;
}
var nFileName = path.basename(npath, path.extname(npath)) + ext;
return path.join(path.dirname(npath), nFileName);
}
module.exports = replaceExt;
/***/ }),
/* 1013 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var isAbsolute = function isAbsolute(pathname) {
return pathname.charAt(0) === '/';
};
// About 1.5x faster than the two-arg version of Array#splice()
var spliceOne = function spliceOne(list, index) {
for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) {
list[i] = list[k];
}list.pop();
};
// This implementation is based heavily on node's url.parse
var resolvePathname = function resolvePathname(to) {
var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
var toParts = to && to.split('/') || [];
var fromParts = from && from.split('/') || [];
var isToAbs = to && isAbsolute(to);
var isFromAbs = from && isAbsolute(from);
var mustEndAbs = isToAbs || isFromAbs;
if (to && isAbsolute(to)) {
// to is absolute
fromParts = toParts;
} else if (toParts.length) {
// to is relative, drop the filename
fromParts.pop();
fromParts = fromParts.concat(toParts);
}
if (!fromParts.length) return '/';
var hasTrailingSlash = void 0;
if (fromParts.length) {
var last = fromParts[fromParts.length - 1];
hasTrailingSlash = last === '.' || last === '..' || last === '';
} else {
hasTrailingSlash = false;
}
var up = 0;
for (var i = fromParts.length; i >= 0; i--) {
var part = fromParts[i];
if (part === '.') {
spliceOne(fromParts, i);
} else if (part === '..') {
spliceOne(fromParts, i);
up++;
} else if (up) {
spliceOne(fromParts, i);
up--;
}
}
if (!mustEndAbs) for (; up--; up) {
fromParts.unshift('..');
}if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');
var result = fromParts.join('/');
if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';
return result;
};
module.exports = resolvePathname;
/***/ }),
/* 1014 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2016 Titus Wormer
* @license MIT
* @module state-toggle
* @fileoverview Enter/exit a state.
*/
/* eslint-env commonjs */
/* Expose. */
module.exports = factory;
/**
* Construct a state `toggler`: a function which inverses
* `property` in context based on its current value.
* The by `toggler` returned function restores that value.
*
* @param {string} key - Property to toggle.
* @param {boolean} state - Default state.
* @param {Object?} [ctx] - Context object.
* @return {Function} - Enter.
*/
function factory(key, state, ctx) {
/**
* Enter a state.
*
* @return {Function} - Exit state.
*/
return function () {
var context = ctx || this;
var current = context[key];
context[key] = !state;
/**
* Cancel state to its value before entering.
*/
return function () {
context[key] = current;
};
};
}
/***/ }),
/* 1015 */
/***/ (function(module, exports) {
/**
* When source maps are enabled, `style-loader` uses a link element with a data-uri to
* embed the css on the page. This breaks all relative urls because now they are relative to a
* bundle instead of the current page.
*
* One solution is to only use full urls, but that may be impossible.
*
* Instead, this function "fixes" the relative urls to be absolute according to the current page location.
*
* A rudimentary test suite is located at `test/fixUrls.js` and can be run via the `npm test` command.
*
*/
module.exports = function (css) {
// get current location
var location = typeof window !== "undefined" && window.location;
if (!location) {
throw new Error("fixUrls requires window.location");
}
// blank or null?
if (!css || typeof css !== "string") {
return css;
}
var baseUrl = location.protocol + "//" + location.host;
var currentDir = baseUrl + location.pathname.replace(/\/[^\/]*$/, "/");
// convert each url(...)
/*
This regular expression is just a way to recursively match brackets within
a string.
/url\s*\( = Match on the word "url" with any whitespace after it and then a parens
( = Start a capturing group
(?: = Start a non-capturing group
[^)(] = Match anything that isn't a parentheses
| = OR
\( = Match a start parentheses
(?: = Start another non-capturing groups
[^)(]+ = Match anything that isn't a parentheses
| = OR
\( = Match a start parentheses
[^)(]* = Match anything that isn't a parentheses
\) = Match a end parentheses
) = End Group
*\) = Match anything and then a close parens
) = Close non-capturing group
* = Match anything
) = Close capturing group
\) = Match a close parens
/gi = Get all matches, not the first. Be case insensitive.
*/
var fixedCss = css.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi, function(fullMatch, origUrl) {
// strip quotes (if they exist)
var unquotedOrigUrl = origUrl
.trim()
.replace(/^"(.*)"$/, function(o, $1){ return $1; })
.replace(/^'(.*)'$/, function(o, $1){ return $1; });
// already a full url? no change
if (/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/)/i.test(unquotedOrigUrl)) {
return fullMatch;
}
// convert the url to a full url
var newUrl;
if (unquotedOrigUrl.indexOf("//") === 0) {
//TODO: should we add protocol?
newUrl = unquotedOrigUrl;
} else if (unquotedOrigUrl.indexOf("/") === 0) {
// path should be relative to the base url
newUrl = baseUrl + unquotedOrigUrl; // already starts with '/'
} else {
// path should be relative to current directory
newUrl = currentDir + unquotedOrigUrl.replace(/^\.\//, ""); // Strip leading './'
}
// send back the fixed url(...)
return "url(" + JSON.stringify(newUrl) + ")";
});
// send back the fixed css
return fixedCss;
};
/***/ }),
/* 1016 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {/*
* __ ___
* _____/ /___ __/ (_)____
* / ___/ __/ / / / / / ___/
* (__ ) /_/ /_/ / / (__ )
* /____/\__/\__, /_/_/____/
* /____/
*
* stylis is a feature-rich css preprocessor
*
* @licence MIT
*/
(function (factory) {
if (true) {
module.exports = factory(global);
}
else if (typeof define === 'function' && define.amd) {
define(factory(window));
}
else {
window.stylis = factory(window);
}
}(function (window) {
'use strict';
// plugins
var plugins = [];
// regular expressions
var andPattern = /&/g;
var splitPattern = /,\f/g;
var globalPattern = /:global\(%?((?:[^\(\)\[\]]*|\[.*\]|\([^\(\)]*\))*)\)/g;
var globalsPattern = /(?:&| ):global\(%?((?:[^\(\)\[\]]*|\[.*\]|\([^\(\)]*\))*)\)/g;
// prefixes
var moz = '-moz-';
var ms = '-ms-';
var webkit = '-webkit-';
/**
* css preprocessor
*
* @param {String} selector - i.e `.class` or `#id` or `[attr=id]`
* @param {String} styles - css string
* @param {Boolean=} animations - prefix animations and keyframes, true by default
* @param {Boolean=} compact - enable additional shadow dom features(:host, :host-context)
* @param {Function} middleware
* @return {string}
*/
function stylis (selector, styles, animations, compact, middleware) {
selector += '';
var prefix = '';
var namespace = '';
var type = selector.charCodeAt(0);
var char;
var character;
var attr;
var animns;
// [ attr selector
if (type === 91) {
// `[data-id=namespace]` -> ['data-id', 'namespace']
attr = selector.substring(1, selector.length - 1).split('=');
char = (namespace = attr[1]).charCodeAt(0);
// [data-id="namespace"]/[data-id='namespace']
// --> "namespace"/'namspace' --> namespace
if (char === 34 || char === 39) {
namespace = namespace.substring(1, namespace.length - 1);
}
prefix = '['+ attr[0] + '="' + namespace +'"]';
}
// `#` `.` `>` id class and descendant selectors
else if (type === 35 || type === 46 || type === 62) {
namespace = (prefix = selector).substring(1);
}
// element selector
else {
namespace = prefix = selector;
}
// reset type signature
type = 0;
// animation and keyframe namespace
if (animations == undefined || animations === true) {
animations = true;
animns = namespace;
}
else {
animns = '';
animations = false;
}
// middleware
var has;
var uses = middleware != null;
var length = plugins.length;
if (uses === true) {
has = (typeof middleware).charCodeAt(0);
// o, object/array
if (has === 111) {
use(middleware);
}
// f, function
else if (has === 102) {
plugins[length++] = middleware;
}
else {
uses = false;
}
}
if (length !== 0) {
middleware = length === 1 ? plugins[0] : function (ctx, str, line, col, prefix, length) {
var output = str;
for (var i = 0, l = plugins.length; i < l; i++) {
output = plugins[i](ctx, output, line, col, prefix, length) || output;
}
if (output !== str) {
return output;
}
};
uses = true;
}
// declare
var colon;
var inner;
var selectors;
var build;
var media;
var temp;
var prev;
var indexOf;
var first;
var second;
var third;
var sel;
var blob;
var nest;
var query;
var str;
var regex;
// buffers
var buff = '';
var blck = '';
var flat = '';
// character code
var code = 0;
var nextcode;
// context signatures
var special = 0;
var close = 0;
var closed = 0;
var nested = 0;
var func = 0;
var medias = 0;
var strings = 0;
var globs = 0;
var isplace = 0;
// context(flat) signatures
var levels = 0;
var level = 0;
// comments
var comment = 0;
var comblck = 0;
var comline = 0;
// pre-process
if (uses === true) {
temp = middleware(0, styles, line, column, prefix, 0);
if (temp != null) {
styles = temp;
}
str = '';
}
// positions
var caret = 0;
var depth = 0;
var column = 0;
var line = 1;
var eof = styles.length;
// compiled output
var output = '';
// parse + compile
while (caret < eof) {
code = styles.charCodeAt(caret);
// {, }, ; characters, parse line by line
if (strings === 0 && func === 0 && comment === 0 &&
(
// {, }, ;
(code === 123 || code === 125 || code === 59)
||
// eof buffer
(
(caret === eof - 1) && buff.length !== 0
)
)
) {
buff += styles.charAt(caret);
// middleware, selector/property context, }
if (uses === true && code !== 125) {
// { pre-processed selector context
if (code === 123) {
temp = middleware(
1,
buff.substring(0, buff.length - 1).trim(),
line,
column,
prefix,
output.length
);
}
// ; property context
else {
temp = middleware(2, buff, line, column, prefix, output.length);
}
if (temp != null) {
buff = code === 123 ? temp + ' {' : temp;
}
}
first = buff.charCodeAt(0);
// only trim when the first character is a space ` `
if (first === 32) {
first = (buff = buff.trim()).charCodeAt(0);
}
second = buff.charCodeAt(1);
third = buff.charCodeAt(2);
// @, special block
if (first === 64) {
// push flat css
if (levels === 1 && flat.length !== 0) {
levels = 0;
flat = prefix + ' {' + flat + '}';
// middleware, flat context
if (uses === true) {
temp = middleware(4, flat, line, column, prefix, output.length);
if (temp != null) {
flat = temp;
}
}
output += flat;
flat = '';
}
// ;
if (code !== 59) {
// @keyframe, `k`
if (second === 107) {
blob = buff.substring(1, 11) + animns + buff.substring(11);
buff = '@' + webkit + blob;
type = 1;
}
// @media `m` character, @global `g` character
else if ((second === 109 && third === 101) || (second === 103)) {
// nested
if (depth !== 0) {
// discard first character {
caret++;
column++;
if (media === undefined) {
media = '';
}
temp = '';
inner = '';
selectors = prev.split(splitPattern);
// keep track of opening `{` and `}` occurrences
closed = 1;
// travel to the end of the block
while (caret < eof) {
char = styles.charCodeAt(caret);
// {, }, nested blocks may have nested blocks
if (char === 123) {
closed++;
}
else if (char === 125) {
closed--;
}
// break when the nested block has ended
if (closed === 0) {
break;
}
// build content of nested block
inner += styles.charAt(caret++);
// move column and line position
column = (char === 13 || char === 10) ? (line++, 0) : column + 1;
}
length = selectors.length;
for (var i = 0; i < length; i++) {
selector = selectors[i];
// build media block
temp += stylis(
// remove { on last selector
(i === length - 1 ? selector.substring(0, selector.length - 1) : selector).trim(),
inner,
animations,
compact,
middleware
);
}
media += buff + temp + '}';
buff = '';
medias = 1;
type = 4;
}
// top-level
else {
type = 2;
query = buff;
buff = '';
}
}
// unknown
else {
type = 6;
}
}
// flag special, i.e @keyframes, @font-face ...
if (type !== 4 && code !== 59 && second !== 105) {
// k, m
if (second !== 107 && second !== 109 && second !== 103) {
type = 5;
}
close = -1;
special++;
}
}
// property/selector
else {
// { character, selector declaration
if (code === 123) {
depth++;
// push flat css
if (levels === 1 && flat.length !== 0) {
levels = 0;
flat = prefix + ' {' + flat + '}';
// middleware, flat context
if (uses === true) {
temp = middleware(4, flat, line, column, prefix, output.length);
if (temp != null) {
flat = temp;
}
}
output += flat;
flat = '';
}
// nested selector
if (depth === 2) {
// discard first character {
caret++;
column++;
// inner content of block
inner = '';
var nestSelector = buff.substring(0, buff.length - 1).split(splitPattern);
var prevSelector = prev.substring(0, prev.length - 1).split(splitPattern);
// keep track of opening `{` and `}` occurrences
closed = 1;
// travel to the end of the block
while (caret < eof) {
char = styles.charCodeAt(caret);
// {, nested blocks may have nested blocks
if (char === 123) {
closed++;
}
// },
else if (char === 125) {
closed--;
}
// break when the nested block has ended
if (closed === 0) {
break;
}
// build content of nested block
inner += styles.charAt(caret++);
// move column and line position
column = (char === 13 || char === 10) ? (line++, 0) : column + 1;
}
// handle multiple selectors: h1, h2 { div, h4 {} } should generate
// -> h1 div, h2 div, h2 h4, h2 div {}
length = prevSelector.length;
for (var j = 0; j < length; j++) {
// extract value, prep index for reuse
temp = prevSelector[j];
indexOf = temp.indexOf(prefix);
prevSelector[j] = '';
// since there could also be multiple nested selectors
for (var k = 0, l = nestSelector.length; k < l; k++) {
if (indexOf > 0) {
selector = ':global(%)' + temp.trim();
}
else {
selector = temp.replace(prefix, '&').trim();
}
sel = nestSelector[k].trim();
if (sel.indexOf(' &') > 0) {
selector = sel.replace('&', '').trim() + ' ' + selector;
}
else if (globalPattern.exec(sel) !== null) {
selector = sel;
}
else {
selector = selector + ' ' + sel;
}
prevSelector[j] += selector.replace(/ +&/, '').trim() + (k === l - 1 ? '' : ',');
}
}
if (nest === undefined) {
nest = '';
}
// concat nest
nest += (
'\n' +
prevSelector.join(',').replace(globalsPattern, ' $1') +
' {'+inner+'}'
);
// signature
nested = 1;
// clear current line, to avoid adding nested blocks to the normal flow
buff = '';
// decreament depth
depth--;
}
// top-level selector
else if (special === 0 || type === 2) {
selectors = buff.split(splitPattern);
// current selector
build = '';
// previous selector
prev = '';
length = selectors.length;
// prefix multiple selectors with namesapces
// @example h1, h2, h3 --> [namespace] h1, [namespace] h1, ....
for (var j = 0; j < length; j++) {
char = (selector = selectors[j]).charCodeAt(0);
// ` `, trim if first character is a space
if (char === 32) {
char = (selector = selector.trim()).charCodeAt(0);
}
// &
if (char === 38) {
// before: & { / &&... {
selector = prefix + selector.substring(1).replace(andPattern, prefix);
// after: ${prefix} { / ${prefix}${prefix}...
}
else {
// register block with placeholder selector
if (selector.indexOf('::place') !== -1) {
isplace = 1;
}
// default to :global if & exists outside of the first non-space character
if ((indexOf = selector.indexOf(' &')) > 0) {
// before: html & {
selector = selector.replace(andPattern, prefix).trim();
// after: html ${prefix} {
}
// :
else if (char === 58) {
nextcode = selector.charCodeAt(1);
// h, t, :host
if (compact === true && nextcode === 104 && selector.charCodeAt(4) === 116) {
nextcode = selector.charCodeAt(5);
// (, :host(selector)
if (nextcode === 40) {
// before: `(selector)`
selector = (
prefix + (
selector
.replace(/:host\((.*)\)/g, '$1')
.replace(andPattern, prefix)
)
);
// after: ${prefx} selector {
}
// -, :host-context(selector)
else if (nextcode === 45) {
// before: `-context(selector)`
selector = selector
.replace(/:host-context\((.*)\)/g, '$1 ' + prefix)
.replace(andPattern, prefix)
// after: selector ${prefix} {
}
// :host
else {
selector = prefix + selector.substring(5);
}
}
// g, :global(selector)
else if (
nextcode === 103 &&
(
compact === true
||
((nextcode = selector.charCodeAt(8)) === 37)
)
) {
globs = 1;
// before: `:global(selector)`
selector = (
selector
.replace(globalPattern, '$1')
.replace(andPattern, prefix).trim()
);
// after: selector
}
// :hover, :active, :focus, etc...
else {
selector = prefix + selector;
}
}
// non-pseudo selectors
else if (globs === 0) {
selector = prefix + ' ' + selector;
}
}
// middleware, post-processed selector context
if (uses === true) {
temp = middleware(
1.5,
j === length - 1 ? selector.substring(0, selector.length - 1).trim() : selector,
line,
column,
prefix,
output.length
);
if (temp != null) {
selector = j === length - 1 ? temp + ' {' : temp;
}
}
// if first selector do not prefix with `,`
prev += (j !== 0 ? ',\f' : '') + (globs !== 1 ? selector : ':global(%)' + selector);
build += j !== 0 ? ',' + selector : selector;
// reset :global flag
globs = 0;
}
buff = build;
}
else {
prev = buff;
}
}
// not single `}`
else if ((code === 125 && buff.length === 1) === false) {
// ;
if (code !== 59) {
buff = (code === 125 ? buff.substring(0, buff.length - 1) : buff.trim()) + ';';
}
// animation: a, n, i characters
if (first === 97 && second === 110 && third === 105) {
// removes ;
buff = buff.substring(0, buff.length - 1);
// position of :
colon = buff.indexOf(':')+1;
// left hand side everything before `:`
build = buff.substring(0, colon);
// short hand animation syntax
if (animations === true && buff.charCodeAt(9) !== 45) {
var anims = buff.substring(colon).trim().split(',');
length = anims.length;
// because we can have multiple animations `animation: slide 4s, slideOut 2s`
for (var j = 0; j < length; j++) {
var anim = anims[j];
var props = anim.split(' ');
// since we can't be sure of the position of the name of the animation we have to find it
for (var k = 0, l = props.length; k < l; k++) {
var prop = props[k].trim();
var frst = prop.charCodeAt(0);
var thrd = prop.charCodeAt(2);
var len = prop.length;
var last = prop.charCodeAt(len - 1);
// animation name parser
if (
// first character
(
// letters
(frst > 64 && frst < 90) ||
(frst > 96 && frst < 122) ||
// the exception `underscores or dashes`
frst === 45 ||
// but two dashes at the beginning are forbidden
(frst === 95 && prop.charCodeAt(1) !== 95)
) &&
// cubic-bezier()/steps(), )
last !== 41 && len !== 0 &&
!(
frst === 105 &&
(
// infinite, i, f, e
(thrd === 102 && last === 101 && len === 8) ||
// initial
(thrd === 105 && last === 108 && len === 7) ||
// inherit
(thrd === 104 && last === 116 && len === 7)
)
) &&
// unset
!(frst === 117 && thrd === 115 && last === 116 && len === 5) &&
// linear, l, n, r
!(frst === 108 && thrd === 110 && last === 114 && len === 6) &&
// alternate/alternate-reverse, a, t, e
!(frst === 97 && thrd === 116 && last === 101 && (len === 9 || len === 17)) &&
// normal, n, r, l
!(frst === 110 && thrd === 114 && last === 108 && len === 6) &&
// backwards, b, c, s
!(frst === 98 && thrd === 99 && last === 115 && len === 9) &&
// forwards, f, r, s
!(frst === 102 && thrd === 114 && last === 115 && len === 8) &&
// both, b, t, h
!(frst === 98 && thrd === 116 && last === 104 && len === 4) &&
// none, n, n, e
!(frst === 110 && thrd === 110 && last === 101 && len === 4)&&
// running, r, n, g
!(frst === 114 && thrd === 110 && last === 103 && len === 7) &&
// paused, p, u, d
!(frst === 112 && thrd === 117 && last === 100 && len === 6) &&
// reversed, r, v, d
!(frst === 114 && thrd === 118 && last === 100 && len === 8) &&
// step-start/step-end, s, e, (t/d)
!(
frst === 115 && thrd === 101 &&
((last === 116 && len === 10) || (last === 100 && len === 8))
) &&
// ease/ease-in/ease-out/ease-in-out, e, s, e
!(
frst === 101 && thrd === 115 &&
(
(last === 101 && len === 4) ||
(len === 11 || len === 7 || len === 8) && prop.charCodeAt(4) === 45
)
) &&
// durations, 0.4ms, .4s, 400ms ...
isNaN(parseFloat(prop)) &&
// handle spaces in cubic-bezier()/steps() functions
prop.indexOf('(') === -1
) {
props[k] = animns + prop;
}
}
build += (j === 0 ? '' : ',') + props.join(' ').trim();
}
}
// explicit syntax, anims array should have only one element
else {
build += (
(buff.charCodeAt(10) !== 110 ? '' : animns) +
buff.substring(colon).trim().trim()
);
}
// vendor prefix
buff = webkit + build + ';' + build + (code === 125 ? ';}' : ';');
}
// appearance: a, p, p
else if (first === 97 && second === 112 && third === 112) {
// vendor prefix -webkit- and -moz-
buff = (
webkit + buff +
moz + buff +
buff
);
}
// display: d, i, s
else if (first === 100 && second === 105 && third === 115) {
// flex/inline-flex
if ((indexOf = buff.indexOf('flex')) !== -1) {
// e, inline-flex
temp = buff.charCodeAt(indexOf-2) === 101 ? 'inline-' : '';
buff = buff.indexOf(' !important') !== -1 ? ' !important' : '';
// vendor prefix
buff = (
'display: ' + webkit + temp + 'box' + buff + ';' +
'display: ' + webkit + temp + 'flex' + buff + ';' +
'display: ' + ms + 'flexbox' + buff + ';' +
'display: ' + temp + 'flex' + buff + ';'
);
}
}
// transforms & transitions: t, r, a
else if (first === 116 && second === 114 && third === 97) {
// vendor prefix -webkit- and -ms- if transform
buff = (
webkit + buff +
(buff.charCodeAt(5) === 102 ? ms + buff : '') +
buff
);
}
// hyphens: h, y, p
// user-select: u, s, e
else if (
(first === 104 && second === 121 && third === 112) ||
(first === 117 && second === 115 && third === 101)
) {
// vendor prefix all
buff = (
webkit + buff +
moz + buff +
ms + buff +
buff
);
}
// flex: f, l, e
else if (first === 102 && second === 108 && third === 101) {
// vendor prefix all but moz
buff = (
webkit + buff +
ms + buff +
buff
);
}
// order: o, r, d
else if (first === 111 && second === 114 && third === 100) {
// vendor prefix all but moz
buff = (
webkit + buff +
ms + 'flex-' + buff +
buff
);
}
// align-items, align-center, align-self: a, l, i, -
else if (first === 97 && second === 108 && third === 105 && buff.charCodeAt(5) === 45) {
switch (buff.charCodeAt(6)) {
// align-items, i
case 105: {
temp = buff.replace('-items', '');
buff = (
webkit + buff +
webkit + 'box-' + temp +
ms + 'flex-'+ temp +
buff
);
break;
}
// align-self, s
case 115: {
buff = (
ms + 'flex-item-' + buff.replace('-self', '') +
buff
);
break;
}
// align-content
default: {
buff = (
ms + 'flex-line-pack' + buff.replace('align-content', '') +
buff
);
break;
}
}
}
// justify-content, j, u, s
else if (first === 106 && second === 117 && third === 115) {
colon = buff.indexOf(':');
temp = buff.substring(colon).replace('flex-', '')
buff = (
webkit + 'box-pack' + temp +
webkit + buff +
ms + 'flex-pack' + temp +
buff
);
}
// cursor, c, u, r
else if (first === 99 && second === 117 && third === 114 && /zoo|gra/.exec(buff) !== null) {
buff = (
buff.replace(/: +/g, ': ' + webkit) +
buff.replace(/: +/g, ': ' + moz) +
buff
);
}
// width: min-content / width: max-content
else if (first === 119 && second === 105 && third === 100 && (indexOf = buff.indexOf('-content')) !== -1) {
temp = buff.substring(indexOf - 3);
// vendor prefix
buff = (
'width: ' + webkit + temp +
'width: ' + moz + temp +
'width: ' + temp
);
}
if (code !== 59) {
buff = buff.substring(0, buff.length - 1);
// }
if (code === 125) {
buff += '}';
}
}
}
// } character
if (code === 125) {
if (depth !== 0) {
depth--;
}
// concat nested css
if (depth === 0 && nested === 1) {
styles = styles.substring(0, caret + 1) + nest + styles.substring(caret + 1);
eof += nest.length;
nest = '';
nested = 0;
close++;
}
// }, ` ` whitespace
if (first !== 125 && buff.charCodeAt(buff.length - 2) === 32) {
buff = buff.substring(0, buff.length-1).trim() + '}';
}
}
// @@keyframes
if (special !== 0) {
// }, find closing tag
if (code === 125) {
close++;
}
// {
else if (code === 123 && close !== 0) {
close--;
}
// append flat @media css
if (level === 1 && (code === 123 || close === 0) && flat.length !== 0) {
level = 0;
buff = prefix + ' {'+flat+'}' + buff;
flat = '';
}
// closing tag
if (close === 0) {
// @keyframes
if (type === 1) {
// vendor prefix
buff = '}@'+blob+'}';
// reset
blob = '';
}
// reset signatures
type = 0;
close--;
special--;
}
// @keyframes
else if (type === 1) {
blob += buff;
}
// @media flat context
else if (type === 2 && depth === 0) {
if (code !== 125) {
if (level === 0) {
flat = '';
}
flat += buff;
buff = '';
}
level = 1;
}
}
// flat context
else if (depth === 0 && code !== 125) {
levels = 1;
flat = flat === undefined ? buff : flat + buff;
buff = '';
}
}
// append line to blck buffer
blck += buff;
// add blck buffer to output
if (code === 125 && (type === 0 || type === 2 || type === 4)) {
char = blck.charCodeAt(blck.length - 2);
if (type === 4) {
type = 0;
}
if (media !== undefined && media.length !== 0) {
blck = char === 123 ? media : blck + media;
media = '';
char = blck.charCodeAt(blck.length - 2);
}
// {, @
if (char !== 123) {
// middleware, block context
if (uses === true) {
temp = middleware(3, blck, line, column, prefix, output.length);
if (temp != null) {
blck = temp;
}
}
if (isplace === 1) {
regex = /::place/g;
isplace = 0;
temp = 'input-place';
blck = (
blck.replace(regex, '::'+webkit+temp) +
blck.replace(regex, '::'+moz+'place') +
blck.replace(regex, ':'+ms+temp) +
blck
);
}
if (query !== undefined) {
query += blck;
// }
if (query.charCodeAt(query.length - 2) === 125) {
output += query;
query = undefined;
}
}
else {
// append blck buffer
output += blck;
}
}
// reset blck buffer
blck = '';
}
// reset line buffer
buff = '';
}
// build line by line
else {
// \r, \n, new lines
if (code === 13 || code === 10) {
if (comline === 1) {
comment = comline = 0;
buff = buff.substring(0, buff.indexOf('//')).trim();
}
// /
else if (uses === true && comment === 0 && (length = (str = str.trim()).length) !== 0 && str.charCodeAt(0) !== 47) {
if (buff.length !== 0) {
temp = middleware(7, str, line, column, prefix, output.length);
if (temp != null) {
buff = buff.replace(new RegExp(str+'$'), temp).trim();
}
}
str = '';
}
column = 0;
line++;
}
else {
// not `\t` tab character
if (code !== 9) {
character = styles.charAt(caret);
// build line buffer
if (uses === true && comment === 0) {
str += character;
}
// build character buffer
buff += character;
switch (code) {
// ,
case 44: {
if (strings === 0 && comment === 0 && func === 0) {
buff += '\f';
}
break;
}
// " character
case 34: {
if (comment === 0) {
// exit string " context / enter string context
strings = strings === 34 ? 0 : (strings === 39 ? 39 : 34);
}
break;
}
// ' character
case 39: {
if (comment === 0) {
// exit string ' context / enter string context
strings = strings === 39 ? 0 : (strings === 34 ? 34 : 39);
}
break;
}
// ( character
case 40: {
if (strings === 0 && comment === 0) {
func = 1;
}
break;
}
// ) character
case 41: {
if (strings === 0 && comment === 0) {
func = 0;
}
break;
}
// / character
case 47: {
if (strings === 0 && func === 0) {
char = styles.charCodeAt(caret - 1);
// /, begin line comment
if (comblck === 0 && char === 47) {
comment = comline = 1;
}
// *, end block comment
else if (char === 42) {
comment = comblck = 0;
buff = buff.substring(0, buff.indexOf('/*')).trim();
}
}
break;
}
// * character
case 42: {
if (strings === 0 && func === 0 && comline === 0 && comblck === 0) {
// /, begin block comment
if (styles.charCodeAt(caret - 1) === 47) {
comment = comblck = 1;
}
}
break;
}
}
}
// move column position
column++;
}
}
// move caret position
caret++;
}
// trailing flat css
if (flat !== undefined && flat.length !== 0) {
flat = prefix + ' {' + flat + '}';
// middleware, flat context
if (uses === true) {
temp = middleware(4, flat, line, column, prefix, output.length);
if (temp != null) {
flat = temp;
}
}
// append flat css
output += flat;
}
// middleware, output context
if (uses === true) {
temp = middleware(6, output, line, column, prefix, output.length);
if (temp != null) {
output = temp;
}
}
return output;
}
/**
* use plugin
*
* @param {string|function|function[]} key
* @param {function?} plugin
* @return {Object} {plugins}
*/
function use (plugin) {
var length = plugins.length;
if (plugin != null) {
// array of plugins
if (plugin.constructor === Array) {
for (var i = 0, l = plugin.length; i < l; i++) {
plugins[length++] = plugin[i];
}
}
// single un-keyed plugin
else {
plugins[length] = plugin;
}
}
return stylis;
};
stylis.use = use;
/**
* plugin store
*
* @type {Function[]}
*/
stylis.p = plugins;
/**
* regular expresions
*
* @type {Object<string, RegExp>}
*/
stylis.r = {
a: andPattern,
s: splitPattern,
g: globalPattern,
n: globalsPattern
};
return stylis;
}));
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(16)))
/***/ }),
/* 1017 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(1018);
/***/ }),
/* 1018 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(global, module) {
Object.defineProperty(exports, "__esModule", {
value: true
});
var _ponyfill = __webpack_require__(1019);
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, __webpack_require__(16), __webpack_require__(111)(module)))
/***/ }),
/* 1019 */
/***/ (function(module, exports, __webpack_require__) {
"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;
};
/***/ }),
/* 1020 */
/***/ (function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_RESULT__;// TinyColor v1.4.1
// https://github.com/bgrins/TinyColor
// Brian Grinstead, MIT License
(function(Math) {
var trimLeft = /^\s+/,
trimRight = /\s+$/,
tinyCounter = 0,
mathRound = Math.round,
mathMin = Math.min,
mathMax = Math.max,
mathRandom = Math.random;
function tinycolor (color, opts) {
color = (color) ? color : '';
opts = opts || { };
// If input is already a tinycolor, return itself
if (color instanceof tinycolor) {
return color;
}
// If we are called as a function, call using new instead
if (!(this instanceof tinycolor)) {
return new tinycolor(color, opts);
}
var rgb = inputToRGB(color);
this._originalInput = color,
this._r = rgb.r,
this._g = rgb.g,
this._b = rgb.b,
this._a = rgb.a,
this._roundA = mathRound(100*this._a) / 100,
this._format = opts.format || rgb.format;
this._gradientType = opts.gradientType;
// Don't let the range of [0,255] come back in [0,1].
// Potentially lose a little bit of precision here, but will fix issues where
// .5 gets interpreted as half of the total, instead of half of 1
// If it was supposed to be 128, this was already taken care of by `inputToRgb`
if (this._r < 1) { this._r = mathRound(this._r); }
if (this._g < 1) { this._g = mathRound(this._g); }
if (this._b < 1) { this._b = mathRound(this._b); }
this._ok = rgb.ok;
this._tc_id = tinyCounter++;
}
tinycolor.prototype = {
isDark: function() {
return this.getBrightness() < 128;
},
isLight: function() {
return !this.isDark();
},
isValid: function() {
return this._ok;
},
getOriginalInput: function() {
return this._originalInput;
},
getFormat: function() {
return this._format;
},
getAlpha: function() {
return this._a;
},
getBrightness: function() {
//http://www.w3.org/TR/AERT#color-contrast
var rgb = this.toRgb();
return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000;
},
getLuminance: function() {
//http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
var rgb = this.toRgb();
var RsRGB, GsRGB, BsRGB, R, G, B;
RsRGB = rgb.r/255;
GsRGB = rgb.g/255;
BsRGB = rgb.b/255;
if (RsRGB <= 0.03928) {R = RsRGB / 12.92;} else {R = Math.pow(((RsRGB + 0.055) / 1.055), 2.4);}
if (GsRGB <= 0.03928) {G = GsRGB / 12.92;} else {G = Math.pow(((GsRGB + 0.055) / 1.055), 2.4);}
if (BsRGB <= 0.03928) {B = BsRGB / 12.92;} else {B = Math.pow(((BsRGB + 0.055) / 1.055), 2.4);}
return (0.2126 * R) + (0.7152 * G) + (0.0722 * B);
},
setAlpha: function(value) {
this._a = boundAlpha(value);
this._roundA = mathRound(100*this._a) / 100;
return this;
},
toHsv: function() {
var hsv = rgbToHsv(this._r, this._g, this._b);
return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this._a };
},
toHsvString: function() {
var hsv = rgbToHsv(this._r, this._g, this._b);
var h = mathRound(hsv.h * 360), s = mathRound(hsv.s * 100), v = mathRound(hsv.v * 100);
return (this._a == 1) ?
"hsv(" + h + ", " + s + "%, " + v + "%)" :
"hsva(" + h + ", " + s + "%, " + v + "%, "+ this._roundA + ")";
},
toHsl: function() {
var hsl = rgbToHsl(this._r, this._g, this._b);
return { h: hsl.h * 360, s: hsl.s, l: hsl.l, a: this._a };
},
toHslString: function() {
var hsl = rgbToHsl(this._r, this._g, this._b);
var h = mathRound(hsl.h * 360), s = mathRound(hsl.s * 100), l = mathRound(hsl.l * 100);
return (this._a == 1) ?
"hsl(" + h + ", " + s + "%, " + l + "%)" :
"hsla(" + h + ", " + s + "%, " + l + "%, "+ this._roundA + ")";
},
toHex: function(allow3Char) {
return rgbToHex(this._r, this._g, this._b, allow3Char);
},
toHexString: function(allow3Char) {
return '#' + this.toHex(allow3Char);
},
toHex8: function(allow4Char) {
return rgbaToHex(this._r, this._g, this._b, this._a, allow4Char);
},
toHex8String: function(allow4Char) {
return '#' + this.toHex8(allow4Char);
},
toRgb: function() {
return { r: mathRound(this._r), g: mathRound(this._g), b: mathRound(this._b), a: this._a };
},
toRgbString: function() {
return (this._a == 1) ?
"rgb(" + mathRound(this._r) + ", " + mathRound(this._g) + ", " + mathRound(this._b) + ")" :
"rgba(" + mathRound(this._r) + ", " + mathRound(this._g) + ", " + mathRound(this._b) + ", " + this._roundA + ")";
},
toPercentageRgb: function() {
return { r: mathRound(bound01(this._r, 255) * 100) + "%", g: mathRound(bound01(this._g, 255) * 100) + "%", b: mathRound(bound01(this._b, 255) * 100) + "%", a: this._a };
},
toPercentageRgbString: function() {
return (this._a == 1) ?
"rgb(" + mathRound(bound01(this._r, 255) * 100) + "%, " + mathRound(bound01(this._g, 255) * 100) + "%, " + mathRound(bound01(this._b, 255) * 100) + "%)" :
"rgba(" + mathRound(bound01(this._r, 255) * 100) + "%, " + mathRound(bound01(this._g, 255) * 100) + "%, " + mathRound(bound01(this._b, 255) * 100) + "%, " + this._roundA + ")";
},
toName: function() {
if (this._a === 0) {
return "transparent";
}
if (this._a < 1) {
return false;
}
return hexNames[rgbToHex(this._r, this._g, this._b, true)] || false;
},
toFilter: function(secondColor) {
var hex8String = '#' + rgbaToArgbHex(this._r, this._g, this._b, this._a);
var secondHex8String = hex8String;
var gradientType = this._gradientType ? "GradientType = 1, " : "";
if (secondColor) {
var s = tinycolor(secondColor);
secondHex8String = '#' + rgbaToArgbHex(s._r, s._g, s._b, s._a);
}
return "progid:DXImageTransform.Microsoft.gradient("+gradientType+"startColorstr="+hex8String+",endColorstr="+secondHex8String+")";
},
toString: function(format) {
var formatSet = !!format;
format = format || this._format;
var formattedString = false;
var hasAlpha = this._a < 1 && this._a >= 0;
var needsAlphaFormat = !formatSet && hasAlpha && (format === "hex" || format === "hex6" || format === "hex3" || format === "hex4" || format === "hex8" || format === "name");
if (needsAlphaFormat) {
// Special case for "transparent", all other non-alpha formats
// will return rgba when there is transparency.
if (format === "name" && this._a === 0) {
return this.toName();
}
return this.toRgbString();
}
if (format === "rgb") {
formattedString = this.toRgbString();
}
if (format === "prgb") {
formattedString = this.toPercentageRgbString();
}
if (format === "hex" || format === "hex6") {
formattedString = this.toHexString();
}
if (format === "hex3") {
formattedString = this.toHexString(true);
}
if (format === "hex4") {
formattedString = this.toHex8String(true);
}
if (format === "hex8") {
formattedString = this.toHex8String();
}
if (format === "name") {
formattedString = this.toName();
}
if (format === "hsl") {
formattedString = this.toHslString();
}
if (format === "hsv") {
formattedString = this.toHsvString();
}
return formattedString || this.toHexString();
},
clone: function() {
return tinycolor(this.toString());
},
_applyModification: function(fn, args) {
var color = fn.apply(null, [this].concat([].slice.call(args)));
this._r = color._r;
this._g = color._g;
this._b = color._b;
this.setAlpha(color._a);
return this;
},
lighten: function() {
return this._applyModification(lighten, arguments);
},
brighten: function() {
return this._applyModification(brighten, arguments);
},
darken: function() {
return this._applyModification(darken, arguments);
},
desaturate: function() {
return this._applyModification(desaturate, arguments);
},
saturate: function() {
return this._applyModification(saturate, arguments);
},
greyscale: function() {
return this._applyModification(greyscale, arguments);
},
spin: function() {
return this._applyModification(spin, arguments);
},
_applyCombination: function(fn, args) {
return fn.apply(null, [this].concat([].slice.call(args)));
},
analogous: function() {
return this._applyCombination(analogous, arguments);
},
complement: function() {
return this._applyCombination(complement, arguments);
},
monochromatic: function() {
return this._applyCombination(monochromatic, arguments);
},
splitcomplement: function() {
return this._applyCombination(splitcomplement, arguments);
},
triad: function() {
return this._applyCombination(triad, arguments);
},
tetrad: function() {
return this._applyCombination(tetrad, arguments);
}
};
// If input is an object, force 1 into "1.0" to handle ratios properly
// String input requires "1.0" as input, so 1 will be treated as 1
tinycolor.fromRatio = function(color, opts) {
if (typeof color == "object") {
var newColor = {};
for (var i in color) {
if (color.hasOwnProperty(i)) {
if (i === "a") {
newColor[i] = color[i];
}
else {
newColor[i] = convertToPercentage(color[i]);
}
}
}
color = newColor;
}
return tinycolor(color, opts);
};
// Given a string or object, convert that input to RGB
// Possible string inputs:
//
// "red"
// "#f00" or "f00"
// "#ff0000" or "ff0000"
// "#ff000000" or "ff000000"
// "rgb 255 0 0" or "rgb (255, 0, 0)"
// "rgb 1.0 0 0" or "rgb (1, 0, 0)"
// "rgba (255, 0, 0, 1)" or "rgba 255, 0, 0, 1"
// "rgba (1.0, 0, 0, 1)" or "rgba 1.0, 0, 0, 1"
// "hsl(0, 100%, 50%)" or "hsl 0 100% 50%"
// "hsla(0, 100%, 50%, 1)" or "hsla 0 100% 50%, 1"
// "hsv(0, 100%, 100%)" or "hsv 0 100% 100%"
//
function inputToRGB(color) {
var rgb = { r: 0, g: 0, b: 0 };
var a = 1;
var s = null;
var v = null;
var l = null;
var ok = false;
var format = false;
if (typeof color == "string") {
color = stringInputToObject(color);
}
if (typeof color == "object") {
if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {
rgb = rgbToRgb(color.r, color.g, color.b);
ok = true;
format = String(color.r).substr(-1) === "%" ? "prgb" : "rgb";
}
else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {
s = convertToPercentage(color.s);
v = convertToPercentage(color.v);
rgb = hsvToRgb(color.h, s, v);
ok = true;
format = "hsv";
}
else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {
s = convertToPercentage(color.s);
l = convertToPercentage(color.l);
rgb = hslToRgb(color.h, s, l);
ok = true;
format = "hsl";
}
if (color.hasOwnProperty("a")) {
a = color.a;
}
}
a = boundAlpha(a);
return {
ok: ok,
format: color.format || format,
r: mathMin(255, mathMax(rgb.r, 0)),
g: mathMin(255, mathMax(rgb.g, 0)),
b: mathMin(255, mathMax(rgb.b, 0)),
a: a
};
}
// Conversion Functions
// --------------------
// `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from:
// <http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript>
// `rgbToRgb`
// Handle bounds / percentage checking to conform to CSS color spec
// <http://www.w3.org/TR/css3-color/>
// *Assumes:* r, g, b in [0, 255] or [0, 1]
// *Returns:* { r, g, b } in [0, 255]
function rgbToRgb(r, g, b){
return {
r: bound01(r, 255) * 255,
g: bound01(g, 255) * 255,
b: bound01(b, 255) * 255
};
}
// `rgbToHsl`
// Converts an RGB color value to HSL.
// *Assumes:* r, g, and b are contained in [0, 255] or [0, 1]
// *Returns:* { h, s, l } in [0,1]
function rgbToHsl(r, g, b) {
r = bound01(r, 255);
g = bound01(g, 255);
b = bound01(b, 255);
var max = mathMax(r, g, b), min = mathMin(r, g, b);
var h, s, l = (max + min) / 2;
if(max == min) {
h = s = 0; // achromatic
}
else {
var d = max - min;
s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
switch(max) {
case r: h = (g - b) / d + (g < b ? 6 : 0); break;
case g: h = (b - r) / d + 2; break;
case b: h = (r - g) / d + 4; break;
}
h /= 6;
}
return { h: h, s: s, l: l };
}
// `hslToRgb`
// Converts an HSL color value to RGB.
// *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100]
// *Returns:* { r, g, b } in the set [0, 255]
function hslToRgb(h, s, l) {
var r, g, b;
h = bound01(h, 360);
s = bound01(s, 100);
l = bound01(l, 100);
function hue2rgb(p, q, t) {
if(t < 0) t += 1;
if(t > 1) t -= 1;
if(t < 1/6) return p + (q - p) * 6 * t;
if(t < 1/2) return q;
if(t < 2/3) return p + (q - p) * (2/3 - t) * 6;
return p;
}
if(s === 0) {
r = g = b = l; // achromatic
}
else {
var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
var p = 2 * l - q;
r = hue2rgb(p, q, h + 1/3);
g = hue2rgb(p, q, h);
b = hue2rgb(p, q, h - 1/3);
}
return { r: r * 255, g: g * 255, b: b * 255 };
}
// `rgbToHsv`
// Converts an RGB color value to HSV
// *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]
// *Returns:* { h, s, v } in [0,1]
function rgbToHsv(r, g, b) {
r = bound01(r, 255);
g = bound01(g, 255);
b = bound01(b, 255);
var max = mathMax(r, g, b), min = mathMin(r, g, b);
var h, s, v = max;
var d = max - min;
s = max === 0 ? 0 : d / max;
if(max == min) {
h = 0; // achromatic
}
else {
switch(max) {
case r: h = (g - b) / d + (g < b ? 6 : 0); break;
case g: h = (b - r) / d + 2; break;
case b: h = (r - g) / d + 4; break;
}
h /= 6;
}
return { h: h, s: s, v: v };
}
// `hsvToRgb`
// Converts an HSV color value to RGB.
// *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]
// *Returns:* { r, g, b } in the set [0, 255]
function hsvToRgb(h, s, v) {
h = bound01(h, 360) * 6;
s = bound01(s, 100);
v = bound01(v, 100);
var i = Math.floor(h),
f = h - i,
p = v * (1 - s),
q = v * (1 - f * s),
t = v * (1 - (1 - f) * s),
mod = i % 6,
r = [v, q, p, p, t, v][mod],
g = [t, v, v, q, p, p][mod],
b = [p, p, t, v, v, q][mod];
return { r: r * 255, g: g * 255, b: b * 255 };
}
// `rgbToHex`
// Converts an RGB color to hex
// Assumes r, g, and b are contained in the set [0, 255]
// Returns a 3 or 6 character hex
function rgbToHex(r, g, b, allow3Char) {
var hex = [
pad2(mathRound(r).toString(16)),
pad2(mathRound(g).toString(16)),
pad2(mathRound(b).toString(16))
];
// Return a 3 character hex if possible
if (allow3Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1)) {
return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);
}
return hex.join("");
}
// `rgbaToHex`
// Converts an RGBA color plus alpha transparency to hex
// Assumes r, g, b are contained in the set [0, 255] and
// a in [0, 1]. Returns a 4 or 8 character rgba hex
function rgbaToHex(r, g, b, a, allow4Char) {
var hex = [
pad2(mathRound(r).toString(16)),
pad2(mathRound(g).toString(16)),
pad2(mathRound(b).toString(16)),
pad2(convertDecimalToHex(a))
];
// Return a 4 character hex if possible
if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) {
return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);
}
return hex.join("");
}
// `rgbaToArgbHex`
// Converts an RGBA color to an ARGB Hex8 string
// Rarely used, but required for "toFilter()"
function rgbaToArgbHex(r, g, b, a) {
var hex = [
pad2(convertDecimalToHex(a)),
pad2(mathRound(r).toString(16)),
pad2(mathRound(g).toString(16)),
pad2(mathRound(b).toString(16))
];
return hex.join("");
}
// `equals`
// Can be called with any tinycolor input
tinycolor.equals = function (color1, color2) {
if (!color1 || !color2) { return false; }
return tinycolor(color1).toRgbString() == tinycolor(color2).toRgbString();
};
tinycolor.random = function() {
return tinycolor.fromRatio({
r: mathRandom(),
g: mathRandom(),
b: mathRandom()
});
};
// Modification Functions
// ----------------------
// Thanks to less.js for some of the basics here
// <https://github.com/cloudhead/less.js/blob/master/lib/less/functions.js>
function desaturate(color, amount) {
amount = (amount === 0) ? 0 : (amount || 10);
var hsl = tinycolor(color).toHsl();
hsl.s -= amount / 100;
hsl.s = clamp01(hsl.s);
return tinycolor(hsl);
}
function saturate(color, amount) {
amount = (amount === 0) ? 0 : (amount || 10);
var hsl = tinycolor(color).toHsl();
hsl.s += amount / 100;
hsl.s = clamp01(hsl.s);
return tinycolor(hsl);
}
function greyscale(color) {
return tinycolor(color).desaturate(100);
}
function lighten (color, amount) {
amount = (amount === 0) ? 0 : (amount || 10);
var hsl = tinycolor(color).toHsl();
hsl.l += amount / 100;
hsl.l = clamp01(hsl.l);
return tinycolor(hsl);
}
function brighten(color, amount) {
amount = (amount === 0) ? 0 : (amount || 10);
var rgb = tinycolor(color).toRgb();
rgb.r = mathMax(0, mathMin(255, rgb.r - mathRound(255 * - (amount / 100))));
rgb.g = mathMax(0, mathMin(255, rgb.g - mathRound(255 * - (amount / 100))));
rgb.b = mathMax(0, mathMin(255, rgb.b - mathRound(255 * - (amount / 100))));
return tinycolor(rgb);
}
function darken (color, amount) {
amount = (amount === 0) ? 0 : (amount || 10);
var hsl = tinycolor(color).toHsl();
hsl.l -= amount / 100;
hsl.l = clamp01(hsl.l);
return tinycolor(hsl);
}
// Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.
// Values outside of this range will be wrapped into this range.
function spin(color, amount) {
var hsl = tinycolor(color).toHsl();
var hue = (hsl.h + amount) % 360;
hsl.h = hue < 0 ? 360 + hue : hue;
return tinycolor(hsl);
}
// Combination Functions
// ---------------------
// Thanks to jQuery xColor for some of the ideas behind these
// <https://github.com/infusion/jQuery-xcolor/blob/master/jquery.xcolor.js>
function complement(color) {
var hsl = tinycolor(color).toHsl();
hsl.h = (hsl.h + 180) % 360;
return tinycolor(hsl);
}
function triad(color) {
var hsl = tinycolor(color).toHsl();
var h = hsl.h;
return [
tinycolor(color),
tinycolor({ h: (h + 120) % 360, s: hsl.s, l: hsl.l }),
tinycolor({ h: (h + 240) % 360, s: hsl.s, l: hsl.l })
];
}
function tetrad(color) {
var hsl = tinycolor(color).toHsl();
var h = hsl.h;
return [
tinycolor(color),
tinycolor({ h: (h + 90) % 360, s: hsl.s, l: hsl.l }),
tinycolor({ h: (h + 180) % 360, s: hsl.s, l: hsl.l }),
tinycolor({ h: (h + 270) % 360, s: hsl.s, l: hsl.l })
];
}
function splitcomplement(color) {
var hsl = tinycolor(color).toHsl();
var h = hsl.h;
return [
tinycolor(color),
tinycolor({ h: (h + 72) % 360, s: hsl.s, l: hsl.l}),
tinycolor({ h: (h + 216) % 360, s: hsl.s, l: hsl.l})
];
}
function analogous(color, results, slices) {
results = results || 6;
slices = slices || 30;
var hsl = tinycolor(color).toHsl();
var part = 360 / slices;
var ret = [tinycolor(color)];
for (hsl.h = ((hsl.h - (part * results >> 1)) + 720) % 360; --results; ) {
hsl.h = (hsl.h + part) % 360;
ret.push(tinycolor(hsl));
}
return ret;
}
function monochromatic(color, results) {
results = results || 6;
var hsv = tinycolor(color).toHsv();
var h = hsv.h, s = hsv.s, v = hsv.v;
var ret = [];
var modification = 1 / results;
while (results--) {
ret.push(tinycolor({ h: h, s: s, v: v}));
v = (v + modification) % 1;
}
return ret;
}
// Utility Functions
// ---------------------
tinycolor.mix = function(color1, color2, amount) {
amount = (amount === 0) ? 0 : (amount || 50);
var rgb1 = tinycolor(color1).toRgb();
var rgb2 = tinycolor(color2).toRgb();
var p = amount / 100;
var rgba = {
r: ((rgb2.r - rgb1.r) * p) + rgb1.r,
g: ((rgb2.g - rgb1.g) * p) + rgb1.g,
b: ((rgb2.b - rgb1.b) * p) + rgb1.b,
a: ((rgb2.a - rgb1.a) * p) + rgb1.a
};
return tinycolor(rgba);
};
// Readability Functions
// ---------------------
// <http://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef (WCAG Version 2)
// `contrast`
// Analyze the 2 colors and returns the color contrast defined by (WCAG Version 2)
tinycolor.readability = function(color1, color2) {
var c1 = tinycolor(color1);
var c2 = tinycolor(color2);
return (Math.max(c1.getLuminance(),c2.getLuminance())+0.05) / (Math.min(c1.getLuminance(),c2.getLuminance())+0.05);
};
// `isReadable`
// Ensure that foreground and background color combinations meet WCAG2 guidelines.
// The third argument is an optional Object.
// the 'level' property states 'AA' or 'AAA' - if missing or invalid, it defaults to 'AA';
// the 'size' property states 'large' or 'small' - if missing or invalid, it defaults to 'small'.
// If the entire object is absent, isReadable defaults to {level:"AA",size:"small"}.
// *Example*
// tinycolor.isReadable("#000", "#111") => false
// tinycolor.isReadable("#000", "#111",{level:"AA",size:"large"}) => false
tinycolor.isReadable = function(color1, color2, wcag2) {
var readability = tinycolor.readability(color1, color2);
var wcag2Parms, out;
out = false;
wcag2Parms = validateWCAG2Parms(wcag2);
switch (wcag2Parms.level + wcag2Parms.size) {
case "AAsmall":
case "AAAlarge":
out = readability >= 4.5;
break;
case "AAlarge":
out = readability >= 3;
break;
case "AAAsmall":
out = readability >= 7;
break;
}
return out;
};
// `mostReadable`
// Given a base color and a list of possible foreground or background
// colors for that base, returns the most readable color.
// Optionally returns Black or White if the most readable color is unreadable.
// *Example*
// tinycolor.mostReadable(tinycolor.mostReadable("#123", ["#124", "#125"],{includeFallbackColors:false}).toHexString(); // "#112255"
// tinycolor.mostReadable(tinycolor.mostReadable("#123", ["#124", "#125"],{includeFallbackColors:true}).toHexString(); // "#ffffff"
// tinycolor.mostReadable("#a8015a", ["#faf3f3"],{includeFallbackColors:true,level:"AAA",size:"large"}).toHexString(); // "#faf3f3"
// tinycolor.mostReadable("#a8015a", ["#faf3f3"],{includeFallbackColors:true,level:"AAA",size:"small"}).toHexString(); // "#ffffff"
tinycolor.mostReadable = function(baseColor, colorList, args) {
var bestColor = null;
var bestScore = 0;
var readability;
var includeFallbackColors, level, size ;
args = args || {};
includeFallbackColors = args.includeFallbackColors ;
level = args.level;
size = args.size;
for (var i= 0; i < colorList.length ; i++) {
readability = tinycolor.readability(baseColor, colorList[i]);
if (readability > bestScore) {
bestScore = readability;
bestColor = tinycolor(colorList[i]);
}
}
if (tinycolor.isReadable(baseColor, bestColor, {"level":level,"size":size}) || !includeFallbackColors) {
return bestColor;
}
else {
args.includeFallbackColors=false;
return tinycolor.mostReadable(baseColor,["#fff", "#000"],args);
}
};
// Big List of Colors
// ------------------
// <http://www.w3.org/TR/css3-color/#svg-color>
var names = tinycolor.names = {
aliceblue: "f0f8ff",
antiquewhite: "faebd7",
aqua: "0ff",
aquamarine: "7fffd4",
azure: "f0ffff",
beige: "f5f5dc",
bisque: "ffe4c4",
black: "000",
blanchedalmond: "ffebcd",
blue: "00f",
blueviolet: "8a2be2",
brown: "a52a2a",
burlywood: "deb887",
burntsienna: "ea7e5d",
cadetblue: "5f9ea0",
chartreuse: "7fff00",
chocolate: "d2691e",
coral: "ff7f50",
cornflowerblue: "6495ed",
cornsilk: "fff8dc",
crimson: "dc143c",
cyan: "0ff",
darkblue: "00008b",
darkcyan: "008b8b",
darkgoldenrod: "b8860b",
darkgray: "a9a9a9",
darkgreen: "006400",
darkgrey: "a9a9a9",
darkkhaki: "bdb76b",
darkmagenta: "8b008b",
darkolivegreen: "556b2f",
darkorange: "ff8c00",
darkorchid: "9932cc",
darkred: "8b0000",
darksalmon: "e9967a",
darkseagreen: "8fbc8f",
darkslateblue: "483d8b",
darkslategray: "2f4f4f",
darkslategrey: "2f4f4f",
darkturquoise: "00ced1",
darkviolet: "9400d3",
deeppink: "ff1493",
deepskyblue: "00bfff",
dimgray: "696969",
dimgrey: "696969",
dodgerblue: "1e90ff",
firebrick: "b22222",
floralwhite: "fffaf0",
forestgreen: "228b22",
fuchsia: "f0f",
gainsboro: "dcdcdc",
ghostwhite: "f8f8ff",
gold: "ffd700",
goldenrod: "daa520",
gray: "808080",
green: "008000",
greenyellow: "adff2f",
grey: "808080",
honeydew: "f0fff0",
hotpink: "ff69b4",
indianred: "cd5c5c",
indigo: "4b0082",
ivory: "fffff0",
khaki: "f0e68c",
lavender: "e6e6fa",
lavenderblush: "fff0f5",
lawngreen: "7cfc00",
lemonchiffon: "fffacd",
lightblue: "add8e6",
lightcoral: "f08080",
lightcyan: "e0ffff",
lightgoldenrodyellow: "fafad2",
lightgray: "d3d3d3",
lightgreen: "90ee90",
lightgrey: "d3d3d3",
lightpink: "ffb6c1",
lightsalmon: "ffa07a",
lightseagreen: "20b2aa",
lightskyblue: "87cefa",
lightslategray: "789",
lightslategrey: "789",
lightsteelblue: "b0c4de",
lightyellow: "ffffe0",
lime: "0f0",
limegreen: "32cd32",
linen: "faf0e6",
magenta: "f0f",
maroon: "800000",
mediumaquamarine: "66cdaa",
mediumblue: "0000cd",
mediumorchid: "ba55d3",
mediumpurple: "9370db",
mediumseagreen: "3cb371",
mediumslateblue: "7b68ee",
mediumspringgreen: "00fa9a",
mediumturquoise: "48d1cc",
mediumvioletred: "c71585",
midnightblue: "191970",
mintcream: "f5fffa",
mistyrose: "ffe4e1",
moccasin: "ffe4b5",
navajowhite: "ffdead",
navy: "000080",
oldlace: "fdf5e6",
olive: "808000",
olivedrab: "6b8e23",
orange: "ffa500",
orangered: "ff4500",
orchid: "da70d6",
palegoldenrod: "eee8aa",
palegreen: "98fb98",
paleturquoise: "afeeee",
palevioletred: "db7093",
papayawhip: "ffefd5",
peachpuff: "ffdab9",
peru: "cd853f",
pink: "ffc0cb",
plum: "dda0dd",
powderblue: "b0e0e6",
purple: "800080",
rebeccapurple: "663399",
red: "f00",
rosybrown: "bc8f8f",
royalblue: "4169e1",
saddlebrown: "8b4513",
salmon: "fa8072",
sandybrown: "f4a460",
seagreen: "2e8b57",
seashell: "fff5ee",
sienna: "a0522d",
silver: "c0c0c0",
skyblue: "87ceeb",
slateblue: "6a5acd",
slategray: "708090",
slategrey: "708090",
snow: "fffafa",
springgreen: "00ff7f",
steelblue: "4682b4",
tan: "d2b48c",
teal: "008080",
thistle: "d8bfd8",
tomato: "ff6347",
turquoise: "40e0d0",
violet: "ee82ee",
wheat: "f5deb3",
white: "fff",
whitesmoke: "f5f5f5",
yellow: "ff0",
yellowgreen: "9acd32"
};
// Make it easy to access colors via `hexNames[hex]`
var hexNames = tinycolor.hexNames = flip(names);
// Utilities
// ---------
// `{ 'name1': 'val1' }` becomes `{ 'val1': 'name1' }`
function flip(o) {
var flipped = { };
for (var i in o) {
if (o.hasOwnProperty(i)) {
flipped[o[i]] = i;
}
}
return flipped;
}
// Return a valid alpha value [0,1] with all invalid values being set to 1
function boundAlpha(a) {
a = parseFloat(a);
if (isNaN(a) || a < 0 || a > 1) {
a = 1;
}
return a;
}
// Take input from [0, n] and return it as [0, 1]
function bound01(n, max) {
if (isOnePointZero(n)) { n = "100%"; }
var processPercent = isPercentage(n);
n = mathMin(max, mathMax(0, parseFloat(n)));
// Automatically convert percentage into number
if (processPercent) {
n = parseInt(n * max, 10) / 100;
}
// Handle floating point rounding errors
if ((Math.abs(n - max) < 0.000001)) {
return 1;
}
// Convert into [0, 1] range if it isn't already
return (n % max) / parseFloat(max);
}
// Force a number between 0 and 1
function clamp01(val) {
return mathMin(1, mathMax(0, val));
}
// Parse a base-16 hex value into a base-10 integer
function parseIntFromHex(val) {
return parseInt(val, 16);
}
// Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1
// <http://stackoverflow.com/questions/7422072/javascript-how-to-detect-number-as-a-decimal-including-1-0>
function isOnePointZero(n) {
return typeof n == "string" && n.indexOf('.') != -1 && parseFloat(n) === 1;
}
// Check to see if string passed in is a percentage
function isPercentage(n) {
return typeof n === "string" && n.indexOf('%') != -1;
}
// Force a hex value to have 2 characters
function pad2(c) {
return c.length == 1 ? '0' + c : '' + c;
}
// Replace a decimal with it's percentage value
function convertToPercentage(n) {
if (n <= 1) {
n = (n * 100) + "%";
}
return n;
}
// Converts a decimal to a hex value
function convertDecimalToHex(d) {
return Math.round(parseFloat(d) * 255).toString(16);
}
// Converts a hex value to a decimal
function convertHexToDecimal(h) {
return (parseIntFromHex(h) / 255);
}
var matchers = (function() {
// <http://www.w3.org/TR/css3-values/#integers>
var CSS_INTEGER = "[-\\+]?\\d+%?";
// <http://www.w3.org/TR/css3-values/#number-value>
var CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?";
// Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome.
var CSS_UNIT = "(?:" + CSS_NUMBER + ")|(?:" + CSS_INTEGER + ")";
// Actual matching.
// Parentheses and commas are optional, but not required.
// Whitespace can take the place of commas or opening paren
var PERMISSIVE_MATCH3 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
var PERMISSIVE_MATCH4 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
return {
CSS_UNIT: new RegExp(CSS_UNIT),
rgb: new RegExp("rgb" + PERMISSIVE_MATCH3),
rgba: new RegExp("rgba" + PERMISSIVE_MATCH4),
hsl: new RegExp("hsl" + PERMISSIVE_MATCH3),
hsla: new RegExp("hsla" + PERMISSIVE_MATCH4),
hsv: new RegExp("hsv" + PERMISSIVE_MATCH3),
hsva: new RegExp("hsva" + PERMISSIVE_MATCH4),
hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
};
})();
// `isValidCSSUnit`
// Take in a single string / number and check to see if it looks like a CSS unit
// (see `matchers` above for definition).
function isValidCSSUnit(color) {
return !!matchers.CSS_UNIT.exec(color);
}
// `stringInputToObject`
// Permissive string parsing. Take in a number of formats, and output an object
// based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}`
function stringInputToObject(color) {
color = color.replace(trimLeft,'').replace(trimRight, '').toLowerCase();
var named = false;
if (names[color]) {
color = names[color];
named = true;
}
else if (color == 'transparent') {
return { r: 0, g: 0, b: 0, a: 0, format: "name" };
}
// Try to match string input using regular expressions.
// Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360]
// Just return an object and let the conversion functions handle that.
// This way the result will be the same whether the tinycolor is initialized with string or object.
var match;
if ((match = matchers.rgb.exec(color))) {
return { r: match[1], g: match[2], b: match[3] };
}
if ((match = matchers.rgba.exec(color))) {
return { r: match[1], g: match[2], b: match[3], a: match[4] };
}
if ((match = matchers.hsl.exec(color))) {
return { h: match[1], s: match[2], l: match[3] };
}
if ((match = matchers.hsla.exec(color))) {
return { h: match[1], s: match[2], l: match[3], a: match[4] };
}
if ((match = matchers.hsv.exec(color))) {
return { h: match[1], s: match[2], v: match[3] };
}
if ((match = matchers.hsva.exec(color))) {
return { h: match[1], s: match[2], v: match[3], a: match[4] };
}
if ((match = matchers.hex8.exec(color))) {
return {
r: parseIntFromHex(match[1]),
g: parseIntFromHex(match[2]),
b: parseIntFromHex(match[3]),
a: convertHexToDecimal(match[4]),
format: named ? "name" : "hex8"
};
}
if ((match = matchers.hex6.exec(color))) {
return {
r: parseIntFromHex(match[1]),
g: parseIntFromHex(match[2]),
b: parseIntFromHex(match[3]),
format: named ? "name" : "hex"
};
}
if ((match = matchers.hex4.exec(color))) {
return {
r: parseIntFromHex(match[1] + '' + match[1]),
g: parseIntFromHex(match[2] + '' + match[2]),
b: parseIntFromHex(match[3] + '' + match[3]),
a: convertHexToDecimal(match[4] + '' + match[4]),
format: named ? "name" : "hex8"
};
}
if ((match = matchers.hex3.exec(color))) {
return {
r: parseIntFromHex(match[1] + '' + match[1]),
g: parseIntFromHex(match[2] + '' + match[2]),
b: parseIntFromHex(match[3] + '' + match[3]),
format: named ? "name" : "hex"
};
}
return false;
}
function validateWCAG2Parms(parms) {
// return valid WCAG2 parms for isReadable.
// If input parms are invalid, return {"level":"AA", "size":"small"}
var level, size;
parms = parms || {"level":"AA", "size":"small"};
level = (parms.level || "AA").toUpperCase();
size = (parms.size || "small").toLowerCase();
if (level !== "AA" && level !== "AAA") {
level = "AA";
}
if (size !== "small" && size !== "large") {
size = "small";
}
return {"level":level, "size":size};
}
// Node: Export function
if (typeof module !== "undefined" && module.exports) {
module.exports = tinycolor;
}
// AMD/requirejs: Define the module
else if (true) {
!(__WEBPACK_AMD_DEFINE_RESULT__ = function () {return tinycolor;}.call(exports, __webpack_require__, exports, module),
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
}
// Browser: Expose to window
else {
window.tinycolor = tinycolor;
}
})(Math);
/***/ }),
/* 1021 */
/***/ (function(module, exports, __webpack_require__) {
var noCase = __webpack_require__(265)
var upperCase = __webpack_require__(327)
/**
* Title case a string.
*
* @param {string} value
* @param {string} [locale]
* @return {string}
*/
module.exports = function (value, locale) {
return noCase(value, locale).replace(/^.| ./g, function (m) {
return upperCase(m, locale)
})
}
/***/ }),
/* 1022 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2016 Titus Wormer
* @license MIT
* @module trough
* @fileoverview Middleware. Inspired by `segmentio/ware`,
* but able to change the values from transformer to
* transformer.
*/
/* Expose. */
module.exports = trough;
/* Methods. */
var slice = [].slice;
/**
* Create new middleware.
*
* @return {Object} - Middlewre.
*/
function trough() {
var fns = [];
var middleware = {};
middleware.run = run;
middleware.use = use;
return middleware;
/**
* Run `fns`. Last argument must be
* a completion handler.
*
* @param {...*} input - Parameters
*/
function run() {
var index = -1;
var input = slice.call(arguments, 0, -1);
var done = arguments[arguments.length - 1];
if (typeof done !== 'function') {
throw new Error('Expected function as last argument, not ' + done);
}
next.apply(null, [null].concat(input));
return;
/**
* Run the next `fn`, if any.
*
* @param {Error?} err - Failure.
* @param {...*} values - Other input.
*/
function next(err) {
var fn = fns[++index];
var params = slice.call(arguments, 0);
var values = params.slice(1);
var length = input.length;
var pos = -1;
if (err) {
done(err);
return;
}
/* Copy non-nully input into values. */
while (++pos < length) {
if (values[pos] === null || values[pos] === undefined) {
values[pos] = input[pos];
}
}
input = values;
/* Next or done. */
if (fn) {
wrap(fn, next).apply(null, input);
} else {
done.apply(null, [null].concat(input));
}
}
}
/**
* Add `fn` to the list.
*
* @param {Function} fn - Anything `wrap` accepts.
*/
function use(fn) {
if (typeof fn !== 'function') {
throw new Error('Expected `fn` to be a function, not ' + fn);
}
fns.push(fn);
return middleware;
}
}
/**
* Wrap `fn`. Can be sync or async; return a promise,
* receive a completion handler, return new values and
* errors.
*
* @param {Function} fn - Thing to wrap.
* @param {Function} next - Completion handler.
* @return {Function} - Wrapped `fn`.
*/
function wrap(fn, next) {
var invoked;
return wrapped;
function wrapped() {
var params = slice.call(arguments, 0);
var callback = fn.length > params.length;
var result;
if (callback) {
params.push(done);
}
try {
result = fn.apply(null, params);
} catch (err) {
/* Well, this is quite the pickle. `fn` received
* a callback and invoked it (thus continuing the
* pipeline), but later also threw an error.
* Were not about to restart the pipeline again,
* so the only thing left to do is to throw the
* thing instea. */
if (callback && invoked) {
throw err;
}
return done(err);
}
if (!callback) {
if (result && typeof result.then === 'function') {
result.then(then, done);
} else if (result instanceof Error) {
done(result);
} else {
then(result);
}
}
}
/**
* Invoke `next`, only once.
*
* @param {Error?} err - Optional error.
*/
function done() {
if (!invoked) {
invoked = true;
next.apply(null, arguments);
}
}
/**
* Invoke `done` with one value.
* Tracks if an error is passed, too.
*
* @param {*} value - Optional value.
*/
function then(value) {
done(null, value);
}
}
/***/ }),
/* 1023 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module unherit
* @fileoverview Create a custom constructor which can be modified
* without affecting the original class.
*/
/* Dependencies. */
var xtend = __webpack_require__(78);
var inherits = __webpack_require__(463);
/* Expose. */
module.exports = unherit;
/**
* Create a custom constructor which can be modified
* without affecting the original class.
*
* @param {Function} Super - Super-class.
* @return {Function} - Constructor acting like `Super`,
* which can be modified without affecting the original
* class.
*/
function unherit(Super) {
var result;
var key;
var value;
inherits(Of, Super);
inherits(From, Of);
/* Clone values. */
result = Of.prototype;
for (key in result) {
value = result[key];
if (value && typeof value === 'object') {
result[key] = 'concat' in value ? value.concat() : xtend(value);
}
}
return Of;
/**
* Constructor accepting a single argument,
* which itself is an `arguments` object.
*/
function From(parameters) {
return Super.apply(this, parameters);
}
/**
* Constructor accepting variadic arguments.
*/
function Of() {
if (!(this instanceof Of)) {
return new From(arguments);
}
return Super.apply(this, arguments);
}
}
/***/ }),
/* 1024 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* Dependencies. */
var has = __webpack_require__(68);
var extend = __webpack_require__(427);
var bail = __webpack_require__(414);
var vfile = __webpack_require__(1030);
var trough = __webpack_require__(1022);
var string = __webpack_require__(328);
var func = __webpack_require__(1032);
var plain = __webpack_require__(468);
/* Expose a frozen processor. */
module.exports = unified().freeze();
var slice = [].slice;
/* Process pipeline. */
var pipeline = trough().use(pipelineParse).use(pipelineRun).use(pipelineStringify);
function pipelineParse(p, ctx) {
ctx.tree = p.parse(ctx.file);
}
function pipelineRun(p, ctx, next) {
p.run(ctx.tree, ctx.file, done);
function done(err, tree, file) {
if (err) {
next(err);
} else {
ctx.tree = tree;
ctx.file = file;
next();
}
}
}
function pipelineStringify(p, ctx) {
ctx.file.contents = p.stringify(ctx.tree, ctx.file);
}
/* Function to create the first processor. */
function unified() {
var attachers = [];
var transformers = trough();
var namespace = {};
var frozen = false;
var freezeIndex = -1;
/* Data management. */
processor.data = data;
/* Lock. */
processor.freeze = freeze;
/* Plug-ins. */
processor.attachers = attachers;
processor.use = use;
/* API. */
processor.parse = parse;
processor.stringify = stringify;
processor.run = run;
processor.runSync = runSync;
processor.process = process;
processor.processSync = processSync;
/* Expose. */
return processor;
/* Create a new processor based on the processor
* in the current scope. */
function processor() {
var destination = unified();
var length = attachers.length;
var index = -1;
while (++index < length) {
destination.use.apply(null, attachers[index]);
}
destination.data(extend(true, {}, namespace));
return destination;
}
/* Freeze: used to signal a processor that has finished
* configuration.
*
* For example, take unified itself. Its frozen.
* Plug-ins should not be added to it. Rather, it should
* be extended, by invoking it, before modifying it.
*
* In essence, always invoke this when exporting a
* processor. */
function freeze() {
var values;
var plugin;
var options;
var transformer;
if (frozen) {
return processor;
}
while (++freezeIndex < attachers.length) {
values = attachers[freezeIndex];
plugin = values[0];
options = values[1];
transformer = null;
if (options === false) {
continue;
}
if (options === true) {
values[1] = undefined;
}
transformer = plugin.apply(processor, values.slice(1));
if (func(transformer)) {
transformers.use(transformer);
}
}
frozen = true;
freezeIndex = Infinity;
return processor;
}
/* Data management.
* Getter / setter for processor-specific informtion. */
function data(key, value) {
if (string(key)) {
/* Set `key`. */
if (arguments.length === 2) {
assertUnfrozen('data', frozen);
namespace[key] = value;
return processor;
}
/* Get `key`. */
return (has(namespace, key) && namespace[key]) || null;
}
/* Set space. */
if (key) {
assertUnfrozen('data', frozen);
namespace = key;
return processor;
}
/* Get space. */
return namespace;
}
/* Plug-in management.
*
* Pass it:
* * an attacher and options,
* * a preset,
* * a list of presets, attachers, and arguments (list
* of attachers and options). */
function use(value) {
var settings;
assertUnfrozen('use', frozen);
if (value === null || value === undefined) {
/* Empty */
} else if (func(value)) {
addPlugin.apply(null, arguments);
} else if (typeof value === 'object') {
if ('length' in value) {
addList(value);
} else {
addPreset(value);
}
} else {
throw new Error('Expected usable value, not `' + value + '`');
}
if (settings) {
namespace.settings = extend(namespace.settings || {}, settings);
}
return processor;
function addPreset(result) {
addList(result.plugins);
if (result.settings) {
settings = extend(settings || {}, result.settings);
}
}
function add(value) {
if (func(value)) {
addPlugin(value);
} else if (typeof value === 'object') {
if ('length' in value) {
addPlugin.apply(null, value);
} else {
addPreset(value);
}
} else {
throw new Error('Expected usable value, not `' + value + '`');
}
}
function addList(plugins) {
var length;
var index;
if (plugins === null || plugins === undefined) {
/* Empty */
} else if (typeof plugins === 'object' && 'length' in plugins) {
length = plugins.length;
index = -1;
while (++index < length) {
add(plugins[index]);
}
} else {
throw new Error('Expected a list of plugins, not `' + plugins + '`');
}
}
function addPlugin(plugin, value) {
var entry = find(plugin);
if (entry) {
if (plain(entry[1]) && plain(value)) {
value = extend(entry[1], value);
}
entry[1] = value;
} else {
attachers.push(slice.call(arguments));
}
}
}
function find(plugin) {
var length = attachers.length;
var index = -1;
var entry;
while (++index < length) {
entry = attachers[index];
if (entry[0] === plugin) {
return entry;
}
}
}
/* Parse a file (in string or VFile representation)
* into a Unist node using the `Parser` on the
* processor. */
function parse(doc) {
var file = vfile(doc);
var Parser;
freeze();
Parser = processor.Parser;
assertParser('parse', Parser);
if (newable(Parser)) {
return new Parser(String(file), file).parse();
}
return Parser(String(file), file); // eslint-disable-line new-cap
}
/* Run transforms on a Unist node representation of a file
* (in string or VFile representation), async. */
function run(node, file, cb) {
assertNode(node);
freeze();
if (!cb && func(file)) {
cb = file;
file = null;
}
if (!cb) {
return new Promise(executor);
}
executor(null, cb);
function executor(resolve, reject) {
transformers.run(node, vfile(file), done);
function done(err, tree, file) {
tree = tree || node;
if (err) {
reject(err);
} else if (resolve) {
resolve(tree);
} else {
cb(null, tree, file);
}
}
}
}
/* Run transforms on a Unist node representation of a file
* (in string or VFile representation), sync. */
function runSync(node, file) {
var complete = false;
var result;
run(node, file, done);
assertDone('runSync', 'run', complete);
return result;
function done(err, tree) {
complete = true;
bail(err);
result = tree;
}
}
/* Stringify a Unist node representation of a file
* (in string or VFile representation) into a string
* using the `Compiler` on the processor. */
function stringify(node, doc) {
var file = vfile(doc);
var Compiler;
freeze();
Compiler = processor.Compiler;
assertCompiler('stringify', Compiler);
assertNode(node);
if (newable(Compiler)) {
return new Compiler(node, file).compile();
}
return Compiler(node, file); // eslint-disable-line new-cap
}
/* Parse a file (in string or VFile representation)
* into a Unist node using the `Parser` on the processor,
* then run transforms on that node, and compile the
* resulting node using the `Compiler` on the processor,
* and store that result on the VFile. */
function process(doc, cb) {
freeze();
assertParser('process', processor.Parser);
assertCompiler('process', processor.Compiler);
if (!cb) {
return new Promise(executor);
}
executor(null, cb);
function executor(resolve, reject) {
var file = vfile(doc);
pipeline.run(processor, {file: file}, done);
function done(err) {
if (err) {
reject(err);
} else if (resolve) {
resolve(file);
} else {
cb(null, file);
}
}
}
}
/* Process the given document (in string or VFile
* representation), sync. */
function processSync(doc) {
var complete = false;
var file;
freeze();
assertParser('processSync', processor.Parser);
assertCompiler('processSync', processor.Compiler);
file = vfile(doc);
process(file, done);
assertDone('processSync', 'process', complete);
return file;
function done(err) {
complete = true;
bail(err);
}
}
}
/* Check if `func` is a constructor. */
function newable(value) {
return func(value) && keys(value.prototype);
}
/* Check if `value` is an object with keys. */
function keys(value) {
var key;
for (key in value) {
return true;
}
return false;
}
/* Assert a parser is available. */
function assertParser(name, Parser) {
if (!func(Parser)) {
throw new Error('Cannot `' + name + '` without `Parser`');
}
}
/* Assert a compiler is available. */
function assertCompiler(name, Compiler) {
if (!func(Compiler)) {
throw new Error('Cannot `' + name + '` without `Compiler`');
}
}
/* Assert the processor is not frozen. */
function assertUnfrozen(name, frozen) {
if (frozen) {
throw new Error(
'Cannot invoke `' + name + '` on a frozen processor.\n' +
'Create a new processor first, by invoking it: ' +
'use `processor()` instead of `processor`.'
);
}
}
/* Assert `node` is a Unist node. */
function assertNode(node) {
if (!node || !string(node.type)) {
throw new Error('Expected node, got `' + node + '`');
}
}
/* Assert that `complete` is `true`. */
function assertDone(name, asyncName, complete) {
if (!complete) {
throw new Error('`' + name + '` finished async. Use `' + asyncName + '` instead');
}
}
/***/ }),
/* 1025 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2016 Titus Wormer
* @license MIT
* @module unist:util:remove-position
* @fileoverview Remove `position`s from a unist tree.
*/
/* eslint-env commonjs */
/* Dependencies. */
var visit = __webpack_require__(1027);
/* Expose. */
module.exports = removePosition;
/**
* Remove `position`s from `tree`.
*
* @param {Node} tree - Node.
* @return {Node} - Node without `position`s.
*/
function removePosition(node, force) {
visit(node, force ? hard : soft);
return node;
}
/**
* Delete `position`.
*/
function hard(node) {
delete node.position;
}
/**
* Remove `position` softly.
*/
function soft(node) {
node.position = undefined;
}
/***/ }),
/* 1026 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var has = __webpack_require__(68);
module.exports = stringify;
function stringify(value) {
/* Nothing. */
if (!value || typeof value !== 'object') {
return null;
}
/* Node. */
if (has(value, 'position') || has(value, 'type')) {
return location(value.position);
}
/* Location. */
if (has(value, 'start') || has(value, 'end')) {
return location(value);
}
/* Position. */
if (has(value, 'line') || has(value, 'column')) {
return position(value);
}
/* ? */
return null;
}
function position(pos) {
if (!pos || typeof pos !== 'object') {
pos = {};
}
return index(pos.line) + ':' + index(pos.column);
}
function location(loc) {
if (!loc || typeof loc !== 'object') {
loc = {};
}
return position(loc.start) + '-' + position(loc.end);
}
function index(value) {
return value && typeof value === 'number' ? value : 1;
}
/***/ }),
/* 1027 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* Expose. */
module.exports = visit;
/* Visit. */
function visit(tree, type, visitor, reverse) {
if (typeof type === 'function') {
reverse = visitor;
visitor = type;
type = null;
}
one(tree);
return;
/* Visit a single node. */
function one(node, index, parent) {
var result;
index = index || (parent ? 0 : null);
if (!type || node.type === type) {
result = visitor(node, index, parent || null);
}
if (node.children && result !== false) {
return all(node.children, node);
}
return result;
}
/* Visit children in `parent`. */
function all(children, parent) {
var step = reverse ? -1 : 1;
var max = children.length;
var min = -1;
var index = (reverse ? max : min) + step;
var child;
while (index > min && index < max) {
child = children[index];
if (child && one(child, index, parent) === false) {
return false;
}
index += step;
}
return true;
}
}
/***/ }),
/* 1028 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var valueEqual = function valueEqual(a, b) {
if (a === b) return true;
if (a == null || b == null) return false;
if (Array.isArray(a)) return Array.isArray(b) && a.length === b.length && a.every(function (item, index) {
return valueEqual(item, b[index]);
});
var aType = typeof a === 'undefined' ? 'undefined' : _typeof(a);
var bType = typeof b === 'undefined' ? 'undefined' : _typeof(b);
if (aType !== bType) return false;
if (aType === 'object') {
var aValue = a.valueOf();
var bValue = b.valueOf();
if (aValue !== a || bValue !== b) return valueEqual(aValue, bValue);
var aKeys = Object.keys(a);
var bKeys = Object.keys(b);
if (aKeys.length !== bKeys.length) return false;
return aKeys.every(function (key) {
return valueEqual(a[key], b[key]);
});
}
return false;
};
exports.default = valueEqual;
/***/ }),
/* 1029 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* @author Titus Wormer
* @copyright 2016 Titus Wormer
* @license MIT
* @module vfile-location
* @fileoverview Convert between positions (line and column-based)
* and offsets (range-based) locations in a virtual file.
*/
/* Expose. */
module.exports = factory;
/**
* Factory.
*
* @param {VFile|string|Buffer} file - Virtual file or document.
*/
function factory(file) {
var contents = indices(String(file));
return {
toPosition: offsetToPositionFactory(contents),
toOffset: positionToOffsetFactory(contents)
};
}
/**
* Factory to get the line and column-based `position` for
* `offset` in the bound indices.
*
* @param {Array.<number>} indices - Indices of
* line-breaks in `value`.
* @return {Function} - Bound method.
*/
function offsetToPositionFactory(indices) {
return offsetToPosition;
/**
* Get the line and column-based `position` for
* `offset` in the bound indices.
*
* @param {number} offset - Offset.
* @return {Position} - Object with `line`, `column`,
* and `offset` properties based on the bound
* `indices`. An empty object when given invalid
* or out of bounds input.
*/
function offsetToPosition(offset) {
var index = -1;
var length = indices.length;
if (offset < 0) {
return {};
}
while (++index < length) {
if (indices[index] > offset) {
return {
line: index + 1,
column: (offset - (indices[index - 1] || 0)) + 1,
offset: offset
};
}
}
return {};
}
}
/**
* Factory to get the `offset` for a line and column-based
* `position` in the bound indices.
*
* @param {Array.<number>} indices - Indices of
* line-breaks in `value`.
* @return {Function} - Bound method.
*/
function positionToOffsetFactory(indices) {
return positionToOffset;
/**
* Get the `offset` for a line and column-based
* `position` in the bound indices.
*
* @param {Position} position - Object with `line` and
* `column` properties.
* @return {number} - Offset. `-1` when given invalid
* or out of bounds input.
*/
function positionToOffset(position) {
var line = position && position.line;
var column = position && position.column;
if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {
return ((indices[line - 2] || 0) + column - 1) || 0;
}
return -1;
}
}
/**
* Get indices of line-breaks in `value`.
*
* @param {string} value - Value.
* @return {Array.<number>} - List of indices of
* line-breaks.
*/
function indices(value) {
var result = [];
var index = value.indexOf('\n');
while (index !== -1) {
result.push(index + 1);
index = value.indexOf('\n', index + 1);
}
result.push(value.length + 1);
return result;
}
/***/ }),
/* 1030 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(process) {
var path = __webpack_require__(266);
var has = __webpack_require__(68);
var replace = __webpack_require__(1012);
var stringify = __webpack_require__(1026);
var buffer = __webpack_require__(465);
var string = __webpack_require__(328);
module.exports = VFile;
var proto = VFile.prototype;
proto.toString = toString;
proto.message = message;
proto.fail = fail;
/* Slight backwards compatibility. Remove in the future. */
proto.warn = message;
/* Order of setting (least specific to most), we need this because
* otherwise `{stem: 'a', path: '~/b.js'}` would throw, as a path
* is needed before a stem can be set. */
var order = [
'history',
'path',
'basename',
'stem',
'extname',
'dirname'
];
/* Construct a new file. */
function VFile(options) {
var prop;
var index;
var length;
if (!options) {
options = {};
} else if (string(options) || buffer(options)) {
options = {contents: options};
} else if ('message' in options && 'messages' in options) {
return options;
}
if (!(this instanceof VFile)) {
return new VFile(options);
}
this.data = {};
this.messages = [];
this.history = [];
this.cwd = process.cwd();
/* Set path related properties in the correct order. */
index = -1;
length = order.length;
while (++index < length) {
prop = order[index];
if (has(options, prop)) {
this[prop] = options[prop];
}
}
/* Set non-path related properties. */
for (prop in options) {
if (order.indexOf(prop) === -1) {
this[prop] = options[prop];
}
}
}
/* Access full path (`~/index.min.js`). */
Object.defineProperty(proto, 'path', {
get: function () {
return this.history[this.history.length - 1];
},
set: function (path) {
assertNonEmpty(path, 'path');
if (path !== this.path) {
this.history.push(path);
}
}
});
/* Access parent path (`~`). */
Object.defineProperty(proto, 'dirname', {
get: function () {
return string(this.path) ? path.dirname(this.path) : undefined;
},
set: function (dirname) {
assertPath(this.path, 'dirname');
this.path = path.join(dirname || '', this.basename);
}
});
/* Access basename (`index.min.js`). */
Object.defineProperty(proto, 'basename', {
get: function () {
return string(this.path) ? path.basename(this.path) : undefined;
},
set: function (basename) {
assertNonEmpty(basename, 'basename');
assertPart(basename, 'basename');
this.path = path.join(this.dirname || '', basename);
}
});
/* Access extname (`.js`). */
Object.defineProperty(proto, 'extname', {
get: function () {
return string(this.path) ? path.extname(this.path) : undefined;
},
set: function (extname) {
var ext = extname || '';
assertPart(ext, 'extname');
assertPath(this.path, 'extname');
if (ext) {
if (ext.charAt(0) !== '.') {
throw new Error('`extname` must start with `.`');
}
if (ext.indexOf('.', 1) !== -1) {
throw new Error('`extname` cannot contain multiple dots');
}
}
this.path = replace(this.path, ext);
}
});
/* Access stem (`index.min`). */
Object.defineProperty(proto, 'stem', {
get: function () {
return string(this.path) ? path.basename(this.path, this.extname) : undefined;
},
set: function (stem) {
assertNonEmpty(stem, 'stem');
assertPart(stem, 'stem');
this.path = path.join(this.dirname || '', stem + (this.extname || ''));
}
});
/* Get the value of the file. */
function toString(encoding) {
var value = this.contents || '';
return buffer(value) ? value.toString(encoding) : String(value);
}
/* Create a message with `reason` at `position`.
* When an error is passed in as `reason`, copies the
* stack. This does not add a message to `messages`. */
function message(reason, position, ruleId) {
var filePath = this.path;
var range = stringify(position) || '1:1';
var location;
var err;
location = {
start: {line: null, column: null},
end: {line: null, column: null}
};
if (position && position.position) {
position = position.position;
}
if (position) {
/* Location. */
if (position.start) {
location = position;
position = position.start;
} else {
/* Position. */
location.start = position;
}
}
err = new VMessage(reason.message || reason);
err.name = (filePath ? filePath + ':' : '') + range;
err.file = filePath || '';
err.reason = reason.message || reason;
err.line = position ? position.line : null;
err.column = position ? position.column : null;
err.location = location;
err.ruleId = ruleId || null;
err.source = null;
err.fatal = false;
if (reason.stack) {
err.stack = reason.stack;
}
this.messages.push(err);
return err;
}
/* Fail. Creates a vmessage, associates it with the file,
* and throws it. */
function fail() {
var message = this.message.apply(this, arguments);
message.fatal = true;
throw message;
}
/* Inherit from `Error#`. */
function VMessagePrototype() {}
VMessagePrototype.prototype = Error.prototype;
VMessage.prototype = new VMessagePrototype();
/* Message properties. */
proto = VMessage.prototype;
proto.file = proto.name = proto.reason = proto.message = proto.stack = '';
proto.fatal = proto.column = proto.line = null;
/* Construct a new file message.
*
* Note: We cannot invoke `Error` on the created context,
* as that adds readonly `line` and `column` attributes on
* Safari 9, thus throwing and failing the data. */
function VMessage(reason) {
this.message = reason;
}
/* Assert that `part` is not a path (i.e., does
* not contain `path.sep`). */
function assertPart(part, name) {
if (part.indexOf(path.sep) !== -1) {
throw new Error('`' + name + '` cannot be a path: did not expect `' + path.sep + '`');
}
}
/* Assert that `part` is not empty. */
function assertNonEmpty(part, name) {
if (!part) {
throw new Error('`' + name + '` cannot be empty');
}
}
/* Assert `path` exists. */
function assertPath(path, name) {
if (!path) {
throw new Error('Setting `' + name + '` requires `path` to be set too');
}
}
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(45)))
/***/ }),
/* 1031 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony export (immutable) */ __webpack_exports__["decode"] = decode;
/* harmony export (immutable) */ __webpack_exports__["encode"] = encode;
var charToInteger = {};
var integerToChar = {};
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='.split( '' ).forEach( function ( char, i ) {
charToInteger[ char ] = i;
integerToChar[ i ] = char;
});
function decode ( string ) {
var result = [];
var shift = 0;
var value = 0;
for ( var i = 0; i < string.length; i += 1 ) {
var integer = charToInteger[ string[i] ];
if ( integer === undefined ) {
throw new Error( 'Invalid character (' + string[i] + ')' );
}
var hasContinuationBit = integer & 32;
integer &= 31;
value += integer << shift;
if ( hasContinuationBit ) {
shift += 5;
} else {
var shouldNegate = value & 1;
value >>= 1;
result.push( shouldNegate ? -value : value );
// reset
value = shift = 0;
}
}
return result;
}
function encode ( value ) {
var result;
if ( typeof value === 'number' ) {
result = encodeInteger( value );
} else {
result = '';
for ( var i = 0; i < value.length; i += 1 ) {
result += encodeInteger( value[i] );
}
}
return result;
}
function encodeInteger ( num ) {
var result = '';
if ( num < 0 ) {
num = ( -num << 1 ) | 1;
} else {
num <<= 1;
}
do {
var clamped = num & 31;
num >>= 5;
if ( num > 0 ) {
clamped |= 32;
}
result += integerToChar[ clamped ];
} while ( num > 0 );
return result;
}
/***/ }),
/* 1032 */
/***/ (function(module, exports) {
module.exports = function isFunction (fn) {
return Object.prototype.toString.call(fn) === '[object Function]'
}
/***/ }),
/* 1033 */
/***/ (function(module, exports) {
module.exports = [
{
"uuid": "081a792c-47e0-4439-924b-2efa9788ae9e",
"id": "nginx",
"name": "Nginx",
"project": "e0ea0c02-55cc-45fe-8064-3e5176a59401",
"instances": 1,
"metrics": [
{
"name": "CPU",
"value": "50%"
},
{
"name": "Memory",
"value": "20%"
},
{
"name": "Network",
"value": "2.9Kb/sec"
}
],
"connections": [
"be227788-74f1-4e5b-a85f-b5c71cbae8d8"
],
"healthy": true,
"datacentres": 1
},
{
"uuid": "be227788-74f1-4e5b-a85f-b5c71cbae8d8",
"id": "wordpress",
"name": "Wordpress",
"project": "e0ea0c02-55cc-45fe-8064-3e5176a59401",
"instances": 2,
"metrics": [
{
"name": "CPU",
"value": "50%"
},
{
"name": "Memory",
"value": "20%"
},
{
"name": "Network",
"value": "2.9Kb/sec"
}
],
"connections": [
"6a0eee76-c019-413b-9d5f-44712b55b993",
"6d31aff4-de1e-4042-a983-fbd23d5c530c",
"4ee4103e-1a52-4099-a48e-01588f597c70"
],
"healthy": true,
"datacentres": 2
},
{
"uuid": "6a0eee76-c019-413b-9d5f-44712b55b993",
"id": "nfs",
"name": "NFS",
"project": "e0ea0c02-55cc-45fe-8064-3e5176a59401",
"instances": 2,
"metrics": [
{
"name": "CPU",
"value": "50%"
},
{
"name": "Memory",
"value": "20%"
},
{
"name": "Network",
"value": "2.9Kb/sec"
}
],
"healthy": true,
"datacentres": 2
},
{
"uuid": "6d31aff4-de1e-4042-a983-fbd23d5c530c",
"id": "memcached",
"name": "Memcached",
"project": "e0ea0c02-55cc-45fe-8064-3e5176a59401",
"instances": 2,
"metrics": [
{
"name": "CPU",
"value": "50%"
},
{
"name": "Memory",
"value": "20%"
},
{
"name": "Network",
"value": "2.9Kb/sec"
}
],
"healthy": true,
"datacentres": 2
},
{
"uuid": "4ee4103e-1a52-4099-a48e-01588f597c70",
"id": "percona",
"name": "Percona",
"project": "e0ea0c02-55cc-45fe-8064-3e5176a59401",
"instances": 2,
"metrics": [
{
"name": "CPU",
"value": "50%"
},
{
"name": "Memory",
"value": "20%"
},
{
"name": "Network",
"value": "2.9Kb/sec"
}
],
"healthy": true,
"datacentres": 1
},
{
"uuid": "97c68055-db88-45c9-ad49-f26da4264777",
"id": "consul",
"name": "Consul",
"project": "e0ea0c02-55cc-45fe-8064-3e5176a59401",
"instances": 2,
"metrics": [
{
"name": "CPU",
"value": "50%"
},
{
"name": "Memory",
"value": "20%"
},
{
"name": "Network",
"value": "2.9Kb/sec"
}
],
"healthy": true,
"datacentres": 2
}
];
/***/ }),
/* 1034 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {/**
* lodash (Custom Build) <https://lodash.com/>
* Build: `lodash modularize exports="npm" -o ./`
* Copyright jQuery Foundation and other contributors <https://jquery.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/
/** Used as references for various `Number` constants. */
var MAX_SAFE_INTEGER = 9007199254740991;
/** `Object#toString` result references. */
var argsTag = '[object Arguments]',
funcTag = '[object Function]',
genTag = '[object GeneratorFunction]';
/** Detect free variable `global` from Node.js. */
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
/** Detect free variable `self`. */
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
/** Used as a reference to the global object. */
var root = freeGlobal || freeSelf || Function('return this')();
/**
* 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;
}
/** 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 objectToString = objectProto.toString;
/** Built-in value references. */
var Symbol = root.Symbol,
propertyIsEnumerable = objectProto.propertyIsEnumerable,
spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;
/**
* 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;
}
/**
* 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]);
}
/**
* 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 ? array.length : 0;
return length ? baseFlatten(array, 1) : [];
}
/**
* 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
*/
function isArguments(value) {
// Safari 8.1 makes `arguments.callee` enumerable in strict mode.
return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
(!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
}
/**
* 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;
/**
* 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);
}
/**
* 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);
}
/**
* 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) {
// The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 8-9 which returns 'object' for typed array and other constructors.
var tag = isObject(value) ? objectToString.call(value) : '';
return tag == funcTag || tag == genTag;
}
/**
* 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;
}
/**
* Checks if `value` is the
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
* @example
*
* _.isObject({});
* // => true
*
* _.isObject([1, 2, 3]);
* // => true
*
* _.isObject(_.noop);
* // => true
*
* _.isObject(null);
* // => false
*/
function isObject(value) {
var type = typeof value;
return !!value && (type == 'object' || type == 'function');
}
/**
* Checks if `value` is object-like. A value is object-like if it's not `null`
* and has a `typeof` result of "object".
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
* @example
*
* _.isObjectLike({});
* // => true
*
* _.isObjectLike([1, 2, 3]);
* // => true
*
* _.isObjectLike(_.noop);
* // => false
*
* _.isObjectLike(null);
* // => false
*/
function isObjectLike(value) {
return !!value && typeof value == 'object';
}
module.exports = flatten;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(16)))
/***/ }),
/* 1035 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(329);
/***/ })
/******/ ]);