does.
+ contentKey = 'textContent' in document.documentElement ? 'textContent' : 'innerText';
+ }
+ return contentKey;
+ }
+
+ module.exports = getTextContentAccessor;
+
+/***/ },
+/* 145 */
+/***/ function(module, exports, __webpack_require__) {
+
+ /**
+ * Copyright 2013-present, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ *
+ */
+
+ 'use strict';
+
+ var ExecutionEnvironment = __webpack_require__(12);
+
+ /**
+ * 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;
+
+/***/ },
+/* 146 */
+/***/ function(module, exports, __webpack_require__) {
+
+ /**
+ * Copyright 2013-present, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ *
+ */
+
+ 'use strict';
+
+ var _prodInvariant = __webpack_require__(4),
+ _assign = __webpack_require__(5);
+
+ var ReactCompositeComponent = __webpack_require__(265);
+ var ReactEmptyComponent = __webpack_require__(134);
+ var ReactHostComponent = __webpack_require__(136);
+
+ var getNextDebugID = __webpack_require__(311);
+ var invariant = __webpack_require__(3);
+ var warning = __webpack_require__(6);
+
+ // To avoid a cyclic dependency, we create the final class in this module
+ var ReactCompositeComponentWrapper = function (element) {
+ this.construct(element);
+ };
+ _assign(ReactCompositeComponentWrapper.prototype, ReactCompositeComponent, {
+ _instantiateReactComponent: instantiateReactComponent
+ });
+
+ function getDeclarationErrorAddendum(owner) {
+ if (owner) {
+ var name = owner.getName();
+ if (name) {
+ return ' Check the render method of `' + name + '`.';
+ }
+ }
+ return '';
+ }
+
+ /**
+ * Check if the type reference is a known internal type. I.e. not a user
+ * provided composite type.
+ *
+ * @param {function} type
+ * @return {boolean} Returns true if this is a valid internal type.
+ */
+ function isInternalComponentType(type) {
+ return typeof type === 'function' && typeof type.prototype !== 'undefined' && typeof type.prototype.mountComponent === 'function' && typeof type.prototype.receiveComponent === 'function';
+ }
+
+ /**
+ * Given a ReactNode, create an instance that will actually be mounted.
+ *
+ * @param {ReactNode} node
+ * @param {boolean} shouldHaveDebugID
+ * @return {object} A new instance of the element's constructor.
+ * @protected
+ */
+ function instantiateReactComponent(node, shouldHaveDebugID) {
+ var instance;
+
+ if (node === null || node === false) {
+ instance = ReactEmptyComponent.create(instantiateReactComponent);
+ } else if (typeof node === 'object') {
+ var element = node;
+ var type = element.type;
+ if (typeof type !== 'function' && typeof type !== 'string') {
+ var info = '';
+ if (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;
+ }
+
+ module.exports = instantiateReactComponent;
+
+/***/ },
+/* 147 */
+/***/ function(module, exports) {
+
+ /**
+ * Copyright 2013-present, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ *
+ *
+ */
+
+ 'use strict';
+
+ /**
+ * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary
+ */
+
+ var supportedInputTypes = {
+ 'color': true,
+ 'date': true,
+ 'datetime': true,
+ 'datetime-local': true,
+ 'email': true,
+ 'month': true,
+ 'number': true,
+ 'password': true,
+ 'range': true,
+ 'search': true,
+ 'tel': true,
+ 'text': true,
+ 'time': true,
+ 'url': true,
+ 'week': true
+ };
+
+ function isTextInputElement(elem) {
+ var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
+
+ if (nodeName === 'input') {
+ return !!supportedInputTypes[elem.type];
+ }
+
+ if (nodeName === 'textarea') {
+ return true;
+ }
+
+ return false;
+ }
+
+ module.exports = isTextInputElement;
+
+/***/ },
+/* 148 */
+/***/ function(module, exports, __webpack_require__) {
+
+ /**
+ * Copyright 2013-present, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ *
+ */
+
+ 'use strict';
+
+ var ExecutionEnvironment = __webpack_require__(12);
+ var escapeTextContentForBrowser = __webpack_require__(61);
+ var setInnerHTML = __webpack_require__(62);
+
+ /**
+ * 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
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;
+
+/***/ },
+/* 149 */
+/***/ function(module, exports, __webpack_require__) {
+
+ /**
+ * Copyright 2013-present, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ *
+ */
+
+ 'use strict';
+
+ var _prodInvariant = __webpack_require__(4);
+
+ var ReactCurrentOwner = __webpack_require__(26);
+ var REACT_ELEMENT_TYPE = __webpack_require__(279);
+
+ var getIteratorFn = __webpack_require__(310);
+ var invariant = __webpack_require__(3);
+ var KeyEscapeUtils = __webpack_require__(82);
+ var warning = __webpack_require__(6);
+
+ 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;
+
+/***/ },
+/* 150 */
+/***/ 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__(24);
+
+ /**
+ * 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;
+
+/***/ },
+/* 151 */
+98,
+/* 152 */
+/***/ function(module, exports) {
+
+ /**
+ * Copyright (c) 2013-present, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ *
+ */
+
+ 'use strict';
+
+ /**
+ * @param {DOMElement} node input/textarea to focus
+ */
+
+ function focusNode(node) {
+ // IE8 can throw "Can't move focus to the control because it is invisible,
+ // not enabled, or of a type that does not accept the focus." for all kinds of
+ // reasons that are too expensive and fragile to test.
+ try {
+ node.focus();
+ } catch (e) {}
+ }
+
+ module.exports = focusNode;
+
+/***/ },
+/* 153 */
+/***/ function(module, exports) {
+
+ 'use strict';
+
+ /**
+ * Copyright (c) 2013-present, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ *
+ * @typechecks
+ */
+
+ /* eslint-disable fb-www/typeof-undefined */
+
+ /**
+ * Same as document.activeElement but wraps in a try-catch block. In IE it is
+ * not safe to call document.activeElement if there is nothing focused.
+ *
+ * The activeElement will be null only if the document or document body is not
+ * yet defined.
+ */
+ function getActiveElement() /*?DOMElement*/{
+ if (typeof document === 'undefined') {
+ return null;
+ }
+ try {
+ return document.activeElement || document.body;
+ } catch (e) {
+ return document.body;
+ }
+ }
+
+ module.exports = getActiveElement;
+
+/***/ },
+/* 154 */
+82,
+/* 155 */
+/***/ function(module, exports) {
+
+ /**
+ * Copyright 2014-present, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ *
+ *
+ */
+
+ 'use strict';
+
+ // The Symbol used to tag the ReactElement type. If there is no native Symbol
+ // nor polyfill, then a plain number is used for performance.
+
+ var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7;
+
+ module.exports = REACT_ELEMENT_TYPE;
+
+/***/ },
+/* 156 */
+/***/ function(module, exports, __webpack_require__) {
+
+ /**
+ * Copyright 2013-present, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ *
+ *
+ */
+
+ 'use strict';
+
+ var ReactPropTypeLocationNames = {};
+
+ if (false) {
+ ReactPropTypeLocationNames = {
+ prop: 'prop',
+ context: 'context',
+ childContext: 'child context'
+ };
+ }
+
+ module.exports = ReactPropTypeLocationNames;
+
+/***/ },
+/* 157 */
+/***/ function(module, exports, __webpack_require__) {
+
+ /**
+ * Copyright 2013-present, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ *
+ *
+ */
+
+ 'use strict';
+
+ var 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;
+
+/***/ },
+/* 158 */
+/***/ function(module, exports) {
+
+ /**
+ * Copyright 2013-present, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ *
+ *
+ */
+
+ 'use strict';
+
+ /* global Symbol */
+
+ var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
+ var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
+
+ /**
+ * Returns the iterator method function contained on the iterable object.
+ *
+ * Be sure to invoke the function with the iterable as context:
+ *
+ * var iteratorFn = getIteratorFn(myIterable);
+ * if (iteratorFn) {
+ * var iterator = iteratorFn.call(myIterable);
+ * ...
+ * }
+ *
+ * @param {?object} maybeIterable
+ * @return {?function}
+ */
+ function getIteratorFn(maybeIterable) {
+ var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
+ if (typeof iteratorFn === 'function') {
+ return iteratorFn;
+ }
+ }
+
+ module.exports = getIteratorFn;
+
+/***/ },
+/* 159 */
+/***/ function(module, exports, __webpack_require__) {
+
+ /**
+ * Copyright 2013-present, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ *
+ */
+ 'use strict';
+
+ var _prodInvariant = __webpack_require__(42);
+
+ var ReactElement = __webpack_require__(41);
+
+ var invariant = __webpack_require__(32);
+
+ /**
+ * 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;
+
+/***/ },
+/* 160 */
+/***/ function(module, exports, __webpack_require__) {
+
+ /**
+ * Copyright 2013-present, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ *
+ */
+
+ 'use strict';
+
+ var _prodInvariant = __webpack_require__(42);
+
+ var ReactCurrentOwner = __webpack_require__(26);
+ var REACT_ELEMENT_TYPE = __webpack_require__(155);
+
+ var getIteratorFn = __webpack_require__(158);
+ var invariant = __webpack_require__(32);
+ var KeyEscapeUtils = __webpack_require__(154);
+ var warning = __webpack_require__(27);
+
+ 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;
+
+/***/ },
+/* 161 */
+/***/ function(module, exports, __webpack_require__) {
+
+ var urljoin = __webpack_require__(20);
+ var PopupHandler = __webpack_require__(162);
+
+ function PluginHandler(webAuth) {
+ this.webAuth = webAuth;
+ }
+
+ PluginHandler.prototype.processParams = function (params) {
+ params.redirectUri = urljoin('https://' + params.domain, 'mobile');
+ delete params.owp;
+ return params;
+ };
+
+ PluginHandler.prototype.getPopupHandler = function () {
+ return new PopupHandler(this.webAuth);
+ };
+
+ module.exports = PluginHandler;
+
+
+/***/ },
+/* 162 */
+/***/ function(module, exports, __webpack_require__) {
+
+ var windowHandler = __webpack_require__(21);
+ var qs = __webpack_require__(43);
+
+ function PopupHandler(webAuth) {
+ this.webAuth = webAuth;
+ this._current_popup = null;
+ this.options = null;
+ }
+
+ PopupHandler.prototype.preload = function (options) {
+ var _this = this;
+ var _window = windowHandler.getWindow();
+
+ var url = options.url || 'about:blank';
+ var popupOptions = options.popupOptions || {};
+
+ popupOptions.location = 'yes';
+ delete popupOptions.width;
+ delete popupOptions.height;
+
+ var windowFeatures = qs.build(popupOptions, ',', false);
+
+ if (this._current_popup && !this._current_popup.closed) {
+ return this._current_popup;
+ }
+
+ this._current_popup = _window.open(url, '_blank', windowFeatures);
+
+ this._current_popup.kill = function (success) {
+ _this._current_popup.success = success;
+ this.close();
+ _this._current_popup = null;
+ };
+
+ return this._current_popup;
+ };
+
+ PopupHandler.prototype.load = function (url, _, options, cb) {
+ var _this = this;
+ this.url = url;
+ this.options = options;
+ if (!this._current_popup) {
+ options.url = url;
+ this.preload(options);
+ } else {
+ this._current_popup.location.href = url;
+ }
+
+ this.transientErrorHandler = function (event) {
+ _this.errorHandler(event, cb);
+ };
+
+ this.transientStartHandler = function (event) {
+ _this.startHandler(event, cb);
+ };
+
+ this.transientExitHandler = function () {
+ _this.exitHandler(cb);
+ };
+
+ this._current_popup.addEventListener('loaderror', this.transientErrorHandler);
+ this._current_popup.addEventListener('loadstart', this.transientStartHandler);
+ this._current_popup.addEventListener('exit', this.transientExitHandler);
+ };
+
+ PopupHandler.prototype.errorHandler = function (event, cb) {
+ if (!this._current_popup) {
+ return;
+ }
+
+ this._current_popup.kill(true);
+
+ cb({ error: 'window_error', errorDescription: event.message });
+ };
+
+ PopupHandler.prototype.unhook = function () {
+ this._current_popup.removeEventListener('loaderror', this.transientErrorHandler);
+ this._current_popup.removeEventListener('loadstart', this.transientStartHandler);
+ this._current_popup.removeEventListener('exit', this.transientExitHandler);
+ };
+
+ PopupHandler.prototype.exitHandler = function (cb) {
+ if (!this._current_popup) {
+ return;
+ }
+
+ // when the modal is closed, this event is called which ends up removing the
+ // event listeners. If you move this before closing the modal, it will add ~1 sec
+ // delay between the user being redirected to the callback and the popup gets closed.
+ this.unhook();
+
+ if (!this._current_popup.success) {
+ cb({ error: 'window_closed', errorDescription: 'Browser window closed' });
+ }
+ };
+
+ PopupHandler.prototype.startHandler = function (event, cb) {
+ var _this = this;
+
+ if (!this._current_popup) {
+ return;
+ }
+ var parts = event.url.split('#');
+
+ if (parts.length === 1) {
+ return;
+ }
+
+ var opts = { hash: parts.pop() };
+
+ if (this.options.nonce) {
+ opts.nonce = this.options.nonce;
+ }
+
+ _this._current_popup.kill(true);
+
+ this.webAuth.parseHash(
+ opts,
+ function (error, result) {
+ if (error || result) {
+ cb(error, result);
+ }
+ }
+ );
+ };
+
+ module.exports = PopupHandler;
+
+
+/***/ },
+/* 163 */
+/***/ function(module, exports, __webpack_require__) {
+
+ var urljoin = __webpack_require__(20);
+
+ var objectHelper = __webpack_require__(15);
+ var assert = __webpack_require__(28);
+ var responseHandler = __webpack_require__(34);
+
+ function DBConnection(request, options) {
+ this.baseOptions = options;
+ this.request = request;
+ }
+
+ /**
+ * Signup a new user
+ *
+ * @method signup
+ * @param {Object} options: https://auth0.com/docs/api/authentication#!#post--dbconnections-signup
+ * @param {Function} cb
+ */
+ DBConnection.prototype.signup = function (options, cb) {
+ var url;
+ var body;
+
+ assert.check(options, { type: 'object', message: 'options parameter is not valid' }, {
+ connection: { type: 'string', message: 'connection option is required' },
+ email: { type: 'string', message: 'email option is required' },
+ password: { type: 'string', message: 'password option is required' }
+ });
+ assert.check(cb, { type: 'function', message: 'cb parameter is not valid' });
+
+ url = urljoin(this.baseOptions.rootUrl, 'dbconnections', 'signup');
+
+ body = objectHelper.merge(this.baseOptions, ['clientID'])
+ .with(options);
+
+ body = objectHelper.blacklist(body, ['scope']);
+
+ body = objectHelper.toSnakeCase(body, ['auth0Client']);
+
+ return this.request
+ .post(url)
+ .send(body)
+ .end(responseHandler(cb));
+ };
+
+ /**
+ * Initializes the change password flow
+ *
+ * @method signup
+ * @param {Object} options: https://auth0.com/docs/api/authentication#!#post--dbconnections-change_password
+ * @param {Function} cb
+ */
+ DBConnection.prototype.changePassword = function (options, cb) {
+ var url;
+ var body;
+
+ assert.check(options, { type: 'object', message: 'options parameter is not valid' }, {
+ connection: { type: 'string', message: 'connection option is required' },
+ email: { type: 'string', message: 'email option is required' }
+ });
+ assert.check(cb, { type: 'function', message: 'cb parameter is not valid' });
+
+ url = urljoin(this.baseOptions.rootUrl, 'dbconnections', 'change_password');
+
+ body = objectHelper.merge(this.baseOptions, ['clientID'])
+ .with(options, ['email', 'connection']);
+
+ body = objectHelper.toSnakeCase(body, ['auth0Client']);
+
+ return this.request
+ .post(url)
+ .send(body)
+ .end(responseHandler(cb));
+ };
+
+ module.exports = DBConnection;
+
+
+/***/ },
+/* 164 */
+/***/ function(module, exports, __webpack_require__) {
+
+ var urljoin = __webpack_require__(20);
+
+ var objectHelper = __webpack_require__(15);
+ var assert = __webpack_require__(28);
+ var qs = __webpack_require__(43);
+ var responseHandler = __webpack_require__(34);
+
+ function PasswordlessAuthentication(request, options) {
+ this.baseOptions = options;
+ this.request = request;
+ }
+
+ /**
+ * Builds and returns the passwordless TOTP verify url in order to initialize a new authN/authZ transaction
+ *
+ * @method buildVerifyUrl
+ * @param {Object} options
+ * @param {Function} cb
+ */
+ PasswordlessAuthentication.prototype.buildVerifyUrl = function (options) {
+ var params;
+ var qString;
+
+ /* eslint-disable */
+ assert.check(options, { type: 'object', message: 'options parameter is not valid' }, {
+ connection: { type: 'string', message: 'connection option is required' },
+ verificationCode: { type: 'string', message: 'verificationCode option is required' },
+ phoneNumber: { optional: false, type: 'string', message: 'phoneNumber option is required',
+ condition: function (o) { return !o.email; } },
+ email: { optional: false, type: 'string', message: 'email option is required',
+ condition: function (o) { return !o.phoneNumber; } }
+ });
+ /* eslint-enable */
+
+ params = objectHelper.merge(this.baseOptions, [
+ 'clientID',
+ 'responseType',
+ 'responseMode',
+ 'redirectUri',
+ 'scope',
+ 'audience'
+ ]).with(options);
+
+ // eslint-disable-next-line
+ if (this.baseOptions._sendTelemetry) {
+ params.auth0Client = this.request.getTelemetryData();
+ }
+
+ params = objectHelper.toSnakeCase(params, ['auth0Client']);
+
+ qString = qs.build(params);
+
+ return urljoin(this.baseOptions.rootUrl, 'passwordless', 'verify_redirect', '?' + qString);
+ };
+
+ /**
+ * Initializes a new passwordless authN/authZ transaction
+ *
+ * @method start
+ * @param {Object} options: https://auth0.com/docs/api/authentication#passwordless
+ * @param {Function} cb
+ */
+ PasswordlessAuthentication.prototype.start = function (options, cb) {
+ var url;
+ var body;
+
+ /* eslint-disable */
+ assert.check(options, { type: 'object', message: 'options parameter is not valid' }, {
+ connection: { type: 'string', message: 'connection option is required' },
+ send: { type: 'string', message: 'send option is required', values: ['link', 'code'],
+ value_message: 'send is not valid ([link, code])' },
+ phoneNumber: { optional: true, type: 'string', message: 'phoneNumber option is required',
+ condition: function (o) { return o.send === 'code' || !o.email; } },
+ email: { optional: true, type: 'string', message: 'email option is required',
+ condition: function (o) { return o.send === 'link' || !o.phoneNumber; } },
+ authParams: { optional: true, type: 'object', message: 'authParams option is required' }
+ });
+ /* eslint-enable */
+
+ assert.check(cb, { type: 'function', message: 'cb parameter is not valid' });
+
+ url = urljoin(this.baseOptions.rootUrl, 'passwordless', 'start');
+
+ body = objectHelper.merge(this.baseOptions, [
+ 'clientID',
+ 'responseType',
+ 'redirectUri',
+ 'scope'
+ ]).with(options);
+
+ if (body.scope) {
+ body.authParams = body.authParams || {};
+ body.authParams.scope = body.scope;
+ }
+
+ if (body.redirectUri) {
+ body.authParams = body.authParams || {};
+ body.authParams.redirect_uri = body.redirectUri;
+ }
+
+ if (body.responseType) {
+ body.authParams = body.authParams || {};
+ body.authParams.response_type = body.responseType;
+ }
+
+ delete body.redirectUri;
+ delete body.responseType;
+ delete body.scope;
+
+ body = objectHelper.toSnakeCase(body, ['auth0Client', 'authParams']);
+
+ return this.request
+ .post(url)
+ .send(body)
+ .end(responseHandler(cb));
+ };
+
+ /**
+ * Verifies the passwordless TOTP and returns an error if any.
+ *
+ * @method buildVerifyUrl
+ * @param {Object} options
+ * @param {Function} cb
+ */
+ PasswordlessAuthentication.prototype.verify = function (options, cb) {
+ var url;
+ var cleanOption;
+
+ /* eslint-disable */
+ assert.check(options, { type: 'object', message: 'options parameter is not valid' }, {
+ connection: { type: 'string', message: 'connection option is required' },
+ verificationCode: { type: 'string', message: 'verificationCode option is required' },
+ phoneNumber: { optional: false, type: 'string', message: 'phoneNumber option is required',
+ condition: function (o) { return !o.email; } },
+ email: { optional: false, type: 'string', message: 'email option is required',
+ condition: function (o) { return !o.phoneNumber; } }
+ });
+ /* eslint-enable */
+
+ assert.check(cb, { type: 'function', message: 'cb parameter is not valid' });
+
+ cleanOption = objectHelper.toSnakeCase(options, ['auth0Client']);
+
+ url = urljoin(this.baseOptions.rootUrl, 'passwordless', 'verify');
+
+ return this.request
+ .post(url)
+ .send(cleanOption)
+ .end(responseHandler(cb));
+ };
+
+ module.exports = PasswordlessAuthentication;
+
+
+/***/ },
+/* 165 */
+/***/ function(module, exports, __webpack_require__) {
+
+ var windowHandler = __webpack_require__(21);
+ var base64Url = __webpack_require__(104);
+
+ function create(name, value, days) {
+ var date;
+ var expires;
+
+ if (windowHandler.getDocument().cookie === undefined
+ || windowHandler.getDocument().cookie === null) {
+ throw new Error('cookie storage not available');
+ }
+
+ if (days) {
+ date = new Date();
+ date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
+ expires = '; expires=' + date.toGMTString();
+ } else {
+ expires = '';
+ }
+
+ windowHandler.getDocument().cookie = name + '=' + base64Url.encode(value) + expires + '; path=/';
+ }
+
+ function read(name) {
+ var i;
+ var cookie;
+ var cookies;
+ var nameEQ = name + '=';
+
+ if (windowHandler.getDocument().cookie === undefined
+ || windowHandler.getDocument().cookie === null) {
+ throw new Error('cookie storage not available');
+ }
+
+ cookies = windowHandler.getDocument().cookie.split(';');
+
+ for (i = 0; i < cookies.length; i++) {
+ cookie = cookies[i];
+ while (cookie.charAt(0) === ' ') {
+ cookie = cookie.substring(1, cookie.length);
+ }
+ if (cookie.indexOf(nameEQ) === 0) {
+ return base64Url.decode(cookie.substring(nameEQ.length, cookie.length));
+ }
+ }
+
+ return null;
+ }
+
+ function erase(name) {
+ create(name, '', -1);
+ }
+
+ module.exports = {
+ create: create,
+ read: read,
+ erase: erase
+ };
+
+
+/***/ },
+/* 166 */
+/***/ function(module, exports, __webpack_require__) {
+
+ var windowHelper = __webpack_require__(21);
+
+ function IframeHandler(options) {
+ this.auth0 = options.auth0;
+ this.url = options.url;
+ this.callback = options.callback;
+ this.timeout = options.timeout || 60 * 1000;
+ this.timeoutCallback = options.timeoutCallback || null;
+ this.usePostMessage = options.usePostMessage || false;
+ this.iframe = null;
+ this.timeoutHandle = null;
+ this._destroyTimeout = null;
+ this.transientMessageEventListener = null;
+ this.transientEventListener = null;
+ }
+
+ IframeHandler.prototype.init = function () {
+ var _this = this;
+ var _window = windowHelper.getWindow();
+
+ this.iframe = _window.document.createElement('iframe');
+ this.iframe.style.display = 'none';
+ this.iframe.src = this.url;
+
+ if (this.usePostMessage) {
+ // Workaround to avoid using bind that does not work in IE8
+ this.transientMessageEventListener = function (e) {
+ _this.messageEventListener(e);
+ };
+
+ _window.addEventListener('message', this.transientMessageEventListener, false);
+ } else {
+ // Workaround to avoid using bind that does not work in IE8
+ this.transientEventListener = function () {
+ _this.loadEventListener();
+ };
+
+ this.iframe.addEventListener('load', this.transientEventListener, false);
+ }
+
+ _window.document.body.appendChild(this.iframe);
+
+ this.timeoutHandle = setTimeout(function () {
+ _this.timeoutHandler();
+ }, this.timeout);
+ };
+
+ IframeHandler.prototype.messageEventListener = function (e) {
+ this.destroy();
+ this.callbackHandler(e.data);
+ };
+
+ IframeHandler.prototype.loadEventListener = function () {
+ var _this = this;
+ this.auth0.parseHash(
+ { hash: this.iframe.contentWindow.location.hash },
+ function (error, result) {
+ if (error || result) {
+ _this.destroy();
+ _this.callback(error, result);
+ }
+ }
+ );
+ };
+
+ IframeHandler.prototype.callbackHandler = function (result) {
+ var error = null;
+
+ if (result && result.error) {
+ error = result;
+ result = null;
+ }
+
+ this.callback(error, result);
+ };
+
+ IframeHandler.prototype.timeoutHandler = function () {
+ this.destroy();
+ if (this.timeoutCallback) {
+ this.timeoutCallback();
+ }
+ };
+
+ IframeHandler.prototype.destroy = function () {
+ var _this = this;
+ var _window = windowHelper.getWindow();
+
+ clearTimeout(this.timeoutHandle);
+
+ this._destroyTimeout = setTimeout(function () {
+ if (_this.usePostMessage) {
+ _window.removeEventListener('message', _this.transientMessageEventListener, false);
+ } else {
+ _this.iframe.removeEventListener('load', _this.transientEventListener, false);
+ }
+
+ _window.document.body.removeChild(_this.iframe);
+ }, 0);
+ };
+
+ module.exports = IframeHandler;
+
+
+/***/ },
+/* 167 */
+/***/ function(module, exports) {
+
+ /* eslint-disable no-continue */
+
+ function get() {
+ if (!Object.assign) {
+ return objectAssignPolyfill;
+ }
+
+ return Object.assign;
+ }
+
+ function objectAssignPolyfill(target) {
+ 'use strict';
+ 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;
+ }
+
+ module.exports = {
+ get: get,
+ objectAssignPolyfill: objectAssignPolyfill
+ };
+
+
+/***/ },
+/* 168 */
+/***/ function(module, exports, __webpack_require__) {
+
+ var objectHelper = __webpack_require__(15);
+
+ var tokenParams = [
+ // auth0
+ 'realm',
+ 'audience',
+ // oauth2
+ 'client_id',
+ 'client_secret',
+ 'redirect_uri',
+ 'scope',
+ 'code',
+ 'grant_type',
+ 'username',
+ 'password',
+ 'refresh_token',
+ 'assertion',
+ 'client_assertion',
+ 'client_assertion_type',
+ 'code_verifier'
+ ];
+
+ var authorizeParams = [
+ // auth0
+ 'connection',
+ 'connection_scope',
+ 'auth0Client',
+ 'owp',
+ 'device',
+
+ 'protocol',
+ '_csrf',
+ '_intstate',
+
+ // oauth2
+ 'client_id',
+ 'response_type',
+ 'response_mode',
+ 'redirect_uri',
+ 'audience',
+ 'scope',
+ 'state',
+ 'nonce',
+ 'display',
+ 'prompt',
+ 'max_age',
+ 'ui_locales',
+ 'claims_locales',
+ 'id_token_hint',
+ 'login_hint',
+ 'acr_values',
+ 'claims',
+ 'registration',
+ 'request',
+ 'request_uri',
+ 'code_challenge',
+ 'code_challenge_method'
+ ];
+
+ function oauthAuthorizeParams(warn, params) {
+ var notAllowed = objectHelper.getKeysNotIn(params, authorizeParams);
+
+ if (notAllowed.length > 0) {
+ warn.warning('Following parameters are not allowed on the `/authorize` endpoing: [' + notAllowed.join(',') + ']');
+ }
+
+ return params;
+ }
+
+ function oauthTokenParams(warn, params) {
+ return objectHelper.pick(params, tokenParams);
+ }
+
+ module.exports = {
+ oauthTokenParams: oauthTokenParams,
+ oauthAuthorizeParams: oauthAuthorizeParams
+ };
+
+
+/***/ },
+/* 169 */
+/***/ function(module, exports, __webpack_require__) {
+
+ var version = __webpack_require__(53);
+
+ function PluginHandler(webAuth, plugins) {
+ this.plugins = plugins;
+
+ for (var a = 0; a < this.plugins.length; a++) {
+ if (this.plugins[a].version !== version.raw) {
+ var pluginName = '';
+
+ if (this.plugins[a].constructor && this.plugins[a].constructor.name) {
+ pluginName = this.plugins[a].constructor.name;
+ }
+
+ throw new Error('Plugin ' + pluginName + ' version (' + this.plugins[a].version + ') ' +
+ 'is not compatible with the SDK version (' + version.raw + ')');
+ }
+
+ this.plugins[a].setWebAuth(webAuth);
+ }
+ }
+
+ PluginHandler.prototype.get = function (extensibilityPoint) {
+ for (var a = 0; a < this.plugins.length; a++) {
+ if (this.plugins[a].supports(extensibilityPoint)) {
+ return this.plugins[a].init();
+ }
+ }
+
+ return null;
+ };
+
+ module.exports = PluginHandler;
+
+
+/***/ },
+/* 170 */
+/***/ function(module, exports, __webpack_require__) {
+
+ /* eslint-disable no-restricted-syntax */
+ /* eslint-disable guard-for-in */
+ var WinChan = __webpack_require__(351);
+
+ var windowHandler = __webpack_require__(21);
+ var objectHelper = __webpack_require__(15);
+ var qs = __webpack_require__(43);
+
+ function PopupHandler() {
+ this._current_popup = null;
+ }
+
+ PopupHandler.prototype.calculatePosition = function (options) {
+ var width = options.width || 500;
+ var height = options.height || 600;
+ var _window = windowHandler.getWindow();
+
+ var screenX = typeof _window.screenX !== 'undefined' ? _window.screenX : _window.screenLeft;
+ var screenY = typeof _window.screenY !== 'undefined' ? _window.screenY : _window.screenTop;
+
+ var outerWidth = typeof _window.outerWidth !== 'undefined'
+ ? _window.outerWidth
+ : _window.document.body.clientWidth;
+
+ var outerHeight = typeof _window.outerHeight !== 'undefined'
+ ? _window.outerHeight
+ : _window.document.body.clientHeight;
+
+ var left = screenX + ((outerWidth - width) / 2);
+ var top = screenY + ((outerHeight - height) / 2);
+
+ return { width: width, height: height, left: left, top: top };
+ };
+
+ PopupHandler.prototype.preload = function (options) {
+ var _this = this;
+ var _window = windowHandler.getWindow();
+ var popupPosition = this.calculatePosition(options.popupOptions || {});
+ var popupOptions = objectHelper.merge(popupPosition).with(options.popupOptions);
+ var url = options.url || 'about:blank';
+ var windowFeatures = qs.build(popupOptions, ',', false);
+
+ if (this._current_popup && !this._current_popup.closed) {
+ return this._current_popup;
+ }
+
+ this._current_popup = _window.open(url, 'auth0_signup_popup', windowFeatures);
+
+ this._current_popup.kill = function () {
+ this.close();
+ _this._current_popup = null;
+ };
+
+ return this._current_popup;
+ };
+
+ PopupHandler.prototype.load = function (url, relayUrl, options, cb) {
+ var _this = this;
+ var popupPosition = this.calculatePosition(options.popupOptions || {});
+ var popupOptions = objectHelper.merge(popupPosition).with(options.popupOptions);
+
+ var winchanOptions = {
+ url: url,
+ relay_url: relayUrl,
+ window_features: qs.build(popupOptions, ',', false),
+ popup: this._current_popup,
+ params: options
+ };
+
+ var popup = WinChan.open(winchanOptions, function (err, data) {
+ _this._current_popup = null;
+ return cb(err, data);
+ });
+
+ popup.focus();
+
+ return popup;
+ };
+
+ module.exports = PopupHandler;
+
+
+/***/ },
+/* 171 */
+/***/ function(module, exports, __webpack_require__) {
+
+ var windowHelper = __webpack_require__(21);
+
+ function randomString(length) {
+ // eslint-disable-next-line
+ var bytes = new Uint8Array(length);
+ var result = [];
+ var charset = '0123456789ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvwxyz-._~';
+
+ var cryptoObj = windowHelper.getWindow().crypto || windowHelper.getWindow().msCrypto;
+ if (!cryptoObj) {
+ return null;
+ }
+
+ var random = cryptoObj.getRandomValues(bytes);
+
+ for (var a = 0; a < random.length; a++) {
+ result.push(charset[random[a] % charset.length]);
+ }
+
+ return result.join('');
+ }
+
+ module.exports = {
+ randomString: randomString
+ };
+
+
+/***/ },
+/* 172 */
+/***/ function(module, exports, __webpack_require__) {
+
+ var StorageHandler = __webpack_require__(175);
+ var storage;
+
+ function getStorage(force) {
+ if (!storage || force) {
+ storage = new StorageHandler();
+ }
+ return storage;
+ }
+
+ module.exports = {
+ getItem: function (key) {
+ var value = getStorage().getItem(key);
+ return value ? JSON.parse(value) : value;
+ },
+ removeItem: function (key) {
+ return getStorage().removeItem(key);
+ },
+ setItem: function (key, value) {
+ var json = JSON.stringify(value);
+ return getStorage().setItem(key, json);
+ },
+ reload: function () {
+ getStorage(true);
+ }
+ };
+
+
+/***/ },
+/* 173 */
+/***/ function(module, exports, __webpack_require__) {
+
+ var cookies = __webpack_require__(165);
+
+ function CookieStorage() {}
+
+ CookieStorage.prototype.getItem = function (key) {
+ return cookies.read(key);
+ };
+
+ CookieStorage.prototype.removeItem = function (key) {
+ cookies.erase(key);
+ };
+
+ CookieStorage.prototype.setItem = function (key, value) {
+ cookies.create(key, value, 1);
+ };
+
+ module.exports = CookieStorage;
+
+
+/***/ },
+/* 174 */
+/***/ function(module, exports) {
+
+ function DummyStorage() {}
+
+ DummyStorage.prototype.getItem = function () { return null; };
+
+ DummyStorage.prototype.removeItem = function () {};
+
+ DummyStorage.prototype.setItem = function () {};
+
+ module.exports = DummyStorage;
+
+
+/***/ },
+/* 175 */
+/***/ function(module, exports, __webpack_require__) {
+
+ var windowHandler = __webpack_require__(21);
+ var DummyStorage = __webpack_require__(174);
+ var CookieStorage = __webpack_require__(173);
+ var Warn = __webpack_require__(51);
+
+ function StorageHandler() {
+ this.warn = new Warn({});
+ this.storage = windowHandler.getWindow().localStorage || new CookieStorage();
+ }
+
+ StorageHandler.prototype.failover = function () {
+ if (this.storage instanceof DummyStorage) {
+ this.warn.warning('DummyStorage: ignore failover');
+ return;
+ } else if (this.storage instanceof CookieStorage) {
+ this.warn.warning('CookieStorage: failing over DummyStorage');
+ this.storage = new DummyStorage();
+ } else {
+ this.warn.warning('LocalStorage: failing over CookieStorage');
+ this.storage = new CookieStorage();
+ }
+ };
+
+ StorageHandler.prototype.getItem = function (key) {
+ try {
+ return this.storage.getItem(key);
+ } catch (e) {
+ this.warn.warning(e);
+ this.failover();
+ return this.getItem(key);
+ }
+ };
+
+ StorageHandler.prototype.removeItem = function (key) {
+ try {
+ return this.storage.removeItem(key);
+ } catch (e) {
+ this.warn.warning(e);
+ this.failover();
+ return this.removeItem(key);
+ }
+ };
+
+ StorageHandler.prototype.setItem = function (key, value) {
+ try {
+ return this.storage.setItem(key, value);
+ } catch (e) {
+ this.warn.warning(e);
+ this.failover();
+ return this.setItem(key, value);
+ }
+ };
+
+ module.exports = StorageHandler;
+
+
+/***/ },
+/* 176 */
+/***/ function(module, exports, __webpack_require__) {
+
+ var urljoin = __webpack_require__(20);
+
+ var RequestBuilder = __webpack_require__(65);
+ var assert = __webpack_require__(28);
+ var responseHandler = __webpack_require__(34);
+
+ /**
+ * Auth0 Management API Client (methods allowed to be called from the browser only)
+ * @constructor
+ * @param {Object} options
+ * @param {Object} options.domain
+ * @param {Object} options.token
+ */
+ function Management(options) {
+ /* eslint-disable */
+ assert.check(options, { type: 'object', message: 'options parameter is not valid' }, {
+ domain: { type: 'string', message: 'domain option is required' },
+ token: { type: 'string', message: 'token option is required' },
+ _sendTelemetry: { optional: true, type: 'boolean', message: '_sendTelemetry option is not valid' },
+ _telemetryInfo: { optional: true, type: 'object', message: '_telemetryInfo option is not valid' }
+ });
+ /* eslint-enable */
+
+ this.baseOptions = options;
+
+ this.baseOptions.headers = { Authorization: 'Bearer ' + this.baseOptions.token };
+
+ this.request = new RequestBuilder(this.baseOptions);
+ this.baseOptions.rootUrl = urljoin('https://' + this.baseOptions.domain, 'api', 'v2');
+ }
+
+ /**
+ * Returns the user profile. https://auth0.com/docs/api/management/v2#!/Users/get_users_by_id
+ *
+ * @method getUser
+ * @param {String} userId
+ * @param {Function} cb
+ */
+ Management.prototype.getUser = function (userId, cb) {
+ var url;
+
+ assert.check(userId, { type: 'string', message: 'userId parameter is not valid' });
+ assert.check(cb, { type: 'function', message: 'cb parameter is not valid' });
+
+ url = urljoin(this.baseOptions.rootUrl, 'users', userId);
+
+ return this.request
+ .get(url)
+ .end(responseHandler(cb, { ignoreCasing: true }));
+ };
+
+ /**
+ * Updates the user metdata. It will patch the user metdata with the attributes sent.
+ * https://auth0.com/docs/api/management/v2#!/Users/patch_users_by_id
+ *
+ * @method patchUserMetadata
+ * @param {String} userId
+ * @param {Object} userMetadata
+ * @param {Function} cb
+ */
+ Management.prototype.patchUserMetadata = function (userId, userMetadata, cb) {
+ var url;
+
+ assert.check(userId, { type: 'string', message: 'userId parameter is not valid' });
+ assert.check(userMetadata, { type: 'object', message: 'userMetadata parameter is not valid' });
+ assert.check(cb, { type: 'function', message: 'cb parameter is not valid' });
+
+ url = urljoin(this.baseOptions.rootUrl, 'users', userId);
+
+ return this.request
+ .patch(url)
+ .send({ user_metadata: userMetadata })
+ .end(responseHandler(cb, { ignoreCasing: true }));
+ };
+
+ /**
+ * Link two users. https://auth0.com/docs/api/management/v2#!/Users/post_identities
+ *
+ * @method linkUser
+ * @param {String} userId
+ * @param {Object} secondaryUserToken
+ * @param {Function} cb
+ */
+ Management.prototype.linkUser = function (userId, secondaryUserToken, cb) {
+ var url;
+ /* eslint-disable */
+ assert.check(userId, { type: 'string', message: 'userId parameter is not valid' });
+ assert.check(secondaryUserToken, { type: 'string',
+ message: 'secondaryUserToken parameter is not valid' });
+ assert.check(cb, { type: 'function', message: 'cb parameter is not valid' });
+ /* eslint-enable */
+
+ url = urljoin(this.baseOptions.rootUrl, 'users', userId, 'identities');
+
+ return this.request
+ .post(url)
+ .send({ link_with: secondaryUserToken })
+ .end(responseHandler(cb, { ignoreCasing: true }));
+ };
+
+ module.exports = Management;
+
+
+/***/ },
+/* 177 */
+/***/ function(module, exports, __webpack_require__) {
+
+ var IdTokenVerifier = __webpack_require__(126);
+
+ var assert = __webpack_require__(28);
+ var error = __webpack_require__(105);
+ var qs = __webpack_require__(43);
+ var PluginHandler = __webpack_require__(169);
+ var windowHelper = __webpack_require__(21);
+ var objectHelper = __webpack_require__(15);
+ var TransactionManager = __webpack_require__(106);
+ var Authentication = __webpack_require__(103);
+ var Redirect = __webpack_require__(179);
+ var Popup = __webpack_require__(178);
+ var SilentAuthenticationHandler = __webpack_require__(180);
+
+ /**
+ * Handles all the browser's authentication flows
+ * @constructor
+ * @param {Object} options
+ * @param {String} options.domain
+ * @param {String} options.clienID
+ * @param {String} options.responseType
+ * @param {String} options.responseMode
+ * @param {String} options.scope
+ * @param {String} options.audience
+ * @param {Array} options.plugins
+ * @param {Boolean} options._disableDeprecationWarnings
+ */
+ function WebAuth(options) {
+ /* eslint-disable */
+ assert.check(options, { type: 'object', message: 'options parameter is not valid' }, {
+ domain: { type: 'string', message: 'domain option is required' },
+ clientID: { type: 'string', message: 'clientID option is required' },
+ responseType: { optional: true, type: 'string', message: 'responseType is not valid' },
+ responseMode: { optional: true, type: 'string', message: 'responseMode is not valid' },
+ redirectUri: { optional: true, type: 'string', message: 'redirectUri is not valid' },
+ scope: { optional: true, type: 'string', message: 'scope is not valid' },
+ audience: { optional: true, type: 'string', message: 'audience is not valid' },
+ leeway: { optional: true, type: 'number', message: 'leeway is not valid' },
+ plugins: { optional: true, type: 'array', message: 'plugins is not valid'},
+ _disableDeprecationWarnings: { optional: true, type: 'boolean', message: '_disableDeprecationWarnings option is not valid' },
+ _sendTelemetry: { optional: true, type: 'boolean', message: '_sendTelemetry option is not valid' },
+ _telemetryInfo: { optional: true, type: 'object', message: '_telemetryInfo option is not valid' }
+ });
+
+ if (options.overrides) {
+ assert.check(options.overrides, { type: 'object', message: 'overrides option is not valid' }, {
+ __tenant: { type: 'string', message: '__tenant option is required' },
+ __token_issuer: { type: 'string', message: '__token_issuer option is required' }
+ });
+ }
+ /* eslint-enable */
+
+ this.baseOptions = options;
+ this.baseOptions.plugins = new PluginHandler(this, this.baseOptions.plugins || []);
+
+ this.baseOptions._sendTelemetry = this.baseOptions._sendTelemetry === false ?
+ this.baseOptions._sendTelemetry : true;
+
+ this.baseOptions.tenant = (this.overrides && this.overrides.__tenant)
+ || this.baseOptions.domain.split('.')[0];
+
+ this.baseOptions.token_issuer = (this.overrides && this.overrides.__token_issuer)
+ || 'https://' + this.baseOptions.domain + '/';
+
+ this.transactionManager = new TransactionManager(this.baseOptions.transaction);
+
+ this.client = new Authentication(this.baseOptions);
+ this.redirect = new Redirect(this.client, this.baseOptions);
+ this.popup = new Popup(this.client, this.baseOptions);
+ }
+
+ /**
+ * Parse the url hash and extract the returned tokens depending on the transaction.
+ *
+ * Only validates id_tokens signed by Auth0 using the RS256 algorithm using the public key exposed
+ * by the `/.well-known/jwks.json` endpoint. Id tokens signed with other algorithms will not be
+ * accepted.
+ *
+ * @method parseHash
+ * @param {Object} options:
+ * @param {String} options.state [OPTIONAL] to verify the response
+ * @param {String} options.nonce [OPTIONAL] to verify the id_token
+ * @param {String} options.hash [OPTIONAL] the url hash. If not provided it will extract from window.location.hash
+ * @param {Function} cb: function(err, token_payload)
+ */
+ WebAuth.prototype.parseHash = function (options, cb) {
+ var parsedQs;
+ var err;
+ var state;
+ var transaction;
+ var transactionNonce;
+ var transactionState;
+
+ if (!cb && typeof options === 'function') {
+ cb = options;
+ options = {};
+ } else {
+ options = options || {};
+ }
+
+ var _window = windowHelper.getWindow();
+
+ var hashStr = options.hash === undefined ? _window.location.hash : options.hash;
+ hashStr = hashStr.replace(/^#?\/?/, '');
+
+ parsedQs = qs.parse(hashStr);
+
+ if (parsedQs.hasOwnProperty('error')) {
+ err = error.buildResponse(parsedQs.error, parsedQs.error_description);
+
+ if (parsedQs.state) {
+ err.state = parsedQs.state;
+ }
+
+ return cb(err);
+ }
+
+ if (!parsedQs.hasOwnProperty('access_token')
+ && !parsedQs.hasOwnProperty('id_token')
+ && !parsedQs.hasOwnProperty('refresh_token')) {
+ return cb(null, null);
+ }
+
+ state = parsedQs.state || options.state;
+
+ transaction = this.transactionManager.getStoredTransaction(state);
+ transactionNonce = options.nonce || (transaction && transaction.nonce) || null;
+ transactionState = options.state || (transaction && transaction.state) || null;
+
+ if (parsedQs.id_token) {
+ this.validateToken(
+ parsedQs.id_token,
+ transactionState,
+ transactionNonce,
+ function (validationError, payload) {
+ if (validationError) {
+ return cb(validationError);
+ }
+
+ return cb(null, buildParseHashResponse(parsedQs, (transaction && transaction.appStatus) || null, payload));
+ });
+ } else {
+ cb(null, buildParseHashResponse(parsedQs, (transaction && transaction.appStatus) || null, null));
+ }
+ };
+
+ function buildParseHashResponse(qsParams, appStatus, token) {
+ return {
+ accessToken: qsParams.access_token || null,
+ idToken: qsParams.id_token || null,
+ idTokenPayload: token || null,
+ appStatus: appStatus || null,
+ refreshToken: qsParams.refresh_token || null,
+ state: qsParams.state || null,
+ expiresIn: qsParams.expires_in ? parseInt(qsParams.expires_in, 10) : null,
+ tokenType: qsParams.token_type || null
+ };
+ }
+
+ /**
+ * Decodes the id_token and verifies the nonce.
+ *
+ * @method validateToken
+ * @param {String} token
+ * @param {String} state
+ * @param {String} nonce
+ * @param {Function} cb: function(err, {payload, transaction})
+ */
+ WebAuth.prototype.validateToken = function (token, state, nonce, cb) {
+ var verifier = new IdTokenVerifier({
+ issuer: this.baseOptions.token_issuer,
+ audience: this.baseOptions.clientID,
+ leeway: this.baseOptions.leeway || 0,
+ __disableExpirationCheck: this.baseOptions.__disableExpirationCheck
+ });
+
+ verifier.verify(token, nonce, function (err, payload) {
+ if (err) {
+ return cb(error.invalidJwt(err.message));
+ }
+
+ cb(null, payload);
+ });
+ };
+
+ /**
+ * Executes a silent authentication transaction under the hood in order to fetch a new token.
+ *
+ * @method renewAuth
+ * @param {Object} options: any valid oauth2 parameter to be sent to the `/authorize` endpoint
+ * @param {Function} cb
+ */
+ WebAuth.prototype.renewAuth = function (options, cb) {
+ var handler;
+ var usePostMessage = !!options.usePostMessage;
+ var _this = this;
+
+ var params = objectHelper.merge(this.baseOptions, [
+ 'clientID',
+ 'redirectUri',
+ 'responseType',
+ 'scope',
+ 'audience'
+ ]).with(options);
+
+ params.responseType = params.responseType || 'token';
+ params.responseMode = params.responseMode || 'fragment';
+
+ params = this.transactionManager.process(params);
+
+ assert.check(params, { type: 'object', message: 'options parameter is not valid' });
+ assert.check(cb, { type: 'function', message: 'cb parameter is not valid' });
+
+ params.prompt = 'none';
+
+ params = objectHelper.blacklist(params, ['usePostMessage', 'tenant']);
+
+ handler = new SilentAuthenticationHandler(this, this.client.buildAuthorizeUrl(params));
+
+ handler.login(usePostMessage, function (err, data) {
+ if (err) {
+ return cb(err);
+ }
+
+ var transaction = _this.transactionManager.getStoredTransaction(params.state);
+ var transactionNonce = options.nonce || (transaction && transaction.nonce) || null;
+ var transactionState = options.state || (transaction && transaction.state) || null;
+
+ if (data.id_token) {
+ return _this.validateToken(data.id_token, transactionState, transactionNonce, function (validationErr, payload) {
+ if (validationErr) {
+ return cb(validationErr);
+ }
+
+ data.idTokenPayload = payload;
+
+ return cb(null, data);
+ });
+ }
+
+ return cb(err, data);
+ });
+ };
+
+ /**
+ * Initialices a change password transaction
+ *
+ * @method changePassword
+ * @param {Object} options: https://auth0.com/docs/api/authentication#!#post--dbconnections-change_password
+ * @param {Function} cb
+ */
+ WebAuth.prototype.changePassword = function (options, cb) {
+ return this.client.dbConnection.changePassword(options, cb);
+ };
+
+ /**
+ * Initialices a passwordless authentication transaction
+ *
+ * @method passwordlessStart
+ * @param {Object} options: https://auth0.com/docs/api/authentication#passwordless
+ * @param {Object} options.type: `sms` or `email`
+ * @param {Object} options.phoneNumber: only if type = sms
+ * @param {Object} options.email: only if type = email
+ * @param {Function} cb
+ */
+ WebAuth.prototype.passwordlessStart = function (options, cb) {
+ return this.client.passwordless.start(options, cb);
+ };
+
+ /**
+ * Signs up a new user
+ *
+ * @method signup
+ * @param {Object} options: https://auth0.com/docs/api/authentication#!#post--dbconnections-signup
+ * @param {Function} cb
+ */
+ WebAuth.prototype.signup = function (options, cb) {
+ return this.client.dbConnection.signup(options, cb);
+ };
+
+ /**
+ * Redirects to the hosted login page (`/authorize`) in order to initialize a new authN/authZ transaction
+ *
+ * @method authorize
+ * @param {Object} options: https://auth0.com/docs/api/authentication#!#get--authorize_db
+ * @param {Function} cb
+ */
+ WebAuth.prototype.authorize = function (options) {
+ var params = objectHelper.merge(this.baseOptions, [
+ 'clientID',
+ 'responseType',
+ 'responseMode',
+ 'redirectUri',
+ 'scope',
+ 'audience'
+ ]).with(options);
+
+ assert.check(params, { type: 'object', message: 'options parameter is not valid' }, {
+ responseType: { type: 'string', message: 'responseType option is required' }
+ });
+
+ params = this.transactionManager.process(params);
+
+ windowHelper.redirect(this.client.buildAuthorizeUrl(params));
+ };
+
+ /**
+ * Signs up a new user, automatically logs the user in after the signup and returns the user token.
+ * The login will be done using /oauth/token with password-realm grant type.
+ *
+ * @method signupAndAuthorize
+ * @param {Object} options: https://auth0.com/docs/api/authentication#!#post--dbconnections-signup
+ * @param {Function} cb
+ */
+ WebAuth.prototype.signupAndAuthorize = function (options, cb) {
+ var _this = this;
+
+ return this.client.dbConnection.signup(objectHelper.blacklist(options, ['popupHandler']),
+ function (err) {
+ if (err) {
+ return cb(err);
+ }
+ options.realm = options.connection;
+ if (!options.username) {
+ options.username = options.email;
+ }
+ _this.client.login(options, cb);
+ });
+ };
+
+ /**
+ * Redirects to the auth0 logout page
+ *
+ * @method logout
+ * @param {Object} options: https://auth0.com/docs/api/authentication#!#get--v2-logout
+ */
+ WebAuth.prototype.logout = function (options) {
+ windowHelper.redirect(this.client.buildLogoutUrl(options));
+ };
+
+ /**
+ * Verifies the passwordless TOTP and redirects to finish the passwordless transaction
+ *
+ * @method passwordlessVerify
+ * @param {Object} options:
+ * @param {Object} options.type: `sms` or `email`
+ * @param {Object} options.phoneNumber: only if type = sms
+ * @param {Object} options.email: only if type = email
+ * @param {Object} options.connection: the connection name
+ * @param {Object} options.verificationCode: the TOTP code
+ * @param {Function} cb
+ */
+ WebAuth.prototype.passwordlessVerify = function (options, cb) {
+ var _this = this;
+ return this.client.passwordless.verify(options, function (err) {
+ if (err) {
+ return cb(err);
+ }
+ return windowHelper.redirect(_this.client.passwordless.buildVerifyUrl(options));
+ });
+ };
+
+ module.exports = WebAuth;
+
+
+/***/ },
+/* 178 */
+/***/ function(module, exports, __webpack_require__) {
+
+ var urljoin = __webpack_require__(20);
+
+ var assert = __webpack_require__(28);
+ var responseHandler = __webpack_require__(34);
+ var PopupHandler = __webpack_require__(170);
+ var objectHelper = __webpack_require__(15);
+ var Warn = __webpack_require__(51);
+ var TransactionManager = __webpack_require__(106);
+
+ function Popup(client, options) {
+ this.baseOptions = options;
+ this.client = client;
+
+ this.transactionManager = new TransactionManager(this.baseOptions.transaction);
+ this.warn = new Warn({
+ disableWarnings: !!options._disableDeprecationWarnings
+ });
+ }
+
+
+ /**
+ * Returns a new instance of the popup handler
+ *
+ * @method buildPopupHandler
+ */
+ Popup.prototype.buildPopupHandler = function () {
+ var pluginHandler = this.baseOptions.plugins.get('popup.getPopupHandler');
+
+ if (pluginHandler) {
+ return pluginHandler.getPopupHandler();
+ }
+
+ return new PopupHandler();
+ };
+
+ /**
+ * Initializes the popup window and returns the instance to be used later in order to avoid being blocked by the browser.
+ *
+ * @method preload
+ * @param {Object} options: receives the window height and width and any other window feature to be sent to window.open
+ */
+ Popup.prototype.preload = function (options) {
+ options = options || {};
+
+ var popup = this.buildPopupHandler();
+
+ popup.preload(options);
+ return popup;
+ };
+
+ /**
+ * Internal use.
+ *
+ * @method getPopupHandler
+ */
+ Popup.prototype.getPopupHandler = function (options, preload) {
+ if (options.popupHandler) {
+ return options.popupHandler;
+ }
+
+ if (preload) {
+ return this.preload(options);
+ }
+
+ return this.buildPopupHandler();
+ };
+
+ /**
+ * Opens in a popup the hosted login page (`/authorize`) in order to initialize a new authN/authZ transaction
+ *
+ * @method authorize
+ * @param {Object} options: https://auth0.com/docs/api/authentication#!#get--authorize_db
+ * @param {Function} cb
+ */
+ Popup.prototype.authorize = function (options, cb) {
+ var popup;
+ var url;
+ var relayUrl;
+
+ var pluginHandler = this.baseOptions.plugins.get('popup.authorize');
+
+ var params = objectHelper.merge(this.baseOptions, [
+ 'clientID',
+ 'scope',
+ 'domain',
+ 'audience',
+ 'responseType'
+ ]).with(objectHelper.blacklist(options, ['popupHandler']));
+
+ assert.check(params, { type: 'object', message: 'options parameter is not valid' }, {
+ responseType: { type: 'string', message: 'responseType option is required' }
+ });
+
+ relayUrl = urljoin(this.baseOptions.rootUrl, 'relay.html');
+
+ // used by server to render the relay page instead of sending the chunk in the
+ // url to the callback
+ params.owp = true;
+ params.redirectUri = undefined;
+
+ if (pluginHandler) {
+ params = pluginHandler.processParams(params);
+ }
+
+ params = this.transactionManager.process(params);
+
+ delete params.domain;
+
+ url = this.client.buildAuthorizeUrl(params);
+
+ popup = this.getPopupHandler(options);
+
+ return popup.load(url, relayUrl, {}, responseHandler(cb));
+ };
+
+ /**
+ * Initializes the legacy Lock login flow in a popup
+ *
+ * @method loginWithCredentials
+ * @param {Object} options
+ * @param {Function} cb
+ * @deprecated `webauth.popup.loginWithCredentials` will be soon deprecated, use `webauth.client.login` instead.
+ */
+ Popup.prototype.loginWithCredentials = function (options, cb) {
+ var params;
+ var popup;
+ var url;
+ var relayUrl;
+
+ this.warn.warning('`webauth.popup.loginWithCredentials` will be soon deprecated, use `webauth.client.login` instead.');
+
+ /* eslint-disable */
+ assert.check(options, { type: 'object', message: 'options parameter is not valid' }, {
+ clientID: { optional: true, type: 'string', message: 'clientID option is required' },
+ redirectUri: { optional: true, type: 'string', message: 'redirectUri option is required' },
+ responseType: { optional: true, type: 'string', message: 'responseType option is required' },
+ scope: { optional: true, type: 'string', message: 'scope option is required' },
+ audience: { optional: true, type: 'string', message: 'audience option is required' }
+ });
+ /* eslint-enable */
+
+ popup = this.getPopupHandler(options);
+
+ options = objectHelper.merge(this.baseOptions, [
+ 'clientID',
+ 'scope',
+ 'domain',
+ 'audience'
+ ]).with(objectHelper.blacklist(options, ['popupHandler']));
+
+ params = objectHelper.pick(options, ['clientID', 'domain']);
+ params.options = objectHelper.toSnakeCase(
+ objectHelper.blacklist(options, ['clientID', 'domain'])
+ );
+
+ url = urljoin(this.baseOptions.rootUrl, 'sso_dbconnection_popup', options.clientID);
+ relayUrl = urljoin(this.baseOptions.rootUrl, 'relay.html');
+
+ return popup.load(url, relayUrl, params, responseHandler(cb));
+ };
+
+ /**
+ * Verifies the passwordless TOTP and returns the requested token
+ *
+ * @method passwordlessVerify
+ * @param {Object} options:
+ * @param {Object} options.type: `sms` or `email`
+ * @param {Object} options.phoneNumber: only if type = sms
+ * @param {Object} options.email: only if type = email
+ * @param {Object} options.connection: the connection name
+ * @param {Object} options.verificationCode: the TOTP code
+ * @param {Function} cb
+ */
+ Popup.prototype.passwordlessVerify = function (options, cb) {
+ var _this = this;
+ return this.client.passwordless.verify(objectHelper.blacklist(options, ['popupHandler']),
+ function (err) {
+ if (err) {
+ return cb(err);
+ }
+
+ options.username = options.phoneNumber || options.email;
+ options.password = options.verificationCode;
+
+ delete options.email;
+ delete options.phoneNumber;
+ delete options.verificationCode;
+ delete options.type;
+
+ _this.client.loginWithResourceOwner(options, cb);
+ });
+ };
+
+ /**
+ * Signs up a new user and automatically logs the user in after the signup.
+ *
+ * @method signupAndLogin
+ * @param {Object} options: https://auth0.com/docs/api/authentication#!#post--dbconnections-signup
+ * @param {Function} cb
+ */
+ Popup.prototype.signupAndLogin = function (options, cb) {
+ var _this = this;
+
+ // Preload popup to avoid the browser to block it since the login happens later
+ var popupHandler = this.getPopupHandler(options, true);
+ options.popupHandler = popupHandler;
+
+ return this.client.dbConnection.signup(objectHelper.blacklist(options, ['popupHandler']),
+ function (err) {
+ if (err) {
+ if (popupHandler._current_popup) {
+ popupHandler._current_popup.kill();
+ }
+ return cb(err);
+ }
+ _this.loginWithCredentials(options, cb);
+ });
+ };
+
+ module.exports = Popup;
+
+
+/***/ },
+/* 179 */
+/***/ function(module, exports, __webpack_require__) {
+
+ var UsernamePassword = __webpack_require__(181);
+ var objectHelper = __webpack_require__(15);
+ var Warn = __webpack_require__(51);
+ var assert = __webpack_require__(28);
+
+ function Redirect(client, options) {
+ this.baseOptions = options;
+ this.client = client;
+
+ this.warn = new Warn({
+ disableWarnings: !!options._disableDeprecationWarnings
+ });
+ }
+
+ /**
+ * Initializes the legacy Lock login flow in redirect mode
+ *
+ * @method loginWithCredentials
+ * @param {Object} options
+ * @param {Function} cb
+ * @deprecated `webauth.redirect.loginWithCredentials` will be soon deprecated, use `webauth.login` instead.
+ */
+ Redirect.prototype.loginWithCredentials = function (options, cb) {
+ var usernamePassword;
+
+ var params = objectHelper.merge(this.baseOptions, [
+ 'clientID',
+ 'redirectUri',
+ 'tenant',
+ 'responseType',
+ 'responseMode',
+ 'scope',
+ 'audience'
+ ]).with(options);
+
+ this.warn.warning('`webauth.redirect.loginWithCredentials` will be soon deprecated, use `webauth.login` instead.');
+
+ assert.check(params, { type: 'object', message: 'options parameter is not valid' }, {
+ responseType: { type: 'string', message: 'responseType option is required' }
+ });
+
+ usernamePassword = new UsernamePassword(this.baseOptions);
+ return usernamePassword.login(params, function (err, data) {
+ if (err) {
+ return cb(err);
+ }
+ return usernamePassword.callback(data);
+ });
+ };
+
+ /**
+ * Signs up a new user and automatically logs the user in after the signup.
+ *
+ * @method signupAndLogin
+ * @param {Object} options: https://auth0.com/docs/api/authentication#!#post--dbconnections-signup
+ * @param {Function} cb
+ */
+ Redirect.prototype.signupAndLogin = function (options, cb) {
+ var _this = this;
+ return this.client.dbConnection.signup(options, function (err) {
+ if (err) {
+ return cb(err);
+ }
+ return _this.loginWithCredentials(options, cb);
+ });
+ };
+
+ module.exports = Redirect;
+
+
+/***/ },
+/* 180 */
+/***/ function(module, exports, __webpack_require__) {
+
+ var IframeHandler = __webpack_require__(166);
+
+ function SilentAuthenticationHandler(auth0, authenticationUrl, timeout) {
+ this.auth0 = auth0;
+ this.authenticationUrl = authenticationUrl;
+ this.timeout = timeout || 60 * 1000;
+ this.handler = null;
+ }
+
+ SilentAuthenticationHandler.prototype.login = function (usePostMessage, callback) {
+ this.handler = new IframeHandler({
+ auth0: this.auth0,
+ url: this.authenticationUrl,
+ callback: callback,
+ timeout: this.timeout,
+ timeoutCallback: function () {
+ callback({
+ error: 'timeout',
+ description: 'Timeout during authentication renew.'
+ });
+ },
+ usePostMessage: usePostMessage || false
+ });
+
+ this.handler.init();
+ };
+
+ module.exports = SilentAuthenticationHandler;
+
+
+/***/ },
+/* 181 */
+/***/ function(module, exports, __webpack_require__) {
+
+ var urljoin = __webpack_require__(20);
+
+ var objectHelper = __webpack_require__(15);
+ var RequestBuilder = __webpack_require__(65);
+ var responseHandler = __webpack_require__(34);
+ var windowHelper = __webpack_require__(21);
+
+ function UsernamePassword(options) {
+ this.baseOptions = options;
+ this.request = new RequestBuilder(options);
+ }
+
+ UsernamePassword.prototype.login = function (options, cb) {
+ var url;
+ var body;
+
+ url = urljoin(this.baseOptions.rootUrl, 'usernamepassword', 'login');
+
+ options.username = options.username || options.email; // eslint-disable-line
+
+ options = objectHelper.blacklist(options, ['email']); // eslint-disable-line
+
+ body = objectHelper.merge(this.baseOptions, [
+ 'clientID',
+ 'redirectUri',
+ 'tenant',
+ 'responseType',
+ 'responseMode',
+ 'scope',
+ 'audience'
+ ]).with(options);
+
+ body = objectHelper.toSnakeCase(body, ['auth0Client']);
+
+ return this.request
+ .post(url)
+ .send(body)
+ .end(responseHandler(cb));
+ };
+
+ UsernamePassword.prototype.callback = function (formHtml) {
+ var div;
+ var form;
+ var _document = windowHelper.getDocument();
+
+ div = _document.createElement('div');
+ div.innerHTML = formHtml;
+ form = _document.body.appendChild(div).children[0];
+
+ form.submit();
+ };
+
+ module.exports = UsernamePassword;
+
+
+/***/ },
+/* 182 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ exports.__esModule = true;
+ exports.displayName = displayName;
+ exports.url = url;
+
+ var _blueimpMd = __webpack_require__(232);
+
+ var _blueimpMd2 = _interopRequireDefault(_blueimpMd);
+
+ var _trim = __webpack_require__(33);
+
+ var _trim2 = _interopRequireDefault(_trim);
+
+ var _jsonp_utils = __webpack_require__(230);
+
+ var _jsonp_utils2 = _interopRequireDefault(_jsonp_utils);
+
+ var _email = __webpack_require__(29);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ var md5 = _blueimpMd2.default.md5 || _blueimpMd2.default;
+
+ function normalize(str) {
+ return typeof str === "string" ? (0, _trim2.default)(str.toLowerCase()) : "";
+ }
+
+ function displayName(email, cb) {
+ email = normalize(email);
+ if (!(0, _email.validateEmail)(email)) return cb({});
+
+ var url = 'https://secure.gravatar.com/' + md5(email) + '.json';
+ _jsonp_utils2.default.get(url, function (error, result) {
+ if (!error && result && result.entry && result.entry[0]) {
+ cb(null, result.entry[0].displayName);
+ } else {
+ cb({});
+ }
+ });
+ }
+
+ function url(email, cb) {
+ email = normalize(email);
+ if (!(0, _email.validateEmail)(email)) return cb({});
+
+ cb(null, 'https://secure.gravatar.com/avatar/' + md5(email) + '?d=404&s=160');
+ }
+
+/***/ },
+/* 183 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ exports.__esModule = true;
+
+ var _react = __webpack_require__(1);
+
+ var _react2 = _interopRequireDefault(_react);
+
+ var _email_pane = __webpack_require__(68);
+
+ var _email_pane2 = _interopRequireDefault(_email_pane);
+
+ var _username_pane = __webpack_require__(71);
+
+ var _username_pane2 = _interopRequireDefault(_username_pane);
+
+ var _password_pane = __webpack_require__(69);
+
+ var _password_pane2 = _interopRequireDefault(_password_pane);
+
+ var _actions = __webpack_require__(35);
+
+ var _index = __webpack_require__(10);
+
+ var _index2 = __webpack_require__(2);
+
+ var l = _interopRequireWildcard(_index2);
+
+ 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 }; }
+
+ 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 LoginPane = function (_React$Component) {
+ _inherits(LoginPane, _React$Component);
+
+ function LoginPane() {
+ _classCallCheck(this, LoginPane);
+
+ return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
+ }
+
+ LoginPane.prototype.handleDontRememberPasswordClick = function handleDontRememberPasswordClick(e) {
+ e.preventDefault();
+ (0, _actions.showResetPasswordActivity)(l.id(this.props.lock));
+ };
+
+ LoginPane.prototype.render = function render() {
+ var _props = this.props,
+ emailInputPlaceholder = _props.emailInputPlaceholder,
+ forgotPasswordAction = _props.forgotPasswordAction,
+ i18n = _props.i18n,
+ instructions = _props.instructions,
+ lock = _props.lock,
+ passwordInputPlaceholder = _props.passwordInputPlaceholder,
+ showForgotPasswordLink = _props.showForgotPasswordLink,
+ showPassword = _props.showPassword,
+ usernameInputPlaceholder = _props.usernameInputPlaceholder,
+ usernameStyle = _props.usernameStyle;
+
+
+ var headerText = instructions || null;
+ var header = headerText && _react2.default.createElement(
+ 'p',
+ null,
+ headerText
+ );
+
+ // Should never validate format on login because of custom db connection and import mode
+ var fieldPane = usernameStyle === "email" ? _react2.default.createElement(_email_pane2.default, {
+ i18n: i18n,
+ lock: lock,
+ forceInvalidVisibility: !showPassword,
+ placeholder: emailInputPlaceholder
+ }) : _react2.default.createElement(_username_pane2.default, {
+ i18n: i18n,
+ lock: lock,
+ placeholder: usernameInputPlaceholder,
+ usernameStyle: usernameStyle,
+ validateFormat: false
+ });
+
+ var passwordPane = showPassword ? _react2.default.createElement(_password_pane2.default, {
+ i18n: i18n,
+ lock: lock,
+ placeholder: passwordInputPlaceholder
+ }) : null;
+
+ var dontRememberPassword = showForgotPasswordLink && (0, _index.hasScreen)(lock, "forgotPassword") ? _react2.default.createElement(
+ 'p',
+ { className: 'auth0-lock-alternative' },
+ _react2.default.createElement(
+ 'a',
+ {
+ className: 'auth0-lock-alternative-link',
+ href: (0, _index.forgotPasswordLink)(lock, "#"),
+ onClick: (0, _index.forgotPasswordLink)(lock) ? undefined : this.handleDontRememberPasswordClick.bind(this)
+ },
+ forgotPasswordAction
+ )
+ ) : null;
+
+ return _react2.default.createElement(
+ 'div',
+ null,
+ header,
+ fieldPane,
+ passwordPane,
+ dontRememberPassword
+ );
+ };
+
+ return LoginPane;
+ }(_react2.default.Component);
+
+ exports.default = LoginPane;
+
+
+ LoginPane.propTypes = {
+ emailInputPlaceholder: _react2.default.PropTypes.string.isRequired,
+ forgotPasswordAction: _react2.default.PropTypes.string.isRequired,
+ i18n: _react2.default.PropTypes.object.isRequired,
+ instructions: _react2.default.PropTypes.any,
+ lock: _react2.default.PropTypes.object.isRequired,
+ passwordInputPlaceholder: _react2.default.PropTypes.string.isRequired,
+ showForgotPasswordLink: _react2.default.PropTypes.bool.isRequired,
+ showPassword: _react2.default.PropTypes.bool.isRequired,
+ usernameInputPlaceholder: _react2.default.PropTypes.string.isRequired,
+ usernameStyle: _react2.default.PropTypes.oneOf(["any", "email", "username"])
+ };
+
+/***/ },
+/* 184 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ exports.__esModule = true;
+
+ var _react = __webpack_require__(1);
+
+ var _react2 = _interopRequireDefault(_react);
+
+ var _mfa_code_pane = __webpack_require__(209);
+
+ var _mfa_code_pane2 = _interopRequireDefault(_mfa_code_pane);
+
+ 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 MFAPane = function (_React$Component) {
+ _inherits(MFAPane, _React$Component);
+
+ function MFAPane() {
+ _classCallCheck(this, MFAPane);
+
+ return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
+ }
+
+ MFAPane.prototype.render = function render() {
+ var _props = this.props,
+ mfaInputPlaceholder = _props.mfaInputPlaceholder,
+ i18n = _props.i18n,
+ instructions = _props.instructions,
+ lock = _props.lock,
+ title = _props.title;
+
+
+ var headerText = instructions || null;
+ var header = headerText && _react2.default.createElement(
+ 'p',
+ null,
+ headerText
+ );
+
+ var pane = _react2.default.createElement(_mfa_code_pane2.default, {
+ i18n: i18n,
+ lock: lock,
+ placeholder: mfaInputPlaceholder
+ });
+
+ var titleElement = title && _react2.default.createElement(
+ 'h2',
+ null,
+ title
+ );
+
+ return _react2.default.createElement(
+ 'div',
+ null,
+ titleElement,
+ header,
+ pane
+ );
+ };
+
+ return MFAPane;
+ }(_react2.default.Component);
+
+ exports.default = MFAPane;
+
+
+ MFAPane.propTypes = {
+ mfaInputPlaceholder: _react2.default.PropTypes.string.isRequired,
+ title: _react2.default.PropTypes.string.isRequired,
+ i18n: _react2.default.PropTypes.object.isRequired,
+ instructions: _react2.default.PropTypes.any,
+ lock: _react2.default.PropTypes.object.isRequired
+ };
+
+/***/ },
+/* 185 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ exports.__esModule = true;
+ exports.renderPasswordResetConfirmation = renderPasswordResetConfirmation;
+
+ var _react = __webpack_require__(1);
+
+ var _react2 = _interopRequireDefault(_react);
+
+ var _success_pane = __webpack_require__(72);
+
+ var _success_pane2 = _interopRequireDefault(_success_pane);
+
+ var _actions = __webpack_require__(22);
+
+ var _index = __webpack_require__(2);
+
+ var l = _interopRequireWildcard(_index);
+
+ var _i18n = __webpack_require__(13);
+
+ var i18n = _interopRequireWildcard(_i18n);
+
+ 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 }; }
+
+ 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; }
+
+ // TODO: can't we get this from props?
+
+ var PasswordResetConfirmation = function (_React$Component) {
+ _inherits(PasswordResetConfirmation, _React$Component);
+
+ function PasswordResetConfirmation() {
+ _classCallCheck(this, PasswordResetConfirmation);
+
+ return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
+ }
+
+ PasswordResetConfirmation.prototype.handleClose = function handleClose() {
+ var _props = this.props,
+ closeHandler = _props.closeHandler,
+ lock = _props.lock;
+
+ closeHandler(l.id(lock));
+ };
+
+ PasswordResetConfirmation.prototype.render = function render() {
+ var lock = this.props.lock;
+
+ var closeHandler = l.ui.closable(lock) ? this.handleClose.bind(this) : undefined;
+
+ return _react2.default.createElement(
+ _success_pane2.default,
+ { closeHandler: closeHandler },
+ _react2.default.createElement(
+ 'p',
+ null,
+ i18n.html(this.props.lock, ["success", "forgotPassword"])
+ )
+ );
+ };
+
+ return PasswordResetConfirmation;
+ }(_react2.default.Component);
+
+ exports.default = PasswordResetConfirmation;
+
+
+ PasswordResetConfirmation.propTypes = {
+ closeHandler: _react2.default.PropTypes.func.isRequired,
+ lock: _react2.default.PropTypes.object.isRequired
+ };
+
+ function renderPasswordResetConfirmation(m) {
+ var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
+
+ props.closeHandler = _actions.closeLock;
+ props.key = "auxiliarypane";
+ props.lock = m;
+
+ return m.get("passwordResetted") ? _react2.default.createElement(PasswordResetConfirmation, props) : null;
+ }
+
+/***/ },
+/* 186 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ exports.__esModule = true;
+
+ var _react = __webpack_require__(1);
+
+ var _react2 = _interopRequireDefault(_react);
+
+ var _screen = __webpack_require__(17);
+
+ var _screen2 = _interopRequireDefault(_screen);
+
+ var _reset_password_pane = __webpack_require__(187);
+
+ var _reset_password_pane2 = _interopRequireDefault(_reset_password_pane);
+
+ var _index = __webpack_require__(10);
+
+ var _actions = __webpack_require__(35);
+
+ var _password_reset_confirmation = __webpack_require__(185);
+
+ var _i18n = __webpack_require__(13);
+
+ var i18n = _interopRequireWildcard(_i18n);
+
+ 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 }; }
+
+ 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 Component = function Component(_ref) {
+ var i18n = _ref.i18n,
+ model = _ref.model;
+
+ var headerText = i18n.html("forgotPasswordInstructions") || null;
+ var header = headerText && _react2.default.createElement(
+ 'p',
+ null,
+ headerText
+ );
+
+ return _react2.default.createElement(_reset_password_pane2.default, {
+ emailInputPlaceholder: i18n.str("emailInputPlaceholder"),
+ header: header,
+ i18n: i18n,
+ lock: model
+ });
+ };
+
+ var ResetPassword = function (_Screen) {
+ _inherits(ResetPassword, _Screen);
+
+ function ResetPassword() {
+ _classCallCheck(this, ResetPassword);
+
+ return _possibleConstructorReturn(this, _Screen.call(this, "forgotPassword"));
+ }
+
+ ResetPassword.prototype.backHandler = function backHandler(m) {
+ return (0, _index.hasScreen)(m, "login") ? _actions.cancelResetPassword : undefined;
+ };
+
+ ResetPassword.prototype.submitButtonLabel = function submitButtonLabel(m) {
+ return i18n.str(m, ["forgotPasswordSubmitLabel"]);
+ };
+
+ ResetPassword.prototype.getScreenTitle = function getScreenTitle(m) {
+ return i18n.str(m, "forgotPasswordTitle");
+ };
+
+ ResetPassword.prototype.submitHandler = function submitHandler() {
+ return _actions.resetPassword;
+ };
+
+ ResetPassword.prototype.renderAuxiliaryPane = function renderAuxiliaryPane(m) {
+ return (0, _password_reset_confirmation.renderPasswordResetConfirmation)(m);
+ };
+
+ ResetPassword.prototype.render = function render() {
+ return Component;
+ };
+
+ return ResetPassword;
+ }(_screen2.default);
+
+ exports.default = ResetPassword;
+
+/***/ },
+/* 187 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ exports.__esModule = true;
+
+ var _react = __webpack_require__(1);
+
+ var _react2 = _interopRequireDefault(_react);
+
+ var _email_pane = __webpack_require__(68);
+
+ var _email_pane2 = _interopRequireDefault(_email_pane);
+
+ var _index = __webpack_require__(2);
+
+ var l = _interopRequireWildcard(_index);
+
+ 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 }; }
+
+ 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 ResetPasswordPane = function (_React$Component) {
+ _inherits(ResetPasswordPane, _React$Component);
+
+ function ResetPasswordPane() {
+ _classCallCheck(this, ResetPasswordPane);
+
+ return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
+ }
+
+ ResetPasswordPane.prototype.render = function render() {
+ var _props = this.props,
+ emailInputPlaceholder = _props.emailInputPlaceholder,
+ header = _props.header,
+ i18n = _props.i18n,
+ lock = _props.lock;
+
+
+ return _react2.default.createElement(
+ 'div',
+ null,
+ header,
+ _react2.default.createElement(_email_pane2.default, {
+ i18n: i18n,
+ lock: lock,
+ placeholder: emailInputPlaceholder
+ })
+ );
+ };
+
+ return ResetPasswordPane;
+ }(_react2.default.Component);
+
+ ResetPasswordPane.propTypes = {
+ emailInputPlaceholder: _react2.default.PropTypes.string.isRequired,
+ lock: _react2.default.PropTypes.object.isRequired
+ };
+ exports.default = ResetPasswordPane;
+
+/***/ },
+/* 188 */
+/***/ function(module, exports, __webpack_require__) {
+
+ "use strict";
+
+ exports.__esModule = true;
+
+ var _react = __webpack_require__(1);
+
+ var _react2 = _interopRequireDefault(_react);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ var SignUpTerms = function SignUpTerms(_ref) {
+ var checkHandler = _ref.checkHandler,
+ checked = _ref.checked,
+ children = _ref.children;
+
+ return checkHandler ? _react2.default.createElement(
+ "span",
+ { className: "auth0-lock-sign-up-terms-agreement" },
+ _react2.default.createElement(
+ "label",
+ null,
+ _react2.default.createElement("input", { type: "checkbox", onChange: checkHandler, checked: checked }),
+ children
+ )
+ ) : children;
+ };
+
+ exports.default = SignUpTerms;
+
+/***/ },
+/* 189 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ exports.__esModule = true;
+ exports.renderSignedUpConfirmation = renderSignedUpConfirmation;
+
+ var _react = __webpack_require__(1);
+
+ var _react2 = _interopRequireDefault(_react);
+
+ var _success_pane = __webpack_require__(72);
+
+ var _success_pane2 = _interopRequireDefault(_success_pane);
+
+ var _actions = __webpack_require__(22);
+
+ var _index = __webpack_require__(2);
+
+ var l = _interopRequireWildcard(_index);
+
+ var _index2 = __webpack_require__(10);
+
+ var _i18n = __webpack_require__(13);
+
+ var i18n = _interopRequireWildcard(_i18n);
+
+ 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 }; }
+
+ 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; }
+
+ // TODO: can't we get this from props?
+
+ var SignedUpConfirmation = function (_React$Component) {
+ _inherits(SignedUpConfirmation, _React$Component);
+
+ function SignedUpConfirmation() {
+ _classCallCheck(this, SignedUpConfirmation);
+
+ return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
+ }
+
+ SignedUpConfirmation.prototype.handleClose = function handleClose() {
+ var _props = this.props,
+ closeHandler = _props.closeHandler,
+ lock = _props.lock;
+
+ closeHandler(l.id(lock));
+ };
+
+ SignedUpConfirmation.prototype.render = function render() {
+ var lock = this.props.lock;
+
+ var closeHandler = l.ui.closable(lock) ? this.handleClose.bind(this) : undefined;
+
+ return _react2.default.createElement(
+ _success_pane2.default,
+ { closeHandler: closeHandler },
+ _react2.default.createElement(
+ 'p',
+ null,
+ i18n.html(lock, ["success", "signUp"])
+ )
+ );
+ };
+
+ return SignedUpConfirmation;
+ }(_react2.default.Component);
+
+ exports.default = SignedUpConfirmation;
+
+
+ SignedUpConfirmation.propTypes = {
+ closeHandler: _react2.default.PropTypes.func.isRequired,
+ lock: _react2.default.PropTypes.object.isRequired
+ };
+
+ function renderSignedUpConfirmation(m) {
+ var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
+
+ props.closeHandler = _actions.closeLock;
+ props.key = "auxiliarypane";
+ props.lock = m;
+
+ return m.get("signedUp") && !(0, _index2.shouldAutoLogin)(m) ? _react2.default.createElement(SignedUpConfirmation, props) : null;
+ }
+
+/***/ },
+/* 190 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ exports.__esModule = true;
+
+ var _react = __webpack_require__(1);
+
+ var _react2 = _interopRequireDefault(_react);
+
+ var _username_pane = __webpack_require__(71);
+
+ var _username_pane2 = _interopRequireDefault(_username_pane);
+
+ var _password_pane = __webpack_require__(69);
+
+ var _password_pane2 = _interopRequireDefault(_password_pane);
+
+ var _index = __webpack_require__(2);
+
+ var l = _interopRequireWildcard(_index);
+
+ 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 }; }
+
+ 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 HRDPane = function (_React$Component) {
+ _inherits(HRDPane, _React$Component);
+
+ function HRDPane() {
+ _classCallCheck(this, HRDPane);
+
+ return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
+ }
+
+ HRDPane.prototype.render = function render() {
+ var _props = this.props,
+ header = _props.header,
+ i18n = _props.i18n,
+ model = _props.model,
+ passwordInputPlaceholder = _props.passwordInputPlaceholder,
+ usernameInputPlaceholder = _props.usernameInputPlaceholder;
+
+
+ return _react2.default.createElement(
+ 'div',
+ null,
+ header,
+ _react2.default.createElement(_username_pane2.default, {
+ i18n: i18n,
+ lock: model,
+ placeholder: usernameInputPlaceholder,
+ validateFormat: false
+ }),
+ _react2.default.createElement(_password_pane2.default, {
+ i18n: i18n,
+ lock: model,
+ placeholder: passwordInputPlaceholder
+ })
+ );
+ };
+
+ return HRDPane;
+ }(_react2.default.Component);
+
+ exports.default = HRDPane;
+
+
+ HRDPane.propTypes = {
+ header: _react2.default.PropTypes.element,
+ i18n: _react2.default.PropTypes.object.isRequired,
+ model: _react2.default.PropTypes.object.isRequired,
+ passwordInputPlaceholder: _react2.default.PropTypes.string.isRequired,
+ usernameInputPlaceholder: _react2.default.PropTypes.string.isRequired
+ };
+
+/***/ },
+/* 191 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ exports.__esModule = true;
+
+ var _react = __webpack_require__(1);
+
+ var _react2 = _interopRequireDefault(_react);
+
+ var _screen = __webpack_require__(17);
+
+ var _screen2 = _interopRequireDefault(_screen);
+
+ var _signed_in_confirmation = __webpack_require__(30);
+
+ var _hrd_pane = __webpack_require__(190);
+
+ var _hrd_pane2 = _interopRequireDefault(_hrd_pane);
+
+ var _actions = __webpack_require__(66);
+
+ var _enterprise = __webpack_require__(16);
+
+ var _i18n = __webpack_require__(13);
+
+ var i18n = _interopRequireWildcard(_i18n);
+
+ 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 }; }
+
+ 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 Component = function Component(_ref) {
+ var i18n = _ref.i18n,
+ model = _ref.model;
+
+ var domain = (0, _enterprise.enterpriseDomain)(model);
+
+ var headerText;
+
+ if (domain != null) {
+ headerText = i18n.html("enterpriseActiveLoginInstructions", domain);
+ } else {
+ headerText = i18n.html("enterpriseLoginIntructions");
+ }
+
+ headerText = headerText || null;
+
+ var header = headerText && _react2.default.createElement(
+ 'p',
+ null,
+ headerText
+ );
+
+ return _react2.default.createElement(_hrd_pane2.default, {
+ header: header,
+ i18n: i18n,
+ model: model,
+ passwordInputPlaceholder: i18n.str("passwordInputPlaceholder"),
+ usernameInputPlaceholder: i18n.str("usernameInputPlaceholder")
+ });
+ };
+
+ var HRDScreen = function (_Screen) {
+ _inherits(HRDScreen, _Screen);
+
+ function HRDScreen() {
+ _classCallCheck(this, HRDScreen);
+
+ return _possibleConstructorReturn(this, _Screen.call(this, "hrd"));
+ }
+
+ HRDScreen.prototype.backHandler = function backHandler(model) {
+ return (0, _enterprise.isSingleHRDConnection)(model) ? null : _actions.cancelHRD;
+ };
+
+ HRDScreen.prototype.submitButtonLabel = function submitButtonLabel(m) {
+ return i18n.str(m, ["loginSubmitLabel"]);
+ };
+
+ HRDScreen.prototype.submitHandler = function submitHandler(model) {
+ return _actions.logIn;
+ };
+
+ HRDScreen.prototype.renderAuxiliaryPane = function renderAuxiliaryPane(model) {
+ return (0, _signed_in_confirmation.renderSignedInConfirmation)(model);
+ };
+
+ HRDScreen.prototype.render = function render() {
+ return Component;
+ };
+
+ return HRDScreen;
+ }(_screen2.default);
+
+ exports.default = HRDScreen;
+
+/***/ },
+/* 192 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ exports.__esModule = true;
+
+ var _react = __webpack_require__(1);
+
+ var _react2 = _interopRequireDefault(_react);
+
+ var _screen = __webpack_require__(17);
+
+ var _screen2 = _interopRequireDefault(_screen);
+
+ var _quick_auth_pane = __webpack_require__(74);
+
+ var _quick_auth_pane2 = _interopRequireDefault(_quick_auth_pane);
+
+ var _actions = __webpack_require__(56);
+
+ var _signed_in_confirmation = __webpack_require__(30);
+
+ var _index = __webpack_require__(2);
+
+ var l = _interopRequireWildcard(_index);
+
+ var _enterprise = __webpack_require__(16);
+
+ 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 }; }
+
+ 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 Component = function Component(_ref) {
+ var i18n = _ref.i18n,
+ model = _ref.model;
+
+ var headerText = i18n.html("windowsAuthInstructions") || null;
+ var header = headerText && _react2.default.createElement(
+ 'p',
+ null,
+ headerText
+ );
+
+ return _react2.default.createElement(_quick_auth_pane2.default, {
+ alternativeLabel: i18n.str("notYourAccountAction"),
+ alternativeClickHandler: function alternativeClickHandler() {
+ return (0, _actions.skipQuickAuth)(l.id(model));
+ },
+ buttonLabel: i18n.str("windowsAuthLabel"),
+ buttonClickHandler: function buttonClickHandler(e) {
+ return (0, _actions.logIn)(l.id(model), (0, _enterprise.corpNetworkConnection)(model));
+ },
+ header: header,
+ strategy: 'windows'
+ });
+ };
+
+ var KerberosScreen = function (_Screen) {
+ _inherits(KerberosScreen, _Screen);
+
+ function KerberosScreen() {
+ _classCallCheck(this, KerberosScreen);
+
+ return _possibleConstructorReturn(this, _Screen.call(this, "kerberos"));
+ }
+
+ KerberosScreen.prototype.renderAuxiliaryPane = function renderAuxiliaryPane(lock) {
+ return (0, _signed_in_confirmation.renderSignedInConfirmation)(lock);
+ };
+
+ KerberosScreen.prototype.render = function render() {
+ return Component;
+ };
+
+ return KerberosScreen;
+ }(_screen2.default);
+
+ exports.default = KerberosScreen;
+
+/***/ },
+/* 193 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ exports.__esModule = true;
+
+ var _react = __webpack_require__(1);
+
+ var _react2 = _interopRequireDefault(_react);
+
+ var _screen = __webpack_require__(17);
+
+ var _screen2 = _interopRequireDefault(_screen);
+
+ var _quick_auth_pane = __webpack_require__(74);
+
+ var _quick_auth_pane2 = _interopRequireDefault(_quick_auth_pane);
+
+ var _actions = __webpack_require__(56);
+
+ var _signed_in_confirmation = __webpack_require__(30);
+
+ var _index = __webpack_require__(2);
+
+ var l = _interopRequireWildcard(_index);
+
+ var _enterprise = __webpack_require__(16);
+
+ var _index2 = __webpack_require__(36);
+
+ 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 }; }
+
+ 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; }
+
+ // TODO: handle this from CSS
+ function icon(strategy) {
+ if (strategy === "google-apps") return strategy;
+ if (~["adfs", "office365", "waad"].indexOf(strategy)) return "windows";
+ return "auth0";
+ }
+
+ var Component = function Component(_ref) {
+ var i18n = _ref.i18n,
+ model = _ref.model;
+
+ var headerText = i18n.html("enterpriseLoginIntructions") || null;
+ var header = headerText && _react2.default.createElement(
+ 'p',
+ null,
+ headerText
+ );
+
+ var theme = (0, _index2.authButtonsTheme)(model);
+
+ var connection = (0, _enterprise.quickAuthConnection)(model);
+ var connectionName = connection.getIn(["name"]);
+ var connectionDomain = connection.getIn(["domains", 0]);
+
+ var buttonTheme = theme.get(connection.get("name"));
+
+ var buttonLabel = buttonTheme && buttonTheme.get("displayName") || connectionDomain && i18n.str("loginAtLabel", connectionDomain) || i18n.str("loginAtLabel", connectionName);
+
+ var primaryColor = buttonTheme && buttonTheme.get("primaryColor");
+ var foregroundColor = buttonTheme && buttonTheme.get("foregroundColor");
+ var buttonIcon = buttonTheme && buttonTheme.get("icon");
+
+ return _react2.default.createElement(_quick_auth_pane2.default, {
+ buttonLabel: buttonLabel,
+ buttonClickHandler: function buttonClickHandler(e) {
+ return (0, _actions.logIn)(l.id(model), (0, _enterprise.quickAuthConnection)(model));
+ },
+ header: header,
+ buttonIcon: buttonIcon,
+ primaryColor: primaryColor,
+ foregroundColor: foregroundColor,
+ strategy: icon((0, _enterprise.quickAuthConnection)(model).get("strategy"))
+ });
+ };
+
+ var QuickAuthScreen = function (_Screen) {
+ _inherits(QuickAuthScreen, _Screen);
+
+ function QuickAuthScreen() {
+ _classCallCheck(this, QuickAuthScreen);
+
+ return _possibleConstructorReturn(this, _Screen.call(this, "enterpriseQuickAuth"));
+ }
+
+ QuickAuthScreen.prototype.renderAuxiliaryPane = function renderAuxiliaryPane(lock) {
+ return (0, _signed_in_confirmation.renderSignedInConfirmation)(lock);
+ };
+
+ QuickAuthScreen.prototype.render = function render() {
+ return Component;
+ };
+
+ return QuickAuthScreen;
+ }(_screen2.default);
+
+ exports.default = QuickAuthScreen;
+
+/***/ },
+/* 194 */
+/***/ 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 _events = __webpack_require__(238);
+
+ var _index = __webpack_require__(11);
+
+ var _box = __webpack_require__(214);
+
+ var _web_api = __webpack_require__(54);
+
+ var _web_api2 = _interopRequireDefault(_web_api);
+
+ var _actions = __webpack_require__(22);
+
+ var _index2 = __webpack_require__(2);
+
+ var l = _interopRequireWildcard(_index2);
+
+ var _index3 = __webpack_require__(8);
+
+ var c = _interopRequireWildcard(_index3);
+
+ var _id_utils = __webpack_require__(229);
+
+ var idu = _interopRequireWildcard(_id_utils);
+
+ var _i18n = __webpack_require__(13);
+
+ var i18n = _interopRequireWildcard(_i18n);
+
+ var _sync = __webpack_require__(44);
+
+ 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 }; }
+
+ 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 Base = function (_EventEmitter) {
+ _inherits(Base, _EventEmitter);
+
+ function Base(clientID, domain) {
+ var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
+ var engine = arguments[3];
+
+ _classCallCheck(this, Base);
+
+ if (typeof clientID != "string") {
+ throw new Error("A `clientID` string must be provided as first argument.");
+ }
+ if (typeof domain != "string") {
+ throw new Error("A `domain` string must be provided as second argument.");
+ }
+ if ((typeof options === 'undefined' ? 'undefined' : _typeof(options)) != "object") {
+ throw new Error("When provided, the third argument must be an `options` object.");
+ }
+
+ var _this = _possibleConstructorReturn(this, _EventEmitter.call(this));
+
+ _this.validEvents = ['show', 'hide', 'unrecoverable_error', 'authenticated', 'authorization_error', 'hash_parsed', 'signin ready', 'signup ready'];
+
+ _this.id = idu.incremental();
+ _this.engine = engine;
+ var hookRunner = _this.runHook.bind(_this);
+ var emitEventFn = _this.emit.bind(_this);
+
+ (0, _sync.go)(_this.id);
+
+ var m = (0, _actions.setupLock)(_this.id, clientID, domain, options, hookRunner, emitEventFn);
+ _this.on('newListener', function (type) {
+ if (_this.validEvents.indexOf(type) === -1) {
+ l.emitUnrecoverableErrorEvent(m, 'Invalid event "' + type + '".');
+ }
+ });
+
+ if (l.auth.autoParseHash(m) && !Base.hasScheduledAuthCallback) {
+ Base.hasScheduledAuthCallback = true;
+ setTimeout(_actions.handleAuthCallback, 0);
+ }
+
+ (0, _index.observe)("render", _this.id, function (m) {
+ var partialApplyId = function partialApplyId(screen, handlerName) {
+ var handler = screen[handlerName](m);
+ return handler ? function () {
+ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
+ args[_key] = arguments[_key];
+ }
+
+ return handler.apply(undefined, [l.id(m)].concat(args));
+ } : handler;
+ };
+ var avatar = l.ui.avatar(m) && m.getIn(["avatar", "transient", "syncStatus"]) === "ok" || null;
+
+ if (l.rendering(m)) {
+ (function () {
+
+ var screen = _this.engine.render(m);
+
+ var title = avatar ? i18n.str(m, "welcome", m.getIn(["avatar", "transient", "displayName"])) : screen.getTitle(m);
+
+ var disableSubmitButton = screen.isSubmitDisabled(m);
+
+ var i18nProp = {
+ group: function group(keyPath) {
+ return i18n.group(m, keyPath);
+ },
+ html: function html(keyPath) {
+ for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
+ args[_key2 - 1] = arguments[_key2];
+ }
+
+ return i18n.html.apply(i18n, [m, keyPath].concat(args));
+ },
+ str: function str(keyPath) {
+ for (var _len3 = arguments.length, args = Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
+ args[_key3 - 1] = arguments[_key3];
+ }
+
+ return i18n.str.apply(i18n, [m, keyPath].concat(args));
+ }
+ };
+
+ var getScreenTitle = function getScreenTitle(m) {
+ // if it is the first screen and the flag is enabled, it should hide the title
+ return l.ui.hideMainScreenTitle(m) && screen.isFirstScreen(m) ? null : title;
+ };
+
+ var props = {
+ avatar: avatar && m.getIn(["avatar", "transient", "url"]),
+ auxiliaryPane: screen.renderAuxiliaryPane(m),
+ autofocus: l.ui.autofocus(m),
+ backHandler: partialApplyId(screen, "backHandler"),
+ badgeLink: "https://auth0.com/?utm_source=lock&utm_campaign=badge&utm_medium=widget",
+ closeHandler: l.ui.closable(m) ? function () {
+ for (var _len4 = arguments.length, args = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
+ args[_key4] = arguments[_key4];
+ }
+
+ return _actions.closeLock.apply(undefined, [l.id(m)].concat(args));
+ } : undefined,
+ contentComponent: screen.render(),
+ contentProps: { i18n: i18nProp, model: m },
+ disableSubmitButton: disableSubmitButton,
+ error: l.globalError(m),
+ isMobile: l.ui.mobile(m),
+ isModal: l.ui.appendContainer(m),
+ isSubmitting: l.submitting(m),
+ logo: l.ui.logo(m),
+ primaryColor: l.ui.primaryColor(m),
+ screenName: screen.name,
+ showBadge: l.showBadge(m) === true,
+ success: l.globalSuccess(m),
+ submitButtonLabel: l.ui.labeledSubmitButton(m) ? screen.submitButtonLabel(m) : null,
+ submitHandler: partialApplyId(screen, "submitHandler"),
+ tabs: screen.renderTabs(m),
+ terms: screen.renderTerms(m, i18nProp.html("signUpTerms")),
+ title: getScreenTitle(m),
+ transitionName: screen.name === "loading" ? "fade" : "horizontal-fade"
+ };
+ (0, _box.render)(l.ui.containerID(m), props);
+
+ // TODO: hack so we can start testing the beta
+ if (!_this.oldScreenName || _this.oldScreenName != screen.name) {
+ if (screen.name === "main.login") {
+ l.emitEvent(m, "signin ready");
+ } else if (screen.name === "main.signUp") {
+ l.emitEvent(m, "signup ready");
+ }
+ }
+ _this.oldScreenName = screen.name;
+ })();
+ } else {
+ (0, _box.remove)(l.ui.containerID(m));
+ }
+ });
+ return _this;
+ }
+
+ Base.prototype.resumeAuth = function resumeAuth(hash, callback) {
+ (0, _actions.resumeAuth)(hash, callback);
+ };
+
+ Base.prototype.show = function show() {
+ var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
+
+ (0, _actions.openLock)(this.id, opts);
+ };
+
+ Base.prototype.hide = function hide() {
+ (0, _actions.closeLock)(this.id, true);
+ };
+
+ Base.prototype.destroy = function destroy() {
+ (0, _actions.removeLock)(this.id);
+ };
+
+ Base.prototype.getProfile = function getProfile(token, cb) {
+ return _web_api2.default.getProfile(this.id, token, cb);
+ };
+
+ Base.prototype.getUserInfo = function getUserInfo(token, cb) {
+ return _web_api2.default.getUserInfo(this.id, token, cb);
+ };
+
+ Base.prototype.logout = function logout() {
+ var query = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
+
+ _web_api2.default.signOut(this.id, query);
+ };
+
+ Base.prototype.update = function update(f) {
+ return (0, _actions.updateLock)(this.id, f);
+ };
+
+ Base.prototype.setModel = function setModel(m) {
+ return this.update(function () {
+ return m;
+ });
+ };
+
+ Base.prototype.runHook = function runHook(str, m) {
+ var _engine;
+
+ if (typeof this.engine[str] != "function") return m;
+
+ for (var _len5 = arguments.length, args = Array(_len5 > 2 ? _len5 - 2 : 0), _key5 = 2; _key5 < _len5; _key5++) {
+ args[_key5 - 2] = arguments[_key5];
+ }
+
+ return (_engine = this.engine)[str].apply(_engine, [m].concat(args));
+ };
+
+ return Base;
+ }(_events.EventEmitter);
+
+ exports.default = Base;
+
+/***/ },
+/* 195 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ exports.__esModule = true;
+ exports.fetchClientSettings = fetchClientSettings;
+ exports.syncClientSettingsSuccess = syncClientSettingsSuccess;
+
+ var _urlJoin = __webpack_require__(20);
+
+ var _urlJoin2 = _interopRequireDefault(_urlJoin);
+
+ var _cdn_utils = __webpack_require__(75);
+
+ var _index = __webpack_require__(2);
+
+ var l = _interopRequireWildcard(_index);
+
+ var _index2 = __webpack_require__(110);
+
+ 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 }; }
+
+ function fetchClientSettings(clientID, clientBaseUrl, cb) {
+ (0, _cdn_utils.load)({
+ method: "setClient",
+ url: (0, _urlJoin2.default)(clientBaseUrl, 'client', clientID + '.js?t' + +new Date()),
+ check: function check(o) {
+ return o && o.id === clientID;
+ },
+ cb: cb
+ });
+ }
+
+ function syncClientSettingsSuccess(m, result) {
+ m = (0, _index2.initClient)(m, result);
+ m = l.filterConnections(m);
+ m = l.runHook(m, "didReceiveClientSettings");
+ return m;
+ }
+
+/***/ },
+/* 196 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ exports.__esModule = true;
+
+ var _react = __webpack_require__(1);
+
+ var _react2 = _interopRequireDefault(_react);
+
+ var _screen = __webpack_require__(17);
+
+ var _screen2 = _interopRequireDefault(_screen);
+
+ var _index = __webpack_require__(2);
+
+ var l = _interopRequireWildcard(_index);
+
+ 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 }; }
+
+ 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 ErrorScreen = function (_Screen) {
+ _inherits(ErrorScreen, _Screen);
+
+ function ErrorScreen() {
+ _classCallCheck(this, ErrorScreen);
+
+ return _possibleConstructorReturn(this, _Screen.call(this, "error"));
+ }
+
+ ErrorScreen.prototype.render = function render() {
+ return ErrorPane;
+ };
+
+ return ErrorScreen;
+ }(_screen2.default);
+
+ exports.default = ErrorScreen;
+
+
+ var ErrorPane = function ErrorPane(_ref) {
+ var i18n = _ref.i18n;
+ return _react2.default.createElement(
+ 'div',
+ { className: 'auth0-lock-error-pane' },
+ _react2.default.createElement(
+ 'p',
+ null,
+ i18n.html("unrecoverableError")
+ )
+ );
+ };
+
+ ErrorPane.propTypes = {
+ i18n: _react2.default.PropTypes.object.isRequired
+ };
+
+/***/ },
+/* 197 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ exports.__esModule = true;
+
+ var _react = __webpack_require__(1);
+
+ var _react2 = _interopRequireDefault(_react);
+
+ var _screen = __webpack_require__(17);
+
+ var _screen2 = _interopRequireDefault(_screen);
+
+ var _actions = __webpack_require__(22);
+
+ var _index = __webpack_require__(2);
+
+ var l = _interopRequireWildcard(_index);
+
+ 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 }; }
+
+ 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 LoadingScreen = function (_Screen) {
+ _inherits(LoadingScreen, _Screen);
+
+ function LoadingScreen() {
+ _classCallCheck(this, LoadingScreen);
+
+ return _possibleConstructorReturn(this, _Screen.call(this, "loading"));
+ }
+
+ LoadingScreen.prototype.render = function render() {
+ return LoadingPane;
+ };
+
+ return LoadingScreen;
+ }(_screen2.default);
+
+ exports.default = LoadingScreen;
+
+ var LoadingPane = function (_React$Component) {
+ _inherits(LoadingPane, _React$Component);
+
+ function LoadingPane() {
+ _classCallCheck(this, LoadingPane);
+
+ return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
+ }
+
+ LoadingPane.prototype.componentDidMount = function componentDidMount() {
+ var model = this.props.model;
+
+ (0, _actions.pinLoadingPane)(l.id(model));
+ setTimeout(function () {
+ return (0, _actions.unpinLoadingPane)(l.id(model));
+ }, 1200);
+ };
+
+ LoadingPane.prototype.render = function render() {
+ return _react2.default.createElement(
+ 'div',
+ { className: 'auth0-loading-screen' },
+ _react2.default.createElement(
+ 'div',
+ { className: 'auth0-loading-container' },
+ _react2.default.createElement('div', { className: 'auth0-loading' })
+ )
+ );
+ };
+
+ return LoadingPane;
+ }(_react2.default.Component);
+
+ LoadingPane.propTypes = {
+ model: _react2.default.PropTypes.object.isRequired
+ };
+
+/***/ },
+/* 198 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ exports.__esModule = true;
+ exports.syncRemoteData = syncRemoteData;
+
+ var _immutable = __webpack_require__(9);
+
+ var _immutable2 = _interopRequireDefault(_immutable);
+
+ var _settings = __webpack_require__(195);
+
+ var _settings2 = __webpack_require__(201);
+
+ var _data = __webpack_require__(199);
+
+ var _index = __webpack_require__(2);
+
+ var l = _interopRequireWildcard(_index);
+
+ var _enterprise = __webpack_require__(16);
+
+ var _sync = __webpack_require__(44);
+
+ var _sync2 = _interopRequireDefault(_sync);
+
+ 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 }; }
+
+ function syncRemoteData(m) {
+
+ if (l.useTenantInfo(m)) {
+ m = (0, _sync2.default)(m, "client", {
+ syncFn: function syncFn(m, cb) {
+ return (0, _settings2.fetchTenantSettings)(l.tenantBaseUrl(m), cb);
+ },
+ successFn: function successFn(m, result) {
+ return (0, _settings2.syncTenantSettingsSuccess)(m, l.clientID(m), result);
+ }
+ });
+ } else {
+ m = (0, _sync2.default)(m, "client", {
+ syncFn: function syncFn(m, cb) {
+ return (0, _settings.fetchClientSettings)(l.clientID(m), l.clientBaseUrl(m), cb);
+ },
+ successFn: _settings.syncClientSettingsSuccess
+ });
+ }
+
+ m = (0, _sync2.default)(m, "sso", {
+ conditionFn: function conditionFn(m) {
+ return l.auth.sso(m) && !l.oidcConformant(m);
+ },
+ waitFn: function waitFn(m) {
+ return (0, _sync.isSuccess)(m, "client");
+ },
+ syncFn: function syncFn(m, cb) {
+ return (0, _data.fetchSSOData)(l.id(m), (0, _enterprise.isADEnabled)(m), cb);
+ },
+ successFn: function successFn(m, result) {
+ return m.mergeIn(["sso"], _immutable2.default.fromJS(result));
+ },
+ errorFn: function errorFn(m, error) {
+ // location.origin is not supported in all browsers
+ var origin = location.protocol + "//" + location.hostname;
+ if (location.port) {
+ origin += ":" + location.port;
+ }
+
+ var appSettingsUrl = 'https://manage.auth0.com/#/applications/' + l.clientID(m) + '/settings';
+
+ l.warn(m, 'There was an error fetching the SSO data. This could simply mean that there was a problem with the network. But, if a "Origin" error has been logged before this warning, please add "' + origin + '" to the "Allowed Origins (CORS)" list in the Auth0 dashboard: ' + appSettingsUrl);
+ }
+ });
+
+ return m;
+ } // shouldn't depend on this
+
+/***/ },
+/* 199 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ exports.__esModule = true;
+ exports.fetchSSOData = fetchSSOData;
+
+ var _web_api = __webpack_require__(54);
+
+ var _web_api2 = _interopRequireDefault(_web_api);
+
+ var _cache = __webpack_require__(227);
+
+ var _cache2 = _interopRequireDefault(_cache);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ var cache = new _cache2.default(function () {
+ return _web_api2.default.getSSOData.apply(_web_api2.default, arguments);
+ });
+
+ function fetchSSOData(id, withAD, cb) {
+ cache.get(id, withAD, cb);
+ }
+
+/***/ },
+/* 200 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ exports.__esModule = true;
+
+ var _react = __webpack_require__(1);
+
+ var _react2 = _interopRequireDefault(_react);
+
+ var _screen = __webpack_require__(17);
+
+ var _screen2 = _interopRequireDefault(_screen);
+
+ var _quick_auth_pane = __webpack_require__(74);
+
+ var _quick_auth_pane2 = _interopRequireDefault(_quick_auth_pane);
+
+ var _actions = __webpack_require__(56);
+
+ var _index = __webpack_require__(112);
+
+ var _index2 = __webpack_require__(2);
+
+ var l = _interopRequireWildcard(_index2);
+
+ var _signed_in_confirmation = __webpack_require__(30);
+
+ var _index3 = __webpack_require__(36);
+
+ 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 }; }
+
+ 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; }
+
+ // TODO: handle this from CSS
+ function icon(strategy) {
+ if (_index3.STRATEGIES[strategy]) return strategy;
+ if (strategy === "google-apps") return strategy;
+ if (~["adfs", "office365", "waad"].indexOf(strategy)) return "windows";
+ return "auth0";
+ }
+
+ var Component = function Component(_ref) {
+ var i18n = _ref.i18n,
+ model = _ref.model;
+
+ var headerText = i18n.html("lastLoginInstructions") || null;
+ var header = headerText && _react2.default.createElement(
+ 'p',
+ null,
+ headerText
+ );
+
+ var buttonClickHandler = function buttonClickHandler() {
+ (0, _actions.logIn)(l.id(model), (0, _index.lastUsedConnection)(model), (0, _index.lastUsedUsername)(model));
+ };
+
+ return _react2.default.createElement(_quick_auth_pane2.default, {
+ alternativeLabel: i18n.str("notYourAccountAction"),
+ alternativeClickHandler: function alternativeClickHandler() {
+ return (0, _actions.skipQuickAuth)(l.id(model));
+ },
+ buttonLabel: (0, _index.lastUsedUsername)(model),
+ buttonClickHandler: buttonClickHandler,
+ header: header,
+ strategy: icon((0, _index.lastUsedConnection)(model).get("strategy"))
+ });
+ };
+
+ var LastLoginScreen = function (_Screen) {
+ _inherits(LastLoginScreen, _Screen);
+
+ function LastLoginScreen() {
+ _classCallCheck(this, LastLoginScreen);
+
+ return _possibleConstructorReturn(this, _Screen.call(this, "lastLogin"));
+ }
+
+ LastLoginScreen.prototype.renderAuxiliaryPane = function renderAuxiliaryPane(lock) {
+ return (0, _signed_in_confirmation.renderSignedInConfirmation)(lock);
+ };
+
+ LastLoginScreen.prototype.render = function render() {
+ return Component;
+ };
+
+ return LastLoginScreen;
+ }(_screen2.default);
+
+ exports.default = LastLoginScreen;
+
+/***/ },
+/* 201 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ exports.__esModule = true;
+ exports.fetchTenantSettings = fetchTenantSettings;
+ exports.syncTenantSettingsSuccess = syncTenantSettingsSuccess;
+
+ var _cdn_utils = __webpack_require__(75);
+
+ var _index = __webpack_require__(2);
+
+ var l = _interopRequireWildcard(_index);
+
+ var _index2 = __webpack_require__(67);
+
+ 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 fetchTenantSettings(tenantBaseUrl, cb) {
+ (0, _cdn_utils.load)({
+ method: "setTenant",
+ url: tenantBaseUrl + '?t' + +new Date(),
+ check: function check() {
+ return true;
+ },
+ cb: cb
+ });
+ }
+
+ function syncTenantSettingsSuccess(m, client_id, result) {
+ m = (0, _index2.initTenant)(m, client_id, result);
+ m = l.filterConnections(m);
+ m = l.runHook(m, "didReceiveClientSettings");
+ return m;
+ }
+
+/***/ },
+/* 202 */
+/***/ 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 _idtokenVerifier = __webpack_require__(126);
+
+ var _idtokenVerifier2 = _interopRequireDefault(_idtokenVerifier);
+
+ var _auth0Js = __webpack_require__(52);
+
+ var _auth0Js2 = _interopRequireDefault(_auth0Js);
+
+ var _cordova = __webpack_require__(102);
+
+ var _cordova2 = _interopRequireDefault(_cordova);
+
+ var _superagent = __webpack_require__(99);
+
+ var _superagent2 = _interopRequireDefault(_superagent);
+
+ var _helper = __webpack_require__(113);
+
+ 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 Auth0LegacyAPIClient = function () {
+ function Auth0LegacyAPIClient(clientID, domain, opts) {
+ _classCallCheck(this, Auth0LegacyAPIClient);
+
+ this.client = null;
+ this.authOpt = null;
+
+ this.domain = domain;
+ this.clientID = clientID;
+ this.tokenIssuer = opts.overrides && opts.overrides.__token_issuer || 'https://' + domain + '/';
+
+ var default_telemetry = {
+ name: 'lock.js',
+ version: '10.11.0',
+ lib_version: _auth0Js2.default.version
+ };
+
+ this.client = new _auth0Js2.default.WebAuth({
+ clientID: clientID,
+ domain: domain,
+ redirectUri: opts.redirectUrl,
+ responseMode: opts.responseMode,
+ responseType: opts.responseType,
+ plugins: [new _cordova2.default()],
+ _sendTelemetry: opts._sendTelemetry === false ? false : true,
+ _telemetryInfo: opts._telemetryInfo || default_telemetry,
+ __tenant: opts.overrides && opts.overrides.__tenant,
+ __token_issuer: opts.overrides && opts.overrides.__token_issuer,
+ _disableDeprecationWarnings: true
+ });
+
+ this.authOpt = {
+ popup: !opts.redirect,
+ popupOptions: opts.popupOptions,
+ sso: opts.sso,
+ nonce: opts.nonce,
+ state: opts.state
+ };
+ }
+
+ Auth0LegacyAPIClient.prototype.logIn = function logIn(options, authParams, cb) {
+ // TODO: for passwordless only, try to clean in auth0.js
+ // client._shouldRedirect = redirect || responseType === "code" || !!redirectUrl;
+ var f = (0, _helper.loginCallback)(!this.authOpt.popup, cb);
+ var auth0Client = this.client;
+
+ if (!options.username && !options.email) {
+ if (this.authOpt.popup) {
+ auth0Client.popup.authorize(_extends({}, options, this.authOpt, authParams), f);
+ } else {
+ auth0Client.authorize(_extends({}, options, this.authOpt, authParams), f);
+ }
+ } else if (!this.authOpt.sso && this.authOpt.popup) {
+ auth0Client.client.loginWithResourceOwner(_extends({}, options, this.authOpt, authParams), f);
+ } else if (this.authOpt.popup) {
+ auth0Client.popup.loginWithCredentials(_extends({}, options, this.authOpt, authParams), f);
+ } else {
+ auth0Client.redirect.loginWithCredentials(_extends({}, options, this.authOpt, authParams), f);
+ }
+ };
+
+ Auth0LegacyAPIClient.prototype.signOut = function signOut(query) {
+ this.client.logout(query);
+ };
+
+ Auth0LegacyAPIClient.prototype.signUp = function signUp(options, cb) {
+ var _authOpt = this.authOpt,
+ popup = _authOpt.popup,
+ sso = _authOpt.sso;
+ var autoLogin = options.autoLogin;
+
+
+ delete options.autoLogin;
+
+ var popupHandler = autoLogin && popup ? this.client.popup.preload() : null;
+
+ this.client.signup(options, function (err, result) {
+ return cb(err, result, popupHandler);
+ });
+ };
+
+ Auth0LegacyAPIClient.prototype.resetPassword = function resetPassword(options, cb) {
+ this.client.changePassword(options, cb);
+ };
+
+ Auth0LegacyAPIClient.prototype.startPasswordless = function startPasswordless(options, cb) {
+ this.client.startPasswordless(options, function (err) {
+ return cb((0, _helper.normalizeError)(err));
+ });
+ };
+
+ // for legacy, we should not verify the id_token so we reimplemented it here
+ // to avoid adding dirt into auth0.js. At some point we will get rid of this.
+
+
+ Auth0LegacyAPIClient.prototype.parseHash = function parseHash() {
+ var hash = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
+ var cb = arguments[1];
+
+ hash = decodeURIComponent(hash);
+ var nonce = this.authOpt.nonce;
+
+ var parsed_qs = parseQS(hash.replace(/^#?\/?/, ''));
+
+ var state = this.authOpt.state || parsed_qs.state;
+
+ this.client.transactionManager.getStoredTransaction(state);
+
+ if (parsed_qs.hasOwnProperty('error')) {
+ var err = {
+ error: parsed_qs.error,
+ error_description: parsed_qs.error_description
+ };
+
+ if (parsed_qs.state) {
+ err.state = parsed_qs.state;
+ }
+
+ return cb(err);
+ }
+
+ if (!parsed_qs.hasOwnProperty('access_token') && !parsed_qs.hasOwnProperty('id_token') && !parsed_qs.hasOwnProperty('refresh_token')) {
+ return cb(null, null);
+ }
+
+ var prof;
+
+ if (parsed_qs.hasOwnProperty('id_token')) {
+ var invalidJwt = function invalidJwt(error) {
+ var err = {
+ error: 'invalid_token',
+ error_description: error
+ };
+ return err;
+ };
+
+ var verifier = new _idtokenVerifier2.default({});
+ prof = verifier.decode(parsed_qs.id_token).payload;
+
+ if (prof.aud !== this.clientID) {
+ return cb(invalidJwt('The clientID configured (' + this.clientID + ') does not match with the clientID set in the token (' + prof.aud + ').'));
+ }
+
+ // iss should be the Auth0 domain (i.e.: https://contoso.auth0.com/)
+ if (prof.iss !== this.tokenIssuer) {
+ return cb(invalidJwt('The domain configured (' + this.tokenIssuer + ') does not match with the domain set in the token (' + prof.iss + ').'));
+ }
+ }
+
+ cb(null, {
+ accessToken: parsed_qs.access_token,
+ idToken: parsed_qs.id_token,
+ idTokenPayload: prof,
+ refreshToken: parsed_qs.refresh_token,
+ state: parsed_qs.state
+ });
+ };
+
+ Auth0LegacyAPIClient.prototype.getUserInfo = function getUserInfo(token, callback) {
+ return this.client.client.userInfo(token, callback);
+ };
+
+ // auth0.js does not supports this endpoint because it is deprecated for oidcConformat clients
+ // we implemented it here to provide BC support, we will loose it in lock 11.
+
+
+ Auth0LegacyAPIClient.prototype.getProfile = function getProfile(token, callback) {
+ _superagent2.default.get('https://' + this.domain + '/tokeninfo?id_token=' + token).end(function (err, res) {
+ if (err) {
+ return callback({
+ error: err.message,
+ error_description: res.text || res.body
+ });
+ }
+
+ return callback(null, res.body);
+ });
+ };
+
+ Auth0LegacyAPIClient.prototype.getSSOData = function getSSOData() {
+ var _client$client;
+
+ return (_client$client = this.client.client).getSSOData.apply(_client$client, arguments);
+ };
+
+ Auth0LegacyAPIClient.prototype.getUserCountry = function getUserCountry(cb) {
+ return this.client.getUserCountry(cb);
+ };
+
+ return Auth0LegacyAPIClient;
+ }();
+
+ exports.default = Auth0LegacyAPIClient;
+
+
+ function parseQS(qs) {
+ return qs.split('&').reduce(function (prev, curr) {
+ var param = curr.split('=');
+ prev[param[0]] = param[1];
+ return prev;
+ }, {});
+ }
+
+/***/ },
+/* 203 */
+/***/ 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 _auth0Js = __webpack_require__(52);
+
+ var _auth0Js2 = _interopRequireDefault(_auth0Js);
+
+ var _cordova = __webpack_require__(102);
+
+ var _cordova2 = _interopRequireDefault(_cordova);
+
+ var _index = __webpack_require__(2);
+
+ var l = _interopRequireWildcard(_index);
+
+ var _index2 = __webpack_require__(11);
+
+ var _helper = __webpack_require__(113);
+
+ 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 }; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ var Auth0APIClient = function () {
+ function Auth0APIClient(lockID, clientID, domain, opts) {
+ _classCallCheck(this, Auth0APIClient);
+
+ this.lockID = lockID;
+ this.client = null;
+ this.authOpt = null;
+
+ var default_telemetry = {
+ name: 'lock.js',
+ version: '10.11.0',
+ lib_version: _auth0Js2.default.version
+ };
+
+ this.client = new _auth0Js2.default.WebAuth({
+ clientID: clientID,
+ domain: domain,
+ audience: opts.audience,
+ redirectUri: opts.redirectUrl,
+ responseMode: opts.responseMode,
+ responseType: opts.responseType,
+ leeway: opts.leeway || 1,
+ plugins: [new _cordova2.default()],
+ _sendTelemetry: opts._sendTelemetry === false ? false : true,
+ _telemetryInfo: opts._telemetryInfo || default_telemetry,
+ __tenant: opts.overrides && opts.overrides.__tenant,
+ __token_issuer: opts.overrides && opts.overrides.__token_issuer
+ });
+
+ this.authOpt = {
+ popup: !opts.redirect,
+ popupOptions: opts.popupOptions,
+ sso: opts.sso,
+ nonce: opts.nonce,
+ state: opts.state
+ };
+ }
+
+ Auth0APIClient.prototype.logIn = function logIn(options, authParams, cb) {
+ // TODO: for passwordless only, try to clean in auth0.js
+ // client._shouldRedirect = redirect || responseType === "code" || !!redirectUrl;
+ var f = (0, _helper.loginCallback)(false, cb);
+
+ if (!options.username && !options.email) {
+ if (this.authOpt.popup) {
+ this.client.popup.authorize(_extends({}, options, this.authOpt, authParams), f);
+ } else {
+ this.client.authorize(_extends({}, options, this.authOpt, authParams), f);
+ }
+ } else {
+ options.realm = options.connection;
+ this.client.client.login(_extends({}, options, this.authOpt, authParams), f);
+ }
+ };
+
+ Auth0APIClient.prototype.signOut = function signOut(query) {
+ this.client.logout(query);
+ };
+
+ Auth0APIClient.prototype.signUp = function signUp(options, cb) {
+ var _authOpt = this.authOpt,
+ popup = _authOpt.popup,
+ sso = _authOpt.sso;
+ var autoLogin = options.autoLogin;
+
+
+ delete options.autoLogin;
+
+ this.client.signup(options, function (err, result) {
+ return cb(err, result);
+ });
+ };
+
+ Auth0APIClient.prototype.resetPassword = function resetPassword(options, cb) {
+ this.client.changePassword(options, cb);
+ };
+
+ Auth0APIClient.prototype.startPasswordless = function startPasswordless(options, cb) {
+ this.client.startPasswordless(options, function (err) {
+ return cb((0, _helper.normalizeError)(err));
+ });
+ };
+
+ Auth0APIClient.prototype.parseHash = function parseHash() {
+ var hash = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
+ var cb = arguments[1];
+
+ return this.client.parseHash({
+ hash: decodeURIComponent(hash),
+ nonce: this.authOpt.nonce,
+ state: this.authOpt.state
+ }, cb);
+ };
+
+ Auth0APIClient.prototype.getUserInfo = function getUserInfo(token, callback) {
+ return this.client.client.userInfo(token, callback);
+ };
+
+ Auth0APIClient.prototype.getProfile = function getProfile(token, callback) {
+ var m = (0, _index2.read)(_index2.getEntity, "lock", this.lockID);
+ l.emitUnrecoverableErrorEvent(m, '`getProfile` is deprecated for oidcConformant clients');
+ };
+
+ Auth0APIClient.prototype.getSSOData = function getSSOData() {
+ var _client$client;
+
+ return (_client$client = this.client.client).getSSOData.apply(_client$client, arguments);
+ };
+
+ Auth0APIClient.prototype.getUserCountry = function getUserCountry(cb) {
+ return this.client.getUserCountry(cb);
+ };
+
+ return Auth0APIClient;
+ }();
+
+ exports.default = Auth0APIClient;
+
+/***/ },
+/* 204 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ exports.__esModule = true;
+
+ var _react = __webpack_require__(1);
+
+ var _react2 = _interopRequireDefault(_react);
+
+ var _screen = __webpack_require__(17);
+
+ var _screen2 = _interopRequireDefault(_screen);
+
+ var _social_buttons_pane = __webpack_require__(115);
+
+ var _social_buttons_pane2 = _interopRequireDefault(_social_buttons_pane);
+
+ var _login_pane = __webpack_require__(183);
+
+ var _login_pane2 = _interopRequireDefault(_login_pane);
+
+ var _pane_separator = __webpack_require__(111);
+
+ var _pane_separator2 = _interopRequireDefault(_pane_separator);
+
+ var _index = __webpack_require__(10);
+
+ var _actions = __webpack_require__(35);
+
+ var _signed_in_confirmation = __webpack_require__(30);
+
+ var _login_sign_up_tabs = __webpack_require__(108);
+
+ var _login_sign_up_tabs2 = _interopRequireDefault(_login_sign_up_tabs);
+
+ var _index2 = __webpack_require__(2);
+
+ var l = _interopRequireWildcard(_index2);
+
+ var _index3 = __webpack_require__(8);
+
+ var c = _interopRequireWildcard(_index3);
+
+ var _email = __webpack_require__(29);
+
+ var _actions2 = __webpack_require__(66);
+
+ var _enterprise = __webpack_require__(16);
+
+ var _single_sign_on_notice = __webpack_require__(109);
+
+ var _single_sign_on_notice2 = _interopRequireDefault(_single_sign_on_notice);
+
+ var _classic = __webpack_require__(55);
+
+ var _i18n = __webpack_require__(13);
+
+ var i18n = _interopRequireWildcard(_i18n);
+
+ 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 }; }
+
+ 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 shouldRenderTabs(m) {
+ if ((0, _classic.isSSOEnabled)(m)) return false;
+ if (l.hasSomeConnections(m, "database")) return (0, _index.hasScreen)(m, "signUp");
+ if (l.hasSomeConnections(m, "social") && (0, _index.hasInitialScreen)(m, "signUp")) return (0, _index.hasScreen)(m, "signUp");
+ }
+
+ var Component = function Component(_ref) {
+ var i18n = _ref.i18n,
+ model = _ref.model,
+ t = _ref.t;
+
+ var sso = (0, _classic.isSSOEnabled)(model);
+ var onlySocial = (0, _classic.hasOnlyClassicConnections)(model, "social");
+
+ var tabs = shouldRenderTabs(model) && _react2.default.createElement(_login_sign_up_tabs2.default, {
+ key: 'loginsignup',
+ lock: model,
+ loginLabel: i18n.str("loginLabel"),
+ signUpLink: (0, _index.signUpLink)(model),
+ signUpLabel: i18n.str("signUpLabel")
+ });
+
+ var social = l.hasSomeConnections(model, "social") && _react2.default.createElement(_social_buttons_pane2.default, {
+ bigButtons: (0, _classic.useBigSocialButtons)(model),
+ instructions: i18n.html("socialLoginInstructions"),
+ labelFn: i18n.str,
+ lock: model,
+ showLoading: onlySocial,
+ signUp: false
+ });
+
+ var showPassword = !sso && (l.hasSomeConnections(model, "database") || !!(0, _enterprise.findADConnectionWithoutDomain)(model));
+
+ var showForgotPasswordLink = showPassword && l.hasSomeConnections(model, "database");
+
+ var loginInstructionsKey = social ? "databaseEnterpriseAlternativeLoginInstructions" : "databaseEnterpriseLoginInstructions";
+
+ var usernameInputPlaceholderKey = (0, _index.databaseUsernameStyle)(model) === "any" || l.countConnections(model, "enterprise") > 1 ? "usernameOrEmailInputPlaceholder" : "usernameInputPlaceholder";
+
+ var usernameStyle = (0, _index.databaseUsernameStyle)(model);
+
+ var login = (sso || l.hasSomeConnections(model, "database") || l.hasSomeConnections(model, "enterprise")) && _react2.default.createElement(_login_pane2.default, {
+ emailInputPlaceholder: i18n.str("emailInputPlaceholder"),
+ forgotPasswordAction: i18n.str("forgotPasswordAction"),
+ i18n: i18n,
+ instructions: i18n.html(loginInstructionsKey),
+ lock: model,
+ passwordInputPlaceholder: i18n.str("passwordInputPlaceholder"),
+ showForgotPasswordLink: showForgotPasswordLink,
+ showPassword: showPassword,
+ usernameInputPlaceholder: i18n.str(usernameInputPlaceholderKey),
+ usernameStyle: usernameStyle
+ });
+
+ var ssoNotice = sso && _react2.default.createElement(
+ _single_sign_on_notice2.default,
+ null,
+ i18n.str("ssoEnabled")
+ );
+
+ var separator = social && login && _react2.default.createElement(_pane_separator2.default, null);
+
+ return _react2.default.createElement(
+ 'div',
+ null,
+ ssoNotice,
+ tabs,
+ social,
+ separator,
+ login
+ );
+ };
+
+ var Login = function (_Screen) {
+ _inherits(Login, _Screen);
+
+ function Login() {
+ _classCallCheck(this, Login);
+
+ return _possibleConstructorReturn(this, _Screen.call(this, "main.login"));
+ }
+
+ Login.prototype.renderAuxiliaryPane = function renderAuxiliaryPane(lock) {
+ return (0, _signed_in_confirmation.renderSignedInConfirmation)(lock);
+ };
+
+ Login.prototype.renderTabs = function renderTabs(model) {
+ return shouldRenderTabs(model);
+ };
+
+ Login.prototype.submitButtonLabel = function submitButtonLabel(m) {
+ return i18n.str(m, ["loginSubmitLabel"]);
+ };
+
+ Login.prototype.isSubmitDisabled = function isSubmitDisabled(m) {
+ // it should disable the submit button if there is any connection that
+ // requires username/password and there is no enterprise with domain
+ // that matches with the email domain entered for HRD
+ return !l.hasSomeConnections(m, "database") // no database connection
+ && !(0, _enterprise.findADConnectionWithoutDomain)(m) // no enterprise without domain
+ && !(0, _classic.isSSOEnabled)(m); // no matching domain
+ };
+
+ Login.prototype.submitHandler = function submitHandler(model) {
+ if ((0, _classic.hasOnlyClassicConnections)(model, "social")) {
+ return null;
+ }
+
+ if ((0, _enterprise.isHRDDomain)(model, (0, _index.databaseUsernameValue)(model))) {
+ return function (id) {
+ return (0, _actions2.startHRD)(id, (0, _index.databaseUsernameValue)(model));
+ };
+ }
+
+ var useDatabaseConnection = !(0, _classic.isSSOEnabled)(model) && (0, _index.databaseConnection)(model) && ((0, _index.defaultDatabaseConnection)(model) || !(0, _enterprise.defaultEnterpriseConnection)(model));
+
+ return useDatabaseConnection ? _actions.logIn : _actions2.logIn;
+ };
+
+ Login.prototype.render = function render() {
+ return Component;
+ };
+
+ return Login;
+ }(_screen2.default);
+
+ exports.default = Login;
+
+/***/ },
+/* 205 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ exports.__esModule = true;
+
+ var _react = __webpack_require__(1);
+
+ var _react2 = _interopRequireDefault(_react);
+
+ var _screen = __webpack_require__(17);
+
+ var _screen2 = _interopRequireDefault(_screen);
+
+ var _mfa_pane = __webpack_require__(184);
+
+ var _mfa_pane2 = _interopRequireDefault(_mfa_pane);
+
+ var _i18n = __webpack_require__(13);
+
+ var i18n = _interopRequireWildcard(_i18n);
+
+ var _actions = __webpack_require__(35);
+
+ var _index = __webpack_require__(10);
+
+ var _signed_in_confirmation = __webpack_require__(30);
+
+ 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 }; }
+
+ 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 Component = function Component(_ref) {
+ var i18n = _ref.i18n,
+ model = _ref.model;
+
+
+ return _react2.default.createElement(_mfa_pane2.default, {
+ mfaInputPlaceholder: i18n.str("mfaInputPlaceholder"),
+ i18n: i18n,
+ instructions: i18n.str("mfaLoginInstructions"),
+ lock: model,
+ title: i18n.str("mfaLoginTitle")
+ });
+ };
+
+ var MFALoginScreen = function (_Screen) {
+ _inherits(MFALoginScreen, _Screen);
+
+ function MFALoginScreen() {
+ _classCallCheck(this, MFALoginScreen);
+
+ return _possibleConstructorReturn(this, _Screen.call(this, "mfa.mfaCode"));
+ }
+
+ MFALoginScreen.prototype.renderAuxiliaryPane = function renderAuxiliaryPane(lock) {
+ return (0, _signed_in_confirmation.renderSignedInConfirmation)(lock);
+ };
+
+ MFALoginScreen.prototype.submitButtonLabel = function submitButtonLabel(m) {
+ return i18n.str(m, ["mfaSubmitLabel"]);
+ };
+
+ MFALoginScreen.prototype.submitHandler = function submitHandler(m) {
+ return function (id) {
+ return (0, _actions.logIn)(id, true);
+ };
+ };
+
+ MFALoginScreen.prototype.render = function render() {
+ return Component;
+ };
+
+ MFALoginScreen.prototype.backHandler = function backHandler(m) {
+ return (0, _index.hasScreen)(m, "login") ? _actions.cancelMFALogin : undefined;
+ };
+
+ return MFALoginScreen;
+ }(_screen2.default);
+
+ exports.default = MFALoginScreen;
+
+/***/ },
+/* 206 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ exports.__esModule = true;
+
+ var _react = __webpack_require__(1);
+
+ var _react2 = _interopRequireDefault(_react);
+
+ var _email_pane = __webpack_require__(68);
+
+ var _email_pane2 = _interopRequireDefault(_email_pane);
+
+ var _password_pane = __webpack_require__(69);
+
+ var _password_pane2 = _interopRequireDefault(_password_pane);
+
+ var _username_pane = __webpack_require__(71);
+
+ var _username_pane2 = _interopRequireDefault(_username_pane);
+
+ var _index = __webpack_require__(10);
+
+ var _custom_input = __webpack_require__(208);
+
+ var _custom_input2 = _interopRequireDefault(_custom_input);
+
+ 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 SignUpPane = function (_React$Component) {
+ _inherits(SignUpPane, _React$Component);
+
+ function SignUpPane() {
+ _classCallCheck(this, SignUpPane);
+
+ return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
+ }
+
+ SignUpPane.prototype.render = function render() {
+ var _props = this.props,
+ emailInputPlaceholder = _props.emailInputPlaceholder,
+ instructions = _props.instructions,
+ i18n = _props.i18n,
+ model = _props.model,
+ onlyEmail = _props.onlyEmail,
+ passwordInputPlaceholder = _props.passwordInputPlaceholder,
+ passwordStrengthMessages = _props.passwordStrengthMessages,
+ usernameInputPlaceholder = _props.usernameInputPlaceholder;
+
+
+ var headerText = instructions || null;
+ var header = headerText && _react2.default.createElement(
+ 'p',
+ null,
+ headerText
+ );
+
+ var usernamePane = !onlyEmail && (0, _index.databaseConnectionRequiresUsername)(model) ? _react2.default.createElement(_username_pane2.default, {
+ i18n: i18n,
+ lock: model,
+ placeholder: usernameInputPlaceholder,
+ validateFormat: true
+ }) : null;
+
+ var fields = !onlyEmail && (0, _index.additionalSignUpFields)(model).map(function (x) {
+ return _react2.default.createElement(_custom_input2.default, {
+ iconUrl: x.get("icon"),
+ key: x.get("name"),
+ model: model,
+ name: x.get("name"),
+ options: x.get("options"),
+ placeholder: x.get("placeholder"),
+ type: x.get("type"),
+ validator: x.get("validator")
+ });
+ });
+
+ var passwordPane = !onlyEmail && _react2.default.createElement(_password_pane2.default, {
+ i18n: i18n,
+ lock: model,
+ placeholder: passwordInputPlaceholder,
+ policy: (0, _index.passwordStrengthPolicy)(model),
+ strengthMessages: passwordStrengthMessages
+ });
+
+ return _react2.default.createElement(
+ 'div',
+ null,
+ header,
+ _react2.default.createElement(_email_pane2.default, {
+ i18n: i18n,
+ lock: model,
+ placeholder: emailInputPlaceholder
+ }),
+ usernamePane,
+ passwordPane,
+ fields
+ );
+ };
+
+ return SignUpPane;
+ }(_react2.default.Component);
+
+ exports.default = SignUpPane;
+
+/***/ },
+/* 207 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ exports.__esModule = true;
+
+ var _react = __webpack_require__(1);
+
+ var _react2 = _interopRequireDefault(_react);
+
+ var _screen = __webpack_require__(17);
+
+ var _screen2 = _interopRequireDefault(_screen);
+
+ var _index = __webpack_require__(10);
+
+ var _sign_up_terms = __webpack_require__(188);
+
+ var _sign_up_terms2 = _interopRequireDefault(_sign_up_terms);
+
+ var _actions = __webpack_require__(35);
+
+ var _login_sign_up_tabs = __webpack_require__(108);
+
+ var _login_sign_up_tabs2 = _interopRequireDefault(_login_sign_up_tabs);
+
+ var _signed_in_confirmation = __webpack_require__(30);
+
+ var _signed_up_confirmation = __webpack_require__(189);
+
+ var _sign_up_pane = __webpack_require__(206);
+
+ var _sign_up_pane2 = _interopRequireDefault(_sign_up_pane);
+
+ var _social_buttons_pane = __webpack_require__(115);
+
+ var _social_buttons_pane2 = _interopRequireDefault(_social_buttons_pane);
+
+ var _index2 = __webpack_require__(8);
+
+ var _index3 = __webpack_require__(2);
+
+ var l = _interopRequireWildcard(_index3);
+
+ var _pane_separator = __webpack_require__(111);
+
+ var _pane_separator2 = _interopRequireDefault(_pane_separator);
+
+ var _classic = __webpack_require__(55);
+
+ var _single_sign_on_notice = __webpack_require__(109);
+
+ var _single_sign_on_notice2 = _interopRequireDefault(_single_sign_on_notice);
+
+ var _actions2 = __webpack_require__(66);
+
+ var _i18n = __webpack_require__(13);
+
+ var i18n = _interopRequireWildcard(_i18n);
+
+ 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 }; }
+
+ 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 Component = function Component(_ref) {
+ var i18n = _ref.i18n,
+ model = _ref.model;
+
+ var sso = (0, _classic.isSSOEnabled)(model) && (0, _index.hasScreen)(model, "login");
+ var ssoNotice = sso && _react2.default.createElement(
+ _single_sign_on_notice2.default,
+ null,
+ i18n.str("ssoEnabled")
+ );
+
+ var tabs = !sso && (0, _index.hasScreen)(model, "login") && _react2.default.createElement(_login_sign_up_tabs2.default, {
+ key: 'loginsignup',
+ lock: model,
+ loginLabel: i18n.str("loginLabel"),
+ signUpLabel: i18n.str("signUpLabel")
+ });
+
+ var social = l.hasSomeConnections(model, "social") && _react2.default.createElement(_social_buttons_pane2.default, {
+ bigButtons: (0, _classic.useBigSocialButtons)(model),
+ instructions: i18n.html("socialSignUpInstructions"),
+ labelFn: i18n.str,
+ lock: model,
+ signUp: true
+ });
+
+ var signUpInstructionsKey = social ? "databaseAlternativeSignUpInstructions" : "databaseSignUpInstructions";
+
+ var db = (l.hasSomeConnections(model, "database") || l.hasSomeConnections(model, "enterprise")) && _react2.default.createElement(_sign_up_pane2.default, {
+ emailInputPlaceholder: i18n.str("emailInputPlaceholder"),
+ i18n: i18n,
+ instructions: i18n.html(signUpInstructionsKey),
+ model: model,
+ onlyEmail: sso,
+ passwordInputPlaceholder: i18n.str("passwordInputPlaceholder"),
+ passwordStrengthMessages: i18n.group("passwordStrength"),
+ usernameInputPlaceholder: i18n.str("usernameInputPlaceholder")
+ });
+
+ var separator = social && db && _react2.default.createElement(_pane_separator2.default, null);
+
+ return _react2.default.createElement(
+ 'div',
+ null,
+ ssoNotice,
+ tabs,
+ social,
+ separator,
+ db
+ );
+ };
+
+ var SignUp = function (_Screen) {
+ _inherits(SignUp, _Screen);
+
+ function SignUp() {
+ _classCallCheck(this, SignUp);
+
+ return _possibleConstructorReturn(this, _Screen.call(this, "main.signUp"));
+ }
+
+ SignUp.prototype.submitButtonLabel = function submitButtonLabel(m) {
+ return i18n.str(m, ["signUpSubmitLabel"]);
+ };
+
+ SignUp.prototype.submitHandler = function submitHandler(m) {
+ if ((0, _classic.hasOnlyClassicConnections)(m, "social")) return null;
+ if ((0, _classic.isSSOEnabled)(m)) return _actions2.logIn;
+ return _actions.signUp;
+ };
+
+ SignUp.prototype.isSubmitDisabled = function isSubmitDisabled(m) {
+ return !(0, _index.termsAccepted)(m);
+ };
+
+ SignUp.prototype.renderAuxiliaryPane = function renderAuxiliaryPane(lock) {
+ return (0, _signed_in_confirmation.renderSignedInConfirmation)(lock) || (0, _signed_up_confirmation.renderSignedUpConfirmation)(lock) || (0, _index2.renderOptionSelection)(lock);
+ };
+
+ SignUp.prototype.renderTabs = function renderTabs() {
+ return true;
+ };
+
+ SignUp.prototype.getScreenTitle = function getScreenTitle(m) {
+ return i18n.str(m, "signupTitle");
+ };
+
+ SignUp.prototype.renderTerms = function renderTerms(m, terms) {
+ var checkHandler = (0, _index.mustAcceptTerms)(m) ? function () {
+ return (0, _actions.toggleTermsAcceptance)(l.id(m));
+ } : undefined;
+ return terms || (0, _index.mustAcceptTerms)(m) ? _react2.default.createElement(
+ _sign_up_terms2.default,
+ { checkHandler: checkHandler, checked: (0, _index.termsAccepted)(m) },
+ terms
+ ) : null;
+ };
+
+ SignUp.prototype.render = function render() {
+ return Component;
+ };
+
+ return SignUp;
+ }(_screen2.default);
+
+ exports.default = SignUp;
+
+/***/ },
+/* 208 */
+/***/ 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 _react = __webpack_require__(1);
+
+ var _react2 = _interopRequireDefault(_react);
+
+ var _actions = __webpack_require__(114);
+
+ var _index = __webpack_require__(8);
+
+ var _text_input = __webpack_require__(120);
+
+ var _text_input2 = _interopRequireDefault(_text_input);
+
+ var _select_input = __webpack_require__(223);
+
+ var _select_input2 = _interopRequireDefault(_select_input);
+
+ var _index2 = __webpack_require__(2);
+
+ var l = _interopRequireWildcard(_index2);
+
+ 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 }; }
+
+ var CustomInput = function CustomInput(_ref) {
+ var iconUrl = _ref.iconUrl,
+ model = _ref.model,
+ name = _ref.name,
+ placeholder = _ref.placeholder,
+ type = _ref.type,
+ validator = _ref.validator;
+
+ var props = {
+ iconUrl: iconUrl,
+ isValid: !(0, _index.isFieldVisiblyInvalid)(model, name),
+ name: name,
+ placeholder: placeholder
+ };
+
+ switch (type) {
+ case "select":
+ return _react2.default.createElement(_select_input2.default, _extends({}, props, {
+ label: (0, _index.getFieldLabel)(model, name),
+ onClick: function onClick() {
+ return (0, _actions.startOptionSelection)(l.id(model), name, iconUrl);
+ }
+ }));
+ default:
+ return _react2.default.createElement(_text_input2.default, _extends({
+ invalidHint: (0, _index.getFieldInvalidHint)(model, name),
+ onChange: function onChange(e) {
+ return (0, _actions.changeField)(l.id(model), name, e.target.value, validator);
+ },
+ value: (0, _index.getFieldValue)(model, name)
+ }, props));
+ }
+ };
+
+ exports.default = CustomInput;
+
+/***/ },
+/* 209 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ exports.__esModule = true;
+
+ var _react = __webpack_require__(1);
+
+ var _react2 = _interopRequireDefault(_react);
+
+ var _mfa_code_input = __webpack_require__(221);
+
+ var _mfa_code_input2 = _interopRequireDefault(_mfa_code_input);
+
+ var _index = __webpack_require__(8);
+
+ var c = _interopRequireWildcard(_index);
+
+ var _index2 = __webpack_require__(11);
+
+ var _index3 = __webpack_require__(2);
+
+ var l = _interopRequireWildcard(_index3);
+
+ var _mfa_code = __webpack_require__(210);
+
+ 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 }; }
+
+ 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 MFACodePane = function (_React$Component) {
+ _inherits(MFACodePane, _React$Component);
+
+ function MFACodePane() {
+ _classCallCheck(this, MFACodePane);
+
+ return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
+ }
+
+ MFACodePane.prototype.handleChange = function handleChange(e) {
+ var lock = this.props.lock;
+
+ (0, _index2.swap)(_index2.updateEntity, "lock", l.id(lock), _mfa_code.setMFACode, e.target.value);
+ };
+
+ MFACodePane.prototype.render = function render() {
+ var _props = this.props,
+ i18n = _props.i18n,
+ lock = _props.lock,
+ placeholder = _props.placeholder;
+
+
+ return _react2.default.createElement(_mfa_code_input2.default, {
+ value: c.getFieldValue(lock, "mfa_code"),
+ invalidHint: i18n.str("mfaCodeErrorHint", (0, _mfa_code.getMFACodeValidation)().length),
+ isValid: !c.isFieldVisiblyInvalid(lock, "mfa_code"),
+ onChange: this.handleChange.bind(this),
+ placeholder: placeholder,
+ disabled: l.submitting(lock)
+ });
+ };
+
+ return MFACodePane;
+ }(_react2.default.Component);
+
+ exports.default = MFACodePane;
+
+
+ MFACodePane.propTypes = {
+ i18n: _react2.default.PropTypes.object.isRequired,
+ lock: _react2.default.PropTypes.object.isRequired,
+ placeholder: _react2.default.PropTypes.string.isRequired
+ };
+
+/***/ },
+/* 210 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ exports.__esModule = true;
+ exports.setMFACode = setMFACode;
+ exports.getMFACodeValidation = getMFACodeValidation;
+
+ var _index = __webpack_require__(8);
+
+ var _email = __webpack_require__(29);
+
+ var _database = __webpack_require__(10);
+
+ var _trim = __webpack_require__(33);
+
+ var _trim2 = _interopRequireDefault(_trim);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ var DEFAULT_VALIDATION = { mfa_code: { length: 6 } };
+ var regExp = /^[0-9]+$/;
+
+ function validateMFACode(str) {
+ var settings = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_VALIDATION.mfa_code;
+
+ var value = (0, _trim2.default)(str);
+
+ // check min value matched
+ if (value.length < settings.length) {
+ return false;
+ }
+
+ // check max value matched
+ if (value.length > settings.length) {
+ return false;
+ }
+
+ // check allowed characters matched
+ var result = regExp.exec(value);
+ return result && result[0];
+ }
+
+ function setMFACode(m, str) {
+ return (0, _index.setField)(m, "mfa_code", str, validateMFACode);
+ }
+
+ function getMFACodeValidation(m) {
+ return DEFAULT_VALIDATION.mfa_code;
+ }
+
+/***/ },
+/* 211 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ exports.__esModule = true;
+
+ var _react = __webpack_require__(1);
+
+ var _react2 = _interopRequireDefault(_react);
+
+ var _list = __webpack_require__(225);
+
+ var _list2 = _interopRequireDefault(_list);
+
+ var _actions = __webpack_require__(114);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ // TODO: these actions should be passed as props
+
+ exports.default = function (_ref) {
+ var icon = _ref.icon,
+ iconUrl = _ref.iconUrl,
+ model = _ref.model,
+ name = _ref.name,
+ items = _ref.items;
+ return _react2.default.createElement(_list2.default, {
+ icon: icon,
+ iconUrl: iconUrl,
+ items: items,
+ onSelect: function onSelect(x) {
+ return (0, _actions.selectOption)(model.get("id"), name, x);
+ },
+ onCancel: function onCancel() {
+ return (0, _actions.cancelOptionSelection)(model.get("id"));
+ }
+ });
+ };
+
+/***/ },
+/* 212 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ exports.__esModule = true;
+ exports.validatePassword = validatePassword;
+ exports.setPassword = setPassword;
+
+ var _passwordSheriff = __webpack_require__(127);
+
+ var _passwordSheriff2 = _interopRequireDefault(_passwordSheriff);
+
+ var _index = __webpack_require__(8);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function validatePassword(password, policy) {
+ return (0, _passwordSheriff2.default)(policy).check(password);
+ }
+
+ function setPassword(m, password, policy) {
+ return (0, _index.setField)(m, "password", password, validatePassword, policy);
+ }
+
+/***/ },
+/* 213 */
+/***/ function(module, exports) {
+
+ "use strict";
+
+ exports.__esModule = true;
+ exports.default = {
+ error: {
+ forgotPassword: {
+ "too_many_requests": "You have reached the limit on password change attempts. Please wait before trying again.",
+ "lock.fallback": "We're sorry, something went wrong when requesting the password change."
+ },
+ login: {
+ "blocked_user": "The user is blocked.",
+ "invalid_user_password": "Wrong credentials.",
+ "lock.fallback": "We're sorry, something went wrong when attempting to log in.",
+ "lock.invalid_code": "Wrong code.",
+ "lock.invalid_email_password": "Wrong email or password.",
+ "lock.invalid_username_password": "Wrong username or password.",
+ "lock.network": "We could not reach the server. Please check your connection and try again.",
+ "lock.popup_closed": "Popup window closed. Try again.",
+ "lock.unauthorized": "Permissions were not granted. Try again.",
+ "lock.mfa_registration_required": "Multifactor authentication is required but your device is not enrolled. Please enroll it before moving on.",
+ "lock.mfa_invalid_code": "Wrong code. Please try again.",
+ "password_change_required": "You need to update your password because this is the first time you are logging in, or because your password has expired.", // TODO: verify error code
+ "password_leaked": "This login has been blocked because your password has been leaked in another website. We’ve sent you an email with instructions on how to unblock it.",
+ "too_many_attempts": "Your account has been blocked after multiple consecutive login attempts.",
+ "session_missing": "Couldn't complete your authentication request. Please try again after closing all open dialogs",
+ "hrd.not_matching_email": "Please, use your corporate email to login."
+ },
+ passwordless: {
+ "bad.email": "The email is invalid",
+ "bad.phone_number": "The phone number is invalid",
+ "lock.fallback": "We're sorry, something went wrong"
+ },
+ signUp: {
+ "invalid_password": "Password is invalid.",
+ "lock.fallback": "We're sorry, something went wrong when attempting to sign up.",
+ "password_dictionary_error": "Password is too common.",
+ "password_no_user_info_error": "Password is based on user information.",
+ "password_strength_error": "Password is too weak.",
+ "user_exists": "The user already exists.",
+ "username_exists": "The username already exists."
+ }
+ },
+ success: { // success messages show above the form or in a confirmation pane
+ logIn: "Thanks for logging in.",
+ forgotPassword: "We've just sent you an email to reset your password.",
+ magicLink: "We sent you a link to log in
to %s.",
+ signUp: "Thanks for signing up."
+ },
+ blankErrorHint: "Can't be blank",
+ codeInputPlaceholder: "your code",
+ databaseEnterpriseLoginInstructions: "",
+ databaseEnterpriseAlternativeLoginInstructions: "or",
+ databaseSignUpInstructions: "",
+ databaseAlternativeSignUpInstructions: "or",
+ emailInputPlaceholder: "yours@example.com",
+ enterpriseLoginIntructions: "Login with your corporate credentials.",
+ enterpriseActiveLoginInstructions: "Please enter your corporate credentials at %s.",
+ failedLabel: "Failed!",
+ forgotPasswordTitle: "Reset your password",
+ forgotPasswordAction: "Don't remember your password?",
+ forgotPasswordInstructions: "Please enter your email address. We will send you an email to reset your password.",
+ forgotPasswordSubmitLabel: "Send email",
+ invalidErrorHint: "Invalid",
+ lastLoginInstructions: "Last time you logged in with",
+ loginAtLabel: "Log in at %s",
+ loginLabel: "Log In",
+ loginSubmitLabel: "Log In",
+ loginWithLabel: "Log in with %s",
+ notYourAccountAction: "Not your account?",
+ passwordInputPlaceholder: "your password",
+ passwordStrength: {
+ containsAtLeast: "Contain at least %d of the following %d types of characters:",
+ identicalChars: "No more than %d identical characters in a row (e.g., \"%s\" not allowed)",
+ nonEmpty: "Non-empty password required",
+ numbers: "Numbers (i.e. 0-9)",
+ lengthAtLeast: "At least %d characters in length",
+ lowerCase: "Lower case letters (a-z)",
+ shouldContain: "Should contain:",
+ specialCharacters: "Special characters (e.g. !@#$%^&*)",
+ upperCase: "Upper case letters (A-Z)"
+ },
+ passwordlessEmailAlternativeInstructions: "Otherwise, enter your email to sign in
or create an account",
+ passwordlessEmailCodeInstructions: "An email with the code has been sent to %s.",
+ passwordlessEmailInstructions: "Enter your email to sign in
or create an account",
+ passwordlessSMSAlternativeInstructions: "Otherwise, enter your phone to sign in
or create an account",
+ passwordlessSMSCodeInstructions: "An SMS with the code has been sent
to %s.",
+ passwordlessSMSInstructions: "Enter your phone to sign in
or create an account",
+ phoneNumberInputPlaceholder: "your phone number",
+ resendCodeAction: "Did not get the code?",
+ resendLabel: "Resend",
+ resendingLabel: "Resending...",
+ retryLabel: "Retry",
+ sentLabel: "Sent!",
+ signupTitle: "Sign Up",
+ signUpLabel: "Sign Up",
+ signUpSubmitLabel: "Sign Up",
+ signUpTerms: "",
+ signUpWithLabel: "Sign up with %s",
+ socialLoginInstructions: "",
+ socialSignUpInstructions: "",
+ ssoEnabled: "Single Sign-On enabled",
+ submitLabel: "Submit",
+ unrecoverableError: "Something went wrong.
Please contact technical support.",
+ usernameFormatErrorHint: "Use %d-%d letters, numbers and \"_\"",
+ usernameInputPlaceholder: "your username",
+ usernameOrEmailInputPlaceholder: "username/email",
+ title: "Auth0",
+ welcome: "Welcome %s!",
+ windowsAuthInstructions: "You are connected from your corporate network…",
+ windowsAuthLabel: "Windows Authentication",
+ mfaInputPlaceholder: "Code",
+ mfaLoginTitle: "2-Step Verification",
+ mfaLoginInstructions: "Please enter the verification code generated by your mobile application.",
+ mfaSubmitLabel: "Log In",
+ mfaCodeErrorHint: "Use %d numbers"
+ };
+
+/***/ },
+/* 214 */
+/***/ function(module, exports, __webpack_require__) {
+
+ /* WEBPACK VAR INJECTION */(function(global) {'use strict';
+
+ exports.__esModule = true;
+ exports.remove = exports.render = undefined;
+
+ var _react = __webpack_require__(1);
+
+ var _react2 = _interopRequireDefault(_react);
+
+ var _reactDom = __webpack_require__(46);
+
+ var _reactDom2 = _interopRequireDefault(_reactDom);
+
+ var _CSSCore = __webpack_require__(124);
+
+ var _CSSCore2 = _interopRequireDefault(_CSSCore);
+
+ var _container = __webpack_require__(118);
+
+ var _container2 = _interopRequireDefault(_container);
+
+ 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 ContainerManager = function () {
+ function ContainerManager() {
+ _classCallCheck(this, ContainerManager);
+ }
+
+ ContainerManager.prototype.ensure = function ensure(id, shouldAppend) {
+ var container = global.document.getElementById(id);
+
+ if (!container && shouldAppend) {
+ container = global.document.createElement('div');
+ container.id = id;
+ container.className = "auth0-lock-container";
+ global.document.body.appendChild(container);
+ }
+
+ if (!container) {
+ throw new Error('Can\'t find element with id ' + id);
+ }
+
+ return container;
+ };
+
+ return ContainerManager;
+ }();
+
+ var Renderer = function () {
+ function Renderer() {
+ _classCallCheck(this, Renderer);
+
+ this.containerManager = new ContainerManager();
+ this.modals = {};
+ }
+
+ Renderer.prototype.render = function render(containerId, props) {
+ var isModal = props.isModal;
+
+ var container = this.containerManager.ensure(containerId, isModal);
+
+ if (isModal && !this.modals[containerId]) {
+ _CSSCore2.default.addClass(global.document.getElementsByTagName("html")[0], "auth0-lock-html");
+ }
+
+ var component = _reactDom2.default.render(_react2.default.createElement(_container2.default, props), container);
+
+ if (isModal) {
+ this.modals[containerId] = component;
+ }
+
+ return component;
+ };
+
+ Renderer.prototype.remove = function remove(containerId) {
+ var _this = this;
+
+ if (this.modals[containerId]) {
+ this.modals[containerId].hide();
+ setTimeout(function () {
+ return _this.unmount(containerId);
+ }, 1000);
+ } else {
+ this.unmount(containerId);
+ }
+ };
+
+ Renderer.prototype.unmount = function unmount(containerId) {
+ try {
+ var container = this.containerManager.ensure(containerId);
+ if (container) {
+ _reactDom2.default.unmountComponentAtNode(container);
+ }
+ } catch (e) {
+ // do nothing if container doesn't exist
+ }
+
+ if (this.modals[containerId]) {
+ delete this.modals[containerId];
+
+ _CSSCore2.default.removeClass(global.document.getElementsByTagName("html")[0], "auth0-lock-html");
+ }
+ };
+
+ return Renderer;
+ }();
+
+ var renderer = new Renderer();
+
+ var render = exports.render = function render() {
+ return renderer.render.apply(renderer, arguments);
+ };
+ var remove = exports.remove = function remove() {
+ return renderer.remove.apply(renderer, arguments);
+ };
+ /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
+
+/***/ },
+/* 215 */
+/***/ function(module, exports, __webpack_require__) {
+
+ /* WEBPACK VAR INJECTION */(function(global) {'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 _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 _react = __webpack_require__(1);
+
+ var _react2 = _interopRequireDefault(_react);
+
+ var _reactDom = __webpack_require__(46);
+
+ var _reactDom2 = _interopRequireDefault(_reactDom);
+
+ var _reactAddonsCssTransitionGroup = __webpack_require__(252);
+
+ var _reactAddonsCssTransitionGroup2 = _interopRequireDefault(_reactAddonsCssTransitionGroup);
+
+ var _multisize_slide = __webpack_require__(219);
+
+ var _multisize_slide2 = _interopRequireDefault(_multisize_slide);
+
+ var _global_message = __webpack_require__(217);
+
+ var _global_message2 = _interopRequireDefault(_global_message);
+
+ var _header = __webpack_require__(218);
+
+ var _header2 = _interopRequireDefault(_header);
+
+ 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 submitSvg = '
';
+ var submitText = '
';
+
+ var SubmitButton = function (_React$Component) {
+ _inherits(SubmitButton, _React$Component);
+
+ function SubmitButton() {
+ _classCallCheck(this, SubmitButton);
+
+ return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
+ }
+
+ SubmitButton.prototype.focus = function focus() {
+ _reactDom2.default.findDOMNode(this).focus();
+ };
+
+ SubmitButton.prototype.render = function render() {
+ var _props = this.props,
+ color = _props.color,
+ disabled = _props.disabled,
+ label = _props.label;
+
+ var content = label ? _react2.default.createElement(
+ 'span',
+ { className: 'auth0-label-submit' },
+ label,
+ _react2.default.createElement('span', { dangerouslySetInnerHTML: { __html: submitText } })
+ ) : _react2.default.createElement('span', { dangerouslySetInnerHTML: { __html: submitSvg } });
+
+ return _react2.default.createElement(
+ 'button',
+ {
+ className: 'auth0-lock-submit',
+ disabled: disabled,
+ style: { backgroundColor: color },
+ type: 'submit'
+ },
+ _react2.default.createElement(
+ 'div',
+ { className: 'auth0-loading-container' },
+ _react2.default.createElement('div', { className: 'auth0-loading' })
+ ),
+ content
+ );
+ };
+
+ return SubmitButton;
+ }(_react2.default.Component);
+
+ SubmitButton.propTypes = {
+ color: _react2.default.PropTypes.string.isRequired,
+ disabled: _react2.default.PropTypes.bool,
+ label: _react2.default.PropTypes.string
+ };
+
+ var MESSAGE_ANIMATION_DURATION = 250;
+ var AUXILIARY_ANIMATION_DURATION = 350;
+
+ var Chrome = function (_React$Component2) {
+ _inherits(Chrome, _React$Component2);
+
+ function Chrome(props) {
+ _classCallCheck(this, Chrome);
+
+ var _this2 = _possibleConstructorReturn(this, _React$Component2.call(this, props));
+
+ _this2.state = { moving: false, reverse: false };
+ return _this2;
+ }
+
+ Chrome.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
+ var _this3 = this;
+
+ var _props2 = this.props,
+ auxiliaryPane = _props2.auxiliaryPane,
+ showSubmitButton = _props2.showSubmitButton;
+ var delayingShowSubmitButton = this.state.delayingShowSubmitButton;
+
+
+ if (!showSubmitButton && nextProps.showSubmitButton && !delayingShowSubmitButton) {
+ this.setState({ delayingShowSubmitButton: true });
+ }
+
+ if (!auxiliaryPane && nextProps.auxiliaryPane) {
+ this.auxiliaryPaneTriggerInput = global.document.activeElement;
+ this.setState({ moving: true });
+ }
+
+ if (auxiliaryPane && !nextProps.auxiliaryPane) {
+ // TODO clear timeout
+ setTimeout(function () {
+ return _this3.setState({ moving: false });
+ }, AUXILIARY_ANIMATION_DURATION + 50);
+ }
+ };
+
+ Chrome.prototype.componentDidUpdate = function componentDidUpdate(prevProps) {
+ var _this4 = this;
+
+ var _props3 = this.props,
+ autofocus = _props3.autofocus,
+ auxiliaryPane = _props3.auxiliaryPane,
+ error = _props3.error,
+ screenName = _props3.screenName;
+
+
+ if (!autofocus) return;
+
+ if (auxiliaryPane && !prevProps.auxiliaryPane) {
+ var _ret = function () {
+ var input = _this4.findAutofocusInput(_this4.refs.auxiliary);
+
+ if (input) {
+ // TODO clear timeout
+ setTimeout(function () {
+ return input.focus();
+ }, AUXILIARY_ANIMATION_DURATION);
+ }
+
+ return {
+ v: void 0
+ };
+ }();
+
+ if ((typeof _ret === 'undefined' ? 'undefined' : _typeof(_ret)) === "object") return _ret.v;
+ }
+
+ if (!auxiliaryPane && prevProps.auxiliaryPane) {
+ if (this.auxiliaryPaneTriggerInput) {
+ // TODO clear timeout
+ setTimeout(function () {
+ return _this4.auxiliaryPaneTriggerInput.focus();
+ }, AUXILIARY_ANIMATION_DURATION);
+ }
+
+ return;
+ }
+
+ if (screenName !== prevProps.screenName) {
+ var _ret2 = function () {
+ var input = _this4.findAutofocusInput();
+
+ if (input) {
+ if (_this4.mainScreenName(prevProps.screenName) !== _this4.mainScreenName()) {
+ _this4.inputToFocus = input;
+ } else {
+ // TODO clear timeout
+ setTimeout(function () {
+ return input.focus();
+ }, 17);
+ }
+ }
+
+ return {
+ v: void 0
+ };
+ }();
+
+ if ((typeof _ret2 === 'undefined' ? 'undefined' : _typeof(_ret2)) === "object") return _ret2.v;
+ }
+
+ if (!prevProps.error && error) {
+ var _ret3 = function () {
+ var input = _this4.findAutofocusInput();
+
+ if (input) {
+ // TODO clear timeout
+ setTimeout(function () {
+ return input.focus();
+ }, 17);
+ }
+
+ return {
+ v: void 0
+ };
+ }();
+
+ if ((typeof _ret3 === 'undefined' ? 'undefined' : _typeof(_ret3)) === "object") return _ret3.v;
+ }
+ };
+
+ Chrome.prototype.onWillSlide = function onWillSlide() {
+ this.setState({ moving: true });
+ this.sliding = true;
+ };
+
+ Chrome.prototype.onDidSlide = function onDidSlide() {
+ this.sliding = false;
+ this.setState({ reverse: false });
+ };
+
+ Chrome.prototype.onDidAppear = function onDidAppear() {
+ this.setState({ moving: false });
+ if (this.state.delayingShowSubmitButton) {
+ this.setState({ delayingShowSubmitButton: false });
+ }
+
+ if (this.inputToFocus) {
+ this.inputToFocus.focus();
+ delete this.inputToFocus;
+ }
+ };
+
+ Chrome.prototype.mainScreenName = function mainScreenName(str) {
+ return (str || this.props.screenName || "").split(".")[0];
+ };
+
+ Chrome.prototype.findAutofocusInput = function findAutofocusInput(ref) {
+ return _reactDom2.default.findDOMNode(ref || this.refs.screen).querySelector("input");
+ };
+
+ Chrome.prototype.focusError = function focusError() {
+ var node = _reactDom2.default.findDOMNode(this.refs.screen);
+ // TODO: make the error input selector configurable via props.
+ var error = node.querySelector(".auth0-lock-error input");
+
+ if (error) {
+ error.focus();
+ }
+ };
+
+ Chrome.prototype.render = function render() {
+ var _props4 = this.props,
+ avatar = _props4.avatar,
+ auxiliaryPane = _props4.auxiliaryPane,
+ backHandler = _props4.backHandler,
+ contentComponent = _props4.contentComponent,
+ contentProps = _props4.contentProps,
+ disableSubmitButton = _props4.disableSubmitButton,
+ error = _props4.error,
+ isSubmitting = _props4.isSubmitting,
+ logo = _props4.logo,
+ primaryColor = _props4.primaryColor,
+ screenName = _props4.screenName,
+ showSubmitButton = _props4.showSubmitButton,
+ submitButtonLabel = _props4.submitButtonLabel,
+ success = _props4.success,
+ terms = _props4.terms,
+ title = _props4.title,
+ transitionName = _props4.transitionName;
+ var _state = this.state,
+ delayingShowSubmitButton = _state.delayingShowSubmitButton,
+ moving = _state.moving,
+ reverse = _state.reverse;
+
+
+ var backgroundUrl = void 0,
+ name = void 0;
+ if (avatar) {
+ backgroundUrl = avatar;
+ name = title;
+ } else {
+ backgroundUrl = logo;
+ name = "";
+ }
+
+ var submitButton = showSubmitButton && !delayingShowSubmitButton && _react2.default.createElement(SubmitButton, {
+ color: primaryColor,
+ disabled: disableSubmitButton,
+ key: 'submit',
+ label: submitButtonLabel,
+ ref: 'submit'
+ });
+
+ var globalError = error ? _react2.default.createElement(_global_message2.default, { key: 'global-error', message: error, type: 'error' }) : null;
+ var globalSuccess = success ? _react2.default.createElement(_global_message2.default, { key: 'global-success', message: success, type: 'success' }) : null;
+
+ var Content = contentComponent;
+
+ var className = "auth0-lock-cred-pane";
+ var isQuiet = !moving && !delayingShowSubmitButton;
+ className += isQuiet ? " auth0-lock-quiet" : " auth0-lock-moving";
+
+ return _react2.default.createElement(
+ 'div',
+ { className: className },
+ _react2.default.createElement(_header2.default, { title: title, name: name, backHandler: backHandler && this.handleBack.bind(this), backgroundUrl: backgroundUrl, backgroundColor: primaryColor, logoUrl: logo }),
+ _react2.default.createElement(
+ _reactAddonsCssTransitionGroup2.default,
+ {
+ transitionName: 'global-message',
+ transitionEnterTimeout: MESSAGE_ANIMATION_DURATION,
+ transitionLeaveTimeout: MESSAGE_ANIMATION_DURATION
+ },
+ globalSuccess,
+ globalError
+ ),
+ _react2.default.createElement(
+ 'div',
+ { style: { position: "relative" } },
+ _react2.default.createElement(
+ _multisize_slide2.default,
+ {
+ delay: 550,
+ onDidAppear: this.onDidAppear.bind(this),
+ onDidSlide: this.onDidSlide.bind(this),
+ onWillSlide: this.onWillSlide.bind(this),
+ transitionName: transitionName,
+ reverse: reverse
+ },
+ _react2.default.createElement(
+ 'div',
+ { key: this.mainScreenName(), className: 'auth0-lock-view-content' },
+ _react2.default.createElement(
+ 'div',
+ { style: { position: "relative" } },
+ _react2.default.createElement(
+ 'div',
+ { className: 'auth0-lock-body-content' },
+ _react2.default.createElement(
+ 'div',
+ { className: 'auth0-lock-content' },
+ _react2.default.createElement(
+ 'div',
+ { className: 'auth0-lock-form', ref: 'screen' },
+ _react2.default.createElement(Content, _extends({ focusSubmit: this.focusSubmit.bind(this) }, contentProps))
+ )
+ ),
+ terms && _react2.default.createElement(
+ 'small',
+ { className: 'auth0-lock-terms' },
+ terms
+ )
+ )
+ )
+ )
+ )
+ ),
+ submitButton,
+ _react2.default.createElement(
+ _reactAddonsCssTransitionGroup2.default,
+ {
+ ref: 'auxiliary',
+ transitionName: 'slide',
+ transitionEnterTimeout: AUXILIARY_ANIMATION_DURATION,
+ transitionLeaveTimeout: AUXILIARY_ANIMATION_DURATION
+ },
+ auxiliaryPane
+ )
+ );
+ };
+
+ Chrome.prototype.focusSubmit = function focusSubmit() {
+ this.refs.submit.focus();
+ };
+
+ Chrome.prototype.handleBack = function handleBack() {
+ if (this.sliding) return;
+
+ var backHandler = this.props.backHandler;
+
+ this.setState({ reverse: true });
+ backHandler();
+ };
+
+ return Chrome;
+ }(_react2.default.Component);
+
+ exports.default = Chrome;
+
+
+ Chrome.propTypes = {
+ autofocus: _react2.default.PropTypes.bool.isRequired,
+ avatar: _react2.default.PropTypes.string,
+ auxiliaryPane: _react2.default.PropTypes.element,
+ backHandler: _react2.default.PropTypes.func,
+ contentComponent: _react2.default.PropTypes.func.isRequired, // TODO: it also can be a class component
+ contentProps: _react2.default.PropTypes.object.isRequired,
+ disableSubmitButton: _react2.default.PropTypes.bool.isRequired,
+ error: _react2.default.PropTypes.string,
+ isSubmitting: _react2.default.PropTypes.bool.isRequired,
+ logo: _react2.default.PropTypes.string.isRequired,
+ primaryColor: _react2.default.PropTypes.string.isRequired,
+ showSubmitButton: _react2.default.PropTypes.bool.isRequired,
+ submitButtonLabel: _react2.default.PropTypes.string,
+ success: _react2.default.PropTypes.string,
+ terms: _react2.default.PropTypes.element,
+ title: _react2.default.PropTypes.string,
+ transitionName: _react2.default.PropTypes.string.isRequired
+ };
+
+ Chrome.defaultProps = {
+ autofocus: false,
+ disableSubmitButton: false,
+ showSubmitButton: true
+ };
+ /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
+
+/***/ },
+/* 216 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ exports.__esModule = true;
+
+ var _react = __webpack_require__(1);
+
+ var _react2 = _interopRequireDefault(_react);
+
+ var _button = __webpack_require__(57);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ var ConfirmationPane = function ConfirmationPane(_ref) {
+ var backHandler = _ref.backHandler,
+ children = _ref.children,
+ closeHandler = _ref.closeHandler,
+ svg = _ref.svg;
+ return _react2.default.createElement(
+ 'div',
+ { className: 'auth0-lock-confirmation' },
+ closeHandler && _react2.default.createElement(_button.CloseButton, { onClick: closeHandler }),
+ backHandler && _react2.default.createElement(_button.BackButton, { onClick: backHandler }),
+ _react2.default.createElement(
+ 'div',
+ { className: 'auth0-lock-confirmation-content' },
+ _react2.default.createElement('span', { dangerouslySetInnerHTML: { __html: svg } }),
+ children
+ )
+ );
+ };
+
+ ConfirmationPane.propTypes = {
+ backHandler: _react2.default.PropTypes.func,
+ closeHandler: _react2.default.PropTypes.func,
+ children: _react2.default.PropTypes.oneOfType([_react2.default.PropTypes.element.isRequired, _react2.default.PropTypes.arrayOf(_react2.default.PropTypes.element).isRequired]),
+ svg: _react2.default.PropTypes.string.isRequired
+ };
+
+ exports.default = ConfirmationPane;
+
+/***/ },
+/* 217 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ exports.__esModule = true;
+
+ var _react = __webpack_require__(1);
+
+ var _react2 = _interopRequireDefault(_react);
+
+ var _reactDom = __webpack_require__(46);
+
+ var _reactDom2 = _interopRequireDefault(_reactDom);
+
+ 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 GlobalMessage = function (_React$Component) {
+ _inherits(GlobalMessage, _React$Component);
+
+ function GlobalMessage() {
+ _classCallCheck(this, GlobalMessage);
+
+ return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
+ }
+
+ GlobalMessage.prototype.render = function render() {
+ var _props = this.props,
+ message = _props.message,
+ type = _props.type;
+
+ var className = 'auth0-global-message auth0-global-message-' + type;
+
+ return _react2.default.createElement(
+ 'div',
+ { className: className },
+ _react2.default.createElement(
+ 'span',
+ { className: 'animated fadeInUp' },
+ message
+ )
+ );
+ };
+
+ return GlobalMessage;
+ }(_react2.default.Component);
+
+ exports.default = GlobalMessage;
+
+
+ GlobalMessage.propTypes = {
+ message: _react2.default.PropTypes.string.isRequired,
+ type: _react2.default.PropTypes.oneOf(['error', 'success']).isRequired
+ };
+
+/***/ },
+/* 218 */
+/***/ function(module, exports, __webpack_require__) {
+
+ /* WEBPACK VAR INJECTION */(function(global) {'use strict';
+
+ exports.__esModule = true;
+
+ var _react = __webpack_require__(1);
+
+ var _react2 = _interopRequireDefault(_react);
+
+ var _button = __webpack_require__(57);
+
+ 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; }
+
+ // TODO: simplify this mess :)
+
+ var Header = function (_React$Component) {
+ _inherits(Header, _React$Component);
+
+ function Header() {
+ _classCallCheck(this, Header);
+
+ return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
+ }
+
+ Header.prototype.render = function render() {
+ var _props = this.props,
+ backHandler = _props.backHandler,
+ backgroundColor = _props.backgroundColor,
+ backgroundUrl = _props.backgroundUrl,
+ logoUrl = _props.logoUrl,
+ name = _props.name,
+ title = _props.title;
+
+
+ return _react2.default.createElement(
+ 'div',
+ { className: 'auth0-lock-header' },
+ backHandler && _react2.default.createElement(_button.BackButton, { onClick: backHandler }),
+ _react2.default.createElement(Background, { imageUrl: backgroundUrl, backgroundColor: backgroundColor, grayScale: !!name }),
+ _react2.default.createElement(Welcome, { title: title, name: name, imageUrl: name ? undefined : logoUrl })
+ );
+ };
+
+ return Header;
+ }(_react2.default.Component);
+
+ exports.default = Header;
+
+
+ Header.propTypes = {
+ backgroundUrl: _react2.default.PropTypes.string,
+ logoUrl: _react2.default.PropTypes.string,
+ name: _react2.default.PropTypes.string
+ };
+
+ var Welcome = function (_React$Component2) {
+ _inherits(Welcome, _React$Component2);
+
+ function Welcome() {
+ _classCallCheck(this, Welcome);
+
+ return _possibleConstructorReturn(this, _React$Component2.apply(this, arguments));
+ }
+
+ Welcome.prototype.render = function render() {
+ var _props2 = this.props,
+ name = _props2.name,
+ imageUrl = _props2.imageUrl,
+ title = _props2.title;
+
+ var imgClassName = !!title ? 'auth0-lock-header-logo' : 'auth0-lock-header-logo centered';
+ var img = _react2.default.createElement('img', { className: imgClassName, src: imageUrl });
+ var welcome = title ? _react2.default.createElement(WelcomeMessage, { title: title, name: name }) : null;
+
+ return _react2.default.createElement(
+ 'div',
+ { className: 'auth0-lock-header-welcome' },
+ imageUrl && img,
+ welcome
+ );
+ };
+
+ return Welcome;
+ }(_react2.default.Component);
+
+ Welcome.propTypes = {
+ imageUrl: _react2.default.PropTypes.string,
+ name: _react2.default.PropTypes.string
+ };
+
+ var WelcomeMessage = function (_React$Component3) {
+ _inherits(WelcomeMessage, _React$Component3);
+
+ function WelcomeMessage() {
+ _classCallCheck(this, WelcomeMessage);
+
+ return _possibleConstructorReturn(this, _React$Component3.apply(this, arguments));
+ }
+
+ WelcomeMessage.prototype.render = function render() {
+ var _props3 = this.props,
+ name = _props3.name,
+ title = _props3.title;
+
+ var className = void 0,
+ message = void 0;
+
+ if (name) {
+ className = "auth0-lock-firstname";
+ message = name;
+ } else {
+ className = "auth0-lock-name";
+ message = title;
+ }
+
+ return _react2.default.createElement(
+ 'div',
+ { className: className },
+ message
+ );
+ };
+
+ return WelcomeMessage;
+ }(_react2.default.Component);
+
+ WelcomeMessage.propTypes = {
+ name: _react2.default.PropTypes.string
+ };
+
+ var cssBlurSupport = function () {
+ // Check stolen from Modernizr, see https://github.com/Modernizr/Modernizr/blob/29eab707f7a2fb261c8a9c538370e97eb1f86e25/feature-detects/css/filters.js
+ var isEdge = global.navigator && !!global.navigator.userAgent.match(/Edge/i);
+ if (typeof global.document === 'undefined' || isEdge) return false;
+
+ var el = global.document.createElement('div');
+ el.style.cssText = "filter: blur(2px); -webkit-filter: blur(2px)";
+ return !!el.style.length && (global.document.documentMode === undefined || global.document.documentMode > 9);
+ }();
+
+ var Background = function (_React$Component4) {
+ _inherits(Background, _React$Component4);
+
+ function Background() {
+ _classCallCheck(this, Background);
+
+ return _possibleConstructorReturn(this, _React$Component4.apply(this, arguments));
+ }
+
+ Background.prototype.render = function render() {
+ var _props4 = this.props,
+ backgroundColor = _props4.backgroundColor,
+ imageUrl = _props4.imageUrl,
+ grayScale = _props4.grayScale;
+
+
+ var props = {
+ className: "auth0-lock-header-bg"
+ };
+
+ if (cssBlurSupport) {
+ props.className += " auth0-lock-blur-support";
+ }
+
+ var blurProps = {
+ className: 'auth0-lock-header-bg-blur',
+ style: { backgroundImage: 'url(\'' + imageUrl + '\')' }
+ };
+
+ if (grayScale) {
+ blurProps.className += ' auth0-lock-no-grayscale';
+ }
+
+ var solidProps = {
+ className: "auth0-lock-header-bg-solid",
+ style: { backgroundColor: backgroundColor }
+ };
+
+ return _react2.default.createElement(
+ 'div',
+ props,
+ _react2.default.createElement('div', blurProps),
+ _react2.default.createElement('div', solidProps)
+ );
+ };
+
+ return Background;
+ }(_react2.default.Component);
+
+ Background.propTypes = {
+ backgorundColor: _react2.default.PropTypes.string,
+ grayScale: _react2.default.PropTypes.bool,
+ imageUrl: _react2.default.PropTypes.string
+ };
+ /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
+
+/***/ },
+/* 219 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ exports.__esModule = true;
+
+ var _react = __webpack_require__(1);
+
+ var _react2 = _interopRequireDefault(_react);
+
+ var _reactDom = __webpack_require__(46);
+
+ var _reactDom2 = _interopRequireDefault(_reactDom);
+
+ var _CSSCore = __webpack_require__(124);
+
+ var _CSSCore2 = _interopRequireDefault(_CSSCore);
+
+ 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 Slider = function (_React$Component) {
+ _inherits(Slider, _React$Component);
+
+ function Slider(props) {
+ _classCallCheck(this, Slider);
+
+ var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));
+
+ _this.state = { children: { current: props.children } };
+ return _this;
+ }
+
+ Slider.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
+ // TODO: take a prop to identify what are we rendering instead of
+ // infering it from children keys so we can accept more than one
+ // child (we are already wrapping them).
+ if (this.state.children.current.key != nextProps.children.key) {
+ this.setState({
+ children: {
+ current: nextProps.children,
+ prev: this.state.children.current
+ },
+ transitionName: this.props.transitionName
+ });
+ this.animate = true;
+ } else if (!this.timeout) {
+ this.setState({ children: { current: nextProps.children }, transitionName: nextProps.transitionName });
+ }
+ };
+
+ Slider.prototype.componentDidUpdate = function componentDidUpdate() {
+ var _this2 = this;
+
+ if (this.animate) {
+ (function () {
+ _this2.animate = false;
+
+ var transitionName = _this2.state.transitionName;
+ var _state$children = _this2.state.children,
+ current = _state$children.current,
+ prev = _state$children.prev;
+ var reverse = _this2.props.reverse;
+
+ var currentComponent = _this2.refs[current.key];
+ var prevComponent = _this2.refs[prev.key];
+
+ var transition = function transition(component, className, delay) {
+ var node = _reactDom2.default.findDOMNode(component);
+ var activeClassName = className + '-active';
+
+ _CSSCore2.default.addClass(node, className);
+
+ setTimeout(function () {
+ return _CSSCore2.default.addClass(node, activeClassName);
+ }, 17);
+
+ if (delay) {
+ setTimeout(function () {
+ _CSSCore2.default.removeClass(node, className);
+ _CSSCore2.default.removeClass(node, activeClassName);
+ }, delay);
+ }
+ };
+
+ var callback = function callback(slide) {
+ currentComponent.componentWillSlideIn(slide);
+ var classNamePrefix = reverse ? "reverse-" : "";
+ transition(currentComponent, '' + classNamePrefix + transitionName + '-enter', _this2.props.delay);
+ transition(prevComponent, '' + classNamePrefix + transitionName + '-leave');
+
+ _this2.timeout = setTimeout(function () {
+ var _context;
+
+ _this2.setState({ children: { current: _this2.state.children.current }, transitionName: _this2.props.transitionName });
+ currentComponent.componentDidSlideIn((_context = _this2.props).onDidAppear.bind(_context));
+ _this2.props.onDidSlide();
+ _this2.timeout = null;
+ }, _this2.props.delay);
+ };
+
+ _this2.props.onWillSlide();
+ prevComponent.componentWillSlideOut(callback);
+ })();
+ }
+ };
+
+ Slider.prototype.componentWillUnmount = function componentWillUnmount() {
+ if (this.timeout) clearTimeout(this.timeout);
+ };
+
+ Slider.prototype.render = function render() {
+ var _state$children2 = this.state.children,
+ current = _state$children2.current,
+ prev = _state$children2.prev;
+
+ var children = prev ? [current, prev] : [current];
+ var childrenToRender = children.map(function (child) {
+ return _react2.default.cloneElement(_react2.default.createElement(Child, {}, child), { ref: child.key, key: child.key });
+ });
+
+ return _react2.default.createElement(this.props.component, {}, childrenToRender);
+ };
+
+ return Slider;
+ }(_react2.default.Component);
+
+ exports.default = Slider;
+
+
+ Slider.propTypes = {
+ component: _react2.default.PropTypes.string,
+ delay: _react2.default.PropTypes.number.isRequired,
+ onDidAppear: _react2.default.PropTypes.func.isRequired,
+ onDidSlide: _react2.default.PropTypes.func.isRequired,
+ onWillSlide: _react2.default.PropTypes.func.isRequired,
+ reverse: _react2.default.PropTypes.bool.isRequired,
+ transitionName: _react2.default.PropTypes.string.isRequired
+ };
+
+ Slider.defaultProps = {
+ component: "span",
+ onDidAppear: function onDidAppear() {},
+ onDidSlide: function onDidSlide() {},
+ onWillSlide: function onWillSlide() {},
+ reverse: false
+ };
+
+ var Child = function (_React$Component2) {
+ _inherits(Child, _React$Component2);
+
+ function Child(props) {
+ _classCallCheck(this, Child);
+
+ var _this3 = _possibleConstructorReturn(this, _React$Component2.call(this, props));
+
+ _this3.state = { height: "", originalHeight: "", show: true };
+ return _this3;
+ }
+
+ Child.prototype.componentWillSlideIn = function componentWillSlideIn(slide) {
+ var node = _reactDom2.default.findDOMNode(this);
+
+ this.setState({
+ height: slide.height,
+ originalHeight: parseInt(window.getComputedStyle(node, null).height, 10),
+ show: false
+ });
+ };
+
+ Child.prototype.componentDidSlideIn = function componentDidSlideIn(cb) {
+ var _this4 = this;
+
+ var _state = this.state,
+ height = _state.height,
+ originalHeight = _state.originalHeight;
+
+
+ if (height === originalHeight) {
+ this.setState({ show: true, height: "" });
+ cb();
+ } else {
+ (function () {
+ _this4.cb = cb;
+ var frames = 10;
+ var count = 0;
+ var current = height;
+ var last = originalHeight;
+ var step = Math.abs(current - last) / frames;
+ var dir = current < last ? 1 : -1;
+ var dh = step * dir;
+
+ // TODO: rAF
+ _this4.t = setInterval(function () {
+ if (count < frames - 1) {
+ _this4.setState({ height: current, animating: true });
+ current += dh;
+ count++;
+ } else {
+ clearInterval(_this4.t);
+ delete _this4.t;
+ _this4.setState({ height: "", show: true });
+ _this4.cb();
+ }
+ }, 17);
+ })();
+ }
+ };
+
+ Child.prototype.componentWillSlideOut = function componentWillSlideOut(cb) {
+ var node = _reactDom2.default.findDOMNode(this);
+ var size = window.getComputedStyle(node, null).height;
+ cb({ height: parseInt(size, 10), reverse: this.reverse });
+ };
+
+ Child.prototype.componentWillUnmount = function componentWillUnmount() {
+ if (this.t) {
+ clearInterval(this.t);
+ cb();
+ }
+ };
+
+ Child.prototype.render = function render() {
+ var children = this.props.children;
+ var _state2 = this.state,
+ height = _state2.height,
+ show = _state2.show;
+
+
+ return _react2.default.createElement(
+ 'div',
+ { style: height ? { height: height + "px" } : {} },
+ _react2.default.createElement(
+ 'div',
+ { style: { visibility: show ? "inherit" : "hidden" } },
+ children
+ )
+ );
+ };
+
+ return Child;
+ }(_react2.default.Component);
+
+/***/ },
+/* 220 */
+/***/ 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 _react = __webpack_require__(1);
+
+ var _react2 = _interopRequireDefault(_react);
+
+ var _input_wrap = __webpack_require__(37);
+
+ var _input_wrap2 = _interopRequireDefault(_input_wrap);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+ var svg = '
';
+
+ var EmailInput = function (_React$Component) {
+ _inherits(EmailInput, _React$Component);
+
+ function EmailInput(props) {
+ _classCallCheck(this, EmailInput);
+
+ var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));
+
+ _this.state = {};
+ return _this;
+ }
+
+ EmailInput.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps, nextState) {
+ var _props = this.props,
+ invalidHint = _props.invalidHint,
+ isValid = _props.isValid,
+ value = _props.value,
+ onChange = _props.onChange;
+ var focused = this.state.focused;
+
+
+ return invalidHint != nextProps.invalidHint || isValid != nextProps.isValid || value != nextProps.value || focused != nextState.focused;
+ };
+
+ EmailInput.prototype.render = function render() {
+ var _props2 = this.props,
+ invalidHint = _props2.invalidHint,
+ isValid = _props2.isValid,
+ onChange = _props2.onChange,
+ props = _objectWithoutProperties(_props2, ['invalidHint', 'isValid', 'onChange']);
+
+ var focused = this.state.focused;
+
+
+ return _react2.default.createElement(
+ _input_wrap2.default,
+ {
+ focused: focused,
+ invalidHint: invalidHint,
+ isValid: isValid,
+ name: 'email',
+ icon: svg
+ },
+ _react2.default.createElement('input', _extends({ ref: 'input',
+ type: 'email',
+ name: 'email',
+ className: 'auth0-lock-input',
+ placeholder: 'yours@example.com',
+ autoComplete: 'off',
+ autoCapitalize: 'off',
+ onChange: this.handleOnChange.bind(this),
+ onFocus: this.handleFocus.bind(this),
+ onBlur: this.handleBlur.bind(this)
+ }, props))
+ );
+ };
+
+ EmailInput.prototype.handleOnChange = function handleOnChange(e) {
+ if (this.props.onChange) {
+ this.props.onChange(e);
+ }
+ };
+
+ EmailInput.prototype.handleFocus = function handleFocus() {
+ this.setState({ focused: true });
+ };
+
+ EmailInput.prototype.handleBlur = function handleBlur() {
+ this.setState({ focused: false });
+ };
+
+ return EmailInput;
+ }(_react2.default.Component);
+
+ // TODO: specify propTypes
+
+
+ exports.default = EmailInput;
+
+/***/ },
+/* 221 */
+/***/ 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 _react = __webpack_require__(1);
+
+ var _react2 = _interopRequireDefault(_react);
+
+ var _input_wrap = __webpack_require__(37);
+
+ var _input_wrap2 = _interopRequireDefault(_input_wrap);
+
+ var _password_input = __webpack_require__(73);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+ var MFACodeInput = function (_React$Component) {
+ _inherits(MFACodeInput, _React$Component);
+
+ function MFACodeInput(props) {
+ _classCallCheck(this, MFACodeInput);
+
+ var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));
+
+ _this.state = {};
+ return _this;
+ }
+
+ MFACodeInput.prototype.focus = function focus() {
+ this.refs.input && this.refs.input.focus();
+ };
+
+ MFACodeInput.prototype.hasFocus = function hasFocus() {
+ return this.state.focused;
+ };
+
+ MFACodeInput.prototype.render = function render() {
+ var _props = this.props,
+ invalidHint = _props.invalidHint,
+ isValid = _props.isValid,
+ onChange = _props.onChange,
+ value = _props.value,
+ props = _objectWithoutProperties(_props, ['invalidHint', 'isValid', 'onChange', 'value']);
+
+ var focused = this.state.focused;
+
+
+ return _react2.default.createElement(
+ _input_wrap2.default,
+ {
+ focused: focused,
+ invalidHint: invalidHint,
+ isValid: isValid,
+ name: 'mfa_code',
+ icon: _password_input.icon
+ },
+ _react2.default.createElement('input', _extends({
+ ref: 'input',
+ type: 'text',
+ name: 'mfa_code',
+ className: 'auth0-lock-input',
+ autoComplete: 'off',
+ autoCapitalize: 'off',
+ onChange: this.handleOnChange.bind(this),
+ onFocus: this.handleFocus.bind(this),
+ onBlur: this.handleBlur.bind(this),
+ value: value
+ }, props))
+ );
+ };
+
+ MFACodeInput.prototype.handleOnChange = function handleOnChange(e) {
+ if (this.props.onChange) {
+ this.props.onChange(e);
+ }
+ };
+
+ MFACodeInput.prototype.handleFocus = function handleFocus() {
+ this.setState({ focused: true });
+ };
+
+ MFACodeInput.prototype.handleBlur = function handleBlur() {
+ this.setState({ focused: false });
+ };
+
+ return MFACodeInput;
+ }(_react2.default.Component);
+
+ MFACodeInput.propTypes = {
+ invalidHint: _react2.default.PropTypes.string.isRequired,
+ isValid: _react2.default.PropTypes.bool.isRequired,
+ onChange: _react2.default.PropTypes.func,
+ placeholder: _react2.default.PropTypes.string,
+ value: _react2.default.PropTypes.string.isRequired
+ };
+ exports.default = MFACodeInput;
+
+/***/ },
+/* 222 */
+/***/ 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 _react = __webpack_require__(1);
+
+ var _react2 = _interopRequireDefault(_react);
+
+ var _passwordSheriff = __webpack_require__(127);
+
+ var _passwordSheriff2 = _interopRequireDefault(_passwordSheriff);
+
+ var _util = __webpack_require__(101);
+
+ var _util2 = _interopRequireDefault(_util);
+
+ 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 PasswordStrength = function (_React$Component) {
+ _inherits(PasswordStrength, _React$Component);
+
+ function PasswordStrength() {
+ _classCallCheck(this, PasswordStrength);
+
+ return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
+ }
+
+ PasswordStrength.prototype.render = function render() {
+ var _props = this.props,
+ password = _props.password,
+ policy = _props.policy,
+ messages = _props.messages;
+
+ var analysis = (0, _passwordSheriff2.default)(policy).missing(password);
+ // TODO: add a component for fadeIn / fadeOut animations?
+ var className = "auth0-lock-password-strength animated " + (!analysis.verified ? "fadeIn" : "fadeOut");
+
+ var prepareMessage = function prepareMessage(items) {
+ items && items.forEach(function (o) {
+ if (messages[o.code]) {
+ o.message = messages[o.code];
+ }
+
+ o.message = _util2.default.format.apply(_util2.default, [o.message].concat(o.format || []));
+
+ if (o.items) {
+ prepareMessage(o.items);
+ }
+ });
+ };
+
+ prepareMessage(analysis.rules);
+
+ return _react2.default.createElement(
+ 'div',
+ { className: className },
+ _react2.default.createElement(List, { items: analysis.rules })
+ );
+ };
+
+ return PasswordStrength;
+ }(_react2.default.Component);
+
+ exports.default = PasswordStrength;
+
+
+ PasswordStrength.propTypes = {
+ messages: _react2.default.PropTypes.object.isRequired,
+ password: _react2.default.PropTypes.string.isRequired,
+ policy: _react2.default.PropTypes.oneOf(["none", "low", "fair", "good", "excellent"]).isRequired
+ };
+
+ PasswordStrength.defaultProps = {
+ messages: {}
+ };
+
+ var List = function (_React$Component2) {
+ _inherits(List, _React$Component2);
+
+ function List() {
+ _classCallCheck(this, List);
+
+ return _possibleConstructorReturn(this, _React$Component2.apply(this, arguments));
+ }
+
+ List.prototype.render = function render() {
+ var items = this.props.items;
+
+
+ return items && items.length ? _react2.default.createElement(
+ 'ul',
+ null,
+ items.map(function (x, i) {
+ return _react2.default.createElement(Item, _extends({}, x, { key: i }));
+ })
+ ) : null;
+ };
+
+ return List;
+ }(_react2.default.Component);
+
+ List.propTypes = {
+ items: _react2.default.PropTypes.arrayOf(_react2.default.PropTypes.object)
+ };
+
+ var Item = function (_React$Component3) {
+ _inherits(Item, _React$Component3);
+
+ function Item() {
+ _classCallCheck(this, Item);
+
+ return _possibleConstructorReturn(this, _React$Component3.apply(this, arguments));
+ }
+
+ Item.prototype.render = function render() {
+ var _props2 = this.props,
+ items = _props2.items,
+ message = _props2.message,
+ verified = _props2.verified;
+
+ var className = verified ? "auth0-lock-checked" : "";
+
+ return _react2.default.createElement(
+ 'li',
+ { className: className },
+ _react2.default.createElement(
+ 'span',
+ null,
+ message
+ ),
+ _react2.default.createElement(List, { items: items })
+ );
+ };
+
+ return Item;
+ }(_react2.default.Component);
+
+ Item.propTypes = {
+ items: _react2.default.PropTypes.array,
+ message: _react2.default.PropTypes.string.isRequired,
+ verified: _react2.default.PropTypes.bool.isRequired
+ };
+
+/***/ },
+/* 223 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ exports.__esModule = true;
+
+ var _react = __webpack_require__(1);
+
+ var _react2 = _interopRequireDefault(_react);
+
+ var _input_wrap = __webpack_require__(37);
+
+ var _input_wrap2 = _interopRequireDefault(_input_wrap);
+
+ 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 arrowSvg = '
';
+
+ var SelectInput = function (_React$Component) {
+ _inherits(SelectInput, _React$Component);
+
+ function SelectInput(props) {
+ _classCallCheck(this, SelectInput);
+
+ var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));
+
+ _this.state = {};
+ return _this;
+ }
+
+ SelectInput.prototype.render = function render() {
+ var _props = this.props,
+ iconUrl = _props.iconUrl,
+ isValid = _props.isValid,
+ label = _props.label,
+ name = _props.name,
+ onClick = _props.onClick,
+ placeholder = _props.placeholder;
+ var icon = this.props.icon;
+ var focused = this.state.focused;
+
+
+ var limitedValue = label || placeholder;
+ if (limitedValue.length > 23) {
+ limitedValue = limitedValue.substr(0, 20) + '...';
+ }
+
+ if (!icon && typeof iconUrl === "string" && iconUrl) {
+ icon = _react2.default.createElement('img', { className: 'auth0-lock-custom-icon', src: iconUrl });
+ }
+
+ var className = "auth0-lock-input auth0-lock-input-location";
+ if (!label) className += " auth0-lock-input-with-placeholder";
+
+ return _react2.default.createElement(
+ _input_wrap2.default,
+ { focused: focused, isValid: isValid, name: 'location', icon: icon },
+ _react2.default.createElement('input', { type: 'button',
+ name: name,
+ className: className,
+ value: limitedValue,
+ onFocus: this.handleFocus.bind(this),
+ onBlur: this.handleBlur.bind(this),
+ onKeyDown: this.handleKeyDown.bind(this),
+ onClick: onClick
+ }),
+ _react2.default.createElement('span', { dangerouslySetInnerHTML: { __html: arrowSvg } })
+ );
+ };
+
+ SelectInput.prototype.handleFocus = function handleFocus() {
+ this.setState({ focused: true });
+ };
+
+ SelectInput.prototype.handleBlur = function handleBlur() {
+ this.setState({ focused: false });
+ };
+
+ SelectInput.prototype.handleKeyDown = function handleKeyDown(e) {
+ if (e.key !== "Tab") {
+ e.preventDefault();
+ }
+
+ if (e.key === "ArrowDown") {
+ return this.props.onClick();
+ }
+
+ if (e.keyCode >= 65 && e.keyCode <= 90) {
+ return this.props.onClick(String.fromCharCode(e.keyCode).toLowerCase());
+ }
+ };
+
+ return SelectInput;
+ }(_react2.default.Component);
+
+ // TODO: specify propTypes
+
+
+ exports.default = SelectInput;
+
+/***/ },
+/* 224 */
+/***/ 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 _react = __webpack_require__(1);
+
+ var _react2 = _interopRequireDefault(_react);
+
+ var _input_wrap = __webpack_require__(37);
+
+ var _input_wrap2 = _interopRequireDefault(_input_wrap);
+
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+ function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+ var svg = '
';
+
+ var UsernameInput = function (_React$Component) {
+ _inherits(UsernameInput, _React$Component);
+
+ function UsernameInput(props) {
+ _classCallCheck(this, UsernameInput);
+
+ var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));
+
+ _this.state = {};
+ return _this;
+ }
+
+ UsernameInput.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps, nextState) {
+ var _props = this.props,
+ invalidHint = _props.invalidHint,
+ isValid = _props.isValid,
+ value = _props.value,
+ onChange = _props.onChange;
+ var focused = this.state.focused;
+
+
+ return invalidHint != nextProps.invalidHint || isValid != nextProps.isValid || value != nextProps.value || focused != nextState.focused;
+ };
+
+ UsernameInput.prototype.render = function render() {
+ var _props2 = this.props,
+ invalidHint = _props2.invalidHint,
+ isValid = _props2.isValid,
+ onChange = _props2.onChange,
+ props = _objectWithoutProperties(_props2, ['invalidHint', 'isValid', 'onChange']);
+
+ var focused = this.state.focused;
+
+
+ return _react2.default.createElement(
+ _input_wrap2.default,
+ {
+ focused: focused,
+ invalidHint: invalidHint,
+ isValid: isValid,
+ name: 'username',
+ icon: svg
+ },
+ _react2.default.createElement('input', _extends({
+ ref: 'input',
+ type: 'text',
+ name: 'username',
+ className: 'auth0-lock-input',
+ placeholder: 'username',
+ autoComplete: 'off',
+ autoCapitalize: 'off',
+ onChange: this.handleOnChange.bind(this),
+ onFocus: this.handleFocus.bind(this),
+ onBlur: this.handleBlur.bind(this)
+ }, props))
+ );
+ };
+
+ UsernameInput.prototype.handleOnChange = function handleOnChange(e) {
+ if (this.props.onChange) {
+ this.props.onChange(e);
+ }
+ };
+
+ UsernameInput.prototype.handleFocus = function handleFocus() {
+ this.setState({ focused: true });
+ };
+
+ UsernameInput.prototype.handleBlur = function handleBlur() {
+ this.setState({ focused: false });
+ };
+
+ return UsernameInput;
+ }(_react2.default.Component);
+
+ // TODO: specify propTypes
+
+
+ exports.default = UsernameInput;
+
+/***/ },
+/* 225 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ exports.__esModule = true;
+
+ var _react = __webpack_require__(1);
+
+ var _react2 = _interopRequireDefault(_react);
+
+ var _reactDom = __webpack_require__(46);
+
+ var _reactDom2 = _interopRequireDefault(_reactDom);
+
+ var _button = __webpack_require__(57);
+
+ var _text_input = __webpack_require__(120);
+
+ var _text_input2 = _interopRequireDefault(_text_input);
+
+ var _media_utils = __webpack_require__(121);
+
+ var _string_utils = __webpack_require__(76);
+
+ var su = _interopRequireWildcard(_string_utils);
+
+ 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 }; }
+
+ 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 cycle = function cycle(xs, x) {
+ return xs.skipWhile(function (y) {
+ return y !== x;
+ }).get(1, xs.get(0));
+ };
+
+ var FiltrableList = function (_React$Component) {
+ _inherits(FiltrableList, _React$Component);
+
+ function FiltrableList(props) {
+ _classCallCheck(this, FiltrableList);
+
+ var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));
+
+ _this.state = { filteredItems: props.items, highlighted: props.defaultItem };
+ return _this;
+ }
+
+ FiltrableList.prototype.filter = function filter(str) {
+ var filteredItems = this.props.items.filter(function (x) {
+ return su.matches(str, x.get("label"));
+ });
+
+ var highlighted = filteredItems.size === 1 && filteredItems.get(0) || filteredItems.includes(this.state.highlighted) && this.state.highlighted || null;
+
+ return {
+ filteredItems: filteredItems,
+ highlighted: highlighted
+ };
+ };
+
+ FiltrableList.prototype.select = function select(x) {
+ this.props.onSelect(x);
+ };
+
+ FiltrableList.prototype.handleChange = function handleChange(e) {
+ this.setState(this.filter(e.target.value));
+ };
+
+ FiltrableList.prototype.handleKeyDown = function handleKeyDown(e) {
+ var _state = this.state,
+ filteredItems = _state.filteredItems,
+ highlighted = _state.highlighted;
+
+
+ switch (e.key) {
+ case "ArrowDown":
+ e.preventDefault();
+ this.setState({ highlighted: cycle(filteredItems, highlighted) });
+ break;
+ case "ArrowUp":
+ e.preventDefault();
+ this.setState({ highlighted: cycle(filteredItems.reverse(), highlighted) });
+ break;
+ case "Enter":
+ e.preventDefault();
+ highlighted && this.select(highlighted);
+ break;
+ case "Escape":
+ e.preventDefault();
+ this.props.onCancel();
+ default:
+ // no-op
+ }
+ };
+
+ FiltrableList.prototype.render = function render() {
+ var _this2 = this;
+
+ var _props = this.props,
+ icon = _props.icon,
+ iconUrl = _props.iconUrl,
+ onCancel = _props.onCancel;
+
+ return _react2.default.createElement(
+ 'div',
+ { className: 'auth0-lock-select-country' },
+ _react2.default.createElement(
+ 'div',
+ { className: 'auth0-lock-search' },
+ _react2.default.createElement(_button.BackButton, { onClick: onCancel }),
+ _react2.default.createElement(_text_input2.default, {
+ name: 'search',
+ icon: icon,
+ iconUrl: iconUrl,
+ isValid: true,
+ onChange: this.handleChange.bind(this),
+ onKeyDown: this.handleKeyDown.bind(this)
+ })
+ ),
+ _react2.default.createElement(List, {
+ highlighted: this.state.highlighted,
+ items: this.state.filteredItems,
+ onClick: this.select.bind(this),
+ onMouseMove: function onMouseMove(x) {
+ return _this2.setState({ highlighted: x });
+ }
+ })
+ );
+ };
+
+ return FiltrableList;
+ }(_react2.default.Component);
+
+ exports.default = FiltrableList;
+
+ var List = function (_React$Component2) {
+ _inherits(List, _React$Component2);
+
+ function List() {
+ _classCallCheck(this, List);
+
+ return _possibleConstructorReturn(this, _React$Component2.apply(this, arguments));
+ }
+
+ List.prototype.componentDidUpdate = function componentDidUpdate() {
+ var _this4 = this;
+
+ // Ensure that highlighted item is entirely visible
+
+ // NOTE: I've spent very little time on this. It works, but it
+ // surely can be more clearly.
+
+ var highlighted = this.refs.highlighted;
+
+
+ if (highlighted) {
+ var scrollableNode = _reactDom2.default.findDOMNode(this);
+ var highlightedNode = _reactDom2.default.findDOMNode(highlighted);
+ var relativeOffsetTop = highlightedNode.offsetTop - scrollableNode.scrollTop;
+ var scrollTopDelta = 0;
+ if (relativeOffsetTop + highlightedNode.offsetHeight > scrollableNode.clientHeight) {
+ scrollTopDelta = relativeOffsetTop + highlightedNode.offsetHeight - scrollableNode.clientHeight;
+ } else if (relativeOffsetTop < 0) {
+ scrollTopDelta = relativeOffsetTop;
+ }
+
+ if (scrollTopDelta) {
+ this.preventHighlight = true;
+ scrollableNode.scrollTop += scrollTopDelta;
+ if (this.timeout) clearTimeout(this.timeout);
+ this.timeout = setTimeout(function () {
+ return _this4.preventHighlight = false;
+ }, 100);
+ }
+ }
+ };
+
+ List.prototype.mouseMoveHandler = function mouseMoveHandler(x) {
+ // TODO: This is an ugly hack to avoid highlighting the element under the
+ // mouse when an arrow key trigger a scroll of the list (which in turn
+ // triggers a mousemove event).
+ !this.preventHighlight && this.props.onMouseMove(x);
+ };
+
+ List.prototype.mouseLeaveHandler = function mouseLeaveHandler() {
+ // TODO: clear highlighted?
+ };
+
+ List.prototype.render = function render() {
+ var _this5 = this;
+
+ var items = this.props.items.map(function (x) {
+ var highlighted = x === _this5.props.highlighted;
+
+ var props = {
+ highlighted: highlighted,
+ key: x.get("label"),
+ label: x.get("label"),
+ onClick: function onClick() {
+ return _this5.props.onClick(x);
+ },
+ onMouseMove: function onMouseMove() {
+ return _this5.mouseMoveHandler(x);
+ }
+ };
+
+ if (highlighted) props.ref = "highlighted";
+
+ return _react2.default.createElement(Item, props);
+ });
+
+ return _react2.default.createElement(
+ 'div',
+ {
+ className: 'auth0-lock-list-code',
+ onMouseLeave: this.mouseLeaveHandler.bind(this)
+ },
+ _react2.default.createElement(
+ 'ul',
+ null,
+ items
+ )
+ );
+ };
+
+ return List;
+ }(_react2.default.Component);
+
+ var Item = function (_React$Component3) {
+ _inherits(Item, _React$Component3);
+
+ function Item() {
+ _classCallCheck(this, Item);
+
+ return _possibleConstructorReturn(this, _React$Component3.apply(this, arguments));
+ }
+
+ Item.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps) {
+ return this.props.highlighted != nextProps.highlighted;
+ };
+
+ Item.prototype.render = function render() {
+ var _props2 = this.props,
+ highlighted = _props2.highlighted,
+ label = _props2.label,
+ onClick = _props2.onClick,
+ onMouseMove = _props2.onMouseMove;
+
+ var className = highlighted ? "auth0-lock-list-code-highlighted" : "";
+
+ return _react2.default.createElement(
+ 'li',
+ { className: className, onClick: onClick, onMouseMove: onMouseMove },
+ label
+ );
+ };
+
+ return Item;
+ }(_react2.default.Component);
+
+ Item.propTypes = {
+ highlighted: _react.PropTypes.bool.isRequired,
+ label: _react.PropTypes.string.isRequired,
+ onClick: _react.PropTypes.func.isRequired,
+ onMouseMove: _react.PropTypes.func.isRequired
+ };
+
+/***/ },
+/* 226 */
+/***/ function(module, exports) {
+
+ "use strict";
+
+ exports.__esModule = true;
+ exports.default = atom;
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ var Atom = function () {
+ function Atom(state) {
+ _classCallCheck(this, Atom);
+
+ this.state = state;
+ this.watches = {};
+ }
+
+ Atom.prototype.reset = function reset(state) {
+ return this._change(state);
+ };
+
+ Atom.prototype.swap = function swap(f) {
+ for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
+ args[_key - 1] = arguments[_key];
+ }
+
+ return this._change(f.apply(undefined, [this.state].concat(args)));
+ };
+
+ Atom.prototype.deref = function deref() {
+ return this.state;
+ };
+
+ Atom.prototype.addWatch = function addWatch(k, f) {
+ // if (this.watches[key]) {
+ // console.warn(`adding a watch with an already registered key: ${k}`);
+ // }
+ this.watches[k] = f;
+ return this;
+ };
+
+ Atom.prototype.removeWatch = function removeWatch(k) {
+ // if (!this.watches[key]) {
+ // console.warn(`removing a watch with an unknown key: ${k}`);
+ // }
+ delete this.watches[k];
+ return this;
+ };
+
+ Atom.prototype._change = function _change(newState) {
+ var state = this.state,
+ watches = this.watches;
+
+ this.state = newState;
+ Object.keys(watches).forEach(function (k) {
+ return watches[k](k, state, newState);
+ });
+ return this.state;
+ };
+
+ return Atom;
+ }();
+
+ function atom(state) {
+ return new Atom(state);
+ }
+
+/***/ },
+/* 227 */
+/***/ function(module, exports) {
+
+ "use strict";
+
+ exports.__esModule = true;
+
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+ var Cache = function () {
+ function Cache(fetchFn) {
+ _classCallCheck(this, Cache);
+
+ this.cache = {};
+ this.cbs = {};
+ this.fetchFn = fetchFn;
+ }
+
+ Cache.prototype.get = function get() {
+ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
+ args[_key] = arguments[_key];
+ }
+
+ var cb = args.pop();
+ var key = JSON.stringify(args);
+ if (this.cache[key]) return cb(null, this.cache[key]);
+ if (this.registerCallback(key, cb) > 1) return;
+ this.fetch(key, args);
+ };
+
+ Cache.prototype.fetch = function fetch(key, args) {
+ var _this = this;
+
+ this.fetchFn.apply(this, args.concat([function (error, result) {
+ if (!error) _this.cache[key] = result;
+ _this.execCallbacks(key, error, result);
+ }]));
+ };
+
+ Cache.prototype.registerCallback = function registerCallback(key, cb) {
+ this.cbs[key] = this.cbs[key] || [];
+ this.cbs[key].push(cb);
+ return this.cbs[key].length;
+ };
+
+ Cache.prototype.execCallbacks = function execCallbacks(key) {
+ for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
+ args[_key2 - 1] = arguments[_key2];
+ }
+
+ this.cbs[key].forEach(function (f) {
+ return f.apply(undefined, args);
+ });
+ delete this.cbs[key];
+ };
+
+ return Cache;
+ }();
+
+ exports.default = Cache;
+
+/***/ },
+/* 228 */
+/***/ function(module, exports) {
+
+ "use strict";
+
+ exports.__esModule = true;
+ exports.debounce = debounce;
+ function debounce(f, delay) {
+ var t = void 0;
+ return function () {
+ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
+ args[_key] = arguments[_key];
+ }
+
+ function handler() {
+ clearTimeout(t);
+ f.apply(undefined, args);
+ }
+ clearTimeout(t);
+ t = setTimeout(handler, delay);
+ };
+ }
+
+/***/ },
+/* 229 */
+/***/ function(module, exports) {
+
+ "use strict";
+
+ exports.__esModule = true;
+ exports.random = random;
+ exports.incremental = incremental;
+ function random() {
+ return (+new Date() + Math.floor(Math.random() * 10000000)).toString(36);
+ }
+
+ var start = 1;
+ function incremental() {
+ return start++;
+ }
+
+/***/ },
+/* 230 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ exports.__esModule = true;
+
+ var _jsonp = __webpack_require__(245);
+
+ var _jsonp2 = _interopRequireDefault(_jsonp);
+
+ 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 JSONPUtils = function () {
+ function JSONPUtils() {
+ _classCallCheck(this, JSONPUtils);
+ }
+
+ JSONPUtils.prototype.get = function get() {
+ return _jsonp2.default.apply(undefined, arguments);
+ };
+
+ return JSONPUtils;
+ }();
+
+ exports.default = new JSONPUtils();
+
+/***/ },
+/* 231 */
+/***/ function(module, exports) {
+
+ /* WEBPACK VAR INJECTION */(function(global) {"use strict";
+
+ exports.__esModule = true;
+ exports.parseUrl = parseUrl;
+ function parseUrl(str) {
+ var parser = global.document.createElement("a");
+ parser.href = str;
+ return parser;
+ }
+ /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
+
+/***/ },
+/* 232 */
+/***/ function(module, exports, __webpack_require__) {
+
+ var __WEBPACK_AMD_DEFINE_RESULT__;/*
+ * JavaScript MD5
+ * https://github.com/blueimp/JavaScript-MD5
+ *
+ * Copyright 2011, Sebastian Tschan
+ * https://blueimp.net
+ *
+ * Licensed under the MIT license:
+ * http://www.opensource.org/licenses/MIT
+ *
+ * Based on
+ * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
+ * Digest Algorithm, as defined in RFC 1321.
+ * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009
+ * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
+ * Distributed under the BSD License
+ * See http://pajhome.org.uk/crypt/md5 for more info.
+ */
+
+ /*global unescape, define, module */
+
+ ;(function ($) {
+ 'use strict'
+
+ /*
+ * Add integers, wrapping at 2^32. This uses 16-bit operations internally
+ * to work around bugs in some JS interpreters.
+ */
+ function safe_add (x, y) {
+ var lsw = (x & 0xFFFF) + (y & 0xFFFF)
+ var msw = (x >> 16) + (y >> 16) + (lsw >> 16)
+ return (msw << 16) | (lsw & 0xFFFF)
+ }
+
+ /*
+ * Bitwise rotate a 32-bit number to the left.
+ */
+ function bit_rol (num, cnt) {
+ return (num << cnt) | (num >>> (32 - cnt))
+ }
+
+ /*
+ * These functions implement the four basic operations the algorithm uses.
+ */
+ function md5_cmn (q, a, b, x, s, t) {
+ return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b)
+ }
+ function md5_ff (a, b, c, d, x, s, t) {
+ return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t)
+ }
+ function md5_gg (a, b, c, d, x, s, t) {
+ return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t)
+ }
+ function md5_hh (a, b, c, d, x, s, t) {
+ return md5_cmn(b ^ c ^ d, a, b, x, s, t)
+ }
+ function md5_ii (a, b, c, d, x, s, t) {
+ return md5_cmn(c ^ (b | (~d)), a, b, x, s, t)
+ }
+
+ /*
+ * Calculate the MD5 of an array of little-endian words, and a bit length.
+ */
+ function binl_md5 (x, len) {
+ /* append padding */
+ x[len >> 5] |= 0x80 << (len % 32)
+ x[(((len + 64) >>> 9) << 4) + 14] = len
+
+ var i
+ var olda
+ var oldb
+ var oldc
+ var oldd
+ var a = 1732584193
+ var b = -271733879
+ var c = -1732584194
+ var d = 271733878
+
+ for (i = 0; i < x.length; i += 16) {
+ olda = a
+ oldb = b
+ oldc = c
+ oldd = d
+
+ a = md5_ff(a, b, c, d, x[i], 7, -680876936)
+ d = md5_ff(d, a, b, c, x[i + 1], 12, -389564586)
+ c = md5_ff(c, d, a, b, x[i + 2], 17, 606105819)
+ b = md5_ff(b, c, d, a, x[i + 3], 22, -1044525330)
+ a = md5_ff(a, b, c, d, x[i + 4], 7, -176418897)
+ d = md5_ff(d, a, b, c, x[i + 5], 12, 1200080426)
+ c = md5_ff(c, d, a, b, x[i + 6], 17, -1473231341)
+ b = md5_ff(b, c, d, a, x[i + 7], 22, -45705983)
+ a = md5_ff(a, b, c, d, x[i + 8], 7, 1770035416)
+ d = md5_ff(d, a, b, c, x[i + 9], 12, -1958414417)
+ c = md5_ff(c, d, a, b, x[i + 10], 17, -42063)
+ b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162)
+ a = md5_ff(a, b, c, d, x[i + 12], 7, 1804603682)
+ d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101)
+ c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290)
+ b = md5_ff(b, c, d, a, x[i + 15], 22, 1236535329)
+
+ a = md5_gg(a, b, c, d, x[i + 1], 5, -165796510)
+ d = md5_gg(d, a, b, c, x[i + 6], 9, -1069501632)
+ c = md5_gg(c, d, a, b, x[i + 11], 14, 643717713)
+ b = md5_gg(b, c, d, a, x[i], 20, -373897302)
+ a = md5_gg(a, b, c, d, x[i + 5], 5, -701558691)
+ d = md5_gg(d, a, b, c, x[i + 10], 9, 38016083)
+ c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335)
+ b = md5_gg(b, c, d, a, x[i + 4], 20, -405537848)
+ a = md5_gg(a, b, c, d, x[i + 9], 5, 568446438)
+ d = md5_gg(d, a, b, c, x[i + 14], 9, -1019803690)
+ c = md5_gg(c, d, a, b, x[i + 3], 14, -187363961)
+ b = md5_gg(b, c, d, a, x[i + 8], 20, 1163531501)
+ a = md5_gg(a, b, c, d, x[i + 13], 5, -1444681467)
+ d = md5_gg(d, a, b, c, x[i + 2], 9, -51403784)
+ c = md5_gg(c, d, a, b, x[i + 7], 14, 1735328473)
+ b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734)
+
+ a = md5_hh(a, b, c, d, x[i + 5], 4, -378558)
+ d = md5_hh(d, a, b, c, x[i + 8], 11, -2022574463)
+ c = md5_hh(c, d, a, b, x[i + 11], 16, 1839030562)
+ b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556)
+ a = md5_hh(a, b, c, d, x[i + 1], 4, -1530992060)
+ d = md5_hh(d, a, b, c, x[i + 4], 11, 1272893353)
+ c = md5_hh(c, d, a, b, x[i + 7], 16, -155497632)
+ b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640)
+ a = md5_hh(a, b, c, d, x[i + 13], 4, 681279174)
+ d = md5_hh(d, a, b, c, x[i], 11, -358537222)
+ c = md5_hh(c, d, a, b, x[i + 3], 16, -722521979)
+ b = md5_hh(b, c, d, a, x[i + 6], 23, 76029189)
+ a = md5_hh(a, b, c, d, x[i + 9], 4, -640364487)
+ d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835)
+ c = md5_hh(c, d, a, b, x[i + 15], 16, 530742520)
+ b = md5_hh(b, c, d, a, x[i + 2], 23, -995338651)
+
+ a = md5_ii(a, b, c, d, x[i], 6, -198630844)
+ d = md5_ii(d, a, b, c, x[i + 7], 10, 1126891415)
+ c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905)
+ b = md5_ii(b, c, d, a, x[i + 5], 21, -57434055)
+ a = md5_ii(a, b, c, d, x[i + 12], 6, 1700485571)
+ d = md5_ii(d, a, b, c, x[i + 3], 10, -1894986606)
+ c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523)
+ b = md5_ii(b, c, d, a, x[i + 1], 21, -2054922799)
+ a = md5_ii(a, b, c, d, x[i + 8], 6, 1873313359)
+ d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744)
+ c = md5_ii(c, d, a, b, x[i + 6], 15, -1560198380)
+ b = md5_ii(b, c, d, a, x[i + 13], 21, 1309151649)
+ a = md5_ii(a, b, c, d, x[i + 4], 6, -145523070)
+ d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379)
+ c = md5_ii(c, d, a, b, x[i + 2], 15, 718787259)
+ b = md5_ii(b, c, d, a, x[i + 9], 21, -343485551)
+
+ a = safe_add(a, olda)
+ b = safe_add(b, oldb)
+ c = safe_add(c, oldc)
+ d = safe_add(d, oldd)
+ }
+ return [a, b, c, d]
+ }
+
+ /*
+ * Convert an array of little-endian words to a string
+ */
+ function binl2rstr (input) {
+ var i
+ var output = ''
+ var length32 = input.length * 32
+ for (i = 0; i < length32; i += 8) {
+ output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xFF)
+ }
+ return output
+ }
+
+ /*
+ * Convert a raw string to an array of little-endian words
+ * Characters >255 have their high-byte silently ignored.
+ */
+ function rstr2binl (input) {
+ var i
+ var output = []
+ output[(input.length >> 2) - 1] = undefined
+ for (i = 0; i < output.length; i += 1) {
+ output[i] = 0
+ }
+ var length8 = input.length * 8
+ for (i = 0; i < length8; i += 8) {
+ output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << (i % 32)
+ }
+ return output
+ }
+
+ /*
+ * Calculate the MD5 of a raw string
+ */
+ function rstr_md5 (s) {
+ return binl2rstr(binl_md5(rstr2binl(s), s.length * 8))
+ }
+
+ /*
+ * Calculate the HMAC-MD5, of a key and some data (raw strings)
+ */
+ function rstr_hmac_md5 (key, data) {
+ var i
+ var bkey = rstr2binl(key)
+ var ipad = []
+ var opad = []
+ var hash
+ ipad[15] = opad[15] = undefined
+ if (bkey.length > 16) {
+ bkey = binl_md5(bkey, key.length * 8)
+ }
+ for (i = 0; i < 16; i += 1) {
+ ipad[i] = bkey[i] ^ 0x36363636
+ opad[i] = bkey[i] ^ 0x5C5C5C5C
+ }
+ hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8)
+ return binl2rstr(binl_md5(opad.concat(hash), 512 + 128))
+ }
+
+ /*
+ * Convert a raw string to a hex string
+ */
+ function rstr2hex (input) {
+ var hex_tab = '0123456789abcdef'
+ var output = ''
+ var x
+ var i
+ for (i = 0; i < input.length; i += 1) {
+ x = input.charCodeAt(i)
+ output += hex_tab.charAt((x >>> 4) & 0x0F) +
+ hex_tab.charAt(x & 0x0F)
+ }
+ return output
+ }
+
+ /*
+ * Encode a string as utf-8
+ */
+ function str2rstr_utf8 (input) {
+ return unescape(encodeURIComponent(input))
+ }
+
+ /*
+ * Take string arguments and return either raw or hex encoded strings
+ */
+ function raw_md5 (s) {
+ return rstr_md5(str2rstr_utf8(s))
+ }
+ function hex_md5 (s) {
+ return rstr2hex(raw_md5(s))
+ }
+ function raw_hmac_md5 (k, d) {
+ return rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d))
+ }
+ function hex_hmac_md5 (k, d) {
+ return rstr2hex(raw_hmac_md5(k, d))
+ }
+
+ function md5 (string, key, raw) {
+ if (!key) {
+ if (!raw) {
+ return hex_md5(string)
+ }
+ return raw_md5(string)
+ }
+ if (!raw) {
+ return hex_hmac_md5(key, string)
+ }
+ return raw_hmac_md5(key, string)
+ }
+
+ if (true) {
+ !(__WEBPACK_AMD_DEFINE_RESULT__ = function () {
+ return md5
+ }.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__))
+ } else if (typeof module === 'object' && module.exports) {
+ module.exports = md5
+ } else {
+ $.md5 = md5
+ }
+ }(this))
+
+
+/***/ },
+/* 233 */
+/***/ function(module, exports, __webpack_require__) {
+
+
+ /**
+ * Expose `Emitter`.
+ */
+
+ if (true) {
+ module.exports = Emitter;
+ }
+
+ /**
+ * Initialize a new `Emitter`.
+ *
+ * @api public
+ */
+
+ function Emitter(obj) {
+ if (obj) return mixin(obj);
+ };
+
+ /**
+ * Mixin the emitter properties.
+ *
+ * @param {Object} obj
+ * @return {Object}
+ * @api private
+ */
+
+ function mixin(obj) {
+ for (var key in Emitter.prototype) {
+ obj[key] = Emitter.prototype[key];
+ }
+ return obj;
+ }
+
+ /**
+ * Listen on the given `event` with `fn`.
+ *
+ * @param {String} event
+ * @param {Function} fn
+ * @return {Emitter}
+ * @api public
+ */
+
+ Emitter.prototype.on =
+ Emitter.prototype.addEventListener = function(event, fn){
+ this._callbacks = this._callbacks || {};
+ (this._callbacks['$' + event] = this._callbacks['$' + event] || [])
+ .push(fn);
+ return this;
+ };
+
+ /**
+ * Adds an `event` listener that will be invoked a single
+ * time then automatically removed.
+ *
+ * @param {String} event
+ * @param {Function} fn
+ * @return {Emitter}
+ * @api public
+ */
+
+ Emitter.prototype.once = function(event, fn){
+ function on() {
+ this.off(event, on);
+ fn.apply(this, arguments);
+ }
+
+ on.fn = fn;
+ this.on(event, on);
+ return this;
+ };
+
+ /**
+ * Remove the given callback for `event` or all
+ * registered callbacks.
+ *
+ * @param {String} event
+ * @param {Function} fn
+ * @return {Emitter}
+ * @api public
+ */
+
+ Emitter.prototype.off =
+ Emitter.prototype.removeListener =
+ Emitter.prototype.removeAllListeners =
+ Emitter.prototype.removeEventListener = function(event, fn){
+ this._callbacks = this._callbacks || {};
+
+ // all
+ if (0 == arguments.length) {
+ this._callbacks = {};
+ return this;
+ }
+
+ // specific event
+ var callbacks = this._callbacks['$' + event];
+ if (!callbacks) return this;
+
+ // remove all handlers
+ if (1 == arguments.length) {
+ delete this._callbacks['$' + event];
+ return this;
+ }
+
+ // remove specific handler
+ var cb;
+ for (var i = 0; i < callbacks.length; i++) {
+ cb = callbacks[i];
+ if (cb === fn || cb.fn === fn) {
+ callbacks.splice(i, 1);
+ break;
+ }
+ }
+ return this;
+ };
+
+ /**
+ * Emit `event` with the given args.
+ *
+ * @param {String} event
+ * @param {Mixed} ...
+ * @return {Emitter}
+ */
+
+ Emitter.prototype.emit = function(event){
+ this._callbacks = this._callbacks || {};
+ var args = [].slice.call(arguments, 1)
+ , callbacks = this._callbacks['$' + event];
+
+ if (callbacks) {
+ callbacks = callbacks.slice(0);
+ for (var i = 0, len = callbacks.length; i < len; ++i) {
+ callbacks[i].apply(this, args);
+ }
+ }
+
+ return this;
+ };
+
+ /**
+ * Return array of callbacks for `event`.
+ *
+ * @param {String} event
+ * @return {Array}
+ * @api public
+ */
+
+ Emitter.prototype.listeners = function(event){
+ this._callbacks = this._callbacks || {};
+ return this._callbacks['$' + event] || [];
+ };
+
+ /**
+ * Check if this emitter has `event` handlers.
+ *
+ * @param {String} event
+ * @return {Boolean}
+ * @api public
+ */
+
+ Emitter.prototype.hasListeners = function(event){
+ return !! this.listeners(event).length;
+ };
+
+
+/***/ },
+/* 234 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;(function (root, factory) {
+ if (true) {
+ // CommonJS
+ module.exports = exports = factory();
+ }
+ else if (typeof define === "function" && define.amd) {
+ // AMD
+ define([], factory);
+ }
+ else {
+ // Global (browser)
+ root.CryptoJS = factory();
+ }
+ }(this, function () {
+
+ /**
+ * CryptoJS core components.
+ */
+ var CryptoJS = CryptoJS || (function (Math, undefined) {
+ /*
+ * Local polyfil of Object.create
+ */
+ var create = Object.create || (function () {
+ function F() {};
+
+ return function (obj) {
+ var subtype;
+
+ F.prototype = obj;
+
+ subtype = new F();
+
+ F.prototype = null;
+
+ return subtype;
+ };
+ }())
+
+ /**
+ * CryptoJS namespace.
+ */
+ var C = {};
+
+ /**
+ * Library namespace.
+ */
+ var C_lib = C.lib = {};
+
+ /**
+ * Base object for prototypal inheritance.
+ */
+ var Base = C_lib.Base = (function () {
+
+
+ return {
+ /**
+ * Creates a new object that inherits from this object.
+ *
+ * @param {Object} overrides Properties to copy into the new object.
+ *
+ * @return {Object} The new object.
+ *
+ * @static
+ *
+ * @example
+ *
+ * var MyType = CryptoJS.lib.Base.extend({
+ * field: 'value',
+ *
+ * method: function () {
+ * }
+ * });
+ */
+ extend: function (overrides) {
+ // Spawn
+ var subtype = create(this);
+
+ // Augment
+ if (overrides) {
+ subtype.mixIn(overrides);
+ }
+
+ // Create default initializer
+ if (!subtype.hasOwnProperty('init') || this.init === subtype.init) {
+ subtype.init = function () {
+ subtype.$super.init.apply(this, arguments);
+ };
+ }
+
+ // Initializer's prototype is the subtype object
+ subtype.init.prototype = subtype;
+
+ // Reference supertype
+ subtype.$super = this;
+
+ return subtype;
+ },
+
+ /**
+ * Extends this object and runs the init method.
+ * Arguments to create() will be passed to init().
+ *
+ * @return {Object} The new object.
+ *
+ * @static
+ *
+ * @example
+ *
+ * var instance = MyType.create();
+ */
+ create: function () {
+ var instance = this.extend();
+ instance.init.apply(instance, arguments);
+
+ return instance;
+ },
+
+ /**
+ * Initializes a newly created object.
+ * Override this method to add some logic when your objects are created.
+ *
+ * @example
+ *
+ * var MyType = CryptoJS.lib.Base.extend({
+ * init: function () {
+ * // ...
+ * }
+ * });
+ */
+ init: function () {
+ },
+
+ /**
+ * Copies properties into this object.
+ *
+ * @param {Object} properties The properties to mix in.
+ *
+ * @example
+ *
+ * MyType.mixIn({
+ * field: 'value'
+ * });
+ */
+ mixIn: function (properties) {
+ for (var propertyName in properties) {
+ if (properties.hasOwnProperty(propertyName)) {
+ this[propertyName] = properties[propertyName];
+ }
+ }
+
+ // IE won't copy toString using the loop above
+ if (properties.hasOwnProperty('toString')) {
+ this.toString = properties.toString;
+ }
+ },
+
+ /**
+ * Creates a copy of this object.
+ *
+ * @return {Object} The clone.
+ *
+ * @example
+ *
+ * var clone = instance.clone();
+ */
+ clone: function () {
+ return this.init.prototype.extend(this);
+ }
+ };
+ }());
+
+ /**
+ * An array of 32-bit words.
+ *
+ * @property {Array} words The array of 32-bit words.
+ * @property {number} sigBytes The number of significant bytes in this word array.
+ */
+ var WordArray = C_lib.WordArray = Base.extend({
+ /**
+ * Initializes a newly created word array.
+ *
+ * @param {Array} words (Optional) An array of 32-bit words.
+ * @param {number} sigBytes (Optional) The number of significant bytes in the words.
+ *
+ * @example
+ *
+ * var wordArray = CryptoJS.lib.WordArray.create();
+ * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);
+ * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);
+ */
+ init: function (words, sigBytes) {
+ words = this.words = words || [];
+
+ if (sigBytes != undefined) {
+ this.sigBytes = sigBytes;
+ } else {
+ this.sigBytes = words.length * 4;
+ }
+ },
+
+ /**
+ * Converts this word array to a string.
+ *
+ * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex
+ *
+ * @return {string} The stringified word array.
+ *
+ * @example
+ *
+ * var string = wordArray + '';
+ * var string = wordArray.toString();
+ * var string = wordArray.toString(CryptoJS.enc.Utf8);
+ */
+ toString: function (encoder) {
+ return (encoder || Hex).stringify(this);
+ },
+
+ /**
+ * Concatenates a word array to this word array.
+ *
+ * @param {WordArray} wordArray The word array to append.
+ *
+ * @return {WordArray} This word array.
+ *
+ * @example
+ *
+ * wordArray1.concat(wordArray2);
+ */
+ concat: function (wordArray) {
+ // Shortcuts
+ var thisWords = this.words;
+ var thatWords = wordArray.words;
+ var thisSigBytes = this.sigBytes;
+ var thatSigBytes = wordArray.sigBytes;
+
+ // Clamp excess bits
+ this.clamp();
+
+ // Concat
+ if (thisSigBytes % 4) {
+ // Copy one byte at a time
+ for (var i = 0; i < thatSigBytes; i++) {
+ var thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
+ thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8);
+ }
+ } else {
+ // Copy one word at a time
+ for (var i = 0; i < thatSigBytes; i += 4) {
+ thisWords[(thisSigBytes + i) >>> 2] = thatWords[i >>> 2];
+ }
+ }
+ this.sigBytes += thatSigBytes;
+
+ // Chainable
+ return this;
+ },
+
+ /**
+ * Removes insignificant bits.
+ *
+ * @example
+ *
+ * wordArray.clamp();
+ */
+ clamp: function () {
+ // Shortcuts
+ var words = this.words;
+ var sigBytes = this.sigBytes;
+
+ // Clamp
+ words[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8);
+ words.length = Math.ceil(sigBytes / 4);
+ },
+
+ /**
+ * Creates a copy of this word array.
+ *
+ * @return {WordArray} The clone.
+ *
+ * @example
+ *
+ * var clone = wordArray.clone();
+ */
+ clone: function () {
+ var clone = Base.clone.call(this);
+ clone.words = this.words.slice(0);
+
+ return clone;
+ },
+
+ /**
+ * Creates a word array filled with random bytes.
+ *
+ * @param {number} nBytes The number of random bytes to generate.
+ *
+ * @return {WordArray} The random word array.
+ *
+ * @static
+ *
+ * @example
+ *
+ * var wordArray = CryptoJS.lib.WordArray.random(16);
+ */
+ random: function (nBytes) {
+ var words = [];
+
+ var r = (function (m_w) {
+ var m_w = m_w;
+ var m_z = 0x3ade68b1;
+ var mask = 0xffffffff;
+
+ return function () {
+ m_z = (0x9069 * (m_z & 0xFFFF) + (m_z >> 0x10)) & mask;
+ m_w = (0x4650 * (m_w & 0xFFFF) + (m_w >> 0x10)) & mask;
+ var result = ((m_z << 0x10) + m_w) & mask;
+ result /= 0x100000000;
+ result += 0.5;
+ return result * (Math.random() > .5 ? 1 : -1);
+ }
+ });
+
+ for (var i = 0, rcache; i < nBytes; i += 4) {
+ var _r = r((rcache || Math.random()) * 0x100000000);
+
+ rcache = _r() * 0x3ade67b7;
+ words.push((_r() * 0x100000000) | 0);
+ }
+
+ return new WordArray.init(words, nBytes);
+ }
+ });
+
+ /**
+ * Encoder namespace.
+ */
+ var C_enc = C.enc = {};
+
+ /**
+ * Hex encoding strategy.
+ */
+ var Hex = C_enc.Hex = {
+ /**
+ * Converts a word array to a hex string.
+ *
+ * @param {WordArray} wordArray The word array.
+ *
+ * @return {string} The hex string.
+ *
+ * @static
+ *
+ * @example
+ *
+ * var hexString = CryptoJS.enc.Hex.stringify(wordArray);
+ */
+ stringify: function (wordArray) {
+ // Shortcuts
+ var words = wordArray.words;
+ var sigBytes = wordArray.sigBytes;
+
+ // Convert
+ var hexChars = [];
+ for (var i = 0; i < sigBytes; i++) {
+ var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
+ hexChars.push((bite >>> 4).toString(16));
+ hexChars.push((bite & 0x0f).toString(16));
+ }
+
+ return hexChars.join('');
+ },
+
+ /**
+ * Converts a hex string to a word array.
+ *
+ * @param {string} hexStr The hex string.
+ *
+ * @return {WordArray} The word array.
+ *
+ * @static
+ *
+ * @example
+ *
+ * var wordArray = CryptoJS.enc.Hex.parse(hexString);
+ */
+ parse: function (hexStr) {
+ // Shortcut
+ var hexStrLength = hexStr.length;
+
+ // Convert
+ var words = [];
+ for (var i = 0; i < hexStrLength; i += 2) {
+ words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << (24 - (i % 8) * 4);
+ }
+
+ return new WordArray.init(words, hexStrLength / 2);
+ }
+ };
+
+ /**
+ * Latin1 encoding strategy.
+ */
+ var Latin1 = C_enc.Latin1 = {
+ /**
+ * Converts a word array to a Latin1 string.
+ *
+ * @param {WordArray} wordArray The word array.
+ *
+ * @return {string} The Latin1 string.
+ *
+ * @static
+ *
+ * @example
+ *
+ * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);
+ */
+ stringify: function (wordArray) {
+ // Shortcuts
+ var words = wordArray.words;
+ var sigBytes = wordArray.sigBytes;
+
+ // Convert
+ var latin1Chars = [];
+ for (var i = 0; i < sigBytes; i++) {
+ var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
+ latin1Chars.push(String.fromCharCode(bite));
+ }
+
+ return latin1Chars.join('');
+ },
+
+ /**
+ * Converts a Latin1 string to a word array.
+ *
+ * @param {string} latin1Str The Latin1 string.
+ *
+ * @return {WordArray} The word array.
+ *
+ * @static
+ *
+ * @example
+ *
+ * var wordArray = CryptoJS.enc.Latin1.parse(latin1String);
+ */
+ parse: function (latin1Str) {
+ // Shortcut
+ var latin1StrLength = latin1Str.length;
+
+ // Convert
+ var words = [];
+ for (var i = 0; i < latin1StrLength; i++) {
+ words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8);
+ }
+
+ return new WordArray.init(words, latin1StrLength);
+ }
+ };
+
+ /**
+ * UTF-8 encoding strategy.
+ */
+ var Utf8 = C_enc.Utf8 = {
+ /**
+ * Converts a word array to a UTF-8 string.
+ *
+ * @param {WordArray} wordArray The word array.
+ *
+ * @return {string} The UTF-8 string.
+ *
+ * @static
+ *
+ * @example
+ *
+ * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);
+ */
+ stringify: function (wordArray) {
+ try {
+ return decodeURIComponent(escape(Latin1.stringify(wordArray)));
+ } catch (e) {
+ throw new Error('Malformed UTF-8 data');
+ }
+ },
+
+ /**
+ * Converts a UTF-8 string to a word array.
+ *
+ * @param {string} utf8Str The UTF-8 string.
+ *
+ * @return {WordArray} The word array.
+ *
+ * @static
+ *
+ * @example
+ *
+ * var wordArray = CryptoJS.enc.Utf8.parse(utf8String);
+ */
+ parse: function (utf8Str) {
+ return Latin1.parse(unescape(encodeURIComponent(utf8Str)));
+ }
+ };
+
+ /**
+ * Abstract buffered block algorithm template.
+ *
+ * The property blockSize must be implemented in a concrete subtype.
+ *
+ * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0
+ */
+ var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({
+ /**
+ * Resets this block algorithm's data buffer to its initial state.
+ *
+ * @example
+ *
+ * bufferedBlockAlgorithm.reset();
+ */
+ reset: function () {
+ // Initial values
+ this._data = new WordArray.init();
+ this._nDataBytes = 0;
+ },
+
+ /**
+ * Adds new data to this block algorithm's buffer.
+ *
+ * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.
+ *
+ * @example
+ *
+ * bufferedBlockAlgorithm._append('data');
+ * bufferedBlockAlgorithm._append(wordArray);
+ */
+ _append: function (data) {
+ // Convert string to WordArray, else assume WordArray already
+ if (typeof data == 'string') {
+ data = Utf8.parse(data);
+ }
+
+ // Append
+ this._data.concat(data);
+ this._nDataBytes += data.sigBytes;
+ },
+
+ /**
+ * Processes available data blocks.
+ *
+ * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.
+ *
+ * @param {boolean} doFlush Whether all blocks and partial blocks should be processed.
+ *
+ * @return {WordArray} The processed data.
+ *
+ * @example
+ *
+ * var processedData = bufferedBlockAlgorithm._process();
+ * var processedData = bufferedBlockAlgorithm._process(!!'flush');
+ */
+ _process: function (doFlush) {
+ // Shortcuts
+ var data = this._data;
+ var dataWords = data.words;
+ var dataSigBytes = data.sigBytes;
+ var blockSize = this.blockSize;
+ var blockSizeBytes = blockSize * 4;
+
+ // Count blocks ready
+ var nBlocksReady = dataSigBytes / blockSizeBytes;
+ if (doFlush) {
+ // Round up to include partial blocks
+ nBlocksReady = Math.ceil(nBlocksReady);
+ } else {
+ // Round down to include only full blocks,
+ // less the number of blocks that must remain in the buffer
+ nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0);
+ }
+
+ // Count words ready
+ var nWordsReady = nBlocksReady * blockSize;
+
+ // Count bytes ready
+ var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes);
+
+ // Process blocks
+ if (nWordsReady) {
+ for (var offset = 0; offset < nWordsReady; offset += blockSize) {
+ // Perform concrete-algorithm logic
+ this._doProcessBlock(dataWords, offset);
+ }
+
+ // Remove processed words
+ var processedWords = dataWords.splice(0, nWordsReady);
+ data.sigBytes -= nBytesReady;
+ }
+
+ // Return processed words
+ return new WordArray.init(processedWords, nBytesReady);
+ },
+
+ /**
+ * Creates a copy of this object.
+ *
+ * @return {Object} The clone.
+ *
+ * @example
+ *
+ * var clone = bufferedBlockAlgorithm.clone();
+ */
+ clone: function () {
+ var clone = Base.clone.call(this);
+ clone._data = this._data.clone();
+
+ return clone;
+ },
+
+ _minBufferSize: 0
+ });
+
+ /**
+ * Abstract hasher template.
+ *
+ * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits)
+ */
+ var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({
+ /**
+ * Configuration options.
+ */
+ cfg: Base.extend(),
+
+ /**
+ * Initializes a newly created hasher.
+ *
+ * @param {Object} cfg (Optional) The configuration options to use for this hash computation.
+ *
+ * @example
+ *
+ * var hasher = CryptoJS.algo.SHA256.create();
+ */
+ init: function (cfg) {
+ // Apply config defaults
+ this.cfg = this.cfg.extend(cfg);
+
+ // Set initial values
+ this.reset();
+ },
+
+ /**
+ * Resets this hasher to its initial state.
+ *
+ * @example
+ *
+ * hasher.reset();
+ */
+ reset: function () {
+ // Reset data buffer
+ BufferedBlockAlgorithm.reset.call(this);
+
+ // Perform concrete-hasher logic
+ this._doReset();
+ },
+
+ /**
+ * Updates this hasher with a message.
+ *
+ * @param {WordArray|string} messageUpdate The message to append.
+ *
+ * @return {Hasher} This hasher.
+ *
+ * @example
+ *
+ * hasher.update('message');
+ * hasher.update(wordArray);
+ */
+ update: function (messageUpdate) {
+ // Append
+ this._append(messageUpdate);
+
+ // Update the hash
+ this._process();
+
+ // Chainable
+ return this;
+ },
+
+ /**
+ * Finalizes the hash computation.
+ * Note that the finalize operation is effectively a destructive, read-once operation.
+ *
+ * @param {WordArray|string} messageUpdate (Optional) A final message update.
+ *
+ * @return {WordArray} The hash.
+ *
+ * @example
+ *
+ * var hash = hasher.finalize();
+ * var hash = hasher.finalize('message');
+ * var hash = hasher.finalize(wordArray);
+ */
+ finalize: function (messageUpdate) {
+ // Final message update
+ if (messageUpdate) {
+ this._append(messageUpdate);
+ }
+
+ // Perform concrete-hasher logic
+ var hash = this._doFinalize();
+
+ return hash;
+ },
+
+ blockSize: 512/32,
+
+ /**
+ * Creates a shortcut function to a hasher's object interface.
+ *
+ * @param {Hasher} hasher The hasher to create a helper for.
+ *
+ * @return {Function} The shortcut function.
+ *
+ * @static
+ *
+ * @example
+ *
+ * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);
+ */
+ _createHelper: function (hasher) {
+ return function (message, cfg) {
+ return new hasher.init(cfg).finalize(message);
+ };
+ },
+
+ /**
+ * Creates a shortcut function to the HMAC's object interface.
+ *
+ * @param {Hasher} hasher The hasher to use in this HMAC helper.
+ *
+ * @return {Function} The shortcut function.
+ *
+ * @static
+ *
+ * @example
+ *
+ * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);
+ */
+ _createHmacHelper: function (hasher) {
+ return function (message, key) {
+ return new C_algo.HMAC.init(hasher, key).finalize(message);
+ };
+ }
+ });
+
+ /**
+ * Algorithm namespace.
+ */
+ var C_algo = C.algo = {};
+
+ return C;
+ }(Math));
+
+
+ return CryptoJS;
+
+ }));
+
+/***/ },
+/* 235 */
+/***/ function(module, exports, __webpack_require__) {
+
+ ;(function (root, factory) {
+ if (true) {
+ // CommonJS
+ module.exports = exports = factory(__webpack_require__(234));
+ }
+ else if (typeof define === "function" && define.amd) {
+ // AMD
+ define(["./core"], factory);
+ }
+ else {
+ // Global (browser)
+ factory(root.CryptoJS);
+ }
+ }(this, function (CryptoJS) {
+
+ (function (Math) {
+ // Shortcuts
+ var C = CryptoJS;
+ var C_lib = C.lib;
+ var WordArray = C_lib.WordArray;
+ var Hasher = C_lib.Hasher;
+ var C_algo = C.algo;
+
+ // Initialization and round constants tables
+ var H = [];
+ var K = [];
+
+ // Compute constants
+ (function () {
+ function isPrime(n) {
+ var sqrtN = Math.sqrt(n);
+ for (var factor = 2; factor <= sqrtN; factor++) {
+ if (!(n % factor)) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ function getFractionalBits(n) {
+ return ((n - (n | 0)) * 0x100000000) | 0;
+ }
+
+ var n = 2;
+ var nPrime = 0;
+ while (nPrime < 64) {
+ if (isPrime(n)) {
+ if (nPrime < 8) {
+ H[nPrime] = getFractionalBits(Math.pow(n, 1 / 2));
+ }
+ K[nPrime] = getFractionalBits(Math.pow(n, 1 / 3));
+
+ nPrime++;
+ }
+
+ n++;
+ }
+ }());
+
+ // Reusable object
+ var W = [];
+
+ /**
+ * SHA-256 hash algorithm.
+ */
+ var SHA256 = C_algo.SHA256 = Hasher.extend({
+ _doReset: function () {
+ this._hash = new WordArray.init(H.slice(0));
+ },
+
+ _doProcessBlock: function (M, offset) {
+ // Shortcut
+ var H = this._hash.words;
+
+ // Working variables
+ var a = H[0];
+ var b = H[1];
+ var c = H[2];
+ var d = H[3];
+ var e = H[4];
+ var f = H[5];
+ var g = H[6];
+ var h = H[7];
+
+ // Computation
+ for (var i = 0; i < 64; i++) {
+ if (i < 16) {
+ W[i] = M[offset + i] | 0;
+ } else {
+ var gamma0x = W[i - 15];
+ var gamma0 = ((gamma0x << 25) | (gamma0x >>> 7)) ^
+ ((gamma0x << 14) | (gamma0x >>> 18)) ^
+ (gamma0x >>> 3);
+
+ var gamma1x = W[i - 2];
+ var gamma1 = ((gamma1x << 15) | (gamma1x >>> 17)) ^
+ ((gamma1x << 13) | (gamma1x >>> 19)) ^
+ (gamma1x >>> 10);
+
+ W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16];
+ }
+
+ var ch = (e & f) ^ (~e & g);
+ var maj = (a & b) ^ (a & c) ^ (b & c);
+
+ var sigma0 = ((a << 30) | (a >>> 2)) ^ ((a << 19) | (a >>> 13)) ^ ((a << 10) | (a >>> 22));
+ var sigma1 = ((e << 26) | (e >>> 6)) ^ ((e << 21) | (e >>> 11)) ^ ((e << 7) | (e >>> 25));
+
+ var t1 = h + sigma1 + ch + K[i] + W[i];
+ var t2 = sigma0 + maj;
+
+ h = g;
+ g = f;
+ f = e;
+ e = (d + t1) | 0;
+ d = c;
+ c = b;
+ b = a;
+ a = (t1 + t2) | 0;
+ }
+
+ // Intermediate hash value
+ H[0] = (H[0] + a) | 0;
+ H[1] = (H[1] + b) | 0;
+ H[2] = (H[2] + c) | 0;
+ H[3] = (H[3] + d) | 0;
+ H[4] = (H[4] + e) | 0;
+ H[5] = (H[5] + f) | 0;
+ H[6] = (H[6] + g) | 0;
+ H[7] = (H[7] + h) | 0;
+ },
+
+ _doFinalize: function () {
+ // Shortcuts
+ var data = this._data;
+ var dataWords = data.words;
+
+ var nBitsTotal = this._nDataBytes * 8;
+ var nBitsLeft = data.sigBytes * 8;
+
+ // Add padding
+ dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
+ dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000);
+ dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal;
+ data.sigBytes = dataWords.length * 4;
+
+ // Hash final blocks
+ this._process();
+
+ // Return final computed hash
+ return this._hash;
+ },
+
+ clone: function () {
+ var clone = Hasher.clone.call(this);
+ clone._hash = this._hash.clone();
+
+ return clone;
+ }
+ });
+
+ /**
+ * Shortcut function to the hasher's object interface.
+ *
+ * @param {WordArray|string} message The message to hash.
+ *
+ * @return {WordArray} The hash.
+ *
+ * @static
+ *
+ * @example
+ *
+ * var hash = CryptoJS.SHA256('message');
+ * var hash = CryptoJS.SHA256(wordArray);
+ */
+ C.SHA256 = Hasher._createHelper(SHA256);
+
+ /**
+ * Shortcut function to the HMAC's object interface.
+ *
+ * @param {WordArray|string} message The message to hash.
+ * @param {WordArray|string} key The secret key.
+ *
+ * @return {WordArray} The HMAC.
+ *
+ * @static
+ *
+ * @example
+ *
+ * var hmac = CryptoJS.HmacSHA256(message, key);
+ */
+ C.HmacSHA256 = Hasher._createHmacHelper(SHA256);
+ }(Math));
+
+
+ return CryptoJS.SHA256;
+
+ }));
+
+/***/ },
+/* 236 */
+/***/ function(module, exports, __webpack_require__) {
+
+ /* WEBPACK VAR INJECTION */(function(process) {/**
+ * This is the web browser implementation of `debug()`.
+ *
+ * Expose `debug()` as the module.
+ */
+
+ exports = module.exports = __webpack_require__(237);
+ exports.log = log;
+ exports.formatArgs = formatArgs;
+ exports.save = save;
+ exports.load = load;
+ exports.useColors = useColors;
+ exports.storage = 'undefined' != typeof chrome
+ && 'undefined' != typeof chrome.storage
+ ? chrome.storage.local
+ : localstorage();
+
+ /**
+ * Colors.
+ */
+
+ exports.colors = [
+ 'lightseagreen',
+ 'forestgreen',
+ 'goldenrod',
+ 'dodgerblue',
+ 'darkorchid',
+ 'crimson'
+ ];
+
+ /**
+ * Currently only WebKit-based Web Inspectors, Firefox >= v31,
+ * and the Firebug extension (any Firefox version) are known
+ * to support "%c" CSS customizations.
+ *
+ * TODO: add a `localStorage` variable to explicitly enable/disable colors
+ */
+
+ function useColors() {
+ // NB: In an Electron preload script, document will be defined but not fully
+ // initialized. Since we know we're in Chrome, we'll just detect this case
+ // explicitly
+ if (typeof window !== 'undefined' && window && typeof window.process !== 'undefined' && window.process.type === 'renderer') {
+ return true;
+ }
+
+ // is webkit? http://stackoverflow.com/a/16459606/376773
+ // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
+ return (typeof document !== 'undefined' && document && 'WebkitAppearance' in document.documentElement.style) ||
+ // is firebug? http://stackoverflow.com/a/398120/376773
+ (typeof window !== 'undefined' && window && window.console && (console.firebug || (console.exception && console.table))) ||
+ // is firefox >= v31?
+ // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
+ (typeof navigator !== 'undefined' && navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
+ // double check webkit in userAgent just in case we are in a worker
+ (typeof navigator !== 'undefined' && navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
+ }
+
+ /**
+ * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
+ */
+
+ exports.formatters.j = function(v) {
+ try {
+ return JSON.stringify(v);
+ } catch (err) {
+ return '[UnexpectedJSONParseError]: ' + err.message;
+ }
+ };
+
+
+ /**
+ * Colorize log arguments if enabled.
+ *
+ * @api public
+ */
+
+ function formatArgs(args) {
+ var useColors = this.useColors;
+
+ args[0] = (useColors ? '%c' : '')
+ + this.namespace
+ + (useColors ? ' %c' : ' ')
+ + args[0]
+ + (useColors ? '%c ' : ' ')
+ + '+' + exports.humanize(this.diff);
+
+ if (!useColors) return;
+
+ var c = 'color: ' + this.color;
+ args.splice(1, 0, c, 'color: inherit')
+
+ // the final "%c" is somewhat tricky, because there could be other
+ // arguments passed either before or after the %c, so we need to
+ // figure out the correct index to insert the CSS into
+ var index = 0;
+ var lastC = 0;
+ args[0].replace(/%[a-zA-Z%]/g, function(match) {
+ if ('%%' === match) return;
+ index++;
+ if ('%c' === match) {
+ // we only are interested in the *last* %c
+ // (the user may have provided their own)
+ lastC = index;
+ }
+ });
+
+ args.splice(lastC, 0, c);
+ }
+
+ /**
+ * Invokes `console.log()` when available.
+ * No-op when `console.log` is not a "function".
+ *
+ * @api public
+ */
+
+ function log() {
+ // this hackery is required for IE8/9, where
+ // the `console.log` function doesn't have 'apply'
+ return 'object' === typeof console
+ && console.log
+ && Function.prototype.apply.call(console.log, console, arguments);
+ }
+
+ /**
+ * Save `namespaces`.
+ *
+ * @param {String} namespaces
+ * @api private
+ */
+
+ function save(namespaces) {
+ try {
+ if (null == namespaces) {
+ exports.storage.removeItem('debug');
+ } else {
+ exports.storage.debug = namespaces;
+ }
+ } catch(e) {}
+ }
+
+ /**
+ * Load `namespaces`.
+ *
+ * @return {String} returns the previously persisted debug modes
+ * @api private
+ */
+
+ function load() {
+ try {
+ return exports.storage.debug;
+ } catch(e) {}
+
+ // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
+ if (typeof process !== 'undefined' && 'env' in process) {
+ return ({"NODE_ENV":"production"}).DEBUG;
+ }
+ }
+
+ /**
+ * Enable namespaces listed in `localStorage.debug` initially.
+ */
+
+ exports.enable(load());
+
+ /**
+ * Localstorage attempts to return the localstorage.
+ *
+ * This is necessary because safari throws
+ * when a user disables cookies/localstorage
+ * and you attempt to access it.
+ *
+ * @return {LocalStorage}
+ * @api private
+ */
+
+ function localstorage() {
+ try {
+ return window.localStorage;
+ } catch (e) {}
+ }
+
+ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(45)))
+
+/***/ },
+/* 237 */
+/***/ function(module, exports, __webpack_require__) {
+
+
+ /**
+ * This is the common logic for both the Node.js and web browser
+ * implementations of `debug()`.
+ *
+ * Expose `debug()` as the module.
+ */
+
+ exports = module.exports = createDebug.debug = createDebug.default = createDebug;
+ exports.coerce = coerce;
+ exports.disable = disable;
+ exports.enable = enable;
+ exports.enabled = enabled;
+ exports.humanize = __webpack_require__(246);
+
+ /**
+ * The currently active debug mode names, and names to skip.
+ */
+
+ exports.names = [];
+ exports.skips = [];
+
+ /**
+ * Map of special "%n" handling functions, for the debug "format" argument.
+ *
+ * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
+ */
+
+ exports.formatters = {};
+
+ /**
+ * Previous log timestamp.
+ */
+
+ var prevTime;
+
+ /**
+ * Select a color.
+ * @param {String} namespace
+ * @return {Number}
+ * @api private
+ */
+
+ function selectColor(namespace) {
+ var hash = 0, i;
+
+ for (i in namespace) {
+ hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
+ hash |= 0; // Convert to 32bit integer
+ }
+
+ return exports.colors[Math.abs(hash) % exports.colors.length];
+ }
+
+ /**
+ * Create a debugger with the given `namespace`.
+ *
+ * @param {String} namespace
+ * @return {Function}
+ * @api public
+ */
+
+ function createDebug(namespace) {
+
+ function debug() {
+ // disabled?
+ if (!debug.enabled) return;
+
+ var self = debug;
+
+ // set `diff` timestamp
+ var curr = +new Date();
+ var ms = curr - (prevTime || curr);
+ self.diff = ms;
+ self.prev = prevTime;
+ self.curr = curr;
+ prevTime = curr;
+
+ // turn the `arguments` into a proper Array
+ var args = new Array(arguments.length);
+ for (var i = 0; i < args.length; i++) {
+ args[i] = arguments[i];
+ }
+
+ args[0] = exports.coerce(args[0]);
+
+ if ('string' !== typeof args[0]) {
+ // anything else let's inspect with %O
+ args.unshift('%O');
+ }
+
+ // apply any `formatters` transformations
+ var index = 0;
+ args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {
+ // if we encounter an escaped % then don't increase the array index
+ if (match === '%%') return match;
+ index++;
+ var formatter = exports.formatters[format];
+ if ('function' === typeof formatter) {
+ var val = args[index];
+ match = formatter.call(self, val);
+
+ // now we need to remove `args[index]` since it's inlined in the `format`
+ args.splice(index, 1);
+ index--;
+ }
+ return match;
+ });
+
+ // apply env-specific formatting (colors, etc.)
+ exports.formatArgs.call(self, args);
+
+ var logFn = debug.log || exports.log || console.log.bind(console);
+ logFn.apply(self, args);
+ }
+
+ debug.namespace = namespace;
+ debug.enabled = exports.enabled(namespace);
+ debug.useColors = exports.useColors();
+ debug.color = selectColor(namespace);
+
+ // env-specific initialization logic for debug instances
+ if ('function' === typeof exports.init) {
+ exports.init(debug);
+ }
+
+ return debug;
+ }
+
+ /**
+ * Enables a debug mode by namespaces. This can include modes
+ * separated by a colon and wildcards.
+ *
+ * @param {String} namespaces
+ * @api public
+ */
+
+ function enable(namespaces) {
+ exports.save(namespaces);
+
+ var split = (namespaces || '').split(/[\s,]+/);
+ var len = split.length;
+
+ for (var i = 0; i < len; i++) {
+ if (!split[i]) continue; // ignore empty strings
+ namespaces = split[i].replace(/\*/g, '.*?');
+ if (namespaces[0] === '-') {
+ exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
+ } else {
+ exports.names.push(new RegExp('^' + namespaces + '$'));
+ }
+ }
+ }
+
+ /**
+ * Disable debug output.
+ *
+ * @api public
+ */
+
+ function disable() {
+ exports.enable('');
+ }
+
+ /**
+ * Returns true if the given mode name is enabled, false otherwise.
+ *
+ * @param {String} name
+ * @return {Boolean}
+ * @api public
+ */
+
+ function enabled(name) {
+ var i, len;
+ for (i = 0, len = exports.skips.length; i < len; i++) {
+ if (exports.skips[i].test(name)) {
+ return false;
+ }
+ }
+ for (i = 0, len = exports.names.length; i < len; i++) {
+ if (exports.names[i].test(name)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Coerce `val`.
+ *
+ * @param {Mixed} val
+ * @return {Mixed}
+ * @api private
+ */
+
+ function coerce(val) {
+ if (val instanceof Error) return val.stack || val.message;
+ return val;
+ }
+
+
+/***/ },
+/* 238 */
+/***/ function(module, exports) {
+
+ // Copyright Joyent, Inc. and other Node contributors.
+ //
+ // Permission is hereby granted, free of charge, to any person obtaining a
+ // copy of this software and associated documentation files (the
+ // "Software"), to deal in the Software without restriction, including
+ // without limitation the rights to use, copy, modify, merge, publish,
+ // distribute, sublicense, and/or sell copies of the Software, and to permit
+ // persons to whom the Software is furnished to do so, subject to the
+ // following conditions:
+ //
+ // The above copyright notice and this permission notice shall be included
+ // in all copies or substantial portions of the Software.
+ //
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+ // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ // USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+ function EventEmitter() {
+ this._events = this._events || {};
+ this._maxListeners = this._maxListeners || undefined;
+ }
+ module.exports = EventEmitter;
+
+ // Backwards-compat with node 0.10.x
+ EventEmitter.EventEmitter = EventEmitter;
+
+ EventEmitter.prototype._events = undefined;
+ EventEmitter.prototype._maxListeners = undefined;
+
+ // By default EventEmitters will print a warning if more than 10 listeners are
+ // added to it. This is a useful default which helps finding memory leaks.
+ EventEmitter.defaultMaxListeners = 10;
+
+ // Obviously not all Emitters should be limited to 10. This function allows
+ // that to be increased. Set to zero for unlimited.
+ EventEmitter.prototype.setMaxListeners = function(n) {
+ if (!isNumber(n) || n < 0 || isNaN(n))
+ throw TypeError('n must be a positive number');
+ this._maxListeners = n;
+ return this;
+ };
+
+ EventEmitter.prototype.emit = function(type) {
+ var er, handler, len, args, i, listeners;
+
+ if (!this._events)
+ this._events = {};
+
+ // If there is no 'error' event listener then throw.
+ if (type === 'error') {
+ if (!this._events.error ||
+ (isObject(this._events.error) && !this._events.error.length)) {
+ er = arguments[1];
+ if (er instanceof Error) {
+ throw er; // Unhandled 'error' event
+ } else {
+ // At least give some kind of context to the user
+ var err = new Error('Uncaught, unspecified "error" event. (' + er + ')');
+ err.context = er;
+ throw err;
+ }
+ }
+ }
+
+ handler = this._events[type];
+
+ if (isUndefined(handler))
+ return false;
+
+ if (isFunction(handler)) {
+ switch (arguments.length) {
+ // fast cases
+ case 1:
+ handler.call(this);
+ break;
+ case 2:
+ handler.call(this, arguments[1]);
+ break;
+ case 3:
+ handler.call(this, arguments[1], arguments[2]);
+ break;
+ // slower
+ default:
+ args = Array.prototype.slice.call(arguments, 1);
+ handler.apply(this, args);
+ }
+ } else if (isObject(handler)) {
+ args = Array.prototype.slice.call(arguments, 1);
+ listeners = handler.slice();
+ len = listeners.length;
+ for (i = 0; i < len; i++)
+ listeners[i].apply(this, args);
+ }
+
+ return true;
+ };
+
+ EventEmitter.prototype.addListener = function(type, listener) {
+ var m;
+
+ if (!isFunction(listener))
+ throw TypeError('listener must be a function');
+
+ if (!this._events)
+ this._events = {};
+
+ // To avoid recursion in the case that type === "newListener"! Before
+ // adding it to the listeners, first emit "newListener".
+ if (this._events.newListener)
+ this.emit('newListener', type,
+ isFunction(listener.listener) ?
+ listener.listener : listener);
+
+ if (!this._events[type])
+ // Optimize the case of one listener. Don't need the extra array object.
+ this._events[type] = listener;
+ else if (isObject(this._events[type]))
+ // If we've already got an array, just append.
+ this._events[type].push(listener);
+ else
+ // Adding the second element, need to change to array.
+ this._events[type] = [this._events[type], listener];
+
+ // Check for listener leak
+ if (isObject(this._events[type]) && !this._events[type].warned) {
+ if (!isUndefined(this._maxListeners)) {
+ m = this._maxListeners;
+ } else {
+ m = EventEmitter.defaultMaxListeners;
+ }
+
+ if (m && m > 0 && this._events[type].length > m) {
+ this._events[type].warned = true;
+ console.error('(node) warning: possible EventEmitter memory ' +
+ 'leak detected. %d listeners added. ' +
+ 'Use emitter.setMaxListeners() to increase limit.',
+ this._events[type].length);
+ if (typeof console.trace === 'function') {
+ // not supported in IE 10
+ console.trace();
+ }
+ }
+ }
+
+ return this;
+ };
+
+ EventEmitter.prototype.on = EventEmitter.prototype.addListener;
+
+ EventEmitter.prototype.once = function(type, listener) {
+ if (!isFunction(listener))
+ throw TypeError('listener must be a function');
+
+ var fired = false;
+
+ function g() {
+ this.removeListener(type, g);
+
+ if (!fired) {
+ fired = true;
+ listener.apply(this, arguments);
+ }
+ }
+
+ g.listener = listener;
+ this.on(type, g);
+
+ return this;
+ };
+
+ // emits a 'removeListener' event iff the listener was removed
+ EventEmitter.prototype.removeListener = function(type, listener) {
+ var list, position, length, i;
+
+ if (!isFunction(listener))
+ throw TypeError('listener must be a function');
+
+ if (!this._events || !this._events[type])
+ return this;
+
+ list = this._events[type];
+ length = list.length;
+ position = -1;
+
+ if (list === listener ||
+ (isFunction(list.listener) && list.listener === listener)) {
+ delete this._events[type];
+ if (this._events.removeListener)
+ this.emit('removeListener', type, listener);
+
+ } else if (isObject(list)) {
+ for (i = length; i-- > 0;) {
+ if (list[i] === listener ||
+ (list[i].listener && list[i].listener === listener)) {
+ position = i;
+ break;
+ }
+ }
+
+ if (position < 0)
+ return this;
+
+ if (list.length === 1) {
+ list.length = 0;
+ delete this._events[type];
+ } else {
+ list.splice(position, 1);
+ }
+
+ if (this._events.removeListener)
+ this.emit('removeListener', type, listener);
+ }
+
+ return this;
+ };
+
+ EventEmitter.prototype.removeAllListeners = function(type) {
+ var key, listeners;
+
+ if (!this._events)
+ return this;
+
+ // not listening for removeListener, no need to emit
+ if (!this._events.removeListener) {
+ if (arguments.length === 0)
+ this._events = {};
+ else if (this._events[type])
+ delete this._events[type];
+ return this;
+ }
+
+ // emit removeListener for all listeners on all events
+ if (arguments.length === 0) {
+ for (key in this._events) {
+ if (key === 'removeListener') continue;
+ this.removeAllListeners(key);
+ }
+ this.removeAllListeners('removeListener');
+ this._events = {};
+ return this;
+ }
+
+ listeners = this._events[type];
+
+ if (isFunction(listeners)) {
+ this.removeListener(type, listeners);
+ } else if (listeners) {
+ // LIFO order
+ while (listeners.length)
+ this.removeListener(type, listeners[listeners.length - 1]);
+ }
+ delete this._events[type];
+
+ return this;
+ };
+
+ EventEmitter.prototype.listeners = function(type) {
+ var ret;
+ if (!this._events || !this._events[type])
+ ret = [];
+ else if (isFunction(this._events[type]))
+ ret = [this._events[type]];
+ else
+ ret = this._events[type].slice();
+ return ret;
+ };
+
+ EventEmitter.prototype.listenerCount = function(type) {
+ if (this._events) {
+ var evlistener = this._events[type];
+
+ if (isFunction(evlistener))
+ return 1;
+ else if (evlistener)
+ return evlistener.length;
+ }
+ return 0;
+ };
+
+ EventEmitter.listenerCount = function(emitter, type) {
+ return emitter.listenerCount(type);
+ };
+
+ function isFunction(arg) {
+ return typeof arg === 'function';
+ }
+
+ function isNumber(arg) {
+ return typeof arg === 'number';
+ }
+
+ function isObject(arg) {
+ return typeof arg === 'object' && arg !== null;
+ }
+
+ function isUndefined(arg) {
+ return arg === void 0;
+ }
+
+
+/***/ },
+/* 239 */
+/***/ function(module, exports, __webpack_require__) {
+
+ /**
+ * 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.
+ *
+ * @providesModule invariant
+ */
+
+ 'use strict';
+
+ /**
+ * Use invariant() to assert state which your program assumes to be true.
+ *
+ * Provide sprintf-style format (only %s is supported) and arguments
+ * to provide information about what broke and what you were
+ * expecting.
+ *
+ * The invariant message will be stripped in production, but the invariant
+ * will remain to ensure logic does not differ in production.
+ */
+
+ var invariant = function (condition, format, a, b, c, d, e, f) {
+ if (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('Invariant Violation: ' + format.replace(/%s/g, function () {
+ return args[argIndex++];
+ }));
+ }
+
+ error.framesToPop = 1; // we don't care about invariant's own frame
+ throw error;
+ }
+ };
+
+ module.exports = invariant;
+
+/***/ },
+/* 240 */
+/***/ function(module, exports) {
+
+ function DummyCache() {}
+
+ DummyCache.prototype.get = function (key) {
+ return null;
+ };
+
+ DummyCache.prototype.has = function (key) {
+ return false;
+ };
+
+ DummyCache.prototype.set = function (key, value) {
+ };
+
+ module.exports = DummyCache;
+
+
+/***/ },
+/* 241 */
+/***/ function(module, exports) {
+
+ function ConfigurationError(message) {
+ this.name = 'ConfigurationError';
+ this.message = (message || '');
+ }
+ ConfigurationError.prototype = Error.prototype;
+
+ function TokenValidationError(message) {
+ this.name = 'TokenValidationError';
+ this.message = (message || '');
+ }
+ TokenValidationError.prototype = Error.prototype;
+
+ module.exports = {
+ ConfigurationError: ConfigurationError,
+ TokenValidationError: TokenValidationError
+ };
+
+
+/***/ },
+/* 242 */
+/***/ function(module, exports, __webpack_require__) {
+
+ var urljoin = __webpack_require__(20);
+ var base64 = __webpack_require__(125);
+ var request = __webpack_require__(99);
+
+ function process(jwks) {
+ var modulus = base64.decodeToHEX(jwks.n);
+ var exp = base64.decodeToHEX(jwks.e);
+
+ return {
+ modulus: modulus,
+ exp: exp
+ };
+ }
+
+ function getJWKS(options, cb) {
+ var url = urljoin(options.iss, '.well-known', 'jwks.json');
+
+ return request
+ .get(url)
+ .end(function (err, data) {
+ if (err) {
+ cb(err);
+ }
+
+ var matchingKey = null;
+
+ for (var a = 0; a < data.body.keys.length && matchingKey === null; a ++) {
+ var key = data.body.keys[a];
+ if (key.kid === options.kid) {
+ matchingKey = key;
+ }
+ }
+
+ cb(null, process(matchingKey));
+ });
+ }
+
+ module.exports = {
+ process: process,
+ getJWKS: getJWKS
+ };
+
+
+/***/ },
+/* 243 */
+/***/ function(module, exports, __webpack_require__) {
+
+ /*
+ Based on the work of Tom Wu
+ http://www-cs-students.stanford.edu/~tjw/jsbn/
+ http://www-cs-students.stanford.edu/~tjw/jsbn/LICENSE
+ */
+
+ var BigInteger = __webpack_require__(244).BigInteger;
+ var SHA256 = __webpack_require__(235);
+
+ var DigestInfoHead = {
+ sha1: '3021300906052b0e03021a05000414',
+ sha224: '302d300d06096086480165030402040500041c',
+ sha256: '3031300d060960864801650304020105000420',
+ sha384: '3041300d060960864801650304020205000430',
+ sha512: '3051300d060960864801650304020305000440',
+ md2: '3020300c06082a864886f70d020205000410',
+ md5: '3020300c06082a864886f70d020505000410',
+ ripemd160: '3021300906052b2403020105000414'
+ };
+
+ var DigestAlgs = {
+ sha256: SHA256
+ };
+
+ function RSAVerifier(modulus, exp) {
+ this.n = null;
+ this.e = 0;
+
+ if (modulus != null && exp != null && modulus.length > 0 && exp.length > 0) {
+ this.n = new BigInteger(modulus, 16);
+ this.e = parseInt(exp, 16);
+ } else {
+ throw new Error('Invalid key data');
+ }
+ }
+
+ function getAlgorithmFromDigest(hDigestInfo) {
+ for (var algName in DigestInfoHead) {
+ var head = DigestInfoHead[algName];
+ var len = head.length;
+
+ if (hDigestInfo.substring(0, len) === head) {
+ return {
+ alg: algName,
+ hash: hDigestInfo.substring(len)
+ };
+ }
+ }
+ return [];
+ }
+
+
+ RSAVerifier.prototype.verify = function (msg, encsig) {
+ encsig = encsig.replace(/[^0-9a-f]|[\s\n]]/ig, '');
+
+ var sig = new BigInteger(encsig, 16);
+ if (sig.bitLength() > this.n.bitLength()) {
+ throw new Error('Signature does not match with the key modulus.');
+ }
+
+ var decryptedSig = sig.modPowInt(this.e, this.n);
+ var digest = decryptedSig.toString(16).replace(/^1f+00/, '');
+
+ var digestInfo = getAlgorithmFromDigest(digest);
+ if (digestInfo.length === 0) {
+ return false;
+ }
+
+ if (!DigestAlgs.hasOwnProperty(digestInfo.alg)) {
+ throw new Error('Hashing algorithm is not supported.');
+ }
+
+ var msgHash = DigestAlgs[digestInfo.alg](msg).toString();
+ return (digestInfo.hash === msgHash);
+ };
+
+ module.exports = RSAVerifier;
+
+
+/***/ },
+/* 244 */
+/***/ function(module, exports, __webpack_require__) {
+
+ (function(){
+
+ // Copyright (c) 2005 Tom Wu
+ // All Rights Reserved.
+ // See "LICENSE" for details.
+
+ // Basic JavaScript BN library - subset useful for RSA encryption.
+
+ // Bits per digit
+ var dbits;
+
+ // JavaScript engine analysis
+ var canary = 0xdeadbeefcafe;
+ var j_lm = ((canary&0xffffff)==0xefcafe);
+
+ // (public) Constructor
+ function BigInteger(a,b,c) {
+ if(a != null)
+ if("number" == typeof a) this.fromNumber(a,b,c);
+ else if(b == null && "string" != typeof a) this.fromString(a,256);
+ else this.fromString(a,b);
+ }
+
+ // return new, unset BigInteger
+ function nbi() { return new BigInteger(null); }
+
+ // am: Compute w_j += (x*this_i), propagate carries,
+ // c is initial carry, returns final carry.
+ // c < 3*dvalue, x < 2*dvalue, this_i < dvalue
+ // We need to select the fastest one that works in this environment.
+
+ // am1: use a single mult and divide to get the high bits,
+ // max digit bits should be 26 because
+ // max internal value = 2*dvalue^2-2*dvalue (< 2^53)
+ function am1(i,x,w,j,c,n) {
+ while(--n >= 0) {
+ var v = x*this[i++]+w[j]+c;
+ c = Math.floor(v/0x4000000);
+ w[j++] = v&0x3ffffff;
+ }
+ return c;
+ }
+ // am2 avoids a big mult-and-extract completely.
+ // Max digit bits should be <= 30 because we do bitwise ops
+ // on values up to 2*hdvalue^2-hdvalue-1 (< 2^31)
+ function am2(i,x,w,j,c,n) {
+ var xl = x&0x7fff, xh = x>>15;
+ while(--n >= 0) {
+ var l = this[i]&0x7fff;
+ var h = this[i++]>>15;
+ var m = xh*l+h*xl;
+ l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff);
+ c = (l>>>30)+(m>>>15)+xh*h+(c>>>30);
+ w[j++] = l&0x3fffffff;
+ }
+ return c;
+ }
+ // Alternately, set max digit bits to 28 since some
+ // browsers slow down when dealing with 32-bit numbers.
+ function am3(i,x,w,j,c,n) {
+ var xl = x&0x3fff, xh = x>>14;
+ while(--n >= 0) {
+ var l = this[i]&0x3fff;
+ var h = this[i++]>>14;
+ var m = xh*l+h*xl;
+ l = xl*l+((m&0x3fff)<<14)+w[j]+c;
+ c = (l>>28)+(m>>14)+xh*h;
+ w[j++] = l&0xfffffff;
+ }
+ return c;
+ }
+ var inBrowser = typeof navigator !== "undefined";
+ if(inBrowser && j_lm && (navigator.appName == "Microsoft Internet Explorer")) {
+ BigInteger.prototype.am = am2;
+ dbits = 30;
+ }
+ else if(inBrowser && j_lm && (navigator.appName != "Netscape")) {
+ BigInteger.prototype.am = am1;
+ dbits = 26;
+ }
+ else { // Mozilla/Netscape seems to prefer am3
+ BigInteger.prototype.am = am3;
+ dbits = 28;
+ }
+
+ BigInteger.prototype.DB = dbits;
+ BigInteger.prototype.DM = ((1<
= 0; --i) r[i] = this[i];
+ r.t = this.t;
+ r.s = this.s;
+ }
+
+ // (protected) set from integer value x, -DV <= x < DV
+ function bnpFromInt(x) {
+ this.t = 1;
+ this.s = (x<0)?-1:0;
+ if(x > 0) this[0] = x;
+ else if(x < -1) this[0] = x+this.DV;
+ else this.t = 0;
+ }
+
+ // return bigint initialized to value
+ function nbv(i) { var r = nbi(); r.fromInt(i); return r; }
+
+ // (protected) set from string and radix
+ function bnpFromString(s,b) {
+ var k;
+ if(b == 16) k = 4;
+ else if(b == 8) k = 3;
+ else if(b == 256) k = 8; // byte array
+ else if(b == 2) k = 1;
+ else if(b == 32) k = 5;
+ else if(b == 4) k = 2;
+ else { this.fromRadix(s,b); return; }
+ this.t = 0;
+ this.s = 0;
+ var i = s.length, mi = false, sh = 0;
+ while(--i >= 0) {
+ var x = (k==8)?s[i]&0xff:intAt(s,i);
+ if(x < 0) {
+ if(s.charAt(i) == "-") mi = true;
+ continue;
+ }
+ mi = false;
+ if(sh == 0)
+ this[this.t++] = x;
+ else if(sh+k > this.DB) {
+ this[this.t-1] |= (x&((1<<(this.DB-sh))-1))<>(this.DB-sh));
+ }
+ else
+ this[this.t-1] |= x<= this.DB) sh -= this.DB;
+ }
+ if(k == 8 && (s[0]&0x80) != 0) {
+ this.s = -1;
+ if(sh > 0) this[this.t-1] |= ((1<<(this.DB-sh))-1)< 0 && this[this.t-1] == c) --this.t;
+ }
+
+ // (public) return string representation in given radix
+ function bnToString(b) {
+ if(this.s < 0) return "-"+this.negate().toString(b);
+ var k;
+ if(b == 16) k = 4;
+ else if(b == 8) k = 3;
+ else if(b == 2) k = 1;
+ else if(b == 32) k = 5;
+ else if(b == 4) k = 2;
+ else return this.toRadix(b);
+ var km = (1< 0) {
+ if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }
+ while(i >= 0) {
+ if(p < k) {
+ d = (this[i]&((1<>(p+=this.DB-k);
+ }
+ else {
+ d = (this[i]>>(p-=k))&km;
+ if(p <= 0) { p += this.DB; --i; }
+ }
+ if(d > 0) m = true;
+ if(m) r += int2char(d);
+ }
+ }
+ return m?r:"0";
+ }
+
+ // (public) -this
+ function bnNegate() { var r = nbi(); BigInteger.ZERO.subTo(this,r); return r; }
+
+ // (public) |this|
+ function bnAbs() { return (this.s<0)?this.negate():this; }
+
+ // (public) return + if this > a, - if this < a, 0 if equal
+ function bnCompareTo(a) {
+ var r = this.s-a.s;
+ if(r != 0) return r;
+ var i = this.t;
+ r = i-a.t;
+ if(r != 0) return (this.s<0)?-r:r;
+ while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;
+ return 0;
+ }
+
+ // returns bit length of the integer x
+ function nbits(x) {
+ var r = 1, t;
+ if((t=x>>>16) != 0) { x = t; r += 16; }
+ if((t=x>>8) != 0) { x = t; r += 8; }
+ if((t=x>>4) != 0) { x = t; r += 4; }
+ if((t=x>>2) != 0) { x = t; r += 2; }
+ if((t=x>>1) != 0) { x = t; r += 1; }
+ return r;
+ }
+
+ // (public) return the number of bits in "this"
+ function bnBitLength() {
+ if(this.t <= 0) return 0;
+ return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));
+ }
+
+ // (protected) r = this << n*DB
+ function bnpDLShiftTo(n,r) {
+ var i;
+ for(i = this.t-1; i >= 0; --i) r[i+n] = this[i];
+ for(i = n-1; i >= 0; --i) r[i] = 0;
+ r.t = this.t+n;
+ r.s = this.s;
+ }
+
+ // (protected) r = this >> n*DB
+ function bnpDRShiftTo(n,r) {
+ for(var i = n; i < this.t; ++i) r[i-n] = this[i];
+ r.t = Math.max(this.t-n,0);
+ r.s = this.s;
+ }
+
+ // (protected) r = this << n
+ function bnpLShiftTo(n,r) {
+ var bs = n%this.DB;
+ var cbs = this.DB-bs;
+ var bm = (1<= 0; --i) {
+ r[i+ds+1] = (this[i]>>cbs)|c;
+ c = (this[i]&bm)<= 0; --i) r[i] = 0;
+ r[ds] = c;
+ r.t = this.t+ds+1;
+ r.s = this.s;
+ r.clamp();
+ }
+
+ // (protected) r = this >> n
+ function bnpRShiftTo(n,r) {
+ r.s = this.s;
+ var ds = Math.floor(n/this.DB);
+ if(ds >= this.t) { r.t = 0; return; }
+ var bs = n%this.DB;
+ var cbs = this.DB-bs;
+ var bm = (1<>bs;
+ for(var i = ds+1; i < this.t; ++i) {
+ r[i-ds-1] |= (this[i]&bm)<>bs;
+ }
+ if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<>= this.DB;
+ }
+ if(a.t < this.t) {
+ c -= a.s;
+ while(i < this.t) {
+ c += this[i];
+ r[i++] = c&this.DM;
+ c >>= this.DB;
+ }
+ c += this.s;
+ }
+ else {
+ c += this.s;
+ while(i < a.t) {
+ c -= a[i];
+ r[i++] = c&this.DM;
+ c >>= this.DB;
+ }
+ c -= a.s;
+ }
+ r.s = (c<0)?-1:0;
+ if(c < -1) r[i++] = this.DV+c;
+ else if(c > 0) r[i++] = c;
+ r.t = i;
+ r.clamp();
+ }
+
+ // (protected) r = this * a, r != this,a (HAC 14.12)
+ // "this" should be the larger one if appropriate.
+ function bnpMultiplyTo(a,r) {
+ var x = this.abs(), y = a.abs();
+ var i = x.t;
+ r.t = i+y.t;
+ while(--i >= 0) r[i] = 0;
+ for(i = 0; i < y.t; ++i) r[i+x.t] = x.am(0,y[i],r,i,0,x.t);
+ r.s = 0;
+ r.clamp();
+ if(this.s != a.s) BigInteger.ZERO.subTo(r,r);
+ }
+
+ // (protected) r = this^2, r != this (HAC 14.16)
+ function bnpSquareTo(r) {
+ var x = this.abs();
+ var i = r.t = 2*x.t;
+ while(--i >= 0) r[i] = 0;
+ for(i = 0; i < x.t-1; ++i) {
+ var c = x.am(i,x[i],r,2*i,0,1);
+ if((r[i+x.t]+=x.am(i+1,2*x[i],r,2*i+1,c,x.t-i-1)) >= x.DV) {
+ r[i+x.t] -= x.DV;
+ r[i+x.t+1] = 1;
+ }
+ }
+ if(r.t > 0) r[r.t-1] += x.am(i,x[i],r,2*i,0,1);
+ r.s = 0;
+ r.clamp();
+ }
+
+ // (protected) divide this by m, quotient and remainder to q, r (HAC 14.20)
+ // r != q, this != m. q or r may be null.
+ function bnpDivRemTo(m,q,r) {
+ var pm = m.abs();
+ if(pm.t <= 0) return;
+ var pt = this.abs();
+ if(pt.t < pm.t) {
+ if(q != null) q.fromInt(0);
+ if(r != null) this.copyTo(r);
+ return;
+ }
+ if(r == null) r = nbi();
+ var y = nbi(), ts = this.s, ms = m.s;
+ var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus
+ if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }
+ else { pm.copyTo(y); pt.copyTo(r); }
+ var ys = y.t;
+ var y0 = y[ys-1];
+ if(y0 == 0) return;
+ var yt = y0*(1<1)?y[ys-2]>>this.F2:0);
+ var d1 = this.FV/yt, d2 = (1<= 0) {
+ r[r.t++] = 1;
+ r.subTo(t,r);
+ }
+ BigInteger.ONE.dlShiftTo(ys,t);
+ t.subTo(y,y); // "negative" y so we can replace sub with am later
+ while(y.t < ys) y[y.t++] = 0;
+ while(--j >= 0) {
+ // Estimate quotient digit
+ var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);
+ if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out
+ y.dlShiftTo(j,t);
+ r.subTo(t,r);
+ while(r[i] < --qd) r.subTo(t,r);
+ }
+ }
+ if(q != null) {
+ r.drShiftTo(ys,q);
+ if(ts != ms) BigInteger.ZERO.subTo(q,q);
+ }
+ r.t = ys;
+ r.clamp();
+ if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder
+ if(ts < 0) BigInteger.ZERO.subTo(r,r);
+ }
+
+ // (public) this mod a
+ function bnMod(a) {
+ var r = nbi();
+ this.abs().divRemTo(a,null,r);
+ if(this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r,r);
+ return r;
+ }
+
+ // Modular reduction using "classic" algorithm
+ function Classic(m) { this.m = m; }
+ function cConvert(x) {
+ if(x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m);
+ else return x;
+ }
+ function cRevert(x) { return x; }
+ function cReduce(x) { x.divRemTo(this.m,null,x); }
+ function cMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }
+ function cSqrTo(x,r) { x.squareTo(r); this.reduce(r); }
+
+ Classic.prototype.convert = cConvert;
+ Classic.prototype.revert = cRevert;
+ Classic.prototype.reduce = cReduce;
+ Classic.prototype.mulTo = cMulTo;
+ Classic.prototype.sqrTo = cSqrTo;
+
+ // (protected) return "-1/this % 2^DB"; useful for Mont. reduction
+ // justification:
+ // xy == 1 (mod m)
+ // xy = 1+km
+ // xy(2-xy) = (1+km)(1-km)
+ // x[y(2-xy)] = 1-k^2m^2
+ // x[y(2-xy)] == 1 (mod m^2)
+ // if y is 1/x mod m, then y(2-xy) is 1/x mod m^2
+ // should reduce x and y(2-xy) by m^2 at each step to keep size bounded.
+ // JS multiply "overflows" differently from C/C++, so care is needed here.
+ function bnpInvDigit() {
+ if(this.t < 1) return 0;
+ var x = this[0];
+ if((x&1) == 0) return 0;
+ var y = x&3; // y == 1/x mod 2^2
+ y = (y*(2-(x&0xf)*y))&0xf; // y == 1/x mod 2^4
+ y = (y*(2-(x&0xff)*y))&0xff; // y == 1/x mod 2^8
+ y = (y*(2-(((x&0xffff)*y)&0xffff)))&0xffff; // y == 1/x mod 2^16
+ // last step - calculate inverse mod DV directly;
+ // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints
+ y = (y*(2-x*y%this.DV))%this.DV; // y == 1/x mod 2^dbits
+ // we really want the negative inverse, and -DV < y < DV
+ return (y>0)?this.DV-y:-y;
+ }
+
+ // Montgomery reduction
+ function Montgomery(m) {
+ this.m = m;
+ this.mp = m.invDigit();
+ this.mpl = this.mp&0x7fff;
+ this.mph = this.mp>>15;
+ this.um = (1<<(m.DB-15))-1;
+ this.mt2 = 2*m.t;
+ }
+
+ // xR mod m
+ function montConvert(x) {
+ var r = nbi();
+ x.abs().dlShiftTo(this.m.t,r);
+ r.divRemTo(this.m,null,r);
+ if(x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r,r);
+ return r;
+ }
+
+ // x/R mod m
+ function montRevert(x) {
+ var r = nbi();
+ x.copyTo(r);
+ this.reduce(r);
+ return r;
+ }
+
+ // x = x/R mod m (HAC 14.32)
+ function montReduce(x) {
+ while(x.t <= this.mt2) // pad x so am has enough room later
+ x[x.t++] = 0;
+ for(var i = 0; i < this.m.t; ++i) {
+ // faster way of calculating u0 = x[i]*mp mod DV
+ var j = x[i]&0x7fff;
+ var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;
+ // use am to combine the multiply-shift-add into one call
+ j = i+this.m.t;
+ x[j] += this.m.am(0,u0,x,i,0,this.m.t);
+ // propagate carry
+ while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }
+ }
+ x.clamp();
+ x.drShiftTo(this.m.t,x);
+ if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);
+ }
+
+ // r = "x^2/R mod m"; x != r
+ function montSqrTo(x,r) { x.squareTo(r); this.reduce(r); }
+
+ // r = "xy/R mod m"; x,y != r
+ function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }
+
+ Montgomery.prototype.convert = montConvert;
+ Montgomery.prototype.revert = montRevert;
+ Montgomery.prototype.reduce = montReduce;
+ Montgomery.prototype.mulTo = montMulTo;
+ Montgomery.prototype.sqrTo = montSqrTo;
+
+ // (protected) true iff this is even
+ function bnpIsEven() { return ((this.t>0)?(this[0]&1):this.s) == 0; }
+
+ // (protected) this^e, e < 2^32, doing sqr and mul with "r" (HAC 14.79)
+ function bnpExp(e,z) {
+ if(e > 0xffffffff || e < 1) return BigInteger.ONE;
+ var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e)-1;
+ g.copyTo(r);
+ while(--i >= 0) {
+ z.sqrTo(r,r2);
+ if((e&(1< 0) z.mulTo(r2,g,r);
+ else { var t = r; r = r2; r2 = t; }
+ }
+ return z.revert(r);
+ }
+
+ // (public) this^e % m, 0 <= e < 2^32
+ function bnModPowInt(e,m) {
+ var z;
+ if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);
+ return this.exp(e,z);
+ }
+
+ // protected
+ BigInteger.prototype.copyTo = bnpCopyTo;
+ BigInteger.prototype.fromInt = bnpFromInt;
+ BigInteger.prototype.fromString = bnpFromString;
+ BigInteger.prototype.clamp = bnpClamp;
+ BigInteger.prototype.dlShiftTo = bnpDLShiftTo;
+ BigInteger.prototype.drShiftTo = bnpDRShiftTo;
+ BigInteger.prototype.lShiftTo = bnpLShiftTo;
+ BigInteger.prototype.rShiftTo = bnpRShiftTo;
+ BigInteger.prototype.subTo = bnpSubTo;
+ BigInteger.prototype.multiplyTo = bnpMultiplyTo;
+ BigInteger.prototype.squareTo = bnpSquareTo;
+ BigInteger.prototype.divRemTo = bnpDivRemTo;
+ BigInteger.prototype.invDigit = bnpInvDigit;
+ BigInteger.prototype.isEven = bnpIsEven;
+ BigInteger.prototype.exp = bnpExp;
+
+ // public
+ BigInteger.prototype.toString = bnToString;
+ BigInteger.prototype.negate = bnNegate;
+ BigInteger.prototype.abs = bnAbs;
+ BigInteger.prototype.compareTo = bnCompareTo;
+ BigInteger.prototype.bitLength = bnBitLength;
+ BigInteger.prototype.mod = bnMod;
+ BigInteger.prototype.modPowInt = bnModPowInt;
+
+ // "constants"
+ BigInteger.ZERO = nbv(0);
+ BigInteger.ONE = nbv(1);
+
+ // Copyright (c) 2005-2009 Tom Wu
+ // All Rights Reserved.
+ // See "LICENSE" for details.
+
+ // Extended JavaScript BN functions, required for RSA private ops.
+
+ // Version 1.1: new BigInteger("0", 10) returns "proper" zero
+ // Version 1.2: square() API, isProbablePrime fix
+
+ // (public)
+ function bnClone() { var r = nbi(); this.copyTo(r); return r; }
+
+ // (public) return value as integer
+ function bnIntValue() {
+ if(this.s < 0) {
+ if(this.t == 1) return this[0]-this.DV;
+ else if(this.t == 0) return -1;
+ }
+ else if(this.t == 1) return this[0];
+ else if(this.t == 0) return 0;
+ // assumes 16 < DB < 32
+ return ((this[1]&((1<<(32-this.DB))-1))<>24; }
+
+ // (public) return value as short (assumes DB>=16)
+ function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }
+
+ // (protected) return x s.t. r^x < DV
+ function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }
+
+ // (public) 0 if this == 0, 1 if this > 0
+ function bnSigNum() {
+ if(this.s < 0) return -1;
+ else if(this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0;
+ else return 1;
+ }
+
+ // (protected) convert to radix string
+ function bnpToRadix(b) {
+ if(b == null) b = 10;
+ if(this.signum() == 0 || b < 2 || b > 36) return "0";
+ var cs = this.chunkSize(b);
+ var a = Math.pow(b,cs);
+ var d = nbv(a), y = nbi(), z = nbi(), r = "";
+ this.divRemTo(d,y,z);
+ while(y.signum() > 0) {
+ r = (a+z.intValue()).toString(b).substr(1) + r;
+ y.divRemTo(d,y,z);
+ }
+ return z.intValue().toString(b) + r;
+ }
+
+ // (protected) convert from radix string
+ function bnpFromRadix(s,b) {
+ this.fromInt(0);
+ if(b == null) b = 10;
+ var cs = this.chunkSize(b);
+ var d = Math.pow(b,cs), mi = false, j = 0, w = 0;
+ for(var i = 0; i < s.length; ++i) {
+ var x = intAt(s,i);
+ if(x < 0) {
+ if(s.charAt(i) == "-" && this.signum() == 0) mi = true;
+ continue;
+ }
+ w = b*w+x;
+ if(++j >= cs) {
+ this.dMultiply(d);
+ this.dAddOffset(w,0);
+ j = 0;
+ w = 0;
+ }
+ }
+ if(j > 0) {
+ this.dMultiply(Math.pow(b,j));
+ this.dAddOffset(w,0);
+ }
+ if(mi) BigInteger.ZERO.subTo(this,this);
+ }
+
+ // (protected) alternate constructor
+ function bnpFromNumber(a,b,c) {
+ if("number" == typeof b) {
+ // new BigInteger(int,int,RNG)
+ if(a < 2) this.fromInt(1);
+ else {
+ this.fromNumber(a,c);
+ if(!this.testBit(a-1)) // force MSB set
+ this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this);
+ if(this.isEven()) this.dAddOffset(1,0); // force odd
+ while(!this.isProbablePrime(b)) {
+ this.dAddOffset(2,0);
+ if(this.bitLength() > a) this.subTo(BigInteger.ONE.shiftLeft(a-1),this);
+ }
+ }
+ }
+ else {
+ // new BigInteger(int,RNG)
+ var x = new Array(), t = a&7;
+ x.length = (a>>3)+1;
+ b.nextBytes(x);
+ if(t > 0) x[0] &= ((1< 0) {
+ if(p < this.DB && (d = this[i]>>p) != (this.s&this.DM)>>p)
+ r[k++] = d|(this.s<<(this.DB-p));
+ while(i >= 0) {
+ if(p < 8) {
+ d = (this[i]&((1<>(p+=this.DB-8);
+ }
+ else {
+ d = (this[i]>>(p-=8))&0xff;
+ if(p <= 0) { p += this.DB; --i; }
+ }
+ if((d&0x80) != 0) d |= -256;
+ if(k == 0 && (this.s&0x80) != (d&0x80)) ++k;
+ if(k > 0 || d != this.s) r[k++] = d;
+ }
+ }
+ return r;
+ }
+
+ function bnEquals(a) { return(this.compareTo(a)==0); }
+ function bnMin(a) { return(this.compareTo(a)<0)?this:a; }
+ function bnMax(a) { return(this.compareTo(a)>0)?this:a; }
+
+ // (protected) r = this op a (bitwise)
+ function bnpBitwiseTo(a,op,r) {
+ var i, f, m = Math.min(a.t,this.t);
+ for(i = 0; i < m; ++i) r[i] = op(this[i],a[i]);
+ if(a.t < this.t) {
+ f = a.s&this.DM;
+ for(i = m; i < this.t; ++i) r[i] = op(this[i],f);
+ r.t = this.t;
+ }
+ else {
+ f = this.s&this.DM;
+ for(i = m; i < a.t; ++i) r[i] = op(f,a[i]);
+ r.t = a.t;
+ }
+ r.s = op(this.s,a.s);
+ r.clamp();
+ }
+
+ // (public) this & a
+ function op_and(x,y) { return x&y; }
+ function bnAnd(a) { var r = nbi(); this.bitwiseTo(a,op_and,r); return r; }
+
+ // (public) this | a
+ function op_or(x,y) { return x|y; }
+ function bnOr(a) { var r = nbi(); this.bitwiseTo(a,op_or,r); return r; }
+
+ // (public) this ^ a
+ function op_xor(x,y) { return x^y; }
+ function bnXor(a) { var r = nbi(); this.bitwiseTo(a,op_xor,r); return r; }
+
+ // (public) this & ~a
+ function op_andnot(x,y) { return x&~y; }
+ function bnAndNot(a) { var r = nbi(); this.bitwiseTo(a,op_andnot,r); return r; }
+
+ // (public) ~this
+ function bnNot() {
+ var r = nbi();
+ for(var i = 0; i < this.t; ++i) r[i] = this.DM&~this[i];
+ r.t = this.t;
+ r.s = ~this.s;
+ return r;
+ }
+
+ // (public) this << n
+ function bnShiftLeft(n) {
+ var r = nbi();
+ if(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);
+ return r;
+ }
+
+ // (public) this >> n
+ function bnShiftRight(n) {
+ var r = nbi();
+ if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);
+ return r;
+ }
+
+ // return index of lowest 1-bit in x, x < 2^31
+ function lbit(x) {
+ if(x == 0) return -1;
+ var r = 0;
+ if((x&0xffff) == 0) { x >>= 16; r += 16; }
+ if((x&0xff) == 0) { x >>= 8; r += 8; }
+ if((x&0xf) == 0) { x >>= 4; r += 4; }
+ if((x&3) == 0) { x >>= 2; r += 2; }
+ if((x&1) == 0) ++r;
+ return r;
+ }
+
+ // (public) returns index of lowest 1-bit (or -1 if none)
+ function bnGetLowestSetBit() {
+ for(var i = 0; i < this.t; ++i)
+ if(this[i] != 0) return i*this.DB+lbit(this[i]);
+ if(this.s < 0) return this.t*this.DB;
+ return -1;
+ }
+
+ // return number of 1 bits in x
+ function cbit(x) {
+ var r = 0;
+ while(x != 0) { x &= x-1; ++r; }
+ return r;
+ }
+
+ // (public) return number of set bits
+ function bnBitCount() {
+ var r = 0, x = this.s&this.DM;
+ for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);
+ return r;
+ }
+
+ // (public) true iff nth bit is set
+ function bnTestBit(n) {
+ var j = Math.floor(n/this.DB);
+ if(j >= this.t) return(this.s!=0);
+ return((this[j]&(1<<(n%this.DB)))!=0);
+ }
+
+ // (protected) this op (1<>= this.DB;
+ }
+ if(a.t < this.t) {
+ c += a.s;
+ while(i < this.t) {
+ c += this[i];
+ r[i++] = c&this.DM;
+ c >>= this.DB;
+ }
+ c += this.s;
+ }
+ else {
+ c += this.s;
+ while(i < a.t) {
+ c += a[i];
+ r[i++] = c&this.DM;
+ c >>= this.DB;
+ }
+ c += a.s;
+ }
+ r.s = (c<0)?-1:0;
+ if(c > 0) r[i++] = c;
+ else if(c < -1) r[i++] = this.DV+c;
+ r.t = i;
+ r.clamp();
+ }
+
+ // (public) this + a
+ function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }
+
+ // (public) this - a
+ function bnSubtract(a) { var r = nbi(); this.subTo(a,r); return r; }
+
+ // (public) this * a
+ function bnMultiply(a) { var r = nbi(); this.multiplyTo(a,r); return r; }
+
+ // (public) this^2
+ function bnSquare() { var r = nbi(); this.squareTo(r); return r; }
+
+ // (public) this / a
+ function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }
+
+ // (public) this % a
+ function bnRemainder(a) { var r = nbi(); this.divRemTo(a,null,r); return r; }
+
+ // (public) [this/a,this%a]
+ function bnDivideAndRemainder(a) {
+ var q = nbi(), r = nbi();
+ this.divRemTo(a,q,r);
+ return new Array(q,r);
+ }
+
+ // (protected) this *= n, this >= 0, 1 < n < DV
+ function bnpDMultiply(n) {
+ this[this.t] = this.am(0,n-1,this,0,0,this.t);
+ ++this.t;
+ this.clamp();
+ }
+
+ // (protected) this += n << w words, this >= 0
+ function bnpDAddOffset(n,w) {
+ if(n == 0) return;
+ while(this.t <= w) this[this.t++] = 0;
+ this[w] += n;
+ while(this[w] >= this.DV) {
+ this[w] -= this.DV;
+ if(++w >= this.t) this[this.t++] = 0;
+ ++this[w];
+ }
+ }
+
+ // A "null" reducer
+ function NullExp() {}
+ function nNop(x) { return x; }
+ function nMulTo(x,y,r) { x.multiplyTo(y,r); }
+ function nSqrTo(x,r) { x.squareTo(r); }
+
+ NullExp.prototype.convert = nNop;
+ NullExp.prototype.revert = nNop;
+ NullExp.prototype.mulTo = nMulTo;
+ NullExp.prototype.sqrTo = nSqrTo;
+
+ // (public) this^e
+ function bnPow(e) { return this.exp(e,new NullExp()); }
+
+ // (protected) r = lower n words of "this * a", a.t <= n
+ // "this" should be the larger one if appropriate.
+ function bnpMultiplyLowerTo(a,n,r) {
+ var i = Math.min(this.t+a.t,n);
+ r.s = 0; // assumes a,this >= 0
+ r.t = i;
+ while(i > 0) r[--i] = 0;
+ var j;
+ for(j = r.t-this.t; i < j; ++i) r[i+this.t] = this.am(0,a[i],r,i,0,this.t);
+ for(j = Math.min(a.t,n); i < j; ++i) this.am(0,a[i],r,i,0,n-i);
+ r.clamp();
+ }
+
+ // (protected) r = "this * a" without lower n words, n > 0
+ // "this" should be the larger one if appropriate.
+ function bnpMultiplyUpperTo(a,n,r) {
+ --n;
+ var i = r.t = this.t+a.t-n;
+ r.s = 0; // assumes a,this >= 0
+ while(--i >= 0) r[i] = 0;
+ for(i = Math.max(n-this.t,0); i < a.t; ++i)
+ r[this.t+i-n] = this.am(n-i,a[i],r,0,0,this.t+i-n);
+ r.clamp();
+ r.drShiftTo(1,r);
+ }
+
+ // Barrett modular reduction
+ function Barrett(m) {
+ // setup Barrett
+ this.r2 = nbi();
+ this.q3 = nbi();
+ BigInteger.ONE.dlShiftTo(2*m.t,this.r2);
+ this.mu = this.r2.divide(m);
+ this.m = m;
+ }
+
+ function barrettConvert(x) {
+ if(x.s < 0 || x.t > 2*this.m.t) return x.mod(this.m);
+ else if(x.compareTo(this.m) < 0) return x;
+ else { var r = nbi(); x.copyTo(r); this.reduce(r); return r; }
+ }
+
+ function barrettRevert(x) { return x; }
+
+ // x = x mod m (HAC 14.42)
+ function barrettReduce(x) {
+ x.drShiftTo(this.m.t-1,this.r2);
+ if(x.t > this.m.t+1) { x.t = this.m.t+1; x.clamp(); }
+ this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3);
+ this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);
+ while(x.compareTo(this.r2) < 0) x.dAddOffset(1,this.m.t+1);
+ x.subTo(this.r2,x);
+ while(x.compareTo(this.m) >= 0) x.subTo(this.m,x);
+ }
+
+ // r = x^2 mod m; x != r
+ function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }
+
+ // r = x*y mod m; x,y != r
+ function barrettMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }
+
+ Barrett.prototype.convert = barrettConvert;
+ Barrett.prototype.revert = barrettRevert;
+ Barrett.prototype.reduce = barrettReduce;
+ Barrett.prototype.mulTo = barrettMulTo;
+ Barrett.prototype.sqrTo = barrettSqrTo;
+
+ // (public) this^e % m (HAC 14.85)
+ function bnModPow(e,m) {
+ var i = e.bitLength(), k, r = nbv(1), z;
+ if(i <= 0) return r;
+ else if(i < 18) k = 1;
+ else if(i < 48) k = 3;
+ else if(i < 144) k = 4;
+ else if(i < 768) k = 5;
+ else k = 6;
+ if(i < 8)
+ z = new Classic(m);
+ else if(m.isEven())
+ z = new Barrett(m);
+ else
+ z = new Montgomery(m);
+
+ // precomputation
+ var g = new Array(), n = 3, k1 = k-1, km = (1< 1) {
+ var g2 = nbi();
+ z.sqrTo(g[1],g2);
+ while(n <= km) {
+ g[n] = nbi();
+ z.mulTo(g2,g[n-2],g[n]);
+ n += 2;
+ }
+ }
+
+ var j = e.t-1, w, is1 = true, r2 = nbi(), t;
+ i = nbits(e[j])-1;
+ while(j >= 0) {
+ if(i >= k1) w = (e[j]>>(i-k1))&km;
+ else {
+ w = (e[j]&((1<<(i+1))-1))<<(k1-i);
+ if(j > 0) w |= e[j-1]>>(this.DB+i-k1);
+ }
+
+ n = k;
+ while((w&1) == 0) { w >>= 1; --n; }
+ if((i -= n) < 0) { i += this.DB; --j; }
+ if(is1) { // ret == 1, don't bother squaring or multiplying it
+ g[w].copyTo(r);
+ is1 = false;
+ }
+ else {
+ while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }
+ if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }
+ z.mulTo(r2,g[w],r);
+ }
+
+ while(j >= 0 && (e[j]&(1< 0) {
+ x.rShiftTo(g,x);
+ y.rShiftTo(g,y);
+ }
+ while(x.signum() > 0) {
+ if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x);
+ if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y);
+ if(x.compareTo(y) >= 0) {
+ x.subTo(y,x);
+ x.rShiftTo(1,x);
+ }
+ else {
+ y.subTo(x,y);
+ y.rShiftTo(1,y);
+ }
+ }
+ if(g > 0) y.lShiftTo(g,y);
+ return y;
+ }
+
+ // (protected) this % n, n < 2^26
+ function bnpModInt(n) {
+ if(n <= 0) return 0;
+ var d = this.DV%n, r = (this.s<0)?n-1:0;
+ if(this.t > 0)
+ if(d == 0) r = this[0]%n;
+ else for(var i = this.t-1; i >= 0; --i) r = (d*r+this[i])%n;
+ return r;
+ }
+
+ // (public) 1/this % m (HAC 14.61)
+ function bnModInverse(m) {
+ var ac = m.isEven();
+ if((this.isEven() && ac) || m.signum() == 0) return BigInteger.ZERO;
+ var u = m.clone(), v = this.clone();
+ var a = nbv(1), b = nbv(0), c = nbv(0), d = nbv(1);
+ while(u.signum() != 0) {
+ while(u.isEven()) {
+ u.rShiftTo(1,u);
+ if(ac) {
+ if(!a.isEven() || !b.isEven()) { a.addTo(this,a); b.subTo(m,b); }
+ a.rShiftTo(1,a);
+ }
+ else if(!b.isEven()) b.subTo(m,b);
+ b.rShiftTo(1,b);
+ }
+ while(v.isEven()) {
+ v.rShiftTo(1,v);
+ if(ac) {
+ if(!c.isEven() || !d.isEven()) { c.addTo(this,c); d.subTo(m,d); }
+ c.rShiftTo(1,c);
+ }
+ else if(!d.isEven()) d.subTo(m,d);
+ d.rShiftTo(1,d);
+ }
+ if(u.compareTo(v) >= 0) {
+ u.subTo(v,u);
+ if(ac) a.subTo(c,a);
+ b.subTo(d,b);
+ }
+ else {
+ v.subTo(u,v);
+ if(ac) c.subTo(a,c);
+ d.subTo(b,d);
+ }
+ }
+ if(v.compareTo(BigInteger.ONE) != 0) return BigInteger.ZERO;
+ if(d.compareTo(m) >= 0) return d.subtract(m);
+ if(d.signum() < 0) d.addTo(m,d); else return d;
+ if(d.signum() < 0) return d.add(m); else return d;
+ }
+
+ var lowprimes = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997];
+ var lplim = (1<<26)/lowprimes[lowprimes.length-1];
+
+ // (public) test primality with certainty >= 1-.5^t
+ function bnIsProbablePrime(t) {
+ var i, x = this.abs();
+ if(x.t == 1 && x[0] <= lowprimes[lowprimes.length-1]) {
+ for(i = 0; i < lowprimes.length; ++i)
+ if(x[0] == lowprimes[i]) return true;
+ return false;
+ }
+ if(x.isEven()) return false;
+ i = 1;
+ while(i < lowprimes.length) {
+ var m = lowprimes[i], j = i+1;
+ while(j < lowprimes.length && m < lplim) m *= lowprimes[j++];
+ m = x.modInt(m);
+ while(i < j) if(m%lowprimes[i++] == 0) return false;
+ }
+ return x.millerRabin(t);
+ }
+
+ // (protected) true if probably prime (HAC 4.24, Miller-Rabin)
+ function bnpMillerRabin(t) {
+ var n1 = this.subtract(BigInteger.ONE);
+ var k = n1.getLowestSetBit();
+ if(k <= 0) return false;
+ var r = n1.shiftRight(k);
+ t = (t+1)>>1;
+ if(t > lowprimes.length) t = lowprimes.length;
+ var a = nbi();
+ for(var i = 0; i < t; ++i) {
+ //Pick bases at random, instead of starting at 2
+ a.fromInt(lowprimes[Math.floor(Math.random()*lowprimes.length)]);
+ var y = a.modPow(r,this);
+ if(y.compareTo(BigInteger.ONE) != 0 && y.compareTo(n1) != 0) {
+ var j = 1;
+ while(j++ < k && y.compareTo(n1) != 0) {
+ y = y.modPowInt(2,this);
+ if(y.compareTo(BigInteger.ONE) == 0) return false;
+ }
+ if(y.compareTo(n1) != 0) return false;
+ }
+ }
+ return true;
+ }
+
+ // protected
+ BigInteger.prototype.chunkSize = bnpChunkSize;
+ BigInteger.prototype.toRadix = bnpToRadix;
+ BigInteger.prototype.fromRadix = bnpFromRadix;
+ BigInteger.prototype.fromNumber = bnpFromNumber;
+ BigInteger.prototype.bitwiseTo = bnpBitwiseTo;
+ BigInteger.prototype.changeBit = bnpChangeBit;
+ BigInteger.prototype.addTo = bnpAddTo;
+ BigInteger.prototype.dMultiply = bnpDMultiply;
+ BigInteger.prototype.dAddOffset = bnpDAddOffset;
+ BigInteger.prototype.multiplyLowerTo = bnpMultiplyLowerTo;
+ BigInteger.prototype.multiplyUpperTo = bnpMultiplyUpperTo;
+ BigInteger.prototype.modInt = bnpModInt;
+ BigInteger.prototype.millerRabin = bnpMillerRabin;
+
+ // public
+ BigInteger.prototype.clone = bnClone;
+ BigInteger.prototype.intValue = bnIntValue;
+ BigInteger.prototype.byteValue = bnByteValue;
+ BigInteger.prototype.shortValue = bnShortValue;
+ BigInteger.prototype.signum = bnSigNum;
+ BigInteger.prototype.toByteArray = bnToByteArray;
+ BigInteger.prototype.equals = bnEquals;
+ BigInteger.prototype.min = bnMin;
+ BigInteger.prototype.max = bnMax;
+ BigInteger.prototype.and = bnAnd;
+ BigInteger.prototype.or = bnOr;
+ BigInteger.prototype.xor = bnXor;
+ BigInteger.prototype.andNot = bnAndNot;
+ BigInteger.prototype.not = bnNot;
+ BigInteger.prototype.shiftLeft = bnShiftLeft;
+ BigInteger.prototype.shiftRight = bnShiftRight;
+ BigInteger.prototype.getLowestSetBit = bnGetLowestSetBit;
+ BigInteger.prototype.bitCount = bnBitCount;
+ BigInteger.prototype.testBit = bnTestBit;
+ BigInteger.prototype.setBit = bnSetBit;
+ BigInteger.prototype.clearBit = bnClearBit;
+ BigInteger.prototype.flipBit = bnFlipBit;
+ BigInteger.prototype.add = bnAdd;
+ BigInteger.prototype.subtract = bnSubtract;
+ BigInteger.prototype.multiply = bnMultiply;
+ BigInteger.prototype.divide = bnDivide;
+ BigInteger.prototype.remainder = bnRemainder;
+ BigInteger.prototype.divideAndRemainder = bnDivideAndRemainder;
+ BigInteger.prototype.modPow = bnModPow;
+ BigInteger.prototype.modInverse = bnModInverse;
+ BigInteger.prototype.pow = bnPow;
+ BigInteger.prototype.gcd = bnGCD;
+ BigInteger.prototype.isProbablePrime = bnIsProbablePrime;
+
+ // JSBN-specific extension
+ BigInteger.prototype.square = bnSquare;
+
+ // Expose the Barrett function
+ BigInteger.prototype.Barrett = Barrett
+
+ // BigInteger interfaces not implemented in jsbn:
+
+ // BigInteger(int signum, byte[] magnitude)
+ // double doubleValue()
+ // float floatValue()
+ // int hashCode()
+ // long longValue()
+ // static BigInteger valueOf(long val)
+
+ // Random number generator - requires a PRNG backend, e.g. prng4.js
+
+ // For best results, put code like
+ //
+ // in your main HTML document.
+
+ var rng_state;
+ var rng_pool;
+ var rng_pptr;
+
+ // Mix in a 32-bit integer into the pool
+ function rng_seed_int(x) {
+ rng_pool[rng_pptr++] ^= x & 255;
+ rng_pool[rng_pptr++] ^= (x >> 8) & 255;
+ rng_pool[rng_pptr++] ^= (x >> 16) & 255;
+ rng_pool[rng_pptr++] ^= (x >> 24) & 255;
+ if(rng_pptr >= rng_psize) rng_pptr -= rng_psize;
+ }
+
+ // Mix in the current time (w/milliseconds) into the pool
+ function rng_seed_time() {
+ rng_seed_int(new Date().getTime());
+ }
+
+ // Initialize the pool with junk if needed.
+ if(rng_pool == null) {
+ rng_pool = new Array();
+ rng_pptr = 0;
+ var t;
+ if(typeof window !== "undefined" && window.crypto) {
+ if (window.crypto.getRandomValues) {
+ // Use webcrypto if available
+ var ua = new Uint8Array(32);
+ window.crypto.getRandomValues(ua);
+ for(t = 0; t < 32; ++t)
+ rng_pool[rng_pptr++] = ua[t];
+ }
+ else if(navigator.appName == "Netscape" && navigator.appVersion < "5") {
+ // Extract entropy (256 bits) from NS4 RNG if available
+ var z = window.crypto.random(32);
+ for(t = 0; t < z.length; ++t)
+ rng_pool[rng_pptr++] = z.charCodeAt(t) & 255;
+ }
+ }
+ while(rng_pptr < rng_psize) { // extract some randomness from Math.random()
+ t = Math.floor(65536 * Math.random());
+ rng_pool[rng_pptr++] = t >>> 8;
+ rng_pool[rng_pptr++] = t & 255;
+ }
+ rng_pptr = 0;
+ rng_seed_time();
+ //rng_seed_int(window.screenX);
+ //rng_seed_int(window.screenY);
+ }
+
+ function rng_get_byte() {
+ if(rng_state == null) {
+ rng_seed_time();
+ rng_state = prng_newstate();
+ rng_state.init(rng_pool);
+ for(rng_pptr = 0; rng_pptr < rng_pool.length; ++rng_pptr)
+ rng_pool[rng_pptr] = 0;
+ rng_pptr = 0;
+ //rng_pool = null;
+ }
+ // TODO: allow reseeding after first request
+ return rng_state.next();
+ }
+
+ function rng_get_bytes(ba) {
+ var i;
+ for(i = 0; i < ba.length; ++i) ba[i] = rng_get_byte();
+ }
+
+ function SecureRandom() {}
+
+ SecureRandom.prototype.nextBytes = rng_get_bytes;
+
+ // prng4.js - uses Arcfour as a PRNG
+
+ function Arcfour() {
+ this.i = 0;
+ this.j = 0;
+ this.S = new Array();
+ }
+
+ // Initialize arcfour context from key, an array of ints, each from [0..255]
+ function ARC4init(key) {
+ var i, j, t;
+ for(i = 0; i < 256; ++i)
+ this.S[i] = i;
+ j = 0;
+ for(i = 0; i < 256; ++i) {
+ j = (j + this.S[i] + key[i % key.length]) & 255;
+ t = this.S[i];
+ this.S[i] = this.S[j];
+ this.S[j] = t;
+ }
+ this.i = 0;
+ this.j = 0;
+ }
+
+ function ARC4next() {
+ var t;
+ this.i = (this.i + 1) & 255;
+ this.j = (this.j + this.S[this.i]) & 255;
+ t = this.S[this.i];
+ this.S[this.i] = this.S[this.j];
+ this.S[this.j] = t;
+ return this.S[(t + this.S[this.i]) & 255];
+ }
+
+ Arcfour.prototype.init = ARC4init;
+ Arcfour.prototype.next = ARC4next;
+
+ // Plug in your RNG constructor here
+ function prng_newstate() {
+ return new Arcfour();
+ }
+
+ // Pool size must be a multiple of 4 and greater than 32.
+ // An array of bytes the size of the pool will be passed to init()
+ var rng_psize = 256;
+
+ if (true) {
+ exports = module.exports = {
+ BigInteger: BigInteger,
+ SecureRandom: SecureRandom,
+ };
+ } else {
+ this.BigInteger = BigInteger;
+ this.SecureRandom = SecureRandom;
+ }
+
+ }).call(this);
+
+
+/***/ },
+/* 245 */
+/***/ function(module, exports, __webpack_require__) {
+
+ /**
+ * Module dependencies
+ */
+
+ var debug = __webpack_require__(236)('jsonp');
+
+ /**
+ * Module exports.
+ */
+
+ module.exports = jsonp;
+
+ /**
+ * Callback index.
+ */
+
+ var count = 0;
+
+ /**
+ * Noop function.
+ */
+
+ function noop(){}
+
+ /**
+ * JSONP handler
+ *
+ * Options:
+ * - param {String} qs parameter (`callback`)
+ * - prefix {String} qs parameter (`__jp`)
+ * - name {String} qs parameter (`prefix` + incr)
+ * - timeout {Number} how long after a timeout error is emitted (`60000`)
+ *
+ * @param {String} url
+ * @param {Object|Function} optional options / callback
+ * @param {Function} optional callback
+ */
+
+ function jsonp(url, opts, fn){
+ if ('function' == typeof opts) {
+ fn = opts;
+ opts = {};
+ }
+ if (!opts) opts = {};
+
+ var prefix = opts.prefix || '__jp';
+
+ // use the callback name that was passed if one was provided.
+ // otherwise generate a unique name by incrementing our counter.
+ var id = opts.name || (prefix + (count++));
+
+ var param = opts.param || 'callback';
+ var timeout = null != opts.timeout ? opts.timeout : 60000;
+ var enc = encodeURIComponent;
+ var target = document.getElementsByTagName('script')[0] || document.head;
+ var script;
+ var timer;
+
+
+ if (timeout) {
+ timer = setTimeout(function(){
+ cleanup();
+ if (fn) fn(new Error('Timeout'));
+ }, timeout);
+ }
+
+ function cleanup(){
+ if (script.parentNode) script.parentNode.removeChild(script);
+ window[id] = noop;
+ if (timer) clearTimeout(timer);
+ }
+
+ function cancel(){
+ if (window[id]) {
+ cleanup();
+ }
+ }
+
+ window[id] = function(data){
+ debug('jsonp got', data);
+ cleanup();
+ if (fn) fn(null, data);
+ };
+
+ // add qs component
+ url += (~url.indexOf('?') ? '&' : '?') + param + '=' + enc(id);
+ url = url.replace('?&', '?');
+
+ debug('jsonp req "%s"', url);
+
+ // create script
+ script = document.createElement('script');
+ script.src = url;
+ target.parentNode.insertBefore(script, target);
+
+ return cancel;
+ }
+
+
+/***/ },
+/* 246 */
+/***/ function(module, exports) {
+
+ /**
+ * Helpers.
+ */
+
+ var s = 1000
+ var m = s * 60
+ var h = m * 60
+ var d = h * 24
+ var y = d * 365.25
+
+ /**
+ * Parse or format the given `val`.
+ *
+ * Options:
+ *
+ * - `long` verbose formatting [false]
+ *
+ * @param {String|Number} val
+ * @param {Object} options
+ * @throws {Error} throw an error if val is not a non-empty string or a number
+ * @return {String|Number}
+ * @api public
+ */
+
+ module.exports = function (val, options) {
+ options = options || {}
+ var type = typeof val
+ if (type === 'string' && val.length > 0) {
+ return parse(val)
+ } else if (type === 'number' && isNaN(val) === false) {
+ return options.long ?
+ fmtLong(val) :
+ fmtShort(val)
+ }
+ throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val))
+ }
+
+ /**
+ * Parse the given `str` and return milliseconds.
+ *
+ * @param {String} str
+ * @return {Number}
+ * @api private
+ */
+
+ function parse(str) {
+ str = String(str)
+ if (str.length > 10000) {
+ return
+ }
+ var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str)
+ if (!match) {
+ return
+ }
+ var n = parseFloat(match[1])
+ var type = (match[2] || 'ms').toLowerCase()
+ switch (type) {
+ case 'years':
+ case 'year':
+ case 'yrs':
+ case 'yr':
+ case 'y':
+ return n * y
+ case 'days':
+ case 'day':
+ case 'd':
+ return n * d
+ case 'hours':
+ case 'hour':
+ case 'hrs':
+ case 'hr':
+ case 'h':
+ return n * h
+ case 'minutes':
+ case 'minute':
+ case 'mins':
+ case 'min':
+ case 'm':
+ return n * m
+ case 'seconds':
+ case 'second':
+ case 'secs':
+ case 'sec':
+ case 's':
+ return n * s
+ case 'milliseconds':
+ case 'millisecond':
+ case 'msecs':
+ case 'msec':
+ case 'ms':
+ return n
+ default:
+ return undefined
+ }
+ }
+
+ /**
+ * Short format for `ms`.
+ *
+ * @param {Number} ms
+ * @return {String}
+ * @api private
+ */
+
+ function fmtShort(ms) {
+ if (ms >= d) {
+ return Math.round(ms / d) + 'd'
+ }
+ if (ms >= h) {
+ return Math.round(ms / h) + 'h'
+ }
+ if (ms >= m) {
+ return Math.round(ms / m) + 'm'
+ }
+ if (ms >= s) {
+ return Math.round(ms / s) + 's'
+ }
+ return ms + 'ms'
+ }
+
+ /**
+ * Long format for `ms`.
+ *
+ * @param {Number} ms
+ * @return {String}
+ * @api private
+ */
+
+ function fmtLong(ms) {
+ return plural(ms, d, 'day') ||
+ plural(ms, h, 'hour') ||
+ plural(ms, m, 'minute') ||
+ plural(ms, s, 'second') ||
+ ms + ' ms'
+ }
+
+ /**
+ * Pluralization helper.
+ */
+
+ function plural(ms, n, name) {
+ if (ms < n) {
+ return
+ }
+ if (ms < n * 1.5) {
+ return Math.floor(ms / n) + ' ' + name
+ }
+ return Math.ceil(ms / n) + ' ' + name + 's'
+ }
+
+
+/***/ },
+/* 247 */
+/***/ function(module, exports, __webpack_require__) {
+
+ var format = __webpack_require__(101).format;
+
+ var PasswordPolicyError = __webpack_require__(248);
+
+ function isString(value) {
+ return typeof value === 'string' || value instanceof String;
+ }
+
+ var defaultRuleset = {
+ length: __webpack_require__(251),
+ contains: __webpack_require__(77),
+ containsAtLeast: __webpack_require__(249),
+ identicalChars: __webpack_require__(250),
+ };
+
+ function flatDescriptions (descriptions, index) {
+ if (!descriptions.length) {
+ return '';
+ }
+
+ function flatSingleDescription (description, index) {
+ var spaces = (new Array(index+1)).join(' ');
+ var result = spaces + '* ';
+ if (description.format) {
+ result += format.apply(null, [description.message].concat(description.format));
+ } else {
+ result += description.message;
+ }
+
+ if (description.items) {
+ result += '\n' + spaces + flatDescriptions(description.items, index + 1);
+ }
+ return result;
+ }
+
+ var firstDescription = flatSingleDescription(descriptions[0], index);
+
+ descriptions = descriptions.slice(1).reduce(function (result, description) {
+ result += '\n' + flatSingleDescription(description, index);
+
+ return result;
+ }, firstDescription);
+
+ return descriptions;
+ }
+
+ /**
+ * Creates a PasswordPolicy which is a set of rules.
+ *
+ * @class PasswordPolicy
+ * @constructor
+ */
+ function PasswordPolicy(rules, ruleset) {
+ this.rules = rules;
+ this.ruleset = ruleset || defaultRuleset;
+
+ this._reduce(function (result, ruleOptions, rule) {
+ rule.validate(ruleOptions);
+ });
+ }
+
+ PasswordPolicy.prototype = {};
+
+ PasswordPolicy.prototype._reduce = function (fn, value) {
+ var self = this;
+ return Object.keys(this.rules).reduce(function (result, ruleName) {
+ var ruleOptions = self.rules[ruleName];
+ var rule = self.ruleset[ruleName];
+
+ return fn(result, ruleOptions, rule);
+
+ }, value);
+ };
+
+ PasswordPolicy.prototype._applyRules = function (password) {
+ return this._reduce(function (result, ruleOptions, rule) {
+ // If previous result was false as this an &&, then nothing to do here!
+ if (!result) {
+ return false;
+ }
+
+ if (!rule) {
+ return false;
+ }
+
+ return rule.assert(ruleOptions, password);
+ }, true);
+ };
+
+ PasswordPolicy.prototype.missing = function (password) {
+ return this._reduce(function (result, ruleOptions, rule) {
+ var missingRule = rule.missing(ruleOptions, password);
+ result.rules.push(missingRule);
+ result.verified = result.verified && !!missingRule.verified;
+ return result;
+ }, {rules: [], verified: true});
+ };
+
+ PasswordPolicy.prototype.explain = function () {
+ return this._reduce(function (result, ruleOptions, rule) {
+ result.push(rule.explain(ruleOptions));
+ return result;
+ }, []);
+ };
+
+ PasswordPolicy.prototype.missingAsMarkdown = function (password) {
+ return flatDescriptions(this.missing(password), 1);
+ };
+
+ PasswordPolicy.prototype.toString = function () {
+ var descriptions = this.explain();
+ return flatDescriptions(descriptions, 0);
+ };
+
+ PasswordPolicy.prototype.check = function (password) {
+ if (!isString(password)) {
+ return false;
+ }
+
+ return this._applyRules(password);
+ };
+
+ PasswordPolicy.prototype.assert = function (password) {
+ if (!this.check(password)) {
+ throw new PasswordPolicyError('Password does not meet password policy');
+ }
+ };
+
+ module.exports = PasswordPolicy;
+
+
+/***/ },
+/* 248 */
+/***/ function(module, exports) {
+
+ /**
+ * Error thrown when asserting a policy against a password.
+ *
+ * @class PasswordPolicyError
+ * @constructor
+ *
+ * @param {String} msg Descriptive message of the error
+ */
+ function PasswordPolicyError(msg) {
+ var err = Error.call(this, msg);
+ err.name = 'PasswordPolicyError';
+ return err;
+ }
+
+ module.exports = PasswordPolicyError;
+
+
+/***/ },
+/* 249 */
+/***/ function(module, exports, __webpack_require__) {
+
+ var _ = __webpack_require__(64);
+
+ var contains = __webpack_require__(77);
+
+ function createIntroMessage() {
+ return 'Contain at least %d of the following %d types of characters:';
+ }
+
+ module.exports = {
+ // TODO validate atLeast to be a number > 0 and expressions to be a list of at least 1
+ validate: function (options) {
+ if (!_.isObject(options)) {
+ throw new Error('options should be an object');
+ }
+
+ if (!_.isNumber(options.atLeast) || _.isNaN(options.atLeast) || options.atLeast < 1) {
+ throw new Error('atLeast should be a valid, non-NaN number, greater than 0');
+ }
+
+ if (!_.isArray(options.expressions) || _.isEmpty(options.expressions)) {
+ throw new Error('expressions should be an non-empty array');
+ }
+
+ if (options.expressions.length < options.atLeast) {
+ throw new Error('expressions length should be greater than atLeast');
+ }
+
+ var ok = options.expressions.every(function (expression) {
+ return _.isFunction(expression.explain) && _.isFunction(expression.test);
+ });
+
+ if (!ok) {
+ throw new Error('containsAtLeast expressions are invalid: An explain and a test function should be provided');
+ }
+
+ return true;
+ },
+ explain: function (options) {
+ return {
+ message: createIntroMessage(),
+ code: 'containsAtLeast',
+ format: [options.atLeast, options.expressions.length],
+ items: options.expressions.map(function (x) { return x.explain(); })
+ };
+ },
+ missing: function (options, password) {
+ var expressions = options.expressions && options.expressions.map(function (expression) {
+ var explained = expression.explain();
+ explained.verified = expression.test(password);
+ return explained;
+ });
+
+ var verifiedCount = expressions.reduce(function (val, ex) { return val + !!ex.verified; }, 0);
+ var verified = verifiedCount >= options.atLeast;
+
+ return {
+ message: createIntroMessage(),
+ code: 'containsAtLeast',
+ format: [options.atLeast, options.expressions.length],
+ items: expressions,
+ verified: verified
+ };
+ },
+ assert: function (options, password) {
+ if (!password) {
+ return false;
+ }
+
+ var workingExpressions = options.expressions.filter(function (expression) {
+ return expression.test(password);
+ });
+
+ return workingExpressions.length >= options.atLeast;
+ },
+ charsets: contains.charsets
+ };
+
+
+/***/ },
+/* 250 */
+/***/ function(module, exports, __webpack_require__) {
+
+ var _ = __webpack_require__(64);
+
+ function assert(options, password) {
+ if (!password) {
+ return false;
+ }
+
+ var i, current = {c: null, count: 0};
+
+ for (i = 0; i < password.length; i++) {
+ if (current.c !== password[i]) {
+ current.c = password[i];
+ current.count = 1;
+ } else {
+ current.count++;
+ }
+
+ if (current.count > options.max) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+ function explain (options, verified) {
+ var example = (new Array(options.max+2)).join('a');
+ var d = {
+ message: 'No more than %d identical characters in a row (e.g., "%s" not allowed)',
+ code: 'identicalChars',
+ format: [options.max, example]
+ };
+ if (verified !== undefined) {
+ d.verified = verified;
+ }
+ return d;
+ }
+
+ module.exports = {
+ validate: function (options) {
+ if (!_.isObject(options)) {
+ throw new Error('options should be an object');
+ }
+
+ if (!_.isNumber(options.max) || _.isNaN(options.max) || options.max < 1 ) {
+ throw new Error('max should be a number greater than 1');
+ }
+
+ return true;
+ },
+ explain: explain,
+ missing: function (options, password) {
+ return explain(options, assert(options, password));
+ },
+ assert: assert
+ };
+
+
+/***/ },
+/* 251 */
+/***/ function(module, exports, __webpack_require__) {
+
+ var _ = __webpack_require__(64);
+
+ /* A rule should contain explain and rule methods */
+ // TODO explain explain
+ // TODO explain missing
+ // TODO explain assert
+
+ function assert (options, password) {
+ return !!password && options.minLength <= password.length;
+ }
+
+ function explain(options) {
+ if (options.minLength === 1) {
+ return {
+ message: 'Non-empty password required',
+ code: 'nonEmpty'
+ };
+ }
+
+ return {
+ message: 'At least %d characters in length',
+ format: [options.minLength],
+ code: 'lengthAtLeast'
+ };
+ }
+
+ module.exports = {
+ validate: function (options) {
+ if (!_.isObject(options)) {
+ throw new Error('options should be an object');
+ }
+
+ if (!_.isNumber(options.minLength) || _.isNaN(options.minLength)) {
+ throw new Error('length expects minLength to be a non-zero number');
+ }
+
+ return true;
+ },
+ explain: explain,
+ missing: function (options, password) {
+ var explained = explain(options);
+ explained.verified = !!assert(options, password);
+ return explained;
+ },
+ assert: assert
+ };
+
+
+/***/ },
+/* 252 */
+/***/ function(module, exports, __webpack_require__) {
+
+ module.exports = __webpack_require__(329);
+
+/***/ },
+/* 253 */
+/***/ function(module, exports) {
+
+ /**
+ * Copyright 2013-present, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ *
+ */
+
+ 'use strict';
+
+ var ARIADOMPropertyConfig = {
+ Properties: {
+ // Global States and Properties
+ 'aria-current': 0, // state
+ 'aria-details': 0,
+ 'aria-disabled': 0, // state
+ 'aria-hidden': 0, // state
+ 'aria-invalid': 0, // state
+ 'aria-keyshortcuts': 0,
+ 'aria-label': 0,
+ 'aria-roledescription': 0,
+ // Widget Attributes
+ 'aria-autocomplete': 0,
+ 'aria-checked': 0,
+ 'aria-expanded': 0,
+ 'aria-haspopup': 0,
+ 'aria-level': 0,
+ 'aria-modal': 0,
+ 'aria-multiline': 0,
+ 'aria-multiselectable': 0,
+ 'aria-orientation': 0,
+ 'aria-placeholder': 0,
+ 'aria-pressed': 0,
+ 'aria-readonly': 0,
+ 'aria-required': 0,
+ 'aria-selected': 0,
+ 'aria-sort': 0,
+ 'aria-valuemax': 0,
+ 'aria-valuemin': 0,
+ 'aria-valuenow': 0,
+ 'aria-valuetext': 0,
+ // Live Region Attributes
+ 'aria-atomic': 0,
+ 'aria-busy': 0,
+ 'aria-live': 0,
+ 'aria-relevant': 0,
+ // Drag-and-Drop Attributes
+ 'aria-dropeffect': 0,
+ 'aria-grabbed': 0,
+ // Relationship Attributes
+ 'aria-activedescendant': 0,
+ 'aria-colcount': 0,
+ 'aria-colindex': 0,
+ 'aria-colspan': 0,
+ 'aria-controls': 0,
+ 'aria-describedby': 0,
+ 'aria-errormessage': 0,
+ 'aria-flowto': 0,
+ 'aria-labelledby': 0,
+ 'aria-owns': 0,
+ 'aria-posinset': 0,
+ 'aria-rowcount': 0,
+ 'aria-rowindex': 0,
+ 'aria-rowspan': 0,
+ 'aria-setsize': 0
+ },
+ DOMAttributeNames: {},
+ DOMPropertyNames: {}
+ };
+
+ module.exports = ARIADOMPropertyConfig;
+
+/***/ },
+/* 254 */
+/***/ function(module, exports, __webpack_require__) {
+
+ /**
+ * Copyright 2013-present, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ *
+ */
+
+ 'use strict';
+
+ var ReactDOMComponentTree = __webpack_require__(7);
+
+ var focusNode = __webpack_require__(152);
+
+ var AutoFocusUtils = {
+ focusDOMComponent: function () {
+ focusNode(ReactDOMComponentTree.getNodeFromInstance(this));
+ }
+ };
+
+ module.exports = AutoFocusUtils;
+
+/***/ },
+/* 255 */
+/***/ function(module, exports, __webpack_require__) {
+
+ /**
+ * Copyright 2013-present Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ *
+ */
+
+ 'use strict';
+
+ var EventPropagators = __webpack_require__(48);
+ var ExecutionEnvironment = __webpack_require__(12);
+ var FallbackCompositionState = __webpack_require__(261);
+ var SyntheticCompositionEvent = __webpack_require__(297);
+ var SyntheticInputEvent = __webpack_require__(300);
+
+ 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;
+
+/***/ },
+/* 256 */
+/***/ function(module, exports, __webpack_require__) {
+
+ /**
+ * Copyright 2013-present, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ *
+ */
+
+ 'use strict';
+
+ var CSSProperty = __webpack_require__(128);
+ var ExecutionEnvironment = __webpack_require__(12);
+ var ReactInstrumentation = __webpack_require__(14);
+
+ var camelizeStyleName = __webpack_require__(316);
+ var dangerousStyleValue = __webpack_require__(306);
+ var hyphenateStyleName = __webpack_require__(323);
+ var memoizeStringOnly = __webpack_require__(326);
+ var warning = __webpack_require__(6);
+
+ 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;
+
+/***/ },
+/* 257 */
+/***/ function(module, exports, __webpack_require__) {
+
+ /**
+ * Copyright 2013-present, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ *
+ */
+
+ 'use strict';
+
+ var EventPluginHub = __webpack_require__(47);
+ var EventPropagators = __webpack_require__(48);
+ var ExecutionEnvironment = __webpack_require__(12);
+ var ReactDOMComponentTree = __webpack_require__(7);
+ var ReactUpdates = __webpack_require__(19);
+ var SyntheticEvent = __webpack_require__(23);
+
+ var getEventTarget = __webpack_require__(90);
+ var isEventSupported = __webpack_require__(91);
+ var isTextInputElement = __webpack_require__(147);
+
+ var eventTypes = {
+ change: {
+ phasedRegistrationNames: {
+ bubbled: 'onChange',
+ captured: 'onChangeCapture'
+ },
+ dependencies: ['topBlur', 'topChange', 'topClick', 'topFocus', 'topInput', 'topKeyDown', 'topKeyUp', 'topSelectionChange']
+ }
+ };
+
+ /**
+ * For IE shims
+ */
+ var activeElement = null;
+ var activeElementInst = null;
+ var activeElementValue = null;
+ var activeElementValueProp = null;
+
+ /**
+ * SECTION: handle `change` event
+ */
+ function shouldUseChangeEvent(elem) {
+ var nodeName = elem.nodeName && elem.nodeName.toLowerCase();
+ return nodeName === 'select' || nodeName === 'input' && elem.type === 'file';
+ }
+
+ var doesChangeEventBubble = false;
+ if (ExecutionEnvironment.canUseDOM) {
+ // See `handleChange` comment below
+ doesChangeEventBubble = isEventSupported('change') && (!document.documentMode || document.documentMode > 8);
+ }
+
+ function manualDispatchChangeEvent(nativeEvent) {
+ var event = SyntheticEvent.getPooled(eventTypes.change, activeElementInst, nativeEvent, getEventTarget(nativeEvent));
+ EventPropagators.accumulateTwoPhaseDispatches(event);
+
+ // If change and propertychange bubbled, we'd just bind to it like all the
+ // other events and have it go through ReactBrowserEventEmitter. Since it
+ // doesn't, we manually listen for the events and so we have to enqueue and
+ // process the abstract event manually.
+ //
+ // Batching is necessary here in order to ensure that all event handlers run
+ // before the next rerender (including event handlers attached to ancestor
+ // elements instead of directly on the input). Without this, controlled
+ // components don't work properly in conjunction with event bubbling because
+ // the component is rerendered and the value reverted before all the event
+ // handlers can run. See https://github.com/facebook/react/issues/708.
+ ReactUpdates.batchedUpdates(runEventInBatch, event);
+ }
+
+ function runEventInBatch(event) {
+ EventPluginHub.enqueueEvents(event);
+ EventPluginHub.processEventQueue(false);
+ }
+
+ function startWatchingForChangeEventIE8(target, targetInst) {
+ activeElement = target;
+ activeElementInst = targetInst;
+ activeElement.attachEvent('onchange', manualDispatchChangeEvent);
+ }
+
+ function stopWatchingForChangeEventIE8() {
+ if (!activeElement) {
+ return;
+ }
+ activeElement.detachEvent('onchange', manualDispatchChangeEvent);
+ activeElement = null;
+ activeElementInst = null;
+ }
+
+ function getTargetInstForChangeEvent(topLevelType, targetInst) {
+ if (topLevelType === 'topChange') {
+ return targetInst;
+ }
+ }
+ function handleEventsForChangeEventIE8(topLevelType, target, targetInst) {
+ if (topLevelType === 'topFocus') {
+ // stopWatching() should be a noop here but we call it just in case we
+ // missed a blur event somehow.
+ stopWatchingForChangeEventIE8();
+ startWatchingForChangeEventIE8(target, targetInst);
+ } else if (topLevelType === 'topBlur') {
+ stopWatchingForChangeEventIE8();
+ }
+ }
+
+ /**
+ * SECTION: handle `input` event
+ */
+ var isInputEventSupported = false;
+ if (ExecutionEnvironment.canUseDOM) {
+ // IE9 claims to support the input event but fails to trigger it when
+ // deleting text, so we ignore its input events.
+ // IE10+ fire input events to often, such when a placeholder
+ // changes or when an input with a placeholder is focused.
+ isInputEventSupported = isEventSupported('input') && (!document.documentMode || document.documentMode > 11);
+ }
+
+ /**
+ * (For IE <=11) Replacement getter/setter for the `value` property that gets
+ * set on the active element.
+ */
+ var newValueProp = {
+ get: function () {
+ return activeElementValueProp.get.call(this);
+ },
+ set: function (val) {
+ // Cast to a string so we can do equality checks.
+ activeElementValue = '' + val;
+ activeElementValueProp.set.call(this, val);
+ }
+ };
+
+ /**
+ * (For IE <=11) Starts tracking propertychange events on the passed-in element
+ * and override the value property so that we can distinguish user events from
+ * value changes in JS.
+ */
+ function startWatchingForValueChange(target, targetInst) {
+ activeElement = target;
+ activeElementInst = targetInst;
+ activeElementValue = target.value;
+ activeElementValueProp = Object.getOwnPropertyDescriptor(target.constructor.prototype, 'value');
+
+ // Not guarded in a canDefineProperty check: IE8 supports defineProperty only
+ // on DOM elements
+ Object.defineProperty(activeElement, 'value', newValueProp);
+ if (activeElement.attachEvent) {
+ activeElement.attachEvent('onpropertychange', handlePropertyChange);
+ } else {
+ activeElement.addEventListener('propertychange', handlePropertyChange, false);
+ }
+ }
+
+ /**
+ * (For IE <=11) Removes the event listeners from the currently-tracked element,
+ * if any exists.
+ */
+ function stopWatchingForValueChange() {
+ if (!activeElement) {
+ return;
+ }
+
+ // delete restores the original property definition
+ delete activeElement.value;
+
+ if (activeElement.detachEvent) {
+ activeElement.detachEvent('onpropertychange', handlePropertyChange);
+ } else {
+ activeElement.removeEventListener('propertychange', handlePropertyChange, false);
+ }
+
+ activeElement = null;
+ activeElementInst = null;
+ activeElementValue = null;
+ activeElementValueProp = null;
+ }
+
+ /**
+ * (For IE <=11) Handles a propertychange event, sending a `change` event if
+ * the value of the active element has changed.
+ */
+ function handlePropertyChange(nativeEvent) {
+ if (nativeEvent.propertyName !== 'value') {
+ return;
+ }
+ var value = nativeEvent.srcElement.value;
+ if (value === activeElementValue) {
+ return;
+ }
+ activeElementValue = value;
+
+ manualDispatchChangeEvent(nativeEvent);
+ }
+
+ /**
+ * If a `change` event should be fired, returns the target's ID.
+ */
+ function getTargetInstForInputEvent(topLevelType, targetInst) {
+ if (topLevelType === 'topInput') {
+ // In modern browsers (i.e., not IE8 or IE9), the input event is exactly
+ // what we want so fall through here and trigger an abstract event
+ return targetInst;
+ }
+ }
+
+ function handleEventsForInputEventIE(topLevelType, target, targetInst) {
+ if (topLevelType === 'topFocus') {
+ // In IE8, we can capture almost all .value changes by adding a
+ // propertychange handler and looking for events with propertyName
+ // equal to 'value'
+ // In IE9-11, propertychange fires for most input events but is buggy and
+ // doesn't fire when text is deleted, but conveniently, selectionchange
+ // appears to fire in all of the remaining cases so we catch those and
+ // forward the event if the value has changed
+ // In either case, we don't want to call the event handler if the value
+ // is changed from JS so we redefine a setter for `.value` that updates
+ // our activeElementValue variable, allowing us to ignore those changes
+ //
+ // stopWatching() should be a noop here but we call it just in case we
+ // missed a blur event somehow.
+ stopWatchingForValueChange();
+ startWatchingForValueChange(target, targetInst);
+ } else if (topLevelType === 'topBlur') {
+ stopWatchingForValueChange();
+ }
+ }
+
+ // For IE8 and IE9.
+ function getTargetInstForInputEventIE(topLevelType, targetInst) {
+ if (topLevelType === 'topSelectionChange' || topLevelType === 'topKeyUp' || topLevelType === 'topKeyDown') {
+ // On the selectionchange event, the target is just document which isn't
+ // helpful for us so just check activeElement instead.
+ //
+ // 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire
+ // propertychange on the first input event after setting `value` from a
+ // script and fires only keydown, keypress, keyup. Catching keyup usually
+ // gets it and catching keydown lets us fire an event for the first
+ // keystroke if user does a key repeat (it'll be a little delayed: right
+ // before the second keystroke). Other input methods (e.g., paste) seem to
+ // fire selectionchange normally.
+ if (activeElement && activeElement.value !== activeElementValue) {
+ activeElementValue = activeElement.value;
+ return activeElementInst;
+ }
+ }
+ }
+
+ /**
+ * SECTION: handle `click` event
+ */
+ function shouldUseClickEvent(elem) {
+ // Use the `click` event to detect changes to checkbox and radio inputs.
+ // This approach works across all browsers, whereas `change` does not fire
+ // until `blur` in IE8.
+ return elem.nodeName && elem.nodeName.toLowerCase() === 'input' && (elem.type === 'checkbox' || elem.type === 'radio');
+ }
+
+ function getTargetInstForClickEvent(topLevelType, targetInst) {
+ if (topLevelType === 'topClick') {
+ return targetInst;
+ }
+ }
+
+ /**
+ * This plugin creates an `onChange` event that normalizes change events
+ * across form elements. This event fires at a time when it's possible to
+ * change the element's value without seeing a flicker.
+ *
+ * Supported elements are:
+ * - input (see `isTextInputElement`)
+ * - textarea
+ * - select
+ */
+ var ChangeEventPlugin = {
+
+ eventTypes: eventTypes,
+
+ extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
+ var targetNode = targetInst ? ReactDOMComponentTree.getNodeFromInstance(targetInst) : window;
+
+ var getTargetInstFunc, handleEventFunc;
+ if (shouldUseChangeEvent(targetNode)) {
+ if (doesChangeEventBubble) {
+ getTargetInstFunc = getTargetInstForChangeEvent;
+ } else {
+ handleEventFunc = handleEventsForChangeEventIE8;
+ }
+ } else if (isTextInputElement(targetNode)) {
+ if (isInputEventSupported) {
+ getTargetInstFunc = getTargetInstForInputEvent;
+ } else {
+ getTargetInstFunc = getTargetInstForInputEventIE;
+ handleEventFunc = handleEventsForInputEventIE;
+ }
+ } else if (shouldUseClickEvent(targetNode)) {
+ getTargetInstFunc = getTargetInstForClickEvent;
+ }
+
+ if (getTargetInstFunc) {
+ var inst = getTargetInstFunc(topLevelType, targetInst);
+ if (inst) {
+ var event = SyntheticEvent.getPooled(eventTypes.change, inst, nativeEvent, nativeEventTarget);
+ event.type = 'change';
+ EventPropagators.accumulateTwoPhaseDispatches(event);
+ return event;
+ }
+ }
+
+ if (handleEventFunc) {
+ handleEventFunc(topLevelType, targetNode, targetInst);
+ }
+ }
+
+ };
+
+ module.exports = ChangeEventPlugin;
+
+/***/ },
+/* 258 */
+/***/ function(module, exports, __webpack_require__) {
+
+ /**
+ * Copyright 2013-present, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ *
+ */
+
+ 'use strict';
+
+ var _prodInvariant = __webpack_require__(4);
+
+ var DOMLazyTree = __webpack_require__(38);
+ var ExecutionEnvironment = __webpack_require__(12);
+
+ var createNodesFromMarkup = __webpack_require__(319);
+ var emptyFunction = __webpack_require__(24);
+ var invariant = __webpack_require__(3);
+
+ 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 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;
+
+/***/ },
+/* 259 */
+/***/ function(module, exports) {
+
+ /**
+ * Copyright 2013-present, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ *
+ */
+
+ 'use strict';
+
+ /**
+ * Module that is injectable into `EventPluginHub`, that specifies a
+ * deterministic ordering of `EventPlugin`s. A convenient way to reason about
+ * plugins, without having to package every one of them. This is better than
+ * having plugins be ordered in the same order that they are injected because
+ * that ordering would be influenced by the packaging order.
+ * `ResponderEventPlugin` must occur before `SimpleEventPlugin` so that
+ * preventing default on events is convenient in `SimpleEventPlugin` handlers.
+ */
+
+ var DefaultEventPluginOrder = ['ResponderEventPlugin', 'SimpleEventPlugin', 'TapEventPlugin', 'EnterLeaveEventPlugin', 'ChangeEventPlugin', 'SelectEventPlugin', 'BeforeInputEventPlugin'];
+
+ module.exports = DefaultEventPluginOrder;
+
+/***/ },
+/* 260 */
+/***/ function(module, exports, __webpack_require__) {
+
+ /**
+ * Copyright 2013-present, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ *
+ */
+
+ 'use strict';
+
+ var EventPropagators = __webpack_require__(48);
+ var ReactDOMComponentTree = __webpack_require__(7);
+ var SyntheticMouseEvent = __webpack_require__(59);
+
+ 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;
+
+/***/ },
+/* 261 */
+/***/ function(module, exports, __webpack_require__) {
+
+ /**
+ * Copyright 2013-present, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ *
+ */
+
+ 'use strict';
+
+ var _assign = __webpack_require__(5);
+
+ var PooledClass = __webpack_require__(31);
+
+ var getTextContentAccessor = __webpack_require__(144);
+
+ /**
+ * 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;
+
+/***/ },
+/* 262 */
+/***/ function(module, exports, __webpack_require__) {
+
+ /**
+ * Copyright 2013-present, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ *
+ */
+
+ 'use strict';
+
+ var DOMProperty = __webpack_require__(39);
+
+ 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 `` 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- tags
+ type: 0,
+ useMap: 0,
+ value: 0,
+ width: 0,
+ wmode: 0,
+ wrap: 0,
+
+ /**
+ * RDFa Properties
+ */
+ about: 0,
+ datatype: 0,
+ inlist: 0,
+ prefix: 0,
+ // property is also supported for OpenGraph in meta tags.
+ property: 0,
+ resource: 0,
+ 'typeof': 0,
+ vocab: 0,
+
+ /**
+ * Non-standard Properties
+ */
+ // autoCapitalize and autoCorrect are supported in Mobile Safari for
+ // keyboard hints.
+ autoCapitalize: 0,
+ autoCorrect: 0,
+ // autoSave allows WebKit/Blink to persist values of input fields on page reloads
+ autoSave: 0,
+ // color is for Safari mask-icon link
+ color: 0,
+ // itemProp, itemScope, itemType are for
+ // Microdata support. See http://schema.org/docs/gs.html
+ itemProp: 0,
+ itemScope: HAS_BOOLEAN_VALUE,
+ itemType: 0,
+ // itemID and itemRef are for Microdata support as well but
+ // only specified in the WHATWG spec document. See
+ // https://html.spec.whatwg.org/multipage/microdata.html#microdata-dom-api
+ itemID: 0,
+ itemRef: 0,
+ // results show looking glass icon and recent searches on input
+ // search fields in WebKit/Blink
+ results: 0,
+ // IE-only attribute that specifies security restrictions on an iframe
+ // as an alternative to the sandbox attribute on IE<10
+ security: 0,
+ // IE-only attribute that controls focus behavior
+ unselectable: 0
+ },
+ DOMAttributeNames: {
+ acceptCharset: 'accept-charset',
+ className: 'class',
+ htmlFor: 'for',
+ httpEquiv: 'http-equiv'
+ },
+ DOMPropertyNames: {}
+ };
+
+ module.exports = HTMLDOMPropertyConfig;
+
+/***/ },
+/* 263 */
+/***/ function(module, exports, __webpack_require__) {
+
+ /* WEBPACK VAR INJECTION */(function(process) {/**
+ * Copyright 2014-present, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ *
+ */
+
+ 'use strict';
+
+ var ReactReconciler = __webpack_require__(40);
+
+ var instantiateReactComponent = __webpack_require__(146);
+ var KeyEscapeUtils = __webpack_require__(82);
+ var shouldUpdateReactComponent = __webpack_require__(92);
+ var traverseAllChildren = __webpack_require__(149);
+ var warning = __webpack_require__(6);
+
+ var ReactComponentTreeHook;
+
+ if (typeof process !== 'undefined' && ({"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__(96);
+ }
+
+ 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)))
+
+/***/ },
+/* 264 */
+/***/ function(module, exports, __webpack_require__) {
+
+ /**
+ * Copyright 2013-present, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ *
+ */
+
+ 'use strict';
+
+ var DOMChildrenOperations = __webpack_require__(78);
+ var ReactDOMIDOperations = __webpack_require__(270);
+
+ /**
+ * 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;
+
+/***/ },
+/* 265 */
+/***/ function(module, exports, __webpack_require__) {
+
+ /**
+ * Copyright 2013-present, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ *
+ */
+
+ 'use strict';
+
+ var _prodInvariant = __webpack_require__(4),
+ _assign = __webpack_require__(5);
+
+ var React = __webpack_require__(25);
+ var ReactComponentEnvironment = __webpack_require__(84);
+ var ReactCurrentOwner = __webpack_require__(26);
+ var ReactErrorUtils = __webpack_require__(85);
+ var ReactInstanceMap = __webpack_require__(49);
+ var ReactInstrumentation = __webpack_require__(14);
+ var ReactNodeTypes = __webpack_require__(139);
+ var ReactReconciler = __webpack_require__(40);
+
+ if (false) {
+ var checkReactTypeSpec = require('./checkReactTypeSpec');
+ }
+
+ var emptyObject = __webpack_require__(151);
+ var invariant = __webpack_require__(3);
+ var shallowEqual = __webpack_require__(94);
+ var shouldUpdateReactComponent = __webpack_require__(92);
+ var warning = __webpack_require__(6);
+
+ 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, 'childContext');
+ }
+ 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;
+
+/***/ },
+/* 266 */
+/***/ 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.
+ *
+ */
+
+ /* global hasOwnProperty:true */
+
+ 'use strict';
+
+ var _prodInvariant = __webpack_require__(4),
+ _assign = __webpack_require__(5);
+
+ var AutoFocusUtils = __webpack_require__(254);
+ var CSSPropertyOperations = __webpack_require__(256);
+ var DOMLazyTree = __webpack_require__(38);
+ var DOMNamespaces = __webpack_require__(79);
+ var DOMProperty = __webpack_require__(39);
+ var DOMPropertyOperations = __webpack_require__(130);
+ var EventPluginHub = __webpack_require__(47);
+ var EventPluginRegistry = __webpack_require__(80);
+ var ReactBrowserEventEmitter = __webpack_require__(58);
+ var ReactDOMComponentFlags = __webpack_require__(132);
+ var ReactDOMComponentTree = __webpack_require__(7);
+ var ReactDOMInput = __webpack_require__(271);
+ var ReactDOMOption = __webpack_require__(272);
+ var ReactDOMSelect = __webpack_require__(133);
+ var ReactDOMTextarea = __webpack_require__(275);
+ var ReactInstrumentation = __webpack_require__(14);
+ var ReactMultiChild = __webpack_require__(284);
+ var ReactServerRenderingTransaction = __webpack_require__(289);
+
+ var emptyFunction = __webpack_require__(24);
+ var escapeTextContentForBrowser = __webpack_require__(61);
+ var invariant = __webpack_require__(3);
+ var isEventSupported = __webpack_require__(91);
+ var shallowEqual = __webpack_require__(94);
+ var validateDOMNesting = __webpack_require__(93);
+ var warning = __webpack_require__(6);
+
+ 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:
+ // See:
+ // See:
+ // See: Parsing of "textarea" "listing" and "pre" elements
+ // from
+ 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':
+ //